fixed reading argvars from gfc in gf-to-gfcc

This commit is contained in:
aarne
2007-09-21 12:00:31 +00:00
parent 6ce60d64a9
commit 6ac6a31274
4 changed files with 19 additions and 12 deletions

View File

@@ -1,11 +1,11 @@
module GF.Infra.CompactPrint where
import Data.Char
compactPrint = concat . map spaceIf . words
compactPrint = tail . concat . map spaceIf . words
spaceIf w = case w of
_ | keyword w -> "\n" ++ w
c:cs | isAlpha c || isDigit c -> " " ++ w
_ -> w
keyword w = elem w ["cat","fun","lin","lincat","oper","param"]
keyword w = elem w ["cat","fun","lin","lincat","lindef","oper","param"]