From 115b4213d515ce308568fd71e362f6ce2881fb50 Mon Sep 17 00:00:00 2001 From: krasimir Date: Fri, 12 Nov 2010 19:37:19 +0000 Subject: operations in the abstract syntax --- src/compiler/GF/Grammar/Printer.hs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/compiler/GF/Grammar/Printer.hs') diff --git a/src/compiler/GF/Grammar/Printer.hs b/src/compiler/GF/Grammar/Printer.hs index 3d190c49a..ee9cd703b 100644 --- a/src/compiler/GF/Grammar/Printer.hs +++ b/src/compiler/GF/Grammar/Printer.hs @@ -78,9 +78,13 @@ ppJudgement q (id, AbsCat pcont ) = (case pcont of Just (L _ cont) -> hsep (map (ppDecl q) cont) Nothing -> empty) <+> semi -ppJudgement q (id, AbsFun ptype _ pexp) = +ppJudgement q (id, AbsFun ptype _ pexp poper) = + let kind | isNothing pexp = "data" + | poper == Just False = "oper" + | otherwise = "fun" + in (case ptype of - Just (L _ typ) -> text (if isNothing pexp then "data" else "fun") <+> ppIdent id <+> colon <+> ppTerm q 0 typ <+> semi + Just (L _ typ) -> text kind <+> ppIdent id <+> colon <+> ppTerm q 0 typ <+> semi Nothing -> empty) $$ (case pexp of Just [] -> empty -- cgit v1.2.3