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.
Projectlark-parser/lark
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
| 16 | 16 | self.name = name | |
| 17 | 17 | ||
| 18 | 18 | def __eq__(self, other): | |
| 19 | - | if not isinstance(other, Symbol): | |
| 19 | + | if other is None: | |
| 20 | 20 | 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 | + | ) | |
| 21 | 25 | return self.is_term == other.is_term and self.name == other.name | |
| 22 | 26 | ||
| 23 | 27 | def __ne__(self, other): |
The check that tells the two apart
fail→pass·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
- 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-06-02Fix empty SPPF node from xearley ignore carry-over (fixes #1598)
- 2026-05-24fix: raise GrammarError for template usage inside terminals
- 2024-10-25Fix Symbol.__eq__ (fixes #1476)