X-Git-Url: https://git.martlubbers.net/?a=blobdiff_plain;f=src%2Fparse.icl;h=cfd4fd1a2b974dba0d617a6547bf81d6646d9a82;hb=40d54a0715006e2baab1704eef15eecc4076668b;hp=c28fb4c58df52ad57313e88bde5ca8869101af58;hpb=8c3da7a503f87783e3614254649ed8c04eb0d519;p=cc1516.git diff --git a/src/parse.icl b/src/parse.icl index c28fb4c..cfd4fd1 100644 --- a/src/parse.icl +++ b/src/parse.icl @@ -175,7 +175,7 @@ trans1 t r = trans2 t $ const r derive gPrint TokenValue derive gEq TokenValue satTok :: TokenValue -> Parser Token Token -satTok t = top >>= \tok=:(pos, tv) -> if (eq t tok) (return tok) (fail (printToString t, pos)) +satTok t = top >>= \tok=:(pos, tv) -> if (eq t tok) (return tok) (fail (printToString tv, pos)) where eq (IdentToken _) (_, IdentToken _) = True eq (NumberToken _) (_, NumberToken _) = True @@ -222,7 +222,7 @@ printStatements [s:ss] i = (case s of ) ++ printStatements ss i where printCodeBlock :: [Stmt] Int -> [String] - printCodeBlock [] _ = ["{}"] + printCodeBlock [] _ = ["{}\n"] printCodeBlock [x] i = ["\n":printStatements [x] (i+1)] printCodeBlock x i = ["{\n":printStatements x (i+1)] ++ indent i ["}\n"]