summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorkrasimir <krasimir@chalmers.se>2009-01-20 14:07:13 +0000
committerkrasimir <krasimir@chalmers.se>2009-01-20 14:07:13 +0000
commitd6e917b5a1454bc75226d27ed71171b2617a4d46 (patch)
tree539739dd6f2fa0026f17545a3887a34184b37038 /src
parentd2a00c373a169b22d450311214b15df9a50ce31a (diff)
added pretty printing for flags
Diffstat (limited to 'src')
-rw-r--r--src/GF/Grammar/Printer.hs7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/GF/Grammar/Printer.hs b/src/GF/Grammar/Printer.hs
index a83f0241d..cc95b2816 100644
--- a/src/GF/Grammar/Printer.hs
+++ b/src/GF/Grammar/Printer.hs
@@ -16,6 +16,7 @@ module GF.Grammar.Printer
import GF.Infra.Ident
import GF.Infra.Modules
+import GF.Infra.Option
import GF.Grammar.Grammar
import GF.Data.Operations
import Text.PrettyPrint
@@ -28,7 +29,7 @@ ppModule (mn, ModInfo mtype mstat opts exts with opens jments _) =
(let defs = tree2list jments
in if null defs
then hdr
- else hdr <+> lbrace $$ nest 2 (vcat (map ppJudgement defs)) $$ rbrace)
+ else hdr <+> lbrace $$ nest 2 (ppOptions opts $$ vcat (map ppJudgement defs)) $$ rbrace)
where
hdr = complModDoc <+> modTypeDoc <+> equals <+>
hsep (intersperse (text "**") $
@@ -59,6 +60,10 @@ ppModule (mn, ModInfo mtype mstat opts exts with opens jments _) =
ppWith (id,ext,opens) = ppExtends (id,ext) <+> text "with" <+> commaPunct ppOpenSpec opens
+ppOptions opts =
+ text "flags" $$
+ nest 2 (vcat [text option <+> equals <+> text (show value) <+> semi | (option,value) <- optionsGFO opts])
+
ppJudgement (id, AbsCat pcont pconstrs) =
text "cat" <+> ppIdent id <+>
(case pcont of