From a679ee0e5c473da22b22949afd2f661333cb0513 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Sat, 21 Dec 2024 14:06:46 -0500 Subject: [PATCH 1/2] Bump to v1.3.0 --- CHANGELOG.md | 24 ++++++++++++++++++++- Gemfile.lock | 4 ++-- ext/prism/extension.h | 2 +- gemfiles/2.7/Gemfile.lock | 2 +- gemfiles/3.0/Gemfile.lock | 2 +- gemfiles/3.1/Gemfile.lock | 2 +- gemfiles/3.2/Gemfile.lock | 2 +- gemfiles/3.3/Gemfile.lock | 2 +- gemfiles/3.4/Gemfile.lock | 2 +- gemfiles/jruby/Gemfile.lock | 2 +- gemfiles/truffleruby/Gemfile.lock | 2 +- gemfiles/typecheck/Gemfile.lock | 3 +-- include/prism/version.h | 4 ++-- javascript/package.json | 2 +- prism.gemspec | 2 +- rust/ruby-prism-sys/Cargo.toml | 2 +- rust/ruby-prism-sys/tests/utils_tests.rs | 2 +- rust/ruby-prism/Cargo.toml | 4 ++-- templates/java/org/prism/Loader.java.erb | 2 +- templates/javascript/src/deserialize.js.erb | 2 +- templates/lib/prism/serialize.rb.erb | 2 +- 21 files changed, 46 insertions(+), 25 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3d198e79b1..a644f47b23 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,27 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a ## [Unreleased] +## [1.3.0] - 2024-12-21 + +### Added + +- Introduce `Prism::StringQuery`. +- Introduce `Prism::Relocation`. +- Track `do` keyword for `WhileNode` and `UntilNode`. +- Change the way the gem is built to rely on `mkmf` instead of `make`. +- Lots more documentation on node fields. + +### Changed + +- Properly add an error for `def @foo; end`. +- Properly add an error for `foo(**, *)`. +- Fix up regression in string parsing in `RubyParser` translation. +- Reject invalid dot method call after match expression. +- Reject invalid operator after match expression. +- Fix up %-literals delimited by newlines. +- Properly add an error for `-> { _1; -> { _1 } }`. +- Reject blocks and keywords in index writes. + ## [1.2.0] - 2024-10-10 ### Added @@ -606,7 +627,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/v1.2.0...HEAD +[unreleased]: https://github.com/ruby/prism/compare/v1.3.0...HEAD +[1.3.0]: https://github.com/ruby/prism/compare/v1.2.0...v1.3.0 [1.2.0]: https://github.com/ruby/prism/compare/v1.1.0...v1.2.0 [1.1.0]: https://github.com/ruby/prism/compare/v1.0.0...v1.1.0 [1.0.0]: https://github.com/ruby/prism/compare/v0.30.0...v1.0.0 diff --git a/Gemfile.lock b/Gemfile.lock index d6dad59c41..1beb0c068f 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - prism (1.2.0) + prism (1.3.0) GEM remote: https://rubygems.org/ @@ -53,4 +53,4 @@ DEPENDENCIES test-unit BUNDLED WITH - 2.6.0.dev + 2.6.1 diff --git a/ext/prism/extension.h b/ext/prism/extension.h index 5241f8dc1e..6fe3965d9a 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 "1.2.0" +#define EXPECTED_PRISM_VERSION "1.3.0" #include #include diff --git a/gemfiles/2.7/Gemfile.lock b/gemfiles/2.7/Gemfile.lock index 9fa8214655..ab232af100 100644 --- a/gemfiles/2.7/Gemfile.lock +++ b/gemfiles/2.7/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: ../.. specs: - prism (1.2.0) + prism (1.3.0) GEM remote: https://rubygems.org/ diff --git a/gemfiles/3.0/Gemfile.lock b/gemfiles/3.0/Gemfile.lock index 6b7ed2ea83..4870dde4a8 100644 --- a/gemfiles/3.0/Gemfile.lock +++ b/gemfiles/3.0/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: ../.. specs: - prism (1.2.0) + prism (1.3.0) GEM remote: https://rubygems.org/ diff --git a/gemfiles/3.1/Gemfile.lock b/gemfiles/3.1/Gemfile.lock index 12af49a7d1..3507c6ac8b 100644 --- a/gemfiles/3.1/Gemfile.lock +++ b/gemfiles/3.1/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: ../.. specs: - prism (1.2.0) + prism (1.3.0) GEM remote: https://rubygems.org/ diff --git a/gemfiles/3.2/Gemfile.lock b/gemfiles/3.2/Gemfile.lock index 98ddc26fb5..b64cd13a40 100644 --- a/gemfiles/3.2/Gemfile.lock +++ b/gemfiles/3.2/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: ../.. specs: - prism (1.2.0) + prism (1.3.0) GEM remote: https://rubygems.org/ diff --git a/gemfiles/3.3/Gemfile.lock b/gemfiles/3.3/Gemfile.lock index 349b72ef52..34694f08a2 100644 --- a/gemfiles/3.3/Gemfile.lock +++ b/gemfiles/3.3/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: ../.. specs: - prism (1.2.0) + prism (1.3.0) GEM remote: https://rubygems.org/ diff --git a/gemfiles/3.4/Gemfile.lock b/gemfiles/3.4/Gemfile.lock index 06f41f1383..8285927d9a 100644 --- a/gemfiles/3.4/Gemfile.lock +++ b/gemfiles/3.4/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: ../.. specs: - prism (1.2.0) + prism (1.3.0) GEM remote: https://rubygems.org/ diff --git a/gemfiles/jruby/Gemfile.lock b/gemfiles/jruby/Gemfile.lock index 8c7ced6f42..57390348f2 100644 --- a/gemfiles/jruby/Gemfile.lock +++ b/gemfiles/jruby/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: ../.. specs: - prism (1.2.0) + prism (1.3.0) GEM remote: https://rubygems.org/ diff --git a/gemfiles/truffleruby/Gemfile.lock b/gemfiles/truffleruby/Gemfile.lock index 8c546f7144..e0733dbac3 100644 --- a/gemfiles/truffleruby/Gemfile.lock +++ b/gemfiles/truffleruby/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: ../.. specs: - prism (1.2.0) + prism (1.3.0) GEM remote: https://rubygems.org/ diff --git a/gemfiles/typecheck/Gemfile.lock b/gemfiles/typecheck/Gemfile.lock index 2ebcf454e3..17b594ad31 100644 --- a/gemfiles/typecheck/Gemfile.lock +++ b/gemfiles/typecheck/Gemfile.lock @@ -23,8 +23,7 @@ GEM csv (3.3.0) drb (2.2.1) erubi (1.13.0) - ffi (1.17.0-arm64-darwin) - ffi (1.17.0-x86_64-linux-gnu) + ffi (1.17.0) fileutils (1.7.3) i18n (1.14.6) concurrent-ruby (~> 1.0) diff --git a/include/prism/version.h b/include/prism/version.h index e3fd9308cd..35cc835d23 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 2 +#define PRISM_VERSION_MINOR 3 /** * 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 "1.2.0" +#define PRISM_VERSION "1.3.0" #endif diff --git a/javascript/package.json b/javascript/package.json index 3f2c36943f..09426e2001 100644 --- a/javascript/package.json +++ b/javascript/package.json @@ -1,6 +1,6 @@ { "name": "@ruby/prism", - "version": "1.2.0", + "version": "1.3.0", "description": "Prism Ruby parser", "type": "module", "main": "src/index.js", diff --git a/prism.gemspec b/prism.gemspec index 0682ca9b1c..56979c0ef6 100644 --- a/prism.gemspec +++ b/prism.gemspec @@ -2,7 +2,7 @@ Gem::Specification.new do |spec| spec.name = "prism" - spec.version = "1.2.0" + spec.version = "1.3.0" spec.authors = ["Shopify"] spec.email = ["ruby@shopify.com"] diff --git a/rust/ruby-prism-sys/Cargo.toml b/rust/ruby-prism-sys/Cargo.toml index 264dc6e5ca..51d3484baa 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 = "1.2.0" +version = "1.3.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 3a75068579..579891f4f6 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(), "1.2.0"); + assert_eq!(&cstring.to_string_lossy(), "1.3.0"); } #[test] diff --git a/rust/ruby-prism/Cargo.toml b/rust/ruby-prism/Cargo.toml index d3497dec3d..3d7d97645c 100644 --- a/rust/ruby-prism/Cargo.toml +++ b/rust/ruby-prism/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ruby-prism" -version = "1.2.0" +version = "1.3.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 = "1.2.0", path = "../ruby-prism-sys" } +ruby-prism-sys = { version = "1.3.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 032cf017c2..088f57d248 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) 1, "prism major version does not match"); - expect((byte) 2, "prism minor version does not match"); + expect((byte) 3, "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 36f5c8fc7c..62b452028e 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 = 1; -const MINOR_VERSION = 2; +const MINOR_VERSION = 3; 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 3750fdaa7b..01c0a6cb2d 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 = 2 + MINOR_VERSION = 3 # The patch version of prism that we are expecting to find in the serialized # strings. From b2874df7ea63bf84e962d337a465d0ce9698030a Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Sat, 21 Dec 2024 14:17:14 -0500 Subject: [PATCH 2/2] Use 2.7 Gemfile for template CI --- .github/workflows/main.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index bda96cf05f..4b6420de5a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -25,16 +25,17 @@ jobs: template: runs-on: ubuntu-latest + env: + BUNDLE_GEMFILE: gemfiles/2.7/Gemfile steps: - uses: actions/checkout@v4 - name: Set up Ruby uses: ruby/setup-ruby@v1 with: ruby-version: "2.7.0" - - name: Install necessary gems - run: gem install rake rake-compiler + bundler-cache: true - name: Generate templates - run: rake templates + run: bundle exec rake templates env: LANG: "C"