recoveryEnabled Issue
See original GitHub issueSimple example has unexpected results, either:
- Incorrect parsing
- A missing value for:
recoveredNode
Tokens:
export const ID = createTok({ name: "ID", pattern: /[_a-zA-Z]\w+/ });
export const Assign = createTok({ name: "Assign", pattern: /:=/ });
export const String = createTok({ name: "String", pattern: /([xDQUV]?'([^'\\]*(?:\\.[^'\\]*)*)')/ });
Parser:
$.RULE("program", () => {
$.CONSUME(ID);
$.CONSUME(Assign);
$.CONSUME(String);
});
Test String:
aaa bbb := 'Hello';
When recoveryEnabled
is false
there is no parsed output (as expected).
When recoveryEnabled
is true
it produces the following cst:
{
"name": "program",
"children": {
"ID": [
{
"image": "aaa",
...
}
],
"Assign": [
{
"image": ":=",
...
}
],
"String": [
{
"image": "'Hello'",
...
}
]
},
"recoveredNode": undefined
}
When I would have expected:
{
"name": "program",
"children": {
"ID": [
{
"image": "bbb",
...
}
],
"Assign": [
{
"image": ":=",
...
}
],
"String": [
{
"image": "'Hello'",
...
}
]
},
"recoveredNode": undefined
}
Or:
{
"name": "program",
"children": {
"ID": [
{
"image": "aaa",
...
}
],
"Assign": [
{
"image": ":=",
...
}
],
"String": [
{
"image": "'Hello'",
...
}
]
},
"recoveredNode": true
}
Issue Analytics
- State:
- Created 4 years ago
- Comments:10 (6 by maintainers)
Top Results From Across the Web
How to Fix a "Stuck in Automatic Repair" Loop in Windows 10
Here's what to do when the tool that's meant to repair issues ends up creating ... Check the values for identifier and recoveryenabled....
Read more >7 Ways Fix – Stuck in Windows Automatic Repair loop!
7 Methods For Fixing The Automatic Repair Windows 10 Loop · In Command Prompt, type bcdedit /set {default} recoveryenabled No and press Enter....
Read more >How to fix automatic repair loop in Windows 10 - IT PRO
These tips will help you fix the issue. ... type “bcdedit /set {current} recoveryenabled No” and hit “Enter” (this command deletes problematic system...
Read more >How to Fix the Automatic Repair Loop in Windows 8.1
Restart the computer and the computer should boot normally. Solution 3. Running check disk to see if your hard drive is the problem....
Read more >How To Fix "Windows Automatic Repair Not Working" [SOLVED]
How to fix this issue? ... Run Chkdsk Command to Fix Hard Disk & File System Issues ... bcdedit /set {default} recoveryenabled No....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hello @GordonSmith
I don’t see a problem with the CST that was outputted.
What is happening here is single token deletion as described here:
This is why the
bbb
is removed, as the parsing and heuristic is mostly greedy.aaa
is consumed to match the IDbbb
is encountred while trying to consume an Assignbbb
is skipped.The
recoveredNode
is related to re-sync error recovery see more docs on this here:Note that you may need to modify how error recovery works in your specific grammar for optimal results, its just a set of greedy heuristics, it is not expected to be the best for all grammars, some examples:
https://github.com/SAP/chevrotain/commit/09afb8d5187c596def3932625b53aac84e6d2d02