forked from GitHub/gf-core
command ss to show source (including gfo) in text; to be extended
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user