How can I stop the parser if an error detected?
The example
def t_error(t):
print("Illegal character '%s'" % t.value[0])
t.lexer.skip(1)
shows only a skip but I need a stop. How to archive?
How can I stop the parser if an error detected?
The example
def t_error(t):
print("Illegal character '%s'" % t.value[0])
t.lexer.skip(1)
shows only a skip but I need a stop. How to archive?
Copyright © 2021 Jogjafile Inc.
You can raise an exception when you encounter an error in the lexer. For example: