-
Notifications
You must be signed in to change notification settings - Fork 170
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
repro : https://github.com/rebcabin/lpython/tree/brian-lasr/lasr/lpython/Issue1945
The following works in ordinary CPython (after uncommenting the compatibility block at the top of the file)
hex_pat : Pattern[str] = fr'-?0[xX]{hexit}+'
oct_pat : Pattern[str] = fr'-?0{octit}+'
int_pat : Pattern[str] = fr'-?{digit}+'
dec_pat : Pattern[str] = fr'(-?{digit})M'
# Not kosher Clojure
sym_pat : Pattern[str] = fr'({alpha}{asr_alpha_mer}*)'
LPython produces the following misleading error message:
└─(15:13:05 on brian-lasr ✭)──> ~/CLionProjects/lpython/src/bin/lpython -I. lasr_lexer.py && ./lasr_lexer.out ──(Sun,Jun18)─┘
semantic error: Variable 'str' not declared
--> lasr_lexer.py:159:19
|
159 | hex_pat : Pattern[str] = fr'-?0[xX]{hexit}+'
| ^^^
The error message does not lead me to a fix.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working