summaryrefslogtreecommitdiff
path: root/libraries/base/Text/Read/Lex.hs
diff options
context:
space:
mode:
Diffstat (limited to 'libraries/base/Text/Read/Lex.hs')
-rw-r--r--libraries/base/Text/Read/Lex.hs27
1 files changed, 15 insertions, 12 deletions
diff --git a/libraries/base/Text/Read/Lex.hs b/libraries/base/Text/Read/Lex.hs
index ed4d204c86..7054be9d79 100644
--- a/libraries/base/Text/Read/Lex.hs
+++ b/libraries/base/Text/Read/Lex.hs
@@ -30,6 +30,8 @@ module Text.Read.Lex
, readOctP
, readDecP
, readHexP
+
+ , isSymbolChar
)
where
@@ -214,18 +216,19 @@ lexSymbol =
return (Punc s) -- Reserved-ops count as punctuation
else
return (Symbol s)
- where
- isSymbolChar c = not (isPuncChar c) && case generalCategory c of
- MathSymbol -> True
- CurrencySymbol -> True
- ModifierSymbol -> True
- OtherSymbol -> True
- DashPunctuation -> True
- OtherPunctuation -> not (c `elem` "'\"")
- ConnectorPunctuation -> c /= '_'
- _ -> False
- reserved_ops = ["..", "::", "=", "\\", "|", "<-", "->", "@", "~", "=>"]
-
+ where
+ reserved_ops = ["..", "::", "=", "\\", "|", "<-", "->", "@", "~", "=>"]
+
+isSymbolChar :: Char -> Bool
+isSymbolChar c = not (isPuncChar c) && case generalCategory c of
+ MathSymbol -> True
+ CurrencySymbol -> True
+ ModifierSymbol -> True
+ OtherSymbol -> True
+ DashPunctuation -> True
+ OtherPunctuation -> not (c `elem` "'\"")
+ ConnectorPunctuation -> c /= '_'
+ _ -> False
-- ----------------------------------------------------------------------
-- identifiers