summaryrefslogtreecommitdiff
path: root/src/compiler/GF/Grammar/Printer.hs
diff options
context:
space:
mode:
authorkrasimir <krasimir@chalmers.se>2010-11-12 19:37:19 +0000
committerkrasimir <krasimir@chalmers.se>2010-11-12 19:37:19 +0000
commit115b4213d515ce308568fd71e362f6ce2881fb50 (patch)
tree246d76b05654b88d11bbfaf23dd67beb02dde21f /src/compiler/GF/Grammar/Printer.hs
parentb46442ab0b50fe58417b85d34a97a16e7b06de05 (diff)
operations in the abstract syntax
Diffstat (limited to 'src/compiler/GF/Grammar/Printer.hs')
-rw-r--r--src/compiler/GF/Grammar/Printer.hs8
1 files changed, 6 insertions, 2 deletions
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