parsing escaped strings from command line fixed

This commit is contained in:
aarne
2005-12-21 19:46:48 +00:00
parent f4c5fcf44a
commit 89ec5b808b
6 changed files with 36 additions and 22 deletions

View File

@@ -22,7 +22,8 @@ module GF.UseGrammar.Tokenize ( tokWords,
lexText,
lexC2M, lexC2M',
lexTextLiteral,
lexIgnore
lexIgnore,
wordsLits
) where
import GF.Data.Operations
@@ -39,7 +40,7 @@ tokWords :: String -> [CFTok]
tokWords = map tS . words
tokLits :: String -> [CFTok]
tokLits = map mkCFTok . mergeStr . words where
tokLits = map mkCFTok . mergeStr . wordsLits where
mergeStr ss = case ss of
w@(c:cs):rest | elem c "\'\"" && c /= last w -> getStr [w] rest
w :rest -> w : mergeStr rest
@@ -50,7 +51,7 @@ tokLits = map mkCFTok . mergeStr . words where
[] -> reverse v
tokVars :: String -> [CFTok]
tokVars = map mkCFTokVar . words
tokVars = map mkCFTokVar . wordsLits
isFloat s = case s of
c:cs | isDigit c -> isFloat cs
@@ -208,3 +209,4 @@ lexIgnore isKnown = concatMap mkOne where
| isKnown s = [t]
| otherwise = []
mkOne t = [t]