forked from GitHub/gf-core
Change the type of PGF.Lexing.bindTok to [String] -> [String]
The old type was [String] -> String. This function was only used in GF.Text.Lexing.stringOp, which now uses (unwords . bindTok) instead, with no change in behaviour.
This commit is contained in:
@@ -14,7 +14,7 @@ stringOp name = case name of
|
||||
"lexcode" -> Just $ appLexer lexCode
|
||||
"lexmixed" -> Just $ appLexer lexMixed
|
||||
"words" -> Just $ appLexer words
|
||||
"bind" -> Just $ appUnlexer bindTok
|
||||
"bind" -> Just $ appUnlexer (unwords . bindTok)
|
||||
"unchars" -> Just $ appUnlexer concat
|
||||
"unlextext" -> Just $ appUnlexer (unlexText . unquote)
|
||||
"unlexcode" -> Just $ appUnlexer unlexCode
|
||||
|
||||
@@ -30,12 +30,12 @@ unlexText = capitInit . unlext where
|
||||
_ -> []
|
||||
|
||||
-- | Bind tokens separated by Prelude.BIND, i.e. &+
|
||||
bindTok :: [String] -> String
|
||||
bindTok :: [String] -> [String]
|
||||
bindTok ws = case ws of
|
||||
w:"&+":ws2 -> w ++ bindTok ws2
|
||||
w:[] -> w
|
||||
w:ws2 -> w ++ " " ++ bindTok ws2
|
||||
[] -> ""
|
||||
w1:"&+":w2:ws -> bindTok ((w1++w2):ws)
|
||||
"&+":ws -> bindTok ws
|
||||
w:ws -> w:bindTok ws
|
||||
[] -> []
|
||||
|
||||
-- * Code lexing
|
||||
|
||||
|
||||
Reference in New Issue
Block a user