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.

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

112112 else:
113113 # Handle items carried over due to ignores
114114 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:
118116 # 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))
119119 for child in item.node.children:
120120 new_item.node.add_family(new_item.s, child.rule, new_item.start, child.left, child.right)
121121

The check that tells the two apart

failpass·tests/test_parser.py::TestFullEarleyDynamic::test_ignore_carryover_with_priority
failpass·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