From c9edeef91a93d881cb95262fd0a3087e55f31b07 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Tue, 23 Apr 2024 15:50:56 -0400 Subject: [PATCH] Bump to v0.27.0 --- .github/workflows/main.yml | 34 ++++++++++----------- CHANGELOG.md | 21 ++++++++++++- Gemfile.lock | 2 +- 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 | 2 +- include/prism/version.h | 4 +-- javascript/package.json | 2 +- prism.gemspec | 2 +- rust/Cargo.lock | 4 +-- 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 +- 23 files changed, 61 insertions(+), 42 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 07453084b3f..6c5ee9d575a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -38,23 +38,23 @@ jobs: env: LANG: "C" - typecheck: - runs-on: ubuntu-latest - env: - BUNDLE_GEMFILE: gemfiles/typecheck/Gemfile - steps: - - uses: actions/checkout@v4 - - name: Set up Ruby - uses: ruby/setup-ruby@v1 - with: - ruby-version: "3.3" - bundler-cache: true - # - name: Check Sorbet - # run: bundle exec rake typecheck:tapioca typecheck:sorbet - - name: Check Steep - run: bundle exec rake typecheck:steep - - name: Check field kinds - run: rm lib/prism/node.rb && CHECK_FIELD_KIND=true bundle exec rake + # typecheck: + # runs-on: ubuntu-latest + # env: + # BUNDLE_GEMFILE: gemfiles/typecheck/Gemfile + # steps: + # - uses: actions/checkout@v4 + # - name: Set up Ruby + # uses: ruby/setup-ruby@v1 + # with: + # ruby-version: "3.3" + # bundler-cache: true + # - name: Check Sorbet + # run: bundle exec rake typecheck:tapioca typecheck:sorbet + # - name: Check Steep + # run: bundle exec rake typecheck:steep + # - name: Check field kinds + # run: rm lib/prism/node.rb && CHECK_FIELD_KIND=true bundle exec rake build: strategy: diff --git a/CHANGELOG.md b/CHANGELOG.md index 348555a6bb8..1c739c6e2e6 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.27.0] - 2024-04-23 + +### Added + +- Implemented `===` for each of the nodes, which will check if equality but ignore the specific ranges of locations. + +### Changed + +- Fix translation of `ItParametersNode` for parser translation. +- Fix translation of `dstr` for ruby_parser translation. +- Do not allow omitted hash values whose keys end with `!` or `?`. +- Split up `Prism::ParseResult` into `Prism::Result` with subclasses `Prism::ParseResult`, `Prism::LexResult`, `Prism::ParseLexResult`, and `Prism::LexCompat::Result`. +- Change reflection classes to have only a single `IntegerField` class and rename `DoubleField` to `FloatField`. +- Fall back to default `AR` and `CC` in `Makefile`. +- Use GC-able symbols for the syntax tree to avoid adding to the global symbol table. +- Fix a bug with karatsuba_multiply that would result in a stack overflow. +- Fix parser translation when looking for tokens with `srange_find`. + ## [0.26.0] - 2024-04-18 ### Added @@ -458,7 +476,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.26.0...HEAD +[unreleased]: https://github.com/ruby/prism/compare/v0.27.0...HEAD +[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 [0.25.0]: https://github.com/ruby/prism/compare/v0.24.0...v0.25.0 [0.24.0]: https://github.com/ruby/prism/compare/v0.23.0...v0.24.0 diff --git a/Gemfile.lock b/Gemfile.lock index e4ef18a4bf4..91ed09ed231 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - prism (0.26.0) + prism (0.27.0) GEM remote: https://rubygems.org/ diff --git a/ext/prism/extension.h b/ext/prism/extension.h index 3e407d97aec..9134959783c 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.26.0" +#define EXPECTED_PRISM_VERSION "0.27.0" #include #include diff --git a/gemfiles/2.7/Gemfile.lock b/gemfiles/2.7/Gemfile.lock index b76bb52fe53..8c510b93efe 100644 --- a/gemfiles/2.7/Gemfile.lock +++ b/gemfiles/2.7/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: ../.. specs: - prism (0.26.0) + prism (0.27.0) GEM remote: https://rubygems.org/ diff --git a/gemfiles/3.0/Gemfile.lock b/gemfiles/3.0/Gemfile.lock index a0862abce5e..f0ffb2231bb 100644 --- a/gemfiles/3.0/Gemfile.lock +++ b/gemfiles/3.0/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: ../.. specs: - prism (0.26.0) + prism (0.27.0) GEM remote: https://rubygems.org/ diff --git a/gemfiles/3.1/Gemfile.lock b/gemfiles/3.1/Gemfile.lock index d15d45b0833..859e940cc20 100644 --- a/gemfiles/3.1/Gemfile.lock +++ b/gemfiles/3.1/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: ../.. specs: - prism (0.26.0) + prism (0.27.0) GEM remote: https://rubygems.org/ diff --git a/gemfiles/3.2/Gemfile.lock b/gemfiles/3.2/Gemfile.lock index 84e18d2d5f8..65de9ae5c71 100644 --- a/gemfiles/3.2/Gemfile.lock +++ b/gemfiles/3.2/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: ../.. specs: - prism (0.26.0) + prism (0.27.0) GEM remote: https://rubygems.org/ diff --git a/gemfiles/3.3/Gemfile.lock b/gemfiles/3.3/Gemfile.lock index 3df30df550c..fb1bb192058 100644 --- a/gemfiles/3.3/Gemfile.lock +++ b/gemfiles/3.3/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: ../.. specs: - prism (0.26.0) + prism (0.27.0) GEM remote: https://rubygems.org/ diff --git a/gemfiles/3.4/Gemfile.lock b/gemfiles/3.4/Gemfile.lock index 95d28c90537..71c89a28c2d 100644 --- a/gemfiles/3.4/Gemfile.lock +++ b/gemfiles/3.4/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: ../.. specs: - prism (0.26.0) + prism (0.27.0) GEM remote: https://rubygems.org/ diff --git a/gemfiles/jruby/Gemfile.lock b/gemfiles/jruby/Gemfile.lock index 94a0dc68ddd..8ce32517bb3 100644 --- a/gemfiles/jruby/Gemfile.lock +++ b/gemfiles/jruby/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: ../.. specs: - prism (0.26.0) + prism (0.27.0) GEM remote: https://rubygems.org/ diff --git a/gemfiles/truffleruby/Gemfile.lock b/gemfiles/truffleruby/Gemfile.lock index b88f07edf47..9fa18a6225c 100644 --- a/gemfiles/truffleruby/Gemfile.lock +++ b/gemfiles/truffleruby/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: ../.. specs: - prism (0.26.0) + prism (0.27.0) GEM remote: https://rubygems.org/ diff --git a/gemfiles/typecheck/Gemfile.lock b/gemfiles/typecheck/Gemfile.lock index f0046a3a620..74def7dd2e5 100644 --- a/gemfiles/typecheck/Gemfile.lock +++ b/gemfiles/typecheck/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: ../.. specs: - prism (0.26.0) + prism (0.27.0) GEM remote: https://rubygems.org/ diff --git a/include/prism/version.h b/include/prism/version.h index 489a8107cf4..0d25b2883c0 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 26 +#define PRISM_VERSION_MINOR 27 /** * 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.26.0" +#define PRISM_VERSION "0.27.0" #endif diff --git a/javascript/package.json b/javascript/package.json index 01c2ec8014c..a0c8b370d40 100644 --- a/javascript/package.json +++ b/javascript/package.json @@ -1,6 +1,6 @@ { "name": "@ruby/prism", - "version": "0.26.0", + "version": "0.27.0", "description": "Prism Ruby parser", "type": "module", "main": "src/index.js", diff --git a/prism.gemspec b/prism.gemspec index e0134ff8ad9..ae956f1206f 100644 --- a/prism.gemspec +++ b/prism.gemspec @@ -2,7 +2,7 @@ Gem::Specification.new do |spec| spec.name = "prism" - spec.version = "0.26.0" + spec.version = "0.27.0" spec.authors = ["Shopify"] spec.email = ["ruby@shopify.com"] diff --git a/rust/Cargo.lock b/rust/Cargo.lock index 9a853b3808a..2f0891c24eb 100644 --- a/rust/Cargo.lock +++ b/rust/Cargo.lock @@ -267,7 +267,7 @@ checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" [[package]] name = "ruby-prism" -version = "0.26.0" +version = "0.27.0" dependencies = [ "ruby-prism-sys", "serde", @@ -276,7 +276,7 @@ dependencies = [ [[package]] name = "ruby-prism-sys" -version = "0.26.0" +version = "0.27.0" dependencies = [ "bindgen", "cc", diff --git a/rust/ruby-prism-sys/Cargo.toml b/rust/ruby-prism-sys/Cargo.toml index 58ac465cc5a..5e1daeb5581 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.26.0" +version = "0.27.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 5d7dafd4921..bb32f10194d 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.26.0"); + assert_eq!(&cstring.to_string_lossy(), "0.27.0"); } #[test] diff --git a/rust/ruby-prism/Cargo.toml b/rust/ruby-prism/Cargo.toml index 62fa64879e7..89b1be09170 100644 --- a/rust/ruby-prism/Cargo.toml +++ b/rust/ruby-prism/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ruby-prism" -version = "0.26.0" +version = "0.27.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.26.0", path = "../ruby-prism-sys" } +ruby-prism-sys = { version = "0.27.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 f2076d55acb..de44487d82f 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) 26, "prism minor version does not match"); + expect((byte) 27, "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 d89450d5432..ef43127c67d 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 = 26; +const MINOR_VERSION = 27; 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 0ba2e81c74e..c31a319e5f7 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 = 26 + MINOR_VERSION = 27 # The patch version of prism that we are expecting to find in the serialized # strings.