From: simonpj Date: Fri, 14 Feb 2003 13:01:32 +0000 (+0000) Subject: [project @ 2003-02-14 13:01:32 by simonpj] X-Git-Tag: nhc98-1-18-release~737 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=0c3ce7a5b3c10ce1e181dab07bfe71aca7e83b33;p=haskell-directory.git [project @ 2003-02-14 13:01:32 by simonpj] Fix for deriving of records with leading underscore, and corresponding lex --- diff --git a/Text/Read/Lex.hs b/Text/Read/Lex.hs index e9b7635..14528c1 100644 --- a/Text/Read/Lex.hs +++ b/Text/Read/Lex.hs @@ -98,7 +98,7 @@ lexPunc = do c <- satisfy isPuncChar return (Punc [c]) where - isPuncChar c = c `elem` ",;()[]{}_`" + isPuncChar c = c `elem` ",;()[]{}`" -- ---------------------------------------------------------------------- -- Symbols @@ -119,10 +119,12 @@ lexSymbol = lexId :: ReadP Lexeme lexId = - do c <- satisfy isAlpha + do c <- satisfy isIdsChar s <- munch isIdfChar return (Ident (c:s)) where + -- Identifiers can start with a '_' + isIdsChar c = isAlpha c || c == '_' isIdfChar c = isAlphaNum c || c `elem` "_'" -- ---------------------------------------------------------------------------