1
0
forked from GitHub/gf-core

Refactor TransformCFG: use Map for CFRules.

This commit is contained in:
bringert
2007-06-27 17:22:59 +00:00
parent bb09506ece
commit af36dcf13d
3 changed files with 42 additions and 41 deletions
+1 -1
View File
@@ -45,7 +45,7 @@ regularPrinter :: Options -> StateGrammar -> String
regularPrinter opts s = prCFRules $ makeSimpleRegular opts s
where
prCFRules :: CFRules -> String
prCFRules g = unlines [ c ++ " ::= " ++ join " | " (map (showRhs . ruleRhs) rs) | (c,rs) <- g]
prCFRules g = unlines [ c ++ " ::= " ++ join " | " (map (showRhs . ruleRhs) rs) | (c,rs) <- allRulesGrouped g]
join g = concat . intersperse g
showRhs = unwords . map (symbol id show)