From 246df63a73a1a583284e38e61f94ed4ac0874ece Mon Sep 17 00:00:00 2001 From: Vladimir Azarov Date: Fri, 30 May 2025 15:49:48 +0200 Subject: Statements --- ppc.fun | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'ppc.fun') diff --git a/ppc.fun b/ppc.fun index a097390..27edf9a 100644 --- a/ppc.fun +++ b/ppc.fun @@ -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 % -- cgit v1.2.3