summaryrefslogtreecommitdiff
path: root/src/GF/Infra/CompactPrint.hs
diff options
context:
space:
mode:
authoraarne <aarne@cs.chalmers.se>2007-12-07 10:23:18 +0000
committeraarne <aarne@cs.chalmers.se>2007-12-07 10:23:18 +0000
commite013138f0ca0db7ecc164f7d52816287f696d265 (patch)
tree1310dd75e6f935b8779905d3903617d6077a8514 /src/GF/Infra/CompactPrint.hs
parent64ebc4f1679b89bccb4328641a2432096e3288b6 (diff)
refresh compilation phase in the new format
Diffstat (limited to 'src/GF/Infra/CompactPrint.hs')
-rw-r--r--src/GF/Infra/CompactPrint.hs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/GF/Infra/CompactPrint.hs b/src/GF/Infra/CompactPrint.hs
index 5625041cd..7b37679ee 100644
--- a/src/GF/Infra/CompactPrint.hs
+++ b/src/GF/Infra/CompactPrint.hs
@@ -5,7 +5,9 @@ compactPrint = compactPrintCustom keywordGF (const False)
compactPrintGFCC = compactPrintCustom (const False) keywordGFCC
-compactPrintCustom pre post = tail . concat . map (spaceIf pre post) . words
+compactPrintCustom pre post = dps . concat . map (spaceIf pre post) . words
+
+dps = dropWhile isSpace
spaceIf pre post w = case w of
_ | pre w -> "\n" ++ w