mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-05-21 17:12:50 -06:00
bnf and ebnf printer: align ::= symbols.
This commit is contained in:
@@ -175,9 +175,9 @@ ungroupTokens = joinRE . mapRE (symbol (RESymbol . NonTerminal) (REConcat . map
|
||||
--
|
||||
|
||||
prSRG :: SRG -> String
|
||||
prSRG = unlines . map prRule . srgRules
|
||||
prSRG = prProductions . map prRule . srgRules
|
||||
where
|
||||
prRule (SRGRule c alts) = c ++ " ::= " ++ unwords (intersperse "|" (map prAlt alts))
|
||||
prRule (SRGRule c alts) = (c,unwords (intersperse "|" (map prAlt alts)))
|
||||
prAlt (SRGAlt _ _ rhs) = prRE prSym rhs
|
||||
prSym = symbol fst (\t -> "\""++ t ++"\"")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user