more checking and gen
[minfp.git] / main.icl
index 386ee77..ea1825c 100644 (file)
--- a/main.icl
+++ b/main.icl
@@ -12,6 +12,7 @@ import parse
 import ast
 import check
 import int
+import gen
 
 chars :: *File -> ([Char], *File)
 chars f
@@ -20,12 +21,13 @@ chars f
        # (cs,f) = chars f
        = ([c:cs], f)
 
-:: Mode = MHelp | MLex | MParse | MType | MInterpret
+:: Mode = MHelp | MLex | MParse | MType | MInterpret | MGen
 :: Result
        = Lex [Token]
        | Parse AST
-       | Type (Type, AST)
+       | Type AST
        | Interpret Value
+       | Gen [String]
 
 options :: [OptDescr (Mode->Mode)]
 options =
@@ -34,6 +36,7 @@ options =
        , Option ['p'] ["parse"]     (NoArg (const MParse))     "Up to and including parse"
        , Option ['t'] ["type"]      (NoArg (const MType))      "Up to and including typing"
        , Option ['i'] ["interpret"] (NoArg (const MInterpret)) "Up to and including interpretation"
+       , Option ['g'] ["gen"]       (NoArg (const MInterpret)) "Up to and including generation"
        ]
 
 Start :: *World -> Either [String] Result
@@ -50,4 +53,5 @@ Start w
                MLex = Lex <$> lex cs
                MParse = Parse <$> (lex cs >>= parse)
                MType = Type <$> (lex cs >>= parse >>= check)
-               MInterpret = Interpret <$> (lex cs >>= parse >>= check >>= int o snd)
+               MInterpret = Interpret <$> (lex cs >>= parse >>= check >>= int)
+               MGen = Gen <$> (lex cs >>= parse >>= check >>= gen)