Releases: sambyeol/plare
Releases · sambyeol/plare
Release list
v1.6.0
What's Changed
Bug Fixes
-
Correct hash semantics for
Item,State, andToken(#38)Itemnow hashes by value (rule + position tuple), so independently constructed equal items share a hash and satisfy==.Statehash is derived from its item-set, making equal states interchangeable in dictionaries.Tokenhash incorporates the concrete subclass, preventing different token types at the same position from colliding.
-
Fixed-point FIRST / FOLLOW computation (#36)
- Replaced the recursive re-entry-guard implementation of
calc_first/calc_followwith a worklist fixed-point algorithm. - Grammars with mutual recursion now produce correct FIRST and FOLLOW sets; the previous implementation could return incomplete results.
Rule.calc_firstandRule.calc_followare retained as thin wrappers for backward compatibility.
- Replaced the recursive re-entry-guard implementation of
Improvements
- Deterministic LR(0) state construction (#37)
- The parser now builds its LR(0) automaton in a stable, input-order-independent way.
- Repeated
Parserconstructions on the same grammar always produce identical parse tables, which aids caching, reproducibility, and debugging.
Documentation
- English docstrings and algorithm comments (#34)
- All public classes and methods now carry English docstrings (
Lexer,Parser,Token,PlareException,LexingError,ParserError,ParsingError). - Inline comments explain the SLR(1) construction phases (FIRST, FOLLOW, LR(0) automaton, ACTION/GOTO table, conflict resolution).
- All public classes and methods now carry English docstrings (
Tests
- Parser safety-net suite (#35) — covers a wide range of grammars including operator precedence, left/right recursion, ε-rules, and expected SLR(1) conflicts (
xfail). - FIRST / FOLLOW unit tests (#36) — 5 tests covering mutual recursion termination, ε-propagation, nullable chains, and the Dragon Book expression grammar.
- Determinism tests (#37) — verifies that repeated parser construction yields identical state IDs and table entries; marked
slowfor optional skipping. - Hash semantics tests (#38) — 5 tests pinning the corrected hash/equality contracts for
Item,State, andToken.
Full Changelog: v1.5.0...v1.6.0
v1.5.0
v1.4.1
- Fix bug in printing matched string with escapes
v1.4.0
v1.3.0
- Support multi token generation from single match in lexer
v1.2.0
v1.1.0
v1.0.0
- Release of v1.0.0
- Lexer and SLR(1) Parser implementation with Python