From: pimjager Date: Mon, 29 Feb 2016 13:05:32 +0000 (+0100) Subject: Merge branch 'master' of https://github.com/dopefishh/cc1516 X-Git-Url: https://git.martlubbers.net/?a=commitdiff_plain;h=40d54a0715006e2baab1704eef15eecc4076668b;hp=-c;p=cc1516.git Merge branch 'master' of https://github.com/dopefishh/cc1516 --- 40d54a0715006e2baab1704eef15eecc4076668b diff --combined src/parse.icl index 9f43314,6c888ac..cfd4fd1 --- a/src/parse.icl +++ b/src/parse.icl @@@ -175,7 -175,7 +175,7 @@@ trans1 t r = trans2 t $ const 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 +222,7 @@@ printStatements [s:ss] i = (case s o ) ++ 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"]