Skip to content

Latest commit

 

History

History
73 lines (61 loc) · 7.01 KB

File metadata and controls

73 lines (61 loc) · 7.01 KB

Changelog

Note: This file is automatically generated. Do not edit by hand.

Unreleased

v0.4.0 (2026-09-13)

  • Fixed the scanner walking its line and column counters past the end of the source when Reset was given an offset beyond it. The offset is now clamped, as it already was in the C and C++ backends.
  • BREAKING: Aligned the generated scanners and parsers across all language backends.
  • Added a Kotlin backend for the scanner and parser generator, selected with --backend kotlin and configured with --backend-kotlin-package-name.
  • Improved error recovery for malformed GoLR grammar files.
  • The GoLR grammar frontend now rejects regex and string literals which span multiple lines, so a missing closing delimiter no longer consumes the rest of the file.
  • Added the @name annotation to the GoLR grammar frontend, letting a production alternative be given an explicit name instead of the auto-generated _.
  • Generated parsers now expose every production as a named Production constant and set it on the ParseNode/Node each reduction produces, so a tree walk can switch on production identity instead of counting children.
  • Generated parsers can emit a text trace of every action they take - each shift, reduce, accept and error recovery step - through an optional trace hook set on the parser instance, as a debugging aid for understanding an unexpected parse.
  • Fixed golr fmt discarding all comments from GoLR grammar files. It now preserves comments and blank lines, and no longer fails on a grammar file with broken syntax.

v0.3.0 (2026-08-23)

  • Added a JavaScript scanner backend.
  • Added a JavaScript parser generator backend, selected with --backend javascript. The generated ECMAScript module imports the token constants from the generated scanner, whose module specifier can be set with --backend-javascript-scanner-module.
  • Added a TypeScript scanner generator backend.
  • Added a TypeScript parser generator backend.
  • Added a C# scanner generator backend.
  • Added a C# parser generator backend.
  • Replaced the Java scanner backend with a table driven one.
  • Added a Java parser generator backend, selected with --backend java.
  • Replaced the Rust scanner backend with a table driven one.
  • Added a Rust parser generator backend, selected with --backend rust.
  • Added a Python scanner generator backend, selected with --backend python.
  • Added a Python parser generator backend, selected with --backend python.
  • Added a C++ scanner generator backend, selected with --backend cpp.
  • Added a C++ parser generator backend, selected with --backend cpp.
  • Fixed the generated scanners consuming one byte too many when a match failed after the automaton had already consumed bytes. The byte which ended the failed match now starts the next token instead of being swallowed by the invalid token, which had corrupted the token following the error.
  • Fixed the generated parser rejecting an empty input which the grammar accepts. The end of input is now a token the parse table decides on like any other.
  • Fixed Symbol.String of the generated Go parser printing the index of a symbol instead of its name.
  • BREAKING: The generated Go parser now spells the augmented start symbol AcceptNonterminal instead of Nonterminal_accept, which is the name every other language backend already uses.
  • BREAKING: --backend go now writes the table driven scanner and parser, which is smaller and faster than the directly coded one it replaces. The directly coded Go backend is gone, and with it the names go-direct and go-table.
  • BREAKING: The public packages pkg/parsergen/backend/golangtable and pkg/scannergen/backend/golangtable are now pkg/parsergen/backend/golang and pkg/scannergen/backend/golang, taking the place of the re-exports of the directly coded backend.
  • Added a C scanner generator backend, selected with --backend c.
  • Added a C parser generator backend, selected with --backend c.

v0.2.0 (2026-08-08)

  • The IELR(1) parser core is now a native Go implementation and is used by default. GNU Bison is no longer required to generate a parser. The Bison backed core is still available as "ielr1-bison".
  • The LALR(1) and LR(1) parser cores are now native Go implementations as well and are used by default. The Bison backed cores are still available as "lalr1-bison" and "lr1-bison".
  • Generated parsers now recover from syntax errors. Mark the places to resume at with the error symbol (@error in GoLR grammars, error in GNU Bison grammars) and the parser reports several errors in one run instead of stopping at the first one.
  • The VS Code and IntelliJ plugins now support the @error token.
  • The parser command now reports shift/reduce and reduce/reduce conflicts on stderr. The new --verbose flag additionally lists every conflict which was resolved automatically.
  • Generated parser tables are smaller, because reductions are compacted into a default reduction and unreachable states are removed.
  • The LALR(1) and IELR(1) cores now report an error when a grammar needs more states than the parser tables can address. Previously only the LR(1) core did.
  • Parser generation for large grammars is significantly faster and needs less memory.
  • The released binaries are built without debug assertions, which makes parser generation noticeably faster.
  • The parsers and scanners generated by GoLR are exempt from the Apache License, Version 2.0. You can license the generated files as you choose.
  • Fixed %nonassoc not rejecting sentences which it should reject.
  • Fixed the Go backend generating broken accept actions, which could result in generated code which does not compile.
  • Fixed terminals declared with %precedence being dropped when handing the grammar to the Bison backed cores, which silently changed how conflicts were resolved.
  • Fixed the precedence of a production getting lost while the grammar is augmented.
  • BREAKING: GrammarToParser of the pkg/parsergen/core/... packages now returns the list of conflicts as an additional result. Call sites need to be updated.
  • Added the golr selftest command, which checks the IELR(1) parser core against a canonical LR(1) oracle on randomly generated grammars across all CPU cores for as long as you let it run.
  • Fixed index out of range panics in the Bison frontend scanner when a grammar file ends inside a tag, prologue or braced code block.
  • Fixed the Bison frontend not recognizing the %lex-param and %parse-param directives.
  • Fixed the Bison frontend scanner swallowing input after char literals or strings ending in an escaped backslash, like '\'.
  • Fixed the Bison frontend ignoring char literal token declarations like %token '\' and misnaming escaped char literals: escape sequences are now decoded, so different spellings of the same character resolve to the same terminal.
  • Added the scanner backend go-table, which writes the scanner as lookup tables instead of as code.
  • Added the new parser backend 'go-table' which writes the parser as lookup tables instead of as control flow. The existing Go backend is now also available as 'go-direct', with 'go' remaining an alias for it.

v0.1.0 (2026-07-11)

  • Initial release.