Skip to content

Releases: sambyeol/plare

v1.6.0

Choose a tag to compare

@henrylee97 henrylee97 released this 11 May 05:30
24f2c2a

What's Changed

Bug Fixes

  • Correct hash semantics for Item, State, and Token (#38)

    • Item now hashes by value (rule + position tuple), so independently constructed equal items share a hash and satisfy ==.
    • State hash is derived from its item-set, making equal states interchangeable in dictionaries.
    • Token hash 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_follow with 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_first and Rule.calc_follow are retained as thin wrappers for backward compatibility.

Improvements

  • Deterministic LR(0) state construction (#37)
    • The parser now builds its LR(0) automaton in a stable, input-order-independent way.
    • Repeated Parser constructions 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).

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 slow for optional skipping.
  • Hash semantics tests (#38) — 5 tests pinning the corrected hash/equality contracts for Item, State, and Token.

Full Changelog: v1.5.0...v1.6.0

v1.5.0

Choose a tag to compare

@henrylee97 henrylee97 released this 19 Nov 00:46
267edff

Officially support Python 3.13.

v1.4.1

Choose a tag to compare

@henrylee97 henrylee97 released this 29 Aug 01:09
cde841d
  • Fix bug in printing matched string with escapes

v1.4.0

Choose a tag to compare

@henrylee97 henrylee97 released this 16 Jul 05:48
89521f6
  • Hide EOF token generation from lexer

v1.3.0

Choose a tag to compare

@henrylee97 henrylee97 released this 12 Jul 06:19
2dc9a8f
  • Support multi token generation from single match in lexer

v1.2.0

Choose a tag to compare

@henrylee97 henrylee97 released this 11 Jul 07:40
9627b90
  • Handle empty rule correctly

v1.1.0

Choose a tag to compare

@henrylee97 henrylee97 released this 07 Jul 10:56
7117446
  • Mark Plare as typed

v1.0.0

Choose a tag to compare

@henrylee97 henrylee97 released this 07 Jul 07:04
556d908
  • Release of v1.0.0
  • Lexer and SLR(1) Parser implementation with Python