summaryrefslogtreecommitdiff
path: root/src/compiler/GF/Grammar/Printer.hs
diff options
context:
space:
mode:
authoraarne <aarne@chalmers.se>2011-09-20 14:58:27 +0000
committeraarne <aarne@chalmers.se>2011-09-20 14:58:27 +0000
commita2ccf1ce6965e93eff9a3d7bef064cb3cab448f5 (patch)
treea1263d24bd22711dfdb58578d049bf5a6d72e8a3 /src/compiler/GF/Grammar/Printer.hs
parent209ec0d7fea6371c3d6c0bf5a21d7501a961c0a6 (diff)
command ss to show source (including gfo) in text; to be extended
Diffstat (limited to 'src/compiler/GF/Grammar/Printer.hs')
-rw-r--r--src/compiler/GF/Grammar/Printer.hs4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/compiler/GF/Grammar/Printer.hs b/src/compiler/GF/Grammar/Printer.hs
index 3319f86e8..fc9d31802 100644
--- a/src/compiler/GF/Grammar/Printer.hs
+++ b/src/compiler/GF/Grammar/Printer.hs
@@ -10,6 +10,7 @@
module GF.Grammar.Printer
( TermPrintQual(..)
, ppLabel
+ , ppGrammar
, ppModule
, ppJudgement
, ppTerm
@@ -33,6 +34,9 @@ import qualified Data.Map as Map
data TermPrintQual = Qualified | Unqualified
+ppGrammar :: SourceGrammar -> Doc
+ppGrammar sgr = vcat $ map (ppModule Qualified) $ modules sgr
+
ppModule :: TermPrintQual -> SourceModule -> Doc
ppModule q (mn, ModInfo mtype mstat opts exts with opens _ jments) =
hdr $$ nest 2 (ppOptions opts $$ vcat (map (ppJudgement q) defs)) $$ ftr