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
) ++ 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"]