summaryrefslogtreecommitdiff
path: root/src/GF/Speech/PrJSGF.hs
diff options
context:
space:
mode:
authorbringert <bringert@cs.chalmers.se>2007-06-27 14:25:39 +0000
committerbringert <bringert@cs.chalmers.se>2007-06-27 14:25:39 +0000
commit2ff350ae59816ee86fb1508d3ffbe83578b7c9d4 (patch)
tree2c86dddd0df21391e1355f2eace69bb57873f567 /src/GF/Speech/PrJSGF.hs
parente7787025f657565d59d91e956260ae961b80f1e9 (diff)
Use shorter lines and paragraph-filling in SRGS, JSGF and GSL printing.
Diffstat (limited to 'src/GF/Speech/PrJSGF.hs')
-rw-r--r--src/GF/Speech/PrJSGF.hs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/GF/Speech/PrJSGF.hs b/src/GF/Speech/PrJSGF.hs
index ec1305b5d..037a4f4e2 100644
--- a/src/GF/Speech/PrJSGF.hs
+++ b/src/GF/Speech/PrJSGF.hs
@@ -39,7 +39,7 @@ import Text.PrettyPrint.HughesPJ
import Debug.Trace
width :: Int
-width = 80
+width = 75
jsgfPrinter :: Maybe SISRFormat
-> Options
@@ -92,7 +92,7 @@ prItem sisr t = f 0
| otherwise = (if p >= 1 then parens else id) (alts (map (f 1) xs))
where (es,nes) = partition isEpsilon xs
f _ (REConcat []) = text "<NULL>"
- f p (REConcat xs) = (if p >= 3 then parens else id) (hsep (map (f 2) xs))
+ f p (REConcat xs) = (if p >= 3 then parens else id) (fsep (map (f 2) xs))
f p (RERepeat x) = f 3 x <> char '*'
f _ (RESymbol s) = prSymbol sisr t s
@@ -125,10 +125,10 @@ comment :: String -> Doc
comment s = text "//" <+> text s
alts :: [Doc] -> Doc
-alts = sep . prepunctuate (text "| ")
+alts = fsep . prepunctuate (text "| ")
rule :: Bool -> SRGCat -> [Doc] -> Doc
-rule pub c xs = sep [p <+> prCat c <+> char '=', nest 2 (alts xs) <+> char ';']
+rule pub c xs = p <+> prCat c <+> char '=' <+> nest 2 (alts xs) <+> char ';'
where p = if pub then text "public" else empty
-- Pretty-printing utilities