Fix reserved name recognition for case-insensitive languages.
authorAntoine Latter <aslatter@gmail.com>
Sat, 8 Oct 2011 18:04:54 +0000 (18:04 +0000)
committerAntoine Latter <aslatter@gmail.com>
Sat, 8 Oct 2011 18:04:54 +0000 (18:04 +0000)
Text/Parsec/Token.hs

index 2b1c032..31ba0a0 100644 (file)
@@ -658,10 +658,10 @@ makeTokenParser languageDef
                             GT  -> False
 
     theReservedNames
-        | caseSensitive languageDef  = sortedNames
-        | otherwise               = map (map toLower) sortedNames
+        | caseSensitive languageDef  = sort reserved
+        | otherwise                  = sort . map (map toLower) $ reserved
         where
-          sortedNames   = sort (reservedNames languageDef)
+          reserved = reservedNames languageDef