diff options
Diffstat (limited to 'libraries/base/GHC/Read.hs')
-rw-r--r-- | libraries/base/GHC/Read.hs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/libraries/base/GHC/Read.hs b/libraries/base/GHC/Read.hs index 54fbc287a8..d7df82f1f6 100644 --- a/libraries/base/GHC/Read.hs +++ b/libraries/base/GHC/Read.hs @@ -229,7 +229,13 @@ lex s = readP_to_S L.hsLex s -- lexLitChar :: ReadS String -- As defined by H2010 lexLitChar = readP_to_S (do { (s, _) <- P.gather L.lexChar ; - return s }) + let s' = removeNulls s in + return s' }) + where + -- remove nulls from end of the character if they exist + removeNulls [] = [] + removeNulls ('\\':'&':xs) = removeNulls xs + removeNulls (first:rest) = first : removeNulls rest -- There was a skipSpaces before the P.gather L.lexChar, -- but that seems inconsistent with readLitChar |