1
0
forked from GitHub/gf-core

Limit GSL/JSGF/SRGS ABNF grammar line width to 80.

This commit is contained in:
bringert
2007-06-27 09:07:51 +00:00
parent cfe3d8699f
commit 6c074d38c6
3 changed files with 15 additions and 4 deletions

View File

@@ -34,8 +34,12 @@ import Data.Char (toUpper,toLower)
import Data.List (partition)
import Text.PrettyPrint.HughesPJ
width :: Int
width = 80
gslPrinter :: Options -> StateGrammar -> String
gslPrinter opts s = show $ prGSL $ makeSimpleSRG opts s
gslPrinter opts s = renderStyle st $ prGSL $ makeSimpleSRG opts s
where st = style { lineLength = width }
prGSL :: SRG -> Doc
prGSL (SRG{grammarName=name,startCat=start,origStartCat=origStart,rules=rs})