summaryrefslogtreecommitdiff
path: root/compiler/parser/Lexer.x
diff options
context:
space:
mode:
authorIan Lynagh <igloo@earth.li>2012-07-14 21:56:14 +0100
committerIan Lynagh <igloo@earth.li>2012-07-14 21:56:14 +0100
commit3248fd922498d7ee70783139ac50334ae1d0574a (patch)
treeed2fbc90936661207cd82702a8689c797df01628 /compiler/parser/Lexer.x
parent7ae1bec53801069661e249e47ebd6998d6450093 (diff)
downloadhaskell-3248fd922498d7ee70783139ac50334ae1d0574a.tar.gz
HsStringPrim now contains FastBytes, not FastString
Diffstat (limited to 'compiler/parser/Lexer.x')
-rw-r--r--compiler/parser/Lexer.x8
1 files changed, 3 insertions, 5 deletions
diff --git a/compiler/parser/Lexer.x b/compiler/parser/Lexer.x
index 114f7f6b32..24a5a4ad54 100644
--- a/compiler/parser/Lexer.x
+++ b/compiler/parser/Lexer.x
@@ -551,7 +551,7 @@ data Token
| ITrational FractionalLit
| ITprimchar Char
- | ITprimstring FastString
+ | ITprimstring FastBytes
| ITprimint Integer
| ITprimword Integer
| ITprimfloat FractionalLit
@@ -1227,10 +1227,8 @@ lex_string s = do
setInput i
if any (> '\xFF') s
then failMsgP "primitive string literal must contain only characters <= \'\\xFF\'"
- else let s' = mkZFastString (reverse s) in
- return (ITprimstring s')
- -- mkZFastString is a hack to avoid encoding the
- -- string in UTF-8. We just want the exact bytes.
+ else let bs = map (fromIntegral . ord) (reverse s)
+ in return (ITprimstring (mkFastBytesByteList bs))
_other ->
return (ITstring (mkFastString (reverse s)))
else