haskell / alex

A lexical analyser generator for Haskell
https://hackage.haskell.org/package/alex
BSD 3-Clause "New" or "Revised" License
297 stars 82 forks source link

WIP #197: add rules to interpret number literals as character sequences #199

Closed andreasabel closed 2 years ago

andreasabel commented 2 years ago

WIP #197: add rules to interpret number literals as character sequences

I think this fixes the problem, but this isn't the final test case yet, so, WIP.

andreasabel commented 2 years ago

Closed in favor of #200.

andreasabel commented 2 years ago

Actually, I see that #200 breaks #141, so I leave my solution in the race.

andreasabel commented 2 years ago

There is a problem with regexes like [01-89] which mean one of 0, 1-8, 9. If we already have numbers (NUM), then this is hard to parse. Maybe NUM should only be lexed inside the multiplication brances {nnn,mmm}, using lexer states.

andreasabel commented 2 years ago

Closing in favor of #202.