diff --git a/CHANGELOG.md b/CHANGELOG.md index 862d1a7e26c..efbececb14c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,24 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a ## [Unreleased] +## [0.29.0] - 2024-05-10 + +### Added + +- Added `Prism::CallNode#full_message_loc`, which gives the location including the `=` if there is one. +- A warning for when `# shareable_constant_value` is not used on its own line. +- An error for invalid implicit local variable writes. +- Implicit hash patterns in array patterns are disallowed. +- We now validate that Unicode escape sequences are not surrogates. + +### Changed + +- All fields named `operator` have been renamed to `binary_operator` for `*OperatorWriteNode` nodes. This is to make it easier to provide C++ support. In the Ruby API, the old fields are aliased to the new fields with a deprecation warning. +- Many updated error messages to more closely match CRuby. +- We ensure keyword parameters do not end in `!` or `?`. +- Fixed some escaping in string literals with control sequences and hex escapes. +- Fix a bug with RBS types when used outside the `ruby/prism` codebase. + ## [0.28.0] - 2024-05-03 ### Added @@ -500,7 +518,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a - 🎉 Initial release! 🎉 -[unreleased]: https://github.com/ruby/prism/compare/v0.28.0...HEAD +[unreleased]: https://github.com/ruby/prism/compare/v0.29.0...HEAD +[0.29.0]: https://github.com/ruby/prism/compare/v0.28.0...v0.29.0 [0.28.0]: https://github.com/ruby/prism/compare/v0.27.0...v0.28.0 [0.27.0]: https://github.com/ruby/prism/compare/v0.26.0...v0.27.0 [0.26.0]: https://github.com/ruby/prism/compare/v0.25.0...v0.26.0 diff --git a/Gemfile.lock b/Gemfile.lock index 08b92cae166..8403e57a522 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - prism (0.28.0) + prism (0.29.0) GEM remote: https://rubygems.org/ diff --git a/ext/prism/extension.h b/ext/prism/extension.h index 93ad58fdc8f..b15a2c5e61b 100644 --- a/ext/prism/extension.h +++ b/ext/prism/extension.h @@ -1,7 +1,7 @@ #ifndef PRISM_EXT_NODE_H #define PRISM_EXT_NODE_H -#define EXPECTED_PRISM_VERSION "0.28.0" +#define EXPECTED_PRISM_VERSION "0.29.0" #include #include diff --git a/gemfiles/2.7/Gemfile.lock b/gemfiles/2.7/Gemfile.lock index 01bd9d19e32..6a6f32f6440 100644 --- a/gemfiles/2.7/Gemfile.lock +++ b/gemfiles/2.7/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: ../.. specs: - prism (0.28.0) + prism (0.29.0) GEM remote: https://rubygems.org/ diff --git a/gemfiles/3.0/Gemfile.lock b/gemfiles/3.0/Gemfile.lock index 80d2808fe8c..ca2f75548f8 100644 --- a/gemfiles/3.0/Gemfile.lock +++ b/gemfiles/3.0/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: ../.. specs: - prism (0.28.0) + prism (0.29.0) GEM remote: https://rubygems.org/ diff --git a/gemfiles/3.1/Gemfile.lock b/gemfiles/3.1/Gemfile.lock index 14a77cd0193..f764f54e6c5 100644 --- a/gemfiles/3.1/Gemfile.lock +++ b/gemfiles/3.1/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: ../.. specs: - prism (0.28.0) + prism (0.29.0) GEM remote: https://rubygems.org/ diff --git a/gemfiles/3.2/Gemfile.lock b/gemfiles/3.2/Gemfile.lock index 96b4f533c62..122c20c383d 100644 --- a/gemfiles/3.2/Gemfile.lock +++ b/gemfiles/3.2/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: ../.. specs: - prism (0.28.0) + prism (0.29.0) GEM remote: https://rubygems.org/ diff --git a/gemfiles/3.3/Gemfile.lock b/gemfiles/3.3/Gemfile.lock index f61d58cbcff..bd36b3c1e3c 100644 --- a/gemfiles/3.3/Gemfile.lock +++ b/gemfiles/3.3/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: ../.. specs: - prism (0.28.0) + prism (0.29.0) GEM remote: https://rubygems.org/ diff --git a/gemfiles/3.4/Gemfile.lock b/gemfiles/3.4/Gemfile.lock index 6edbf8044c8..a685ef0f49b 100644 --- a/gemfiles/3.4/Gemfile.lock +++ b/gemfiles/3.4/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: ../.. specs: - prism (0.28.0) + prism (0.29.0) GEM remote: https://rubygems.org/ diff --git a/gemfiles/jruby/Gemfile.lock b/gemfiles/jruby/Gemfile.lock index d5ec924000a..3be9525ebe0 100644 --- a/gemfiles/jruby/Gemfile.lock +++ b/gemfiles/jruby/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: ../.. specs: - prism (0.28.0) + prism (0.29.0) GEM remote: https://rubygems.org/ diff --git a/gemfiles/truffleruby/Gemfile.lock b/gemfiles/truffleruby/Gemfile.lock index 666e1b1e369..36079707322 100644 --- a/gemfiles/truffleruby/Gemfile.lock +++ b/gemfiles/truffleruby/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: ../.. specs: - prism (0.28.0) + prism (0.29.0) GEM remote: https://rubygems.org/ diff --git a/gemfiles/typecheck/Gemfile.lock b/gemfiles/typecheck/Gemfile.lock index fc26a1074b3..a7d8f735f4b 100644 --- a/gemfiles/typecheck/Gemfile.lock +++ b/gemfiles/typecheck/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: ../.. specs: - prism (0.28.0) + prism (0.29.0) GEM remote: https://rubygems.org/ diff --git a/include/prism/version.h b/include/prism/version.h index 195d1dab0a0..154e967944a 100644 --- a/include/prism/version.h +++ b/include/prism/version.h @@ -14,7 +14,7 @@ /** * The minor version of the Prism library as an int. */ -#define PRISM_VERSION_MINOR 28 +#define PRISM_VERSION_MINOR 29 /** * The patch version of the Prism library as an int. @@ -24,6 +24,6 @@ /** * The version of the Prism library as a constant string. */ -#define PRISM_VERSION "0.28.0" +#define PRISM_VERSION "0.29.0" #endif diff --git a/javascript/package.json b/javascript/package.json index 80b6e2d3d64..7f02fc49739 100644 --- a/javascript/package.json +++ b/javascript/package.json @@ -1,6 +1,6 @@ { "name": "@ruby/prism", - "version": "0.28.0", + "version": "0.29.0", "description": "Prism Ruby parser", "type": "module", "main": "src/index.js", diff --git a/prism.gemspec b/prism.gemspec index 73ec01251f0..374591bb707 100644 --- a/prism.gemspec +++ b/prism.gemspec @@ -2,7 +2,7 @@ Gem::Specification.new do |spec| spec.name = "prism" - spec.version = "0.28.0" + spec.version = "0.29.0" spec.authors = ["Shopify"] spec.email = ["ruby@shopify.com"] diff --git a/rust/Cargo.lock b/rust/Cargo.lock index b10780e111e..6b340beedcf 100644 --- a/rust/Cargo.lock +++ b/rust/Cargo.lock @@ -267,7 +267,7 @@ checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" [[package]] name = "ruby-prism" -version = "0.28.0" +version = "0.29.0" dependencies = [ "ruby-prism-sys", "serde", @@ -276,7 +276,7 @@ dependencies = [ [[package]] name = "ruby-prism-sys" -version = "0.28.0" +version = "0.29.0" dependencies = [ "bindgen", "cc", diff --git a/rust/ruby-prism-sys/Cargo.toml b/rust/ruby-prism-sys/Cargo.toml index fddbac66ea0..ffc834087b9 100644 --- a/rust/ruby-prism-sys/Cargo.toml +++ b/rust/ruby-prism-sys/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ruby-prism-sys" -version = "0.28.0" +version = "0.29.0" edition = "2021" license-file = "../../LICENSE.md" repository = "https://github.com/ruby/prism" diff --git a/rust/ruby-prism-sys/tests/utils_tests.rs b/rust/ruby-prism-sys/tests/utils_tests.rs index 25c09ce4b31..b7ecbf81030 100644 --- a/rust/ruby-prism-sys/tests/utils_tests.rs +++ b/rust/ruby-prism-sys/tests/utils_tests.rs @@ -12,7 +12,7 @@ fn version_test() { CStr::from_ptr(version) }; - assert_eq!(&cstring.to_string_lossy(), "0.28.0"); + assert_eq!(&cstring.to_string_lossy(), "0.29.0"); } #[test] diff --git a/rust/ruby-prism/Cargo.toml b/rust/ruby-prism/Cargo.toml index 6bf280ccce7..7e7411e6853 100644 --- a/rust/ruby-prism/Cargo.toml +++ b/rust/ruby-prism/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ruby-prism" -version = "0.28.0" +version = "0.29.0" edition = "2021" license-file = "../../LICENSE.md" repository = "https://github.com/ruby/prism" @@ -26,7 +26,7 @@ serde = { version = "1.0", features = ["derive"] } serde_yaml = "0.9" [dependencies] -ruby-prism-sys = { version = "0.28.0", path = "../ruby-prism-sys" } +ruby-prism-sys = { version = "0.29.0", path = "../ruby-prism-sys" } [features] default = ["vendored"] diff --git a/templates/java/org/prism/Loader.java.erb b/templates/java/org/prism/Loader.java.erb index 18265e57df1..823a01f36db 100644 --- a/templates/java/org/prism/Loader.java.erb +++ b/templates/java/org/prism/Loader.java.erb @@ -101,7 +101,7 @@ public class Loader { expect((byte) 'M', "incorrect prism header"); expect((byte) 0, "prism major version does not match"); - expect((byte) 28, "prism minor version does not match"); + expect((byte) 29, "prism minor version does not match"); expect((byte) 0, "prism patch version does not match"); expect((byte) 1, "Loader.java requires no location fields in the serialized output"); diff --git a/templates/javascript/src/deserialize.js.erb b/templates/javascript/src/deserialize.js.erb index 12cac1badd6..5ddb130e361 100644 --- a/templates/javascript/src/deserialize.js.erb +++ b/templates/javascript/src/deserialize.js.erb @@ -1,7 +1,7 @@ import * as nodes from "./nodes.js"; const MAJOR_VERSION = 0; -const MINOR_VERSION = 28; +const MINOR_VERSION = 29; const PATCH_VERSION = 0; // The DataView getFloat64 function takes an optional second argument that diff --git a/templates/lib/prism/serialize.rb.erb b/templates/lib/prism/serialize.rb.erb index 370b6297997..756821cf7d7 100644 --- a/templates/lib/prism/serialize.rb.erb +++ b/templates/lib/prism/serialize.rb.erb @@ -10,7 +10,7 @@ module Prism # The minor version of prism that we are expecting to find in the serialized # strings. - MINOR_VERSION = 28 + MINOR_VERSION = 29 # The patch version of prism that we are expecting to find in the serialized # strings.