diff options
author | Oleg Grenrus <oleg.grenrus@iki.fi> | 2021-02-14 13:33:21 +0200 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2021-04-05 20:38:07 -0400 |
commit | 9c9adbd0ffe6ecc37d3a565811d8e79f24383943 (patch) | |
tree | 6beab45ec5caf3e406c3aecb7dfb7f4361d3fb05 /compiler/GHC/Parser/Lexer.x | |
parent | 918d5021ad74a6b7e5e027df2f7d7605d833b486 (diff) | |
download | haskell-9c9adbd0ffe6ecc37d3a565811d8e79f24383943.tar.gz |
Implement proposal 403: Lexer cleanup
This allows Other Numbers to be used in identifiers, and also documents
other, already existing lexer divergence from Haskell Report
Diffstat (limited to 'compiler/GHC/Parser/Lexer.x')
-rw-r--r-- | compiler/GHC/Parser/Lexer.x | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/compiler/GHC/Parser/Lexer.x b/compiler/GHC/Parser/Lexer.x index eec5171eb8..9fa6d05cf0 100644 --- a/compiler/GHC/Parser/Lexer.x +++ b/compiler/GHC/Parser/Lexer.x @@ -131,7 +131,7 @@ $tab = \t $ascdigit = 0-9 $unidigit = \x03 -- Trick Alex into handling Unicode. See [Unicode in Alex]. -$decdigit = $ascdigit -- for now, should really be $digit (ToDo) +$decdigit = $ascdigit -- exactly $ascdigit, no more no less. $digit = [$ascdigit $unidigit] $special = [\(\)\,\;\[\]\`\{\}] @@ -147,17 +147,17 @@ $unismall = \x02 -- Trick Alex into handling Unicode. See [Unicode in Alex]. $ascsmall = [a-z] $small = [$ascsmall $unismall \_] +$uniidchar = \x07 -- Trick Alex into handling Unicode. See [Unicode in Alex]. +$idchar = [$small $large $digit $uniidchar \'] + $unigraphic = \x06 -- Trick Alex into handling Unicode. See [Unicode in Alex]. -$graphic = [$small $large $symbol $digit $special $unigraphic \"\'] +$graphic = [$small $large $symbol $digit $idchar $special $unigraphic \"\'] $binit = 0-1 $octit = 0-7 $hexit = [$decdigit A-F a-f] -$uniidchar = \x07 -- Trick Alex into handling Unicode. See [Unicode in Alex]. -$idchar = [$small $large $digit $uniidchar \'] - -$pragmachar = [$small $large $digit] +$pragmachar = [$small $large $digit $uniidchar ] $docsym = [\| \^ \* \$] @@ -2521,7 +2521,7 @@ adjustChar c = fromIntegral $ ord adj_c SpacingCombiningMark -> other_graphic EnclosingMark -> other_graphic DecimalNumber -> digit - LetterNumber -> other_graphic + LetterNumber -> digit OtherNumber -> digit -- see #4373 ConnectorPunctuation -> symbol DashPunctuation -> symbol |