curry gotcha
[cc1516.git] / spl.icl
diff --git a/spl.icl b/spl.icl
index 9976cc1..0e22a1e 100644 (file)
--- a/spl.icl
+++ b/spl.icl
@@ -46,13 +46,9 @@ preamble (AST fd) = AST (pre ++ fd)
                        ,
                        FunDecl zero "1printbool" ["x"] Nothing [] [
                                IfStmt (VarExpr zero (VarDef "x" []))
-                                       [FunStmt "1printstr" [strOp2 $ fromString "True"] []]
-                                       [FunStmt "1printstr" [strOp2 $ fromString "False"] []]
-                       ]] 
-
-               strOp2 :: [Char] -> Expr
-               strOp2 [] = EmptyListExpr zero
-               strOp2 [x:xs] = Op2Expr zero (CharExpr zero x) BiCons (strOp2 xs)
+                                       [FunStmt "1printstr" [makeStrExpr zero $ fromString "True"] []]
+                                       [FunStmt "1printstr" [makeStrExpr zero $ fromString "False"] []]]
+                       ] 
 
 Start :: *World -> *World
 Start w
@@ -60,14 +56,12 @@ Start w
 # (stdin, w) = stdio w
 | args.version
        # stdin = stdin 
-               <<< "spl 0.1 (17 march 2016)\n"
+               <<< "spl 1.0 (9 June 2016)\n"
                <<< "Copyright Pim Jager and Mart Lubbers\n"
        = snd $ fclose stdin w
 | args.help
        # stdin = stdin 
                <<< "Usage: " <<< args.program <<< " [OPTION] [FILE]\n"
-               <<< "<spl> ::= <spl> <parser> <lexer>\n"
-               <<< "Lex parse and either FILE or stdin\n"
                <<< "\n"
                <<< "Options:\n"
                <<< "  --help             Show this help\n"
@@ -92,9 +86,10 @@ Start w
                                stdin <<<  "//PARSER\n" <<< toString parseOut <<< "//PARSER\n")
                        = case sem (preamble parseOut) of
                                (Left e) = snd $ fclose (stdin <<< join "\n" (map toString e) <<< "\n") w
-                               (Right ast)
+                               (Right (ast, gam))
                                # stdin = if (not args.sem) stdin (stdin
-                                       <<< "//SEM G\n" <<< toString ast <<< "//SEMA\n")
+                                       <<< "//SEM AST\n" <<< toString ast <<< "//SEM AST\n"
+                    <<< "//SEM GAMMA\n" <<< toString gam <<< "//SEM GAMMA\n")
                                = case gen ast of
                                        (Left e) = snd $ fclose (stdin <<< e) w
                                        (Right asm)