diff options
Diffstat (limited to 'ppc.fun')
-rw-r--r-- | ppc.fun | 20 |
1 files changed, 14 insertions, 6 deletions
@@ -42,9 +42,11 @@ struct Ctk of T.token | Cid | Cconst | + Cstrlit | Cunop | Cbinop | - Cop + Cop | + Cexpr fun pos2tkPos pos = TkPos (pos, []) fun tkPos2pos (TkPos (pos, [])) = pos @@ -75,13 +77,19 @@ struct fun clerror (TkPos (pos, layers)) cls = let fun pcl cl out = + let + fun p s = Printf out `s % + in case cl of Ctk tk => Printf out Ptk tk % - | Cid => Printf out `"identifier" % - | Cconst => Printf out `"constant" % - | Cunop => Printf out `"unary operator" % - | Cbinop => Printf out `"binary operator" % - | Cop => Printf out `"operator" % + | Cid => p "identifier" + | Cconst => p "constant" + | Cstrlit => p "string literal" + | Cunop => p "unary operator" + | Cbinop => p "binary operator" + | Cop => p "operator" + | Cexpr => p "expression" + end fun pcls [] _ = raise Unreachable | pcls [cl] out = Printf out A1 pcl cl % |