Whole file

lark-parser/lark

The author described this change as Adjust behaviour in #1481 to raise a NotImplementedError. It counts as a record because the check below fails on the code as it stood at da118c3c7 and passes on 3ac48c1cd, with nothing else changed between the two runs.

Fix saved2024-10-25
Sharing licenceMIT · LICENSE
Change size+5 1

What the code was meant to do, written into the code itself as a save note

Adjust behaviour in #1481 to raise a NotImplementedError

The change

1616 self.name = name
1717
1818 def __eq__(self, other):
19- if not isinstance(other, Symbol):
19+ if other is None:
2020 return False
21+ if not isinstance(other, Symbol):
22+ raise NotImplementedError(
23+ f"Comparing a Symbol with type {type(other).__name__} is not implemented"
24+ )
2125 return self.is_term == other.is_term and self.name == other.name
2226
2327 def __ne__(self, other):

The check that tells the two apart

failpass·tests/test_grammar.py::TestGrammar::test_symbol_eq

Check file tests/test_grammar.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 itda118c3c7e4b114ed3dbe546171145b52808c261
Broken version dated2024-10-25
Modulelark.grammar
Units changedSymbol
Fingerprint61618994ef29a641
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