-
https://github.com/ryo33/parol_sandbox/tree/d562d4ef567b8b0d91c39f0544e8537c953d4417 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. |
Beta Was this translation helpful? Give feedback.
Replies: 8 comments 2 replies
-
I replaced |
Beta Was this translation helpful? Give feedback.
-
I will have a closer look at it 😊 |
Beta Was this translation helpful? Give feedback.
-
The last self = LookaheadDFA {
states: [
None,
Some(
1,
),
Some(
5,
),
],
transitions: [
DFATransition(
0,
5,
2,
),
DFATransition(
0,
6,
1,
),
DFATransition(
0,
7,
1,
),
DFATransition(
0,
8,
1,
),
],
k: 1,
} I replaced |
Beta Was this translation helpful? Give feedback.
-
I think the second time of
|
Beta Was this translation helpful? Give feedback.
-
I've found that |
Beta Was this translation helpful? Give feedback.
-
Oh, I didn't know about terminal attachments for a scanner state. I've changed the grammar:
The error changes to: Diagnostic {
message: "Production prediction failed at state 0",
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(5), length: SourceOffset(1) } }]"
} |
Beta Was this translation helpful? Give feedback.
-
This works! 🎉 |
Beta Was this translation helpful? Give feedback.
-
Exactly 💯 |
Beta Was this translation helpful? Give feedback.
Exactly 💯
In your first version there were no terminals assigned to the scanner state ’String’.
The resulting scanner then can't deliver any valid "scannable" tokens.
This should be detected during the analysis phase.
I will add a proper check for this situation.
Thank you for your analysis!