1
0
forked from GitHub/gf-core

command ss to show source (including gfo) in text; to be extended

This commit is contained in:
aarne
2011-09-20 14:58:27 +00:00
parent 209ec0d7fe
commit a2ccf1ce69
3 changed files with 35 additions and 3 deletions

View File

@@ -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