summaryrefslogtreecommitdiff
path: root/src/compiler/GF/Grammar/Printer.hs
diff options
context:
space:
mode:
authorkrasimir <krasimir@chalmers.se>2010-02-16 09:34:02 +0000
committerkrasimir <krasimir@chalmers.se>2010-02-16 09:34:02 +0000
commit19b17dceb6a1882ee779e75b9703d7fd2b93cc95 (patch)
tree7f9f3e6e85abc5d481b69f8c90a9418b6fdbefeb /src/compiler/GF/Grammar/Printer.hs
parent61287f39259bdca55ba9874d369d2d2191bb1baf (diff)
no need to keep the list of constructors per category in .gfo
Diffstat (limited to 'src/compiler/GF/Grammar/Printer.hs')
-rw-r--r--src/compiler/GF/Grammar/Printer.hs11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/compiler/GF/Grammar/Printer.hs b/src/compiler/GF/Grammar/Printer.hs
index befc61932..4ead4e0bb 100644
--- a/src/compiler/GF/Grammar/Printer.hs
+++ b/src/compiler/GF/Grammar/Printer.hs
@@ -25,7 +25,7 @@ import GF.Grammar.Values
import GF.Grammar.Grammar
import Text.PrettyPrint
-import Data.Maybe (maybe)
+import Data.Maybe (maybe, isNothing)
import Data.List (intersperse)
import qualified Data.Map as Map
@@ -71,17 +71,14 @@ ppOptions opts =
text "flags" $$
nest 2 (vcat [text option <+> equals <+> str value <+> semi | (option,value) <- optionsGFO opts])
-ppJudgement q (id, AbsCat pcont pconstrs) =
+ppJudgement q (id, AbsCat pcont ) =
text "cat" <+> ppIdent id <+>
(case pcont of
Just cont -> hsep (map (ppDecl q) cont)
- Nothing -> empty) <+> semi $$
- case pconstrs of
- Just costrs -> text "data" <+> ppIdent id <+> equals <+> fsep (intersperse (char '|') (map (ppTerm q 0) costrs)) <+> semi
- Nothing -> empty
+ Nothing -> empty) <+> semi
ppJudgement q (id, AbsFun ptype _ pexp) =
(case ptype of
- Just typ -> text "fun" <+> ppIdent id <+> colon <+> ppTerm q 0 typ <+> semi
+ Just typ -> text (if isNothing pexp then "data" else "fun") <+> ppIdent id <+> colon <+> ppTerm q 0 typ <+> semi
Nothing -> empty) $$
(case pexp of
Just [] -> empty