summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/compiler/GF/Text/Lexing.hs2
-rw-r--r--src/runtime/haskell/PGF/Lexing.hs10
2 files changed, 6 insertions, 6 deletions
diff --git a/src/compiler/GF/Text/Lexing.hs b/src/compiler/GF/Text/Lexing.hs
index 4e07c2126..bfe38ca83 100644
--- a/src/compiler/GF/Text/Lexing.hs
+++ b/src/compiler/GF/Text/Lexing.hs
@@ -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
diff --git a/src/runtime/haskell/PGF/Lexing.hs b/src/runtime/haskell/PGF/Lexing.hs
index a49328826..782757b03 100644
--- a/src/runtime/haskell/PGF/Lexing.hs
+++ b/src/runtime/haskell/PGF/Lexing.hs
@@ -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