Skip to content

Commit

Permalink
Update to v0.18.0 (#1902)
Browse files Browse the repository at this point in the history
  • Loading branch information
kddnewton authored Nov 21, 2023
1 parent 46b8576 commit 6ca8896
Show file tree
Hide file tree
Showing 14 changed files with 49 additions and 20 deletions.
31 changes: 30 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,34 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a

## [Unreleased]

## [0.18.0] - 2023-11-21

### Added

- The `ParametersNode#signature` method is added, which returns the same thing as `Method#parameters`.
- Visitor functionality has been added to the JavaScript API.
- The `Node#to_dot` API has been added to convert syntax trees to Graphviz digraphs.
- `IfNode` and `UnlessNode` now have a `then_keyword_loc` field.
- Many more encodings are now supported.
- Some new `Location` APIs have been added for dealing with characters instead of bytes, which are: `start_character_offset`, `end_character_offset`, `start_character_column`, and `end_character_column`.
- A warning has been added for when `END {}` is used within a method.
- `ConstantPathNode#full_name{,_parts}` will now raise an error if the receiver of the constant path is not itself a constant.
- The `in` keyword and the `=>` operator now respect non-associativity.
- The `..` and `...` operators now properly respect non-associativity.

### Changed

- Previously `...` in blocks was accepted, but it is now properly rejected.
- **BREAKING**: `librubyparser.*` has been renamed to `libprism.*` in the C API.
- We now properly reject floats with exponent and rational suffixes.
- We now properly reject void value expressions.
- **BREAKING**: The `--disable-static` option has been removed from the C extension.
- The rescue modifier keyword is now properly parsed in terms of precedence.
- We now properly reject defining a numbered parameter method.
- **BREAKING**: `MatchWriteNode` now has a list of `targets`, which are local variable target nodes. This is instead of `locals` which was a constant list. This is to support writing to local variables outside the current scope. It has the added benefit of providing location information for the local variable targets.
- **BREAKING**: `CaseNode` has been split into `CaseNode` and `CaseMatchNode`, the latter is used for `case ... in` expressions.
- **BREAKING**: `StringConcatNode` has been removed in favor of using `InterpolatedStringNode` as a list.

## [0.17.1] - 2023-11-03

### Changed
Expand Down Expand Up @@ -239,7 +267,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.17.1...HEAD
[unreleased]: https://github.com/ruby/prism/compare/v0.18.0...HEAD
[0.18.0]: https://github.com/ruby/prism/compare/v0.17.1...v0.18.0
[0.17.1]: https://github.com/ruby/prism/compare/v0.17.0...v0.17.1
[0.17.0]: https://github.com/ruby/prism/compare/v0.16.0...v0.17.0
[0.16.0]: https://github.com/ruby/prism/compare/v0.15.1...v0.16.0
Expand Down
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
prism (0.17.1)
prism (0.18.0)

GEM
remote: https://rubygems.org/
Expand Down
2 changes: 1 addition & 1 deletion ext/prism/extension.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef PRISM_EXT_NODE_H
#define PRISM_EXT_NODE_H

#define EXPECTED_PRISM_VERSION "0.17.1"
#define EXPECTED_PRISM_VERSION "0.18.0"

#include <ruby.h>
#include <ruby/encoding.h>
Expand Down
6 changes: 3 additions & 3 deletions include/prism/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@
/**
* The minor version of the Prism library as an int.
*/
#define PRISM_VERSION_MINOR 17
#define PRISM_VERSION_MINOR 18

/**
* The patch version of the Prism library as an int.
*/
#define PRISM_VERSION_PATCH 1
#define PRISM_VERSION_PATCH 0

/**
* The version of the Prism library as a constant string.
*/
#define PRISM_VERSION "0.17.1"
#define PRISM_VERSION "0.18.0"

#endif
2 changes: 1 addition & 1 deletion javascript/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ruby/prism",
"version": "0.17.1",
"version": "0.18.0",
"description": "Prism Ruby parser",
"type": "module",
"main": "src/index.js",
Expand Down
2 changes: 1 addition & 1 deletion prism.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Gem::Specification.new do |spec|
spec.name = "prism"
spec.version = "0.17.1"
spec.version = "0.18.0"
spec.authors = ["Shopify"]
spec.email = ["[email protected]"]

Expand Down
2 changes: 1 addition & 1 deletion rust/prism-sys/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion rust/prism-sys/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "prism-sys"
version = "0.17.1"
version = "0.18.0"
edition = "2021"
license-file = "../../LICENSE.md"
repository = "https://github.com/ruby/prism"
Expand Down
2 changes: 1 addition & 1 deletion rust/prism-sys/tests/utils_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ fn version_test() {
CStr::from_ptr(version)
};

assert_eq!(&cstring.to_string_lossy(), "0.17.1");
assert_eq!(&cstring.to_string_lossy(), "0.18.0");
}

#[test]
Expand Down
4 changes: 2 additions & 2 deletions rust/prism/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion rust/prism/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "prism"
version = "0.17.1"
version = "0.18.0"
edition = "2021"
license-file = "../../LICENSE.md"
repository = "https://github.com/ruby/prism"
Expand Down
4 changes: 2 additions & 2 deletions templates/java/org/prism/Loader.java.erb
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@ public class Loader {
expect((byte) 'M', "incorrect prism header");

expect((byte) 0, "prism version does not match");
expect((byte) 17, "prism version does not match");
expect((byte) 1, "prism version does not match");
expect((byte) 18, "prism version does not match");
expect((byte) 0, "prism version does not match");

expect((byte) 1, "Loader.java requires no location fields in the serialized output");

Expand Down
4 changes: 2 additions & 2 deletions templates/javascript/src/deserialize.js.erb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import * as nodes from "./nodes.js";

const MAJOR_VERSION = 0;
const MINOR_VERSION = 17;
const PATCH_VERSION = 1;
const MINOR_VERSION = 18;
const PATCH_VERSION = 0;

class SerializationBuffer {
constructor(source, array) {
Expand Down
4 changes: 2 additions & 2 deletions templates/lib/prism/serialize.rb.erb
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ module Prism

# The minor version of prism that we are expecting to find in the serialized
# strings.
MINOR_VERSION = 17
MINOR_VERSION = 18

# The patch version of prism that we are expecting to find in the serialized
# strings.
PATCH_VERSION = 1
PATCH_VERSION = 0

# Deserialize the AST represented by the given string into a parse result.
def self.load(input, serialized)
Expand Down

0 comments on commit 6ca8896

Please sign in to comment.