diff --git a/CHANGELOG.md b/CHANGELOG.md index fc76002..b83e755 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,69 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.6.0] - 2022-08-03 + +### Added + +- `^` and `$` as aliases for `Start` and `End` + +- Leading pipes. This allows you to format expressions more beautifully: + + ```pomsky + | 'Lorem' + | :group( + | 'ipsum' + | 'dolor' + | 'sit' + | 'amet' + ) + | 'consetetur' + ``` + +- Improved diagnostics for typos. When you spell a variable, capturing group or character class + wrong, pomsky will suggest the correct spelling: + + ``` + $ pomsky '[Alpabetic]' + error: + × Unknown character class `Alpabetic` + ╭──── + 1 │ [Alpabetic] + · ────┬──── + · ╰── error occurred here + ╰──── + help: Perhaps you meant `Alphabetic` + ``` + +- Many regex syntax diagnostics were added. Pomsky now recognizes most regex syntax and suggests + the equivalent pomsky syntax. For example: + + ``` + $ pomsky '(? "test")' + error: + × This syntax is not supported + ╭──── + 1 │ (? "test") + · ───┬─── + · ╰── error occurred here + ╰──── + help: Named capturing groups use the `:name(...)` syntax. Try `:grp(...)` instead + ``` + +### Changed + +- A plus directly after a repetition (e.g. `'a'{2}+`) is now **forbidden**. Fix it by adding + parentheses: `('a'{2})+` + + The reason is that this syntax is used by regular expressions for possessive quantifiers. + Forbidding this syntax in pomsky allows for better diagnostics. + +- Deprecated `[.]`, `[codepoint]` and `[cp]`. They should have been deprecated before, but the + warnings were missed in the previous release. + +- Pomsky now sometimes reports multiple errors at once. The number of errors is limited to 8 in the + CLI. + ## [0.5.0] - 2022-07-04 This is the first release since [Rulex was renamed to Pomsky](https://pomsky-lang.org/blog/renaming-rulex/). @@ -19,8 +82,8 @@ rm $(type -P rulex) ### Added -- Deprecation warnings for `<%`, `%>`, `[codepoint]`, `[cp]` and `[.]`. These were deprecated - before, but Pomsky wasn't able to show warnings until now. +- Deprecation warnings for `<%` and `%>`. These were deprecated before, but Pomsky wasn't able + to show warnings until now. ### Changed @@ -213,7 +276,8 @@ The repository was moved to its own organization! 🎉 It also has a new website Initial release -[unreleased]: https://github.com/rulex-rs/pomsky/compare/v0.5...HEAD +[unreleased]: https://github.com/rulex-rs/pomsky/compare/v0.6...HEAD +[0.6.0]: https://github.com/rulex-rs/pomsky/compare/v0.5...v0.6 [0.5.0]: https://github.com/rulex-rs/pomsky/compare/v0.4.3...v0.5 [0.4.3]: https://github.com/rulex-rs/pomsky/compare/v0.4.2...v0.4.3 [0.4.2]: https://github.com/rulex-rs/pomsky/compare/v0.4.1...v0.4.2 diff --git a/Cargo.lock b/Cargo.lock index 00cab14..bd9294b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -45,7 +45,7 @@ checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "benchmark" -version = "0.1.2" +version = "0.1.3" dependencies = [ "criterion", "melody_compiler", @@ -577,7 +577,7 @@ dependencies = [ [[package]] name = "pomsky" -version = "0.5.0" +version = "0.6.0" dependencies = [ "arbitrary", "atty", @@ -591,7 +591,7 @@ dependencies = [ [[package]] name = "pomsky-bin" -version = "0.5.0" +version = "0.6.0" dependencies = [ "atty", "clap 3.2.16", @@ -603,7 +603,7 @@ dependencies = [ [[package]] name = "pomsky-macro" -version = "0.5.0" +version = "0.6.0" dependencies = [ "pomsky", ] diff --git a/benchmark/Cargo.toml b/benchmark/Cargo.toml index 677f287..efe2d5b 100644 --- a/benchmark/Cargo.toml +++ b/benchmark/Cargo.toml @@ -1,12 +1,13 @@ [package] name = "benchmark" -version = "0.1.2" +version = "0.1.3" edition = "2021" +publish = false # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -pomsky = { version = "0.5.0", path = "../pomsky-lib" } +pomsky = { version = "0.6.0", path = "../pomsky-lib" } criterion = { git = "https://github.com/bheisler/criterion.rs", branch = "version-0.4" } melody_compiler = "0.18.1" diff --git a/pomsky-bin/Cargo.toml b/pomsky-bin/Cargo.toml index 823826b..657292d 100644 --- a/pomsky-bin/Cargo.toml +++ b/pomsky-bin/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "pomsky-bin" description = "Compile pomsky expressions, a new regular expression language" -version = "0.5.0" +version = "0.6.0" edition = "2021" authors = ["Ludwig Stecher "] license = "MIT OR Apache-2.0" @@ -28,7 +28,7 @@ version = "4.7.1" features = ["fancy-no-backtrace"] [dependencies.pomsky] -version = "0.5.0" +version = "0.6.0" path = "../pomsky-lib" features = ["dbg", "miette", "suggestions"] diff --git a/pomsky-lib/Cargo.toml b/pomsky-lib/Cargo.toml index fbd699e..61e188f 100644 --- a/pomsky-lib/Cargo.toml +++ b/pomsky-lib/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "pomsky" description = "A new regular expression language" -version = "0.5.0" +version = "0.6.0" edition = "2021" authors = ["Ludwig Stecher "] license = "MIT OR Apache-2.0" diff --git a/pomsky-macro/Cargo.toml b/pomsky-macro/Cargo.toml index 5580968..556c113 100644 --- a/pomsky-macro/Cargo.toml +++ b/pomsky-macro/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "pomsky-macro" description = "Macro for converting pomsky expressions to regexes" -version = "0.5.0" +version = "0.6.0" edition = "2021" authors = ["Ludwig Stecher "] license = "MIT OR Apache-2.0" @@ -19,4 +19,4 @@ default = [] diagnostics = [] [dependencies] -pomsky = { version = "0.5.0", path = "../pomsky-lib" } +pomsky = { version = "0.6.0", path = "../pomsky-lib" }