aboutsummaryrefslogtreecommitdiff
path: root/silc.icl
diff options
context:
space:
mode:
Diffstat (limited to 'silc.icl')
-rw-r--r--silc.icl13
1 files changed, 7 insertions, 6 deletions
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