Whole file
lark-parser/lark
The author described this change as “Fix Symbol.__eq__ (fixes #1476)”. It counts as a record because the check below fails on the code as it stood at 24d0cf7b5 and passes on da118c3c7, with nothing else changed between the two runs.
Projectlark-parser/lark
Fix saved2024-10-25
Sharing licenceMIT · LICENSE
Change size+2 −1
What the code was meant to do, written into the code itself as a save note
Fix Symbol.__eq__ (fixes #1476)
The change
| 16 | 16 | self.name = name | |
| 17 | 17 | ||
| 18 | 18 | def __eq__(self, other): | |
| 19 | - | assert isinstance(other, Symbol), other | |
| 19 | + | if not isinstance(other, Symbol): | |
| 20 | + | return False | |
| 20 | 21 | return self.is_term == other.is_term and self.name == other.name | |
| 21 | 22 | ||
| 22 | 23 | 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 it24d0cf7b5b56db77203dbbe794e50958433130ea
Broken version dated2024-09-23
Modulelark.grammar
Units changedSymbol
Fingerprintb20260bd5ab1045d
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-25Adjust behaviour in #1481 to raise a NotImplementedError