Closed aspizu closed 10 months ago
I think you mean UnexpectedToken
. Did you try e.token.value
?
if isinstance(err, UnexpectedCharacters):
expected = ", ".join(err.allowed)
return Diagnostic(
range,
f"Expected one of: {expected}",
DiagnosticSeverity.Error,
"UnexpectedCharacters",
)
err.allowed
is Set[str]
I want to get the string which was defined in the grammar file from this list.
Did you try lark_instance.terminals
?
I want to get the value of the terminal from UnexpectedInput errors.