diff --git a/CHANGES.md b/CHANGES.md index 46ee4c332..f70a3b763 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,3 +1,75 @@ +# grmtools 0.14.0 (2025-10-22) + +This release contains a number of new features and breaking changes. Most of +the breaking changes are in advanced/niche parts of the API, which few users +will notice. However, four breaking changes might affect a more substantial +subset of users: those are highlighted in the "breaking changes (major)" +section below. + + +## New features and improvements + + * Lex and Yacc-like inputs can now optionally take a `%grmtools` directive + which allows customisation of how grmtools treats the file. This allows + users to keep together the necessary grmtools settings, rather than + having to remember what is set in, for example, a `build.rs` file. See + [Lex Extensions](https://softdevteam.github.io/grmtools/latest_release/book/lexextensions.html) + and [Yacc Extensions](https://softdevteam.github.io/grmtools/latest_release/book/yaccextensions.html + for more details) in the grmtools book for more details. `nimbleparse` is + also able to use `%grmtools` directives. + + Note that setting options via the command-line / build script overrides + `%grmtools` directives. + + * Many error messages have been improved, ranging from incorrect grammars + to reporting the look ahead value with reduce/reduce conflicts. + + * lrpar uses bincode directly for generated tables, making the serde + dependency optional. + + * `parse_map` been added as a more generic version of `parse_generictree`. The + latter is marked as deprecated. + + * `CTTokenMapBuilder` has been added as a more flexible alternative to + `ct_token_map`. The latter is marked as deprecated. + + * lrlex has a new flag `allow_wholeline_comments` which allows `// ...` + comments to be added to lex files. This defaults to off, because it is not + uncommon for Lex rules themselves to use `//`. + + * Support for use under WASM has been improved. + + +## Breaking changes + + * `LexErrorKind is no longer `Eq`/`PartialEq`. This allows specific errors + with regexes to be reported, instead of the generic error previously. + + * Many `struct`s and `enum`s have been marked non-exhaustive. This means that + external users cannot directly construct instances of such types. In general, + these are parts of the API that users would have expected to have received + from grmtools, not construct themselves. + + * `allow_missing_tokens_in_parser` is now treated as a warning. + + * `RegexOptions` in lrlex has been renamed `LexFlags`. This struct was, and + remains, mostly `doc(hidden)` but it cannot be fully hidden from users. + + +## Other changes + + * Code generation now uses the + [quote](https://crates.io/crates/quote) crate and formatted using + [prettyplease](https://crates.io/crates/prettyplease). This makes dealing + with the generated code more pleasant. + + * The signature for `ct_token_map` has been generalized to use the `Borrow` + trait instead of a reference. + + * The lifetime of the `lrpar_config` callback has been relaxed (previously it + was the onerous `'static`). + + # grmtools 0.13.10 (2025-02-04) * Add option for more complete POSIX lex compatible regex escapes. For diff --git a/cfgrammar/Cargo.toml b/cfgrammar/Cargo.toml index 5acf3affa..8fd011e7a 100644 --- a/cfgrammar/Cargo.toml +++ b/cfgrammar/Cargo.toml @@ -2,7 +2,7 @@ name = "cfgrammar" description = "Grammar manipulation" repository = "https://github.com/softdevteam/grmtools" -version = "0.13.10" +version = "0.14.0" edition = "2024" readme = "README.md" license = "Apache-2.0/MIT" diff --git a/lrlex/Cargo.toml b/lrlex/Cargo.toml index 1c8ea0da5..d1d726128 100644 --- a/lrlex/Cargo.toml +++ b/lrlex/Cargo.toml @@ -2,7 +2,7 @@ name = "lrlex" description = "Simple lexer generator" repository = "https://github.com/softdevteam/grmtools" -version = "0.13.10" +version = "0.14.0" edition = "2024" readme = "README.md" license = "Apache-2.0/MIT" @@ -24,8 +24,8 @@ _unsealed_unstable_traits = ["_unstable_api"] vergen = { version = "8", default-features = false, features = ["build"] } [dependencies] -cfgrammar = { path = "../cfgrammar", version = "0.13" } -lrpar = { path = "../lrpar", version = "0.13" } +cfgrammar = { path = "../cfgrammar", version = "0.14" } +lrpar = { path = "../lrpar", version = "0.14" } getopts.workspace = true regex.workspace = true diff --git a/lrpar/Cargo.toml b/lrpar/Cargo.toml index bdaa91ccc..779fe6b64 100644 --- a/lrpar/Cargo.toml +++ b/lrpar/Cargo.toml @@ -2,7 +2,7 @@ name = "lrpar" description = "Yacc-compatible parser generator" repository = "https://github.com/softdevteam/grmtools" -version = "0.13.10" +version = "0.14.0" edition = "2024" readme = "README.md" license = "Apache-2.0/MIT" @@ -23,8 +23,8 @@ _unsealed_unstable_traits = ["_unstable_api"] vergen = { version = "8", default-features = false, features = ["build"] } [dependencies] -cfgrammar = { path="../cfgrammar", version = "0.13", features = ["bincode"] } -lrtable = { path="../lrtable", version = "0.13", features = ["bincode"] } +cfgrammar = { path="../cfgrammar", version = "0.14", features = ["bincode"] } +lrtable = { path="../lrtable", version = "0.14", features = ["bincode"] } bincode = { workspace = true, features = ["derive"] } cactus.workspace = true diff --git a/lrtable/Cargo.toml b/lrtable/Cargo.toml index af656248e..9f1c8cf63 100644 --- a/lrtable/Cargo.toml +++ b/lrtable/Cargo.toml @@ -2,7 +2,7 @@ name = "lrtable" description = "LR grammar table generation" repository = "https://github.com/softdevteam/grmtools" -version = "0.13.10" +version = "0.14.0" edition = "2024" readme = "README.md" license = "Apache-2.0/MIT" @@ -17,7 +17,7 @@ name = "lrtable" path = "src/lib/mod.rs" [dependencies] -cfgrammar = { path="../cfgrammar", version = "0.13" } +cfgrammar = { path="../cfgrammar", version = "0.14" } bincode = { workspace = true, features = ["derive"], optional = true } fnv.workspace = true diff --git a/nimbleparse/Cargo.toml b/nimbleparse/Cargo.toml index 5b55ee6a9..5c03fb161 100644 --- a/nimbleparse/Cargo.toml +++ b/nimbleparse/Cargo.toml @@ -2,7 +2,7 @@ name = "nimbleparse" description = "Simple Yacc grammar debugging tool" repository = "https://github.com/softdevteam/grmtools" -version = "0.13.10" +version = "0.14.0" edition = "2024" readme = "README.md" license = "Apache-2.0/MIT" @@ -13,10 +13,10 @@ doc = false name = "nimbleparse" [dependencies] -cfgrammar = { path="../cfgrammar", version="0.13" } -lrlex = { path="../lrlex", version="0.13" } -lrpar = { path="../lrpar", version="0.13" } -lrtable = { path="../lrtable", version="0.13" } +cfgrammar = { path="../cfgrammar", version="0.14" } +lrlex = { path="../lrlex", version="0.14" } +lrpar = { path="../lrpar", version="0.14" } +lrtable = { path="../lrtable", version="0.14" } getopts.workspace = true num-traits.workspace = true