Question: PYTHON SLY LIBRARY Im creating my own programming language using the python library Sly lexer and parser. I'm getting an error whenever a decimal is
PYTHON SLY LIBRARY
Im creating my own programming language using the python library Sly lexer and parser. I'm getting an error whenever a decimal is entered in the compiler.
Heres the declaration in my code:
DECIMAL = r'([0-9]*\.[0-9]+|[0-9]+\.?)([Ee][+-]?[0-9]+)?'
@_('DECIMAL') def expr(self,p): return ('decimal', p.DECIMAL)

WARNING: Token(s) {LETTER, DECIMAL_POINT, ANY_STRING} defined, but not used WARNING: There are 3 unused tokens ===LAO Programming Language=== LA0> abc = 1.5 sly: Syntax error at line 1, token=DECIMAL LAO> WARNING: Token(s) {LETTER, DECIMAL_POINT, ANY_STRING} defined, but not used WARNING: There are 3 unused tokens ===LAO Programming Language=== LA0> abc = 1.5 sly: Syntax error at line 1, token=DECIMAL LAO>
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
