Error accessing lookahead token from token stream!
jsinger67 opened this issue · comments
Jörg Singer commented
https://github.com/ryo33/parol_sandbox/tree/d562d4ef567b8b0d91c39f0544e8537c953d4417
This code emits the following error with cargo test
Diagnostic {
message: "Error accessing lookahead token from token stream!",
code: "parol_runtime::parser::syntax_error",
help: "Syntax error in input prevents prediction of next production",
labels: "[LabeledSpan {
label: Some(\"Error location\"),
span: SourceSpan { offset: SourceOffset(0), length: SourceOffset(0) }
}]"
}
I'm trying to understand what happens, but it's a little harder.
Jörg Singer commented
If there are no terminals assigned to a scanner state, the resulting scanner can't deliver any valid tokens.
This should be detected during the analysis phase.
Jörg Singer commented