Whole file
lark-parser/lark
The author described this change as “Fix empty SPPF node from xearley ignore carry-over (fixes #1598)”. It counts as a record because the checks below fail on the code as it stood at eb015d1b5 and pass on 0aaca5975, with nothing else changed between the two runs.
Projectlark-parser/lark
Fix saved2026-06-02
Sharing licenceMIT · LICENSE
Change size+3 −3
What the code was meant to do, written into the code itself as a save note
Fix empty SPPF node from xearley ignore carry-over (fixes #1598)
The change
| 112 | 112 | else: | |
| 113 | 113 | # Handle items carried over due to ignores | |
| 114 | 114 | new_item = Item(item.rule, item.ptr, item.start) | |
| 115 | - | label = (new_item.s, new_item.start, i + 1) | |
| 116 | - | new_item.node = node_cache[label] if label in node_cache else node_cache.setdefault(label, self.SymbolNode(*label)) | |
| 117 | - | if item.node: | |
| 115 | + | if item.node is not None: | |
| 118 | 116 | # new_item.node and item.node both represent the same symbol, so merge their children | |
| 117 | + | label = (new_item.s, new_item.start, i + 1) | |
| 118 | + | new_item.node = node_cache[label] if label in node_cache else node_cache.setdefault(label, self.SymbolNode(*label)) | |
| 119 | 119 | for child in item.node.children: | |
| 120 | 120 | new_item.node.add_family(new_item.s, child.rule, new_item.start, child.left, child.right) | |
| 121 | 121 |
The check that tells the two apart
fail→pass·tests/test_parser.py::TestFullEarleyDynamic::test_ignore_carryover_with_priority
fail→pass·tests/test_parser.py::TestFullEarleyDynamic_complete::test_ignore_carryover_with_priority
Check file tests/test_parser.py, taken without changes from the fix and copied onto the older code, so the exact same check runs against both versions.
Origin and history
The code before iteb015d1b5c236b22bf3215fd4a76c891262e1bf8
Broken version dated2026-05-09
Modulelark.parsers.xearley
Units changedParser
Fingerprint3024fdd5d37bbc26
Checked2026-08-18 by goldset/0.1
Every field above is generated by our program. None of it is written by hand.
Other bugs found in lark-parser/lark
- 2026-07-08Fix lexer_callbacks silently dropped for keyword terminals
- 2026-06-24Transformer_NonRecursive
- 2026-06-04Raise GrammarError for non-terminal names in %declare
- 2026-05-24fix: raise GrammarError for template usage inside terminals
- 2024-10-25Adjust behaviour in #1481 to raise a NotImplementedError
- 2024-10-25Fix Symbol.__eq__ (fixes #1476)