From 88de5784428bec9a4b32bdf447c160da29b3745e Mon Sep 17 00:00:00 2001 From: Camil Staps Date: Mon, 4 Jan 2021 20:27:45 +0100 Subject: Make up to date --- silc.icl | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'silc.icl') diff --git a/silc.icl b/silc.icl index 4a5ceea..cd748fe 100644 --- a/silc.icl +++ b/silc.icl @@ -5,6 +5,7 @@ import StdChar import StdFile from StdFunc import o, seq import StdList +import StdMaybe import StdOverloaded import StdString import StdTuple @@ -38,7 +39,7 @@ from Sil.Util.Printer import :: PrintState, instance zero PrintState, , compile :: Bool , generate :: Bool , help :: Bool - , inputfile :: Maybe String + , inputfile :: ?String } instance zero CLI @@ -49,7 +50,7 @@ where , compile = True , generate = True , help = False - , inputfile = Nothing + , inputfile = ?None } Start w @@ -64,7 +65,7 @@ Start w | args.help # io = io <<< HELP = finish 0 io err w -| isNothing args.inputfile +| isNone args.inputfile # err = err <<< "No input file given.\r\n" = finish 1 io err w # infile = fromJust args.inputfile @@ -112,11 +113,11 @@ Start w | isError prog # err = err <<< fromError prog = finish 1 io err w -#! f = f <<< fromOk prog +#! f = printAssembler (fromOk prog) f #! (_,w) = fclose f w | not args.generate = finish 0 io err w -#! (p,w) = callProcess "/opt/clean/bin/clm" [module, "-o", module] (Just dir) w +#! (p,w) = callProcess "/opt/clean/bin/clm" [module, "-o", module] (?Just dir) w | isError p # err = err <<< snd (fromError p) <<< "\r\n" = finish 1 io err w @@ -131,7 +132,7 @@ where <|> (\ cli -> {cli & compile=False}) <$ item "--no-compile" <|> (\ cli -> {cli & generate=False}) <$ item "--no-generate" <|> (\ cli -> {cli & help=True}) <$ anyItem ["-h", "--help"] - <|> (\name cli -> {cli & inputfile=Just name}) <$> satisfy isFilename + <|> (\name cli -> {cli & inputfile= ?Just name}) <$> satisfy isFilename ) P_Invalid "command line argument" opt -- cgit v1.2.3