From a0a6405ab04466a76c04974b01c8ea71c5f4e0c1 Mon Sep 17 00:00:00 2001 From: Dmitry Dygalo Date: Mon, 24 Mar 2025 10:26:50 +0100 Subject: [PATCH 001/333] feat: add `Integer::to_u32_digits` Signed-off-by: Dmitry Dygalo --- rust/ruby-prism/src/lib.rs | 40 +++++++++++++++++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/rust/ruby-prism/src/lib.rs b/rust/ruby-prism/src/lib.rs index 1d86b7eeb7..03fb21575d 100644 --- a/rust/ruby-prism/src/lib.rs +++ b/rust/ruby-prism/src/lib.rs @@ -250,6 +250,23 @@ impl<'pr> Integer<'pr> { fn new(pointer: *const pm_integer_t) -> Self { Integer { pointer, marker: PhantomData } } + + /// Returns the sign and the u32 digits representation of the integer, + /// ordered least significant digit first. + pub fn to_u32_digits(&self) -> (bool, &[u32]) { + let negative = unsafe { (*self.pointer).negative }; + let length = unsafe { (*self.pointer).length }; + let values = unsafe { (*self.pointer).values }; + + if values.is_null() { + let value_ptr = unsafe { std::ptr::addr_of!((*self.pointer).value) }; + let slice = unsafe { std::slice::from_raw_parts(value_ptr, 1) }; + (negative, slice) + } else { + let slice = unsafe { std::slice::from_raw_parts(values, length) }; + (negative, slice) + } + } } impl std::fmt::Debug for Integer<'_> { @@ -1144,11 +1161,32 @@ end #[test] fn integer_value_test() { let result = parse("0xA".as_ref()); - let value: i32 = result.node().as_program_node().unwrap().statements().body().iter().next().unwrap().as_integer_node().unwrap().value().try_into().unwrap(); + let integer = result.node().as_program_node().unwrap().statements().body().iter().next().unwrap().as_integer_node().unwrap().value(); + let value: i32 = integer.try_into().unwrap(); assert_eq!(value, 10); } + #[test] + fn integer_small_value_to_u32_digits_test() { + let result = parse("0xA".as_ref()); + let integer = result.node().as_program_node().unwrap().statements().body().iter().next().unwrap().as_integer_node().unwrap().value(); + let (negative, digits) = integer.to_u32_digits(); + + assert!(!negative); + assert_eq!(digits, &[10]); + } + + #[test] + fn integer_large_value_to_u32_digits_test() { + let result = parse("0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF".as_ref()); + let integer = result.node().as_program_node().unwrap().statements().body().iter().next().unwrap().as_integer_node().unwrap().value(); + let (negative, digits) = integer.to_u32_digits(); + + assert!(!negative); + assert_eq!(digits, &[4294967295, 4294967295, 4294967295, 2147483647]); + } + #[test] fn float_value_test() { let result = parse("1.0".as_ref()); From bf79ef2df1e6e493c6f1bd7f6794f9b0ec3a9eee Mon Sep 17 00:00:00 2001 From: Earlopain <14981592+Earlopain@users.noreply.github.com> Date: Mon, 24 Mar 2025 14:18:08 +0100 Subject: [PATCH 002/333] Mention the prism/parser guide from the `parser` gem I wrote something up on how to use both if you need to also parse older ruby versions. --- docs/parser_translation.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/parser_translation.md b/docs/parser_translation.md index 55fd3e4c22..dc0f452f2c 100644 --- a/docs/parser_translation.md +++ b/docs/parser_translation.md @@ -20,6 +20,9 @@ Prism::Translation::ParserCurrent.parse("puts 'Hello World!'") All the parsers are autoloaded, so you don't have to worry about requiring them yourself. +If you also need to parse Ruby versions below 3.3 (which `prism` has no support for), check out +[this guide](https://github.com/whitequark/parser/blob/master/doc/PRISM_TRANSLATION.md) from the `parser` gem on how to use both in conjunction. + ### RuboCop Prism as a parser engine is directly supported since RuboCop 1.62. From 80dbd85c459d166a550cd75431b3a8e367953148 Mon Sep 17 00:00:00 2001 From: Earlopain <14981592+Earlopain@users.noreply.github.com> Date: Sun, 30 Mar 2025 13:28:36 +0200 Subject: [PATCH 003/333] Fix parser translator when splatting in pattern matching pin Because it ends up treating it as a local variable, and `a.x` is not a valid local variable name. I'm not big on pattern matching, but conceptually it makes sense to me to treat anything inside ^() to not be pattern matching syntax? --- lib/prism/translation/parser/compiler.rb | 3 +- snapshots/patterns.txt | 209 ++++++++++++++++++----- test/prism/fixtures/patterns.txt | 4 + 3 files changed, 169 insertions(+), 47 deletions(-) diff --git a/lib/prism/translation/parser/compiler.rb b/lib/prism/translation/parser/compiler.rb index acf4e77ee4..1beccc30a1 100644 --- a/lib/prism/translation/parser/compiler.rb +++ b/lib/prism/translation/parser/compiler.rb @@ -1481,7 +1481,8 @@ def visit_parentheses_node(node) # foo => ^(bar) # ^^^^^^ def visit_pinned_expression_node(node) - expression = builder.begin(token(node.lparen_loc), visit(node.expression), token(node.rparen_loc)) + parts = node.expression.accept(copy_compiler(in_pattern: false)) # Don't treat * and similar as match_rest + expression = builder.begin(token(node.lparen_loc), parts, token(node.rparen_loc)) builder.pin(token(node.operator_loc), expression) end diff --git a/snapshots/patterns.txt b/snapshots/patterns.txt index fc0f6e7cef..96c765a3c8 100644 --- a/snapshots/patterns.txt +++ b/snapshots/patterns.txt @@ -1,10 +1,10 @@ -@ ProgramNode (location: (1,0)-(220,14)) +@ ProgramNode (location: (1,0)-(224,14)) ├── flags: ∅ ├── locals: [:bar, :baz, :qux, :b, :a, :foo, :x, :_a] └── statements: - @ StatementsNode (location: (1,0)-(220,14)) + @ StatementsNode (location: (1,0)-(224,14)) ├── flags: ∅ - └── body: (length: 187) + └── body: (length: 190) ├── @ MatchRequiredNode (location: (1,0)-(1,10)) │ ├── flags: newline │ ├── value: @@ -5727,49 +5727,166 @@ │ │ ├── closing_loc: ∅ │ │ └── block: ∅ │ └── operator_loc: (219,10)-(219,13) = "and" - └── @ OrNode (location: (220,0)-(220,14)) + ├── @ OrNode (location: (220,0)-(220,14)) + │ ├── flags: newline + │ ├── left: + │ │ @ ParenthesesNode (location: (220,0)-(220,9)) + │ │ ├── flags: ∅ + │ │ ├── body: + │ │ │ @ StatementsNode (location: (220,1)-(220,8)) + │ │ │ ├── flags: ∅ + │ │ │ └── body: (length: 1) + │ │ │ └── @ MatchPredicateNode (location: (220,1)-(220,8)) + │ │ │ ├── flags: newline + │ │ │ ├── value: + │ │ │ │ @ LocalVariableReadNode (location: (220,1)-(220,2)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── name: :a + │ │ │ │ └── depth: 0 + │ │ │ ├── pattern: + │ │ │ │ @ ArrayPatternNode (location: (220,6)-(220,8)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── constant: ∅ + │ │ │ │ ├── requireds: (length: 1) + │ │ │ │ │ └── @ LocalVariableTargetNode (location: (220,6)-(220,7)) + │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ ├── name: :b + │ │ │ │ │ └── depth: 0 + │ │ │ │ ├── rest: + │ │ │ │ │ @ ImplicitRestNode (location: (220,7)-(220,8)) + │ │ │ │ │ └── flags: ∅ + │ │ │ │ ├── posts: (length: 0) + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ └── closing_loc: ∅ + │ │ │ └── operator_loc: (220,3)-(220,5) = "in" + │ │ ├── opening_loc: (220,0)-(220,1) = "(" + │ │ └── closing_loc: (220,8)-(220,9) = ")" + │ ├── right: + │ │ @ CallNode (location: (220,13)-(220,14)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :c + │ │ ├── message_loc: (220,13)-(220,14) = "c" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ └── operator_loc: (220,10)-(220,12) = "or" + ├── @ MatchRequiredNode (location: (222,0)-(222,14)) + │ ├── flags: newline + │ ├── value: + │ │ @ LocalVariableReadNode (location: (222,0)-(222,1)) + │ │ ├── flags: ∅ + │ │ ├── name: :x + │ │ └── depth: 0 + │ ├── pattern: + │ │ @ PinnedExpressionNode (location: (222,5)-(222,14)) + │ │ ├── flags: ∅ + │ │ ├── expression: + │ │ │ @ ArrayNode (location: (222,7)-(222,13)) + │ │ │ ├── flags: contains_splat + │ │ │ ├── elements: (length: 1) + │ │ │ │ └── @ SplatNode (location: (222,8)-(222,12)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── operator_loc: (222,8)-(222,9) = "*" + │ │ │ │ └── expression: + │ │ │ │ @ CallNode (location: (222,9)-(222,12)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── receiver: + │ │ │ │ │ @ LocalVariableReadNode (location: (222,9)-(222,10)) + │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ ├── name: :a + │ │ │ │ │ └── depth: 0 + │ │ │ │ ├── call_operator_loc: (222,10)-(222,11) = "." + │ │ │ │ ├── name: :x + │ │ │ │ ├── message_loc: (222,11)-(222,12) = "x" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ ├── opening_loc: (222,7)-(222,8) = "[" + │ │ │ └── closing_loc: (222,12)-(222,13) = "]" + │ │ ├── operator_loc: (222,5)-(222,6) = "^" + │ │ ├── lparen_loc: (222,6)-(222,7) = "(" + │ │ └── rparen_loc: (222,13)-(222,14) = ")" + │ └── operator_loc: (222,2)-(222,4) = "=>" + ├── @ MatchRequiredNode (location: (223,0)-(223,15)) + │ ├── flags: newline + │ ├── value: + │ │ @ LocalVariableReadNode (location: (223,0)-(223,1)) + │ │ ├── flags: ∅ + │ │ ├── name: :x + │ │ └── depth: 0 + │ ├── pattern: + │ │ @ PinnedExpressionNode (location: (223,5)-(223,15)) + │ │ ├── flags: ∅ + │ │ ├── expression: + │ │ │ @ ArrayNode (location: (223,7)-(223,14)) + │ │ │ ├── flags: ∅ + │ │ │ ├── elements: (length: 1) + │ │ │ │ └── @ KeywordHashNode (location: (223,8)-(223,13)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── elements: (length: 1) + │ │ │ │ └── @ AssocSplatNode (location: (223,8)-(223,13)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── value: + │ │ │ │ │ @ CallNode (location: (223,10)-(223,13)) + │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ ├── receiver: + │ │ │ │ │ │ @ LocalVariableReadNode (location: (223,10)-(223,11)) + │ │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ │ ├── name: :a + │ │ │ │ │ │ └── depth: 0 + │ │ │ │ │ ├── call_operator_loc: (223,11)-(223,12) = "." + │ │ │ │ │ ├── name: :x + │ │ │ │ │ ├── message_loc: (223,12)-(223,13) = "x" + │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ ├── arguments: ∅ + │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ └── block: ∅ + │ │ │ │ └── operator_loc: (223,8)-(223,10) = "**" + │ │ │ ├── opening_loc: (223,7)-(223,8) = "[" + │ │ │ └── closing_loc: (223,13)-(223,14) = "]" + │ │ ├── operator_loc: (223,5)-(223,6) = "^" + │ │ ├── lparen_loc: (223,6)-(223,7) = "(" + │ │ └── rparen_loc: (223,14)-(223,15) = ")" + │ └── operator_loc: (223,2)-(223,4) = "=>" + └── @ MatchRequiredNode (location: (224,0)-(224,14)) ├── flags: newline - ├── left: - │ @ ParenthesesNode (location: (220,0)-(220,9)) + ├── value: + │ @ LocalVariableReadNode (location: (224,0)-(224,1)) + │ ├── flags: ∅ + │ ├── name: :x + │ └── depth: 0 + ├── pattern: + │ @ PinnedExpressionNode (location: (224,5)-(224,14)) │ ├── flags: ∅ - │ ├── body: - │ │ @ StatementsNode (location: (220,1)-(220,8)) + │ ├── expression: + │ │ @ HashNode (location: (224,7)-(224,13)) │ │ ├── flags: ∅ - │ │ └── body: (length: 1) - │ │ └── @ MatchPredicateNode (location: (220,1)-(220,8)) - │ │ ├── flags: newline - │ │ ├── value: - │ │ │ @ LocalVariableReadNode (location: (220,1)-(220,2)) - │ │ │ ├── flags: ∅ - │ │ │ ├── name: :a - │ │ │ └── depth: 0 - │ │ ├── pattern: - │ │ │ @ ArrayPatternNode (location: (220,6)-(220,8)) - │ │ │ ├── flags: ∅ - │ │ │ ├── constant: ∅ - │ │ │ ├── requireds: (length: 1) - │ │ │ │ └── @ LocalVariableTargetNode (location: (220,6)-(220,7)) - │ │ │ │ ├── flags: ∅ - │ │ │ │ ├── name: :b - │ │ │ │ └── depth: 0 - │ │ │ ├── rest: - │ │ │ │ @ ImplicitRestNode (location: (220,7)-(220,8)) - │ │ │ │ └── flags: ∅ - │ │ │ ├── posts: (length: 0) - │ │ │ ├── opening_loc: ∅ - │ │ │ └── closing_loc: ∅ - │ │ └── operator_loc: (220,3)-(220,5) = "in" - │ ├── opening_loc: (220,0)-(220,1) = "(" - │ └── closing_loc: (220,8)-(220,9) = ")" - ├── right: - │ @ CallNode (location: (220,13)-(220,14)) - │ ├── flags: variable_call, ignore_visibility - │ ├── receiver: ∅ - │ ├── call_operator_loc: ∅ - │ ├── name: :c - │ ├── message_loc: (220,13)-(220,14) = "c" - │ ├── opening_loc: ∅ - │ ├── arguments: ∅ - │ ├── closing_loc: ∅ - │ └── block: ∅ - └── operator_loc: (220,10)-(220,12) = "or" + │ │ ├── opening_loc: (224,7)-(224,8) = "{" + │ │ ├── elements: (length: 1) + │ │ │ └── @ AssocNode (location: (224,9)-(224,11)) + │ │ │ ├── flags: ∅ + │ │ │ ├── key: + │ │ │ │ @ SymbolNode (location: (224,9)-(224,11)) + │ │ │ │ ├── flags: static_literal, forced_us_ascii_encoding + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── value_loc: (224,9)-(224,10) = "a" + │ │ │ │ ├── closing_loc: (224,10)-(224,11) = ":" + │ │ │ │ └── unescaped: "a" + │ │ │ ├── value: + │ │ │ │ @ ImplicitNode (location: (224,9)-(224,11)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── value: + │ │ │ │ @ LocalVariableReadNode (location: (224,9)-(224,11)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── name: :a + │ │ │ │ └── depth: 0 + │ │ │ └── operator_loc: ∅ + │ │ └── closing_loc: (224,12)-(224,13) = "}" + │ ├── operator_loc: (224,5)-(224,6) = "^" + │ ├── lparen_loc: (224,6)-(224,7) = "(" + │ └── rparen_loc: (224,13)-(224,14) = ")" + └── operator_loc: (224,2)-(224,4) = "=>" diff --git a/test/prism/fixtures/patterns.txt b/test/prism/fixtures/patterns.txt index 09584e43eb..449dac619b 100644 --- a/test/prism/fixtures/patterns.txt +++ b/test/prism/fixtures/patterns.txt @@ -218,3 +218,7 @@ a in b, and c a in b, or c (a in b,) and c (a in b,) or c + +x => ^([*a.x]) +x => ^([**a.x]) +x => ^({ a: }) From bdcc8b3dc527c77da66f58c161a204a34ea1c527 Mon Sep 17 00:00:00 2001 From: Earlopain <14981592+Earlopain@users.noreply.github.com> Date: Mon, 31 Mar 2025 10:53:01 +0200 Subject: [PATCH 004/333] Be explicit in tests which files `parser` can't parse It also updates to latest `parser`, which allows numbered parameters in pattern matching pin, passing `patterns.txt` and `case.txt` --- Gemfile.lock | 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/3.5/Gemfile.lock | 2 +- gemfiles/jruby/Gemfile.lock | 2 +- gemfiles/truffleruby/Gemfile.lock | 2 +- gemfiles/typecheck/Gemfile.lock | 2 +- test/prism/ruby/parser_test.rb | 18 ++++++++++++------ 12 files changed, 23 insertions(+), 17 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index a34b551d7b..d5b5741d73 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -15,7 +15,7 @@ GEM mini_portile2 (~> 2.8.2) racc (~> 1.4) onigmo (0.1.0) - parser (3.3.7.2) + parser (3.3.7.4) ast (~> 2.4.1) racc power_assert (2.0.5) diff --git a/gemfiles/2.7/Gemfile.lock b/gemfiles/2.7/Gemfile.lock index 573b04b2f2..9b6b8e398e 100644 --- a/gemfiles/2.7/Gemfile.lock +++ b/gemfiles/2.7/Gemfile.lock @@ -8,7 +8,7 @@ GEM specs: ast (2.4.2) onigmo (0.1.0) - parser (3.3.7.2) + parser (3.3.7.4) ast (~> 2.4.1) racc power_assert (2.0.5) diff --git a/gemfiles/3.0/Gemfile.lock b/gemfiles/3.0/Gemfile.lock index 212ccb05d9..f61e0446a5 100644 --- a/gemfiles/3.0/Gemfile.lock +++ b/gemfiles/3.0/Gemfile.lock @@ -13,7 +13,7 @@ GEM mini_portile2 (~> 2.8.2) racc (~> 1.4) onigmo (0.1.0) - parser (3.3.7.2) + parser (3.3.7.4) ast (~> 2.4.1) racc power_assert (2.0.4) diff --git a/gemfiles/3.1/Gemfile.lock b/gemfiles/3.1/Gemfile.lock index 33fc2feb03..47a1804cfa 100644 --- a/gemfiles/3.1/Gemfile.lock +++ b/gemfiles/3.1/Gemfile.lock @@ -13,7 +13,7 @@ GEM mini_portile2 (~> 2.8.2) racc (~> 1.4) onigmo (0.1.0) - parser (3.3.7.2) + parser (3.3.7.4) ast (~> 2.4.1) racc power_assert (2.0.5) diff --git a/gemfiles/3.2/Gemfile.lock b/gemfiles/3.2/Gemfile.lock index a10e7b2c8d..97c8ae0655 100644 --- a/gemfiles/3.2/Gemfile.lock +++ b/gemfiles/3.2/Gemfile.lock @@ -13,7 +13,7 @@ GEM mini_portile2 (~> 2.8.2) racc (~> 1.4) onigmo (0.1.0) - parser (3.3.7.2) + parser (3.3.7.4) ast (~> 2.4.1) racc power_assert (2.0.5) diff --git a/gemfiles/3.3/Gemfile.lock b/gemfiles/3.3/Gemfile.lock index 792c529c22..8ec8c4b8a6 100644 --- a/gemfiles/3.3/Gemfile.lock +++ b/gemfiles/3.3/Gemfile.lock @@ -13,7 +13,7 @@ GEM mini_portile2 (~> 2.8.2) racc (~> 1.4) onigmo (0.1.0) - parser (3.3.7.2) + parser (3.3.7.4) ast (~> 2.4.1) racc power_assert (2.0.5) diff --git a/gemfiles/3.4/Gemfile.lock b/gemfiles/3.4/Gemfile.lock index be614dd47f..a0489039d5 100644 --- a/gemfiles/3.4/Gemfile.lock +++ b/gemfiles/3.4/Gemfile.lock @@ -13,7 +13,7 @@ GEM mini_portile2 (~> 2.8.2) racc (~> 1.4) onigmo (0.1.0) - parser (3.3.7.2) + parser (3.3.7.4) ast (~> 2.4.1) racc power_assert (2.0.5) diff --git a/gemfiles/3.5/Gemfile.lock b/gemfiles/3.5/Gemfile.lock index c654e57020..d37c6a96f6 100644 --- a/gemfiles/3.5/Gemfile.lock +++ b/gemfiles/3.5/Gemfile.lock @@ -14,7 +14,7 @@ GEM mini_portile2 (~> 2.8.2) racc (~> 1.4) onigmo (0.1.0) - parser (3.3.7.2) + parser (3.3.7.4) ast (~> 2.4.1) racc power_assert (2.0.5) diff --git a/gemfiles/jruby/Gemfile.lock b/gemfiles/jruby/Gemfile.lock index d388c683bb..e15bb9ae5a 100644 --- a/gemfiles/jruby/Gemfile.lock +++ b/gemfiles/jruby/Gemfile.lock @@ -7,7 +7,7 @@ GEM remote: https://rubygems.org/ specs: ast (2.4.3) - parser (3.3.7.2) + parser (3.3.7.4) ast (~> 2.4.1) racc power_assert (2.0.5) diff --git a/gemfiles/truffleruby/Gemfile.lock b/gemfiles/truffleruby/Gemfile.lock index 1bf4241a4b..e37aefccab 100644 --- a/gemfiles/truffleruby/Gemfile.lock +++ b/gemfiles/truffleruby/Gemfile.lock @@ -7,7 +7,7 @@ GEM remote: https://rubygems.org/ specs: ast (2.4.3) - parser (3.3.7.2) + parser (3.3.7.4) ast (~> 2.4.1) racc power_assert (2.0.5) diff --git a/gemfiles/typecheck/Gemfile.lock b/gemfiles/typecheck/Gemfile.lock index 59c461344d..48652ac3ed 100644 --- a/gemfiles/typecheck/Gemfile.lock +++ b/gemfiles/typecheck/Gemfile.lock @@ -38,7 +38,7 @@ GEM mutex_m (0.3.0) netrc (0.11.0) parallel (1.26.3) - parser (3.3.7.2) + parser (3.3.7.4) ast (~> 2.4.1) racc power_assert (2.0.5) diff --git a/test/prism/ruby/parser_test.rb b/test/prism/ruby/parser_test.rb index e94f9f860d..cd52758f2e 100644 --- a/test/prism/ruby/parser_test.rb +++ b/test/prism/ruby/parser_test.rb @@ -56,6 +56,16 @@ def ==(other) module Prism class ParserTest < TestCase + # These files contain code with valid syntax that can't be parsed. + skip_syntax_error = [ + # alias/undef with %s(abc) symbol literal + "alias.txt", + "seattlerb/bug_215.txt", + + # 1.. && 2 + "ranges.txt", + ] + # These files contain code that is being parsed incorrectly by the parser # gem, and therefore we don't want to compare against our translation. skip_incorrect = [ @@ -133,7 +143,7 @@ class ParserTest < TestCase "whitequark/space_args_block.txt" ] - Fixture.each do |fixture| + Fixture.each(except: skip_syntax_error) do |fixture| define_method(fixture.test_name) do assert_equal_parses( fixture, @@ -190,11 +200,7 @@ def assert_equal_parses(fixture, compare_asts: true, compare_tokens: true, compa parser.diagnostics.all_errors_are_fatal = true expected_ast, expected_comments, expected_tokens = - begin - ignore_warnings { parser.tokenize(buffer) } - rescue ArgumentError, Parser::SyntaxError - return - end + ignore_warnings { parser.tokenize(buffer) } actual_ast, actual_comments, actual_tokens = ignore_warnings { Prism::Translation::Parser33.new.tokenize(buffer) } From 62ded57a660c70d3274339a8beaa15b95fd472fa Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 31 Mar 2025 16:58:57 +0000 Subject: [PATCH 005/333] Bump the ruby-deps group across 10 directories with 3 updates Bumps the ruby-deps group with 1 update in the /gemfiles/2.7 directory: [parser](https://github.com/whitequark/parser). Bumps the ruby-deps group with 1 update in the /gemfiles/3.0 directory: [parser](https://github.com/whitequark/parser). Bumps the ruby-deps group with 2 updates in the /gemfiles/3.1 directory: [parser](https://github.com/whitequark/parser) and [rbs](https://github.com/ruby/rbs). Bumps the ruby-deps group with 2 updates in the /gemfiles/3.2 directory: [parser](https://github.com/whitequark/parser) and [rbs](https://github.com/ruby/rbs). Bumps the ruby-deps group with 2 updates in the /gemfiles/3.3 directory: [parser](https://github.com/whitequark/parser) and [rbs](https://github.com/ruby/rbs). Bumps the ruby-deps group with 2 updates in the /gemfiles/3.4 directory: [parser](https://github.com/whitequark/parser) and [rbs](https://github.com/ruby/rbs). Bumps the ruby-deps group with 2 updates in the /gemfiles/3.5 directory: [parser](https://github.com/whitequark/parser) and [rbs](https://github.com/ruby/rbs). Bumps the ruby-deps group with 1 update in the /gemfiles/jruby directory: [parser](https://github.com/whitequark/parser). Bumps the ruby-deps group with 1 update in the /gemfiles/truffleruby directory: [parser](https://github.com/whitequark/parser). Bumps the ruby-deps group with 3 updates in the /gemfiles/typecheck directory: [parser](https://github.com/whitequark/parser), [rbs](https://github.com/ruby/rbs) and [sorbet](https://github.com/sorbet/sorbet). Updates `parser` from 3.3.7.2 to 3.3.7.4 - [Changelog](https://github.com/whitequark/parser/blob/master/CHANGELOG.md) - [Commits](https://github.com/whitequark/parser/compare/v3.3.7.2...v3.3.7.4) Updates `parser` from 3.3.7.2 to 3.3.7.4 - [Changelog](https://github.com/whitequark/parser/blob/master/CHANGELOG.md) - [Commits](https://github.com/whitequark/parser/compare/v3.3.7.2...v3.3.7.4) Updates `parser` from 3.3.7.2 to 3.3.7.4 - [Changelog](https://github.com/whitequark/parser/blob/master/CHANGELOG.md) - [Commits](https://github.com/whitequark/parser/compare/v3.3.7.2...v3.3.7.4) Updates `rbs` from 3.9.1 to 3.9.2 - [Release notes](https://github.com/ruby/rbs/releases) - [Changelog](https://github.com/ruby/rbs/blob/master/CHANGELOG.md) - [Commits](https://github.com/ruby/rbs/compare/v3.9.1...v3.9.2) Updates `parser` from 3.3.7.2 to 3.3.7.4 - [Changelog](https://github.com/whitequark/parser/blob/master/CHANGELOG.md) - [Commits](https://github.com/whitequark/parser/compare/v3.3.7.2...v3.3.7.4) Updates `rbs` from 3.9.1 to 3.9.2 - [Release notes](https://github.com/ruby/rbs/releases) - [Changelog](https://github.com/ruby/rbs/blob/master/CHANGELOG.md) - [Commits](https://github.com/ruby/rbs/compare/v3.9.1...v3.9.2) Updates `parser` from 3.3.7.2 to 3.3.7.4 - [Changelog](https://github.com/whitequark/parser/blob/master/CHANGELOG.md) - [Commits](https://github.com/whitequark/parser/compare/v3.3.7.2...v3.3.7.4) Updates `rbs` from 3.9.1 to 3.9.2 - [Release notes](https://github.com/ruby/rbs/releases) - [Changelog](https://github.com/ruby/rbs/blob/master/CHANGELOG.md) - [Commits](https://github.com/ruby/rbs/compare/v3.9.1...v3.9.2) Updates `parser` from 3.3.7.2 to 3.3.7.4 - [Changelog](https://github.com/whitequark/parser/blob/master/CHANGELOG.md) - [Commits](https://github.com/whitequark/parser/compare/v3.3.7.2...v3.3.7.4) Updates `rbs` from 3.9.1 to 3.9.2 - [Release notes](https://github.com/ruby/rbs/releases) - [Changelog](https://github.com/ruby/rbs/blob/master/CHANGELOG.md) - [Commits](https://github.com/ruby/rbs/compare/v3.9.1...v3.9.2) Updates `parser` from 3.3.7.2 to 3.3.7.4 - [Changelog](https://github.com/whitequark/parser/blob/master/CHANGELOG.md) - [Commits](https://github.com/whitequark/parser/compare/v3.3.7.2...v3.3.7.4) Updates `rbs` from 3.9.1 to 3.9.2 - [Release notes](https://github.com/ruby/rbs/releases) - [Changelog](https://github.com/ruby/rbs/blob/master/CHANGELOG.md) - [Commits](https://github.com/ruby/rbs/compare/v3.9.1...v3.9.2) Updates `parser` from 3.3.7.2 to 3.3.7.4 - [Changelog](https://github.com/whitequark/parser/blob/master/CHANGELOG.md) - [Commits](https://github.com/whitequark/parser/compare/v3.3.7.2...v3.3.7.4) Updates `parser` from 3.3.7.2 to 3.3.7.4 - [Changelog](https://github.com/whitequark/parser/blob/master/CHANGELOG.md) - [Commits](https://github.com/whitequark/parser/compare/v3.3.7.2...v3.3.7.4) Updates `parser` from 3.3.7.2 to 3.3.7.4 - [Changelog](https://github.com/whitequark/parser/blob/master/CHANGELOG.md) - [Commits](https://github.com/whitequark/parser/compare/v3.3.7.2...v3.3.7.4) Updates `rbs` from 3.9.1 to 3.9.2 - [Release notes](https://github.com/ruby/rbs/releases) - [Changelog](https://github.com/ruby/rbs/blob/master/CHANGELOG.md) - [Commits](https://github.com/ruby/rbs/compare/v3.9.1...v3.9.2) Updates `sorbet` from 0.5.11953 to 0.5.11966 - [Release notes](https://github.com/sorbet/sorbet/releases) - [Commits](https://github.com/sorbet/sorbet/commits) --- updated-dependencies: - dependency-name: parser dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps - dependency-name: parser dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps - dependency-name: parser dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps - dependency-name: rbs dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps - dependency-name: parser dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps - dependency-name: rbs dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps - dependency-name: parser dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps - dependency-name: rbs dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps - dependency-name: parser dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps - dependency-name: rbs dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps - dependency-name: parser dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps - dependency-name: rbs dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps - dependency-name: parser dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps - dependency-name: parser dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps - dependency-name: parser dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps - dependency-name: rbs dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps - dependency-name: sorbet dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps ... Signed-off-by: dependabot[bot] --- gemfiles/2.7/Gemfile.lock | 4 ++-- gemfiles/3.0/Gemfile.lock | 4 ++-- gemfiles/3.1/Gemfile.lock | 6 +++--- gemfiles/3.2/Gemfile.lock | 6 +++--- gemfiles/3.3/Gemfile.lock | 6 +++--- gemfiles/3.4/Gemfile.lock | 6 +++--- gemfiles/3.5/Gemfile.lock | 6 +++--- gemfiles/jruby/Gemfile.lock | 2 +- gemfiles/truffleruby/Gemfile.lock | 2 +- gemfiles/typecheck/Gemfile.lock | 22 +++++++++++----------- 10 files changed, 32 insertions(+), 32 deletions(-) diff --git a/gemfiles/2.7/Gemfile.lock b/gemfiles/2.7/Gemfile.lock index 573b04b2f2..83c061fa1b 100644 --- a/gemfiles/2.7/Gemfile.lock +++ b/gemfiles/2.7/Gemfile.lock @@ -6,9 +6,9 @@ PATH GEM remote: https://rubygems.org/ specs: - ast (2.4.2) + ast (2.4.3) onigmo (0.1.0) - parser (3.3.7.2) + parser (3.3.7.4) ast (~> 2.4.1) racc power_assert (2.0.5) diff --git a/gemfiles/3.0/Gemfile.lock b/gemfiles/3.0/Gemfile.lock index 212ccb05d9..004411baab 100644 --- a/gemfiles/3.0/Gemfile.lock +++ b/gemfiles/3.0/Gemfile.lock @@ -6,14 +6,14 @@ PATH GEM remote: https://rubygems.org/ specs: - ast (2.4.2) + ast (2.4.3) logger (1.6.1) mini_portile2 (2.8.8) nokogiri (1.17.2) mini_portile2 (~> 2.8.2) racc (~> 1.4) onigmo (0.1.0) - parser (3.3.7.2) + parser (3.3.7.4) ast (~> 2.4.1) racc power_assert (2.0.4) diff --git a/gemfiles/3.1/Gemfile.lock b/gemfiles/3.1/Gemfile.lock index 33fc2feb03..bbb2cc26d3 100644 --- a/gemfiles/3.1/Gemfile.lock +++ b/gemfiles/3.1/Gemfile.lock @@ -7,13 +7,13 @@ GEM remote: https://rubygems.org/ specs: ast (2.4.3) - logger (1.6.6) + logger (1.7.0) mini_portile2 (2.8.8) nokogiri (1.18.5) mini_portile2 (~> 2.8.2) racc (~> 1.4) onigmo (0.1.0) - parser (3.3.7.2) + parser (3.3.7.4) ast (~> 2.4.1) racc power_assert (2.0.5) @@ -21,7 +21,7 @@ GEM rake (13.2.1) rake-compiler (1.2.9) rake - rbs (3.9.1) + rbs (3.9.2) logger ruby_memcheck (3.0.1) nokogiri diff --git a/gemfiles/3.2/Gemfile.lock b/gemfiles/3.2/Gemfile.lock index a10e7b2c8d..b96b9d5d75 100644 --- a/gemfiles/3.2/Gemfile.lock +++ b/gemfiles/3.2/Gemfile.lock @@ -7,13 +7,13 @@ GEM remote: https://rubygems.org/ specs: ast (2.4.3) - logger (1.6.6) + logger (1.7.0) mini_portile2 (2.8.8) nokogiri (1.18.5) mini_portile2 (~> 2.8.2) racc (~> 1.4) onigmo (0.1.0) - parser (3.3.7.2) + parser (3.3.7.4) ast (~> 2.4.1) racc power_assert (2.0.5) @@ -21,7 +21,7 @@ GEM rake (13.2.1) rake-compiler (1.2.9) rake - rbs (3.9.1) + rbs (3.9.2) logger ruby_memcheck (3.0.1) nokogiri diff --git a/gemfiles/3.3/Gemfile.lock b/gemfiles/3.3/Gemfile.lock index 792c529c22..f165bbf2a7 100644 --- a/gemfiles/3.3/Gemfile.lock +++ b/gemfiles/3.3/Gemfile.lock @@ -7,13 +7,13 @@ GEM remote: https://rubygems.org/ specs: ast (2.4.3) - logger (1.6.6) + logger (1.7.0) mini_portile2 (2.8.8) nokogiri (1.18.5) mini_portile2 (~> 2.8.2) racc (~> 1.4) onigmo (0.1.0) - parser (3.3.7.2) + parser (3.3.7.4) ast (~> 2.4.1) racc power_assert (2.0.5) @@ -21,7 +21,7 @@ GEM rake (13.2.1) rake-compiler (1.2.9) rake - rbs (3.9.1) + rbs (3.9.2) logger ruby_memcheck (3.0.1) nokogiri diff --git a/gemfiles/3.4/Gemfile.lock b/gemfiles/3.4/Gemfile.lock index be614dd47f..a70b49f28d 100644 --- a/gemfiles/3.4/Gemfile.lock +++ b/gemfiles/3.4/Gemfile.lock @@ -7,13 +7,13 @@ GEM remote: https://rubygems.org/ specs: ast (2.4.3) - logger (1.6.6) + logger (1.7.0) mini_portile2 (2.8.8) nokogiri (1.18.5) mini_portile2 (~> 2.8.2) racc (~> 1.4) onigmo (0.1.0) - parser (3.3.7.2) + parser (3.3.7.4) ast (~> 2.4.1) racc power_assert (2.0.5) @@ -21,7 +21,7 @@ GEM rake (13.2.1) rake-compiler (1.2.9) rake - rbs (3.9.1) + rbs (3.9.2) logger ruby_memcheck (3.0.1) nokogiri diff --git a/gemfiles/3.5/Gemfile.lock b/gemfiles/3.5/Gemfile.lock index c654e57020..b786f6660a 100644 --- a/gemfiles/3.5/Gemfile.lock +++ b/gemfiles/3.5/Gemfile.lock @@ -8,13 +8,13 @@ GEM specs: ast (2.4.3) ffi (1.17.1) - logger (1.6.6) + logger (1.7.0) mini_portile2 (2.8.8) nokogiri (1.18.5) mini_portile2 (~> 2.8.2) racc (~> 1.4) onigmo (0.1.0) - parser (3.3.7.2) + parser (3.3.7.4) ast (~> 2.4.1) racc power_assert (2.0.5) @@ -22,7 +22,7 @@ GEM rake (13.2.1) rake-compiler (1.2.9) rake - rbs (3.9.1) + rbs (3.9.2) logger ruby_memcheck (3.0.1) nokogiri diff --git a/gemfiles/jruby/Gemfile.lock b/gemfiles/jruby/Gemfile.lock index d388c683bb..e15bb9ae5a 100644 --- a/gemfiles/jruby/Gemfile.lock +++ b/gemfiles/jruby/Gemfile.lock @@ -7,7 +7,7 @@ GEM remote: https://rubygems.org/ specs: ast (2.4.3) - parser (3.3.7.2) + parser (3.3.7.4) ast (~> 2.4.1) racc power_assert (2.0.5) diff --git a/gemfiles/truffleruby/Gemfile.lock b/gemfiles/truffleruby/Gemfile.lock index 1bf4241a4b..e37aefccab 100644 --- a/gemfiles/truffleruby/Gemfile.lock +++ b/gemfiles/truffleruby/Gemfile.lock @@ -7,7 +7,7 @@ GEM remote: https://rubygems.org/ specs: ast (2.4.3) - parser (3.3.7.2) + parser (3.3.7.4) ast (~> 2.4.1) racc power_assert (2.0.5) diff --git a/gemfiles/typecheck/Gemfile.lock b/gemfiles/typecheck/Gemfile.lock index 59c461344d..8d9f43a9af 100644 --- a/gemfiles/typecheck/Gemfile.lock +++ b/gemfiles/typecheck/Gemfile.lock @@ -33,12 +33,12 @@ GEM listen (3.9.0) rb-fsevent (~> 0.10, >= 0.10.3) rb-inotify (~> 0.9, >= 0.9.10) - logger (1.6.6) + logger (1.7.0) minitest (5.25.5) mutex_m (0.3.0) netrc (0.11.0) parallel (1.26.3) - parser (3.3.7.2) + parser (3.3.7.4) ast (~> 2.4.1) racc power_assert (2.0.5) @@ -55,21 +55,21 @@ GEM prism (~> 1.0) rbs (>= 3.4.4) sorbet-runtime (>= 0.5.9204) - rbs (3.9.1) + rbs (3.9.2) logger ruby_parser (3.21.1) racc (~> 1.5) sexp_processor (~> 4.16) securerandom (0.4.1) sexp_processor (4.17.3) - sorbet (0.5.11953) - sorbet-static (= 0.5.11953) - sorbet-runtime (0.5.11953) - sorbet-static (0.5.11953-universal-darwin) - sorbet-static (0.5.11953-x86_64-linux) - sorbet-static-and-runtime (0.5.11953) - sorbet (= 0.5.11953) - sorbet-runtime (= 0.5.11953) + sorbet (0.5.11966) + sorbet-static (= 0.5.11966) + sorbet-runtime (0.5.11966) + sorbet-static (0.5.11966-universal-darwin) + sorbet-static (0.5.11966-x86_64-linux) + sorbet-static-and-runtime (0.5.11966) + sorbet (= 0.5.11966) + sorbet-runtime (= 0.5.11966) spoom (1.6.1) erubi (>= 1.10.0) prism (>= 0.28.0) From e2cbfe3f45068889ab81ae728f4af10a43b6a765 Mon Sep 17 00:00:00 2001 From: Andrea Peruffo Date: Tue, 1 Apr 2025 17:21:11 +0100 Subject: [PATCH 006/333] Fix Java dependencies scopes --- java-wasm/pom.xml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/java-wasm/pom.xml b/java-wasm/pom.xml index ba0b66da9c..3d7d38cde2 100644 --- a/java-wasm/pom.xml +++ b/java-wasm/pom.xml @@ -36,14 +36,23 @@ com.dylibso.chicory runtime + + com.dylibso.chicory + log + com.dylibso.chicory wasi + + com.dylibso.chicory + wasm + org.junit.jupiter junit-jupiter-engine ${junit.version} + test com.dylibso.chicory From 7653b73f1c9c22df1d4373e93c5a6e32b5399644 Mon Sep 17 00:00:00 2001 From: Andrea Peruffo Date: Wed, 2 Apr 2025 09:18:57 +0100 Subject: [PATCH 007/333] Bump deprecated Ubuntu runners --- .github/workflows/cruby-bindings.yml | 3 ++- .github/workflows/main.yml | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cruby-bindings.yml b/.github/workflows/cruby-bindings.yml index 5458d80694..087fb97c0f 100644 --- a/.github/workflows/cruby-bindings.yml +++ b/.github/workflows/cruby-bindings.yml @@ -12,7 +12,7 @@ on: jobs: test-all: - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 steps: - name: Set up latest ruby head uses: ruby/setup-ruby@v1 @@ -37,6 +37,7 @@ jobs: working-directory: ruby/ruby - name: Build Ruby run: | + ruby tool/downloader.rb -d tool -e gnu config.guess config.sub autoconf ./configure -C --disable-install-doc make -j2 diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index bfe8e9b0ca..ff5aeb45e1 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -104,7 +104,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-20.04, ubuntu-22.04] + os: [ubuntu-22.04, ubuntu-24.04] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 From a9a3164fd11efea7cb923a9096a83532bf1829c5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 7 Apr 2025 16:58:44 +0000 Subject: [PATCH 008/333] Bump the ruby-deps group across 10 directories with 2 updates Bumps the ruby-deps group with 1 update in the /gemfiles/2.7 directory: [test-unit](https://github.com/test-unit/test-unit). Bumps the ruby-deps group with 1 update in the /gemfiles/3.0 directory: [test-unit](https://github.com/test-unit/test-unit). Bumps the ruby-deps group with 1 update in the /gemfiles/3.1 directory: [test-unit](https://github.com/test-unit/test-unit). Bumps the ruby-deps group with 1 update in the /gemfiles/3.2 directory: [test-unit](https://github.com/test-unit/test-unit). Bumps the ruby-deps group with 1 update in the /gemfiles/3.3 directory: [test-unit](https://github.com/test-unit/test-unit). Bumps the ruby-deps group with 1 update in the /gemfiles/3.4 directory: [test-unit](https://github.com/test-unit/test-unit). Bumps the ruby-deps group with 1 update in the /gemfiles/3.5 directory: [test-unit](https://github.com/test-unit/test-unit). Bumps the ruby-deps group with 1 update in the /gemfiles/jruby directory: [test-unit](https://github.com/test-unit/test-unit). Bumps the ruby-deps group with 1 update in the /gemfiles/truffleruby directory: [test-unit](https://github.com/test-unit/test-unit). Bumps the ruby-deps group with 2 updates in the /gemfiles/typecheck directory: [test-unit](https://github.com/test-unit/test-unit) and [sorbet](https://github.com/sorbet/sorbet). Updates `test-unit` from 3.6.7 to 3.6.8 - [Release notes](https://github.com/test-unit/test-unit/releases) - [Commits](https://github.com/test-unit/test-unit/compare/3.6.7...3.6.8) Updates `test-unit` from 3.6.7 to 3.6.8 - [Release notes](https://github.com/test-unit/test-unit/releases) - [Commits](https://github.com/test-unit/test-unit/compare/3.6.7...3.6.8) Updates `test-unit` from 3.6.7 to 3.6.8 - [Release notes](https://github.com/test-unit/test-unit/releases) - [Commits](https://github.com/test-unit/test-unit/compare/3.6.7...3.6.8) Updates `test-unit` from 3.6.7 to 3.6.8 - [Release notes](https://github.com/test-unit/test-unit/releases) - [Commits](https://github.com/test-unit/test-unit/compare/3.6.7...3.6.8) Updates `test-unit` from 3.6.7 to 3.6.8 - [Release notes](https://github.com/test-unit/test-unit/releases) - [Commits](https://github.com/test-unit/test-unit/compare/3.6.7...3.6.8) Updates `test-unit` from 3.6.7 to 3.6.8 - [Release notes](https://github.com/test-unit/test-unit/releases) - [Commits](https://github.com/test-unit/test-unit/compare/3.6.7...3.6.8) Updates `test-unit` from 3.6.7 to 3.6.8 - [Release notes](https://github.com/test-unit/test-unit/releases) - [Commits](https://github.com/test-unit/test-unit/compare/3.6.7...3.6.8) Updates `test-unit` from 3.6.7 to 3.6.8 - [Release notes](https://github.com/test-unit/test-unit/releases) - [Commits](https://github.com/test-unit/test-unit/compare/3.6.7...3.6.8) Updates `test-unit` from 3.6.7 to 3.6.8 - [Release notes](https://github.com/test-unit/test-unit/releases) - [Commits](https://github.com/test-unit/test-unit/compare/3.6.7...3.6.8) Updates `test-unit` from 3.6.7 to 3.6.8 - [Release notes](https://github.com/test-unit/test-unit/releases) - [Commits](https://github.com/test-unit/test-unit/compare/3.6.7...3.6.8) Updates `sorbet` from 0.5.11966 to 0.5.11989 - [Release notes](https://github.com/sorbet/sorbet/releases) - [Commits](https://github.com/sorbet/sorbet/commits) --- updated-dependencies: - dependency-name: test-unit dependency-version: 3.6.8 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps - dependency-name: test-unit dependency-version: 3.6.8 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps - dependency-name: test-unit dependency-version: 3.6.8 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps - dependency-name: test-unit dependency-version: 3.6.8 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps - dependency-name: test-unit dependency-version: 3.6.8 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps - dependency-name: test-unit dependency-version: 3.6.8 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps - dependency-name: test-unit dependency-version: 3.6.8 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps - dependency-name: test-unit dependency-version: 3.6.8 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps - dependency-name: test-unit dependency-version: 3.6.8 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps - dependency-name: test-unit dependency-version: 3.6.8 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps - dependency-name: sorbet dependency-version: 0.5.11989 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps ... Signed-off-by: dependabot[bot] --- gemfiles/2.7/Gemfile.lock | 2 +- gemfiles/3.0/Gemfile.lock | 4 ++-- 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/3.5/Gemfile.lock | 2 +- gemfiles/jruby/Gemfile.lock | 2 +- gemfiles/truffleruby/Gemfile.lock | 2 +- gemfiles/typecheck/Gemfile.lock | 18 +++++++++--------- 10 files changed, 19 insertions(+), 19 deletions(-) diff --git a/gemfiles/2.7/Gemfile.lock b/gemfiles/2.7/Gemfile.lock index 83c061fa1b..bddefee416 100644 --- a/gemfiles/2.7/Gemfile.lock +++ b/gemfiles/2.7/Gemfile.lock @@ -17,7 +17,7 @@ GEM rake-compiler (1.2.9) rake rbs (3.1.3) - test-unit (3.6.7) + test-unit (3.6.8) power_assert PLATFORMS diff --git a/gemfiles/3.0/Gemfile.lock b/gemfiles/3.0/Gemfile.lock index 004411baab..57d7869768 100644 --- a/gemfiles/3.0/Gemfile.lock +++ b/gemfiles/3.0/Gemfile.lock @@ -16,7 +16,7 @@ GEM parser (3.3.7.4) ast (~> 2.4.1) racc - power_assert (2.0.4) + power_assert (2.0.5) racc (1.8.1) rake (13.2.1) rake-compiler (1.2.9) @@ -25,7 +25,7 @@ GEM logger ruby_memcheck (3.0.1) nokogiri - test-unit (3.6.7) + test-unit (3.6.8) power_assert PLATFORMS diff --git a/gemfiles/3.1/Gemfile.lock b/gemfiles/3.1/Gemfile.lock index bbb2cc26d3..428516c7a0 100644 --- a/gemfiles/3.1/Gemfile.lock +++ b/gemfiles/3.1/Gemfile.lock @@ -25,7 +25,7 @@ GEM logger ruby_memcheck (3.0.1) nokogiri - test-unit (3.6.7) + test-unit (3.6.8) power_assert PLATFORMS diff --git a/gemfiles/3.2/Gemfile.lock b/gemfiles/3.2/Gemfile.lock index b96b9d5d75..be29a20c48 100644 --- a/gemfiles/3.2/Gemfile.lock +++ b/gemfiles/3.2/Gemfile.lock @@ -25,7 +25,7 @@ GEM logger ruby_memcheck (3.0.1) nokogiri - test-unit (3.6.7) + test-unit (3.6.8) power_assert PLATFORMS diff --git a/gemfiles/3.3/Gemfile.lock b/gemfiles/3.3/Gemfile.lock index f165bbf2a7..3c621b393d 100644 --- a/gemfiles/3.3/Gemfile.lock +++ b/gemfiles/3.3/Gemfile.lock @@ -25,7 +25,7 @@ GEM logger ruby_memcheck (3.0.1) nokogiri - test-unit (3.6.7) + test-unit (3.6.8) power_assert PLATFORMS diff --git a/gemfiles/3.4/Gemfile.lock b/gemfiles/3.4/Gemfile.lock index a70b49f28d..7e9e5898bb 100644 --- a/gemfiles/3.4/Gemfile.lock +++ b/gemfiles/3.4/Gemfile.lock @@ -25,7 +25,7 @@ GEM logger ruby_memcheck (3.0.1) nokogiri - test-unit (3.6.7) + test-unit (3.6.8) power_assert PLATFORMS diff --git a/gemfiles/3.5/Gemfile.lock b/gemfiles/3.5/Gemfile.lock index b786f6660a..2e081fa9d7 100644 --- a/gemfiles/3.5/Gemfile.lock +++ b/gemfiles/3.5/Gemfile.lock @@ -26,7 +26,7 @@ GEM logger ruby_memcheck (3.0.1) nokogiri - test-unit (3.6.7) + test-unit (3.6.8) power_assert PLATFORMS diff --git a/gemfiles/jruby/Gemfile.lock b/gemfiles/jruby/Gemfile.lock index e15bb9ae5a..0a38fab5c3 100644 --- a/gemfiles/jruby/Gemfile.lock +++ b/gemfiles/jruby/Gemfile.lock @@ -16,7 +16,7 @@ GEM rake (13.2.1) rake-compiler (1.2.9) rake - test-unit (3.6.7) + test-unit (3.6.8) power_assert PLATFORMS diff --git a/gemfiles/truffleruby/Gemfile.lock b/gemfiles/truffleruby/Gemfile.lock index e37aefccab..4cbfac607d 100644 --- a/gemfiles/truffleruby/Gemfile.lock +++ b/gemfiles/truffleruby/Gemfile.lock @@ -15,7 +15,7 @@ GEM rake (13.2.1) rake-compiler (1.2.9) rake - test-unit (3.6.7) + test-unit (3.6.8) power_assert PLATFORMS diff --git a/gemfiles/typecheck/Gemfile.lock b/gemfiles/typecheck/Gemfile.lock index 8d9f43a9af..c274d1eaa9 100644 --- a/gemfiles/typecheck/Gemfile.lock +++ b/gemfiles/typecheck/Gemfile.lock @@ -62,14 +62,14 @@ GEM sexp_processor (~> 4.16) securerandom (0.4.1) sexp_processor (4.17.3) - sorbet (0.5.11966) - sorbet-static (= 0.5.11966) - sorbet-runtime (0.5.11966) - sorbet-static (0.5.11966-universal-darwin) - sorbet-static (0.5.11966-x86_64-linux) - sorbet-static-and-runtime (0.5.11966) - sorbet (= 0.5.11966) - sorbet-runtime (= 0.5.11966) + sorbet (0.5.11989) + sorbet-static (= 0.5.11989) + sorbet-runtime (0.5.11989) + sorbet-static (0.5.11989-universal-darwin) + sorbet-static (0.5.11989-x86_64-linux) + sorbet-static-and-runtime (0.5.11989) + sorbet (= 0.5.11989) + sorbet-runtime (= 0.5.11989) spoom (1.6.1) erubi (>= 1.10.0) prism (>= 0.28.0) @@ -106,7 +106,7 @@ GEM yard-sorbet terminal-table (4.0.0) unicode-display_width (>= 1.1.1, < 4) - test-unit (3.6.7) + test-unit (3.6.8) power_assert thor (1.3.2) tzinfo (2.0.6) From 76d01aeb6c9af8892707dfc5b40ac69f9c59490f Mon Sep 17 00:00:00 2001 From: viralpraxis Date: Thu, 10 Apr 2025 11:56:25 +0300 Subject: [PATCH 009/333] Fix parsing rescued exception via indexed assignment Given this code ```ruby begin raise '42' rescue => A[] end ``` Prism fails with this backtrace ``` Error: test_unparser/corpus/literal/rescue.txt(Prism::ParserTest): NoMethodError: undefined method `arguments' for nil prism/lib/prism/translation/parser/compiler.rb:1055:in `visit_index_target_node' prism/lib/prism/node.rb:9636:in `accept' prism/lib/prism/compiler.rb:30:in `visit' prism/lib/prism/translation/parser/compiler.rb:218:in `visit_begin_node' ``` Seems like ```diff - visit_all(node.arguments.arguments), + visit_all(node.arguments&.arguments || []), ``` fixes the problem. --- lib/prism/translation/parser/compiler.rb | 2 +- snapshots/rescue.txt | 141 ++++++++++++++--------- test/prism/fixtures/rescue.txt | 4 + 3 files changed, 89 insertions(+), 58 deletions(-) diff --git a/lib/prism/translation/parser/compiler.rb b/lib/prism/translation/parser/compiler.rb index 1beccc30a1..0bd9d74f93 100644 --- a/lib/prism/translation/parser/compiler.rb +++ b/lib/prism/translation/parser/compiler.rb @@ -1052,7 +1052,7 @@ def visit_index_target_node(node) builder.index_asgn( visit(node.receiver), token(node.opening_loc), - visit_all(node.arguments.arguments), + visit_all(node.arguments&.arguments || []), token(node.closing_loc), ) end diff --git a/snapshots/rescue.txt b/snapshots/rescue.txt index d664e6a9ef..6b20e6e5ce 100644 --- a/snapshots/rescue.txt +++ b/snapshots/rescue.txt @@ -1,10 +1,10 @@ -@ ProgramNode (location: (1,0)-(35,18)) +@ ProgramNode (location: (1,0)-(39,3)) ├── flags: ∅ ├── locals: [:a, :z] └── statements: - @ StatementsNode (location: (1,0)-(35,18)) + @ StatementsNode (location: (1,0)-(39,3)) ├── flags: ∅ - └── body: (length: 14) + └── body: (length: 15) ├── @ RescueModifierNode (location: (1,0)-(1,14)) │ ├── flags: newline │ ├── expression: @@ -526,61 +526,88 @@ │ ├── arguments: ∅ │ ├── closing_loc: ∅ │ └── block: ∅ - └── @ LocalVariableWriteNode (location: (35,0)-(35,18)) + ├── @ LocalVariableWriteNode (location: (35,0)-(35,18)) + │ ├── flags: newline + │ ├── name: :z + │ ├── depth: 0 + │ ├── name_loc: (35,0)-(35,1) = "z" + │ ├── value: + │ │ @ RescueModifierNode (location: (35,4)-(35,18)) + │ │ ├── flags: ∅ + │ │ ├── expression: + │ │ │ @ CallNode (location: (35,4)-(35,7)) + │ │ │ ├── flags: ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :x + │ │ │ ├── message_loc: (35,4)-(35,5) = "x" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: + │ │ │ │ @ ArgumentsNode (location: (35,6)-(35,7)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── arguments: (length: 1) + │ │ │ │ └── @ CallNode (location: (35,6)-(35,7)) + │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :y + │ │ │ │ ├── message_loc: (35,6)-(35,7) = "y" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── keyword_loc: (35,8)-(35,14) = "rescue" + │ │ └── rescue_expression: + │ │ @ CallNode (location: (35,15)-(35,18)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :c + │ │ ├── message_loc: (35,15)-(35,16) = "c" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (35,17)-(35,18)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ CallNode (location: (35,17)-(35,18)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :d + │ │ │ ├── message_loc: (35,17)-(35,18) = "d" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ └── operator_loc: (35,2)-(35,3) = "=" + └── @ BeginNode (location: (37,0)-(39,3)) ├── flags: newline - ├── name: :z - ├── depth: 0 - ├── name_loc: (35,0)-(35,1) = "z" - ├── value: - │ @ RescueModifierNode (location: (35,4)-(35,18)) + ├── begin_keyword_loc: (37,0)-(37,5) = "begin" + ├── statements: ∅ + ├── rescue_clause: + │ @ RescueNode (location: (38,0)-(38,13)) │ ├── flags: ∅ - │ ├── expression: - │ │ @ CallNode (location: (35,4)-(35,7)) - │ │ ├── flags: ignore_visibility - │ │ ├── receiver: ∅ - │ │ ├── call_operator_loc: ∅ - │ │ ├── name: :x - │ │ ├── message_loc: (35,4)-(35,5) = "x" - │ │ ├── opening_loc: ∅ - │ │ ├── arguments: - │ │ │ @ ArgumentsNode (location: (35,6)-(35,7)) + │ ├── keyword_loc: (38,0)-(38,6) = "rescue" + │ ├── exceptions: (length: 0) + │ ├── operator_loc: (38,7)-(38,9) = "=>" + │ ├── reference: + │ │ @ IndexTargetNode (location: (38,10)-(38,13)) + │ │ ├── flags: attribute_write + │ │ ├── receiver: + │ │ │ @ ConstantReadNode (location: (38,10)-(38,11)) │ │ │ ├── flags: ∅ - │ │ │ └── arguments: (length: 1) - │ │ │ └── @ CallNode (location: (35,6)-(35,7)) - │ │ │ ├── flags: variable_call, ignore_visibility - │ │ │ ├── receiver: ∅ - │ │ │ ├── call_operator_loc: ∅ - │ │ │ ├── name: :y - │ │ │ ├── message_loc: (35,6)-(35,7) = "y" - │ │ │ ├── opening_loc: ∅ - │ │ │ ├── arguments: ∅ - │ │ │ ├── closing_loc: ∅ - │ │ │ └── block: ∅ - │ │ ├── closing_loc: ∅ + │ │ │ └── name: :A + │ │ ├── opening_loc: (38,11)-(38,12) = "[" + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: (38,12)-(38,13) = "]" │ │ └── block: ∅ - │ ├── keyword_loc: (35,8)-(35,14) = "rescue" - │ └── rescue_expression: - │ @ CallNode (location: (35,15)-(35,18)) - │ ├── flags: ignore_visibility - │ ├── receiver: ∅ - │ ├── call_operator_loc: ∅ - │ ├── name: :c - │ ├── message_loc: (35,15)-(35,16) = "c" - │ ├── opening_loc: ∅ - │ ├── arguments: - │ │ @ ArgumentsNode (location: (35,17)-(35,18)) - │ │ ├── flags: ∅ - │ │ └── arguments: (length: 1) - │ │ └── @ CallNode (location: (35,17)-(35,18)) - │ │ ├── flags: variable_call, ignore_visibility - │ │ ├── receiver: ∅ - │ │ ├── call_operator_loc: ∅ - │ │ ├── name: :d - │ │ ├── message_loc: (35,17)-(35,18) = "d" - │ │ ├── opening_loc: ∅ - │ │ ├── arguments: ∅ - │ │ ├── closing_loc: ∅ - │ │ └── block: ∅ - │ ├── closing_loc: ∅ - │ └── block: ∅ - └── operator_loc: (35,2)-(35,3) = "=" + │ ├── then_keyword_loc: ∅ + │ ├── statements: ∅ + │ └── subsequent: ∅ + ├── else_clause: ∅ + ├── ensure_clause: ∅ + └── end_keyword_loc: (39,0)-(39,3) = "end" diff --git a/test/prism/fixtures/rescue.txt b/test/prism/fixtures/rescue.txt index 99170fbe0f..f436463029 100644 --- a/test/prism/fixtures/rescue.txt +++ b/test/prism/fixtures/rescue.txt @@ -33,3 +33,7 @@ end foo if bar rescue baz z = x y rescue c d + +begin +rescue => A[] +end From 713f068b1f3abbe913e6ba45eae7a79eeca87a87 Mon Sep 17 00:00:00 2001 From: Dmitry Dygalo Date: Sat, 12 Apr 2025 19:11:04 +0200 Subject: [PATCH 010/333] chore: fix clippy Signed-off-by: Dmitry Dygalo --- rust/ruby-prism/src/lib.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rust/ruby-prism/src/lib.rs b/rust/ruby-prism/src/lib.rs index 03fb21575d..a6fc7bed3d 100644 --- a/rust/ruby-prism/src/lib.rs +++ b/rust/ruby-prism/src/lib.rs @@ -253,6 +253,7 @@ impl<'pr> Integer<'pr> { /// Returns the sign and the u32 digits representation of the integer, /// ordered least significant digit first. + #[must_use] pub fn to_u32_digits(&self) -> (bool, &[u32]) { let negative = unsafe { (*self.pointer).negative }; let length = unsafe { (*self.pointer).length }; @@ -1184,7 +1185,7 @@ end let (negative, digits) = integer.to_u32_digits(); assert!(!negative); - assert_eq!(digits, &[4294967295, 4294967295, 4294967295, 2147483647]); + assert_eq!(digits, &[4_294_967_295, 4_294_967_295, 4_294_967_295, 2_147_483_647]); } #[test] From 9a2709d270b40e64840a27412dc77a837ee98f7d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 14 Apr 2025 16:33:33 +0000 Subject: [PATCH 011/333] Bump org.junit.jupiter:junit-jupiter-engine Bumps the java-deps group in /java-wasm with 1 update: [org.junit.jupiter:junit-jupiter-engine](https://github.com/junit-team/junit5). Updates `org.junit.jupiter:junit-jupiter-engine` from 5.12.1 to 5.12.2 - [Release notes](https://github.com/junit-team/junit5/releases) - [Commits](https://github.com/junit-team/junit5/compare/r5.12.1...r5.12.2) --- updated-dependencies: - dependency-name: org.junit.jupiter:junit-jupiter-engine dependency-version: 5.12.2 dependency-type: direct:development update-type: version-update:semver-patch dependency-group: java-deps ... Signed-off-by: dependabot[bot] --- java-wasm/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java-wasm/pom.xml b/java-wasm/pom.xml index 3d7d38cde2..8d9831c318 100644 --- a/java-wasm/pom.xml +++ b/java-wasm/pom.xml @@ -16,7 +16,7 @@ 11 1.2.1 - 5.12.1 + 5.12.2 From 15c994d06588c119dc3fd80a4078df5bd37525d3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 14 Apr 2025 16:48:51 +0000 Subject: [PATCH 012/333] Bump the ruby-deps group across 10 directories with 3 updates Bumps the ruby-deps group with 2 updates in the /gemfiles/2.7 directory: [parser](https://github.com/whitequark/parser) and [rake-compiler](https://github.com/luislavena/rake-compiler). Bumps the ruby-deps group with 2 updates in the /gemfiles/3.0 directory: [parser](https://github.com/whitequark/parser) and [rake-compiler](https://github.com/luislavena/rake-compiler). Bumps the ruby-deps group with 2 updates in the /gemfiles/3.1 directory: [parser](https://github.com/whitequark/parser) and [rake-compiler](https://github.com/luislavena/rake-compiler). Bumps the ruby-deps group with 2 updates in the /gemfiles/3.2 directory: [parser](https://github.com/whitequark/parser) and [rake-compiler](https://github.com/luislavena/rake-compiler). Bumps the ruby-deps group with 2 updates in the /gemfiles/3.3 directory: [parser](https://github.com/whitequark/parser) and [rake-compiler](https://github.com/luislavena/rake-compiler). Bumps the ruby-deps group with 2 updates in the /gemfiles/3.4 directory: [parser](https://github.com/whitequark/parser) and [rake-compiler](https://github.com/luislavena/rake-compiler). Bumps the ruby-deps group with 2 updates in the /gemfiles/3.5 directory: [parser](https://github.com/whitequark/parser) and [rake-compiler](https://github.com/luislavena/rake-compiler). Bumps the ruby-deps group with 2 updates in the /gemfiles/jruby directory: [parser](https://github.com/whitequark/parser) and [rake-compiler](https://github.com/luislavena/rake-compiler). Bumps the ruby-deps group with 2 updates in the /gemfiles/truffleruby directory: [parser](https://github.com/whitequark/parser) and [rake-compiler](https://github.com/luislavena/rake-compiler). Bumps the ruby-deps group with 3 updates in the /gemfiles/typecheck directory: [parser](https://github.com/whitequark/parser), [rake-compiler](https://github.com/luislavena/rake-compiler) and [sorbet](https://github.com/sorbet/sorbet). Updates `parser` from 3.3.7.4 to 3.3.8.0 - [Changelog](https://github.com/whitequark/parser/blob/master/CHANGELOG.md) - [Commits](https://github.com/whitequark/parser/compare/v3.3.7.4...v3.3.8.0) Updates `rake-compiler` from 1.2.9 to 1.3.0 - [Release notes](https://github.com/luislavena/rake-compiler/releases) - [Changelog](https://github.com/rake-compiler/rake-compiler/blob/master/History.md) - [Commits](https://github.com/luislavena/rake-compiler/compare/v1.2.9...v1.3.0) Updates `parser` from 3.3.7.4 to 3.3.8.0 - [Changelog](https://github.com/whitequark/parser/blob/master/CHANGELOG.md) - [Commits](https://github.com/whitequark/parser/compare/v3.3.7.4...v3.3.8.0) Updates `rake-compiler` from 1.2.9 to 1.3.0 - [Release notes](https://github.com/luislavena/rake-compiler/releases) - [Changelog](https://github.com/rake-compiler/rake-compiler/blob/master/History.md) - [Commits](https://github.com/luislavena/rake-compiler/compare/v1.2.9...v1.3.0) Updates `parser` from 3.3.7.4 to 3.3.8.0 - [Changelog](https://github.com/whitequark/parser/blob/master/CHANGELOG.md) - [Commits](https://github.com/whitequark/parser/compare/v3.3.7.4...v3.3.8.0) Updates `rake-compiler` from 1.2.9 to 1.3.0 - [Release notes](https://github.com/luislavena/rake-compiler/releases) - [Changelog](https://github.com/rake-compiler/rake-compiler/blob/master/History.md) - [Commits](https://github.com/luislavena/rake-compiler/compare/v1.2.9...v1.3.0) Updates `parser` from 3.3.7.4 to 3.3.8.0 - [Changelog](https://github.com/whitequark/parser/blob/master/CHANGELOG.md) - [Commits](https://github.com/whitequark/parser/compare/v3.3.7.4...v3.3.8.0) Updates `rake-compiler` from 1.2.9 to 1.3.0 - [Release notes](https://github.com/luislavena/rake-compiler/releases) - [Changelog](https://github.com/rake-compiler/rake-compiler/blob/master/History.md) - [Commits](https://github.com/luislavena/rake-compiler/compare/v1.2.9...v1.3.0) Updates `parser` from 3.3.7.4 to 3.3.8.0 - [Changelog](https://github.com/whitequark/parser/blob/master/CHANGELOG.md) - [Commits](https://github.com/whitequark/parser/compare/v3.3.7.4...v3.3.8.0) Updates `rake-compiler` from 1.2.9 to 1.3.0 - [Release notes](https://github.com/luislavena/rake-compiler/releases) - [Changelog](https://github.com/rake-compiler/rake-compiler/blob/master/History.md) - [Commits](https://github.com/luislavena/rake-compiler/compare/v1.2.9...v1.3.0) Updates `parser` from 3.3.7.4 to 3.3.8.0 - [Changelog](https://github.com/whitequark/parser/blob/master/CHANGELOG.md) - [Commits](https://github.com/whitequark/parser/compare/v3.3.7.4...v3.3.8.0) Updates `rake-compiler` from 1.2.9 to 1.3.0 - [Release notes](https://github.com/luislavena/rake-compiler/releases) - [Changelog](https://github.com/rake-compiler/rake-compiler/blob/master/History.md) - [Commits](https://github.com/luislavena/rake-compiler/compare/v1.2.9...v1.3.0) Updates `parser` from 3.3.7.4 to 3.3.8.0 - [Changelog](https://github.com/whitequark/parser/blob/master/CHANGELOG.md) - [Commits](https://github.com/whitequark/parser/compare/v3.3.7.4...v3.3.8.0) Updates `rake-compiler` from 1.2.9 to 1.3.0 - [Release notes](https://github.com/luislavena/rake-compiler/releases) - [Changelog](https://github.com/rake-compiler/rake-compiler/blob/master/History.md) - [Commits](https://github.com/luislavena/rake-compiler/compare/v1.2.9...v1.3.0) Updates `parser` from 3.3.7.4 to 3.3.8.0 - [Changelog](https://github.com/whitequark/parser/blob/master/CHANGELOG.md) - [Commits](https://github.com/whitequark/parser/compare/v3.3.7.4...v3.3.8.0) Updates `rake-compiler` from 1.2.9 to 1.3.0 - [Release notes](https://github.com/luislavena/rake-compiler/releases) - [Changelog](https://github.com/rake-compiler/rake-compiler/blob/master/History.md) - [Commits](https://github.com/luislavena/rake-compiler/compare/v1.2.9...v1.3.0) Updates `parser` from 3.3.7.4 to 3.3.8.0 - [Changelog](https://github.com/whitequark/parser/blob/master/CHANGELOG.md) - [Commits](https://github.com/whitequark/parser/compare/v3.3.7.4...v3.3.8.0) Updates `rake-compiler` from 1.2.9 to 1.3.0 - [Release notes](https://github.com/luislavena/rake-compiler/releases) - [Changelog](https://github.com/rake-compiler/rake-compiler/blob/master/History.md) - [Commits](https://github.com/luislavena/rake-compiler/compare/v1.2.9...v1.3.0) Updates `parser` from 3.3.7.4 to 3.3.8.0 - [Changelog](https://github.com/whitequark/parser/blob/master/CHANGELOG.md) - [Commits](https://github.com/whitequark/parser/compare/v3.3.7.4...v3.3.8.0) Updates `rake-compiler` from 1.2.9 to 1.3.0 - [Release notes](https://github.com/luislavena/rake-compiler/releases) - [Changelog](https://github.com/rake-compiler/rake-compiler/blob/master/History.md) - [Commits](https://github.com/luislavena/rake-compiler/compare/v1.2.9...v1.3.0) Updates `sorbet` from 0.5.11989 to 0.5.12010 - [Release notes](https://github.com/sorbet/sorbet/releases) - [Commits](https://github.com/sorbet/sorbet/commits) --- updated-dependencies: - dependency-name: parser dependency-version: 3.3.8.0 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps - dependency-name: rake-compiler dependency-version: 1.3.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: parser dependency-version: 3.3.8.0 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps - dependency-name: rake-compiler dependency-version: 1.3.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: parser dependency-version: 3.3.8.0 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps - dependency-name: rake-compiler dependency-version: 1.3.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: parser dependency-version: 3.3.8.0 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps - dependency-name: rake-compiler dependency-version: 1.3.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: parser dependency-version: 3.3.8.0 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps - dependency-name: rake-compiler dependency-version: 1.3.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: parser dependency-version: 3.3.8.0 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps - dependency-name: rake-compiler dependency-version: 1.3.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: parser dependency-version: 3.3.8.0 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps - dependency-name: rake-compiler dependency-version: 1.3.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: parser dependency-version: 3.3.8.0 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps - dependency-name: rake-compiler dependency-version: 1.3.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: parser dependency-version: 3.3.8.0 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps - dependency-name: rake-compiler dependency-version: 1.3.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: parser dependency-version: 3.3.8.0 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps - dependency-name: rake-compiler dependency-version: 1.3.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: sorbet dependency-version: 0.5.12010 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps ... Signed-off-by: dependabot[bot] --- gemfiles/2.7/Gemfile.lock | 4 ++-- gemfiles/3.0/Gemfile.lock | 4 ++-- gemfiles/3.1/Gemfile.lock | 4 ++-- gemfiles/3.2/Gemfile.lock | 4 ++-- gemfiles/3.3/Gemfile.lock | 4 ++-- gemfiles/3.4/Gemfile.lock | 4 ++-- gemfiles/3.5/Gemfile.lock | 4 ++-- gemfiles/jruby/Gemfile.lock | 4 ++-- gemfiles/truffleruby/Gemfile.lock | 4 ++-- gemfiles/typecheck/Gemfile.lock | 20 ++++++++++---------- 10 files changed, 28 insertions(+), 28 deletions(-) diff --git a/gemfiles/2.7/Gemfile.lock b/gemfiles/2.7/Gemfile.lock index bddefee416..418aec99d7 100644 --- a/gemfiles/2.7/Gemfile.lock +++ b/gemfiles/2.7/Gemfile.lock @@ -8,13 +8,13 @@ GEM specs: ast (2.4.3) onigmo (0.1.0) - parser (3.3.7.4) + parser (3.3.8.0) ast (~> 2.4.1) racc power_assert (2.0.5) racc (1.8.1) rake (13.2.1) - rake-compiler (1.2.9) + rake-compiler (1.3.0) rake rbs (3.1.3) test-unit (3.6.8) diff --git a/gemfiles/3.0/Gemfile.lock b/gemfiles/3.0/Gemfile.lock index 57d7869768..0a94cb01ea 100644 --- a/gemfiles/3.0/Gemfile.lock +++ b/gemfiles/3.0/Gemfile.lock @@ -13,13 +13,13 @@ GEM mini_portile2 (~> 2.8.2) racc (~> 1.4) onigmo (0.1.0) - parser (3.3.7.4) + parser (3.3.8.0) ast (~> 2.4.1) racc power_assert (2.0.5) racc (1.8.1) rake (13.2.1) - rake-compiler (1.2.9) + rake-compiler (1.3.0) rake rbs (3.6.1) logger diff --git a/gemfiles/3.1/Gemfile.lock b/gemfiles/3.1/Gemfile.lock index 428516c7a0..3d80a97bc0 100644 --- a/gemfiles/3.1/Gemfile.lock +++ b/gemfiles/3.1/Gemfile.lock @@ -13,13 +13,13 @@ GEM mini_portile2 (~> 2.8.2) racc (~> 1.4) onigmo (0.1.0) - parser (3.3.7.4) + parser (3.3.8.0) ast (~> 2.4.1) racc power_assert (2.0.5) racc (1.8.1) rake (13.2.1) - rake-compiler (1.2.9) + rake-compiler (1.3.0) rake rbs (3.9.2) logger diff --git a/gemfiles/3.2/Gemfile.lock b/gemfiles/3.2/Gemfile.lock index be29a20c48..3f3ae012c0 100644 --- a/gemfiles/3.2/Gemfile.lock +++ b/gemfiles/3.2/Gemfile.lock @@ -13,13 +13,13 @@ GEM mini_portile2 (~> 2.8.2) racc (~> 1.4) onigmo (0.1.0) - parser (3.3.7.4) + parser (3.3.8.0) ast (~> 2.4.1) racc power_assert (2.0.5) racc (1.8.1) rake (13.2.1) - rake-compiler (1.2.9) + rake-compiler (1.3.0) rake rbs (3.9.2) logger diff --git a/gemfiles/3.3/Gemfile.lock b/gemfiles/3.3/Gemfile.lock index 3c621b393d..ed2f01d981 100644 --- a/gemfiles/3.3/Gemfile.lock +++ b/gemfiles/3.3/Gemfile.lock @@ -13,13 +13,13 @@ GEM mini_portile2 (~> 2.8.2) racc (~> 1.4) onigmo (0.1.0) - parser (3.3.7.4) + parser (3.3.8.0) ast (~> 2.4.1) racc power_assert (2.0.5) racc (1.8.1) rake (13.2.1) - rake-compiler (1.2.9) + rake-compiler (1.3.0) rake rbs (3.9.2) logger diff --git a/gemfiles/3.4/Gemfile.lock b/gemfiles/3.4/Gemfile.lock index 7e9e5898bb..859c4f6a0b 100644 --- a/gemfiles/3.4/Gemfile.lock +++ b/gemfiles/3.4/Gemfile.lock @@ -13,13 +13,13 @@ GEM mini_portile2 (~> 2.8.2) racc (~> 1.4) onigmo (0.1.0) - parser (3.3.7.4) + parser (3.3.8.0) ast (~> 2.4.1) racc power_assert (2.0.5) racc (1.8.1) rake (13.2.1) - rake-compiler (1.2.9) + rake-compiler (1.3.0) rake rbs (3.9.2) logger diff --git a/gemfiles/3.5/Gemfile.lock b/gemfiles/3.5/Gemfile.lock index 2e081fa9d7..aba15f5fb5 100644 --- a/gemfiles/3.5/Gemfile.lock +++ b/gemfiles/3.5/Gemfile.lock @@ -14,13 +14,13 @@ GEM mini_portile2 (~> 2.8.2) racc (~> 1.4) onigmo (0.1.0) - parser (3.3.7.4) + parser (3.3.8.0) ast (~> 2.4.1) racc power_assert (2.0.5) racc (1.8.1) rake (13.2.1) - rake-compiler (1.2.9) + rake-compiler (1.3.0) rake rbs (3.9.2) logger diff --git a/gemfiles/jruby/Gemfile.lock b/gemfiles/jruby/Gemfile.lock index 0a38fab5c3..09c0cc92fc 100644 --- a/gemfiles/jruby/Gemfile.lock +++ b/gemfiles/jruby/Gemfile.lock @@ -7,14 +7,14 @@ GEM remote: https://rubygems.org/ specs: ast (2.4.3) - parser (3.3.7.4) + parser (3.3.8.0) ast (~> 2.4.1) racc power_assert (2.0.5) racc (1.8.1) racc (1.8.1-java) rake (13.2.1) - rake-compiler (1.2.9) + rake-compiler (1.3.0) rake test-unit (3.6.8) power_assert diff --git a/gemfiles/truffleruby/Gemfile.lock b/gemfiles/truffleruby/Gemfile.lock index 4cbfac607d..2a3b4f90f8 100644 --- a/gemfiles/truffleruby/Gemfile.lock +++ b/gemfiles/truffleruby/Gemfile.lock @@ -7,13 +7,13 @@ GEM remote: https://rubygems.org/ specs: ast (2.4.3) - parser (3.3.7.4) + parser (3.3.8.0) ast (~> 2.4.1) racc power_assert (2.0.5) racc (1.8.1) rake (13.2.1) - rake-compiler (1.2.9) + rake-compiler (1.3.0) rake test-unit (3.6.8) power_assert diff --git a/gemfiles/typecheck/Gemfile.lock b/gemfiles/typecheck/Gemfile.lock index c274d1eaa9..3f1d2c6b5d 100644 --- a/gemfiles/typecheck/Gemfile.lock +++ b/gemfiles/typecheck/Gemfile.lock @@ -38,7 +38,7 @@ GEM mutex_m (0.3.0) netrc (0.11.0) parallel (1.26.3) - parser (3.3.7.4) + parser (3.3.8.0) ast (~> 2.4.1) racc power_assert (2.0.5) @@ -46,7 +46,7 @@ GEM racc (1.8.1) rainbow (3.1.1) rake (13.2.1) - rake-compiler (1.2.9) + rake-compiler (1.3.0) rake rb-fsevent (0.11.2) rb-inotify (0.11.1) @@ -62,14 +62,14 @@ GEM sexp_processor (~> 4.16) securerandom (0.4.1) sexp_processor (4.17.3) - sorbet (0.5.11989) - sorbet-static (= 0.5.11989) - sorbet-runtime (0.5.11989) - sorbet-static (0.5.11989-universal-darwin) - sorbet-static (0.5.11989-x86_64-linux) - sorbet-static-and-runtime (0.5.11989) - sorbet (= 0.5.11989) - sorbet-runtime (= 0.5.11989) + sorbet (0.5.12010) + sorbet-static (= 0.5.12010) + sorbet-runtime (0.5.12010) + sorbet-static (0.5.12010-universal-darwin) + sorbet-static (0.5.12010-x86_64-linux) + sorbet-static-and-runtime (0.5.12010) + sorbet (= 0.5.12010) + sorbet-runtime (= 0.5.12010) spoom (1.6.1) erubi (>= 1.10.0) prism (>= 0.28.0) From 46c13f94dc2fbc8bc95fda566b6354dd124b2007 Mon Sep 17 00:00:00 2001 From: Kohei Suzuki Date: Fri, 18 Apr 2025 16:30:55 +0900 Subject: [PATCH 013/333] Make pm_comment_type_t field accessible from Rust wrapper --- rust/ruby-prism/src/lib.rs | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/rust/ruby-prism/src/lib.rs b/rust/ruby-prism/src/lib.rs index 868a4cd5c0..323dcae204 100644 --- a/rust/ruby-prism/src/lib.rs +++ b/rust/ruby-prism/src/lib.rs @@ -19,7 +19,7 @@ use std::mem::MaybeUninit; use std::ptr::NonNull; pub use self::bindings::*; -use ruby_prism_sys::{pm_comment_t, pm_constant_id_list_t, pm_constant_id_t, pm_diagnostic_t, pm_integer_t, pm_location_t, pm_magic_comment_t, pm_node_destroy, pm_node_list, pm_node_t, pm_parse, pm_parser_free, pm_parser_init, pm_parser_t}; +use ruby_prism_sys::{pm_comment_t, pm_comment_type_t, pm_constant_id_list_t, pm_constant_id_t, pm_diagnostic_t, pm_integer_t, pm_location_t, pm_magic_comment_t, pm_node_destroy, pm_node_list, pm_node_t, pm_parse, pm_parser_free, pm_parser_init, pm_parser_t}; /// A range in the source file. pub struct Location<'pr> { @@ -329,6 +329,15 @@ pub struct Comment<'pr> { marker: PhantomData<&'pr pm_comment_t>, } +/// The type of the comment +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub enum CommentType { + /// InlineComment corresponds to comments that start with #. + InlineComment, + /// EmbDocComment corresponds to comments that are surrounded by =begin and =end. + EmbDocComment, +} + impl<'pr> Comment<'pr> { /// Returns the text of the comment. /// @@ -339,6 +348,16 @@ impl<'pr> Comment<'pr> { self.location().as_slice() } + /// Returns the type of the comment. + pub fn type_(&self) -> CommentType { + let type_ = unsafe { self.comment.as_ref().type_ }; + if type_ == pm_comment_type_t::PM_COMMENT_EMBDOC { + CommentType::EmbDocComment + } else { + CommentType::InlineComment + } + } + /// The location of the comment in the source. #[must_use] pub fn location(&self) -> Location<'pr> { @@ -593,6 +612,7 @@ mod tests { let result = parse(source.as_ref()); for comment in result.comments() { + assert_eq!(super::CommentType::InlineComment, comment.type_()); let text = std::str::from_utf8(comment.text()).unwrap(); assert!(text.starts_with("# comment")); } From 27d284bbb8f85de6334c2437f9af0fd7f5d7ed2f Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Mon, 21 Apr 2025 16:07:03 -0400 Subject: [PATCH 014/333] Bump JRuby version --- gemfiles/jruby/Gemfile | 2 +- gemfiles/jruby/Gemfile.lock | 8 ++++---- test/prism/ruby/parameters_signature_test.rb | 2 +- test/prism/ruby/parser_test.rb | 12 +----------- test/prism/ruby/ripper_test.rb | 2 +- 5 files changed, 8 insertions(+), 18 deletions(-) diff --git a/gemfiles/jruby/Gemfile b/gemfiles/jruby/Gemfile index 6d2ca211b6..23d09a18a7 100644 --- a/gemfiles/jruby/Gemfile +++ b/gemfiles/jruby/Gemfile @@ -2,7 +2,7 @@ source "https://rubygems.org" -ruby "~> 3.1.4", engine: "jruby", engine_version: "~> 9.4.5" +ruby "~> 3.4.2", engine: "jruby", engine_version: "~> 10.0.0.0" gemspec path: "../.." diff --git a/gemfiles/jruby/Gemfile.lock b/gemfiles/jruby/Gemfile.lock index 0a38fab5c3..91ca442677 100644 --- a/gemfiles/jruby/Gemfile.lock +++ b/gemfiles/jruby/Gemfile.lock @@ -7,14 +7,14 @@ GEM remote: https://rubygems.org/ specs: ast (2.4.3) - parser (3.3.7.4) + parser (3.3.8.0) ast (~> 2.4.1) racc power_assert (2.0.5) racc (1.8.1) racc (1.8.1-java) rake (13.2.1) - rake-compiler (1.2.9) + rake-compiler (1.3.0) rake test-unit (3.6.8) power_assert @@ -36,7 +36,7 @@ DEPENDENCIES test-unit RUBY VERSION - ruby 3.1.4p0 (jruby 9.4.5.0) + ruby 3.4.2p0 (jruby 10.0.0.0) BUNDLED WITH - 2.3.26 + 2.6.3 diff --git a/test/prism/ruby/parameters_signature_test.rb b/test/prism/ruby/parameters_signature_test.rb index af5b54ed91..ea1eea106b 100644 --- a/test/prism/ruby/parameters_signature_test.rb +++ b/test/prism/ruby/parameters_signature_test.rb @@ -54,7 +54,7 @@ def test_keyrest_anonymous assert_parameters([[:keyrest, :**]], "**") end - if RUBY_ENGINE != "truffleruby" + if RUBY_ENGINE == "ruby" def test_key_ordering assert_parameters([[:keyreq, :a], [:keyreq, :b], [:key, :c], [:key, :d]], "a:, c: 1, b:, d: 2") end diff --git a/test/prism/ruby/parser_test.rb b/test/prism/ruby/parser_test.rb index cd52758f2e..82b5ea54a8 100644 --- a/test/prism/ruby/parser_test.rb +++ b/test/prism/ruby/parser_test.rb @@ -99,16 +99,6 @@ class ParserTest < TestCase "seattlerb/regexp_esc_C_slash.txt", ] - # These files are either failing to parse or failing to translate, so we'll - # skip them for now. - skip_all = skip_incorrect | [ - ] - - # Not sure why these files are failing on JRuby, but skipping them for now. - if RUBY_ENGINE == "jruby" - skip_all.push("emoji_method_calls.txt", "symbols.txt") - end - # These files are failing to translate their lexer output into the lexer # output expected by the parser gem, so we'll skip them for now. skip_tokens = [ @@ -147,7 +137,7 @@ class ParserTest < TestCase define_method(fixture.test_name) do assert_equal_parses( fixture, - compare_asts: !skip_all.include?(fixture.path), + compare_asts: !skip_incorrect.include?(fixture.path), compare_tokens: !skip_tokens.include?(fixture.path), compare_comments: fixture.path != "embdoc_no_newline_at_end.txt" ) diff --git a/test/prism/ruby/ripper_test.rb b/test/prism/ruby/ripper_test.rb index d4b278c28e..5c37178889 100644 --- a/test/prism/ruby/ripper_test.rb +++ b/test/prism/ruby/ripper_test.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -return if RUBY_VERSION < "3.3" || RUBY_ENGINE == "truffleruby" +return if RUBY_VERSION < "3.3" || RUBY_ENGINE != "ruby" require_relative "../test_helper" From 2a9f19ceb4d8d2672c5c515f29343c722cf28935 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 24 Apr 2025 17:12:42 +0000 Subject: [PATCH 015/333] Bump nokogiri from 1.18.5 to 1.18.8 in /gemfiles/3.4 Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.18.5 to 1.18.8. - [Release notes](https://github.com/sparklemotion/nokogiri/releases) - [Changelog](https://github.com/sparklemotion/nokogiri/blob/main/CHANGELOG.md) - [Commits](https://github.com/sparklemotion/nokogiri/compare/v1.18.5...v1.18.8) --- updated-dependencies: - dependency-name: nokogiri dependency-version: 1.18.8 dependency-type: indirect ... Signed-off-by: dependabot[bot] --- gemfiles/3.4/Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gemfiles/3.4/Gemfile.lock b/gemfiles/3.4/Gemfile.lock index 859c4f6a0b..4c1ffc0b21 100644 --- a/gemfiles/3.4/Gemfile.lock +++ b/gemfiles/3.4/Gemfile.lock @@ -9,7 +9,7 @@ GEM ast (2.4.3) logger (1.7.0) mini_portile2 (2.8.8) - nokogiri (1.18.5) + nokogiri (1.18.8) mini_portile2 (~> 2.8.2) racc (~> 1.4) onigmo (0.1.0) From 2ae713aa820d7ddf513f576d64b30e0f873218ed Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 24 Apr 2025 17:13:27 +0000 Subject: [PATCH 016/333] Bump the ruby-deps group across 2 directories with 2 updates Bumps the ruby-deps group with 1 update in the /gemfiles/3.5 directory: [ffi](https://github.com/ffi/ffi). Bumps the ruby-deps group with 2 updates in the /gemfiles/typecheck directory: [ffi](https://github.com/ffi/ffi) and [sorbet](https://github.com/sorbet/sorbet). Updates `ffi` from 1.17.1 to 1.17.2 - [Changelog](https://github.com/ffi/ffi/blob/master/CHANGELOG.md) - [Commits](https://github.com/ffi/ffi/compare/v1.17.1...v1.17.2) Updates `ffi` from 1.17.1 to 1.17.2 - [Changelog](https://github.com/ffi/ffi/blob/master/CHANGELOG.md) - [Commits](https://github.com/ffi/ffi/compare/v1.17.1...v1.17.2) Updates `sorbet` from 0.5.12010 to 0.5.12026 - [Release notes](https://github.com/sorbet/sorbet/releases) - [Commits](https://github.com/sorbet/sorbet/commits) --- updated-dependencies: - dependency-name: ffi dependency-version: 1.17.2 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps - dependency-name: ffi dependency-version: 1.17.2 dependency-type: indirect update-type: version-update:semver-patch dependency-group: ruby-deps - dependency-name: sorbet dependency-version: 0.5.12026 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps ... Signed-off-by: dependabot[bot] --- gemfiles/3.5/Gemfile.lock | 2 +- gemfiles/typecheck/Gemfile.lock | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/gemfiles/3.5/Gemfile.lock b/gemfiles/3.5/Gemfile.lock index aba15f5fb5..21ed7c2f4a 100644 --- a/gemfiles/3.5/Gemfile.lock +++ b/gemfiles/3.5/Gemfile.lock @@ -7,7 +7,7 @@ GEM remote: https://rubygems.org/ specs: ast (2.4.3) - ffi (1.17.1) + ffi (1.17.2) logger (1.7.0) mini_portile2 (2.8.8) nokogiri (1.18.5) diff --git a/gemfiles/typecheck/Gemfile.lock b/gemfiles/typecheck/Gemfile.lock index 3f1d2c6b5d..6ff7a51519 100644 --- a/gemfiles/typecheck/Gemfile.lock +++ b/gemfiles/typecheck/Gemfile.lock @@ -23,8 +23,8 @@ GEM csv (3.3.3) drb (2.2.1) erubi (1.13.1) - ffi (1.17.1-arm64-darwin) - ffi (1.17.1-x86_64-linux-gnu) + ffi (1.17.2-arm64-darwin) + ffi (1.17.2-x86_64-linux-gnu) fileutils (1.7.3) i18n (1.14.7) concurrent-ruby (~> 1.0) @@ -62,14 +62,14 @@ GEM sexp_processor (~> 4.16) securerandom (0.4.1) sexp_processor (4.17.3) - sorbet (0.5.12010) - sorbet-static (= 0.5.12010) - sorbet-runtime (0.5.12010) - sorbet-static (0.5.12010-universal-darwin) - sorbet-static (0.5.12010-x86_64-linux) - sorbet-static-and-runtime (0.5.12010) - sorbet (= 0.5.12010) - sorbet-runtime (= 0.5.12010) + sorbet (0.5.12032) + sorbet-static (= 0.5.12032) + sorbet-runtime (0.5.12032) + sorbet-static (0.5.12032-universal-darwin) + sorbet-static (0.5.12032-x86_64-linux) + sorbet-static-and-runtime (0.5.12032) + sorbet (= 0.5.12032) + sorbet-runtime (= 0.5.12032) spoom (1.6.1) erubi (>= 1.10.0) prism (>= 0.28.0) From 62e7f581cf82e4351b17a4c383e7c1fc0926ce7e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 5 May 2025 16:59:41 +0000 Subject: [PATCH 017/333] Bump the java-deps group in /java-wasm with 3 updates Bumps the java-deps group in /java-wasm with 3 updates: [com.dylibso.chicory:bom](https://github.com/dylibso/chicory), com.dylibso.chicory:host-module-processor-experimental and com.dylibso.chicory:aot-maven-plugin-experimental. Updates `com.dylibso.chicory:bom` from 1.2.1 to 1.3.0 - [Release notes](https://github.com/dylibso/chicory/releases) - [Commits](https://github.com/dylibso/chicory/compare/1.2.1...1.3.0) Updates `com.dylibso.chicory:host-module-processor-experimental` from 1.2.1 to 1.3.0 Updates `com.dylibso.chicory:aot-maven-plugin-experimental` from 1.2.1 to 1.3.0 Updates `com.dylibso.chicory:host-module-processor-experimental` from 1.2.1 to 1.3.0 Updates `com.dylibso.chicory:aot-maven-plugin-experimental` from 1.2.1 to 1.3.0 --- updated-dependencies: - dependency-name: com.dylibso.chicory:bom dependency-version: 1.3.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: java-deps - dependency-name: com.dylibso.chicory:host-module-processor-experimental dependency-version: 1.3.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: java-deps - dependency-name: com.dylibso.chicory:aot-maven-plugin-experimental dependency-version: 1.3.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: java-deps - dependency-name: com.dylibso.chicory:host-module-processor-experimental dependency-version: 1.3.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: java-deps - dependency-name: com.dylibso.chicory:aot-maven-plugin-experimental dependency-version: 1.3.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: java-deps ... Signed-off-by: dependabot[bot] --- java-wasm/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java-wasm/pom.xml b/java-wasm/pom.xml index 8d9831c318..69726a620f 100644 --- a/java-wasm/pom.xml +++ b/java-wasm/pom.xml @@ -15,7 +15,7 @@ 11 11 - 1.2.1 + 1.3.0 5.12.2 From 483aa8923447ba2acfb4c02b99363d8cd505d933 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Tue, 6 May 2025 08:57:30 -0400 Subject: [PATCH 018/333] Optimize context_terminator with a lookup table --- config.yml | 71 ++++++++++++------------ rakelib/lint.rake | 11 ---- src/prism.c | 137 ++++++++++++++++++++-------------------------- 3 files changed, 96 insertions(+), 123 deletions(-) diff --git a/config.yml b/config.yml index 3d5eee190f..c9358b077f 100644 --- a/config.yml +++ b/config.yml @@ -320,13 +320,42 @@ warnings: - UNUSED_LOCAL_VARIABLE - VOID_STATEMENT tokens: + # The order of the tokens at the beginning is important, because we use them + # for a lookup table. - name: EOF value: 1 comment: final token in the file - - name: MISSING - comment: "a token that was expected but not found" - - name: NOT_PROVIDED - comment: "a token that was not present but it is okay" + - name: BRACE_RIGHT + comment: "}" + - name: COMMA + comment: "," + - name: EMBEXPR_END + comment: "}" + - name: KEYWORD_DO + comment: "do" + - name: KEYWORD_ELSE + comment: "else" + - name: KEYWORD_ELSIF + comment: "elsif" + - name: KEYWORD_END + comment: "end" + - name: KEYWORD_ENSURE + comment: "ensure" + - name: KEYWORD_IN + comment: "in" + - name: KEYWORD_RESCUE + comment: "rescue" + - name: KEYWORD_THEN + comment: "then" + - name: KEYWORD_WHEN + comment: "when" + - name: NEWLINE + comment: "a newline character outside of other tokens" + - name: PARENTHESIS_RIGHT + comment: ")" + - name: SEMICOLON + comment: ";" + # Tokens from here on are not used for lookup, and can be in any order. - name: AMPERSAND comment: "&" - name: AMPERSAND_AMPERSAND @@ -349,8 +378,6 @@ tokens: comment: "!~" - name: BRACE_LEFT comment: "{" - - name: BRACE_RIGHT - comment: "}" - name: BRACKET_LEFT comment: "[" - name: BRACKET_LEFT_ARRAY @@ -373,8 +400,6 @@ tokens: comment: ":" - name: COLON_COLON comment: "::" - - name: COMMA - comment: "," - name: COMMENT comment: "a comment" - name: CONSTANT @@ -393,8 +418,6 @@ tokens: comment: "a line inside of embedded documentation" - name: EMBEXPR_BEGIN comment: "#{" - - name: EMBEXPR_END - comment: "}" - name: EMBVAR comment: "#" - name: EQUAL @@ -461,20 +484,10 @@ tokens: comment: "def" - name: KEYWORD_DEFINED comment: "defined?" - - name: KEYWORD_DO - comment: "do" - name: KEYWORD_DO_LOOP comment: "do keyword for a predicate in a while, until, or for loop" - - name: KEYWORD_ELSE - comment: "else" - - name: KEYWORD_ELSIF - comment: "elsif" - - name: KEYWORD_END - comment: "end" - name: KEYWORD_END_UPCASE comment: "END" - - name: KEYWORD_ENSURE - comment: "ensure" - name: KEYWORD_FALSE comment: "false" - name: KEYWORD_FOR @@ -483,8 +496,6 @@ tokens: comment: "if" - name: KEYWORD_IF_MODIFIER comment: "if in the modifier form" - - name: KEYWORD_IN - comment: "in" - name: KEYWORD_MODULE comment: "module" - name: KEYWORD_NEXT @@ -497,8 +508,6 @@ tokens: comment: "or" - name: KEYWORD_REDO comment: "redo" - - name: KEYWORD_RESCUE - comment: "rescue" - name: KEYWORD_RESCUE_MODIFIER comment: "rescue in the modifier form" - name: KEYWORD_RETRY @@ -509,8 +518,6 @@ tokens: comment: "self" - name: KEYWORD_SUPER comment: "super" - - name: KEYWORD_THEN - comment: "then" - name: KEYWORD_TRUE comment: "true" - name: KEYWORD_UNDEF @@ -523,8 +530,6 @@ tokens: comment: "until" - name: KEYWORD_UNTIL_MODIFIER comment: "until in the modifier form" - - name: KEYWORD_WHEN - comment: "when" - name: KEYWORD_WHILE comment: "while" - name: KEYWORD_WHILE_MODIFIER @@ -561,16 +566,12 @@ tokens: comment: "-=" - name: MINUS_GREATER comment: "->" - - name: NEWLINE - comment: "a newline character outside of other tokens" - name: NUMBERED_REFERENCE comment: "a numbered reference to a capture group in the previous regular expression match" - name: PARENTHESIS_LEFT comment: "(" - name: PARENTHESIS_LEFT_PARENTHESES comment: "( for a parentheses node" - - name: PARENTHESIS_RIGHT - comment: ")" - name: PERCENT comment: "%" - name: PERCENT_EQUAL @@ -603,8 +604,6 @@ tokens: comment: "the beginning of a regular expression" - name: REGEXP_END comment: "the end of a regular expression" - - name: SEMICOLON - comment: ";" - name: SLASH comment: "/" - name: SLASH_EQUAL @@ -649,6 +648,10 @@ tokens: comment: "a separator between words in a list" - name: __END__ comment: "marker for the point in the file at which the parser should stop" + - name: MISSING + comment: "a token that was expected but not found" + - name: NOT_PROVIDED + comment: "a token that was not present but it is okay" flags: - name: ArgumentsNodeFlags values: diff --git a/rakelib/lint.rake b/rakelib/lint.rake index 89d5a01ba5..e5ecdb28bc 100644 --- a/rakelib/lint.rake +++ b/rakelib/lint.rake @@ -5,17 +5,6 @@ task :lint do require "yaml" config = YAML.safe_load_file(File.expand_path("../config.yml", __dir__)) - tokens = config.fetch("tokens")[4..-1].map { |token| token.fetch("name") } - if tokens.sort != tokens - warn("Tokens are not sorted alphabetically") - - tokens.sort.zip(tokens).each do |(sorted, unsorted)| - warn("Expected #{sorted} got #{unsorted}") if sorted != unsorted - end - - exit(1) - end - nodes = config.fetch("nodes") names = nodes.map { |node| node.fetch("name") } if names.sort != names diff --git a/src/prism.c b/src/prism.c index cc634b59e3..1acbab0d1e 100644 --- a/src/prism.c +++ b/src/prism.c @@ -8582,85 +8582,66 @@ parser_lex_magic_comment(pm_parser_t *parser, bool semantic_token_seen) { /* Context manipulations */ /******************************************************************************/ -static bool -context_terminator(pm_context_t context, pm_token_t *token) { - switch (context) { - case PM_CONTEXT_MAIN: - case PM_CONTEXT_DEF_PARAMS: - case PM_CONTEXT_DEFINED: - case PM_CONTEXT_MULTI_TARGET: - case PM_CONTEXT_TERNARY: - case PM_CONTEXT_RESCUE_MODIFIER: - return token->type == PM_TOKEN_EOF; - case PM_CONTEXT_DEFAULT_PARAMS: - return token->type == PM_TOKEN_COMMA || token->type == PM_TOKEN_PARENTHESIS_RIGHT; - case PM_CONTEXT_PREEXE: - case PM_CONTEXT_POSTEXE: - return token->type == PM_TOKEN_BRACE_RIGHT; - case PM_CONTEXT_MODULE: - case PM_CONTEXT_CLASS: - case PM_CONTEXT_SCLASS: - case PM_CONTEXT_LAMBDA_DO_END: - case PM_CONTEXT_DEF: - case PM_CONTEXT_BLOCK_KEYWORDS: - return token->type == PM_TOKEN_KEYWORD_END || token->type == PM_TOKEN_KEYWORD_RESCUE || token->type == PM_TOKEN_KEYWORD_ENSURE; - case PM_CONTEXT_WHILE: - case PM_CONTEXT_UNTIL: - case PM_CONTEXT_ELSE: - case PM_CONTEXT_FOR: - case PM_CONTEXT_BEGIN_ENSURE: - case PM_CONTEXT_BLOCK_ENSURE: - case PM_CONTEXT_CLASS_ENSURE: - case PM_CONTEXT_DEF_ENSURE: - case PM_CONTEXT_LAMBDA_ENSURE: - case PM_CONTEXT_MODULE_ENSURE: - case PM_CONTEXT_SCLASS_ENSURE: - return token->type == PM_TOKEN_KEYWORD_END; - case PM_CONTEXT_LOOP_PREDICATE: - return token->type == PM_TOKEN_KEYWORD_DO || token->type == PM_TOKEN_KEYWORD_THEN; - case PM_CONTEXT_FOR_INDEX: - return token->type == PM_TOKEN_KEYWORD_IN; - case PM_CONTEXT_CASE_WHEN: - return token->type == PM_TOKEN_KEYWORD_WHEN || token->type == PM_TOKEN_KEYWORD_END || token->type == PM_TOKEN_KEYWORD_ELSE; - case PM_CONTEXT_CASE_IN: - return token->type == PM_TOKEN_KEYWORD_IN || token->type == PM_TOKEN_KEYWORD_END || token->type == PM_TOKEN_KEYWORD_ELSE; - case PM_CONTEXT_IF: - case PM_CONTEXT_ELSIF: - return token->type == PM_TOKEN_KEYWORD_ELSE || token->type == PM_TOKEN_KEYWORD_ELSIF || token->type == PM_TOKEN_KEYWORD_END; - case PM_CONTEXT_UNLESS: - return token->type == PM_TOKEN_KEYWORD_ELSE || token->type == PM_TOKEN_KEYWORD_END; - case PM_CONTEXT_EMBEXPR: - return token->type == PM_TOKEN_EMBEXPR_END; - case PM_CONTEXT_BLOCK_BRACES: - return token->type == PM_TOKEN_BRACE_RIGHT; - case PM_CONTEXT_PARENS: - return token->type == PM_TOKEN_PARENTHESIS_RIGHT; - case PM_CONTEXT_BEGIN: - case PM_CONTEXT_BEGIN_RESCUE: - case PM_CONTEXT_BLOCK_RESCUE: - case PM_CONTEXT_CLASS_RESCUE: - case PM_CONTEXT_DEF_RESCUE: - case PM_CONTEXT_LAMBDA_RESCUE: - case PM_CONTEXT_MODULE_RESCUE: - case PM_CONTEXT_SCLASS_RESCUE: - return token->type == PM_TOKEN_KEYWORD_ENSURE || token->type == PM_TOKEN_KEYWORD_RESCUE || token->type == PM_TOKEN_KEYWORD_ELSE || token->type == PM_TOKEN_KEYWORD_END; - case PM_CONTEXT_BEGIN_ELSE: - case PM_CONTEXT_BLOCK_ELSE: - case PM_CONTEXT_CLASS_ELSE: - case PM_CONTEXT_DEF_ELSE: - case PM_CONTEXT_LAMBDA_ELSE: - case PM_CONTEXT_MODULE_ELSE: - case PM_CONTEXT_SCLASS_ELSE: - return token->type == PM_TOKEN_KEYWORD_ENSURE || token->type == PM_TOKEN_KEYWORD_END; - case PM_CONTEXT_LAMBDA_BRACES: - return token->type == PM_TOKEN_BRACE_RIGHT; - case PM_CONTEXT_PREDICATE: - return token->type == PM_TOKEN_KEYWORD_THEN || token->type == PM_TOKEN_NEWLINE || token->type == PM_TOKEN_SEMICOLON; - case PM_CONTEXT_NONE: - return false; - } +static const uint32_t context_terminators[] = { + [PM_CONTEXT_NONE] = 0, + [PM_CONTEXT_BEGIN] = (1 << PM_TOKEN_KEYWORD_ENSURE) | (1 << PM_TOKEN_KEYWORD_RESCUE) | (1 << PM_TOKEN_KEYWORD_ELSE) | (1 << PM_TOKEN_KEYWORD_END), + [PM_CONTEXT_BEGIN_ENSURE] = (1 << PM_TOKEN_KEYWORD_END), + [PM_CONTEXT_BEGIN_ELSE] = (1 << PM_TOKEN_KEYWORD_ENSURE) | (1 << PM_TOKEN_KEYWORD_END), + [PM_CONTEXT_BEGIN_RESCUE] = (1 << PM_TOKEN_KEYWORD_ENSURE) | (1 << PM_TOKEN_KEYWORD_RESCUE) | (1 << PM_TOKEN_KEYWORD_ELSE) | (1 << PM_TOKEN_KEYWORD_END), + [PM_CONTEXT_BLOCK_BRACES] = (1 << PM_TOKEN_BRACE_RIGHT), + [PM_CONTEXT_BLOCK_KEYWORDS] = (1 << PM_TOKEN_KEYWORD_END) | (1 << PM_TOKEN_KEYWORD_RESCUE) | (1 << PM_TOKEN_KEYWORD_ENSURE), + [PM_CONTEXT_BLOCK_ENSURE] = (1 << PM_TOKEN_KEYWORD_END), + [PM_CONTEXT_BLOCK_ELSE] = (1 << PM_TOKEN_KEYWORD_ENSURE) | (1 << PM_TOKEN_KEYWORD_END), + [PM_CONTEXT_BLOCK_RESCUE] = (1 << PM_TOKEN_KEYWORD_ENSURE) | (1 << PM_TOKEN_KEYWORD_RESCUE) | (1 << PM_TOKEN_KEYWORD_ELSE) | (1 << PM_TOKEN_KEYWORD_END), + [PM_CONTEXT_CASE_WHEN] = (1 << PM_TOKEN_KEYWORD_WHEN) | (1 << PM_TOKEN_KEYWORD_END) | (1 << PM_TOKEN_KEYWORD_ELSE), + [PM_CONTEXT_CASE_IN] = (1 << PM_TOKEN_KEYWORD_IN) | (1 << PM_TOKEN_KEYWORD_END) | (1 << PM_TOKEN_KEYWORD_ELSE), + [PM_CONTEXT_CLASS] = (1 << PM_TOKEN_KEYWORD_END) | (1 << PM_TOKEN_KEYWORD_RESCUE) | (1 << PM_TOKEN_KEYWORD_ENSURE), + [PM_CONTEXT_CLASS_ENSURE] = (1 << PM_TOKEN_KEYWORD_END), + [PM_CONTEXT_CLASS_ELSE] = (1 << PM_TOKEN_KEYWORD_ENSURE) | (1 << PM_TOKEN_KEYWORD_END), + [PM_CONTEXT_CLASS_RESCUE] = (1 << PM_TOKEN_KEYWORD_ENSURE) | (1 << PM_TOKEN_KEYWORD_RESCUE) | (1 << PM_TOKEN_KEYWORD_ELSE) | (1 << PM_TOKEN_KEYWORD_END), + [PM_CONTEXT_DEF] = (1 << PM_TOKEN_KEYWORD_END) | (1 << PM_TOKEN_KEYWORD_RESCUE) | (1 << PM_TOKEN_KEYWORD_ENSURE), + [PM_CONTEXT_DEF_ENSURE] = (1 << PM_TOKEN_KEYWORD_END), + [PM_CONTEXT_DEF_ELSE] = (1 << PM_TOKEN_KEYWORD_ENSURE) | (1 << PM_TOKEN_KEYWORD_END), + [PM_CONTEXT_DEF_RESCUE] = (1 << PM_TOKEN_KEYWORD_ENSURE) | (1 << PM_TOKEN_KEYWORD_RESCUE) | (1 << PM_TOKEN_KEYWORD_ELSE) | (1 << PM_TOKEN_KEYWORD_END), + [PM_CONTEXT_DEF_PARAMS] = (1 << PM_TOKEN_EOF), + [PM_CONTEXT_DEFINED] = (1 << PM_TOKEN_EOF), + [PM_CONTEXT_DEFAULT_PARAMS] = (1 << PM_TOKEN_COMMA) | (1 << PM_TOKEN_PARENTHESIS_RIGHT), + [PM_CONTEXT_ELSE] = (1 << PM_TOKEN_KEYWORD_END), + [PM_CONTEXT_ELSIF] = (1 << PM_TOKEN_KEYWORD_ELSE) | (1 << PM_TOKEN_KEYWORD_ELSIF) | (1 << PM_TOKEN_KEYWORD_END), + [PM_CONTEXT_EMBEXPR] = (1 << PM_TOKEN_EMBEXPR_END), + [PM_CONTEXT_FOR] = (1 << PM_TOKEN_KEYWORD_END), + [PM_CONTEXT_FOR_INDEX] = (1 << PM_TOKEN_KEYWORD_IN), + [PM_CONTEXT_IF] = (1 << PM_TOKEN_KEYWORD_ELSE) | (1 << PM_TOKEN_KEYWORD_ELSIF) | (1 << PM_TOKEN_KEYWORD_END), + [PM_CONTEXT_LAMBDA_BRACES] = (1 << PM_TOKEN_BRACE_RIGHT), + [PM_CONTEXT_LAMBDA_DO_END] = (1 << PM_TOKEN_KEYWORD_END) | (1 << PM_TOKEN_KEYWORD_RESCUE) | (1 << PM_TOKEN_KEYWORD_ENSURE), + [PM_CONTEXT_LAMBDA_ENSURE] = (1 << PM_TOKEN_KEYWORD_END), + [PM_CONTEXT_LAMBDA_ELSE] = (1 << PM_TOKEN_KEYWORD_ENSURE) | (1 << PM_TOKEN_KEYWORD_END), + [PM_CONTEXT_LAMBDA_RESCUE] = (1 << PM_TOKEN_KEYWORD_ENSURE) | (1 << PM_TOKEN_KEYWORD_RESCUE) | (1 << PM_TOKEN_KEYWORD_ELSE) | (1 << PM_TOKEN_KEYWORD_END), + [PM_CONTEXT_LOOP_PREDICATE] = (1 << PM_TOKEN_KEYWORD_DO) | (1 << PM_TOKEN_KEYWORD_THEN), + [PM_CONTEXT_MAIN] = (1 << PM_TOKEN_EOF), + [PM_CONTEXT_MODULE] = (1 << PM_TOKEN_KEYWORD_END) | (1 << PM_TOKEN_KEYWORD_RESCUE) | (1 << PM_TOKEN_KEYWORD_ENSURE), + [PM_CONTEXT_MODULE_ENSURE] = (1 << PM_TOKEN_KEYWORD_END), + [PM_CONTEXT_MODULE_ELSE] = (1 << PM_TOKEN_KEYWORD_ENSURE) | (1 << PM_TOKEN_KEYWORD_END), + [PM_CONTEXT_MODULE_RESCUE] = (1 << PM_TOKEN_KEYWORD_ENSURE) | (1 << PM_TOKEN_KEYWORD_RESCUE) | (1 << PM_TOKEN_KEYWORD_ELSE) | (1 << PM_TOKEN_KEYWORD_END), + [PM_CONTEXT_MULTI_TARGET] = (1 << PM_TOKEN_EOF), + [PM_CONTEXT_PARENS] = (1 << PM_TOKEN_PARENTHESIS_RIGHT), + [PM_CONTEXT_POSTEXE] = (1 << PM_TOKEN_BRACE_RIGHT), + [PM_CONTEXT_PREDICATE] = (1 << PM_TOKEN_KEYWORD_THEN) | (1 << PM_TOKEN_NEWLINE) | (1 << PM_TOKEN_SEMICOLON), + [PM_CONTEXT_PREEXE] = (1 << PM_TOKEN_BRACE_RIGHT), + [PM_CONTEXT_RESCUE_MODIFIER] = (1 << PM_TOKEN_EOF), + [PM_CONTEXT_SCLASS] = (1 << PM_TOKEN_KEYWORD_END) | (1 << PM_TOKEN_KEYWORD_RESCUE) | (1 << PM_TOKEN_KEYWORD_ENSURE), + [PM_CONTEXT_SCLASS_ENSURE] = (1 << PM_TOKEN_KEYWORD_END), + [PM_CONTEXT_SCLASS_ELSE] = (1 << PM_TOKEN_KEYWORD_ENSURE) | (1 << PM_TOKEN_KEYWORD_END), + [PM_CONTEXT_SCLASS_RESCUE] = (1 << PM_TOKEN_KEYWORD_ENSURE) | (1 << PM_TOKEN_KEYWORD_RESCUE) | (1 << PM_TOKEN_KEYWORD_ELSE) | (1 << PM_TOKEN_KEYWORD_END), + [PM_CONTEXT_TERNARY] = (1 << PM_TOKEN_EOF), + [PM_CONTEXT_UNLESS] = (1 << PM_TOKEN_KEYWORD_ELSE) | (1 << PM_TOKEN_KEYWORD_END), + [PM_CONTEXT_UNTIL] = (1 << PM_TOKEN_KEYWORD_END), + [PM_CONTEXT_WHILE] = (1 << PM_TOKEN_KEYWORD_END), +}; - return false; +static inline bool +context_terminator(pm_context_t context, pm_token_t *token) { + return token->type < 32 && (context_terminators[context] & (1 << token->type)); } /** From 915f6b3ae90aae73bb438e51fb9baa8b6ec0c489 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Tue, 6 May 2025 09:30:03 -0400 Subject: [PATCH 019/333] Ensure context terminators terminate expressions --- snapshots/case_in_hash_key.txt | 127 +++++++++++++++++++++++ src/prism.c | 6 ++ test/prism/fixtures/case_in_hash_key.txt | 6 ++ 3 files changed, 139 insertions(+) create mode 100644 snapshots/case_in_hash_key.txt create mode 100644 test/prism/fixtures/case_in_hash_key.txt diff --git a/snapshots/case_in_hash_key.txt b/snapshots/case_in_hash_key.txt new file mode 100644 index 0000000000..0753362dc0 --- /dev/null +++ b/snapshots/case_in_hash_key.txt @@ -0,0 +1,127 @@ +@ ProgramNode (location: (1,0)-(6,3)) +├── flags: ∅ +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(6,3)) + ├── flags: ∅ + └── body: (length: 1) + └── @ CaseMatchNode (location: (1,0)-(6,3)) + ├── flags: newline + ├── predicate: + │ @ IntegerNode (location: (1,5)-(1,6)) + │ ├── flags: static_literal, decimal + │ └── value: 1 + ├── conditions: (length: 2) + │ ├── @ InNode (location: (2,0)-(3,18)) + │ │ ├── flags: ∅ + │ │ ├── pattern: + │ │ │ @ IntegerNode (location: (2,3)-(2,4)) + │ │ │ ├── flags: static_literal, decimal + │ │ │ └── value: 2 + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (3,2)-(3,18)) + │ │ │ ├── flags: ∅ + │ │ │ └── body: (length: 1) + │ │ │ └── @ CallNode (location: (3,2)-(3,18)) + │ │ │ ├── flags: newline + │ │ │ ├── receiver: + │ │ │ │ @ ConstantReadNode (location: (3,2)-(3,3)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :A + │ │ │ ├── call_operator_loc: (3,3)-(3,4) = "." + │ │ │ ├── name: :print + │ │ │ ├── message_loc: (3,4)-(3,9) = "print" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: + │ │ │ │ @ ArgumentsNode (location: (3,10)-(3,18)) + │ │ │ │ ├── flags: contains_keywords + │ │ │ │ └── arguments: (length: 1) + │ │ │ │ └── @ KeywordHashNode (location: (3,10)-(3,18)) + │ │ │ │ ├── flags: symbol_keys + │ │ │ │ └── elements: (length: 1) + │ │ │ │ └── @ AssocNode (location: (3,10)-(3,18)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── key: + │ │ │ │ │ @ SymbolNode (location: (3,10)-(3,18)) + │ │ │ │ │ ├── flags: static_literal, forced_us_ascii_encoding + │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ ├── value_loc: (3,10)-(3,17) = "message" + │ │ │ │ │ ├── closing_loc: (3,17)-(3,18) = ":" + │ │ │ │ │ └── unescaped: "message" + │ │ │ │ ├── value: + │ │ │ │ │ @ ImplicitNode (location: (3,10)-(3,18)) + │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ └── value: + │ │ │ │ │ @ CallNode (location: (3,10)-(3,18)) + │ │ │ │ │ ├── flags: ignore_visibility + │ │ │ │ │ ├── receiver: ∅ + │ │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ │ ├── name: :message + │ │ │ │ │ ├── message_loc: (3,10)-(3,17) = "message" + │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ ├── arguments: ∅ + │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ └── block: ∅ + │ │ │ │ └── operator_loc: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── in_loc: (2,0)-(2,2) = "in" + │ │ └── then_loc: ∅ + │ └── @ InNode (location: (4,0)-(5,18)) + │ ├── flags: ∅ + │ ├── pattern: + │ │ @ IntegerNode (location: (4,3)-(4,4)) + │ │ ├── flags: static_literal, decimal + │ │ └── value: 3 + │ ├── statements: + │ │ @ StatementsNode (location: (5,2)-(5,18)) + │ │ ├── flags: ∅ + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (5,2)-(5,18)) + │ │ ├── flags: newline + │ │ ├── receiver: + │ │ │ @ ConstantReadNode (location: (5,2)-(5,3)) + │ │ │ ├── flags: ∅ + │ │ │ └── name: :A + │ │ ├── call_operator_loc: (5,3)-(5,4) = "." + │ │ ├── name: :print + │ │ ├── message_loc: (5,4)-(5,9) = "print" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (5,10)-(5,18)) + │ │ │ ├── flags: contains_keywords + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ KeywordHashNode (location: (5,10)-(5,18)) + │ │ │ ├── flags: symbol_keys + │ │ │ └── elements: (length: 1) + │ │ │ └── @ AssocNode (location: (5,10)-(5,18)) + │ │ │ ├── flags: ∅ + │ │ │ ├── key: + │ │ │ │ @ SymbolNode (location: (5,10)-(5,18)) + │ │ │ │ ├── flags: static_literal, forced_us_ascii_encoding + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── value_loc: (5,10)-(5,17) = "message" + │ │ │ │ ├── closing_loc: (5,17)-(5,18) = ":" + │ │ │ │ └── unescaped: "message" + │ │ │ ├── value: + │ │ │ │ @ ImplicitNode (location: (5,10)-(5,18)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── value: + │ │ │ │ @ CallNode (location: (5,10)-(5,18)) + │ │ │ │ ├── flags: ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :message + │ │ │ │ ├── message_loc: (5,10)-(5,17) = "message" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ └── operator_loc: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── in_loc: (4,0)-(4,2) = "in" + │ └── then_loc: ∅ + ├── else_clause: ∅ + ├── case_keyword_loc: (1,0)-(1,4) = "case" + └── end_keyword_loc: (6,0)-(6,3) = "end" diff --git a/src/prism.c b/src/prism.c index 1acbab0d1e..c42a62f528 100644 --- a/src/prism.c +++ b/src/prism.c @@ -22150,6 +22150,12 @@ parse_expression(pm_parser_t *parser, pm_binding_power_t binding_power, bool acc ) { node = parse_expression_infix(parser, node, binding_power, current_binding_powers.right, accepts_command_call, (uint16_t) (depth + 1)); + if (context_terminator(parser->current_context->context, &parser->current)) { + // If this token terminates the current context, then we need to + // stop parsing the expression, as it has become a statement. + return node; + } + switch (PM_NODE_TYPE(node)) { case PM_MULTI_WRITE_NODE: // Multi-write nodes are statements, and cannot be followed by diff --git a/test/prism/fixtures/case_in_hash_key.txt b/test/prism/fixtures/case_in_hash_key.txt new file mode 100644 index 0000000000..75ac8a846f --- /dev/null +++ b/test/prism/fixtures/case_in_hash_key.txt @@ -0,0 +1,6 @@ +case 1 +in 2 + A.print message: +in 3 + A.print message: +end From 302c62cb1124b63f2a7587beda3b126796972026 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 7 May 2025 21:20:54 +0000 Subject: [PATCH 020/333] Bump sorbet Bumps the ruby-deps group with 1 update in the /gemfiles/typecheck directory: [sorbet](https://github.com/sorbet/sorbet). Updates `sorbet` from 0.5.12032 to 0.5.12043 - [Release notes](https://github.com/sorbet/sorbet/releases) - [Commits](https://github.com/sorbet/sorbet/commits) --- updated-dependencies: - dependency-name: sorbet dependency-version: 0.5.12043 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps ... Signed-off-by: dependabot[bot] --- gemfiles/typecheck/Gemfile.lock | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/gemfiles/typecheck/Gemfile.lock b/gemfiles/typecheck/Gemfile.lock index 6ff7a51519..7fafa8c785 100644 --- a/gemfiles/typecheck/Gemfile.lock +++ b/gemfiles/typecheck/Gemfile.lock @@ -62,14 +62,14 @@ GEM sexp_processor (~> 4.16) securerandom (0.4.1) sexp_processor (4.17.3) - sorbet (0.5.12032) - sorbet-static (= 0.5.12032) - sorbet-runtime (0.5.12032) - sorbet-static (0.5.12032-universal-darwin) - sorbet-static (0.5.12032-x86_64-linux) - sorbet-static-and-runtime (0.5.12032) - sorbet (= 0.5.12032) - sorbet-runtime (= 0.5.12032) + sorbet (0.5.12070) + sorbet-static (= 0.5.12070) + sorbet-runtime (0.5.12070) + sorbet-static (0.5.12070-universal-darwin) + sorbet-static (0.5.12070-x86_64-linux) + sorbet-static-and-runtime (0.5.12070) + sorbet (= 0.5.12070) + sorbet-runtime (= 0.5.12070) spoom (1.6.1) erubi (>= 1.10.0) prism (>= 0.28.0) From a702c27d6fa379522129d205d70b70e02cfcdce4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 12 May 2025 17:13:09 +0000 Subject: [PATCH 021/333] Bump the ruby-deps group across 6 directories with 2 updates Bumps the ruby-deps group with 1 update in the /gemfiles/3.1 directory: [rbs](https://github.com/ruby/rbs). Bumps the ruby-deps group with 1 update in the /gemfiles/3.2 directory: [rbs](https://github.com/ruby/rbs). Bumps the ruby-deps group with 1 update in the /gemfiles/3.3 directory: [rbs](https://github.com/ruby/rbs). Bumps the ruby-deps group with 1 update in the /gemfiles/3.4 directory: [rbs](https://github.com/ruby/rbs). Bumps the ruby-deps group with 1 update in the /gemfiles/3.5 directory: [rbs](https://github.com/ruby/rbs). Bumps the ruby-deps group with 2 updates in the /gemfiles/typecheck directory: [rbs](https://github.com/ruby/rbs) and [sorbet](https://github.com/sorbet/sorbet). Updates `rbs` from 3.9.2 to 3.9.3 - [Release notes](https://github.com/ruby/rbs/releases) - [Changelog](https://github.com/ruby/rbs/blob/master/CHANGELOG.md) - [Commits](https://github.com/ruby/rbs/compare/v3.9.2...v3.9.3) Updates `rbs` from 3.9.2 to 3.9.3 - [Release notes](https://github.com/ruby/rbs/releases) - [Changelog](https://github.com/ruby/rbs/blob/master/CHANGELOG.md) - [Commits](https://github.com/ruby/rbs/compare/v3.9.2...v3.9.3) Updates `rbs` from 3.9.2 to 3.9.3 - [Release notes](https://github.com/ruby/rbs/releases) - [Changelog](https://github.com/ruby/rbs/blob/master/CHANGELOG.md) - [Commits](https://github.com/ruby/rbs/compare/v3.9.2...v3.9.3) Updates `rbs` from 3.9.2 to 3.9.3 - [Release notes](https://github.com/ruby/rbs/releases) - [Changelog](https://github.com/ruby/rbs/blob/master/CHANGELOG.md) - [Commits](https://github.com/ruby/rbs/compare/v3.9.2...v3.9.3) Updates `rbs` from 3.9.2 to 3.9.3 - [Release notes](https://github.com/ruby/rbs/releases) - [Changelog](https://github.com/ruby/rbs/blob/master/CHANGELOG.md) - [Commits](https://github.com/ruby/rbs/compare/v3.9.2...v3.9.3) Updates `rbs` from 3.9.2 to 3.9.3 - [Release notes](https://github.com/ruby/rbs/releases) - [Changelog](https://github.com/ruby/rbs/blob/master/CHANGELOG.md) - [Commits](https://github.com/ruby/rbs/compare/v3.9.2...v3.9.3) Updates `sorbet` from 0.5.12070 to 0.5.12087 - [Release notes](https://github.com/sorbet/sorbet/releases) - [Commits](https://github.com/sorbet/sorbet/commits) --- updated-dependencies: - dependency-name: rbs dependency-version: 3.9.3 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps - dependency-name: rbs dependency-version: 3.9.3 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps - dependency-name: rbs dependency-version: 3.9.3 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps - dependency-name: rbs dependency-version: 3.9.3 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps - dependency-name: rbs dependency-version: 3.9.3 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps - dependency-name: rbs dependency-version: 3.9.3 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps - dependency-name: sorbet dependency-version: 0.5.12087 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps ... Signed-off-by: dependabot[bot] --- 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/3.5/Gemfile.lock | 2 +- gemfiles/typecheck/Gemfile.lock | 18 +++++++++--------- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/gemfiles/3.1/Gemfile.lock b/gemfiles/3.1/Gemfile.lock index 3d80a97bc0..d5995c509f 100644 --- a/gemfiles/3.1/Gemfile.lock +++ b/gemfiles/3.1/Gemfile.lock @@ -21,7 +21,7 @@ GEM rake (13.2.1) rake-compiler (1.3.0) rake - rbs (3.9.2) + rbs (3.9.3) logger ruby_memcheck (3.0.1) nokogiri diff --git a/gemfiles/3.2/Gemfile.lock b/gemfiles/3.2/Gemfile.lock index 3f3ae012c0..bdd03c3bfa 100644 --- a/gemfiles/3.2/Gemfile.lock +++ b/gemfiles/3.2/Gemfile.lock @@ -21,7 +21,7 @@ GEM rake (13.2.1) rake-compiler (1.3.0) rake - rbs (3.9.2) + rbs (3.9.3) logger ruby_memcheck (3.0.1) nokogiri diff --git a/gemfiles/3.3/Gemfile.lock b/gemfiles/3.3/Gemfile.lock index ed2f01d981..78a4987e57 100644 --- a/gemfiles/3.3/Gemfile.lock +++ b/gemfiles/3.3/Gemfile.lock @@ -21,7 +21,7 @@ GEM rake (13.2.1) rake-compiler (1.3.0) rake - rbs (3.9.2) + rbs (3.9.3) logger ruby_memcheck (3.0.1) nokogiri diff --git a/gemfiles/3.4/Gemfile.lock b/gemfiles/3.4/Gemfile.lock index 4c1ffc0b21..8750b6ac7e 100644 --- a/gemfiles/3.4/Gemfile.lock +++ b/gemfiles/3.4/Gemfile.lock @@ -21,7 +21,7 @@ GEM rake (13.2.1) rake-compiler (1.3.0) rake - rbs (3.9.2) + rbs (3.9.3) logger ruby_memcheck (3.0.1) nokogiri diff --git a/gemfiles/3.5/Gemfile.lock b/gemfiles/3.5/Gemfile.lock index 21ed7c2f4a..1f664ca4f7 100644 --- a/gemfiles/3.5/Gemfile.lock +++ b/gemfiles/3.5/Gemfile.lock @@ -22,7 +22,7 @@ GEM rake (13.2.1) rake-compiler (1.3.0) rake - rbs (3.9.2) + rbs (3.9.3) logger ruby_memcheck (3.0.1) nokogiri diff --git a/gemfiles/typecheck/Gemfile.lock b/gemfiles/typecheck/Gemfile.lock index 7fafa8c785..404d1332e2 100644 --- a/gemfiles/typecheck/Gemfile.lock +++ b/gemfiles/typecheck/Gemfile.lock @@ -55,21 +55,21 @@ GEM prism (~> 1.0) rbs (>= 3.4.4) sorbet-runtime (>= 0.5.9204) - rbs (3.9.2) + rbs (3.9.3) logger ruby_parser (3.21.1) racc (~> 1.5) sexp_processor (~> 4.16) securerandom (0.4.1) sexp_processor (4.17.3) - sorbet (0.5.12070) - sorbet-static (= 0.5.12070) - sorbet-runtime (0.5.12070) - sorbet-static (0.5.12070-universal-darwin) - sorbet-static (0.5.12070-x86_64-linux) - sorbet-static-and-runtime (0.5.12070) - sorbet (= 0.5.12070) - sorbet-runtime (= 0.5.12070) + sorbet (0.5.12087) + sorbet-static (= 0.5.12087) + sorbet-runtime (0.5.12087) + sorbet-static (0.5.12087-universal-darwin) + sorbet-static (0.5.12087-x86_64-linux) + sorbet-static-and-runtime (0.5.12087) + sorbet (= 0.5.12087) + sorbet-runtime (= 0.5.12087) spoom (1.6.1) erubi (>= 1.10.0) prism (>= 0.28.0) From 0155fb47fde48ca62f33872990aed2c7d483430e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 19 May 2025 16:29:38 +0000 Subject: [PATCH 022/333] Bump the ruby-deps group across 6 directories with 2 updates Bumps the ruby-deps group with 1 update in the /gemfiles/3.1 directory: [rbs](https://github.com/ruby/rbs). Bumps the ruby-deps group with 1 update in the /gemfiles/3.2 directory: [rbs](https://github.com/ruby/rbs). Bumps the ruby-deps group with 1 update in the /gemfiles/3.3 directory: [rbs](https://github.com/ruby/rbs). Bumps the ruby-deps group with 1 update in the /gemfiles/3.4 directory: [rbs](https://github.com/ruby/rbs). Bumps the ruby-deps group with 1 update in the /gemfiles/3.5 directory: [rbs](https://github.com/ruby/rbs). Bumps the ruby-deps group with 2 updates in the /gemfiles/typecheck directory: [rbs](https://github.com/ruby/rbs) and [sorbet](https://github.com/sorbet/sorbet). Updates `rbs` from 3.9.3 to 3.9.4 - [Release notes](https://github.com/ruby/rbs/releases) - [Changelog](https://github.com/ruby/rbs/blob/master/CHANGELOG.md) - [Commits](https://github.com/ruby/rbs/compare/v3.9.3...v3.9.4) Updates `rbs` from 3.9.3 to 3.9.4 - [Release notes](https://github.com/ruby/rbs/releases) - [Changelog](https://github.com/ruby/rbs/blob/master/CHANGELOG.md) - [Commits](https://github.com/ruby/rbs/compare/v3.9.3...v3.9.4) Updates `rbs` from 3.9.3 to 3.9.4 - [Release notes](https://github.com/ruby/rbs/releases) - [Changelog](https://github.com/ruby/rbs/blob/master/CHANGELOG.md) - [Commits](https://github.com/ruby/rbs/compare/v3.9.3...v3.9.4) Updates `rbs` from 3.9.3 to 3.9.4 - [Release notes](https://github.com/ruby/rbs/releases) - [Changelog](https://github.com/ruby/rbs/blob/master/CHANGELOG.md) - [Commits](https://github.com/ruby/rbs/compare/v3.9.3...v3.9.4) Updates `rbs` from 3.9.3 to 3.9.4 - [Release notes](https://github.com/ruby/rbs/releases) - [Changelog](https://github.com/ruby/rbs/blob/master/CHANGELOG.md) - [Commits](https://github.com/ruby/rbs/compare/v3.9.3...v3.9.4) Updates `rbs` from 3.9.3 to 3.9.4 - [Release notes](https://github.com/ruby/rbs/releases) - [Changelog](https://github.com/ruby/rbs/blob/master/CHANGELOG.md) - [Commits](https://github.com/ruby/rbs/compare/v3.9.3...v3.9.4) Updates `sorbet` from 0.5.12087 to 0.5.12115 - [Release notes](https://github.com/sorbet/sorbet/releases) - [Commits](https://github.com/sorbet/sorbet/commits) --- updated-dependencies: - dependency-name: rbs dependency-version: 3.9.4 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps - dependency-name: rbs dependency-version: 3.9.4 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps - dependency-name: rbs dependency-version: 3.9.4 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps - dependency-name: rbs dependency-version: 3.9.4 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps - dependency-name: rbs dependency-version: 3.9.4 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps - dependency-name: rbs dependency-version: 3.9.4 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps - dependency-name: sorbet dependency-version: 0.5.12115 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps ... Signed-off-by: dependabot[bot] --- 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/3.5/Gemfile.lock | 2 +- gemfiles/typecheck/Gemfile.lock | 18 +++++++++--------- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/gemfiles/3.1/Gemfile.lock b/gemfiles/3.1/Gemfile.lock index d5995c509f..8040ebd2b1 100644 --- a/gemfiles/3.1/Gemfile.lock +++ b/gemfiles/3.1/Gemfile.lock @@ -21,7 +21,7 @@ GEM rake (13.2.1) rake-compiler (1.3.0) rake - rbs (3.9.3) + rbs (3.9.4) logger ruby_memcheck (3.0.1) nokogiri diff --git a/gemfiles/3.2/Gemfile.lock b/gemfiles/3.2/Gemfile.lock index bdd03c3bfa..23ede9e0fc 100644 --- a/gemfiles/3.2/Gemfile.lock +++ b/gemfiles/3.2/Gemfile.lock @@ -21,7 +21,7 @@ GEM rake (13.2.1) rake-compiler (1.3.0) rake - rbs (3.9.3) + rbs (3.9.4) logger ruby_memcheck (3.0.1) nokogiri diff --git a/gemfiles/3.3/Gemfile.lock b/gemfiles/3.3/Gemfile.lock index 78a4987e57..a4979c023d 100644 --- a/gemfiles/3.3/Gemfile.lock +++ b/gemfiles/3.3/Gemfile.lock @@ -21,7 +21,7 @@ GEM rake (13.2.1) rake-compiler (1.3.0) rake - rbs (3.9.3) + rbs (3.9.4) logger ruby_memcheck (3.0.1) nokogiri diff --git a/gemfiles/3.4/Gemfile.lock b/gemfiles/3.4/Gemfile.lock index 8750b6ac7e..3ed3ce7b51 100644 --- a/gemfiles/3.4/Gemfile.lock +++ b/gemfiles/3.4/Gemfile.lock @@ -21,7 +21,7 @@ GEM rake (13.2.1) rake-compiler (1.3.0) rake - rbs (3.9.3) + rbs (3.9.4) logger ruby_memcheck (3.0.1) nokogiri diff --git a/gemfiles/3.5/Gemfile.lock b/gemfiles/3.5/Gemfile.lock index 1f664ca4f7..13ddf15710 100644 --- a/gemfiles/3.5/Gemfile.lock +++ b/gemfiles/3.5/Gemfile.lock @@ -22,7 +22,7 @@ GEM rake (13.2.1) rake-compiler (1.3.0) rake - rbs (3.9.3) + rbs (3.9.4) logger ruby_memcheck (3.0.1) nokogiri diff --git a/gemfiles/typecheck/Gemfile.lock b/gemfiles/typecheck/Gemfile.lock index 404d1332e2..84d2612108 100644 --- a/gemfiles/typecheck/Gemfile.lock +++ b/gemfiles/typecheck/Gemfile.lock @@ -55,21 +55,21 @@ GEM prism (~> 1.0) rbs (>= 3.4.4) sorbet-runtime (>= 0.5.9204) - rbs (3.9.3) + rbs (3.9.4) logger ruby_parser (3.21.1) racc (~> 1.5) sexp_processor (~> 4.16) securerandom (0.4.1) sexp_processor (4.17.3) - sorbet (0.5.12087) - sorbet-static (= 0.5.12087) - sorbet-runtime (0.5.12087) - sorbet-static (0.5.12087-universal-darwin) - sorbet-static (0.5.12087-x86_64-linux) - sorbet-static-and-runtime (0.5.12087) - sorbet (= 0.5.12087) - sorbet-runtime (= 0.5.12087) + sorbet (0.5.12115) + sorbet-static (= 0.5.12115) + sorbet-runtime (0.5.12115) + sorbet-static (0.5.12115-universal-darwin) + sorbet-static (0.5.12115-x86_64-linux) + sorbet-static-and-runtime (0.5.12115) + sorbet (= 0.5.12115) + sorbet-runtime (= 0.5.12115) spoom (1.6.1) erubi (>= 1.10.0) prism (>= 0.28.0) From 60d324a7010f0340ddf8937758046f52b08ff319 Mon Sep 17 00:00:00 2001 From: Ufuk Kayserilioglu Date: Thu, 22 May 2025 16:32:04 +0300 Subject: [PATCH 023/333] Monomorphise visitor methods The current implementation of the visitor pattern in Prism uses a single method (`visit_child_nodes`) to handle all node types. This can lead to performance issues since the `node` argument will end up being polymorphic, and will prevent effective use of inline caches, which in CRuby are monomorphic. This commit generates an inlined version of the previous code for each node type, thus making the calls inside visitor methods monomorphic. This should improve performance, especially in cases where the visitor is called frequently. --- templates/lib/prism/compiler.rb.erb | 4 +++- templates/lib/prism/visitor.rb.erb | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/templates/lib/prism/compiler.rb.erb b/templates/lib/prism/compiler.rb.erb index 45ed88d8de..9102025c20 100644 --- a/templates/lib/prism/compiler.rb.erb +++ b/templates/lib/prism/compiler.rb.erb @@ -35,7 +35,9 @@ module Prism <%- nodes.each_with_index do |node, index| -%> <%= "\n" if index != 0 -%> # Compile a <%= node.name %> node - alias visit_<%= node.human %> visit_child_nodes + def visit_<%= node.human %>(node) + node.compact_child_nodes.map { |node| node.accept(self) } + end <%- end -%> end end diff --git a/templates/lib/prism/visitor.rb.erb b/templates/lib/prism/visitor.rb.erb index 4b30a1815b..a1eac38dc4 100644 --- a/templates/lib/prism/visitor.rb.erb +++ b/templates/lib/prism/visitor.rb.erb @@ -47,7 +47,9 @@ module Prism <%- nodes.each_with_index do |node, index| -%> <%= "\n" if index != 0 -%> # Visit a <%= node.name %> node - alias visit_<%= node.human %> visit_child_nodes + def visit_<%= node.human %>(node) + node.compact_child_nodes.each { |node| node.accept(self) } + end <%- end -%> end end From 10a80b564d93da404849e65a64276268efaf7110 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 22 May 2025 16:49:27 +0000 Subject: [PATCH 024/333] Bump nokogiri from 1.18.5 to 1.18.8 in /gemfiles/3.1 Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.18.5 to 1.18.8. - [Release notes](https://github.com/sparklemotion/nokogiri/releases) - [Changelog](https://github.com/sparklemotion/nokogiri/blob/main/CHANGELOG.md) - [Commits](https://github.com/sparklemotion/nokogiri/compare/v1.18.5...v1.18.8) --- updated-dependencies: - dependency-name: nokogiri dependency-version: 1.18.8 dependency-type: indirect ... Signed-off-by: dependabot[bot] --- gemfiles/3.1/Gemfile.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gemfiles/3.1/Gemfile.lock b/gemfiles/3.1/Gemfile.lock index 8040ebd2b1..3e64a11b67 100644 --- a/gemfiles/3.1/Gemfile.lock +++ b/gemfiles/3.1/Gemfile.lock @@ -8,8 +8,8 @@ GEM specs: ast (2.4.3) logger (1.7.0) - mini_portile2 (2.8.8) - nokogiri (1.18.5) + mini_portile2 (2.8.9) + nokogiri (1.18.8) mini_portile2 (~> 2.8.2) racc (~> 1.4) onigmo (0.1.0) From c9b59f765fc9bf33ea1253b03073aae0bf2346dc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 25 May 2025 16:58:17 +0000 Subject: [PATCH 025/333] Bump nokogiri from 1.18.5 to 1.18.8 in /gemfiles/3.2 Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.18.5 to 1.18.8. - [Release notes](https://github.com/sparklemotion/nokogiri/releases) - [Changelog](https://github.com/sparklemotion/nokogiri/blob/main/CHANGELOG.md) - [Commits](https://github.com/sparklemotion/nokogiri/compare/v1.18.5...v1.18.8) --- updated-dependencies: - dependency-name: nokogiri dependency-version: 1.18.8 dependency-type: indirect ... Signed-off-by: dependabot[bot] --- gemfiles/3.2/Gemfile.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gemfiles/3.2/Gemfile.lock b/gemfiles/3.2/Gemfile.lock index 23ede9e0fc..5b36f779f1 100644 --- a/gemfiles/3.2/Gemfile.lock +++ b/gemfiles/3.2/Gemfile.lock @@ -8,8 +8,8 @@ GEM specs: ast (2.4.3) logger (1.7.0) - mini_portile2 (2.8.8) - nokogiri (1.18.5) + mini_portile2 (2.8.9) + nokogiri (1.18.8) mini_portile2 (~> 2.8.2) racc (~> 1.4) onigmo (0.1.0) From b1777496aadb6ffa1575b96868877f82ff713fe4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 26 May 2025 16:35:20 +0000 Subject: [PATCH 026/333] Bump sorbet Bumps the ruby-deps group with 1 update in the /gemfiles/typecheck directory: [sorbet](https://github.com/sorbet/sorbet). Updates `sorbet` from 0.5.12115 to 0.5.12130 - [Release notes](https://github.com/sorbet/sorbet/releases) - [Commits](https://github.com/sorbet/sorbet/commits) --- updated-dependencies: - dependency-name: sorbet dependency-version: 0.5.12130 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps ... Signed-off-by: dependabot[bot] --- gemfiles/typecheck/Gemfile.lock | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/gemfiles/typecheck/Gemfile.lock b/gemfiles/typecheck/Gemfile.lock index 84d2612108..44f225a0c3 100644 --- a/gemfiles/typecheck/Gemfile.lock +++ b/gemfiles/typecheck/Gemfile.lock @@ -62,14 +62,14 @@ GEM sexp_processor (~> 4.16) securerandom (0.4.1) sexp_processor (4.17.3) - sorbet (0.5.12115) - sorbet-static (= 0.5.12115) - sorbet-runtime (0.5.12115) - sorbet-static (0.5.12115-universal-darwin) - sorbet-static (0.5.12115-x86_64-linux) - sorbet-static-and-runtime (0.5.12115) - sorbet (= 0.5.12115) - sorbet-runtime (= 0.5.12115) + sorbet (0.5.12130) + sorbet-static (= 0.5.12130) + sorbet-runtime (0.5.12130) + sorbet-static (0.5.12130-universal-darwin) + sorbet-static (0.5.12130-x86_64-linux) + sorbet-static-and-runtime (0.5.12130) + sorbet (= 0.5.12130) + sorbet-runtime (= 0.5.12130) spoom (1.6.1) erubi (>= 1.10.0) prism (>= 0.28.0) From 4daefd07f580e2726074c2f97775c996ac4fb387 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 26 May 2025 20:38:42 +0000 Subject: [PATCH 027/333] Bump nokogiri from 1.18.5 to 1.18.8 in /gemfiles/3.5 Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.18.5 to 1.18.8. - [Release notes](https://github.com/sparklemotion/nokogiri/releases) - [Changelog](https://github.com/sparklemotion/nokogiri/blob/main/CHANGELOG.md) - [Commits](https://github.com/sparklemotion/nokogiri/compare/v1.18.5...v1.18.8) --- updated-dependencies: - dependency-name: nokogiri dependency-version: 1.18.8 dependency-type: indirect ... Signed-off-by: dependabot[bot] --- gemfiles/3.5/Gemfile.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gemfiles/3.5/Gemfile.lock b/gemfiles/3.5/Gemfile.lock index 13ddf15710..481c498928 100644 --- a/gemfiles/3.5/Gemfile.lock +++ b/gemfiles/3.5/Gemfile.lock @@ -9,8 +9,8 @@ GEM ast (2.4.3) ffi (1.17.2) logger (1.7.0) - mini_portile2 (2.8.8) - nokogiri (1.18.5) + mini_portile2 (2.8.9) + nokogiri (1.18.8) mini_portile2 (~> 2.8.2) racc (~> 1.4) onigmo (0.1.0) From 6d9d29ec7939b5a07f01f5e3f08aaa7ba32d02ea Mon Sep 17 00:00:00 2001 From: Andrew Konchin Date: Wed, 28 May 2025 13:31:02 +0300 Subject: [PATCH 028/333] Fix Java class ParsingOptions.Scope and make its constructors public This fixes the issue with using the Scope class outside the Prism gem. Otherwise building fails with the following error: ``` ...src/main/java/org/truffleruby/parser/YARPTranslatorDriver.java:89: error: constructor Scope in class Scope cannot be applied to given types; private static final ParsingOptions.Scope EMPTY_SCOPE = new ParsingOptions.Scope(EMPTY_BYTE_ARRAY_ARRAY, ^ required: byte[][],Forwarding[] found: byte[][],Forwarding[] reason: Scope(byte[][],Forwarding[]) is not public in Scope; cannot be accessed from outside package ``` --- java/org/prism/ParsingOptions.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/java/org/prism/ParsingOptions.java b/java/org/prism/ParsingOptions.java index ff2e995e6b..d4652f069a 100644 --- a/java/org/prism/ParsingOptions.java +++ b/java/org/prism/ParsingOptions.java @@ -63,15 +63,15 @@ public static class Scope { private byte[][] locals; private Forwarding[] forwarding; - Scope(byte[][] locals) { + public Scope(byte[][] locals) { this(locals, new Forwarding[0]); } - Scope(Forwarding[] forwarding) { + public Scope(Forwarding[] forwarding) { this(new byte[0][], forwarding); } - Scope(byte[][] locals, Forwarding[] forwarding) { + public Scope(byte[][] locals, Forwarding[] forwarding) { this.locals = locals; this.forwarding = forwarding; } From 90c38e760bb34cbbc20bb0abb025cd0dd8153842 Mon Sep 17 00:00:00 2001 From: Andrew Konchin Date: Wed, 28 May 2025 13:31:25 +0300 Subject: [PATCH 029/333] Fix typo in docs/ripper_translation.md document --- docs/ripper_translation.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/ripper_translation.md b/docs/ripper_translation.md index af765da56f..196eeb811c 100644 --- a/docs/ripper_translation.md +++ b/docs/ripper_translation.md @@ -55,7 +55,7 @@ It is helpful to understand the differences between the `Ripper` library and the ### Design -`Ripper` is a streaming parser. This means as it is parsing Ruby code, it dispatches events back to the consumer. This allows quite a bit of flexibility. You can use it to build your own syntax tree or to find specific patterns in the code. `Prism` on the other hand returns to your the completed syntax tree _before_ it allows you to manipulate it. This means the tree that you get back is the only representation that can be generated by the parser _at parse time_ (but of course can be manipulated later). +`Ripper` is a streaming parser. This means as it is parsing Ruby code, it dispatches events back to the consumer. This allows quite a bit of flexibility. You can use it to build your own syntax tree or to find specific patterns in the code. `Prism` on the other hand returns to you the completed syntax tree _before_ it allows you to manipulate it. This means the tree that you get back is the only representation that can be generated by the parser _at parse time_ (but of course can be manipulated later). ### Fields From 12af4e144e9b298accda6e3163f543cf32839b16 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Wed, 28 May 2025 19:25:48 +0900 Subject: [PATCH 030/333] [DOC] Specify markdown mode to RDoc --- lib/prism.rb | 1 + lib/prism/desugar_compiler.rb | 1 + lib/prism/ffi.rb | 1 + lib/prism/lex_compat.rb | 1 + lib/prism/node_ext.rb | 1 + lib/prism/pack.rb | 2 ++ lib/prism/parse_result.rb | 1 + lib/prism/parse_result/comments.rb | 1 + lib/prism/parse_result/errors.rb | 1 + lib/prism/parse_result/newlines.rb | 1 + lib/prism/pattern.rb | 1 + lib/prism/relocation.rb | 1 + lib/prism/string_query.rb | 1 + lib/prism/translation.rb | 1 + lib/prism/translation/parser.rb | 1 + lib/prism/translation/parser/builder.rb | 1 + lib/prism/translation/parser/compiler.rb | 1 + lib/prism/translation/parser/lexer.rb | 1 + lib/prism/translation/parser33.rb | 1 + lib/prism/translation/parser34.rb | 1 + lib/prism/translation/parser35.rb | 1 + lib/prism/translation/parser_current.rb | 2 ++ lib/prism/translation/ripper.rb | 1 + lib/prism/translation/ripper/sexp.rb | 1 + lib/prism/translation/ruby_parser.rb | 1 + templates/template.rb | 3 +++ 26 files changed, 30 insertions(+) diff --git a/lib/prism.rb b/lib/prism.rb index eaab5cbfed..dceba4b1f5 100644 --- a/lib/prism.rb +++ b/lib/prism.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true +# :markup: markdown # The Prism Ruby parser. # diff --git a/lib/prism/desugar_compiler.rb b/lib/prism/desugar_compiler.rb index e3b15fc3b0..5d7d38d841 100644 --- a/lib/prism/desugar_compiler.rb +++ b/lib/prism/desugar_compiler.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true +# :markup: markdown module Prism class DesugarAndWriteNode # :nodoc: diff --git a/lib/prism/ffi.rb b/lib/prism/ffi.rb index a0da0b6195..5a4ba09a4f 100644 --- a/lib/prism/ffi.rb +++ b/lib/prism/ffi.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true +# :markup: markdown # typed: ignore # This file is responsible for mirroring the API provided by the C extension by diff --git a/lib/prism/lex_compat.rb b/lib/prism/lex_compat.rb index a83c24cb41..9b3f025ab6 100644 --- a/lib/prism/lex_compat.rb +++ b/lib/prism/lex_compat.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true +# :markup: markdown require "delegate" require "ripper" diff --git a/lib/prism/node_ext.rb b/lib/prism/node_ext.rb index b007a051ea..939740385c 100644 --- a/lib/prism/node_ext.rb +++ b/lib/prism/node_ext.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true +# :markup: markdown # Here we are reopening the prism module to provide methods on nodes that aren't # templated and are meant as convenience methods. diff --git a/lib/prism/pack.rb b/lib/prism/pack.rb index c0de8ab8b7..166c04c3c0 100644 --- a/lib/prism/pack.rb +++ b/lib/prism/pack.rb @@ -1,6 +1,8 @@ # frozen_string_literal: true +# :markup: markdown # typed: ignore +# module Prism # A parser for the pack template language. module Pack diff --git a/lib/prism/parse_result.rb b/lib/prism/parse_result.rb index 9a3e7c5b79..05c14e33f5 100644 --- a/lib/prism/parse_result.rb +++ b/lib/prism/parse_result.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true +# :markup: markdown module Prism # This represents a source of Ruby code that has been parsed. It is used in diff --git a/lib/prism/parse_result/comments.rb b/lib/prism/parse_result/comments.rb index 22c4148b2c..3e93316aff 100644 --- a/lib/prism/parse_result/comments.rb +++ b/lib/prism/parse_result/comments.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true +# :markup: markdown module Prism class ParseResult < Result diff --git a/lib/prism/parse_result/errors.rb b/lib/prism/parse_result/errors.rb index eb4f317248..26c376b3ce 100644 --- a/lib/prism/parse_result/errors.rb +++ b/lib/prism/parse_result/errors.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true +# :markup: markdown require "stringio" diff --git a/lib/prism/parse_result/newlines.rb b/lib/prism/parse_result/newlines.rb index 37f64f8ae2..e7fd62cafe 100644 --- a/lib/prism/parse_result/newlines.rb +++ b/lib/prism/parse_result/newlines.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true +# :markup: markdown module Prism class ParseResult < Result diff --git a/lib/prism/pattern.rb b/lib/prism/pattern.rb index 03fec26789..6ad2d9e5b9 100644 --- a/lib/prism/pattern.rb +++ b/lib/prism/pattern.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true +# :markup: markdown module Prism # A pattern is an object that wraps a Ruby pattern matching expression. The diff --git a/lib/prism/relocation.rb b/lib/prism/relocation.rb index 163d2012c5..3e9210a785 100644 --- a/lib/prism/relocation.rb +++ b/lib/prism/relocation.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true +# :markup: markdown module Prism # Prism parses deterministically for the same input. This provides a nice diff --git a/lib/prism/string_query.rb b/lib/prism/string_query.rb index 9011051d2b..547f58d2fa 100644 --- a/lib/prism/string_query.rb +++ b/lib/prism/string_query.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true +# :markup: markdown module Prism # Query methods that allow categorizing strings based on their context for diff --git a/lib/prism/translation.rb b/lib/prism/translation.rb index 511c80febc..d127f2006c 100644 --- a/lib/prism/translation.rb +++ b/lib/prism/translation.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true +# :markup: markdown module Prism # This module is responsible for converting the prism syntax tree into other diff --git a/lib/prism/translation/parser.rb b/lib/prism/translation/parser.rb index d43ad7c1e4..a7888f77ec 100644 --- a/lib/prism/translation/parser.rb +++ b/lib/prism/translation/parser.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true +# :markup: markdown begin required_version = ">= 3.3.7.2" diff --git a/lib/prism/translation/parser/builder.rb b/lib/prism/translation/parser/builder.rb index d3b51f4275..6b620c25bc 100644 --- a/lib/prism/translation/parser/builder.rb +++ b/lib/prism/translation/parser/builder.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true +# :markup: markdown module Prism module Translation diff --git a/lib/prism/translation/parser/compiler.rb b/lib/prism/translation/parser/compiler.rb index 0bd9d74f93..6e0618890d 100644 --- a/lib/prism/translation/parser/compiler.rb +++ b/lib/prism/translation/parser/compiler.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true +# :markup: markdown module Prism module Translation diff --git a/lib/prism/translation/parser/lexer.rb b/lib/prism/translation/parser/lexer.rb index 8f2d065b73..349a0b257f 100644 --- a/lib/prism/translation/parser/lexer.rb +++ b/lib/prism/translation/parser/lexer.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true +# :markup: markdown require "strscan" require_relative "../../polyfill/append_as_bytes" diff --git a/lib/prism/translation/parser33.rb b/lib/prism/translation/parser33.rb index b09266e06a..0a59669465 100644 --- a/lib/prism/translation/parser33.rb +++ b/lib/prism/translation/parser33.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true +# :markup: markdown module Prism module Translation diff --git a/lib/prism/translation/parser34.rb b/lib/prism/translation/parser34.rb index 0ead70ad3c..566a23fadb 100644 --- a/lib/prism/translation/parser34.rb +++ b/lib/prism/translation/parser34.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true +# :markup: markdown module Prism module Translation diff --git a/lib/prism/translation/parser35.rb b/lib/prism/translation/parser35.rb index a6abc12589..79cd59cbd9 100644 --- a/lib/prism/translation/parser35.rb +++ b/lib/prism/translation/parser35.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true +# :markup: markdown module Prism module Translation diff --git a/lib/prism/translation/parser_current.rb b/lib/prism/translation/parser_current.rb index b44769fde7..1b1794abbe 100644 --- a/lib/prism/translation/parser_current.rb +++ b/lib/prism/translation/parser_current.rb @@ -1,6 +1,8 @@ # frozen_string_literal: true +# :markup: markdown # typed: ignore +# module Prism module Translation case RUBY_VERSION diff --git a/lib/prism/translation/ripper.rb b/lib/prism/translation/ripper.rb index 95f366ac91..6ea98fc1ea 100644 --- a/lib/prism/translation/ripper.rb +++ b/lib/prism/translation/ripper.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true +# :markup: markdown require "ripper" diff --git a/lib/prism/translation/ripper/sexp.rb b/lib/prism/translation/ripper/sexp.rb index dc26a639a3..8cfefc8472 100644 --- a/lib/prism/translation/ripper/sexp.rb +++ b/lib/prism/translation/ripper/sexp.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true +# :markup: markdown require_relative "../ripper" diff --git a/lib/prism/translation/ruby_parser.rb b/lib/prism/translation/ruby_parser.rb index 8784e22d10..cfb76631a4 100644 --- a/lib/prism/translation/ruby_parser.rb +++ b/lib/prism/translation/ruby_parser.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true +# :markup: markdown begin require "ruby_parser" diff --git a/templates/template.rb b/templates/template.rb index 30cb60cabd..12fcebb4a7 100755 --- a/templates/template.rb +++ b/templates/template.rb @@ -551,6 +551,7 @@ def render(name, write_to: nil) when ".rb" <<~HEADING # frozen_string_literal: true + # :markup: markdown =begin This file is generated by the templates/template.rb script and should not be @@ -579,6 +580,8 @@ def render(name, write_to: nil) HEADING else <<~HEADING + /* :markup: markdown */ + /*----------------------------------------------------------------------------*/ /* This file is generated by the templates/template.rb script and should not */ /* be modified manually. See */ From 641775e5fea6dc818f8183a0f3eb7336023d17c9 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Wed, 28 May 2025 19:26:54 +0900 Subject: [PATCH 031/333] [DOC] Add code fences --- lib/prism/translation/ruby_parser.rb | 282 +++++++++++++++++++++++++++ 1 file changed, 282 insertions(+) diff --git a/lib/prism/translation/ruby_parser.rb b/lib/prism/translation/ruby_parser.rb index cfb76631a4..3c08a1944c 100644 --- a/lib/prism/translation/ruby_parser.rb +++ b/lib/prism/translation/ruby_parser.rb @@ -35,26 +35,34 @@ def initialize(file, in_def: false, in_pattern: false) @in_pattern = in_pattern end + # ``` # alias foo bar # ^^^^^^^^^^^^^ + # ``` def visit_alias_method_node(node) s(node, :alias, visit(node.new_name), visit(node.old_name)) end + # ``` # alias $foo $bar # ^^^^^^^^^^^^^^^ + # ``` def visit_alias_global_variable_node(node) s(node, :valias, node.new_name.name, node.old_name.name) end + # ``` # foo => bar | baz # ^^^^^^^^^ + # ``` def visit_alternation_pattern_node(node) s(node, :or, visit(node.left), visit(node.right)) end + # ``` # a and b # ^^^^^^^ + # ``` def visit_and_node(node) left = visit(node.left) @@ -71,8 +79,10 @@ def visit_and_node(node) end end + # ``` # [] # ^^ + # ``` def visit_array_node(node) if in_pattern s(node, :array_pat, nil).concat(visit_all(node.elements)) @@ -81,8 +91,10 @@ def visit_array_node(node) end end + # ``` # foo => [bar] # ^^^^^ + # ``` def visit_array_pattern_node(node) if node.constant.nil? && node.requireds.empty? && node.rest.nil? && node.posts.empty? s(node, :array_pat) @@ -104,23 +116,29 @@ def visit_array_pattern_node(node) end end + # ``` # foo(bar) # ^^^ + # ``` def visit_arguments_node(node) raise "Cannot visit arguments directly" end + # ``` # { a: 1 } # ^^^^ + # ``` def visit_assoc_node(node) [visit(node.key), visit(node.value)] end + # ``` # def foo(**); bar(**); end # ^^ # # { **foo } # ^^^^^ + # ``` def visit_assoc_splat_node(node) if node.value.nil? [s(node, :kwsplat)] @@ -129,14 +147,18 @@ def visit_assoc_splat_node(node) end end + # ``` # $+ # ^^ + # ``` def visit_back_reference_read_node(node) s(node, :back_ref, node.name.name.delete_prefix("$").to_sym) end + # ``` # begin end # ^^^^^^^^^ + # ``` def visit_begin_node(node) result = node.statements.nil? ? s(node, :nil) : visit(node.statements) @@ -168,16 +190,20 @@ def visit_begin_node(node) result end + # ``` # foo(&bar) # ^^^^ + # ``` def visit_block_argument_node(node) s(node, :block_pass).tap do |result| result << visit(node.expression) unless node.expression.nil? end end + # ``` # foo { |; bar| } # ^^^ + # ``` def visit_block_local_variable_node(node) node.name end @@ -187,8 +213,10 @@ def visit_block_node(node) s(node, :block_pass, visit(node.expression)) end + # ``` # def foo(&bar); end # ^^^^ + # ``` def visit_block_parameter_node(node) :"&#{node.name}" end @@ -229,11 +257,13 @@ def visit_block_parameters_node(node) result end + # ``` # break # ^^^^^ # # break foo # ^^^^^^^^^ + # ``` def visit_break_node(node) if node.arguments.nil? s(node, :break) @@ -244,6 +274,7 @@ def visit_break_node(node) end end + # ``` # foo # ^^^ # @@ -252,6 +283,7 @@ def visit_break_node(node) # # foo.bar() {} # ^^^^^^^^^^^^ + # ``` def visit_call_node(node) case node.name when :!~ @@ -290,8 +322,10 @@ def visit_call_node(node) visit_block(node, result, block) end + # ``` # foo.bar += baz # ^^^^^^^^^^^^^^^ + # ``` def visit_call_operator_write_node(node) if op_asgn?(node) s(node, op_asgn_type(node, :op_asgn), visit(node.receiver), visit_write_value(node.value), node.read_name, node.binary_operator) @@ -300,8 +334,10 @@ def visit_call_operator_write_node(node) end end + # ``` # foo.bar &&= baz # ^^^^^^^^^^^^^^^ + # ``` def visit_call_and_write_node(node) if op_asgn?(node) s(node, op_asgn_type(node, :op_asgn), visit(node.receiver), visit_write_value(node.value), node.read_name, :"&&") @@ -310,8 +346,10 @@ def visit_call_and_write_node(node) end end + # ``` # foo.bar ||= baz # ^^^^^^^^^^^^^^^ + # ``` def visit_call_or_write_node(node) if op_asgn?(node) s(node, op_asgn_type(node, :op_asgn), visit(node.receiver), visit_write_value(node.value), node.read_name, :"||") @@ -333,32 +371,42 @@ def visit_call_or_write_node(node) node.safe_navigation? ? :"safe_#{type}" : type end + # ``` # foo.bar, = 1 # ^^^^^^^ + # ``` def visit_call_target_node(node) s(node, :attrasgn, visit(node.receiver), node.name) end + # ``` # foo => bar => baz # ^^^^^^^^^^ + # ``` def visit_capture_pattern_node(node) visit(node.target) << visit(node.value) end + # ``` # case foo; when bar; end # ^^^^^^^^^^^^^^^^^^^^^^^ + # ``` def visit_case_node(node) s(node, :case, visit(node.predicate)).concat(visit_all(node.conditions)) << visit(node.else_clause) end + # ``` # case foo; in bar; end # ^^^^^^^^^^^^^^^^^^^^^ + # ``` def visit_case_match_node(node) s(node, :case, visit(node.predicate)).concat(visit_all(node.conditions)) << visit(node.else_clause) end + # ``` # class Foo; end # ^^^^^^^^^^^^^^ + # ``` def visit_class_node(node) name = if node.constant_path.is_a?(ConstantReadNode) @@ -377,41 +425,53 @@ def visit_class_node(node) end end + # ``` # @@foo # ^^^^^ + # ``` def visit_class_variable_read_node(node) s(node, :cvar, node.name) end + # ``` # @@foo = 1 # ^^^^^^^^^ # # @@foo, @@bar = 1 # ^^^^^ ^^^^^ + # ``` def visit_class_variable_write_node(node) s(node, class_variable_write_type, node.name, visit_write_value(node.value)) end + # ``` # @@foo += bar # ^^^^^^^^^^^^ + # ``` def visit_class_variable_operator_write_node(node) s(node, class_variable_write_type, node.name, s(node, :call, s(node, :cvar, node.name), node.binary_operator, visit_write_value(node.value))) end + # ``` # @@foo &&= bar # ^^^^^^^^^^^^^ + # ``` def visit_class_variable_and_write_node(node) s(node, :op_asgn_and, s(node, :cvar, node.name), s(node, class_variable_write_type, node.name, visit_write_value(node.value))) end + # ``` # @@foo ||= bar # ^^^^^^^^^^^^^ + # ``` def visit_class_variable_or_write_node(node) s(node, :op_asgn_or, s(node, :cvar, node.name), s(node, class_variable_write_type, node.name, visit_write_value(node.value))) end + # ``` # @@foo, = bar # ^^^^^ + # ``` def visit_class_variable_target_node(node) s(node, class_variable_write_type, node.name) end @@ -422,47 +482,61 @@ def visit_class_variable_target_node(node) in_def ? :cvasgn : :cvdecl end + # ``` # Foo # ^^^ + # ``` def visit_constant_read_node(node) s(node, :const, node.name) end + # ``` # Foo = 1 # ^^^^^^^ # # Foo, Bar = 1 # ^^^ ^^^ + # ``` def visit_constant_write_node(node) s(node, :cdecl, node.name, visit_write_value(node.value)) end + # ``` # Foo += bar # ^^^^^^^^^^^ + # ``` def visit_constant_operator_write_node(node) s(node, :cdecl, node.name, s(node, :call, s(node, :const, node.name), node.binary_operator, visit_write_value(node.value))) end + # ``` # Foo &&= bar # ^^^^^^^^^^^^ + # ``` def visit_constant_and_write_node(node) s(node, :op_asgn_and, s(node, :const, node.name), s(node, :cdecl, node.name, visit(node.value))) end + # ``` # Foo ||= bar # ^^^^^^^^^^^^ + # ``` def visit_constant_or_write_node(node) s(node, :op_asgn_or, s(node, :const, node.name), s(node, :cdecl, node.name, visit(node.value))) end + # ``` # Foo, = bar # ^^^ + # ``` def visit_constant_target_node(node) s(node, :cdecl, node.name) end + # ``` # Foo::Bar # ^^^^^^^^ + # ``` def visit_constant_path_node(node) if node.parent.nil? s(node, :colon3, node.name) @@ -471,35 +545,45 @@ def visit_constant_path_node(node) end end + # ``` # Foo::Bar = 1 # ^^^^^^^^^^^^ # # Foo::Foo, Bar::Bar = 1 # ^^^^^^^^ ^^^^^^^^ + # ``` def visit_constant_path_write_node(node) s(node, :cdecl, visit(node.target), visit_write_value(node.value)) end + # ``` # Foo::Bar += baz # ^^^^^^^^^^^^^^^ + # ``` def visit_constant_path_operator_write_node(node) s(node, :op_asgn, visit(node.target), node.binary_operator, visit_write_value(node.value)) end + # ``` # Foo::Bar &&= baz # ^^^^^^^^^^^^^^^^ + # ``` def visit_constant_path_and_write_node(node) s(node, :op_asgn_and, visit(node.target), visit_write_value(node.value)) end + # ``` # Foo::Bar ||= baz # ^^^^^^^^^^^^^^^^ + # ``` def visit_constant_path_or_write_node(node) s(node, :op_asgn_or, visit(node.target), visit_write_value(node.value)) end + # ``` # Foo::Bar, = baz # ^^^^^^^^ + # ``` def visit_constant_path_target_node(node) inner = if node.parent.nil? @@ -511,11 +595,13 @@ def visit_constant_path_target_node(node) s(node, :const, inner) end + # ``` # def foo; end # ^^^^^^^^^^^^ # # def self.foo; end # ^^^^^^^^^^^^^^^^^ + # ``` def visit_def_node(node) name = node.name_loc.slice.to_sym result = @@ -542,55 +628,71 @@ def visit_def_node(node) end end + # ``` # defined? a # ^^^^^^^^^^ # # defined?(a) # ^^^^^^^^^^^ + # ``` def visit_defined_node(node) s(node, :defined, visit(node.value)) end + # ``` # if foo then bar else baz end # ^^^^^^^^^^^^ + # ``` def visit_else_node(node) visit(node.statements) end + # ``` # "foo #{bar}" # ^^^^^^ + # ``` def visit_embedded_statements_node(node) result = s(node, :evstr) result << visit(node.statements) unless node.statements.nil? result end + # ``` # "foo #@bar" # ^^^^^ + # ``` def visit_embedded_variable_node(node) s(node, :evstr, visit(node.variable)) end + # ``` # begin; foo; ensure; bar; end # ^^^^^^^^^^^^ + # ``` def visit_ensure_node(node) node.statements.nil? ? s(node, :nil) : visit(node.statements) end + # ``` # false # ^^^^^ + # ``` def visit_false_node(node) s(node, :false) end + # ``` # foo => [*, bar, *] # ^^^^^^^^^^^ + # ``` def visit_find_pattern_node(node) s(node, :find_pat, visit_pattern_constant(node.constant), :"*#{node.left.expression&.name}", *visit_all(node.requireds), :"*#{node.right.expression&.name}") end + # ``` # if foo .. bar; end # ^^^^^^^^^^ + # ``` def visit_flip_flop_node(node) if node.left.is_a?(IntegerNode) && node.right.is_a?(IntegerNode) s(node, :lit, Range.new(node.left.value, node.right.value, node.exclude_end?)) @@ -599,86 +701,112 @@ def visit_flip_flop_node(node) end end + # ``` # 1.0 # ^^^ + # ``` def visit_float_node(node) s(node, :lit, node.value) end + # ``` # for foo in bar do end # ^^^^^^^^^^^^^^^^^^^^^ + # ``` def visit_for_node(node) s(node, :for, visit(node.collection), visit(node.index), visit(node.statements)) end + # ``` # def foo(...); bar(...); end # ^^^ + # ``` def visit_forwarding_arguments_node(node) s(node, :forward_args) end + # ``` # def foo(...); end # ^^^ + # ``` def visit_forwarding_parameter_node(node) s(node, :forward_args) end + # ``` # super # ^^^^^ # # super {} # ^^^^^^^^ + # ``` def visit_forwarding_super_node(node) visit_block(node, s(node, :zsuper), node.block) end + # ``` # $foo # ^^^^ + # ``` def visit_global_variable_read_node(node) s(node, :gvar, node.name) end + # ``` # $foo = 1 # ^^^^^^^^ # # $foo, $bar = 1 # ^^^^ ^^^^ + # ``` def visit_global_variable_write_node(node) s(node, :gasgn, node.name, visit_write_value(node.value)) end + # ``` # $foo += bar # ^^^^^^^^^^^ + # ``` def visit_global_variable_operator_write_node(node) s(node, :gasgn, node.name, s(node, :call, s(node, :gvar, node.name), node.binary_operator, visit(node.value))) end + # ``` # $foo &&= bar # ^^^^^^^^^^^^ + # ``` def visit_global_variable_and_write_node(node) s(node, :op_asgn_and, s(node, :gvar, node.name), s(node, :gasgn, node.name, visit_write_value(node.value))) end + # ``` # $foo ||= bar # ^^^^^^^^^^^^ + # ``` def visit_global_variable_or_write_node(node) s(node, :op_asgn_or, s(node, :gvar, node.name), s(node, :gasgn, node.name, visit_write_value(node.value))) end + # ``` # $foo, = bar # ^^^^ + # ``` def visit_global_variable_target_node(node) s(node, :gasgn, node.name) end + # ``` # {} # ^^ + # ``` def visit_hash_node(node) s(node, :hash).concat(node.elements.flat_map { |element| visit(element) }) end + # ``` # foo => {} # ^^ + # ``` def visit_hash_pattern_node(node) result = s(node, :hash_pat, visit_pattern_constant(node.constant)).concat(node.elements.flat_map { |element| visit(element) }) @@ -692,6 +820,7 @@ def visit_hash_pattern_node(node) result end + # ``` # if foo then bar end # ^^^^^^^^^^^^^^^^^^^ # @@ -700,6 +829,7 @@ def visit_hash_pattern_node(node) # # foo ? bar : baz # ^^^^^^^^^^^^^^^ + # ``` def visit_if_node(node) s(node, :if, visit(node.predicate), visit(node.statements), visit(node.subsequent)) end @@ -709,18 +839,24 @@ def visit_imaginary_node(node) s(node, :lit, node.value) end + # ``` # { foo: } # ^^^^ + # ``` def visit_implicit_node(node) end + # ``` # foo { |bar,| } # ^ + # ``` def visit_implicit_rest_node(node) end + # ``` # case foo; in bar; end # ^^^^^^^^^^^^^^^^^^^^^ + # ``` def visit_in_node(node) pattern = if node.pattern.is_a?(ConstantPathNode) @@ -732,8 +868,10 @@ def visit_in_node(node) s(node, :in, pattern).concat(node.statements.nil? ? [nil] : visit_all(node.statements.body)) end + # ``` # foo[bar] += baz # ^^^^^^^^^^^^^^^ + # ``` def visit_index_operator_write_node(node) arglist = nil @@ -745,8 +883,10 @@ def visit_index_operator_write_node(node) s(node, :op_asgn1, visit(node.receiver), arglist, node.binary_operator, visit_write_value(node.value)) end + # ``` # foo[bar] &&= baz # ^^^^^^^^^^^^^^^^ + # ``` def visit_index_and_write_node(node) arglist = nil @@ -758,8 +898,10 @@ def visit_index_and_write_node(node) s(node, :op_asgn1, visit(node.receiver), arglist, :"&&", visit_write_value(node.value)) end + # ``` # foo[bar] ||= baz # ^^^^^^^^^^^^^^^^ + # ``` def visit_index_or_write_node(node) arglist = nil @@ -771,8 +913,10 @@ def visit_index_or_write_node(node) s(node, :op_asgn1, visit(node.receiver), arglist, :"||", visit_write_value(node.value)) end + # ``` # foo[bar], = 1 # ^^^^^^^^ + # ``` def visit_index_target_node(node) arguments = visit_all(node.arguments&.arguments || []) arguments << visit(node.block) unless node.block.nil? @@ -780,53 +924,69 @@ def visit_index_target_node(node) s(node, :attrasgn, visit(node.receiver), :[]=).concat(arguments) end + # ``` # @foo # ^^^^ + # ``` def visit_instance_variable_read_node(node) s(node, :ivar, node.name) end + # ``` # @foo = 1 # ^^^^^^^^ # # @foo, @bar = 1 # ^^^^ ^^^^ + # ``` def visit_instance_variable_write_node(node) s(node, :iasgn, node.name, visit_write_value(node.value)) end + # ``` # @foo += bar # ^^^^^^^^^^^ + # ``` def visit_instance_variable_operator_write_node(node) s(node, :iasgn, node.name, s(node, :call, s(node, :ivar, node.name), node.binary_operator, visit_write_value(node.value))) end + # ``` # @foo &&= bar # ^^^^^^^^^^^^ + # ``` def visit_instance_variable_and_write_node(node) s(node, :op_asgn_and, s(node, :ivar, node.name), s(node, :iasgn, node.name, visit(node.value))) end + # ``` # @foo ||= bar # ^^^^^^^^^^^^ + # ``` def visit_instance_variable_or_write_node(node) s(node, :op_asgn_or, s(node, :ivar, node.name), s(node, :iasgn, node.name, visit(node.value))) end + # ``` # @foo, = bar # ^^^^ + # ``` def visit_instance_variable_target_node(node) s(node, :iasgn, node.name) end + # ``` # 1 # ^ + # ``` def visit_integer_node(node) s(node, :lit, node.value) end + # ``` # if /foo #{bar}/ then end # ^^^^^^^^^^^^ + # ``` def visit_interpolated_match_last_line_node(node) parts = visit_interpolated_parts(node.parts) regexp = @@ -842,8 +1002,10 @@ def visit_interpolated_match_last_line_node(node) s(node, :match, regexp) end + # ``` # /foo #{bar}/ # ^^^^^^^^^^^^ + # ``` def visit_interpolated_regular_expression_node(node) parts = visit_interpolated_parts(node.parts) @@ -857,22 +1019,28 @@ def visit_interpolated_regular_expression_node(node) end end + # ``` # "foo #{bar}" # ^^^^^^^^^^^^ + # ``` def visit_interpolated_string_node(node) parts = visit_interpolated_parts(node.parts) parts.length == 1 ? s(node, :str, parts.first) : s(node, :dstr).concat(parts) end + # ``` # :"foo #{bar}" # ^^^^^^^^^^^^^ + # ``` def visit_interpolated_symbol_node(node) parts = visit_interpolated_parts(node.parts) parts.length == 1 ? s(node, :lit, parts.first.to_sym) : s(node, :dsym).concat(parts) end + # ``` # `foo #{bar}` # ^^^^^^^^^^^^ + # ``` def visit_interpolated_x_string_node(node) source = node.heredoc? ? node.parts.first : node parts = visit_interpolated_parts(node.parts) @@ -952,23 +1120,29 @@ def visit_interpolated_x_string_node(node) results end + # ``` # -> { it } # ^^ + # ``` def visit_it_local_variable_read_node(node) s(node, :call, nil, :it) end + # ``` # foo(bar: baz) # ^^^^^^^^ + # ``` def visit_keyword_hash_node(node) s(node, :hash).concat(node.elements.flat_map { |element| visit(element) }) end + # ``` # def foo(**bar); end # ^^^^^ # # def foo(**); end # ^^ + # ``` def visit_keyword_rest_parameter_node(node) :"**#{node.name}" end @@ -990,8 +1164,10 @@ def visit_lambda_node(node) end end + # ``` # foo # ^^^ + # ``` def visit_local_variable_read_node(node) if node.name.match?(/^_\d$/) s(node, :call, nil, node.name) @@ -1000,59 +1176,77 @@ def visit_local_variable_read_node(node) end end + # ``` # foo = 1 # ^^^^^^^ # # foo, bar = 1 # ^^^ ^^^ + # ``` def visit_local_variable_write_node(node) s(node, :lasgn, node.name, visit_write_value(node.value)) end + # ``` # foo += bar # ^^^^^^^^^^ + # ``` def visit_local_variable_operator_write_node(node) s(node, :lasgn, node.name, s(node, :call, s(node, :lvar, node.name), node.binary_operator, visit_write_value(node.value))) end + # ``` # foo &&= bar # ^^^^^^^^^^^ + # ``` def visit_local_variable_and_write_node(node) s(node, :op_asgn_and, s(node, :lvar, node.name), s(node, :lasgn, node.name, visit_write_value(node.value))) end + # ``` # foo ||= bar # ^^^^^^^^^^^ + # ``` def visit_local_variable_or_write_node(node) s(node, :op_asgn_or, s(node, :lvar, node.name), s(node, :lasgn, node.name, visit_write_value(node.value))) end + # ``` # foo, = bar # ^^^ + # ``` def visit_local_variable_target_node(node) s(node, :lasgn, node.name) end + # ``` # if /foo/ then end # ^^^^^ + # ``` def visit_match_last_line_node(node) s(node, :match, s(node, :lit, Regexp.new(node.unescaped, node.options))) end + # ``` # foo in bar # ^^^^^^^^^^ + # ``` def visit_match_predicate_node(node) s(node, :case, visit(node.value), s(node, :in, node.pattern.accept(copy_compiler(in_pattern: true)), nil), nil) end + # ``` # foo => bar # ^^^^^^^^^^ + # ``` def visit_match_required_node(node) s(node, :case, visit(node.value), s(node, :in, node.pattern.accept(copy_compiler(in_pattern: true)), nil), nil) end + # ``` # /(?foo)/ =~ bar # ^^^^^^^^^^^^^^^^^^^^ + # ``` def visit_match_write_node(node) s(node, :match2, visit(node.call.receiver), visit(node.call.arguments.arguments.first)) end @@ -1064,8 +1258,10 @@ def visit_missing_node(node) raise "Cannot visit missing node directly" end + # ``` # module Foo; end # ^^^^^^^^^^^^^^^ + # ``` def visit_module_node(node) name = if node.constant_path.is_a?(ConstantReadNode) @@ -1084,8 +1280,10 @@ def visit_module_node(node) end end + # ``` # foo, bar = baz # ^^^^^^^^ + # ``` def visit_multi_target_node(node) targets = [*node.lefts] targets << node.rest if !node.rest.nil? && !node.rest.is_a?(ImplicitRestNode) @@ -1094,8 +1292,10 @@ def visit_multi_target_node(node) s(node, :masgn, s(node, :array).concat(visit_all(targets))) end + # ``` # foo, bar = baz # ^^^^^^^^^^^^^^ + # ``` def visit_multi_write_node(node) targets = [*node.lefts] targets << node.rest if !node.rest.nil? && !node.rest.is_a?(ImplicitRestNode) @@ -1115,11 +1315,13 @@ def visit_multi_write_node(node) s(node, :masgn, s(node, :array).concat(visit_all(targets)), value) end + # ``` # next # ^^^^ # # next foo # ^^^^^^^^ + # ``` def visit_next_node(node) if node.arguments.nil? s(node, :next) @@ -1131,44 +1333,58 @@ def visit_next_node(node) end end + # ``` # nil # ^^^ + # ``` def visit_nil_node(node) s(node, :nil) end + # ``` # def foo(**nil); end # ^^^^^ + # ``` def visit_no_keywords_parameter_node(node) in_pattern ? s(node, :kwrest, :"**nil") : :"**nil" end + # ``` # -> { _1 + _2 } # ^^^^^^^^^^^^^^ + # ``` def visit_numbered_parameters_node(node) raise "Cannot visit numbered parameters directly" end + # ``` # $1 # ^^ + # ``` def visit_numbered_reference_read_node(node) s(node, :nth_ref, node.number) end + # ``` # def foo(bar: baz); end # ^^^^^^^^ + # ``` def visit_optional_keyword_parameter_node(node) s(node, :kwarg, node.name, visit(node.value)) end + # ``` # def foo(bar = 1); end # ^^^^^^^ + # ``` def visit_optional_parameter_node(node) s(node, :lasgn, node.name, visit(node.value)) end + # ``` # a or b # ^^^^^^ + # ``` def visit_or_node(node) left = visit(node.left) @@ -1185,8 +1401,10 @@ def visit_or_node(node) end end + # ``` # def foo(bar, *baz); end # ^^^^^^^^^ + # ``` def visit_parameters_node(node) children = node.compact_child_nodes.map do |element| @@ -1200,8 +1418,10 @@ def visit_parameters_node(node) s(node, :args).concat(children) end + # ``` # def foo((bar, baz)); end # ^^^^^^^^^^ + # ``` private def visit_destructured_parameter(node) children = [*node.lefts, *node.rest, *node.rights].map do |child| @@ -1220,11 +1440,13 @@ def visit_parameters_node(node) s(node, :masgn).concat(children) end + # ``` # () # ^^ # # (1) # ^^^ + # ``` def visit_parentheses_node(node) if node.body.nil? s(node, :nil) @@ -1233,14 +1455,18 @@ def visit_parentheses_node(node) end end + # ``` # foo => ^(bar) # ^^^^^^ + # ``` def visit_pinned_expression_node(node) node.expression.accept(copy_compiler(in_pattern: false)) end + # ``` # foo = 1 and bar => ^foo # ^^^^ + # ``` def visit_pinned_variable_node(node) if node.variable.is_a?(LocalVariableReadNode) && node.variable.name.match?(/^_\d$/) s(node, :lvar, node.variable.name) @@ -1264,8 +1490,10 @@ def visit_program_node(node) visit(node.statements) end + # ``` # 0..5 # ^^^^ + # ``` def visit_range_node(node) if !in_pattern && !node.left.nil? && !node.right.nil? && ([node.left.type, node.right.type] - %i[nil_node integer_node]).empty? left = node.left.value if node.left.is_a?(IntegerNode) @@ -1286,44 +1514,58 @@ def visit_range_node(node) end end + # ``` # 1r # ^^ + # ``` def visit_rational_node(node) s(node, :lit, node.value) end + # ``` # redo # ^^^^ + # ``` def visit_redo_node(node) s(node, :redo) end + # ``` # /foo/ # ^^^^^ + # ``` def visit_regular_expression_node(node) s(node, :lit, Regexp.new(node.unescaped, node.options)) end + # ``` # def foo(bar:); end # ^^^^ + # ``` def visit_required_keyword_parameter_node(node) s(node, :kwarg, node.name) end + # ``` # def foo(bar); end # ^^^ + # ``` def visit_required_parameter_node(node) node.name end + # ``` # foo rescue bar # ^^^^^^^^^^^^^^ + # ``` def visit_rescue_modifier_node(node) s(node, :rescue, visit(node.expression), s(node.rescue_expression, :resbody, s(node.rescue_expression, :array), visit(node.rescue_expression))) end + # ``` # begin; rescue; end # ^^^^^^^ + # ``` def visit_rescue_node(node) exceptions = if node.exceptions.length == 1 && node.exceptions.first.is_a?(SplatNode) @@ -1339,26 +1581,32 @@ def visit_rescue_node(node) s(node, :resbody, exceptions).concat(node.statements.nil? ? [nil] : visit_all(node.statements.body)) end + # ``` # def foo(*bar); end # ^^^^ # # def foo(*); end # ^ + # ``` def visit_rest_parameter_node(node) :"*#{node.name}" end + # ``` # retry # ^^^^^ + # ``` def visit_retry_node(node) s(node, :retry) end + # ``` # return # ^^^^^^ # # return 1 # ^^^^^^^^ + # ``` def visit_return_node(node) if node.arguments.nil? s(node, :return) @@ -1370,8 +1618,10 @@ def visit_return_node(node) end end + # ``` # self # ^^^^ + # ``` def visit_self_node(node) s(node, :self) end @@ -1381,33 +1631,42 @@ def visit_shareable_constant_node(node) visit(node.write) end + # ``` # class << self; end # ^^^^^^^^^^^^^^^^^^ + # ``` def visit_singleton_class_node(node) s(node, :sclass, visit(node.expression)).tap do |sexp| sexp << node.body.accept(copy_compiler(in_def: false)) unless node.body.nil? end end + # ``` # __ENCODING__ # ^^^^^^^^^^^^ + # ``` def visit_source_encoding_node(node) # TODO s(node, :colon2, s(node, :const, :Encoding), :UTF_8) end + # ``` # __FILE__ # ^^^^^^^^ + # ``` def visit_source_file_node(node) s(node, :str, node.filepath) end + # ``` # __LINE__ # ^^^^^^^^ + # ``` def visit_source_line_node(node) s(node, :lit, node.location.start_line) end + # ``` # foo(*bar) # ^^^^ # @@ -1416,6 +1675,7 @@ def visit_source_line_node(node) # # def foo(*); bar(*); end # ^ + # ``` def visit_splat_node(node) if node.expression.nil? s(node, :splat) @@ -1435,8 +1695,10 @@ def visit_statements_node(node) end end + # ``` # "foo" # ^^^^^ + # ``` def visit_string_node(node) unescaped = node.unescaped @@ -1448,8 +1710,10 @@ def visit_string_node(node) s(node, :str, unescaped) end + # ``` # super(foo) # ^^^^^^^^^^ + # ``` def visit_super_node(node) arguments = node.arguments&.arguments || [] block = node.block @@ -1462,60 +1726,76 @@ def visit_super_node(node) visit_block(node, s(node, :super).concat(visit_all(arguments)), block) end + # ``` # :foo # ^^^^ + # ``` def visit_symbol_node(node) node.value == "!@" ? s(node, :lit, :"!@") : s(node, :lit, node.unescaped.to_sym) end + # ``` # true # ^^^^ + # ``` def visit_true_node(node) s(node, :true) end + # ``` # undef foo # ^^^^^^^^^ + # ``` def visit_undef_node(node) names = node.names.map { |name| s(node, :undef, visit(name)) } names.length == 1 ? names.first : s(node, :block).concat(names) end + # ``` # unless foo; bar end # ^^^^^^^^^^^^^^^^^^^ # # bar unless foo # ^^^^^^^^^^^^^^ + # ``` def visit_unless_node(node) s(node, :if, visit(node.predicate), visit(node.else_clause), visit(node.statements)) end + # ``` # until foo; bar end # ^^^^^^^^^^^^^^^^^ # # bar until foo # ^^^^^^^^^^^^^ + # ``` def visit_until_node(node) s(node, :until, visit(node.predicate), visit(node.statements), !node.begin_modifier?) end + # ``` # case foo; when bar; end # ^^^^^^^^^^^^^ + # ``` def visit_when_node(node) s(node, :when, s(node, :array).concat(visit_all(node.conditions))).concat(node.statements.nil? ? [nil] : visit_all(node.statements.body)) end + # ``` # while foo; bar end # ^^^^^^^^^^^^^^^^^^ # # bar while foo # ^^^^^^^^^^^^^ + # ``` def visit_while_node(node) s(node, :while, visit(node.predicate), visit(node.statements), !node.begin_modifier?) end + # ``` # `foo` # ^^^^^ + # ``` def visit_x_string_node(node) result = s(node, :xstr, node.unescaped) @@ -1527,11 +1807,13 @@ def visit_x_string_node(node) result end + # ``` # yield # ^^^^^ # # yield 1 # ^^^^^^^ + # ``` def visit_yield_node(node) s(node, :yield).concat(visit_all(node.arguments&.arguments || [])) end From de1faa1680150d7b28d112b2ae9b7743d9365d44 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Wed, 28 May 2025 19:40:53 +0900 Subject: [PATCH 032/333] [DOC] Stop rdoc from processing non-rdoc comments --- lib/prism/node_ext.rb | 2 ++ templates/template.rb | 2 ++ 2 files changed, 4 insertions(+) diff --git a/lib/prism/node_ext.rb b/lib/prism/node_ext.rb index 939740385c..469e54ca0c 100644 --- a/lib/prism/node_ext.rb +++ b/lib/prism/node_ext.rb @@ -1,8 +1,10 @@ # frozen_string_literal: true # :markup: markdown +#-- # Here we are reopening the prism module to provide methods on nodes that aren't # templated and are meant as convenience methods. +#++ module Prism class Node def deprecated(*replacements) # :nodoc: diff --git a/templates/template.rb b/templates/template.rb index 12fcebb4a7..bf0d8ac9b7 100755 --- a/templates/template.rb +++ b/templates/template.rb @@ -554,9 +554,11 @@ def render(name, write_to: nil) # :markup: markdown =begin + -- This file is generated by the templates/template.rb script and should not be modified manually. See #{filepath} if you are looking to modify the template + ++ =end HEADING From 571ba378f5600e1f87651cbab121bd98dccd37f9 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Wed, 28 May 2025 19:47:22 +0900 Subject: [PATCH 033/333] [DOC] Markup `__FILE__` as code, not emphasis --- lib/prism/translation/ruby_parser.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/prism/translation/ruby_parser.rb b/lib/prism/translation/ruby_parser.rb index 3c08a1944c..3808cd3130 100644 --- a/lib/prism/translation/ruby_parser.rb +++ b/lib/prism/translation/ruby_parser.rb @@ -16,7 +16,7 @@ class RubyParser # A prism visitor that builds Sexp objects. class Compiler < ::Prism::Compiler # This is the name of the file that we are compiling. We set it on every - # Sexp object that is generated, and also use it to compile __FILE__ + # Sexp object that is generated, and also use it to compile `__FILE__` # nodes. attr_reader :file From ba019ab4b4dd04de199008b3541de109c4c07c88 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Wed, 28 May 2025 19:49:45 +0900 Subject: [PATCH 034/333] [DOC] Simply use `String#ljust` --- templates/template.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/template.rb b/templates/template.rb index bf0d8ac9b7..6c3efd7e6c 100755 --- a/templates/template.rb +++ b/templates/template.rb @@ -587,7 +587,7 @@ def render(name, write_to: nil) /*----------------------------------------------------------------------------*/ /* This file is generated by the templates/template.rb script and should not */ /* be modified manually. See */ - /* #{filepath + " " * (74 - filepath.size) } */ + /* #{filepath.ljust(74)} */ /* if you are looking to modify the */ /* template */ /*----------------------------------------------------------------------------*/ From 1cae6e3b0200524a396c900bca67a6055e1ca9f8 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Thu, 29 May 2025 06:11:08 +0900 Subject: [PATCH 035/333] [DOC] No RDoc in include/prism/ast.h --- templates/include/prism/ast.h.erb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/templates/include/prism/ast.h.erb b/templates/include/prism/ast.h.erb index 751c0b43c2..087eb81890 100644 --- a/templates/include/prism/ast.h.erb +++ b/templates/include/prism/ast.h.erb @@ -2,6 +2,8 @@ * @file ast.h * * The abstract syntax tree. + * + * -- */ #ifndef PRISM_AST_H #define PRISM_AST_H From 99615b43ac98412c8499a563119720cc8881880c Mon Sep 17 00:00:00 2001 From: harasho Date: Thu, 29 May 2025 14:05:28 +0900 Subject: [PATCH 036/333] Document ClassNode fields - Adds documentation for the fields of the `ClassNode`. - Part of #2123 --- config.yml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/config.yml b/config.yml index c9358b077f..0046810e4e 100644 --- a/config.yml +++ b/config.yml @@ -1831,6 +1831,11 @@ nodes: type: constant[] - name: class_keyword_loc type: location + comment: | + Represents the location of the `class` keyword. + + class Foo end + ^^^^^ - name: constant_path type: node kind: @@ -1839,18 +1844,43 @@ nodes: - on error: CallNode # class 0.X end - name: inheritance_operator_loc type: location? + comment: | + Represents the location of the `<` operator. + + class Foo < Bar + ^ - name: superclass type: node? kind: non-void expression + comment: | + Represents the superclass of the class. + + class Foo < Bar + ^^^ - name: body type: node? kind: - StatementsNode - BeginNode + comment: | + Represents the body of the class. + + class Foo + foo + ^^^ - name: end_keyword_loc type: location + comment: | + Represents the location of the `end` keyword. + + class Foo end + ^^^ - name: name type: constant + comment: | + The name of the class. + + class Foo end # name `:Foo` comment: | Represents a class declaration involving the `class` keyword. From f5ded5104d180b492c4e47afaf342c85225c45e3 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Mon, 2 Jun 2025 22:21:25 -0400 Subject: [PATCH 037/333] Handle new ractor stuff --- test/prism/ractor_test.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/prism/ractor_test.rb b/test/prism/ractor_test.rb index 55ff723395..6169940beb 100644 --- a/test/prism/ractor_test.rb +++ b/test/prism/ractor_test.rb @@ -62,7 +62,11 @@ def with_ractor(*arguments, &block) if reader reader.gets.chomp else - puts(ignore_warnings { Ractor.new(*arguments, &block) }.take) + ractor = ignore_warnings { Ractor.new(*arguments, &block) } + + # Somewhere in the Ruby 3.5.* series, Ractor#take was removed and + # Ractor#value was added. + puts(ractor.respond_to?(:value) ? ractor.value : ractor.take) end end end From cc1fa9d968812b8cfd87bc96fa5c1fcc58eb26c9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 3 Jun 2025 13:22:00 +0000 Subject: [PATCH 038/333] Bump org.junit.jupiter:junit-jupiter-engine Bumps the java-deps group in /java-wasm with 1 update: [org.junit.jupiter:junit-jupiter-engine](https://github.com/junit-team/junit5). Updates `org.junit.jupiter:junit-jupiter-engine` from 5.12.2 to 5.13.0 - [Release notes](https://github.com/junit-team/junit5/releases) - [Commits](https://github.com/junit-team/junit5/compare/r5.12.2...r5.13.0) --- updated-dependencies: - dependency-name: org.junit.jupiter:junit-jupiter-engine dependency-version: 5.13.0 dependency-type: direct:development update-type: version-update:semver-minor dependency-group: java-deps ... Signed-off-by: dependabot[bot] --- java-wasm/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java-wasm/pom.xml b/java-wasm/pom.xml index 69726a620f..b6935cfde6 100644 --- a/java-wasm/pom.xml +++ b/java-wasm/pom.xml @@ -16,7 +16,7 @@ 11 1.3.0 - 5.12.2 + 5.13.0 From a08f663d758ce46de1610dc67215c31191f34ad3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 3 Jun 2025 13:33:03 +0000 Subject: [PATCH 039/333] Bump the ruby-deps group across 10 directories with 2 updates Bumps the ruby-deps group with 1 update in the /gemfiles/2.7 directory: [rake](https://github.com/ruby/rake). Bumps the ruby-deps group with 1 update in the /gemfiles/3.0 directory: [rake](https://github.com/ruby/rake). Bumps the ruby-deps group with 1 update in the /gemfiles/3.1 directory: [rake](https://github.com/ruby/rake). Bumps the ruby-deps group with 1 update in the /gemfiles/3.2 directory: [rake](https://github.com/ruby/rake). Bumps the ruby-deps group with 1 update in the /gemfiles/3.3 directory: [rake](https://github.com/ruby/rake). Bumps the ruby-deps group with 1 update in the /gemfiles/3.4 directory: [rake](https://github.com/ruby/rake). Bumps the ruby-deps group with 1 update in the /gemfiles/3.5 directory: [rake](https://github.com/ruby/rake). Bumps the ruby-deps group with 1 update in the /gemfiles/jruby directory: [rake](https://github.com/ruby/rake). Bumps the ruby-deps group with 1 update in the /gemfiles/truffleruby directory: [rake](https://github.com/ruby/rake). Bumps the ruby-deps group with 2 updates in the /gemfiles/typecheck directory: [rake](https://github.com/ruby/rake) and [sorbet](https://github.com/sorbet/sorbet). Updates `rake` from 13.2.1 to 13.3.0 - [Release notes](https://github.com/ruby/rake/releases) - [Changelog](https://github.com/ruby/rake/blob/master/History.rdoc) - [Commits](https://github.com/ruby/rake/compare/v13.2.1...v13.3.0) Updates `rake` from 13.2.1 to 13.3.0 - [Release notes](https://github.com/ruby/rake/releases) - [Changelog](https://github.com/ruby/rake/blob/master/History.rdoc) - [Commits](https://github.com/ruby/rake/compare/v13.2.1...v13.3.0) Updates `rake` from 13.2.1 to 13.3.0 - [Release notes](https://github.com/ruby/rake/releases) - [Changelog](https://github.com/ruby/rake/blob/master/History.rdoc) - [Commits](https://github.com/ruby/rake/compare/v13.2.1...v13.3.0) Updates `rake` from 13.2.1 to 13.3.0 - [Release notes](https://github.com/ruby/rake/releases) - [Changelog](https://github.com/ruby/rake/blob/master/History.rdoc) - [Commits](https://github.com/ruby/rake/compare/v13.2.1...v13.3.0) Updates `rake` from 13.2.1 to 13.3.0 - [Release notes](https://github.com/ruby/rake/releases) - [Changelog](https://github.com/ruby/rake/blob/master/History.rdoc) - [Commits](https://github.com/ruby/rake/compare/v13.2.1...v13.3.0) Updates `rake` from 13.2.1 to 13.3.0 - [Release notes](https://github.com/ruby/rake/releases) - [Changelog](https://github.com/ruby/rake/blob/master/History.rdoc) - [Commits](https://github.com/ruby/rake/compare/v13.2.1...v13.3.0) Updates `rake` from 13.2.1 to 13.3.0 - [Release notes](https://github.com/ruby/rake/releases) - [Changelog](https://github.com/ruby/rake/blob/master/History.rdoc) - [Commits](https://github.com/ruby/rake/compare/v13.2.1...v13.3.0) Updates `rake` from 13.2.1 to 13.3.0 - [Release notes](https://github.com/ruby/rake/releases) - [Changelog](https://github.com/ruby/rake/blob/master/History.rdoc) - [Commits](https://github.com/ruby/rake/compare/v13.2.1...v13.3.0) Updates `rake` from 13.2.1 to 13.3.0 - [Release notes](https://github.com/ruby/rake/releases) - [Changelog](https://github.com/ruby/rake/blob/master/History.rdoc) - [Commits](https://github.com/ruby/rake/compare/v13.2.1...v13.3.0) Updates `rake` from 13.2.1 to 13.3.0 - [Release notes](https://github.com/ruby/rake/releases) - [Changelog](https://github.com/ruby/rake/blob/master/History.rdoc) - [Commits](https://github.com/ruby/rake/compare/v13.2.1...v13.3.0) Updates `rake` from 13.2.1 to 13.3.0 - [Release notes](https://github.com/ruby/rake/releases) - [Changelog](https://github.com/ruby/rake/blob/master/History.rdoc) - [Commits](https://github.com/ruby/rake/compare/v13.2.1...v13.3.0) Updates `rake` from 13.2.1 to 13.3.0 - [Release notes](https://github.com/ruby/rake/releases) - [Changelog](https://github.com/ruby/rake/blob/master/History.rdoc) - [Commits](https://github.com/ruby/rake/compare/v13.2.1...v13.3.0) Updates `rake` from 13.2.1 to 13.3.0 - [Release notes](https://github.com/ruby/rake/releases) - [Changelog](https://github.com/ruby/rake/blob/master/History.rdoc) - [Commits](https://github.com/ruby/rake/compare/v13.2.1...v13.3.0) Updates `rake` from 13.2.1 to 13.3.0 - [Release notes](https://github.com/ruby/rake/releases) - [Changelog](https://github.com/ruby/rake/blob/master/History.rdoc) - [Commits](https://github.com/ruby/rake/compare/v13.2.1...v13.3.0) Updates `rake` from 13.2.1 to 13.3.0 - [Release notes](https://github.com/ruby/rake/releases) - [Changelog](https://github.com/ruby/rake/blob/master/History.rdoc) - [Commits](https://github.com/ruby/rake/compare/v13.2.1...v13.3.0) Updates `rake` from 13.2.1 to 13.3.0 - [Release notes](https://github.com/ruby/rake/releases) - [Changelog](https://github.com/ruby/rake/blob/master/History.rdoc) - [Commits](https://github.com/ruby/rake/compare/v13.2.1...v13.3.0) Updates `rake` from 13.2.1 to 13.3.0 - [Release notes](https://github.com/ruby/rake/releases) - [Changelog](https://github.com/ruby/rake/blob/master/History.rdoc) - [Commits](https://github.com/ruby/rake/compare/v13.2.1...v13.3.0) Updates `rake` from 13.2.1 to 13.3.0 - [Release notes](https://github.com/ruby/rake/releases) - [Changelog](https://github.com/ruby/rake/blob/master/History.rdoc) - [Commits](https://github.com/ruby/rake/compare/v13.2.1...v13.3.0) Updates `rake` from 13.2.1 to 13.3.0 - [Release notes](https://github.com/ruby/rake/releases) - [Changelog](https://github.com/ruby/rake/blob/master/History.rdoc) - [Commits](https://github.com/ruby/rake/compare/v13.2.1...v13.3.0) Updates `rake` from 13.2.1 to 13.3.0 - [Release notes](https://github.com/ruby/rake/releases) - [Changelog](https://github.com/ruby/rake/blob/master/History.rdoc) - [Commits](https://github.com/ruby/rake/compare/v13.2.1...v13.3.0) Updates `rake` from 13.2.1 to 13.3.0 - [Release notes](https://github.com/ruby/rake/releases) - [Changelog](https://github.com/ruby/rake/blob/master/History.rdoc) - [Commits](https://github.com/ruby/rake/compare/v13.2.1...v13.3.0) Updates `rake` from 13.2.1 to 13.3.0 - [Release notes](https://github.com/ruby/rake/releases) - [Changelog](https://github.com/ruby/rake/blob/master/History.rdoc) - [Commits](https://github.com/ruby/rake/compare/v13.2.1...v13.3.0) Updates `rake` from 13.2.1 to 13.3.0 - [Release notes](https://github.com/ruby/rake/releases) - [Changelog](https://github.com/ruby/rake/blob/master/History.rdoc) - [Commits](https://github.com/ruby/rake/compare/v13.2.1...v13.3.0) Updates `rake` from 13.2.1 to 13.3.0 - [Release notes](https://github.com/ruby/rake/releases) - [Changelog](https://github.com/ruby/rake/blob/master/History.rdoc) - [Commits](https://github.com/ruby/rake/compare/v13.2.1...v13.3.0) Updates `rake` from 13.2.1 to 13.3.0 - [Release notes](https://github.com/ruby/rake/releases) - [Changelog](https://github.com/ruby/rake/blob/master/History.rdoc) - [Commits](https://github.com/ruby/rake/compare/v13.2.1...v13.3.0) Updates `rake` from 13.2.1 to 13.3.0 - [Release notes](https://github.com/ruby/rake/releases) - [Changelog](https://github.com/ruby/rake/blob/master/History.rdoc) - [Commits](https://github.com/ruby/rake/compare/v13.2.1...v13.3.0) Updates `rake` from 13.2.1 to 13.3.0 - [Release notes](https://github.com/ruby/rake/releases) - [Changelog](https://github.com/ruby/rake/blob/master/History.rdoc) - [Commits](https://github.com/ruby/rake/compare/v13.2.1...v13.3.0) Updates `rake` from 13.2.1 to 13.3.0 - [Release notes](https://github.com/ruby/rake/releases) - [Changelog](https://github.com/ruby/rake/blob/master/History.rdoc) - [Commits](https://github.com/ruby/rake/compare/v13.2.1...v13.3.0) Updates `rake` from 13.2.1 to 13.3.0 - [Release notes](https://github.com/ruby/rake/releases) - [Changelog](https://github.com/ruby/rake/blob/master/History.rdoc) - [Commits](https://github.com/ruby/rake/compare/v13.2.1...v13.3.0) Updates `rake` from 13.2.1 to 13.3.0 - [Release notes](https://github.com/ruby/rake/releases) - [Changelog](https://github.com/ruby/rake/blob/master/History.rdoc) - [Commits](https://github.com/ruby/rake/compare/v13.2.1...v13.3.0) Updates `rake` from 13.2.1 to 13.3.0 - [Release notes](https://github.com/ruby/rake/releases) - [Changelog](https://github.com/ruby/rake/blob/master/History.rdoc) - [Commits](https://github.com/ruby/rake/compare/v13.2.1...v13.3.0) Updates `rake` from 13.2.1 to 13.3.0 - [Release notes](https://github.com/ruby/rake/releases) - [Changelog](https://github.com/ruby/rake/blob/master/History.rdoc) - [Commits](https://github.com/ruby/rake/compare/v13.2.1...v13.3.0) Updates `rake` from 13.2.1 to 13.3.0 - [Release notes](https://github.com/ruby/rake/releases) - [Changelog](https://github.com/ruby/rake/blob/master/History.rdoc) - [Commits](https://github.com/ruby/rake/compare/v13.2.1...v13.3.0) Updates `rake` from 13.2.1 to 13.3.0 - [Release notes](https://github.com/ruby/rake/releases) - [Changelog](https://github.com/ruby/rake/blob/master/History.rdoc) - [Commits](https://github.com/ruby/rake/compare/v13.2.1...v13.3.0) Updates `rake` from 13.2.1 to 13.3.0 - [Release notes](https://github.com/ruby/rake/releases) - [Changelog](https://github.com/ruby/rake/blob/master/History.rdoc) - [Commits](https://github.com/ruby/rake/compare/v13.2.1...v13.3.0) Updates `rake` from 13.2.1 to 13.3.0 - [Release notes](https://github.com/ruby/rake/releases) - [Changelog](https://github.com/ruby/rake/blob/master/History.rdoc) - [Commits](https://github.com/ruby/rake/compare/v13.2.1...v13.3.0) Updates `rake` from 13.2.1 to 13.3.0 - [Release notes](https://github.com/ruby/rake/releases) - [Changelog](https://github.com/ruby/rake/blob/master/History.rdoc) - [Commits](https://github.com/ruby/rake/compare/v13.2.1...v13.3.0) Updates `rake` from 13.2.1 to 13.3.0 - [Release notes](https://github.com/ruby/rake/releases) - [Changelog](https://github.com/ruby/rake/blob/master/History.rdoc) - [Commits](https://github.com/ruby/rake/compare/v13.2.1...v13.3.0) Updates `rake` from 13.2.1 to 13.3.0 - [Release notes](https://github.com/ruby/rake/releases) - [Changelog](https://github.com/ruby/rake/blob/master/History.rdoc) - [Commits](https://github.com/ruby/rake/compare/v13.2.1...v13.3.0) Updates `rake` from 13.2.1 to 13.3.0 - [Release notes](https://github.com/ruby/rake/releases) - [Changelog](https://github.com/ruby/rake/blob/master/History.rdoc) - [Commits](https://github.com/ruby/rake/compare/v13.2.1...v13.3.0) Updates `rake` from 13.2.1 to 13.3.0 - [Release notes](https://github.com/ruby/rake/releases) - [Changelog](https://github.com/ruby/rake/blob/master/History.rdoc) - [Commits](https://github.com/ruby/rake/compare/v13.2.1...v13.3.0) Updates `rake` from 13.2.1 to 13.3.0 - [Release notes](https://github.com/ruby/rake/releases) - [Changelog](https://github.com/ruby/rake/blob/master/History.rdoc) - [Commits](https://github.com/ruby/rake/compare/v13.2.1...v13.3.0) Updates `rake` from 13.2.1 to 13.3.0 - [Release notes](https://github.com/ruby/rake/releases) - [Changelog](https://github.com/ruby/rake/blob/master/History.rdoc) - [Commits](https://github.com/ruby/rake/compare/v13.2.1...v13.3.0) Updates `rake` from 13.2.1 to 13.3.0 - [Release notes](https://github.com/ruby/rake/releases) - [Changelog](https://github.com/ruby/rake/blob/master/History.rdoc) - [Commits](https://github.com/ruby/rake/compare/v13.2.1...v13.3.0) Updates `rake` from 13.2.1 to 13.3.0 - [Release notes](https://github.com/ruby/rake/releases) - [Changelog](https://github.com/ruby/rake/blob/master/History.rdoc) - [Commits](https://github.com/ruby/rake/compare/v13.2.1...v13.3.0) Updates `rake` from 13.2.1 to 13.3.0 - [Release notes](https://github.com/ruby/rake/releases) - [Changelog](https://github.com/ruby/rake/blob/master/History.rdoc) - [Commits](https://github.com/ruby/rake/compare/v13.2.1...v13.3.0) Updates `rake` from 13.2.1 to 13.3.0 - [Release notes](https://github.com/ruby/rake/releases) - [Changelog](https://github.com/ruby/rake/blob/master/History.rdoc) - [Commits](https://github.com/ruby/rake/compare/v13.2.1...v13.3.0) Updates `rake` from 13.2.1 to 13.3.0 - [Release notes](https://github.com/ruby/rake/releases) - [Changelog](https://github.com/ruby/rake/blob/master/History.rdoc) - [Commits](https://github.com/ruby/rake/compare/v13.2.1...v13.3.0) Updates `rake` from 13.2.1 to 13.3.0 - [Release notes](https://github.com/ruby/rake/releases) - [Changelog](https://github.com/ruby/rake/blob/master/History.rdoc) - [Commits](https://github.com/ruby/rake/compare/v13.2.1...v13.3.0) Updates `rake` from 13.2.1 to 13.3.0 - [Release notes](https://github.com/ruby/rake/releases) - [Changelog](https://github.com/ruby/rake/blob/master/History.rdoc) - [Commits](https://github.com/ruby/rake/compare/v13.2.1...v13.3.0) Updates `rake` from 13.2.1 to 13.3.0 - [Release notes](https://github.com/ruby/rake/releases) - [Changelog](https://github.com/ruby/rake/blob/master/History.rdoc) - [Commits](https://github.com/ruby/rake/compare/v13.2.1...v13.3.0) Updates `rake` from 13.2.1 to 13.3.0 - [Release notes](https://github.com/ruby/rake/releases) - [Changelog](https://github.com/ruby/rake/blob/master/History.rdoc) - [Commits](https://github.com/ruby/rake/compare/v13.2.1...v13.3.0) Updates `rake` from 13.2.1 to 13.3.0 - [Release notes](https://github.com/ruby/rake/releases) - [Changelog](https://github.com/ruby/rake/blob/master/History.rdoc) - [Commits](https://github.com/ruby/rake/compare/v13.2.1...v13.3.0) Updates `rake` from 13.2.1 to 13.3.0 - [Release notes](https://github.com/ruby/rake/releases) - [Changelog](https://github.com/ruby/rake/blob/master/History.rdoc) - [Commits](https://github.com/ruby/rake/compare/v13.2.1...v13.3.0) Updates `rake` from 13.2.1 to 13.3.0 - [Release notes](https://github.com/ruby/rake/releases) - [Changelog](https://github.com/ruby/rake/blob/master/History.rdoc) - [Commits](https://github.com/ruby/rake/compare/v13.2.1...v13.3.0) Updates `rake` from 13.2.1 to 13.3.0 - [Release notes](https://github.com/ruby/rake/releases) - [Changelog](https://github.com/ruby/rake/blob/master/History.rdoc) - [Commits](https://github.com/ruby/rake/compare/v13.2.1...v13.3.0) Updates `rake` from 13.2.1 to 13.3.0 - [Release notes](https://github.com/ruby/rake/releases) - [Changelog](https://github.com/ruby/rake/blob/master/History.rdoc) - [Commits](https://github.com/ruby/rake/compare/v13.2.1...v13.3.0) Updates `rake` from 13.2.1 to 13.3.0 - [Release notes](https://github.com/ruby/rake/releases) - [Changelog](https://github.com/ruby/rake/blob/master/History.rdoc) - [Commits](https://github.com/ruby/rake/compare/v13.2.1...v13.3.0) Updates `rake` from 13.2.1 to 13.3.0 - [Release notes](https://github.com/ruby/rake/releases) - [Changelog](https://github.com/ruby/rake/blob/master/History.rdoc) - [Commits](https://github.com/ruby/rake/compare/v13.2.1...v13.3.0) Updates `rake` from 13.2.1 to 13.3.0 - [Release notes](https://github.com/ruby/rake/releases) - [Changelog](https://github.com/ruby/rake/blob/master/History.rdoc) - [Commits](https://github.com/ruby/rake/compare/v13.2.1...v13.3.0) Updates `rake` from 13.2.1 to 13.3.0 - [Release notes](https://github.com/ruby/rake/releases) - [Changelog](https://github.com/ruby/rake/blob/master/History.rdoc) - [Commits](https://github.com/ruby/rake/compare/v13.2.1...v13.3.0) Updates `rake` from 13.2.1 to 13.3.0 - [Release notes](https://github.com/ruby/rake/releases) - [Changelog](https://github.com/ruby/rake/blob/master/History.rdoc) - [Commits](https://github.com/ruby/rake/compare/v13.2.1...v13.3.0) Updates `rake` from 13.2.1 to 13.3.0 - [Release notes](https://github.com/ruby/rake/releases) - [Changelog](https://github.com/ruby/rake/blob/master/History.rdoc) - [Commits](https://github.com/ruby/rake/compare/v13.2.1...v13.3.0) Updates `rake` from 13.2.1 to 13.3.0 - [Release notes](https://github.com/ruby/rake/releases) - [Changelog](https://github.com/ruby/rake/blob/master/History.rdoc) - [Commits](https://github.com/ruby/rake/compare/v13.2.1...v13.3.0) Updates `rake` from 13.2.1 to 13.3.0 - [Release notes](https://github.com/ruby/rake/releases) - [Changelog](https://github.com/ruby/rake/blob/master/History.rdoc) - [Commits](https://github.com/ruby/rake/compare/v13.2.1...v13.3.0) Updates `rake` from 13.2.1 to 13.3.0 - [Release notes](https://github.com/ruby/rake/releases) - [Changelog](https://github.com/ruby/rake/blob/master/History.rdoc) - [Commits](https://github.com/ruby/rake/compare/v13.2.1...v13.3.0) Updates `rake` from 13.2.1 to 13.3.0 - [Release notes](https://github.com/ruby/rake/releases) - [Changelog](https://github.com/ruby/rake/blob/master/History.rdoc) - [Commits](https://github.com/ruby/rake/compare/v13.2.1...v13.3.0) Updates `rake` from 13.2.1 to 13.3.0 - [Release notes](https://github.com/ruby/rake/releases) - [Changelog](https://github.com/ruby/rake/blob/master/History.rdoc) - [Commits](https://github.com/ruby/rake/compare/v13.2.1...v13.3.0) Updates `rake` from 13.2.1 to 13.3.0 - [Release notes](https://github.com/ruby/rake/releases) - [Changelog](https://github.com/ruby/rake/blob/master/History.rdoc) - [Commits](https://github.com/ruby/rake/compare/v13.2.1...v13.3.0) Updates `rake` from 13.2.1 to 13.3.0 - [Release notes](https://github.com/ruby/rake/releases) - [Changelog](https://github.com/ruby/rake/blob/master/History.rdoc) - [Commits](https://github.com/ruby/rake/compare/v13.2.1...v13.3.0) Updates `rake` from 13.2.1 to 13.3.0 - [Release notes](https://github.com/ruby/rake/releases) - [Changelog](https://github.com/ruby/rake/blob/master/History.rdoc) - [Commits](https://github.com/ruby/rake/compare/v13.2.1...v13.3.0) Updates `rake` from 13.2.1 to 13.3.0 - [Release notes](https://github.com/ruby/rake/releases) - [Changelog](https://github.com/ruby/rake/blob/master/History.rdoc) - [Commits](https://github.com/ruby/rake/compare/v13.2.1...v13.3.0) Updates `rake` from 13.2.1 to 13.3.0 - [Release notes](https://github.com/ruby/rake/releases) - [Changelog](https://github.com/ruby/rake/blob/master/History.rdoc) - [Commits](https://github.com/ruby/rake/compare/v13.2.1...v13.3.0) Updates `rake` from 13.2.1 to 13.3.0 - [Release notes](https://github.com/ruby/rake/releases) - [Changelog](https://github.com/ruby/rake/blob/master/History.rdoc) - [Commits](https://github.com/ruby/rake/compare/v13.2.1...v13.3.0) Updates `rake` from 13.2.1 to 13.3.0 - [Release notes](https://github.com/ruby/rake/releases) - [Changelog](https://github.com/ruby/rake/blob/master/History.rdoc) - [Commits](https://github.com/ruby/rake/compare/v13.2.1...v13.3.0) Updates `rake` from 13.2.1 to 13.3.0 - [Release notes](https://github.com/ruby/rake/releases) - [Changelog](https://github.com/ruby/rake/blob/master/History.rdoc) - [Commits](https://github.com/ruby/rake/compare/v13.2.1...v13.3.0) Updates `rake` from 13.2.1 to 13.3.0 - [Release notes](https://github.com/ruby/rake/releases) - [Changelog](https://github.com/ruby/rake/blob/master/History.rdoc) - [Commits](https://github.com/ruby/rake/compare/v13.2.1...v13.3.0) Updates `rake` from 13.2.1 to 13.3.0 - [Release notes](https://github.com/ruby/rake/releases) - [Changelog](https://github.com/ruby/rake/blob/master/History.rdoc) - [Commits](https://github.com/ruby/rake/compare/v13.2.1...v13.3.0) Updates `rake` from 13.2.1 to 13.3.0 - [Release notes](https://github.com/ruby/rake/releases) - [Changelog](https://github.com/ruby/rake/blob/master/History.rdoc) - [Commits](https://github.com/ruby/rake/compare/v13.2.1...v13.3.0) Updates `rake` from 13.2.1 to 13.3.0 - [Release notes](https://github.com/ruby/rake/releases) - [Changelog](https://github.com/ruby/rake/blob/master/History.rdoc) - [Commits](https://github.com/ruby/rake/compare/v13.2.1...v13.3.0) Updates `rake` from 13.2.1 to 13.3.0 - [Release notes](https://github.com/ruby/rake/releases) - [Changelog](https://github.com/ruby/rake/blob/master/History.rdoc) - [Commits](https://github.com/ruby/rake/compare/v13.2.1...v13.3.0) Updates `rake` from 13.2.1 to 13.3.0 - [Release notes](https://github.com/ruby/rake/releases) - [Changelog](https://github.com/ruby/rake/blob/master/History.rdoc) - [Commits](https://github.com/ruby/rake/compare/v13.2.1...v13.3.0) Updates `rake` from 13.2.1 to 13.3.0 - [Release notes](https://github.com/ruby/rake/releases) - [Changelog](https://github.com/ruby/rake/blob/master/History.rdoc) - [Commits](https://github.com/ruby/rake/compare/v13.2.1...v13.3.0) Updates `rake` from 13.2.1 to 13.3.0 - [Release notes](https://github.com/ruby/rake/releases) - [Changelog](https://github.com/ruby/rake/blob/master/History.rdoc) - [Commits](https://github.com/ruby/rake/compare/v13.2.1...v13.3.0) Updates `rake` from 13.2.1 to 13.3.0 - [Release notes](https://github.com/ruby/rake/releases) - [Changelog](https://github.com/ruby/rake/blob/master/History.rdoc) - [Commits](https://github.com/ruby/rake/compare/v13.2.1...v13.3.0) Updates `rake` from 13.2.1 to 13.3.0 - [Release notes](https://github.com/ruby/rake/releases) - [Changelog](https://github.com/ruby/rake/blob/master/History.rdoc) - [Commits](https://github.com/ruby/rake/compare/v13.2.1...v13.3.0) Updates `rake` from 13.2.1 to 13.3.0 - [Release notes](https://github.com/ruby/rake/releases) - [Changelog](https://github.com/ruby/rake/blob/master/History.rdoc) - [Commits](https://github.com/ruby/rake/compare/v13.2.1...v13.3.0) Updates `rake` from 13.2.1 to 13.3.0 - [Release notes](https://github.com/ruby/rake/releases) - [Changelog](https://github.com/ruby/rake/blob/master/History.rdoc) - [Commits](https://github.com/ruby/rake/compare/v13.2.1...v13.3.0) Updates `rake` from 13.2.1 to 13.3.0 - [Release notes](https://github.com/ruby/rake/releases) - [Changelog](https://github.com/ruby/rake/blob/master/History.rdoc) - [Commits](https://github.com/ruby/rake/compare/v13.2.1...v13.3.0) Updates `rake` from 13.2.1 to 13.3.0 - [Release notes](https://github.com/ruby/rake/releases) - [Changelog](https://github.com/ruby/rake/blob/master/History.rdoc) - [Commits](https://github.com/ruby/rake/compare/v13.2.1...v13.3.0) Updates `rake` from 13.2.1 to 13.3.0 - [Release notes](https://github.com/ruby/rake/releases) - [Changelog](https://github.com/ruby/rake/blob/master/History.rdoc) - [Commits](https://github.com/ruby/rake/compare/v13.2.1...v13.3.0) Updates `rake` from 13.2.1 to 13.3.0 - [Release notes](https://github.com/ruby/rake/releases) - [Changelog](https://github.com/ruby/rake/blob/master/History.rdoc) - [Commits](https://github.com/ruby/rake/compare/v13.2.1...v13.3.0) Updates `rake` from 13.2.1 to 13.3.0 - [Release notes](https://github.com/ruby/rake/releases) - [Changelog](https://github.com/ruby/rake/blob/master/History.rdoc) - [Commits](https://github.com/ruby/rake/compare/v13.2.1...v13.3.0) Updates `rake` from 13.2.1 to 13.3.0 - [Release notes](https://github.com/ruby/rake/releases) - [Changelog](https://github.com/ruby/rake/blob/master/History.rdoc) - [Commits](https://github.com/ruby/rake/compare/v13.2.1...v13.3.0) Updates `rake` from 13.2.1 to 13.3.0 - [Release notes](https://github.com/ruby/rake/releases) - [Changelog](https://github.com/ruby/rake/blob/master/History.rdoc) - [Commits](https://github.com/ruby/rake/compare/v13.2.1...v13.3.0) Updates `rake` from 13.2.1 to 13.3.0 - [Release notes](https://github.com/ruby/rake/releases) - [Changelog](https://github.com/ruby/rake/blob/master/History.rdoc) - [Commits](https://github.com/ruby/rake/compare/v13.2.1...v13.3.0) Updates `rake` from 13.2.1 to 13.3.0 - [Release notes](https://github.com/ruby/rake/releases) - [Changelog](https://github.com/ruby/rake/blob/master/History.rdoc) - [Commits](https://github.com/ruby/rake/compare/v13.2.1...v13.3.0) Updates `rake` from 13.2.1 to 13.3.0 - [Release notes](https://github.com/ruby/rake/releases) - [Changelog](https://github.com/ruby/rake/blob/master/History.rdoc) - [Commits](https://github.com/ruby/rake/compare/v13.2.1...v13.3.0) Updates `rake` from 13.2.1 to 13.3.0 - [Release notes](https://github.com/ruby/rake/releases) - [Changelog](https://github.com/ruby/rake/blob/master/History.rdoc) - [Commits](https://github.com/ruby/rake/compare/v13.2.1...v13.3.0) Updates `rake` from 13.2.1 to 13.3.0 - [Release notes](https://github.com/ruby/rake/releases) - [Changelog](https://github.com/ruby/rake/blob/master/History.rdoc) - [Commits](https://github.com/ruby/rake/compare/v13.2.1...v13.3.0) Updates `sorbet` from 0.5.12130 to 0.5.12149 - [Release notes](https://github.com/sorbet/sorbet/releases) - [Commits](https://github.com/sorbet/sorbet/commits) --- updated-dependencies: - dependency-name: rake dependency-version: 13.3.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: rake dependency-version: 13.3.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: rake dependency-version: 13.3.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: rake dependency-version: 13.3.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: rake dependency-version: 13.3.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: rake dependency-version: 13.3.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: rake dependency-version: 13.3.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: rake dependency-version: 13.3.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: rake dependency-version: 13.3.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: rake dependency-version: 13.3.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: rake dependency-version: 13.3.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: rake dependency-version: 13.3.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: rake dependency-version: 13.3.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: rake dependency-version: 13.3.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: rake dependency-version: 13.3.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: rake dependency-version: 13.3.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: rake dependency-version: 13.3.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: rake dependency-version: 13.3.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: rake dependency-version: 13.3.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: rake dependency-version: 13.3.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: rake dependency-version: 13.3.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: rake dependency-version: 13.3.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: rake dependency-version: 13.3.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: rake dependency-version: 13.3.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: rake dependency-version: 13.3.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: rake dependency-version: 13.3.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: rake dependency-version: 13.3.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: rake dependency-version: 13.3.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: rake dependency-version: 13.3.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: rake dependency-version: 13.3.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: rake dependency-version: 13.3.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: rake dependency-version: 13.3.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: rake dependency-version: 13.3.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: rake dependency-version: 13.3.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: rake dependency-version: 13.3.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: rake dependency-version: 13.3.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: rake dependency-version: 13.3.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: rake dependency-version: 13.3.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: rake dependency-version: 13.3.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: rake dependency-version: 13.3.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: rake dependency-version: 13.3.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: rake dependency-version: 13.3.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: rake dependency-version: 13.3.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: rake dependency-version: 13.3.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: rake dependency-version: 13.3.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: rake dependency-version: 13.3.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: rake dependency-version: 13.3.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: rake dependency-version: 13.3.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: rake dependency-version: 13.3.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: rake dependency-version: 13.3.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: rake dependency-version: 13.3.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: rake dependency-version: 13.3.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: rake dependency-version: 13.3.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: rake dependency-version: 13.3.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: rake dependency-version: 13.3.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: rake dependency-version: 13.3.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: rake dependency-version: 13.3.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: rake dependency-version: 13.3.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: rake dependency-version: 13.3.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: rake dependency-version: 13.3.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: rake dependency-version: 13.3.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: rake dependency-version: 13.3.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: rake dependency-version: 13.3.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: rake dependency-version: 13.3.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: rake dependency-version: 13.3.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: rake dependency-version: 13.3.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: rake dependency-version: 13.3.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: rake dependency-version: 13.3.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: rake dependency-version: 13.3.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: rake dependency-version: 13.3.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: rake dependency-version: 13.3.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: rake dependency-version: 13.3.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: rake dependency-version: 13.3.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: rake dependency-version: 13.3.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: rake dependency-version: 13.3.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: rake dependency-version: 13.3.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: rake dependency-version: 13.3.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: rake dependency-version: 13.3.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: rake dependency-version: 13.3.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: rake dependency-version: 13.3.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: rake dependency-version: 13.3.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: rake dependency-version: 13.3.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: rake dependency-version: 13.3.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: rake dependency-version: 13.3.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: rake dependency-version: 13.3.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: rake dependency-version: 13.3.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: rake dependency-version: 13.3.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: rake dependency-version: 13.3.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: rake dependency-version: 13.3.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: rake dependency-version: 13.3.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: rake dependency-version: 13.3.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: rake dependency-version: 13.3.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: rake dependency-version: 13.3.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: rake dependency-version: 13.3.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: rake dependency-version: 13.3.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: rake dependency-version: 13.3.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: rake dependency-version: 13.3.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: rake dependency-version: 13.3.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: rake dependency-version: 13.3.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: rake dependency-version: 13.3.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: sorbet dependency-version: 0.5.12149 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps ... Signed-off-by: dependabot[bot] --- 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/3.5/Gemfile.lock | 2 +- gemfiles/jruby/Gemfile.lock | 2 +- gemfiles/truffleruby/Gemfile.lock | 2 +- gemfiles/typecheck/Gemfile.lock | 18 +++++++++--------- 10 files changed, 18 insertions(+), 18 deletions(-) diff --git a/gemfiles/2.7/Gemfile.lock b/gemfiles/2.7/Gemfile.lock index 418aec99d7..f527aca815 100644 --- a/gemfiles/2.7/Gemfile.lock +++ b/gemfiles/2.7/Gemfile.lock @@ -13,7 +13,7 @@ GEM racc power_assert (2.0.5) racc (1.8.1) - rake (13.2.1) + rake (13.3.0) rake-compiler (1.3.0) rake rbs (3.1.3) diff --git a/gemfiles/3.0/Gemfile.lock b/gemfiles/3.0/Gemfile.lock index 0a94cb01ea..0294295200 100644 --- a/gemfiles/3.0/Gemfile.lock +++ b/gemfiles/3.0/Gemfile.lock @@ -18,7 +18,7 @@ GEM racc power_assert (2.0.5) racc (1.8.1) - rake (13.2.1) + rake (13.3.0) rake-compiler (1.3.0) rake rbs (3.6.1) diff --git a/gemfiles/3.1/Gemfile.lock b/gemfiles/3.1/Gemfile.lock index 3e64a11b67..b9bab66fb9 100644 --- a/gemfiles/3.1/Gemfile.lock +++ b/gemfiles/3.1/Gemfile.lock @@ -18,7 +18,7 @@ GEM racc power_assert (2.0.5) racc (1.8.1) - rake (13.2.1) + rake (13.3.0) rake-compiler (1.3.0) rake rbs (3.9.4) diff --git a/gemfiles/3.2/Gemfile.lock b/gemfiles/3.2/Gemfile.lock index 5b36f779f1..44af3438ed 100644 --- a/gemfiles/3.2/Gemfile.lock +++ b/gemfiles/3.2/Gemfile.lock @@ -18,7 +18,7 @@ GEM racc power_assert (2.0.5) racc (1.8.1) - rake (13.2.1) + rake (13.3.0) rake-compiler (1.3.0) rake rbs (3.9.4) diff --git a/gemfiles/3.3/Gemfile.lock b/gemfiles/3.3/Gemfile.lock index a4979c023d..6a46058c22 100644 --- a/gemfiles/3.3/Gemfile.lock +++ b/gemfiles/3.3/Gemfile.lock @@ -18,7 +18,7 @@ GEM racc power_assert (2.0.5) racc (1.8.1) - rake (13.2.1) + rake (13.3.0) rake-compiler (1.3.0) rake rbs (3.9.4) diff --git a/gemfiles/3.4/Gemfile.lock b/gemfiles/3.4/Gemfile.lock index 3ed3ce7b51..13c9307f53 100644 --- a/gemfiles/3.4/Gemfile.lock +++ b/gemfiles/3.4/Gemfile.lock @@ -18,7 +18,7 @@ GEM racc power_assert (2.0.5) racc (1.8.1) - rake (13.2.1) + rake (13.3.0) rake-compiler (1.3.0) rake rbs (3.9.4) diff --git a/gemfiles/3.5/Gemfile.lock b/gemfiles/3.5/Gemfile.lock index 481c498928..d3da363978 100644 --- a/gemfiles/3.5/Gemfile.lock +++ b/gemfiles/3.5/Gemfile.lock @@ -19,7 +19,7 @@ GEM racc power_assert (2.0.5) racc (1.8.1) - rake (13.2.1) + rake (13.3.0) rake-compiler (1.3.0) rake rbs (3.9.4) diff --git a/gemfiles/jruby/Gemfile.lock b/gemfiles/jruby/Gemfile.lock index 91ca442677..ceefde1070 100644 --- a/gemfiles/jruby/Gemfile.lock +++ b/gemfiles/jruby/Gemfile.lock @@ -13,7 +13,7 @@ GEM power_assert (2.0.5) racc (1.8.1) racc (1.8.1-java) - rake (13.2.1) + rake (13.3.0) rake-compiler (1.3.0) rake test-unit (3.6.8) diff --git a/gemfiles/truffleruby/Gemfile.lock b/gemfiles/truffleruby/Gemfile.lock index 2a3b4f90f8..812e91dde2 100644 --- a/gemfiles/truffleruby/Gemfile.lock +++ b/gemfiles/truffleruby/Gemfile.lock @@ -12,7 +12,7 @@ GEM racc power_assert (2.0.5) racc (1.8.1) - rake (13.2.1) + rake (13.3.0) rake-compiler (1.3.0) rake test-unit (3.6.8) diff --git a/gemfiles/typecheck/Gemfile.lock b/gemfiles/typecheck/Gemfile.lock index 44f225a0c3..332f77bef5 100644 --- a/gemfiles/typecheck/Gemfile.lock +++ b/gemfiles/typecheck/Gemfile.lock @@ -45,7 +45,7 @@ GEM prism (1.4.0) racc (1.8.1) rainbow (3.1.1) - rake (13.2.1) + rake (13.3.0) rake-compiler (1.3.0) rake rb-fsevent (0.11.2) @@ -62,14 +62,14 @@ GEM sexp_processor (~> 4.16) securerandom (0.4.1) sexp_processor (4.17.3) - sorbet (0.5.12130) - sorbet-static (= 0.5.12130) - sorbet-runtime (0.5.12130) - sorbet-static (0.5.12130-universal-darwin) - sorbet-static (0.5.12130-x86_64-linux) - sorbet-static-and-runtime (0.5.12130) - sorbet (= 0.5.12130) - sorbet-runtime (= 0.5.12130) + sorbet (0.5.12149) + sorbet-static (= 0.5.12149) + sorbet-runtime (0.5.12149) + sorbet-static (0.5.12149-universal-darwin) + sorbet-static (0.5.12149-x86_64-linux) + sorbet-static-and-runtime (0.5.12149) + sorbet (= 0.5.12149) + sorbet-runtime (= 0.5.12149) spoom (1.6.1) erubi (>= 1.10.0) prism (>= 0.28.0) From 5aa963f8e6b7d357054fd4310c27349aafe6975b Mon Sep 17 00:00:00 2001 From: Tim Craft Date: Mon, 9 Jun 2025 10:41:29 +0100 Subject: [PATCH 040/333] Fix typo in visitor example code --- templates/lib/prism/visitor.rb.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/lib/prism/visitor.rb.erb b/templates/lib/prism/visitor.rb.erb index a1eac38dc4..b1a03c3f1a 100644 --- a/templates/lib/prism/visitor.rb.erb +++ b/templates/lib/prism/visitor.rb.erb @@ -34,7 +34,7 @@ module Prism # # class FooCalls < Prism::Visitor # def visit_call_node(node) - # if node.name == "foo" + # if node.name == :foo # # Do something with the node # end # From 52a3dbce0c66db571da6974bde0eaeee88ded129 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 9 Jun 2025 16:49:21 +0000 Subject: [PATCH 041/333] Bump the java-deps group in /java-wasm with 2 updates Bumps the java-deps group in /java-wasm with 2 updates: [org.junit.jupiter:junit-jupiter-engine](https://github.com/junit-team/junit5) and [org.codehaus.mojo:build-helper-maven-plugin](https://github.com/mojohaus/build-helper-maven-plugin). Updates `org.junit.jupiter:junit-jupiter-engine` from 5.13.0 to 5.13.1 - [Release notes](https://github.com/junit-team/junit5/releases) - [Commits](https://github.com/junit-team/junit5/compare/r5.13.0...r5.13.1) Updates `org.codehaus.mojo:build-helper-maven-plugin` from 3.6.0 to 3.6.1 - [Release notes](https://github.com/mojohaus/build-helper-maven-plugin/releases) - [Commits](https://github.com/mojohaus/build-helper-maven-plugin/compare/3.6.0...3.6.1) --- updated-dependencies: - dependency-name: org.junit.jupiter:junit-jupiter-engine dependency-version: 5.13.1 dependency-type: direct:development update-type: version-update:semver-patch dependency-group: java-deps - dependency-name: org.codehaus.mojo:build-helper-maven-plugin dependency-version: 3.6.1 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: java-deps ... Signed-off-by: dependabot[bot] --- java-wasm/pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/java-wasm/pom.xml b/java-wasm/pom.xml index b6935cfde6..e917ee1123 100644 --- a/java-wasm/pom.xml +++ b/java-wasm/pom.xml @@ -16,7 +16,7 @@ 11 1.3.0 - 5.13.0 + 5.13.1 @@ -99,7 +99,7 @@ org.codehaus.mojo build-helper-maven-plugin - 3.6.0 + 3.6.1 generate-sources From 84075dc53f90021009dccd4bca4a28cddf709594 Mon Sep 17 00:00:00 2001 From: Alexander Momchilov Date: Mon, 9 Jun 2025 12:51:57 -0400 Subject: [PATCH 042/333] Add `repl` command --- bin/prism | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/bin/prism b/bin/prism index 14878dee90..1817f453cb 100755 --- a/bin/prism +++ b/bin/prism @@ -20,6 +20,7 @@ module Prism when "parser" then parser(argv) when "ripper" then ripper(argv) when "rubyparser" then rubyparser(argv) + when "repl" then repl else puts <<~TXT Usage: @@ -35,6 +36,7 @@ module Prism bin/prism parser [source] bin/prism ripper [source] bin/prism rubyparser [source] + bin/prism repl TXT end end @@ -324,6 +326,25 @@ module Prism pp prism end + # bin/prism repl + def repl + loop do + print "Prism> " + + input = gets + break if input.nil? + + result = Prism.parse(input.chomp) + + statements_node = result.value.statements + statements = statements_node.body + + result.errors.each { |e| p(e) } + + p(statements.one? ? statements.first : statements) + end + end + ############################################################################ # Helpers ############################################################################ From 3418835be68e681b467ad61adf243470ea82d518 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 9 Jun 2025 17:03:44 +0000 Subject: [PATCH 043/333] Bump sorbet Bumps the ruby-deps group with 1 update in the /gemfiles/typecheck directory: [sorbet](https://github.com/sorbet/sorbet). Updates `sorbet` from 0.5.12149 to 0.5.12163 - [Release notes](https://github.com/sorbet/sorbet/releases) - [Commits](https://github.com/sorbet/sorbet/commits) --- updated-dependencies: - dependency-name: sorbet dependency-version: 0.5.12163 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps ... Signed-off-by: dependabot[bot] --- gemfiles/typecheck/Gemfile.lock | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/gemfiles/typecheck/Gemfile.lock b/gemfiles/typecheck/Gemfile.lock index 332f77bef5..b410ce54e4 100644 --- a/gemfiles/typecheck/Gemfile.lock +++ b/gemfiles/typecheck/Gemfile.lock @@ -62,14 +62,14 @@ GEM sexp_processor (~> 4.16) securerandom (0.4.1) sexp_processor (4.17.3) - sorbet (0.5.12149) - sorbet-static (= 0.5.12149) - sorbet-runtime (0.5.12149) - sorbet-static (0.5.12149-universal-darwin) - sorbet-static (0.5.12149-x86_64-linux) - sorbet-static-and-runtime (0.5.12149) - sorbet (= 0.5.12149) - sorbet-runtime (= 0.5.12149) + sorbet (0.5.12163) + sorbet-static (= 0.5.12163) + sorbet-runtime (0.5.12163) + sorbet-static (0.5.12163-universal-darwin) + sorbet-static (0.5.12163-x86_64-linux) + sorbet-static-and-runtime (0.5.12163) + sorbet (= 0.5.12163) + sorbet-runtime (= 0.5.12163) spoom (1.6.1) erubi (>= 1.10.0) prism (>= 0.28.0) From 7f3008b2b5fbb9ed40421afaefcbf0e2eb14ca0a Mon Sep 17 00:00:00 2001 From: Earlopain <14981592+Earlopain@users.noreply.github.com> Date: Wed, 11 Jun 2025 15:28:21 +0200 Subject: [PATCH 044/333] Fix parser translator during string escaping with invalid utf-8 Instead, prefer `scan_byte` over `get_byte` since that already returns the byte as an integer, sidestepping conversion issues. Fixes https://github.com/ruby/prism/issues/3582 --- Steepfile | 1 + lib/prism/polyfill/scan_byte.rb | 14 +++++ lib/prism/translation/parser/lexer.rb | 7 +-- prism.gemspec | 1 + snapshots/strings.txt | 74 ++++++++++++++++----------- test/prism/fixtures/strings.txt | 4 ++ 6 files changed, 67 insertions(+), 34 deletions(-) create mode 100644 lib/prism/polyfill/scan_byte.rb diff --git a/Steepfile b/Steepfile index f415408746..433e53cd29 100644 --- a/Steepfile +++ b/Steepfile @@ -16,5 +16,6 @@ target :lib do ignore "lib/prism/polyfill/append_as_bytes.rb" ignore "lib/prism/polyfill/byteindex.rb" + ignore "lib/prism/polyfill/scan_byte.rb" ignore "lib/prism/polyfill/unpack1.rb" end diff --git a/lib/prism/polyfill/scan_byte.rb b/lib/prism/polyfill/scan_byte.rb new file mode 100644 index 0000000000..2def4572c4 --- /dev/null +++ b/lib/prism/polyfill/scan_byte.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +require "strscan" + +# Polyfill for StringScanner#scan_byte, which didn't exist until Ruby 3.4. +if !(StringScanner.instance_methods.include?(:scan_byte)) + StringScanner.include( + Module.new { + def scan_byte # :nodoc: + get_byte&.b&.ord + end + } + ) +end diff --git a/lib/prism/translation/parser/lexer.rb b/lib/prism/translation/parser/lexer.rb index 349a0b257f..22ca3b6321 100644 --- a/lib/prism/translation/parser/lexer.rb +++ b/lib/prism/translation/parser/lexer.rb @@ -3,6 +3,7 @@ require "strscan" require_relative "../../polyfill/append_as_bytes" +require_relative "../../polyfill/scan_byte" module Prism module Translation @@ -762,12 +763,12 @@ def escape_read(result, scanner, control, meta) elsif (value = scanner.scan(/M-\\?(?=[[:print:]])/)) # \M-x where x is an ASCII printable character escape_read(result, scanner, control, true) - elsif (byte = scanner.get_byte) + elsif (byte = scanner.scan_byte) # Something else after an escape. - if control && byte == "?" + if control && byte == 0x3f # ASCII '?' result.append_as_bytes(escape_build(0x7f, false, meta)) else - result.append_as_bytes(escape_build(byte.ord, control, meta)) + result.append_as_bytes(escape_build(byte, control, meta)) end end end diff --git a/prism.gemspec b/prism.gemspec index 5cb5a98057..4daa511300 100644 --- a/prism.gemspec +++ b/prism.gemspec @@ -88,6 +88,7 @@ Gem::Specification.new do |spec| "lib/prism/pattern.rb", "lib/prism/polyfill/append_as_bytes.rb", "lib/prism/polyfill/byteindex.rb", + "lib/prism/polyfill/scan_byte.rb", "lib/prism/polyfill/unpack1.rb", "lib/prism/polyfill/warn.rb", "lib/prism/reflection.rb", diff --git a/snapshots/strings.txt b/snapshots/strings.txt index 6bf5006305..2ca8a6c9ed 100644 --- a/snapshots/strings.txt +++ b/snapshots/strings.txt @@ -1,10 +1,10 @@ -@ ProgramNode (location: (1,0)-(153,15)) +@ ProgramNode (location: (1,0)-(157,15)) ├── flags: ∅ ├── locals: [] └── statements: - @ StatementsNode (location: (1,0)-(153,15)) + @ StatementsNode (location: (1,0)-(157,15)) ├── flags: ∅ - └── body: (length: 65) + └── body: (length: 67) ├── @ StringNode (location: (1,0)-(1,6)) │ ├── flags: newline │ ├── opening_loc: (1,0)-(1,2) = "%%" @@ -757,56 +757,68 @@ │ ├── content_loc: (147,3)-(147,6) = "abc" │ ├── closing_loc: (147,6)-(147,7) = "}" │ └── unescaped: "abc" - ├── @ StringNode (location: (149,0)-(149,5)) - │ ├── flags: newline - │ ├── opening_loc: (149,0)-(149,2) = "%^" - │ ├── content_loc: (149,2)-(149,4) = "\#$" - │ ├── closing_loc: (149,4)-(149,5) = "^" + ├── @ StringNode (location: (149,0)-(149,7)) + │ ├── flags: newline + │ ├── opening_loc: (149,0)-(149,3) = "%Q(" + │ ├── content_loc: (149,3)-(149,6) = "\\«" + │ ├── closing_loc: (149,6)-(149,7) = ")" + │ └── unescaped: "«" + ├── @ StringNode (location: (151,0)-(151,7)) + │ ├── flags: newline + │ ├── opening_loc: (151,0)-(151,3) = "%q(" + │ ├── content_loc: (151,3)-(151,6) = "\\«" + │ ├── closing_loc: (151,6)-(151,7) = ")" + │ └── unescaped: "\\«" + ├── @ StringNode (location: (153,0)-(153,5)) + │ ├── flags: newline + │ ├── opening_loc: (153,0)-(153,2) = "%^" + │ ├── content_loc: (153,2)-(153,4) = "\#$" + │ ├── closing_loc: (153,4)-(153,5) = "^" │ └── unescaped: "\#$" - ├── @ StringNode (location: (151,0)-(151,4)) + ├── @ StringNode (location: (155,0)-(155,4)) │ ├── flags: newline - │ ├── opening_loc: (151,0)-(151,2) = "%@" - │ ├── content_loc: (151,2)-(151,3) = "#" - │ ├── closing_loc: (151,3)-(151,4) = "@" + │ ├── opening_loc: (155,0)-(155,2) = "%@" + │ ├── content_loc: (155,2)-(155,3) = "#" + │ ├── closing_loc: (155,3)-(155,4) = "@" │ └── unescaped: "#" - └── @ InterpolatedStringNode (location: (153,0)-(153,15)) + └── @ InterpolatedStringNode (location: (157,0)-(157,15)) ├── flags: newline - ├── opening_loc: (153,0)-(153,1) = "\"" + ├── opening_loc: (157,0)-(157,1) = "\"" ├── parts: (length: 2) - │ ├── @ EmbeddedStatementsNode (location: (153,1)-(153,12)) + │ ├── @ EmbeddedStatementsNode (location: (157,1)-(157,12)) │ │ ├── flags: ∅ - │ │ ├── opening_loc: (153,1)-(153,3) = "\#{" + │ │ ├── opening_loc: (157,1)-(157,3) = "\#{" │ │ ├── statements: - │ │ │ @ StatementsNode (location: (153,3)-(153,11)) + │ │ │ @ StatementsNode (location: (157,3)-(157,11)) │ │ │ ├── flags: ∅ │ │ │ └── body: (length: 1) - │ │ │ └── @ InterpolatedStringNode (location: (153,3)-(153,11)) + │ │ │ └── @ InterpolatedStringNode (location: (157,3)-(157,11)) │ │ │ ├── flags: ∅ - │ │ │ ├── opening_loc: (153,3)-(153,4) = "\"" + │ │ │ ├── opening_loc: (157,3)-(157,4) = "\"" │ │ │ ├── parts: (length: 2) - │ │ │ │ ├── @ EmbeddedStatementsNode (location: (153,4)-(153,8)) + │ │ │ │ ├── @ EmbeddedStatementsNode (location: (157,4)-(157,8)) │ │ │ │ │ ├── flags: ∅ - │ │ │ │ │ ├── opening_loc: (153,4)-(153,6) = "\#{" + │ │ │ │ │ ├── opening_loc: (157,4)-(157,6) = "\#{" │ │ │ │ │ ├── statements: - │ │ │ │ │ │ @ StatementsNode (location: (153,6)-(153,7)) + │ │ │ │ │ │ @ StatementsNode (location: (157,6)-(157,7)) │ │ │ │ │ │ ├── flags: ∅ │ │ │ │ │ │ └── body: (length: 1) - │ │ │ │ │ │ └── @ ConstantReadNode (location: (153,6)-(153,7)) + │ │ │ │ │ │ └── @ ConstantReadNode (location: (157,6)-(157,7)) │ │ │ │ │ │ ├── flags: ∅ │ │ │ │ │ │ └── name: :B - │ │ │ │ │ └── closing_loc: (153,7)-(153,8) = "}" - │ │ │ │ └── @ StringNode (location: (153,8)-(153,10)) + │ │ │ │ │ └── closing_loc: (157,7)-(157,8) = "}" + │ │ │ │ └── @ StringNode (location: (157,8)-(157,10)) │ │ │ │ ├── flags: static_literal, frozen │ │ │ │ ├── opening_loc: ∅ - │ │ │ │ ├── content_loc: (153,8)-(153,10) = " C" + │ │ │ │ ├── content_loc: (157,8)-(157,10) = " C" │ │ │ │ ├── closing_loc: ∅ │ │ │ │ └── unescaped: " C" - │ │ │ └── closing_loc: (153,10)-(153,11) = "\"" - │ │ └── closing_loc: (153,11)-(153,12) = "}" - │ └── @ StringNode (location: (153,12)-(153,14)) + │ │ │ └── closing_loc: (157,10)-(157,11) = "\"" + │ │ └── closing_loc: (157,11)-(157,12) = "}" + │ └── @ StringNode (location: (157,12)-(157,14)) │ ├── flags: static_literal, frozen │ ├── opening_loc: ∅ - │ ├── content_loc: (153,12)-(153,14) = " D" + │ ├── content_loc: (157,12)-(157,14) = " D" │ ├── closing_loc: ∅ │ └── unescaped: " D" - └── closing_loc: (153,14)-(153,15) = "\"" + └── closing_loc: (157,14)-(157,15) = "\"" diff --git a/test/prism/fixtures/strings.txt b/test/prism/fixtures/strings.txt index 0787152786..77e1e4acff 100644 --- a/test/prism/fixtures/strings.txt +++ b/test/prism/fixtures/strings.txt @@ -146,6 +146,10 @@ baz %Q{abc} +%Q(\«) + +%q(\«) + %^#$^# %@#@# From f5c7460ad5bc93ca9dcae83e7ef3354ba011a1b6 Mon Sep 17 00:00:00 2001 From: Earlopain <14981592+Earlopain@users.noreply.github.com> Date: Thu, 12 Jun 2025 14:12:40 +0200 Subject: [PATCH 045/333] Fix parser translator with trailing backslash in `%W` /`%I` array https://docs.ruby-lang.org/en/master/syntax/literals_rdoc.html#label-25w+and+-25W-3A+String-Array+Literals > %W allow escape sequences described in Escape Sequences. However the continuation line is not usable because it is interpreted as the escaped newline described above. --- lib/prism/translation/parser/lexer.rb | 7 +- snapshots/strings.txt | 440 +++++++++++++++++--------- test/prism/fixtures/strings.txt | 28 ++ 3 files changed, 324 insertions(+), 151 deletions(-) diff --git a/lib/prism/translation/parser/lexer.rb b/lib/prism/translation/parser/lexer.rb index 22ca3b6321..dd4867415c 100644 --- a/lib/prism/translation/parser/lexer.rb +++ b/lib/prism/translation/parser/lexer.rb @@ -425,7 +425,12 @@ def to_a end current_string << unescape_string(value, quote_stack.last) - if (backslash_count = token.value[/(\\{1,})\n/, 1]&.length).nil? || backslash_count.even? || !interpolation?(quote_stack.last) + relevant_backslash_count = if quote_stack.last.start_with?("%W", "%I") + 0 # the last backslash escapes the newline + else + token.value[/(\\{1,})\n/, 1]&.length || 0 + end + if relevant_backslash_count.even? || !interpolation?(quote_stack.last) tokens << [:tSTRING_CONTENT, [current_string, range(start_offset, start_offset + current_length)]] break end diff --git a/snapshots/strings.txt b/snapshots/strings.txt index 2ca8a6c9ed..bbaa66f53a 100644 --- a/snapshots/strings.txt +++ b/snapshots/strings.txt @@ -1,10 +1,10 @@ -@ ProgramNode (location: (1,0)-(157,15)) +@ ProgramNode (location: (1,0)-(185,15)) ├── flags: ∅ ├── locals: [] └── statements: - @ StatementsNode (location: (1,0)-(157,15)) + @ StatementsNode (location: (1,0)-(185,15)) ├── flags: ∅ - └── body: (length: 67) + └── body: (length: 71) ├── @ StringNode (location: (1,0)-(1,6)) │ ├── flags: newline │ ├── opening_loc: (1,0)-(1,2) = "%%" @@ -529,296 +529,436 @@ │ │ └── unescaped: "d" │ ├── opening_loc: (96,0)-(96,3) = "%w[" │ └── closing_loc: (100,0)-(100,1) = "]" - ├── @ ArrayNode (location: (102,0)-(102,18)) + ├── @ ArrayNode (location: (102,0)-(105,1)) + │ ├── flags: newline + │ ├── elements: (length: 3) + │ │ ├── @ StringNode (location: (103,2)-(103,10)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (103,2)-(103,10) = "foo\\nbar" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "foo\\nbar" + │ │ ├── @ StringNode (location: (103,11)-(104,0)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (103,11)-(104,0) = "baz\\n\\n\\\n" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "baz\\n\\n\n" + │ │ └── @ StringNode (location: (104,2)-(104,15)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: ∅ + │ │ ├── content_loc: (104,2)-(104,15) = "bat\\n\\\\\\n\\foo" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "bat\\n\\\\n\\foo" + │ ├── opening_loc: (102,0)-(102,3) = "%w[" + │ └── closing_loc: (105,0)-(105,1) = "]" + ├── @ ArrayNode (location: (107,0)-(110,1)) + │ ├── flags: newline + │ ├── elements: (length: 3) + │ │ ├── @ StringNode (location: (108,2)-(108,10)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (108,2)-(108,10) = "foo\\nbar" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "foo\nbar" + │ │ ├── @ StringNode (location: (108,11)-(109,0)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (108,11)-(109,0) = "baz\\n\\n\\\n" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "baz\n\n\n" + │ │ └── @ StringNode (location: (109,2)-(109,15)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: ∅ + │ │ ├── content_loc: (109,2)-(109,15) = "bat\\n\\\\\\n\\foo" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "bat\n\\\n\foo" + │ ├── opening_loc: (107,0)-(107,3) = "%W[" + │ └── closing_loc: (110,0)-(110,1) = "]" + ├── @ ArrayNode (location: (112,0)-(119,1)) + │ ├── flags: newline + │ ├── elements: (length: 7) + │ │ ├── @ StringNode (location: (112,3)-(113,0)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (112,3)-(113,0) = "foo\\\n" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "foo\n" + │ │ ├── @ StringNode (location: (113,2)-(113,5)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (113,2)-(113,5) = "bar" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "bar" + │ │ ├── @ StringNode (location: (114,2)-(114,7)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (114,2)-(114,7) = "baz\\\\" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "baz\\" + │ │ ├── @ StringNode (location: (115,2)-(115,5)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (115,2)-(115,5) = "bat" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "bat" + │ │ ├── @ StringNode (location: (116,2)-(116,5)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (116,2)-(116,5) = "1\\n" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "1\\n" + │ │ ├── @ StringNode (location: (117,2)-(117,3)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (117,2)-(117,3) = "2" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "2" + │ │ └── @ StringNode (location: (118,2)-(118,6)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: ∅ + │ │ ├── content_loc: (118,2)-(118,6) = "3\\\\n" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "3\\n" + │ ├── opening_loc: (112,0)-(112,3) = "%w[" + │ └── closing_loc: (119,0)-(119,1) = "]" + ├── @ ArrayNode (location: (121,0)-(128,1)) + │ ├── flags: newline + │ ├── elements: (length: 7) + │ │ ├── @ StringNode (location: (121,3)-(122,0)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (121,3)-(122,0) = "foo\\\n" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "foo\n" + │ │ ├── @ StringNode (location: (122,2)-(122,5)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (122,2)-(122,5) = "bar" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "bar" + │ │ ├── @ StringNode (location: (123,2)-(123,7)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (123,2)-(123,7) = "baz\\\\" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "baz\\" + │ │ ├── @ StringNode (location: (124,2)-(124,5)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (124,2)-(124,5) = "bat" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "bat" + │ │ ├── @ StringNode (location: (125,2)-(125,5)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (125,2)-(125,5) = "1\\n" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "1\n" + │ │ ├── @ StringNode (location: (126,2)-(126,3)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── content_loc: (126,2)-(126,3) = "2" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "2" + │ │ └── @ StringNode (location: (127,2)-(127,6)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: ∅ + │ │ ├── content_loc: (127,2)-(127,6) = "3\\\\n" + │ │ ├── closing_loc: ∅ + │ │ └── unescaped: "3\\n" + │ ├── opening_loc: (121,0)-(121,3) = "%W[" + │ └── closing_loc: (128,0)-(128,1) = "]" + ├── @ ArrayNode (location: (130,0)-(130,18)) │ ├── flags: newline │ ├── elements: (length: 1) - │ │ └── @ StringNode (location: (102,3)-(102,17)) + │ │ └── @ StringNode (location: (130,3)-(130,17)) │ │ ├── flags: ∅ │ │ ├── opening_loc: ∅ - │ │ ├── content_loc: (102,3)-(102,17) = "f\\u{006f 006f}" + │ │ ├── content_loc: (130,3)-(130,17) = "f\\u{006f 006f}" │ │ ├── closing_loc: ∅ │ │ └── unescaped: "foo" - │ ├── opening_loc: (102,0)-(102,3) = "%W[" - │ └── closing_loc: (102,17)-(102,18) = "]" - ├── @ ArrayNode (location: (104,0)-(104,14)) + │ ├── opening_loc: (130,0)-(130,3) = "%W[" + │ └── closing_loc: (130,17)-(130,18) = "]" + ├── @ ArrayNode (location: (132,0)-(132,14)) │ ├── flags: newline │ ├── elements: (length: 3) - │ │ ├── @ StringNode (location: (104,3)-(104,4)) + │ │ ├── @ StringNode (location: (132,3)-(132,4)) │ │ │ ├── flags: ∅ │ │ │ ├── opening_loc: ∅ - │ │ │ ├── content_loc: (104,3)-(104,4) = "a" + │ │ │ ├── content_loc: (132,3)-(132,4) = "a" │ │ │ ├── closing_loc: ∅ │ │ │ └── unescaped: "a" - │ │ ├── @ InterpolatedStringNode (location: (104,5)-(104,11)) + │ │ ├── @ InterpolatedStringNode (location: (132,5)-(132,11)) │ │ │ ├── flags: ∅ │ │ │ ├── opening_loc: ∅ │ │ │ ├── parts: (length: 3) - │ │ │ │ ├── @ StringNode (location: (104,5)-(104,6)) + │ │ │ │ ├── @ StringNode (location: (132,5)-(132,6)) │ │ │ │ │ ├── flags: static_literal, frozen │ │ │ │ │ ├── opening_loc: ∅ - │ │ │ │ │ ├── content_loc: (104,5)-(104,6) = "b" + │ │ │ │ │ ├── content_loc: (132,5)-(132,6) = "b" │ │ │ │ │ ├── closing_loc: ∅ │ │ │ │ │ └── unescaped: "b" - │ │ │ │ ├── @ EmbeddedStatementsNode (location: (104,6)-(104,10)) + │ │ │ │ ├── @ EmbeddedStatementsNode (location: (132,6)-(132,10)) │ │ │ │ │ ├── flags: ∅ - │ │ │ │ │ ├── opening_loc: (104,6)-(104,8) = "\#{" + │ │ │ │ │ ├── opening_loc: (132,6)-(132,8) = "\#{" │ │ │ │ │ ├── statements: - │ │ │ │ │ │ @ StatementsNode (location: (104,8)-(104,9)) + │ │ │ │ │ │ @ StatementsNode (location: (132,8)-(132,9)) │ │ │ │ │ │ ├── flags: ∅ │ │ │ │ │ │ └── body: (length: 1) - │ │ │ │ │ │ └── @ CallNode (location: (104,8)-(104,9)) + │ │ │ │ │ │ └── @ CallNode (location: (132,8)-(132,9)) │ │ │ │ │ │ ├── flags: variable_call, ignore_visibility │ │ │ │ │ │ ├── receiver: ∅ │ │ │ │ │ │ ├── call_operator_loc: ∅ │ │ │ │ │ │ ├── name: :c - │ │ │ │ │ │ ├── message_loc: (104,8)-(104,9) = "c" + │ │ │ │ │ │ ├── message_loc: (132,8)-(132,9) = "c" │ │ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ │ │ ├── arguments: ∅ │ │ │ │ │ │ ├── closing_loc: ∅ │ │ │ │ │ │ └── block: ∅ - │ │ │ │ │ └── closing_loc: (104,9)-(104,10) = "}" - │ │ │ │ └── @ StringNode (location: (104,10)-(104,11)) + │ │ │ │ │ └── closing_loc: (132,9)-(132,10) = "}" + │ │ │ │ └── @ StringNode (location: (132,10)-(132,11)) │ │ │ │ ├── flags: static_literal, frozen │ │ │ │ ├── opening_loc: ∅ - │ │ │ │ ├── content_loc: (104,10)-(104,11) = "d" + │ │ │ │ ├── content_loc: (132,10)-(132,11) = "d" │ │ │ │ ├── closing_loc: ∅ │ │ │ │ └── unescaped: "d" │ │ │ └── closing_loc: ∅ - │ │ └── @ StringNode (location: (104,12)-(104,13)) + │ │ └── @ StringNode (location: (132,12)-(132,13)) │ │ ├── flags: ∅ │ │ ├── opening_loc: ∅ - │ │ ├── content_loc: (104,12)-(104,13) = "e" + │ │ ├── content_loc: (132,12)-(132,13) = "e" │ │ ├── closing_loc: ∅ │ │ └── unescaped: "e" - │ ├── opening_loc: (104,0)-(104,3) = "%W[" - │ └── closing_loc: (104,13)-(104,14) = "]" - ├── @ ArrayNode (location: (106,0)-(106,9)) + │ ├── opening_loc: (132,0)-(132,3) = "%W[" + │ └── closing_loc: (132,13)-(132,14) = "]" + ├── @ ArrayNode (location: (134,0)-(134,9)) │ ├── flags: newline │ ├── elements: (length: 3) - │ │ ├── @ StringNode (location: (106,3)-(106,4)) + │ │ ├── @ StringNode (location: (134,3)-(134,4)) │ │ │ ├── flags: ∅ │ │ │ ├── opening_loc: ∅ - │ │ │ ├── content_loc: (106,3)-(106,4) = "a" + │ │ │ ├── content_loc: (134,3)-(134,4) = "a" │ │ │ ├── closing_loc: ∅ │ │ │ └── unescaped: "a" - │ │ ├── @ StringNode (location: (106,5)-(106,6)) + │ │ ├── @ StringNode (location: (134,5)-(134,6)) │ │ │ ├── flags: ∅ │ │ │ ├── opening_loc: ∅ - │ │ │ ├── content_loc: (106,5)-(106,6) = "b" + │ │ │ ├── content_loc: (134,5)-(134,6) = "b" │ │ │ ├── closing_loc: ∅ │ │ │ └── unescaped: "b" - │ │ └── @ StringNode (location: (106,7)-(106,8)) + │ │ └── @ StringNode (location: (134,7)-(134,8)) │ │ ├── flags: ∅ │ │ ├── opening_loc: ∅ - │ │ ├── content_loc: (106,7)-(106,8) = "c" + │ │ ├── content_loc: (134,7)-(134,8) = "c" │ │ ├── closing_loc: ∅ │ │ └── unescaped: "c" - │ ├── opening_loc: (106,0)-(106,3) = "%W[" - │ └── closing_loc: (106,8)-(106,9) = "]" - ├── @ ArrayNode (location: (108,0)-(112,1)) + │ ├── opening_loc: (134,0)-(134,3) = "%W[" + │ └── closing_loc: (134,8)-(134,9) = "]" + ├── @ ArrayNode (location: (136,0)-(140,1)) │ ├── flags: newline │ ├── elements: (length: 3) - │ │ ├── @ StringNode (location: (109,2)-(109,3)) + │ │ ├── @ StringNode (location: (137,2)-(137,3)) │ │ │ ├── flags: ∅ │ │ │ ├── opening_loc: ∅ - │ │ │ ├── content_loc: (109,2)-(109,3) = "a" + │ │ │ ├── content_loc: (137,2)-(137,3) = "a" │ │ │ ├── closing_loc: ∅ │ │ │ └── unescaped: "a" - │ │ ├── @ StringNode (location: (110,2)-(110,3)) + │ │ ├── @ StringNode (location: (138,2)-(138,3)) │ │ │ ├── flags: ∅ │ │ │ ├── opening_loc: ∅ - │ │ │ ├── content_loc: (110,2)-(110,3) = "b" + │ │ │ ├── content_loc: (138,2)-(138,3) = "b" │ │ │ ├── closing_loc: ∅ │ │ │ └── unescaped: "b" - │ │ └── @ StringNode (location: (111,2)-(111,3)) + │ │ └── @ StringNode (location: (139,2)-(139,3)) │ │ ├── flags: ∅ │ │ ├── opening_loc: ∅ - │ │ ├── content_loc: (111,2)-(111,3) = "c" + │ │ ├── content_loc: (139,2)-(139,3) = "c" │ │ ├── closing_loc: ∅ │ │ └── unescaped: "c" - │ ├── opening_loc: (108,0)-(108,3) = "%w[" - │ └── closing_loc: (112,0)-(112,1) = "]" - ├── @ StringNode (location: (114,0)-(114,15)) + │ ├── opening_loc: (136,0)-(136,3) = "%w[" + │ └── closing_loc: (140,0)-(140,1) = "]" + ├── @ StringNode (location: (142,0)-(142,15)) │ ├── flags: newline - │ ├── opening_loc: (114,0)-(114,1) = "'" - │ ├── content_loc: (114,1)-(114,14) = "\\' foo \\' bar" - │ ├── closing_loc: (114,14)-(114,15) = "'" + │ ├── opening_loc: (142,0)-(142,1) = "'" + │ ├── content_loc: (142,1)-(142,14) = "\\' foo \\' bar" + │ ├── closing_loc: (142,14)-(142,15) = "'" │ └── unescaped: "' foo ' bar" - ├── @ StringNode (location: (116,0)-(116,15)) + ├── @ StringNode (location: (144,0)-(144,15)) │ ├── flags: newline - │ ├── opening_loc: (116,0)-(116,1) = "'" - │ ├── content_loc: (116,1)-(116,14) = "\\\\ foo \\\\ bar" - │ ├── closing_loc: (116,14)-(116,15) = "'" + │ ├── opening_loc: (144,0)-(144,1) = "'" + │ ├── content_loc: (144,1)-(144,14) = "\\\\ foo \\\\ bar" + │ ├── closing_loc: (144,14)-(144,15) = "'" │ └── unescaped: "\\ foo \\ bar" - ├── @ StringNode (location: (118,0)-(121,1)) + ├── @ StringNode (location: (146,0)-(149,1)) │ ├── flags: newline - │ ├── opening_loc: (118,0)-(118,1) = "'" - │ ├── content_loc: (118,1)-(121,0) = "foo\\\nbar\\\\\nbaz\n" - │ ├── closing_loc: (121,0)-(121,1) = "'" + │ ├── opening_loc: (146,0)-(146,1) = "'" + │ ├── content_loc: (146,1)-(149,0) = "foo\\\nbar\\\\\nbaz\n" + │ ├── closing_loc: (149,0)-(149,1) = "'" │ └── unescaped: "foo\\\nbar\\\nbaz\n" - ├── @ InterpolatedStringNode (location: (123,0)-(123,7)) + ├── @ InterpolatedStringNode (location: (151,0)-(151,7)) │ ├── flags: newline - │ ├── opening_loc: (123,0)-(123,1) = "\"" + │ ├── opening_loc: (151,0)-(151,1) = "\"" │ ├── parts: (length: 1) - │ │ └── @ EmbeddedVariableNode (location: (123,1)-(123,6)) + │ │ └── @ EmbeddedVariableNode (location: (151,1)-(151,6)) │ │ ├── flags: ∅ - │ │ ├── operator_loc: (123,1)-(123,2) = "#" + │ │ ├── operator_loc: (151,1)-(151,2) = "#" │ │ └── variable: - │ │ @ GlobalVariableReadNode (location: (123,2)-(123,6)) + │ │ @ GlobalVariableReadNode (location: (151,2)-(151,6)) │ │ ├── flags: ∅ │ │ └── name: :$foo - │ └── closing_loc: (123,6)-(123,7) = "\"" - ├── @ InterpolatedStringNode (location: (125,0)-(125,7)) + │ └── closing_loc: (151,6)-(151,7) = "\"" + ├── @ InterpolatedStringNode (location: (153,0)-(153,7)) │ ├── flags: newline - │ ├── opening_loc: (125,0)-(125,1) = "\"" + │ ├── opening_loc: (153,0)-(153,1) = "\"" │ ├── parts: (length: 1) - │ │ └── @ EmbeddedVariableNode (location: (125,1)-(125,6)) + │ │ └── @ EmbeddedVariableNode (location: (153,1)-(153,6)) │ │ ├── flags: ∅ - │ │ ├── operator_loc: (125,1)-(125,2) = "#" + │ │ ├── operator_loc: (153,1)-(153,2) = "#" │ │ └── variable: - │ │ @ InstanceVariableReadNode (location: (125,2)-(125,6)) + │ │ @ InstanceVariableReadNode (location: (153,2)-(153,6)) │ │ ├── flags: ∅ │ │ └── name: :@foo - │ └── closing_loc: (125,6)-(125,7) = "\"" - ├── @ StringNode (location: (127,0)-(127,15)) + │ └── closing_loc: (153,6)-(153,7) = "\"" + ├── @ StringNode (location: (155,0)-(155,15)) │ ├── flags: newline - │ ├── opening_loc: (127,0)-(127,1) = "\"" - │ ├── content_loc: (127,1)-(127,14) = "\\x7 \\x23 \\x61" - │ ├── closing_loc: (127,14)-(127,15) = "\"" + │ ├── opening_loc: (155,0)-(155,1) = "\"" + │ ├── content_loc: (155,1)-(155,14) = "\\x7 \\x23 \\x61" + │ ├── closing_loc: (155,14)-(155,15) = "\"" │ └── unescaped: "\a # a" - ├── @ StringNode (location: (129,0)-(129,13)) + ├── @ StringNode (location: (157,0)-(157,13)) │ ├── flags: newline - │ ├── opening_loc: (129,0)-(129,1) = "\"" - │ ├── content_loc: (129,1)-(129,12) = "\\7 \\43 \\141" - │ ├── closing_loc: (129,12)-(129,13) = "\"" + │ ├── opening_loc: (157,0)-(157,1) = "\"" + │ ├── content_loc: (157,1)-(157,12) = "\\7 \\43 \\141" + │ ├── closing_loc: (157,12)-(157,13) = "\"" │ └── unescaped: "\a # a" - ├── @ StringNode (location: (131,0)-(131,17)) + ├── @ StringNode (location: (159,0)-(159,17)) │ ├── flags: newline, forced_utf8_encoding - │ ├── opening_loc: (131,0)-(131,1) = "\"" - │ ├── content_loc: (131,1)-(131,16) = "ち\\xE3\\x81\\xFF" - │ ├── closing_loc: (131,16)-(131,17) = "\"" + │ ├── opening_loc: (159,0)-(159,1) = "\"" + │ ├── content_loc: (159,1)-(159,16) = "ち\\xE3\\x81\\xFF" + │ ├── closing_loc: (159,16)-(159,17) = "\"" │ └── unescaped: "ち\xE3\x81\xFF" - ├── @ StringNode (location: (133,0)-(133,6)) + ├── @ StringNode (location: (161,0)-(161,6)) │ ├── flags: newline, forced_utf8_encoding - │ ├── opening_loc: (133,0)-(133,1) = "\"" - │ ├── content_loc: (133,1)-(133,5) = "\\777" - │ ├── closing_loc: (133,5)-(133,6) = "\"" + │ ├── opening_loc: (161,0)-(161,1) = "\"" + │ ├── content_loc: (161,1)-(161,5) = "\\777" + │ ├── closing_loc: (161,5)-(161,6) = "\"" │ └── unescaped: "\xFF" - ├── @ StringNode (location: (135,0)-(135,6)) + ├── @ StringNode (location: (163,0)-(163,6)) │ ├── flags: newline - │ ├── opening_loc: (135,0)-(135,2) = "%[" - │ ├── content_loc: (135,2)-(135,5) = "abc" - │ ├── closing_loc: (135,5)-(135,6) = "]" + │ ├── opening_loc: (163,0)-(163,2) = "%[" + │ ├── content_loc: (163,2)-(163,5) = "abc" + │ ├── closing_loc: (163,5)-(163,6) = "]" │ └── unescaped: "abc" - ├── @ StringNode (location: (137,0)-(137,6)) + ├── @ StringNode (location: (165,0)-(165,6)) │ ├── flags: newline - │ ├── opening_loc: (137,0)-(137,2) = "%(" - │ ├── content_loc: (137,2)-(137,5) = "abc" - │ ├── closing_loc: (137,5)-(137,6) = ")" + │ ├── opening_loc: (165,0)-(165,2) = "%(" + │ ├── content_loc: (165,2)-(165,5) = "abc" + │ ├── closing_loc: (165,5)-(165,6) = ")" │ └── unescaped: "abc" - ├── @ StringNode (location: (139,0)-(139,6)) + ├── @ StringNode (location: (167,0)-(167,6)) │ ├── flags: newline - │ ├── opening_loc: (139,0)-(139,2) = "%@" - │ ├── content_loc: (139,2)-(139,5) = "abc" - │ ├── closing_loc: (139,5)-(139,6) = "@" + │ ├── opening_loc: (167,0)-(167,2) = "%@" + │ ├── content_loc: (167,2)-(167,5) = "abc" + │ ├── closing_loc: (167,5)-(167,6) = "@" │ └── unescaped: "abc" - ├── @ StringNode (location: (141,0)-(141,6)) + ├── @ StringNode (location: (169,0)-(169,6)) │ ├── flags: newline - │ ├── opening_loc: (141,0)-(141,2) = "%$" - │ ├── content_loc: (141,2)-(141,5) = "abc" - │ ├── closing_loc: (141,5)-(141,6) = "$" + │ ├── opening_loc: (169,0)-(169,2) = "%$" + │ ├── content_loc: (169,2)-(169,5) = "abc" + │ ├── closing_loc: (169,5)-(169,6) = "$" │ └── unescaped: "abc" - ├── @ StringNode (location: (143,0)-(143,2)) + ├── @ StringNode (location: (171,0)-(171,2)) │ ├── flags: newline - │ ├── opening_loc: (143,0)-(143,1) = "?" - │ ├── content_loc: (143,1)-(143,2) = "a" + │ ├── opening_loc: (171,0)-(171,1) = "?" + │ ├── content_loc: (171,1)-(171,2) = "a" │ ├── closing_loc: ∅ │ └── unescaped: "a" - ├── @ InterpolatedStringNode (location: (145,0)-(145,6)) + ├── @ InterpolatedStringNode (location: (173,0)-(173,6)) │ ├── flags: newline, static_literal │ ├── opening_loc: ∅ │ ├── parts: (length: 2) - │ │ ├── @ StringNode (location: (145,0)-(145,2)) + │ │ ├── @ StringNode (location: (173,0)-(173,2)) │ │ │ ├── flags: static_literal, frozen - │ │ │ ├── opening_loc: (145,0)-(145,1) = "?" - │ │ │ ├── content_loc: (145,1)-(145,2) = "a" + │ │ │ ├── opening_loc: (173,0)-(173,1) = "?" + │ │ │ ├── content_loc: (173,1)-(173,2) = "a" │ │ │ ├── closing_loc: ∅ │ │ │ └── unescaped: "a" - │ │ └── @ StringNode (location: (145,3)-(145,6)) + │ │ └── @ StringNode (location: (173,3)-(173,6)) │ │ ├── flags: static_literal, frozen - │ │ ├── opening_loc: (145,3)-(145,4) = "\"" - │ │ ├── content_loc: (145,4)-(145,5) = "a" - │ │ ├── closing_loc: (145,5)-(145,6) = "\"" + │ │ ├── opening_loc: (173,3)-(173,4) = "\"" + │ │ ├── content_loc: (173,4)-(173,5) = "a" + │ │ ├── closing_loc: (173,5)-(173,6) = "\"" │ │ └── unescaped: "a" │ └── closing_loc: ∅ - ├── @ StringNode (location: (147,0)-(147,7)) + ├── @ StringNode (location: (175,0)-(175,7)) │ ├── flags: newline - │ ├── opening_loc: (147,0)-(147,3) = "%Q{" - │ ├── content_loc: (147,3)-(147,6) = "abc" - │ ├── closing_loc: (147,6)-(147,7) = "}" + │ ├── opening_loc: (175,0)-(175,3) = "%Q{" + │ ├── content_loc: (175,3)-(175,6) = "abc" + │ ├── closing_loc: (175,6)-(175,7) = "}" │ └── unescaped: "abc" - ├── @ StringNode (location: (149,0)-(149,7)) + ├── @ StringNode (location: (177,0)-(177,7)) │ ├── flags: newline - │ ├── opening_loc: (149,0)-(149,3) = "%Q(" - │ ├── content_loc: (149,3)-(149,6) = "\\«" - │ ├── closing_loc: (149,6)-(149,7) = ")" + │ ├── opening_loc: (177,0)-(177,3) = "%Q(" + │ ├── content_loc: (177,3)-(177,6) = "\\«" + │ ├── closing_loc: (177,6)-(177,7) = ")" │ └── unescaped: "«" - ├── @ StringNode (location: (151,0)-(151,7)) + ├── @ StringNode (location: (179,0)-(179,7)) │ ├── flags: newline - │ ├── opening_loc: (151,0)-(151,3) = "%q(" - │ ├── content_loc: (151,3)-(151,6) = "\\«" - │ ├── closing_loc: (151,6)-(151,7) = ")" + │ ├── opening_loc: (179,0)-(179,3) = "%q(" + │ ├── content_loc: (179,3)-(179,6) = "\\«" + │ ├── closing_loc: (179,6)-(179,7) = ")" │ └── unescaped: "\\«" - ├── @ StringNode (location: (153,0)-(153,5)) + ├── @ StringNode (location: (181,0)-(181,5)) │ ├── flags: newline - │ ├── opening_loc: (153,0)-(153,2) = "%^" - │ ├── content_loc: (153,2)-(153,4) = "\#$" - │ ├── closing_loc: (153,4)-(153,5) = "^" + │ ├── opening_loc: (181,0)-(181,2) = "%^" + │ ├── content_loc: (181,2)-(181,4) = "\#$" + │ ├── closing_loc: (181,4)-(181,5) = "^" │ └── unescaped: "\#$" - ├── @ StringNode (location: (155,0)-(155,4)) + ├── @ StringNode (location: (183,0)-(183,4)) │ ├── flags: newline - │ ├── opening_loc: (155,0)-(155,2) = "%@" - │ ├── content_loc: (155,2)-(155,3) = "#" - │ ├── closing_loc: (155,3)-(155,4) = "@" + │ ├── opening_loc: (183,0)-(183,2) = "%@" + │ ├── content_loc: (183,2)-(183,3) = "#" + │ ├── closing_loc: (183,3)-(183,4) = "@" │ └── unescaped: "#" - └── @ InterpolatedStringNode (location: (157,0)-(157,15)) + └── @ InterpolatedStringNode (location: (185,0)-(185,15)) ├── flags: newline - ├── opening_loc: (157,0)-(157,1) = "\"" + ├── opening_loc: (185,0)-(185,1) = "\"" ├── parts: (length: 2) - │ ├── @ EmbeddedStatementsNode (location: (157,1)-(157,12)) + │ ├── @ EmbeddedStatementsNode (location: (185,1)-(185,12)) │ │ ├── flags: ∅ - │ │ ├── opening_loc: (157,1)-(157,3) = "\#{" + │ │ ├── opening_loc: (185,1)-(185,3) = "\#{" │ │ ├── statements: - │ │ │ @ StatementsNode (location: (157,3)-(157,11)) + │ │ │ @ StatementsNode (location: (185,3)-(185,11)) │ │ │ ├── flags: ∅ │ │ │ └── body: (length: 1) - │ │ │ └── @ InterpolatedStringNode (location: (157,3)-(157,11)) + │ │ │ └── @ InterpolatedStringNode (location: (185,3)-(185,11)) │ │ │ ├── flags: ∅ - │ │ │ ├── opening_loc: (157,3)-(157,4) = "\"" + │ │ │ ├── opening_loc: (185,3)-(185,4) = "\"" │ │ │ ├── parts: (length: 2) - │ │ │ │ ├── @ EmbeddedStatementsNode (location: (157,4)-(157,8)) + │ │ │ │ ├── @ EmbeddedStatementsNode (location: (185,4)-(185,8)) │ │ │ │ │ ├── flags: ∅ - │ │ │ │ │ ├── opening_loc: (157,4)-(157,6) = "\#{" + │ │ │ │ │ ├── opening_loc: (185,4)-(185,6) = "\#{" │ │ │ │ │ ├── statements: - │ │ │ │ │ │ @ StatementsNode (location: (157,6)-(157,7)) + │ │ │ │ │ │ @ StatementsNode (location: (185,6)-(185,7)) │ │ │ │ │ │ ├── flags: ∅ │ │ │ │ │ │ └── body: (length: 1) - │ │ │ │ │ │ └── @ ConstantReadNode (location: (157,6)-(157,7)) + │ │ │ │ │ │ └── @ ConstantReadNode (location: (185,6)-(185,7)) │ │ │ │ │ │ ├── flags: ∅ │ │ │ │ │ │ └── name: :B - │ │ │ │ │ └── closing_loc: (157,7)-(157,8) = "}" - │ │ │ │ └── @ StringNode (location: (157,8)-(157,10)) + │ │ │ │ │ └── closing_loc: (185,7)-(185,8) = "}" + │ │ │ │ └── @ StringNode (location: (185,8)-(185,10)) │ │ │ │ ├── flags: static_literal, frozen │ │ │ │ ├── opening_loc: ∅ - │ │ │ │ ├── content_loc: (157,8)-(157,10) = " C" + │ │ │ │ ├── content_loc: (185,8)-(185,10) = " C" │ │ │ │ ├── closing_loc: ∅ │ │ │ │ └── unescaped: " C" - │ │ │ └── closing_loc: (157,10)-(157,11) = "\"" - │ │ └── closing_loc: (157,11)-(157,12) = "}" - │ └── @ StringNode (location: (157,12)-(157,14)) + │ │ │ └── closing_loc: (185,10)-(185,11) = "\"" + │ │ └── closing_loc: (185,11)-(185,12) = "}" + │ └── @ StringNode (location: (185,12)-(185,14)) │ ├── flags: static_literal, frozen │ ├── opening_loc: ∅ - │ ├── content_loc: (157,12)-(157,14) = " D" + │ ├── content_loc: (185,12)-(185,14) = " D" │ ├── closing_loc: ∅ │ └── unescaped: " D" - └── closing_loc: (157,14)-(157,15) = "\"" + └── closing_loc: (185,14)-(185,15) = "\"" diff --git a/test/prism/fixtures/strings.txt b/test/prism/fixtures/strings.txt index 77e1e4acff..1419f975b7 100644 --- a/test/prism/fixtures/strings.txt +++ b/test/prism/fixtures/strings.txt @@ -99,6 +99,34 @@ bar) d ] +%w[ + foo\nbar baz\n\n\ + bat\n\\\n\foo +] + +%W[ + foo\nbar baz\n\n\ + bat\n\\\n\foo +] + +%w[foo\ + bar + baz\\ + bat + 1\n + 2 + 3\\n +] + +%W[foo\ + bar + baz\\ + bat + 1\n + 2 + 3\\n +] + %W[f\u{006f 006f}] %W[a b#{c}d e] From 5671172661d94f1f4ef74d6b679cb40749ad7bed Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 16 Jun 2025 17:37:14 +0000 Subject: [PATCH 046/333] Bump sorbet Bumps the ruby-deps group with 1 update in the /gemfiles/typecheck directory: [sorbet](https://github.com/sorbet/sorbet). Updates `sorbet` from 0.5.12163 to 0.5.12176 - [Release notes](https://github.com/sorbet/sorbet/releases) - [Commits](https://github.com/sorbet/sorbet/commits) --- updated-dependencies: - dependency-name: sorbet dependency-version: 0.5.12176 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps ... Signed-off-by: dependabot[bot] --- gemfiles/typecheck/Gemfile.lock | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/gemfiles/typecheck/Gemfile.lock b/gemfiles/typecheck/Gemfile.lock index b410ce54e4..80ae53e947 100644 --- a/gemfiles/typecheck/Gemfile.lock +++ b/gemfiles/typecheck/Gemfile.lock @@ -62,14 +62,14 @@ GEM sexp_processor (~> 4.16) securerandom (0.4.1) sexp_processor (4.17.3) - sorbet (0.5.12163) - sorbet-static (= 0.5.12163) - sorbet-runtime (0.5.12163) - sorbet-static (0.5.12163-universal-darwin) - sorbet-static (0.5.12163-x86_64-linux) - sorbet-static-and-runtime (0.5.12163) - sorbet (= 0.5.12163) - sorbet-runtime (= 0.5.12163) + sorbet (0.5.12176) + sorbet-static (= 0.5.12176) + sorbet-runtime (0.5.12176) + sorbet-static (0.5.12176-universal-darwin) + sorbet-static (0.5.12176-x86_64-linux) + sorbet-static-and-runtime (0.5.12176) + sorbet (= 0.5.12176) + sorbet-runtime (= 0.5.12176) spoom (1.6.1) erubi (>= 1.10.0) prism (>= 0.28.0) From e13d4f19db30eec4dc77daed21f52d2c73da081d Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Tue, 17 Jun 2025 19:23:41 +0900 Subject: [PATCH 047/333] [DOC] Fix a typo in comment ruby/ruby#13636 Co-Authored-By: Tim Smith --- test/prism/lex_test.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/prism/lex_test.rb b/test/prism/lex_test.rb index 2786c45a22..d34c3d9dd3 100644 --- a/test/prism/lex_test.rb +++ b/test/prism/lex_test.rb @@ -17,7 +17,7 @@ class LexTest < TestCase "spanning_heredoc.txt", "spanning_heredoc_newlines.txt", # Prism emits a single :on_tstring_content in <<- style heredocs when there - # is a line continuation preceeded by escaped backslashes. It should emit two, same + # is a line continuation preceded by escaped backslashes. It should emit two, same # as if the backslashes are not present. "heredocs_with_fake_newlines.txt", ] From e23292120ee6a2e1c26b141c9fc5d82705ad578a Mon Sep 17 00:00:00 2001 From: Dmitry Dygalo Date: Sat, 21 Jun 2025 20:54:16 +0200 Subject: [PATCH 048/333] fix: sigsegv on malformed shebang Signed-off-by: Dmitry Dygalo --- rust/ruby-prism/src/lib.rs | 8 ++++++++ src/prism.c | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/rust/ruby-prism/src/lib.rs b/rust/ruby-prism/src/lib.rs index 868a4cd5c0..22054de8ba 100644 --- a/rust/ruby-prism/src/lib.rs +++ b/rust/ruby-prism/src/lib.rs @@ -1238,4 +1238,12 @@ end extractor.push_scope(node.as_program_node().unwrap().statements().body().iter().next().unwrap()); assert_eq!(3, extractor.scopes.len()); } + + #[test] + fn malformed_shebang() { + let source = "#!\x00"; + let result = parse(source.as_ref()); + assert!(result.errors().next().is_none()); + assert!(result.warnings().next().is_none()); + } } diff --git a/src/prism.c b/src/prism.c index c42a62f528..c5f5744f58 100644 --- a/src/prism.c +++ b/src/prism.c @@ -22663,7 +22663,7 @@ pm_parser_init(pm_parser_t *parser, const uint8_t *source, size_t size, const pm } search_shebang = false; - } else if (options->main_script && !parser->parsing_eval) { + } else if (options != NULL && options->main_script && !parser->parsing_eval) { search_shebang = true; } } From 49e2470fa211ef665c8f5e7e799e7664f433e300 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 23 Jun 2025 19:13:45 +0000 Subject: [PATCH 049/333] Bump sorbet Bumps the ruby-deps group with 1 update in the /gemfiles/typecheck directory: [sorbet](https://github.com/sorbet/sorbet). Updates `sorbet` from 0.5.12176 to 0.5.12200 - [Release notes](https://github.com/sorbet/sorbet/releases) - [Commits](https://github.com/sorbet/sorbet/commits) --- updated-dependencies: - dependency-name: sorbet dependency-version: 0.5.12200 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps ... Signed-off-by: dependabot[bot] --- gemfiles/typecheck/Gemfile.lock | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/gemfiles/typecheck/Gemfile.lock b/gemfiles/typecheck/Gemfile.lock index 80ae53e947..166e29449a 100644 --- a/gemfiles/typecheck/Gemfile.lock +++ b/gemfiles/typecheck/Gemfile.lock @@ -62,14 +62,14 @@ GEM sexp_processor (~> 4.16) securerandom (0.4.1) sexp_processor (4.17.3) - sorbet (0.5.12176) - sorbet-static (= 0.5.12176) - sorbet-runtime (0.5.12176) - sorbet-static (0.5.12176-universal-darwin) - sorbet-static (0.5.12176-x86_64-linux) - sorbet-static-and-runtime (0.5.12176) - sorbet (= 0.5.12176) - sorbet-runtime (= 0.5.12176) + sorbet (0.5.12200) + sorbet-static (= 0.5.12200) + sorbet-runtime (0.5.12200) + sorbet-static (0.5.12200-universal-darwin) + sorbet-static (0.5.12200-x86_64-linux) + sorbet-static-and-runtime (0.5.12200) + sorbet (= 0.5.12200) + sorbet-runtime (= 0.5.12200) spoom (1.6.1) erubi (>= 1.10.0) prism (>= 0.28.0) From e13c469d2ed1117cac58f29ab2a8b6807c7345d9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 24 Jun 2025 20:20:03 +0000 Subject: [PATCH 050/333] Bump nokogiri from 1.18.5 to 1.18.8 in /gemfiles/3.3 Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.18.5 to 1.18.8. - [Release notes](https://github.com/sparklemotion/nokogiri/releases) - [Changelog](https://github.com/sparklemotion/nokogiri/blob/main/CHANGELOG.md) - [Commits](https://github.com/sparklemotion/nokogiri/compare/v1.18.5...v1.18.8) --- updated-dependencies: - dependency-name: nokogiri dependency-version: 1.18.8 dependency-type: indirect ... Signed-off-by: dependabot[bot] --- gemfiles/3.3/Gemfile.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gemfiles/3.3/Gemfile.lock b/gemfiles/3.3/Gemfile.lock index 6a46058c22..35350a1919 100644 --- a/gemfiles/3.3/Gemfile.lock +++ b/gemfiles/3.3/Gemfile.lock @@ -8,8 +8,8 @@ GEM specs: ast (2.4.3) logger (1.7.0) - mini_portile2 (2.8.8) - nokogiri (1.18.5) + mini_portile2 (2.8.9) + nokogiri (1.18.8) mini_portile2 (~> 2.8.2) racc (~> 1.4) onigmo (0.1.0) From de56fa4a34d1daf02a59fad44819894d91ed7b4e Mon Sep 17 00:00:00 2001 From: Earlopain <14981592+Earlopain@users.noreply.github.com> Date: Mon, 19 May 2025 13:14:59 +0200 Subject: [PATCH 051/333] [Bug #21345] Fix accepting multiple rest patterns with leading match Related: * https://bugs.ruby-lang.org/issues/20765 * https://github.com/ruby/prism/issues/2915 --- src/prism.c | 10 +--------- test/prism/errors/pattern_match_implicit_rest.txt | 3 +++ 2 files changed, 4 insertions(+), 9 deletions(-) create mode 100644 test/prism/errors/pattern_match_implicit_rest.txt diff --git a/src/prism.c b/src/prism.c index c5f5744f58..f645879e0c 100644 --- a/src/prism.c +++ b/src/prism.c @@ -13123,14 +13123,6 @@ match8(const pm_parser_t *parser, pm_token_type_t type1, pm_token_type_t type2, return match1(parser, type1) || match1(parser, type2) || match1(parser, type3) || match1(parser, type4) || match1(parser, type5) || match1(parser, type6) || match1(parser, type7) || match1(parser, type8); } -/** - * Returns true if the current token is any of the nine given types. - */ -static inline bool -match9(const pm_parser_t *parser, pm_token_type_t type1, pm_token_type_t type2, pm_token_type_t type3, pm_token_type_t type4, pm_token_type_t type5, pm_token_type_t type6, pm_token_type_t type7, pm_token_type_t type8, pm_token_type_t type9) { - return match1(parser, type1) || match1(parser, type2) || match1(parser, type3) || match1(parser, type4) || match1(parser, type5) || match1(parser, type6) || match1(parser, type7) || match1(parser, type8) || match1(parser, type9); -} - /** * If the current token is of the specified type, lex forward by one token and * return true. Otherwise, return false. For example: @@ -17675,7 +17667,7 @@ parse_pattern(pm_parser_t *parser, pm_constant_id_list_t *captures, uint8_t flag // Gather up all of the patterns into the list. while (accept1(parser, PM_TOKEN_COMMA)) { // Break early here in case we have a trailing comma. - if (match9(parser, PM_TOKEN_KEYWORD_THEN, PM_TOKEN_BRACE_RIGHT, PM_TOKEN_BRACKET_RIGHT, PM_TOKEN_PARENTHESIS_RIGHT, PM_TOKEN_SEMICOLON, PM_TOKEN_NEWLINE, PM_TOKEN_EOF,PM_TOKEN_KEYWORD_AND, PM_TOKEN_KEYWORD_OR)) { + if (match7(parser, PM_TOKEN_KEYWORD_THEN, PM_TOKEN_BRACE_RIGHT, PM_TOKEN_BRACKET_RIGHT, PM_TOKEN_PARENTHESIS_RIGHT, PM_TOKEN_SEMICOLON, PM_TOKEN_KEYWORD_AND, PM_TOKEN_KEYWORD_OR)) { node = (pm_node_t *) pm_implicit_rest_node_create(parser, &parser->previous); pm_node_list_append(&nodes, node); trailing_rest = true; diff --git a/test/prism/errors/pattern_match_implicit_rest.txt b/test/prism/errors/pattern_match_implicit_rest.txt new file mode 100644 index 0000000000..8602c0add0 --- /dev/null +++ b/test/prism/errors/pattern_match_implicit_rest.txt @@ -0,0 +1,3 @@ +a=>b, *, + ^ expected a pattern expression after `,` + From ece5ab1cf2de68d60873b3cc2c782bebc9c4612c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 30 Jun 2025 19:45:38 +0000 Subject: [PATCH 052/333] Bump org.junit.jupiter:junit-jupiter-engine Bumps the java-deps group in /java-wasm with 1 update: [org.junit.jupiter:junit-jupiter-engine](https://github.com/junit-team/junit-framework). Updates `org.junit.jupiter:junit-jupiter-engine` from 5.13.1 to 5.13.2 - [Release notes](https://github.com/junit-team/junit-framework/releases) - [Commits](https://github.com/junit-team/junit-framework/compare/r5.13.1...r5.13.2) --- updated-dependencies: - dependency-name: org.junit.jupiter:junit-jupiter-engine dependency-version: 5.13.2 dependency-type: direct:development update-type: version-update:semver-patch dependency-group: java-deps ... Signed-off-by: dependabot[bot] --- java-wasm/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java-wasm/pom.xml b/java-wasm/pom.xml index e917ee1123..ee7f5055b6 100644 --- a/java-wasm/pom.xml +++ b/java-wasm/pom.xml @@ -16,7 +16,7 @@ 11 1.3.0 - 5.13.1 + 5.13.2 From 365049a7670b49e127e606d3a17704bd384bd6bd Mon Sep 17 00:00:00 2001 From: Stan Lo Date: Tue, 1 Jul 2025 17:10:22 +0100 Subject: [PATCH 053/333] Fix crash when using arithmetic expressions in pattern matching When arithmetic expressions like `-1**2` are used in pattern matching contexts, Ruby crashes with "Unexpected node type in pattern matching expression: PM_CALL_NODE". This happens because the Prism parser creates `PM_CALL_NODE` for arithmetic operations, but Ruby's pattern matching compiler doesn't handle call nodes. This fix adds validation to reject `PM_CALL_NODE` in pattern contexts with a proper syntax error. --- src/prism.c | 8 ++++++++ test/prism/errors/pattern_arithmetic_expressions.txt | 3 +++ 2 files changed, 11 insertions(+) create mode 100644 test/prism/errors/pattern_arithmetic_expressions.txt diff --git a/src/prism.c b/src/prism.c index c5f5744f58..4dd519962a 100644 --- a/src/prism.c +++ b/src/prism.c @@ -17393,6 +17393,14 @@ parse_pattern_primitive(pm_parser_t *parser, pm_constant_id_list_t *captures, pm // If we found a label, we need to immediately return to the caller. if (pm_symbol_node_label_p(node)) return node; + // Call nodes (arithmetic operations) are not allowed in patterns + if (PM_NODE_TYPE(node) == PM_CALL_NODE) { + pm_parser_err_node(parser, node, diag_id); + pm_missing_node_t *missing_node = pm_missing_node_create(parser, node->location.start, node->location.end); + pm_node_destroy(parser, node); + return (pm_node_t *) missing_node; + } + // Now that we have a primitive, we need to check if it's part of a range. if (accept2(parser, PM_TOKEN_DOT_DOT, PM_TOKEN_DOT_DOT_DOT)) { pm_token_t operator = parser->previous; diff --git a/test/prism/errors/pattern_arithmetic_expressions.txt b/test/prism/errors/pattern_arithmetic_expressions.txt new file mode 100644 index 0000000000..cfb3650531 --- /dev/null +++ b/test/prism/errors/pattern_arithmetic_expressions.txt @@ -0,0 +1,3 @@ +case 1; in -1**2; end + ^~~~~ expected a pattern expression after the `in` keyword + From 73179c81a82c5ac86e5642715c887133fe2c2833 Mon Sep 17 00:00:00 2001 From: Vinicius Stock Date: Thu, 3 Jul 2025 10:35:01 -0400 Subject: [PATCH 054/333] Add OS matrix to Rust build --- .github/workflows/rust-bindings.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/rust-bindings.yml b/.github/workflows/rust-bindings.yml index 85e766adb8..2f52bf747a 100644 --- a/.github/workflows/rust-bindings.yml +++ b/.github/workflows/rust-bindings.yml @@ -20,7 +20,9 @@ jobs: name: cargo:test strategy: fail-fast: false - runs-on: ubuntu-latest + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] + runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 - name: Set up Ruby From 74cbe5b252008adb5704a121309dd2ea4d4dcd45 Mon Sep 17 00:00:00 2001 From: Vinicius Stock Date: Thu, 3 Jul 2025 10:35:06 -0400 Subject: [PATCH 055/333] Upgrade bindgen --- .github/workflows/documentation.yml | 2 +- .github/workflows/rust-bindings.yml | 10 +- rakelib/cargo.rake | 2 +- rust/Cargo.lock | 238 +++------------------------ rust/ruby-prism-sys/Cargo.toml | 2 +- rust/ruby-prism-sys/build/main.rs | 2 +- rust/ruby-prism-sys/src/lib.rs | 2 + rust/ruby-prism/examples/wasm/run.sh | 4 +- 8 files changed, 32 insertions(+), 230 deletions(-) diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index 43300482c1..785fa409c9 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -23,7 +23,7 @@ jobs: - name: Set up Rust uses: dtolnay/rust-toolchain@master with: - toolchain: "1.71.1" + toolchain: stable - name: Install doxygen and dependencies run: | sudo apt-get update diff --git a/.github/workflows/rust-bindings.yml b/.github/workflows/rust-bindings.yml index 2f52bf747a..5bb9ae153c 100644 --- a/.github/workflows/rust-bindings.yml +++ b/.github/workflows/rust-bindings.yml @@ -33,8 +33,8 @@ jobs: - name: Set up Rust uses: dtolnay/rust-toolchain@master with: - toolchain: "1.71.1" - targets: wasm32-wasi + toolchain: stable + targets: wasm32-wasip1 - uses: actions/cache@v4 with: path: | @@ -65,7 +65,7 @@ jobs: - name: Set up Rust uses: dtolnay/rust-toolchain@master with: - toolchain: "1.71.1" + toolchain: stable components: clippy, rustfmt - uses: actions/cache@v4 with: @@ -100,7 +100,7 @@ jobs: run: bundle exec rake cargo:build - uses: dtolnay/rust-toolchain@master with: - toolchain: nightly-2023-10-24 + toolchain: nightly target: "x86_64-unknown-linux-gnu" components: "rust-src" - name: Test with sanitizer @@ -126,7 +126,7 @@ jobs: # uses: dtolnay/rust-toolchain@master # with: # toolchain: "1.71.1" - # targets: wasm32-wasi + # targets: wasm32-wasip1 # - uses: actions/cache@v4 # with: # path: | diff --git a/rakelib/cargo.rake b/rakelib/cargo.rake index 8f5d5266a9..c52cebba2b 100644 --- a/rakelib/cargo.rake +++ b/rakelib/cargo.rake @@ -97,7 +97,7 @@ namespace :cargo do CRATES.each do |crate| Dir.chdir("rust/#{crate}") do - sh("cargo +nightly-2023-10-24 test -Zbuild-std --target=#{current_target} -- --nocapture") + sh("cargo +nightly test -Zbuild-std --target=#{current_target} -- --nocapture") end end ensure diff --git a/rust/Cargo.lock b/rust/Cargo.lock index 25499d37f8..e51c0878e9 100644 --- a/rust/Cargo.lock +++ b/rust/Cargo.lock @@ -1,6 +1,6 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 +version = 4 [[package]] name = "aho-corasick" @@ -13,17 +13,15 @@ dependencies = [ [[package]] name = "bindgen" -version = "0.66.1" +version = "0.72.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2b84e06fc203107bfbad243f4aba2af864eb7db3b1cf46ea0a023b0b433d2a7" +checksum = "4f72209734318d0b619a5e0f5129918b848c416e122a3c4ce054e03cb87b726f" dependencies = [ "bitflags", "cexpr", "clang-sys", - "lazy_static", - "lazycell", + "itertools", "log", - "peeking_take_while", "prettyplease", "proc-macro2", "quote", @@ -31,7 +29,6 @@ dependencies = [ "rustc-hash", "shlex", "syn", - "which", ] [[package]] @@ -87,16 +84,6 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" -[[package]] -name = "errno" -version = "0.3.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" -dependencies = [ - "libc", - "windows-sys 0.52.0", -] - [[package]] name = "glob" version = "0.3.1" @@ -109,15 +96,6 @@ version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" -[[package]] -name = "home" -version = "0.5.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5444c27eef6923071f7ebcc33e3444508466a76f7a2b93da00ed6e19f30c1ddb" -dependencies = [ - "windows-sys 0.48.0", -] - [[package]] name = "indexmap" version = "2.1.0" @@ -129,22 +107,19 @@ dependencies = [ ] [[package]] -name = "itoa" -version = "1.0.9" +name = "itertools" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" - -[[package]] -name = "lazy_static" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" +dependencies = [ + "either", +] [[package]] -name = "lazycell" -version = "1.3.0" +name = "itoa" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" +checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" [[package]] name = "libc" @@ -162,12 +137,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "linux-raw-sys" -version = "0.4.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4cd1a83af159aa67994778be9070f0ae1bd732942279cabb14f86f986a21456" - [[package]] name = "log" version = "0.4.20" @@ -196,18 +165,6 @@ dependencies = [ "minimal-lexical", ] -[[package]] -name = "once_cell" -version = "1.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" - -[[package]] -name = "peeking_take_while" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099" - [[package]] name = "prettyplease" version = "0.2.15" @@ -220,9 +177,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.70" +version = "1.0.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39278fbbf5fb4f646ce651690877f89d1c5811a3d4acb27700c1cb3cdb78fd3b" +checksum = "02b3e5e68a3a1a02aad3ec490a98007cbc13c37cbe84a3cd7b8e406d76e7f778" dependencies = [ "unicode-ident", ] @@ -267,7 +224,7 @@ checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" [[package]] name = "ruby-prism" -version = "1.3.0" +version = "1.4.0" dependencies = [ "ruby-prism-sys", "serde", @@ -276,7 +233,7 @@ dependencies = [ [[package]] name = "ruby-prism-sys" -version = "1.3.0" +version = "1.4.0" dependencies = [ "bindgen", "cc", @@ -284,22 +241,9 @@ dependencies = [ [[package]] name = "rustc-hash" -version = "1.1.0" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" - -[[package]] -name = "rustix" -version = "0.38.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9470c4bf8246c8daf25f9598dca807fb6510347b1e1cfa55749113850c79d88a" -dependencies = [ - "bitflags", - "errno", - "libc", - "linux-raw-sys", - "windows-sys 0.52.0", -] +checksum = "357703d41365b4b27c590e3ed91eabb1b663f07c4c084095e60cbed4362dff0d" [[package]] name = "ryu" @@ -369,18 +313,6 @@ version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ab4c90930b95a82d00dc9e9ac071b4991924390d46cbd0dfe566148667605e4b" -[[package]] -name = "which" -version = "4.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87ba24419a2078cd2b0f2ede2691b6c66d8e47836da3b6db8265ebad47afbfc7" -dependencies = [ - "either", - "home", - "once_cell", - "rustix", -] - [[package]] name = "winapi" version = "0.3.9" @@ -402,135 +334,3 @@ name = "winapi-x86_64-pc-windows-gnu" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" - -[[package]] -name = "windows-sys" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" -dependencies = [ - "windows-targets 0.48.5", -] - -[[package]] -name = "windows-sys" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" -dependencies = [ - "windows-targets 0.52.0", -] - -[[package]] -name = "windows-targets" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" -dependencies = [ - "windows_aarch64_gnullvm 0.48.5", - "windows_aarch64_msvc 0.48.5", - "windows_i686_gnu 0.48.5", - "windows_i686_msvc 0.48.5", - "windows_x86_64_gnu 0.48.5", - "windows_x86_64_gnullvm 0.48.5", - "windows_x86_64_msvc 0.48.5", -] - -[[package]] -name = "windows-targets" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" -dependencies = [ - "windows_aarch64_gnullvm 0.52.0", - "windows_aarch64_msvc 0.52.0", - "windows_i686_gnu 0.52.0", - "windows_i686_msvc 0.52.0", - "windows_x86_64_gnu 0.52.0", - "windows_x86_64_gnullvm 0.52.0", - "windows_x86_64_msvc 0.52.0", -] - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" - -[[package]] -name = "windows_i686_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" - -[[package]] -name = "windows_i686_gnu" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" - -[[package]] -name = "windows_i686_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" - -[[package]] -name = "windows_i686_msvc" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" diff --git a/rust/ruby-prism-sys/Cargo.toml b/rust/ruby-prism-sys/Cargo.toml index 223788fe6a..ae76e11a7e 100644 --- a/rust/ruby-prism-sys/Cargo.toml +++ b/rust/ruby-prism-sys/Cargo.toml @@ -22,7 +22,7 @@ build = "build/main.rs" include = ["src/", "build/", "Cargo.toml", "Cargo.lock", "README.md", "vendor"] [build-dependencies] -bindgen = "0.66" +bindgen = "0.72" cc = { version = "1.0", optional = true } [features] diff --git a/rust/ruby-prism-sys/build/main.rs b/rust/ruby-prism-sys/build/main.rs index 82f75c3e47..798d06d8ff 100644 --- a/rust/ruby-prism-sys/build/main.rs +++ b/rust/ruby-prism-sys/build/main.rs @@ -108,7 +108,7 @@ fn generate_bindings(ruby_include_path: &Path) -> bindgen::Bindings { .impl_debug(true) .layout_tests(true) .merge_extern_blocks(true) - .parse_callbacks(Box::new(bindgen::CargoCallbacks)) + .parse_callbacks(Box::new(bindgen::CargoCallbacks::new())) .parse_callbacks(Box::new(Callbacks)) .prepend_enum_name(false) .size_t_is_usize(true) diff --git a/rust/ruby-prism-sys/src/lib.rs b/rust/ruby-prism-sys/src/lib.rs index ecaf83a8f4..f2eb9204b8 100644 --- a/rust/ruby-prism-sys/src/lib.rs +++ b/rust/ruby-prism-sys/src/lib.rs @@ -25,6 +25,8 @@ #[allow(non_camel_case_types)] #[allow(non_snake_case)] #[allow(non_upper_case_globals)] +#[allow(unused_qualifications)] +#[allow(clippy::missing_const_for_fn)] mod bindings { // In `build.rs`, we use `bindgen` to generate bindings based on C headers // and `libprism`. Here is where we pull in those bindings and make diff --git a/rust/ruby-prism/examples/wasm/run.sh b/rust/ruby-prism/examples/wasm/run.sh index bd55ce69e0..f1f141df47 100755 --- a/rust/ruby-prism/examples/wasm/run.sh +++ b/rust/ruby-prism/examples/wasm/run.sh @@ -7,7 +7,7 @@ WASI_SDK_VERSION="$WASI_SDK_VERSION_MAJOR.0" TMPDIR="$(pwd)/tmp" WASI_SDK_PATH="${TMPDIR}/wasi-sdk-${WASI_SDK_VERSION}" WASI_SDK_TAR="${TMPDIR}/wasi-sdk.tar.gz" -WASM_BUILD_DIR="./target/wasm32-wasi/debug/examples" +WASM_BUILD_DIR="./target/wasm32-wasip1/debug/examples" WASM_FILE="${WASM_BUILD_DIR}/wasm.wasm" export WASI_SDK_PATH @@ -45,7 +45,7 @@ download_wasi_sdk() { } build_wasm() { - cargo build --target=wasm32-wasi --example wasm >&2 + cargo build --target=wasm32-wasip1 --example wasm >&2 echo "WASM built to ${WASM_FILE}" >&2 } From ab22c39eba27ed4ab553ad95b769f6a9185e871c Mon Sep 17 00:00:00 2001 From: Vinicius Stock Date: Thu, 3 Jul 2025 11:21:23 -0400 Subject: [PATCH 056/333] Fix all clippy violations --- rust/ruby-prism-sys/build/vendored.rs | 2 +- rust/ruby-prism-sys/src/lib.rs | 1 - rust/ruby-prism-sys/tests/pack_tests.rs | 2 +- rust/ruby-prism-sys/tests/utils_tests.rs | 20 +-- rust/ruby-prism/build.rs | 30 ++--- rust/ruby-prism/examples/wasm/main.rs | 6 +- rust/ruby-prism/src/lib.rs | 150 ++++++++++++++--------- 7 files changed, 120 insertions(+), 91 deletions(-) diff --git a/rust/ruby-prism-sys/build/vendored.rs b/rust/ruby-prism-sys/build/vendored.rs index 670df42d50..da01fa6a69 100644 --- a/rust/ruby-prism-sys/build/vendored.rs +++ b/rust/ruby-prism-sys/build/vendored.rs @@ -114,7 +114,7 @@ fn source_files>(root_dir: P) -> Vec { if Path::new(&path) .extension() - .map_or(false, |ext| ext.eq_ignore_ascii_case("c")) + .is_some_and(|ext| ext.eq_ignore_ascii_case("c")) { files.push(path); } diff --git a/rust/ruby-prism-sys/src/lib.rs b/rust/ruby-prism-sys/src/lib.rs index f2eb9204b8..e18fced44e 100644 --- a/rust/ruby-prism-sys/src/lib.rs +++ b/rust/ruby-prism-sys/src/lib.rs @@ -4,7 +4,6 @@ //! #![deny(unused_extern_crates)] #![warn( - box_pointers, clippy::all, clippy::nursery, clippy::pedantic, diff --git a/rust/ruby-prism-sys/tests/pack_tests.rs b/rust/ruby-prism-sys/tests/pack_tests.rs index c729aa6cdc..63bc1cb1ea 100644 --- a/rust/ruby-prism-sys/tests/pack_tests.rs +++ b/rust/ruby-prism-sys/tests/pack_tests.rs @@ -30,7 +30,7 @@ fn pack_parse_test() { endian_out.as_mut_ptr(), size_out.as_mut_ptr(), length_type_out.as_mut_ptr(), - &mut length_out, + &raw mut length_out, encoding_out.as_mut_ptr(), ); diff --git a/rust/ruby-prism-sys/tests/utils_tests.rs b/rust/ruby-prism-sys/tests/utils_tests.rs index ea1b8bc4a2..8ab12d620c 100644 --- a/rust/ruby-prism-sys/tests/utils_tests.rs +++ b/rust/ruby-prism-sys/tests/utils_tests.rs @@ -66,13 +66,13 @@ mod string { let mut s = make_string(PM_STRING_SHARED); unsafe { - let len = pm_string_length(&s.pm_string); + let len = pm_string_length(&raw const s.pm_string); assert_eq!(len, 16); - let result_start = pm_string_source(&s.pm_string); + let result_start = pm_string_source(&raw const s.pm_string); assert_eq!(s.start_ptr(), result_start); - pm_string_free(&mut s.pm_string); + pm_string_free(&raw mut s.pm_string); } } @@ -81,10 +81,10 @@ mod string { let s = make_string(PM_STRING_OWNED); unsafe { - let result_len = pm_string_length(&s.pm_string); + let result_len = pm_string_length(&raw const s.pm_string); assert_eq!(result_len, 16); - let result_start = pm_string_source(&s.pm_string); + let result_start = pm_string_source(&raw const s.pm_string); assert_eq!(s.pm_string.source, result_start); // Don't drop the pm_string--we don't own it anymore! @@ -96,13 +96,13 @@ mod string { let mut s = make_string(PM_STRING_CONSTANT); unsafe { - let result_len = pm_string_length(&s.pm_string); + let result_len = pm_string_length(&raw const s.pm_string); assert_eq!(result_len, 16); - let result_start = pm_string_source(&s.pm_string); + let result_start = pm_string_source(&raw const s.pm_string); assert_eq!(s.pm_string.source, result_start); - pm_string_free(&mut s.pm_string); + pm_string_free(&raw mut s.pm_string); } } @@ -111,10 +111,10 @@ mod string { let s = make_string(PM_STRING_MAPPED); unsafe { - let result_len = pm_string_length(&s.pm_string); + let result_len = pm_string_length(&raw const s.pm_string); assert_eq!(result_len, 16); - let result_start = pm_string_source(&s.pm_string); + let result_start = pm_string_source(&raw const s.pm_string); assert_eq!(s.pm_string.source, result_start); } } diff --git a/rust/ruby-prism/build.rs b/rust/ruby-prism/build.rs index a43a159c5b..e1dd0b4271 100644 --- a/rust/ruby-prism/build.rs +++ b/rust/ruby-prism/build.rs @@ -247,14 +247,14 @@ fn write_node(file: &mut File, flags: &[Flags], node: &Node) -> Result<(), Box {}<'pr> {{", node.name)?; writeln!(file, " /// Converts this node to a generic node.")?; writeln!(file, " #[must_use]")?; - writeln!(file, " pub fn as_node(&self) -> Node<'pr> {{")?; + writeln!(file, " pub const fn as_node(&self) -> Node<'pr> {{")?; writeln!(file, " Node::{} {{ parser: self.parser, pointer: self.pointer, marker: PhantomData }}", node.name)?; writeln!(file, " }}")?; writeln!(file)?; writeln!(file, " /// Returns the location of this node.")?; writeln!(file, " #[must_use]")?; writeln!(file, " pub fn location(&self) -> Location<'pr> {{")?; - writeln!(file, " let pointer: *mut pm_location_t = unsafe {{ &mut (*self.pointer).base.location }};")?; + writeln!(file, " let pointer: *mut pm_location_t = unsafe {{ &raw mut (*self.pointer).base.location }};")?; writeln!(file, " Location::new(self.parser, unsafe {{ &(*pointer) }})")?; writeln!(file, " }}")?; writeln!(file)?; @@ -326,7 +326,7 @@ fn write_node(file: &mut File, flags: &[Flags], node: &Node) -> Result<(), Box { writeln!(file, " pub fn {}(&self) -> NodeList<'pr> {{", field.name)?; - writeln!(file, " let pointer: *mut pm_node_list = unsafe {{ &mut (*self.pointer).{} }};", field.name)?; + writeln!(file, " let pointer: *mut pm_node_list = unsafe {{ &raw mut (*self.pointer).{} }};", field.name)?; writeln!(file, " NodeList {{ parser: self.parser, pointer: unsafe {{ NonNull::new_unchecked(pointer) }}, marker: PhantomData }}")?; writeln!(file, " }}")?; }, @@ -359,19 +359,19 @@ fn write_node(file: &mut File, flags: &[Flags], node: &Node) -> Result<(), Box { writeln!(file, " pub fn {}(&self) -> ConstantList<'pr> {{", field.name)?; - writeln!(file, " let pointer: *mut pm_constant_id_list_t = unsafe {{ &mut (*self.pointer).{} }};", field.name)?; + writeln!(file, " let pointer: *mut pm_constant_id_list_t = unsafe {{ &raw mut (*self.pointer).{} }};", field.name)?; writeln!(file, " ConstantList {{ parser: self.parser, pointer: unsafe {{ NonNull::new_unchecked(pointer) }}, marker: PhantomData }}")?; writeln!(file, " }}")?; }, NodeFieldType::Location => { writeln!(file, " pub fn {}(&self) -> Location<'pr> {{", field.name)?; - writeln!(file, " let pointer: *mut pm_location_t = unsafe {{ &mut (*self.pointer).{} }};", field.name)?; + writeln!(file, " let pointer: *mut pm_location_t = unsafe {{ &raw mut (*self.pointer).{} }};", field.name)?; writeln!(file, " Location::new(self.parser, unsafe {{ &(*pointer) }})")?; writeln!(file, " }}")?; }, NodeFieldType::OptionalLocation => { writeln!(file, " pub fn {}(&self) -> Option> {{", field.name)?; - writeln!(file, " let pointer: *mut pm_location_t = unsafe {{ &mut (*self.pointer).{} }};", field.name)?; + writeln!(file, " let pointer: *mut pm_location_t = unsafe {{ &raw mut (*self.pointer).{} }};", field.name)?; writeln!(file, " let start = unsafe {{ (*pointer).start }};")?; writeln!(file, " if start.is_null() {{")?; writeln!(file, " None")?; @@ -392,7 +392,7 @@ fn write_node(file: &mut File, flags: &[Flags], node: &Node) -> Result<(), Box { writeln!(file, " pub fn {}(&self) -> Integer<'pr> {{", field.name)?; - writeln!(file, " Integer::new(unsafe {{ &(*self.pointer).{} }})", field.name)?; + writeln!(file, " Integer::new(unsafe {{ &raw const(*self.pointer).{} }})", field.name)?; writeln!(file, " }}")?; }, NodeFieldType::Double => { @@ -523,7 +523,7 @@ fn write_visit(file: &mut File, config: &Config) -> Result<(), Box { - writeln!(file, " for node in node.{}().iter() {{", field.name)?; + writeln!(file, " for node in &node.{}() {{", field.name)?; writeln!(file, " visitor.visit(&node);")?; writeln!(file, " }}")?; }, @@ -533,7 +533,7 @@ fn write_visit(file: &mut File, config: &Config) -> Result<(), Box(_visitor: &mut V, _node: &{}<'pr>)", struct_name(&node.name), node.name)?; + writeln!(file, "pub const fn visit{}<'pr, V>(_visitor: &mut V, _node: &{}<'pr>)", struct_name(&node.name), node.name)?; writeln!(file, "where")?; writeln!(file, " V: Visit<'pr> + ?Sized,")?; writeln!(file, "{{}}")?; @@ -552,14 +552,14 @@ fn write_bindings(config: &Config) -> Result<(), Box> { write!( file, - r#" + r" use std::marker::PhantomData; use std::ptr::NonNull; #[allow(clippy::wildcard_imports)] use ruby_prism_sys::*; use crate::{{ConstantId, ConstantList, Integer, Location, NodeList}}; -"# +" )?; for node in &config.nodes { @@ -578,7 +578,7 @@ use crate::{{ConstantId, ConstantList, Integer, Location, NodeList}}; writeln!(file, "pub enum Node<'pr> {{")?; for node in &config.nodes { - writeln!(file, " /// The {} node", node.name)?; + writeln!(file, " /// The `{}` node", node.name)?; writeln!(file, " {} {{", node.name)?; writeln!(file, " /// The pointer to the associated parser this node came from.")?; writeln!(file, " parser: NonNull,")?; @@ -596,7 +596,7 @@ use crate::{{ConstantId, ConstantList, Integer, Location, NodeList}}; writeln!( file, - r#" + r" impl<'pr> Node<'pr> {{ /// Creates a new node from the given pointer. /// @@ -607,7 +607,7 @@ impl<'pr> Node<'pr> {{ #[allow(clippy::not_unsafe_ptr_arg_deref)] pub(crate) fn new(parser: NonNull, node: *mut pm_node_t) -> Self {{ match unsafe {{ (*node).type_ }} {{ -"# +" )?; for node in &config.nodes { @@ -633,7 +633,7 @@ impl<'pr> Node<'pr> {{ for node in &config.nodes { writeln!(file, " /// Returns the node as a `{}`.", node.name)?; writeln!(file, " #[must_use]")?; - writeln!(file, " pub fn as{}(&self) -> Option<{}<'pr>> {{", struct_name(&node.name), node.name)?; + writeln!(file, " pub const fn as{}(&self) -> Option<{}<'pr>> {{", struct_name(&node.name), node.name)?; writeln!(file, " match *self {{")?; writeln!(file, " Self::{} {{ parser, pointer, marker }} => Some({} {{ parser, pointer, marker }}),", node.name, node.name)?; writeln!(file, " _ => None")?; diff --git a/rust/ruby-prism/examples/wasm/main.rs b/rust/ruby-prism/examples/wasm/main.rs index bfb8e0023f..8a49f634a0 100644 --- a/rust/ruby-prism/examples/wasm/main.rs +++ b/rust/ruby-prism/examples/wasm/main.rs @@ -7,7 +7,7 @@ fn main() { let comments_count = result.comments().count(); let warnings_count = result.warnings().count(); let errors_count = result.errors().count(); - println!(" comments: {}", comments_count); - println!(" warnings: {}", warnings_count); - println!(" errors: {}", errors_count); + println!(" comments: {comments_count}"); + println!(" warnings: {warnings_count}"); + println!(" errors: {errors_count}"); } diff --git a/rust/ruby-prism/src/lib.rs b/rust/ruby-prism/src/lib.rs index 22054de8ba..43b1be6409 100644 --- a/rust/ruby-prism/src/lib.rs +++ b/rust/ruby-prism/src/lib.rs @@ -31,6 +31,8 @@ pub struct Location<'pr> { impl<'pr> Location<'pr> { /// Returns a byte slice for the range. + /// # Panics + /// Panics if the end offset is not greater than the start offset. #[must_use] pub fn as_slice(&self) -> &'pr [u8] { unsafe { @@ -41,7 +43,7 @@ impl<'pr> Location<'pr> { /// Return a Location from the given `pm_location_t`. #[must_use] - pub(crate) const fn new(parser: NonNull, loc: &'pr pm_location_t) -> Location<'pr> { + pub(crate) const fn new(parser: NonNull, loc: &'pr pm_location_t) -> Self { Location { parser, start: loc.start, @@ -54,7 +56,7 @@ impl<'pr> Location<'pr> { /// Returns None if both locations did not originate from the same parser, /// or if self starts after other. #[must_use] - pub fn join(&self, other: &Location<'pr>) -> Option> { + pub fn join(&self, other: &Self) -> Option { if self.parser != other.parser || self.start > other.start { None } else { @@ -68,6 +70,8 @@ impl<'pr> Location<'pr> { } /// Return the start offset from the beginning of the parsed source. + /// # Panics + /// Panics if the start offset is not greater than the parser's start. #[must_use] pub fn start_offset(&self) -> usize { unsafe { @@ -77,6 +81,8 @@ impl<'pr> Location<'pr> { } /// Return the end offset from the beginning of the parsed source. + /// # Panics + /// Panics if the end offset is not greater than the parser's start. #[must_use] pub fn end_offset(&self) -> usize { unsafe { @@ -135,7 +141,7 @@ pub struct NodeList<'pr> { impl<'pr> NodeList<'pr> { /// Returns an iterator over the nodes. #[must_use] - pub fn iter(&self) -> NodeListIter<'pr> { + pub const fn iter(&self) -> NodeListIter<'pr> { NodeListIter { parser: self.parser, pointer: self.pointer, @@ -145,6 +151,14 @@ impl<'pr> NodeList<'pr> { } } +impl<'pr> IntoIterator for &NodeList<'pr> { + type Item = Node<'pr>; + type IntoIter = NodeListIter<'pr>; + fn into_iter(self) -> Self::IntoIter { + self.iter() + } +} + impl std::fmt::Debug for NodeList<'_> { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { write!(f, "{:?}", self.iter().collect::>()) @@ -159,7 +173,7 @@ pub struct ConstantId<'pr> { } impl<'pr> ConstantId<'pr> { - fn new(parser: NonNull, id: pm_constant_id_t) -> Self { + const fn new(parser: NonNull, id: pm_constant_id_t) -> Self { ConstantId { parser, id, marker: PhantomData } } @@ -221,7 +235,7 @@ pub struct ConstantList<'pr> { impl<'pr> ConstantList<'pr> { /// Returns an iterator over the constants in the list. #[must_use] - pub fn iter(&self) -> ConstantListIter<'pr> { + pub const fn iter(&self) -> ConstantListIter<'pr> { ConstantListIter { parser: self.parser, pointer: self.pointer, @@ -231,6 +245,14 @@ impl<'pr> ConstantList<'pr> { } } +impl<'pr> IntoIterator for &ConstantList<'pr> { + type Item = ConstantId<'pr>; + type IntoIter = ConstantListIter<'pr>; + fn into_iter(self) -> Self::IntoIter { + self.iter() + } +} + impl std::fmt::Debug for ConstantList<'_> { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { write!(f, "{:?}", self.iter().collect::>()) @@ -246,15 +268,15 @@ pub struct Integer<'pr> { marker: PhantomData<&'pr mut pm_constant_id_t>, } -impl<'pr> Integer<'pr> { - fn new(pointer: *const pm_integer_t) -> Self { +impl Integer<'_> { + const fn new(pointer: *const pm_integer_t) -> Self { Integer { pointer, marker: PhantomData } } /// Returns the sign and the u32 digits representation of the integer, /// ordered least significant digit first. #[must_use] - pub fn to_u32_digits(&self) -> (bool, &[u32]) { + pub const fn to_u32_digits(&self) -> (bool, &[u32]) { let negative = unsafe { (*self.pointer).negative }; let length = unsafe { (*self.pointer).length }; let values = unsafe { (*self.pointer).values }; @@ -294,7 +316,7 @@ impl TryInto for Integer<'_> { /// A diagnostic message that came back from the parser. #[derive(Debug)] pub struct Diagnostic<'pr> { - diagnostic: NonNull, + diag: NonNull, parser: NonNull, marker: PhantomData<&'pr pm_diagnostic_t>, } @@ -309,22 +331,22 @@ impl<'pr> Diagnostic<'pr> { #[must_use] pub fn message(&self) -> &str { unsafe { - let message: *mut c_char = self.diagnostic.as_ref().message.cast_mut(); + let message: *mut c_char = self.diag.as_ref().message.cast_mut(); CStr::from_ptr(message).to_str().expect("prism allows only UTF-8 for diagnostics.") } } /// The location of the diagnostic in the source. #[must_use] - pub fn location(&self) -> Location<'pr> { - Location::new(self.parser, unsafe { &self.diagnostic.as_ref().location }) + pub const fn location(&self) -> Location<'pr> { + Location::new(self.parser, unsafe { &self.diag.as_ref().location }) } } /// A comment that was found during parsing. #[derive(Debug)] pub struct Comment<'pr> { - comment: NonNull, + content: NonNull, parser: NonNull, marker: PhantomData<&'pr pm_comment_t>, } @@ -341,8 +363,8 @@ impl<'pr> Comment<'pr> { /// The location of the comment in the source. #[must_use] - pub fn location(&self) -> Location<'pr> { - Location::new(self.parser, unsafe { &self.comment.as_ref().location }) + pub const fn location(&self) -> Location<'pr> { + Location::new(self.parser, unsafe { &self.content.as_ref().location }) } } @@ -353,10 +375,10 @@ pub struct MagicComment<'pr> { marker: PhantomData<&'pr pm_magic_comment_t>, } -impl<'pr> MagicComment<'pr> { +impl MagicComment<'_> { /// Returns the text of the comment's key. #[must_use] - pub fn key(&self) -> &[u8] { + pub const fn key(&self) -> &[u8] { unsafe { let start = self.comment.as_ref().key_start; let len = self.comment.as_ref().key_length as usize; @@ -366,7 +388,7 @@ impl<'pr> MagicComment<'pr> { /// Returns the text of the comment's value. #[must_use] - pub fn value(&self) -> &[u8] { + pub const fn value(&self) -> &[u8] { unsafe { let start = self.comment.as_ref().value_start; let len = self.comment.as_ref().value_length as usize; @@ -388,7 +410,11 @@ impl<'pr> Iterator for Diagnostics<'pr> { fn next(&mut self) -> Option { if let Some(diagnostic) = NonNull::new(self.diagnostic) { - let current = Diagnostic { diagnostic, parser: self.parser, marker: PhantomData }; + let current = Diagnostic { + diag: diagnostic, + parser: self.parser, + marker: PhantomData, + }; self.diagnostic = unsafe { diagnostic.as_ref().node.next.cast::() }; Some(current) } else { @@ -410,7 +436,11 @@ impl<'pr> Iterator for Comments<'pr> { fn next(&mut self) -> Option { if let Some(comment) = NonNull::new(self.comment) { - let current = Comment { comment, parser: self.parser, marker: PhantomData }; + let current = Comment { + content: comment, + parser: self.parser, + marker: PhantomData, + }; self.comment = unsafe { comment.as_ref().node.next.cast::() }; Some(current) } else { @@ -549,7 +579,7 @@ impl<'pr> ParseResult<'pr> { } } -impl<'pr> Drop for ParseResult<'pr> { +impl Drop for ParseResult<'_> { fn drop(&mut self) { unsafe { pm_node_destroy(self.parser.as_ptr(), self.node.as_ptr()); @@ -755,12 +785,12 @@ mod tests { #[test] fn optional_loc_test() { - let source = r#" + let source = r" module Example x = call_func(3, 4) y = x.call_func 5, 6 end -"#; +"; let result = parse(source.as_ref()); let node = result.node(); @@ -829,9 +859,9 @@ end #[test] fn call_flags_test() { - let source = r#" + let source = r" x -"#; +"; let result = parse(source.as_ref()); let node = result.node(); @@ -839,9 +869,9 @@ x let call = call.as_call_node().unwrap(); assert!(call.is_variable_call()); - let source = r#" + let source = r" x&.foo -"#; +"; let result = parse(source.as_ref()); let node = result.node(); @@ -852,9 +882,9 @@ x&.foo #[test] fn integer_flags_test() { - let source = r#" + let source = r" 0b1 -"#; +"; let result = parse(source.as_ref()); let node = result.node(); @@ -865,9 +895,9 @@ x&.foo assert!(!i.is_octal()); assert!(!i.is_hexadecimal()); - let source = r#" + let source = r" 1 -"#; +"; let result = parse(source.as_ref()); let node = result.node(); @@ -878,9 +908,9 @@ x&.foo assert!(!i.is_octal()); assert!(!i.is_hexadecimal()); - let source = r#" + let source = r" 0o1 -"#; +"; let result = parse(source.as_ref()); let node = result.node(); @@ -891,9 +921,9 @@ x&.foo assert!(i.is_octal()); assert!(!i.is_hexadecimal()); - let source = r#" + let source = r" 0x1 -"#; +"; let result = parse(source.as_ref()); let node = result.node(); @@ -907,9 +937,9 @@ x&.foo #[test] fn range_flags_test() { - let source = r#" + let source = r" 0..1 -"#; +"; let result = parse(source.as_ref()); let node = result.node(); @@ -917,9 +947,9 @@ x&.foo let range = range.as_range_node().unwrap(); assert!(!range.is_exclude_end()); - let source = r#" + let source = r" 0...1 -"#; +"; let result = parse(source.as_ref()); let node = result.node(); @@ -931,9 +961,9 @@ x&.foo #[allow(clippy::too_many_lines, clippy::cognitive_complexity)] #[test] fn regex_flags_test() { - let source = r#" + let source = r" /a/i -"#; +"; let result = parse(source.as_ref()); let node = result.node(); @@ -948,9 +978,9 @@ x&.foo assert!(!regex.is_utf_8()); assert!(!regex.is_once()); - let source = r#" + let source = r" /a/x -"#; +"; let result = parse(source.as_ref()); let node = result.node(); @@ -965,9 +995,9 @@ x&.foo assert!(!regex.is_utf_8()); assert!(!regex.is_once()); - let source = r#" + let source = r" /a/m -"#; +"; let result = parse(source.as_ref()); let node = result.node(); @@ -982,9 +1012,9 @@ x&.foo assert!(!regex.is_utf_8()); assert!(!regex.is_once()); - let source = r#" + let source = r" /a/e -"#; +"; let result = parse(source.as_ref()); let node = result.node(); @@ -999,9 +1029,9 @@ x&.foo assert!(!regex.is_utf_8()); assert!(!regex.is_once()); - let source = r#" + let source = r" /a/n -"#; +"; let result = parse(source.as_ref()); let node = result.node(); @@ -1016,9 +1046,9 @@ x&.foo assert!(!regex.is_utf_8()); assert!(!regex.is_once()); - let source = r#" + let source = r" /a/s -"#; +"; let result = parse(source.as_ref()); let node = result.node(); @@ -1033,9 +1063,9 @@ x&.foo assert!(!regex.is_utf_8()); assert!(!regex.is_once()); - let source = r#" + let source = r" /a/u -"#; +"; let result = parse(source.as_ref()); let node = result.node(); @@ -1050,9 +1080,9 @@ x&.foo assert!(regex.is_utf_8()); assert!(!regex.is_once()); - let source = r#" + let source = r" /a/o -"#; +"; let result = parse(source.as_ref()); let node = result.node(); @@ -1085,7 +1115,7 @@ x&.foo counts: NodeCounts, } - impl<'pr> Visit<'pr> for CountingVisitor { + impl Visit<'_> for CountingVisitor { fn visit_branch_node_enter(&mut self, _node: Node<'_>) { self.counts.pre_parent += 1; } @@ -1103,12 +1133,12 @@ x&.foo } } - let source = r#" + let source = r" module Example x = call_func(3, 4) y = x.call_func 5, 6 end -"#; +"; let result = parse(source.as_ref()); let node = result.node(); let mut visitor = CountingVisitor::default(); @@ -1144,12 +1174,12 @@ end } } - let source = r#" + let source = r" module Example x = call_func(3, 4) y = x.call_func 5, 6 end -"#; +"; let result = parse(source.as_ref()); let node = result.node(); let mut visitor = StackingNodeVisitor::default(); From 263e4b4d37fd91d99b8579d81bbe740aa29f8733 Mon Sep 17 00:00:00 2001 From: Vinicius Stock Date: Fri, 4 Jul 2025 10:46:02 -0400 Subject: [PATCH 057/333] Run Rust bindings workflow latest Ruby, but not head --- .github/workflows/rust-bindings.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/rust-bindings.yml b/.github/workflows/rust-bindings.yml index 5bb9ae153c..14ec2f0856 100644 --- a/.github/workflows/rust-bindings.yml +++ b/.github/workflows/rust-bindings.yml @@ -28,7 +28,7 @@ jobs: - name: Set up Ruby uses: ruby/setup-ruby@v1 with: - ruby-version: head + ruby-version: 3.4 bundler-cache: true - name: Set up Rust uses: dtolnay/rust-toolchain@master @@ -60,7 +60,7 @@ jobs: - name: Set up Ruby uses: ruby/setup-ruby@v1 with: - ruby-version: head + ruby-version: 3.4 bundler-cache: true - name: Set up Rust uses: dtolnay/rust-toolchain@master @@ -94,7 +94,7 @@ jobs: - name: Set up Ruby uses: ruby/setup-ruby@v1 with: - ruby-version: head + ruby-version: 3.4 bundler-cache: true - name: rake cargo:build run: bundle exec rake cargo:build From 32519009acda41e9b4e26739605122ca9de11f92 Mon Sep 17 00:00:00 2001 From: Vinicius Stock Date: Fri, 4 Jul 2025 10:51:05 -0400 Subject: [PATCH 058/333] Skip WASM example for Windows --- .github/workflows/rust-bindings.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/rust-bindings.yml b/.github/workflows/rust-bindings.yml index 14ec2f0856..f2b9d45431 100644 --- a/.github/workflows/rust-bindings.yml +++ b/.github/workflows/rust-bindings.yml @@ -47,7 +47,9 @@ jobs: ${{ runner.os }}-cargo - name: Run tests run: bundle exec rake cargo:test + - name: Run examples + if: ${{ matrix.os != 'windows-latest' }} run: bundle exec rake cargo:examples lint: From 86b7b9e6a5fe234e17275a5955596eaeed7efe63 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 7 Jul 2025 18:47:28 +0000 Subject: [PATCH 059/333] Bump the ruby-deps group across 10 directories with 2 updates Bumps the ruby-deps group with 1 update in the /gemfiles/2.7 directory: [test-unit](https://github.com/test-unit/test-unit). Bumps the ruby-deps group with 1 update in the /gemfiles/3.0 directory: [test-unit](https://github.com/test-unit/test-unit). Bumps the ruby-deps group with 1 update in the /gemfiles/3.1 directory: [test-unit](https://github.com/test-unit/test-unit). Bumps the ruby-deps group with 1 update in the /gemfiles/3.2 directory: [test-unit](https://github.com/test-unit/test-unit). Bumps the ruby-deps group with 1 update in the /gemfiles/3.3 directory: [test-unit](https://github.com/test-unit/test-unit). Bumps the ruby-deps group with 1 update in the /gemfiles/3.4 directory: [test-unit](https://github.com/test-unit/test-unit). Bumps the ruby-deps group with 1 update in the /gemfiles/3.5 directory: [test-unit](https://github.com/test-unit/test-unit). Bumps the ruby-deps group with 1 update in the /gemfiles/jruby directory: [test-unit](https://github.com/test-unit/test-unit). Bumps the ruby-deps group with 1 update in the /gemfiles/truffleruby directory: [test-unit](https://github.com/test-unit/test-unit). Bumps the ruby-deps group with 2 updates in the /gemfiles/typecheck directory: [test-unit](https://github.com/test-unit/test-unit) and [sorbet](https://github.com/sorbet/sorbet). Updates `test-unit` from 3.6.8 to 3.7.0 - [Release notes](https://github.com/test-unit/test-unit/releases) - [Commits](https://github.com/test-unit/test-unit/compare/3.6.8...3.7.0) Updates `test-unit` from 3.6.8 to 3.7.0 - [Release notes](https://github.com/test-unit/test-unit/releases) - [Commits](https://github.com/test-unit/test-unit/compare/3.6.8...3.7.0) Updates `test-unit` from 3.6.8 to 3.7.0 - [Release notes](https://github.com/test-unit/test-unit/releases) - [Commits](https://github.com/test-unit/test-unit/compare/3.6.8...3.7.0) Updates `test-unit` from 3.6.8 to 3.7.0 - [Release notes](https://github.com/test-unit/test-unit/releases) - [Commits](https://github.com/test-unit/test-unit/compare/3.6.8...3.7.0) Updates `test-unit` from 3.6.8 to 3.7.0 - [Release notes](https://github.com/test-unit/test-unit/releases) - [Commits](https://github.com/test-unit/test-unit/compare/3.6.8...3.7.0) Updates `test-unit` from 3.6.8 to 3.7.0 - [Release notes](https://github.com/test-unit/test-unit/releases) - [Commits](https://github.com/test-unit/test-unit/compare/3.6.8...3.7.0) Updates `test-unit` from 3.6.8 to 3.7.0 - [Release notes](https://github.com/test-unit/test-unit/releases) - [Commits](https://github.com/test-unit/test-unit/compare/3.6.8...3.7.0) Updates `test-unit` from 3.6.8 to 3.7.0 - [Release notes](https://github.com/test-unit/test-unit/releases) - [Commits](https://github.com/test-unit/test-unit/compare/3.6.8...3.7.0) Updates `test-unit` from 3.6.8 to 3.7.0 - [Release notes](https://github.com/test-unit/test-unit/releases) - [Commits](https://github.com/test-unit/test-unit/compare/3.6.8...3.7.0) Updates `test-unit` from 3.6.8 to 3.7.0 - [Release notes](https://github.com/test-unit/test-unit/releases) - [Commits](https://github.com/test-unit/test-unit/compare/3.6.8...3.7.0) Updates `test-unit` from 3.6.8 to 3.7.0 - [Release notes](https://github.com/test-unit/test-unit/releases) - [Commits](https://github.com/test-unit/test-unit/compare/3.6.8...3.7.0) Updates `test-unit` from 3.6.8 to 3.7.0 - [Release notes](https://github.com/test-unit/test-unit/releases) - [Commits](https://github.com/test-unit/test-unit/compare/3.6.8...3.7.0) Updates `test-unit` from 3.6.8 to 3.7.0 - [Release notes](https://github.com/test-unit/test-unit/releases) - [Commits](https://github.com/test-unit/test-unit/compare/3.6.8...3.7.0) Updates `test-unit` from 3.6.8 to 3.7.0 - [Release notes](https://github.com/test-unit/test-unit/releases) - [Commits](https://github.com/test-unit/test-unit/compare/3.6.8...3.7.0) Updates `test-unit` from 3.6.8 to 3.7.0 - [Release notes](https://github.com/test-unit/test-unit/releases) - [Commits](https://github.com/test-unit/test-unit/compare/3.6.8...3.7.0) Updates `test-unit` from 3.6.8 to 3.7.0 - [Release notes](https://github.com/test-unit/test-unit/releases) - [Commits](https://github.com/test-unit/test-unit/compare/3.6.8...3.7.0) Updates `test-unit` from 3.6.8 to 3.7.0 - [Release notes](https://github.com/test-unit/test-unit/releases) - [Commits](https://github.com/test-unit/test-unit/compare/3.6.8...3.7.0) Updates `test-unit` from 3.6.8 to 3.7.0 - [Release notes](https://github.com/test-unit/test-unit/releases) - [Commits](https://github.com/test-unit/test-unit/compare/3.6.8...3.7.0) Updates `test-unit` from 3.6.8 to 3.7.0 - [Release notes](https://github.com/test-unit/test-unit/releases) - [Commits](https://github.com/test-unit/test-unit/compare/3.6.8...3.7.0) Updates `test-unit` from 3.6.8 to 3.7.0 - [Release notes](https://github.com/test-unit/test-unit/releases) - [Commits](https://github.com/test-unit/test-unit/compare/3.6.8...3.7.0) Updates `test-unit` from 3.6.8 to 3.7.0 - [Release notes](https://github.com/test-unit/test-unit/releases) - [Commits](https://github.com/test-unit/test-unit/compare/3.6.8...3.7.0) Updates `test-unit` from 3.6.8 to 3.7.0 - [Release notes](https://github.com/test-unit/test-unit/releases) - [Commits](https://github.com/test-unit/test-unit/compare/3.6.8...3.7.0) Updates `test-unit` from 3.6.8 to 3.7.0 - [Release notes](https://github.com/test-unit/test-unit/releases) - [Commits](https://github.com/test-unit/test-unit/compare/3.6.8...3.7.0) Updates `test-unit` from 3.6.8 to 3.7.0 - [Release notes](https://github.com/test-unit/test-unit/releases) - [Commits](https://github.com/test-unit/test-unit/compare/3.6.8...3.7.0) Updates `test-unit` from 3.6.8 to 3.7.0 - [Release notes](https://github.com/test-unit/test-unit/releases) - [Commits](https://github.com/test-unit/test-unit/compare/3.6.8...3.7.0) Updates `test-unit` from 3.6.8 to 3.7.0 - [Release notes](https://github.com/test-unit/test-unit/releases) - [Commits](https://github.com/test-unit/test-unit/compare/3.6.8...3.7.0) Updates `test-unit` from 3.6.8 to 3.7.0 - [Release notes](https://github.com/test-unit/test-unit/releases) - [Commits](https://github.com/test-unit/test-unit/compare/3.6.8...3.7.0) Updates `test-unit` from 3.6.8 to 3.7.0 - [Release notes](https://github.com/test-unit/test-unit/releases) - [Commits](https://github.com/test-unit/test-unit/compare/3.6.8...3.7.0) Updates `test-unit` from 3.6.8 to 3.7.0 - [Release notes](https://github.com/test-unit/test-unit/releases) - [Commits](https://github.com/test-unit/test-unit/compare/3.6.8...3.7.0) Updates `test-unit` from 3.6.8 to 3.7.0 - [Release notes](https://github.com/test-unit/test-unit/releases) - [Commits](https://github.com/test-unit/test-unit/compare/3.6.8...3.7.0) Updates `test-unit` from 3.6.8 to 3.7.0 - [Release notes](https://github.com/test-unit/test-unit/releases) - [Commits](https://github.com/test-unit/test-unit/compare/3.6.8...3.7.0) Updates `test-unit` from 3.6.8 to 3.7.0 - [Release notes](https://github.com/test-unit/test-unit/releases) - [Commits](https://github.com/test-unit/test-unit/compare/3.6.8...3.7.0) Updates `test-unit` from 3.6.8 to 3.7.0 - [Release notes](https://github.com/test-unit/test-unit/releases) - [Commits](https://github.com/test-unit/test-unit/compare/3.6.8...3.7.0) Updates `test-unit` from 3.6.8 to 3.7.0 - [Release notes](https://github.com/test-unit/test-unit/releases) - [Commits](https://github.com/test-unit/test-unit/compare/3.6.8...3.7.0) Updates `test-unit` from 3.6.8 to 3.7.0 - [Release notes](https://github.com/test-unit/test-unit/releases) - [Commits](https://github.com/test-unit/test-unit/compare/3.6.8...3.7.0) Updates `test-unit` from 3.6.8 to 3.7.0 - [Release notes](https://github.com/test-unit/test-unit/releases) - [Commits](https://github.com/test-unit/test-unit/compare/3.6.8...3.7.0) Updates `test-unit` from 3.6.8 to 3.7.0 - [Release notes](https://github.com/test-unit/test-unit/releases) - [Commits](https://github.com/test-unit/test-unit/compare/3.6.8...3.7.0) Updates `test-unit` from 3.6.8 to 3.7.0 - [Release notes](https://github.com/test-unit/test-unit/releases) - [Commits](https://github.com/test-unit/test-unit/compare/3.6.8...3.7.0) Updates `test-unit` from 3.6.8 to 3.7.0 - [Release notes](https://github.com/test-unit/test-unit/releases) - [Commits](https://github.com/test-unit/test-unit/compare/3.6.8...3.7.0) Updates `test-unit` from 3.6.8 to 3.7.0 - [Release notes](https://github.com/test-unit/test-unit/releases) - [Commits](https://github.com/test-unit/test-unit/compare/3.6.8...3.7.0) Updates `test-unit` from 3.6.8 to 3.7.0 - [Release notes](https://github.com/test-unit/test-unit/releases) - [Commits](https://github.com/test-unit/test-unit/compare/3.6.8...3.7.0) Updates `test-unit` from 3.6.8 to 3.7.0 - [Release notes](https://github.com/test-unit/test-unit/releases) - [Commits](https://github.com/test-unit/test-unit/compare/3.6.8...3.7.0) Updates `test-unit` from 3.6.8 to 3.7.0 - [Release notes](https://github.com/test-unit/test-unit/releases) - [Commits](https://github.com/test-unit/test-unit/compare/3.6.8...3.7.0) Updates `test-unit` from 3.6.8 to 3.7.0 - [Release notes](https://github.com/test-unit/test-unit/releases) - [Commits](https://github.com/test-unit/test-unit/compare/3.6.8...3.7.0) Updates `test-unit` from 3.6.8 to 3.7.0 - [Release notes](https://github.com/test-unit/test-unit/releases) - [Commits](https://github.com/test-unit/test-unit/compare/3.6.8...3.7.0) Updates `test-unit` from 3.6.8 to 3.7.0 - [Release notes](https://github.com/test-unit/test-unit/releases) - [Commits](https://github.com/test-unit/test-unit/compare/3.6.8...3.7.0) Updates `test-unit` from 3.6.8 to 3.7.0 - [Release notes](https://github.com/test-unit/test-unit/releases) - [Commits](https://github.com/test-unit/test-unit/compare/3.6.8...3.7.0) Updates `test-unit` from 3.6.8 to 3.7.0 - [Release notes](https://github.com/test-unit/test-unit/releases) - [Commits](https://github.com/test-unit/test-unit/compare/3.6.8...3.7.0) Updates `test-unit` from 3.6.8 to 3.7.0 - [Release notes](https://github.com/test-unit/test-unit/releases) - [Commits](https://github.com/test-unit/test-unit/compare/3.6.8...3.7.0) Updates `test-unit` from 3.6.8 to 3.7.0 - [Release notes](https://github.com/test-unit/test-unit/releases) - [Commits](https://github.com/test-unit/test-unit/compare/3.6.8...3.7.0) Updates `test-unit` from 3.6.8 to 3.7.0 - [Release notes](https://github.com/test-unit/test-unit/releases) - [Commits](https://github.com/test-unit/test-unit/compare/3.6.8...3.7.0) Updates `test-unit` from 3.6.8 to 3.7.0 - [Release notes](https://github.com/test-unit/test-unit/releases) - [Commits](https://github.com/test-unit/test-unit/compare/3.6.8...3.7.0) Updates `test-unit` from 3.6.8 to 3.7.0 - [Release notes](https://github.com/test-unit/test-unit/releases) - [Commits](https://github.com/test-unit/test-unit/compare/3.6.8...3.7.0) Updates `test-unit` from 3.6.8 to 3.7.0 - [Release notes](https://github.com/test-unit/test-unit/releases) - [Commits](https://github.com/test-unit/test-unit/compare/3.6.8...3.7.0) Updates `test-unit` from 3.6.8 to 3.7.0 - [Release notes](https://github.com/test-unit/test-unit/releases) - [Commits](https://github.com/test-unit/test-unit/compare/3.6.8...3.7.0) Updates `test-unit` from 3.6.8 to 3.7.0 - [Release notes](https://github.com/test-unit/test-unit/releases) - [Commits](https://github.com/test-unit/test-unit/compare/3.6.8...3.7.0) Updates `test-unit` from 3.6.8 to 3.7.0 - [Release notes](https://github.com/test-unit/test-unit/releases) - [Commits](https://github.com/test-unit/test-unit/compare/3.6.8...3.7.0) Updates `test-unit` from 3.6.8 to 3.7.0 - [Release notes](https://github.com/test-unit/test-unit/releases) - [Commits](https://github.com/test-unit/test-unit/compare/3.6.8...3.7.0) Updates `test-unit` from 3.6.8 to 3.7.0 - [Release notes](https://github.com/test-unit/test-unit/releases) - [Commits](https://github.com/test-unit/test-unit/compare/3.6.8...3.7.0) Updates `test-unit` from 3.6.8 to 3.7.0 - [Release notes](https://github.com/test-unit/test-unit/releases) - [Commits](https://github.com/test-unit/test-unit/compare/3.6.8...3.7.0) Updates `test-unit` from 3.6.8 to 3.7.0 - [Release notes](https://github.com/test-unit/test-unit/releases) - [Commits](https://github.com/test-unit/test-unit/compare/3.6.8...3.7.0) Updates `test-unit` from 3.6.8 to 3.7.0 - [Release notes](https://github.com/test-unit/test-unit/releases) - [Commits](https://github.com/test-unit/test-unit/compare/3.6.8...3.7.0) Updates `test-unit` from 3.6.8 to 3.7.0 - [Release notes](https://github.com/test-unit/test-unit/releases) - [Commits](https://github.com/test-unit/test-unit/compare/3.6.8...3.7.0) Updates `test-unit` from 3.6.8 to 3.7.0 - [Release notes](https://github.com/test-unit/test-unit/releases) - [Commits](https://github.com/test-unit/test-unit/compare/3.6.8...3.7.0) Updates `test-unit` from 3.6.8 to 3.7.0 - [Release notes](https://github.com/test-unit/test-unit/releases) - [Commits](https://github.com/test-unit/test-unit/compare/3.6.8...3.7.0) Updates `test-unit` from 3.6.8 to 3.7.0 - [Release notes](https://github.com/test-unit/test-unit/releases) - [Commits](https://github.com/test-unit/test-unit/compare/3.6.8...3.7.0) Updates `test-unit` from 3.6.8 to 3.7.0 - [Release notes](https://github.com/test-unit/test-unit/releases) - [Commits](https://github.com/test-unit/test-unit/compare/3.6.8...3.7.0) Updates `test-unit` from 3.6.8 to 3.7.0 - [Release notes](https://github.com/test-unit/test-unit/releases) - [Commits](https://github.com/test-unit/test-unit/compare/3.6.8...3.7.0) Updates `test-unit` from 3.6.8 to 3.7.0 - [Release notes](https://github.com/test-unit/test-unit/releases) - [Commits](https://github.com/test-unit/test-unit/compare/3.6.8...3.7.0) Updates `test-unit` from 3.6.8 to 3.7.0 - [Release notes](https://github.com/test-unit/test-unit/releases) - [Commits](https://github.com/test-unit/test-unit/compare/3.6.8...3.7.0) Updates `test-unit` from 3.6.8 to 3.7.0 - [Release notes](https://github.com/test-unit/test-unit/releases) - [Commits](https://github.com/test-unit/test-unit/compare/3.6.8...3.7.0) Updates `test-unit` from 3.6.8 to 3.7.0 - [Release notes](https://github.com/test-unit/test-unit/releases) - [Commits](https://github.com/test-unit/test-unit/compare/3.6.8...3.7.0) Updates `test-unit` from 3.6.8 to 3.7.0 - [Release notes](https://github.com/test-unit/test-unit/releases) - [Commits](https://github.com/test-unit/test-unit/compare/3.6.8...3.7.0) Updates `test-unit` from 3.6.8 to 3.7.0 - [Release notes](https://github.com/test-unit/test-unit/releases) - [Commits](https://github.com/test-unit/test-unit/compare/3.6.8...3.7.0) Updates `test-unit` from 3.6.8 to 3.7.0 - [Release notes](https://github.com/test-unit/test-unit/releases) - [Commits](https://github.com/test-unit/test-unit/compare/3.6.8...3.7.0) Updates `test-unit` from 3.6.8 to 3.7.0 - [Release notes](https://github.com/test-unit/test-unit/releases) - [Commits](https://github.com/test-unit/test-unit/compare/3.6.8...3.7.0) Updates `test-unit` from 3.6.8 to 3.7.0 - [Release notes](https://github.com/test-unit/test-unit/releases) - [Commits](https://github.com/test-unit/test-unit/compare/3.6.8...3.7.0) Updates `test-unit` from 3.6.8 to 3.7.0 - [Release notes](https://github.com/test-unit/test-unit/releases) - [Commits](https://github.com/test-unit/test-unit/compare/3.6.8...3.7.0) Updates `test-unit` from 3.6.8 to 3.7.0 - [Release notes](https://github.com/test-unit/test-unit/releases) - [Commits](https://github.com/test-unit/test-unit/compare/3.6.8...3.7.0) Updates `test-unit` from 3.6.8 to 3.7.0 - [Release notes](https://github.com/test-unit/test-unit/releases) - [Commits](https://github.com/test-unit/test-unit/compare/3.6.8...3.7.0) Updates `test-unit` from 3.6.8 to 3.7.0 - [Release notes](https://github.com/test-unit/test-unit/releases) - [Commits](https://github.com/test-unit/test-unit/compare/3.6.8...3.7.0) Updates `test-unit` from 3.6.8 to 3.7.0 - [Release notes](https://github.com/test-unit/test-unit/releases) - [Commits](https://github.com/test-unit/test-unit/compare/3.6.8...3.7.0) Updates `test-unit` from 3.6.8 to 3.7.0 - [Release notes](https://github.com/test-unit/test-unit/releases) - [Commits](https://github.com/test-unit/test-unit/compare/3.6.8...3.7.0) Updates `test-unit` from 3.6.8 to 3.7.0 - [Release notes](https://github.com/test-unit/test-unit/releases) - [Commits](https://github.com/test-unit/test-unit/compare/3.6.8...3.7.0) Updates `test-unit` from 3.6.8 to 3.7.0 - [Release notes](https://github.com/test-unit/test-unit/releases) - [Commits](https://github.com/test-unit/test-unit/compare/3.6.8...3.7.0) Updates `test-unit` from 3.6.8 to 3.7.0 - [Release notes](https://github.com/test-unit/test-unit/releases) - [Commits](https://github.com/test-unit/test-unit/compare/3.6.8...3.7.0) Updates `test-unit` from 3.6.8 to 3.7.0 - [Release notes](https://github.com/test-unit/test-unit/releases) - [Commits](https://github.com/test-unit/test-unit/compare/3.6.8...3.7.0) Updates `test-unit` from 3.6.8 to 3.7.0 - [Release notes](https://github.com/test-unit/test-unit/releases) - [Commits](https://github.com/test-unit/test-unit/compare/3.6.8...3.7.0) Updates `test-unit` from 3.6.8 to 3.7.0 - [Release notes](https://github.com/test-unit/test-unit/releases) - [Commits](https://github.com/test-unit/test-unit/compare/3.6.8...3.7.0) Updates `test-unit` from 3.6.8 to 3.7.0 - [Release notes](https://github.com/test-unit/test-unit/releases) - [Commits](https://github.com/test-unit/test-unit/compare/3.6.8...3.7.0) Updates `test-unit` from 3.6.8 to 3.7.0 - [Release notes](https://github.com/test-unit/test-unit/releases) - [Commits](https://github.com/test-unit/test-unit/compare/3.6.8...3.7.0) Updates `test-unit` from 3.6.8 to 3.7.0 - [Release notes](https://github.com/test-unit/test-unit/releases) - [Commits](https://github.com/test-unit/test-unit/compare/3.6.8...3.7.0) Updates `test-unit` from 3.6.8 to 3.7.0 - [Release notes](https://github.com/test-unit/test-unit/releases) - [Commits](https://github.com/test-unit/test-unit/compare/3.6.8...3.7.0) Updates `test-unit` from 3.6.8 to 3.7.0 - [Release notes](https://github.com/test-unit/test-unit/releases) - [Commits](https://github.com/test-unit/test-unit/compare/3.6.8...3.7.0) Updates `test-unit` from 3.6.8 to 3.7.0 - [Release notes](https://github.com/test-unit/test-unit/releases) - [Commits](https://github.com/test-unit/test-unit/compare/3.6.8...3.7.0) Updates `test-unit` from 3.6.8 to 3.7.0 - [Release notes](https://github.com/test-unit/test-unit/releases) - [Commits](https://github.com/test-unit/test-unit/compare/3.6.8...3.7.0) Updates `test-unit` from 3.6.8 to 3.7.0 - [Release notes](https://github.com/test-unit/test-unit/releases) - [Commits](https://github.com/test-unit/test-unit/compare/3.6.8...3.7.0) Updates `test-unit` from 3.6.8 to 3.7.0 - [Release notes](https://github.com/test-unit/test-unit/releases) - [Commits](https://github.com/test-unit/test-unit/compare/3.6.8...3.7.0) Updates `test-unit` from 3.6.8 to 3.7.0 - [Release notes](https://github.com/test-unit/test-unit/releases) - [Commits](https://github.com/test-unit/test-unit/compare/3.6.8...3.7.0) Updates `sorbet` from 0.5.12200 to 0.5.12219 - [Release notes](https://github.com/sorbet/sorbet/releases) - [Commits](https://github.com/sorbet/sorbet/commits) Updates `test-unit` from 3.6.8 to 3.7.0 - [Release notes](https://github.com/test-unit/test-unit/releases) - [Commits](https://github.com/test-unit/test-unit/compare/3.6.8...3.7.0) --- updated-dependencies: - dependency-name: test-unit dependency-version: 3.7.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: test-unit dependency-version: 3.7.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: test-unit dependency-version: 3.7.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: test-unit dependency-version: 3.7.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: test-unit dependency-version: 3.7.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: test-unit dependency-version: 3.7.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: test-unit dependency-version: 3.7.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: test-unit dependency-version: 3.7.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: test-unit dependency-version: 3.7.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: test-unit dependency-version: 3.7.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: test-unit dependency-version: 3.7.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: test-unit dependency-version: 3.7.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: test-unit dependency-version: 3.7.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: test-unit dependency-version: 3.7.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: test-unit dependency-version: 3.7.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: test-unit dependency-version: 3.7.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: test-unit dependency-version: 3.7.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: test-unit dependency-version: 3.7.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: test-unit dependency-version: 3.7.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: test-unit dependency-version: 3.7.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: test-unit dependency-version: 3.7.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: test-unit dependency-version: 3.7.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: test-unit dependency-version: 3.7.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: test-unit dependency-version: 3.7.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: test-unit dependency-version: 3.7.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: test-unit dependency-version: 3.7.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: test-unit dependency-version: 3.7.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: test-unit dependency-version: 3.7.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: test-unit dependency-version: 3.7.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: test-unit dependency-version: 3.7.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: test-unit dependency-version: 3.7.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: test-unit dependency-version: 3.7.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: test-unit dependency-version: 3.7.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: test-unit dependency-version: 3.7.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: test-unit dependency-version: 3.7.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: test-unit dependency-version: 3.7.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: test-unit dependency-version: 3.7.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: test-unit dependency-version: 3.7.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: test-unit dependency-version: 3.7.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: test-unit dependency-version: 3.7.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: test-unit dependency-version: 3.7.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: test-unit dependency-version: 3.7.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: test-unit dependency-version: 3.7.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: test-unit dependency-version: 3.7.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: test-unit dependency-version: 3.7.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: test-unit dependency-version: 3.7.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: test-unit dependency-version: 3.7.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: test-unit dependency-version: 3.7.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: test-unit dependency-version: 3.7.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: test-unit dependency-version: 3.7.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: test-unit dependency-version: 3.7.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: test-unit dependency-version: 3.7.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: test-unit dependency-version: 3.7.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: test-unit dependency-version: 3.7.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: test-unit dependency-version: 3.7.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: test-unit dependency-version: 3.7.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: test-unit dependency-version: 3.7.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: test-unit dependency-version: 3.7.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: test-unit dependency-version: 3.7.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: test-unit dependency-version: 3.7.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: test-unit dependency-version: 3.7.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: test-unit dependency-version: 3.7.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: test-unit dependency-version: 3.7.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: test-unit dependency-version: 3.7.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: test-unit dependency-version: 3.7.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: test-unit dependency-version: 3.7.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: test-unit dependency-version: 3.7.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: test-unit dependency-version: 3.7.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: test-unit dependency-version: 3.7.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: test-unit dependency-version: 3.7.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: test-unit dependency-version: 3.7.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: test-unit dependency-version: 3.7.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: test-unit dependency-version: 3.7.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: test-unit dependency-version: 3.7.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: test-unit dependency-version: 3.7.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: test-unit dependency-version: 3.7.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: test-unit dependency-version: 3.7.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: test-unit dependency-version: 3.7.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: test-unit dependency-version: 3.7.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: test-unit dependency-version: 3.7.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: test-unit dependency-version: 3.7.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: test-unit dependency-version: 3.7.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: test-unit dependency-version: 3.7.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: test-unit dependency-version: 3.7.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: test-unit dependency-version: 3.7.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: test-unit dependency-version: 3.7.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: test-unit dependency-version: 3.7.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: test-unit dependency-version: 3.7.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: test-unit dependency-version: 3.7.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: test-unit dependency-version: 3.7.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: test-unit dependency-version: 3.7.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: test-unit dependency-version: 3.7.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: test-unit dependency-version: 3.7.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: test-unit dependency-version: 3.7.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: test-unit dependency-version: 3.7.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: test-unit dependency-version: 3.7.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: test-unit dependency-version: 3.7.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: test-unit dependency-version: 3.7.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: test-unit dependency-version: 3.7.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: sorbet dependency-version: 0.5.12219 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps - dependency-name: test-unit dependency-version: 3.7.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps ... Signed-off-by: dependabot[bot] --- 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/3.5/Gemfile.lock | 2 +- gemfiles/jruby/Gemfile.lock | 2 +- gemfiles/truffleruby/Gemfile.lock | 2 +- gemfiles/typecheck/Gemfile.lock | 18 +++++++++--------- 10 files changed, 18 insertions(+), 18 deletions(-) diff --git a/gemfiles/2.7/Gemfile.lock b/gemfiles/2.7/Gemfile.lock index f527aca815..72745d80d2 100644 --- a/gemfiles/2.7/Gemfile.lock +++ b/gemfiles/2.7/Gemfile.lock @@ -17,7 +17,7 @@ GEM rake-compiler (1.3.0) rake rbs (3.1.3) - test-unit (3.6.8) + test-unit (3.7.0) power_assert PLATFORMS diff --git a/gemfiles/3.0/Gemfile.lock b/gemfiles/3.0/Gemfile.lock index 0294295200..1c63d1d695 100644 --- a/gemfiles/3.0/Gemfile.lock +++ b/gemfiles/3.0/Gemfile.lock @@ -25,7 +25,7 @@ GEM logger ruby_memcheck (3.0.1) nokogiri - test-unit (3.6.8) + test-unit (3.7.0) power_assert PLATFORMS diff --git a/gemfiles/3.1/Gemfile.lock b/gemfiles/3.1/Gemfile.lock index b9bab66fb9..7d5e598a41 100644 --- a/gemfiles/3.1/Gemfile.lock +++ b/gemfiles/3.1/Gemfile.lock @@ -25,7 +25,7 @@ GEM logger ruby_memcheck (3.0.1) nokogiri - test-unit (3.6.8) + test-unit (3.7.0) power_assert PLATFORMS diff --git a/gemfiles/3.2/Gemfile.lock b/gemfiles/3.2/Gemfile.lock index 44af3438ed..1c766f367d 100644 --- a/gemfiles/3.2/Gemfile.lock +++ b/gemfiles/3.2/Gemfile.lock @@ -25,7 +25,7 @@ GEM logger ruby_memcheck (3.0.1) nokogiri - test-unit (3.6.8) + test-unit (3.7.0) power_assert PLATFORMS diff --git a/gemfiles/3.3/Gemfile.lock b/gemfiles/3.3/Gemfile.lock index 35350a1919..1c7f24a4f3 100644 --- a/gemfiles/3.3/Gemfile.lock +++ b/gemfiles/3.3/Gemfile.lock @@ -25,7 +25,7 @@ GEM logger ruby_memcheck (3.0.1) nokogiri - test-unit (3.6.8) + test-unit (3.7.0) power_assert PLATFORMS diff --git a/gemfiles/3.4/Gemfile.lock b/gemfiles/3.4/Gemfile.lock index 13c9307f53..bc4478717a 100644 --- a/gemfiles/3.4/Gemfile.lock +++ b/gemfiles/3.4/Gemfile.lock @@ -25,7 +25,7 @@ GEM logger ruby_memcheck (3.0.1) nokogiri - test-unit (3.6.8) + test-unit (3.7.0) power_assert PLATFORMS diff --git a/gemfiles/3.5/Gemfile.lock b/gemfiles/3.5/Gemfile.lock index d3da363978..13e2ccb495 100644 --- a/gemfiles/3.5/Gemfile.lock +++ b/gemfiles/3.5/Gemfile.lock @@ -26,7 +26,7 @@ GEM logger ruby_memcheck (3.0.1) nokogiri - test-unit (3.6.8) + test-unit (3.7.0) power_assert PLATFORMS diff --git a/gemfiles/jruby/Gemfile.lock b/gemfiles/jruby/Gemfile.lock index ceefde1070..86d641f8f9 100644 --- a/gemfiles/jruby/Gemfile.lock +++ b/gemfiles/jruby/Gemfile.lock @@ -16,7 +16,7 @@ GEM rake (13.3.0) rake-compiler (1.3.0) rake - test-unit (3.6.8) + test-unit (3.7.0) power_assert PLATFORMS diff --git a/gemfiles/truffleruby/Gemfile.lock b/gemfiles/truffleruby/Gemfile.lock index 812e91dde2..44fb5b2a80 100644 --- a/gemfiles/truffleruby/Gemfile.lock +++ b/gemfiles/truffleruby/Gemfile.lock @@ -15,7 +15,7 @@ GEM rake (13.3.0) rake-compiler (1.3.0) rake - test-unit (3.6.8) + test-unit (3.7.0) power_assert PLATFORMS diff --git a/gemfiles/typecheck/Gemfile.lock b/gemfiles/typecheck/Gemfile.lock index 166e29449a..ebce39efaf 100644 --- a/gemfiles/typecheck/Gemfile.lock +++ b/gemfiles/typecheck/Gemfile.lock @@ -62,14 +62,14 @@ GEM sexp_processor (~> 4.16) securerandom (0.4.1) sexp_processor (4.17.3) - sorbet (0.5.12200) - sorbet-static (= 0.5.12200) - sorbet-runtime (0.5.12200) - sorbet-static (0.5.12200-universal-darwin) - sorbet-static (0.5.12200-x86_64-linux) - sorbet-static-and-runtime (0.5.12200) - sorbet (= 0.5.12200) - sorbet-runtime (= 0.5.12200) + sorbet (0.5.12219) + sorbet-static (= 0.5.12219) + sorbet-runtime (0.5.12219) + sorbet-static (0.5.12219-universal-darwin) + sorbet-static (0.5.12219-x86_64-linux) + sorbet-static-and-runtime (0.5.12219) + sorbet (= 0.5.12219) + sorbet-runtime (= 0.5.12219) spoom (1.6.1) erubi (>= 1.10.0) prism (>= 0.28.0) @@ -106,7 +106,7 @@ GEM yard-sorbet terminal-table (4.0.0) unicode-display_width (>= 1.1.1, < 4) - test-unit (3.6.8) + test-unit (3.7.0) power_assert thor (1.3.2) tzinfo (2.0.6) From 8b036f1773834cc8fa26d15e9be9013b5a6c972a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 14 Jul 2025 19:08:38 +0000 Subject: [PATCH 060/333] Bump sorbet Bumps the ruby-deps group with 1 update in the /gemfiles/typecheck directory: [sorbet](https://github.com/sorbet/sorbet). Updates `sorbet` from 0.5.12219 to 0.5.12222 - [Release notes](https://github.com/sorbet/sorbet/releases) - [Commits](https://github.com/sorbet/sorbet/commits) --- updated-dependencies: - dependency-name: sorbet dependency-version: 0.5.12222 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps ... Signed-off-by: dependabot[bot] --- gemfiles/typecheck/Gemfile.lock | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/gemfiles/typecheck/Gemfile.lock b/gemfiles/typecheck/Gemfile.lock index ebce39efaf..274837fb4c 100644 --- a/gemfiles/typecheck/Gemfile.lock +++ b/gemfiles/typecheck/Gemfile.lock @@ -62,14 +62,14 @@ GEM sexp_processor (~> 4.16) securerandom (0.4.1) sexp_processor (4.17.3) - sorbet (0.5.12219) - sorbet-static (= 0.5.12219) - sorbet-runtime (0.5.12219) - sorbet-static (0.5.12219-universal-darwin) - sorbet-static (0.5.12219-x86_64-linux) - sorbet-static-and-runtime (0.5.12219) - sorbet (= 0.5.12219) - sorbet-runtime (= 0.5.12219) + sorbet (0.5.12222) + sorbet-static (= 0.5.12222) + sorbet-runtime (0.5.12222) + sorbet-static (0.5.12222-universal-darwin) + sorbet-static (0.5.12222-x86_64-linux) + sorbet-static-and-runtime (0.5.12222) + sorbet (= 0.5.12222) + sorbet-runtime (= 0.5.12222) spoom (1.6.1) erubi (>= 1.10.0) prism (>= 0.28.0) From ca14c091024d27dc412ef79017a292273fe7495c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 14 Jul 2025 20:00:03 +0000 Subject: [PATCH 061/333] Bump org.junit.jupiter:junit-jupiter-engine Bumps the java-deps group in /java-wasm with 1 update: [org.junit.jupiter:junit-jupiter-engine](https://github.com/junit-team/junit-framework). Updates `org.junit.jupiter:junit-jupiter-engine` from 5.13.2 to 5.13.3 - [Release notes](https://github.com/junit-team/junit-framework/releases) - [Commits](https://github.com/junit-team/junit-framework/compare/r5.13.2...r5.13.3) --- updated-dependencies: - dependency-name: org.junit.jupiter:junit-jupiter-engine dependency-version: 5.13.3 dependency-type: direct:development update-type: version-update:semver-patch dependency-group: java-deps ... Signed-off-by: dependabot[bot] --- java-wasm/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java-wasm/pom.xml b/java-wasm/pom.xml index ee7f5055b6..7b313ca3d3 100644 --- a/java-wasm/pom.xml +++ b/java-wasm/pom.xml @@ -16,7 +16,7 @@ 11 1.3.0 - 5.13.2 + 5.13.3 From 0513cf22ad51bd9c596388bd37406f0dafa99181 Mon Sep 17 00:00:00 2001 From: Yusuke Endoh Date: Fri, 13 Jun 2025 12:44:08 +0900 Subject: [PATCH 062/333] Reject `true && not true` A command-call-like `not true` must be rejected after `&&` and `||`. https://bugs.ruby-lang.org/issues/21337 --- config.yml | 1 + src/prism.c | 5 +++++ templates/src/diagnostic.c.erb | 1 + test/prism/errors/command_calls_31.txt | 12 ++++++++++++ 4 files changed, 19 insertions(+) create mode 100644 test/prism/errors/command_calls_31.txt diff --git a/config.yml b/config.yml index 0046810e4e..ee34047dbe 100644 --- a/config.yml +++ b/config.yml @@ -101,6 +101,7 @@ errors: - EXPECT_FOR_DELIMITER - EXPECT_IDENT_REQ_PARAMETER - EXPECT_IN_DELIMITER + - EXPECT_LPAREN_AFTER_NOT - EXPECT_LPAREN_REQ_PARAMETER - EXPECT_MESSAGE - EXPECT_RBRACKET diff --git a/src/prism.c b/src/prism.c index c5f5744f58..7e3477cf0e 100644 --- a/src/prism.c +++ b/src/prism.c @@ -19756,6 +19756,11 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b pm_arguments_t arguments = { 0 }; pm_node_t *receiver = NULL; + if (!accepts_command_call && !match1(parser, PM_TOKEN_PARENTHESIS_LEFT)) { + pm_parser_err_current(parser, PM_ERR_EXPECT_LPAREN_AFTER_NOT); + return (pm_node_t *) pm_missing_node_create(parser, parser->current.start, parser->current.end); + } + accept1(parser, PM_TOKEN_NEWLINE); if (accept1(parser, PM_TOKEN_PARENTHESIS_LEFT)) { diff --git a/templates/src/diagnostic.c.erb b/templates/src/diagnostic.c.erb index ce98dc5acd..389b1dc484 100644 --- a/templates/src/diagnostic.c.erb +++ b/templates/src/diagnostic.c.erb @@ -184,6 +184,7 @@ static const pm_diagnostic_data_t diagnostic_messages[PM_DIAGNOSTIC_ID_MAX] = { [PM_ERR_EXPECT_FOR_DELIMITER] = { "unexpected %s; expected a 'do', newline, or ';' after the 'for' loop collection", PM_ERROR_LEVEL_SYNTAX }, [PM_ERR_EXPECT_IDENT_REQ_PARAMETER] = { "expected an identifier for the required parameter", PM_ERROR_LEVEL_SYNTAX }, [PM_ERR_EXPECT_IN_DELIMITER] = { "expected a delimiter after the patterns of an `in` clause", PM_ERROR_LEVEL_SYNTAX }, + [PM_ERR_EXPECT_LPAREN_AFTER_NOT] = { "expected a `(` after `not`", PM_ERROR_LEVEL_SYNTAX }, [PM_ERR_EXPECT_LPAREN_REQ_PARAMETER] = { "expected a `(` to start a required parameter", PM_ERROR_LEVEL_SYNTAX }, [PM_ERR_EXPECT_MESSAGE] = { "unexpected %s; expecting a message to send to the receiver", PM_ERROR_LEVEL_SYNTAX }, [PM_ERR_EXPECT_RBRACKET] = { "expected a matching `]`", PM_ERROR_LEVEL_SYNTAX }, diff --git a/test/prism/errors/command_calls_31.txt b/test/prism/errors/command_calls_31.txt new file mode 100644 index 0000000000..72d5fc588f --- /dev/null +++ b/test/prism/errors/command_calls_31.txt @@ -0,0 +1,12 @@ +true && not true + ^~~~ expected a `(` after `not` + ^~~~ unexpected 'true', expecting end-of-input + +true || not true + ^~~~ expected a `(` after `not` + ^~~~ unexpected 'true', expecting end-of-input + +true && not (true) + ^ expected a `(` after `not` + ^ unexpected '(', expecting end-of-input + From d9151b8a82cc95cb88e2e8b546c43acc514b0e66 Mon Sep 17 00:00:00 2001 From: ydah Date: Mon, 7 Jul 2025 19:06:26 +0900 Subject: [PATCH 063/333] Improve error handling for missing parentheses after 'not' in command calls --- config.yml | 3 ++- src/prism.c | 11 ++++++++++- templates/src/diagnostic.c.erb | 3 ++- test/prism/errors/command_calls_31.txt | 7 ++++++- 4 files changed, 20 insertions(+), 4 deletions(-) diff --git a/config.yml b/config.yml index ee34047dbe..b37b98cbdf 100644 --- a/config.yml +++ b/config.yml @@ -101,7 +101,8 @@ errors: - EXPECT_FOR_DELIMITER - EXPECT_IDENT_REQ_PARAMETER - EXPECT_IN_DELIMITER - - EXPECT_LPAREN_AFTER_NOT + - EXPECT_LPAREN_AFTER_NOT_LPAREN + - EXPECT_LPAREN_AFTER_NOT_OTHER - EXPECT_LPAREN_REQ_PARAMETER - EXPECT_MESSAGE - EXPECT_RBRACKET diff --git a/src/prism.c b/src/prism.c index 7e3477cf0e..eb7a4f7b81 100644 --- a/src/prism.c +++ b/src/prism.c @@ -19756,8 +19756,17 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b pm_arguments_t arguments = { 0 }; pm_node_t *receiver = NULL; + // If we do not accept a command call, then we also do not accept a + // not without parentheses. In this case we need to reject this + // syntax. if (!accepts_command_call && !match1(parser, PM_TOKEN_PARENTHESIS_LEFT)) { - pm_parser_err_current(parser, PM_ERR_EXPECT_LPAREN_AFTER_NOT); + if (match1(parser, PM_TOKEN_PARENTHESIS_LEFT_PARENTHESES)) { + pm_parser_err(parser, parser->previous.end, parser->previous.end + 1, PM_ERR_EXPECT_LPAREN_AFTER_NOT_LPAREN); + } else { + accept1(parser, PM_TOKEN_NEWLINE); + pm_parser_err_current(parser, PM_ERR_EXPECT_LPAREN_AFTER_NOT_OTHER); + } + return (pm_node_t *) pm_missing_node_create(parser, parser->current.start, parser->current.end); } diff --git a/templates/src/diagnostic.c.erb b/templates/src/diagnostic.c.erb index 389b1dc484..9a30a57e3b 100644 --- a/templates/src/diagnostic.c.erb +++ b/templates/src/diagnostic.c.erb @@ -184,7 +184,8 @@ static const pm_diagnostic_data_t diagnostic_messages[PM_DIAGNOSTIC_ID_MAX] = { [PM_ERR_EXPECT_FOR_DELIMITER] = { "unexpected %s; expected a 'do', newline, or ';' after the 'for' loop collection", PM_ERROR_LEVEL_SYNTAX }, [PM_ERR_EXPECT_IDENT_REQ_PARAMETER] = { "expected an identifier for the required parameter", PM_ERROR_LEVEL_SYNTAX }, [PM_ERR_EXPECT_IN_DELIMITER] = { "expected a delimiter after the patterns of an `in` clause", PM_ERROR_LEVEL_SYNTAX }, - [PM_ERR_EXPECT_LPAREN_AFTER_NOT] = { "expected a `(` after `not`", PM_ERROR_LEVEL_SYNTAX }, + [PM_ERR_EXPECT_LPAREN_AFTER_NOT_LPAREN] = { "expected a `(` immediately after `not`", PM_ERROR_LEVEL_SYNTAX }, + [PM_ERR_EXPECT_LPAREN_AFTER_NOT_OTHER] = { "expected a `(` after `not`", PM_ERROR_LEVEL_SYNTAX }, [PM_ERR_EXPECT_LPAREN_REQ_PARAMETER] = { "expected a `(` to start a required parameter", PM_ERROR_LEVEL_SYNTAX }, [PM_ERR_EXPECT_MESSAGE] = { "unexpected %s; expecting a message to send to the receiver", PM_ERROR_LEVEL_SYNTAX }, [PM_ERR_EXPECT_RBRACKET] = { "expected a matching `]`", PM_ERROR_LEVEL_SYNTAX }, diff --git a/test/prism/errors/command_calls_31.txt b/test/prism/errors/command_calls_31.txt index 72d5fc588f..e662b25444 100644 --- a/test/prism/errors/command_calls_31.txt +++ b/test/prism/errors/command_calls_31.txt @@ -7,6 +7,11 @@ true || not true ^~~~ unexpected 'true', expecting end-of-input true && not (true) - ^ expected a `(` after `not` + ^ expected a `(` immediately after `not` ^ unexpected '(', expecting end-of-input +true && not +true +^~~~ expected a `(` after `not` +^~~~ unexpected 'true', expecting end-of-input + From 70413ed4dd96c92bb71f2b82dbe05d164d0d2e68 Mon Sep 17 00:00:00 2001 From: Stan Lo Date: Thu, 17 Jul 2025 12:29:40 +0100 Subject: [PATCH 064/333] Allow command calls in endless method bodies regardless of context Previously, endless method definitions like `x = def f = p 1` would fail to parse because command calls (method calls without parentheses) were only accepted when the surrounding binding power was less than `PM_BINDING_POWER_COMPOSITION` (8). In assignment contexts with binding power 18, this condition was false, causing parse errors. This fix ensures command calls are always accepted in endless method bodies by passing `true` for `accepts_command_call`, making the method body parse consistently regardless of where the method is defined. --- snapshots/endless_methods.txt | 148 +++++++++++++++--------- src/prism.c | 2 +- test/prism/fixtures/endless_methods.txt | 2 + 3 files changed, 97 insertions(+), 55 deletions(-) diff --git a/snapshots/endless_methods.txt b/snapshots/endless_methods.txt index 29f701ed17..512c87d552 100644 --- a/snapshots/endless_methods.txt +++ b/snapshots/endless_methods.txt @@ -1,10 +1,10 @@ -@ ProgramNode (location: (1,0)-(5,22)) +@ ProgramNode (location: (1,0)-(7,15)) ├── flags: ∅ -├── locals: [] +├── locals: [:x] └── statements: - @ StatementsNode (location: (1,0)-(5,22)) + @ StatementsNode (location: (1,0)-(7,15)) ├── flags: ∅ - └── body: (length: 3) + └── body: (length: 4) ├── @ DefNode (location: (1,0)-(1,11)) │ ├── flags: newline │ ├── name: :foo @@ -61,55 +61,95 @@ │ ├── rparen_loc: ∅ │ ├── equal_loc: (3,8)-(3,9) = "=" │ └── end_keyword_loc: ∅ - └── @ DefNode (location: (5,0)-(5,22)) + ├── @ DefNode (location: (5,0)-(5,22)) + │ ├── flags: newline + │ ├── name: :method + │ ├── name_loc: (5,4)-(5,10) = "method" + │ ├── receiver: ∅ + │ ├── parameters: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (5,13)-(5,22)) + │ │ ├── flags: ∅ + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (5,13)-(5,22)) + │ │ ├── flags: ∅ + │ │ ├── receiver: + │ │ │ @ CallNode (location: (5,13)-(5,18)) + │ │ │ ├── flags: ∅ + │ │ │ ├── receiver: + │ │ │ │ @ IntegerNode (location: (5,13)-(5,14)) + │ │ │ │ ├── flags: static_literal, decimal + │ │ │ │ └── value: 1 + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :+ + │ │ │ ├── message_loc: (5,15)-(5,16) = "+" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: + │ │ │ │ @ ArgumentsNode (location: (5,17)-(5,18)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── arguments: (length: 1) + │ │ │ │ └── @ IntegerNode (location: (5,17)-(5,18)) + │ │ │ │ ├── flags: static_literal, decimal + │ │ │ │ └── value: 2 + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :+ + │ │ ├── message_loc: (5,19)-(5,20) = "+" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (5,21)-(5,22)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ IntegerNode (location: (5,21)-(5,22)) + │ │ │ ├── flags: static_literal, decimal + │ │ │ └── value: 3 + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── locals: [] + │ ├── def_keyword_loc: (5,0)-(5,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── equal_loc: (5,11)-(5,12) = "=" + │ └── end_keyword_loc: ∅ + └── @ LocalVariableWriteNode (location: (7,0)-(7,15)) ├── flags: newline - ├── name: :method - ├── name_loc: (5,4)-(5,10) = "method" - ├── receiver: ∅ - ├── parameters: ∅ - ├── body: - │ @ StatementsNode (location: (5,13)-(5,22)) + ├── name: :x + ├── depth: 0 + ├── name_loc: (7,0)-(7,1) = "x" + ├── value: + │ @ DefNode (location: (7,4)-(7,15)) │ ├── flags: ∅ - │ └── body: (length: 1) - │ └── @ CallNode (location: (5,13)-(5,22)) - │ ├── flags: ∅ - │ ├── receiver: - │ │ @ CallNode (location: (5,13)-(5,18)) - │ │ ├── flags: ∅ - │ │ ├── receiver: - │ │ │ @ IntegerNode (location: (5,13)-(5,14)) - │ │ │ ├── flags: static_literal, decimal - │ │ │ └── value: 1 - │ │ ├── call_operator_loc: ∅ - │ │ ├── name: :+ - │ │ ├── message_loc: (5,15)-(5,16) = "+" - │ │ ├── opening_loc: ∅ - │ │ ├── arguments: - │ │ │ @ ArgumentsNode (location: (5,17)-(5,18)) - │ │ │ ├── flags: ∅ - │ │ │ └── arguments: (length: 1) - │ │ │ └── @ IntegerNode (location: (5,17)-(5,18)) - │ │ │ ├── flags: static_literal, decimal - │ │ │ └── value: 2 - │ │ ├── closing_loc: ∅ - │ │ └── block: ∅ - │ ├── call_operator_loc: ∅ - │ ├── name: :+ - │ ├── message_loc: (5,19)-(5,20) = "+" - │ ├── opening_loc: ∅ - │ ├── arguments: - │ │ @ ArgumentsNode (location: (5,21)-(5,22)) - │ │ ├── flags: ∅ - │ │ └── arguments: (length: 1) - │ │ └── @ IntegerNode (location: (5,21)-(5,22)) - │ │ ├── flags: static_literal, decimal - │ │ └── value: 3 - │ ├── closing_loc: ∅ - │ └── block: ∅ - ├── locals: [] - ├── def_keyword_loc: (5,0)-(5,3) = "def" - ├── operator_loc: ∅ - ├── lparen_loc: ∅ - ├── rparen_loc: ∅ - ├── equal_loc: (5,11)-(5,12) = "=" - └── end_keyword_loc: ∅ + │ ├── name: :f + │ ├── name_loc: (7,8)-(7,9) = "f" + │ ├── receiver: ∅ + │ ├── parameters: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (7,12)-(7,15)) + │ │ ├── flags: ∅ + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (7,12)-(7,15)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :p + │ │ ├── message_loc: (7,12)-(7,13) = "p" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (7,14)-(7,15)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ IntegerNode (location: (7,14)-(7,15)) + │ │ │ ├── flags: static_literal, decimal + │ │ │ └── value: 1 + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── locals: [] + │ ├── def_keyword_loc: (7,4)-(7,7) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── equal_loc: (7,10)-(7,11) = "=" + │ └── end_keyword_loc: ∅ + └── operator_loc: (7,2)-(7,3) = "=" diff --git a/src/prism.c b/src/prism.c index eb7a4f7b81..6022039bea 100644 --- a/src/prism.c +++ b/src/prism.c @@ -19501,7 +19501,7 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b pm_do_loop_stack_push(parser, false); statements = (pm_node_t *) pm_statements_node_create(parser); - pm_node_t *statement = parse_expression(parser, PM_BINDING_POWER_DEFINED + 1, binding_power < PM_BINDING_POWER_COMPOSITION, false, PM_ERR_DEF_ENDLESS, (uint16_t) (depth + 1)); + pm_node_t *statement = parse_expression(parser, PM_BINDING_POWER_DEFINED + 1, true, false, PM_ERR_DEF_ENDLESS, (uint16_t) (depth + 1)); if (accept1(parser, PM_TOKEN_KEYWORD_RESCUE_MODIFIER)) { context_push(parser, PM_CONTEXT_RESCUE_MODIFIER); diff --git a/test/prism/fixtures/endless_methods.txt b/test/prism/fixtures/endless_methods.txt index 8c2f2a30cc..7eb3bf4318 100644 --- a/test/prism/fixtures/endless_methods.txt +++ b/test/prism/fixtures/endless_methods.txt @@ -3,3 +3,5 @@ def foo = 1 def bar = A "" def method = 1 + 2 + 3 + +x = def f = p 1 From e5ca485f4e7b5f2a0fe933315d43d8f1d422a6a5 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Thu, 17 Jul 2025 09:23:09 -0700 Subject: [PATCH 065/333] Revert "Merge pull request #3598 from Shopify/fix-3473" This reverts commit bc446fb9795e9c9fed8450945ecf277b545031a9, reversing changes made to 71432af1eb4964e128c695ae6aeba13e5526c417. --- snapshots/endless_methods.txt | 148 +++++++++--------------- src/prism.c | 2 +- test/prism/fixtures/endless_methods.txt | 2 - 3 files changed, 55 insertions(+), 97 deletions(-) diff --git a/snapshots/endless_methods.txt b/snapshots/endless_methods.txt index 512c87d552..29f701ed17 100644 --- a/snapshots/endless_methods.txt +++ b/snapshots/endless_methods.txt @@ -1,10 +1,10 @@ -@ ProgramNode (location: (1,0)-(7,15)) +@ ProgramNode (location: (1,0)-(5,22)) ├── flags: ∅ -├── locals: [:x] +├── locals: [] └── statements: - @ StatementsNode (location: (1,0)-(7,15)) + @ StatementsNode (location: (1,0)-(5,22)) ├── flags: ∅ - └── body: (length: 4) + └── body: (length: 3) ├── @ DefNode (location: (1,0)-(1,11)) │ ├── flags: newline │ ├── name: :foo @@ -61,95 +61,55 @@ │ ├── rparen_loc: ∅ │ ├── equal_loc: (3,8)-(3,9) = "=" │ └── end_keyword_loc: ∅ - ├── @ DefNode (location: (5,0)-(5,22)) - │ ├── flags: newline - │ ├── name: :method - │ ├── name_loc: (5,4)-(5,10) = "method" - │ ├── receiver: ∅ - │ ├── parameters: ∅ - │ ├── body: - │ │ @ StatementsNode (location: (5,13)-(5,22)) - │ │ ├── flags: ∅ - │ │ └── body: (length: 1) - │ │ └── @ CallNode (location: (5,13)-(5,22)) - │ │ ├── flags: ∅ - │ │ ├── receiver: - │ │ │ @ CallNode (location: (5,13)-(5,18)) - │ │ │ ├── flags: ∅ - │ │ │ ├── receiver: - │ │ │ │ @ IntegerNode (location: (5,13)-(5,14)) - │ │ │ │ ├── flags: static_literal, decimal - │ │ │ │ └── value: 1 - │ │ │ ├── call_operator_loc: ∅ - │ │ │ ├── name: :+ - │ │ │ ├── message_loc: (5,15)-(5,16) = "+" - │ │ │ ├── opening_loc: ∅ - │ │ │ ├── arguments: - │ │ │ │ @ ArgumentsNode (location: (5,17)-(5,18)) - │ │ │ │ ├── flags: ∅ - │ │ │ │ └── arguments: (length: 1) - │ │ │ │ └── @ IntegerNode (location: (5,17)-(5,18)) - │ │ │ │ ├── flags: static_literal, decimal - │ │ │ │ └── value: 2 - │ │ │ ├── closing_loc: ∅ - │ │ │ └── block: ∅ - │ │ ├── call_operator_loc: ∅ - │ │ ├── name: :+ - │ │ ├── message_loc: (5,19)-(5,20) = "+" - │ │ ├── opening_loc: ∅ - │ │ ├── arguments: - │ │ │ @ ArgumentsNode (location: (5,21)-(5,22)) - │ │ │ ├── flags: ∅ - │ │ │ └── arguments: (length: 1) - │ │ │ └── @ IntegerNode (location: (5,21)-(5,22)) - │ │ │ ├── flags: static_literal, decimal - │ │ │ └── value: 3 - │ │ ├── closing_loc: ∅ - │ │ └── block: ∅ - │ ├── locals: [] - │ ├── def_keyword_loc: (5,0)-(5,3) = "def" - │ ├── operator_loc: ∅ - │ ├── lparen_loc: ∅ - │ ├── rparen_loc: ∅ - │ ├── equal_loc: (5,11)-(5,12) = "=" - │ └── end_keyword_loc: ∅ - └── @ LocalVariableWriteNode (location: (7,0)-(7,15)) + └── @ DefNode (location: (5,0)-(5,22)) ├── flags: newline - ├── name: :x - ├── depth: 0 - ├── name_loc: (7,0)-(7,1) = "x" - ├── value: - │ @ DefNode (location: (7,4)-(7,15)) + ├── name: :method + ├── name_loc: (5,4)-(5,10) = "method" + ├── receiver: ∅ + ├── parameters: ∅ + ├── body: + │ @ StatementsNode (location: (5,13)-(5,22)) │ ├── flags: ∅ - │ ├── name: :f - │ ├── name_loc: (7,8)-(7,9) = "f" - │ ├── receiver: ∅ - │ ├── parameters: ∅ - │ ├── body: - │ │ @ StatementsNode (location: (7,12)-(7,15)) - │ │ ├── flags: ∅ - │ │ └── body: (length: 1) - │ │ └── @ CallNode (location: (7,12)-(7,15)) - │ │ ├── flags: ignore_visibility - │ │ ├── receiver: ∅ - │ │ ├── call_operator_loc: ∅ - │ │ ├── name: :p - │ │ ├── message_loc: (7,12)-(7,13) = "p" - │ │ ├── opening_loc: ∅ - │ │ ├── arguments: - │ │ │ @ ArgumentsNode (location: (7,14)-(7,15)) - │ │ │ ├── flags: ∅ - │ │ │ └── arguments: (length: 1) - │ │ │ └── @ IntegerNode (location: (7,14)-(7,15)) - │ │ │ ├── flags: static_literal, decimal - │ │ │ └── value: 1 - │ │ ├── closing_loc: ∅ - │ │ └── block: ∅ - │ ├── locals: [] - │ ├── def_keyword_loc: (7,4)-(7,7) = "def" - │ ├── operator_loc: ∅ - │ ├── lparen_loc: ∅ - │ ├── rparen_loc: ∅ - │ ├── equal_loc: (7,10)-(7,11) = "=" - │ └── end_keyword_loc: ∅ - └── operator_loc: (7,2)-(7,3) = "=" + │ └── body: (length: 1) + │ └── @ CallNode (location: (5,13)-(5,22)) + │ ├── flags: ∅ + │ ├── receiver: + │ │ @ CallNode (location: (5,13)-(5,18)) + │ │ ├── flags: ∅ + │ │ ├── receiver: + │ │ │ @ IntegerNode (location: (5,13)-(5,14)) + │ │ │ ├── flags: static_literal, decimal + │ │ │ └── value: 1 + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :+ + │ │ ├── message_loc: (5,15)-(5,16) = "+" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (5,17)-(5,18)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ IntegerNode (location: (5,17)-(5,18)) + │ │ │ ├── flags: static_literal, decimal + │ │ │ └── value: 2 + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :+ + │ ├── message_loc: (5,19)-(5,20) = "+" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (5,21)-(5,22)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ IntegerNode (location: (5,21)-(5,22)) + │ │ ├── flags: static_literal, decimal + │ │ └── value: 3 + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── locals: [] + ├── def_keyword_loc: (5,0)-(5,3) = "def" + ├── operator_loc: ∅ + ├── lparen_loc: ∅ + ├── rparen_loc: ∅ + ├── equal_loc: (5,11)-(5,12) = "=" + └── end_keyword_loc: ∅ diff --git a/src/prism.c b/src/prism.c index 465c42c9a6..6d4381565c 100644 --- a/src/prism.c +++ b/src/prism.c @@ -19501,7 +19501,7 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b pm_do_loop_stack_push(parser, false); statements = (pm_node_t *) pm_statements_node_create(parser); - pm_node_t *statement = parse_expression(parser, PM_BINDING_POWER_DEFINED + 1, true, false, PM_ERR_DEF_ENDLESS, (uint16_t) (depth + 1)); + pm_node_t *statement = parse_expression(parser, PM_BINDING_POWER_DEFINED + 1, binding_power < PM_BINDING_POWER_COMPOSITION, false, PM_ERR_DEF_ENDLESS, (uint16_t) (depth + 1)); if (accept1(parser, PM_TOKEN_KEYWORD_RESCUE_MODIFIER)) { context_push(parser, PM_CONTEXT_RESCUE_MODIFIER); diff --git a/test/prism/fixtures/endless_methods.txt b/test/prism/fixtures/endless_methods.txt index 7eb3bf4318..8c2f2a30cc 100644 --- a/test/prism/fixtures/endless_methods.txt +++ b/test/prism/fixtures/endless_methods.txt @@ -3,5 +3,3 @@ def foo = 1 def bar = A "" def method = 1 + 2 + 3 - -x = def f = p 1 From 34ae2dcc037a7fb7a31d63ff787c54064d94469e Mon Sep 17 00:00:00 2001 From: Earlopain <14981592+Earlopain@users.noreply.github.com> Date: Thu, 17 Jul 2025 19:23:25 +0200 Subject: [PATCH 066/333] RuboCop now uses prism as a first-class (translation) parser Since rubocop 1.75 it just does the right thing, so no need to specifically call it out anymore. --- docs/parser_translation.md | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/docs/parser_translation.md b/docs/parser_translation.md index dc0f452f2c..f4aeef9a95 100644 --- a/docs/parser_translation.md +++ b/docs/parser_translation.md @@ -22,27 +22,3 @@ All the parsers are autoloaded, so you don't have to worry about requiring them If you also need to parse Ruby versions below 3.3 (which `prism` has no support for), check out [this guide](https://github.com/whitequark/parser/blob/master/doc/PRISM_TRANSLATION.md) from the `parser` gem on how to use both in conjunction. - -### RuboCop - -Prism as a parser engine is directly supported since RuboCop 1.62. - -First, specify `prism` in your Gemfile: - -```ruby -gem "prism" -``` - -To use Prism with RuboCop, specify `ParserEngine` and `TargetRubyVersion` in your RuboCop configuration file: - -```yaml -AllCops: - ParserEngine: parser_prism - TargetRubyVersion: 3.3 -``` - -The default value for `ParserEngine` is `parser_whitequark`, which indicates the Parser gem. You need to explicitly switch it to `parser_prism` to indicate Prism. Additionally, the value for `TargetRubyVersion` must be specified as `3.3` or higher, as Prism supports parsing versions of Ruby 3.3 and higher. -The parser class is determined by the combination of values for `ParserEngine` and `TargetRubyVersion`. For example, if `TargetRubyVersion: 3.3`, parsing is performed by `Prism::Translation::Parser33`, and for `TargetRubyVersion 3.4`, parsing is performed by `Prism::Translation::Parser34`. - -For further information, please refer to the RuboCop documentation: -https://docs.rubocop.org/rubocop/configuration.html#setting-the-parser-engine From 4e5e3fcf8f6760ee75ad700769bcea85b29875a8 Mon Sep 17 00:00:00 2001 From: Alexander Momchilov Date: Thu, 17 Jul 2025 14:34:00 -0400 Subject: [PATCH 067/333] Add Sorbet to example applications list https://github.com/sorbet/sorbet/pull/8485 --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index b601ee5262..756f8a0eff 100644 --- a/README.md +++ b/README.md @@ -139,3 +139,4 @@ Prism has been integrated into the majority of Ruby runtimes, many libraries, an ### Applications * [gem.sh](https://github.com/marcoroth/gem.sh/pull/96) +* [Sorbet](https://github.com/sorbet/sorbet) From bba926ed7d4ba2f82005264a0a4c529590ca2cc9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Mendon=C3=A7a=20Fran=C3=A7a?= Date: Fri, 18 Jul 2025 15:12:12 -0400 Subject: [PATCH 068/333] Fix GitHub pages workflow We should be using the stable rust toolchain --- .github/workflows/github-pages.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/github-pages.yml b/.github/workflows/github-pages.yml index 14c368c737..96174d2a67 100644 --- a/.github/workflows/github-pages.yml +++ b/.github/workflows/github-pages.yml @@ -36,7 +36,7 @@ jobs: - name: Set up Rust uses: dtolnay/rust-toolchain@master with: - toolchain: "1.71.1" + toolchain: stable - name: Install doxygen and dependencies run: | sudo apt-get update From cf3bbf9d2c21fca6c656e83883f9d37f683227b0 Mon Sep 17 00:00:00 2001 From: S-H-GAMELINKS Date: Mon, 21 Jul 2025 11:00:33 +0900 Subject: [PATCH 069/333] Make `it = it` assign `nil` to match parse.y behavior [Bug #21139] Currently Prism returns `42` for code like this: ```ruby 42.tap { it = it; p it } # => 42 ``` But parse.y returns `nil`: ```ruby 42.tap { it = it; p it } # => nil ``` In parse.y, it on the right-hand side is parsed as a local variable. In Prism, it was parsed as the implicit block parameter it, which caused this inconsistent behavior. This change makes the right-hand side it to be parsed as a local variable, aligning with parse.y's behavior. Bug ticket: https://bugs.ruby-lang.org/issues/21139 --- src/prism.c | 7 +++++++ test/prism/fixtures/it_assignment.txt | 1 + test/prism/ruby/parser_test.rb | 19 +++++++++++++++++++ 3 files changed, 27 insertions(+) create mode 100644 test/prism/fixtures/it_assignment.txt diff --git a/src/prism.c b/src/prism.c index 6d4381565c..f9aee2b72f 100644 --- a/src/prism.c +++ b/src/prism.c @@ -16456,6 +16456,13 @@ parse_variable(pm_parser_t *parser) { return node; } else if ((parser->version != PM_OPTIONS_VERSION_CRUBY_3_3) && pm_token_is_it(parser->previous.start, parser->previous.end)) { + if (match1(parser, PM_TOKEN_EQUAL)) { + pm_constant_id_t name_id = pm_parser_local_add_location(parser, parser->previous.start, parser->previous.end, 0); + pm_node_t *node = (pm_node_t *) pm_local_variable_read_node_create_constant_id(parser, &parser->previous, name_id, 0, false); + + return node; + } + pm_node_t *node = (pm_node_t *) pm_it_local_variable_read_node_create(parser, &parser->previous); pm_node_list_append(¤t_scope->implicit_parameters, node); diff --git a/test/prism/fixtures/it_assignment.txt b/test/prism/fixtures/it_assignment.txt new file mode 100644 index 0000000000..523b0ffe1e --- /dev/null +++ b/test/prism/fixtures/it_assignment.txt @@ -0,0 +1 @@ +42.tap { it = it; p it } diff --git a/test/prism/ruby/parser_test.rb b/test/prism/ruby/parser_test.rb index 82b5ea54a8..add06dd8a6 100644 --- a/test/prism/ruby/parser_test.rb +++ b/test/prism/ruby/parser_test.rb @@ -179,6 +179,25 @@ def test_it_block_parameter_syntax assert_equal(it_block_parameter_sexp, actual_ast.to_sexp) end + def test_it_assignment_syntax + it_assignment_fixture_path = Pathname(__dir__).join('../../../test/prism/fixtures/it_assignment.txt') + + buffer = Parser::Source::Buffer.new(it_assignment_fixture_path) + buffer.source = it_assignment_fixture_path.read + actual_ast = Prism::Translation::Parser34.new.tokenize(buffer)[0] + + it_assignment_sexp = parse_sexp { + s(:block, + s(:send, s(:int, 42), :tap), + s(:args), + s(:begin, + s(:lvasgn, :it, s(:lvar, :it)), + s(:send, nil, :p, s(:lvar, :it)))) + } + + assert_equal(it_assignment_sexp, actual_ast.to_sexp) + end + private def assert_equal_parses(fixture, compare_asts: true, compare_tokens: true, compare_comments: true) From eda693f0564280ab4c87e97ff9ca459a9c8acada Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Mon, 21 Jul 2025 08:20:45 -0700 Subject: [PATCH 070/333] Clear flags on interpolated strings When inner strings aren't frozen, we need to clear the flags on interpolated string nodes so that we don't emit wrong instructions. The compiler is currently incorrectly emitting frozen strings because the parser is erroneously declaring interpolated strings as "frozen". We need to fix this behavior in the parser so we can fix the compiler in CRuby. This patch is a partial fix for [this bug](https://bugs.ruby-lang.org/issues/21187) --- snapshots/dos_endings.txt | 4 ++-- snapshots/dstring.txt | 2 +- snapshots/heredocs_leading_whitespace.txt | 4 ++-- snapshots/heredocs_nested.txt | 2 +- snapshots/heredocs_with_fake_newlines.txt | 2 +- snapshots/heredocs_with_ignored_newlines.txt | 2 +- snapshots/seattlerb/difficult0_.txt | 2 +- snapshots/seattlerb/dstr_str.txt | 2 +- snapshots/seattlerb/heredoc_nested.txt | 4 ++-- snapshots/seattlerb/heredoc_squiggly.txt | 2 +- .../heredoc_squiggly_blank_lines.txt | 2 +- snapshots/seattlerb/heredoc_squiggly_tabs.txt | 2 +- .../seattlerb/heredoc_squiggly_tabs_extra.txt | 2 +- .../heredoc_squiggly_visually_blank_lines.txt | 2 +- .../str_lit_concat_bad_encodings.txt | 2 +- snapshots/seattlerb/str_str.txt | 2 +- snapshots/seattlerb/str_str_str.txt | 2 +- snapshots/spanning_heredoc.txt | 10 +++++----- snapshots/strings.txt | 2 +- snapshots/tilde_heredocs.txt | 20 +++++++++---------- snapshots/unparser/corpus/literal/literal.txt | 2 +- snapshots/unparser/corpus/semantic/dstr.txt | 4 ++-- snapshots/whitequark/dedenting_heredoc.txt | 20 +++++++++---------- ...olating_heredoc_fake_line_continuation.txt | 2 +- ...nterpolating_heredoc_line_continuation.txt | 2 +- snapshots/whitequark/parser_bug_640.txt | 2 +- snapshots/whitequark/ruby_bug_11990.txt | 2 +- .../whitequark/slash_newline_in_heredocs.txt | 2 +- src/prism.c | 4 ++++ test/prism/result/static_literals_test.rb | 5 +++++ 30 files changed, 63 insertions(+), 54 deletions(-) diff --git a/snapshots/dos_endings.txt b/snapshots/dos_endings.txt index 69d6b7cd7e..6ddb8b0a93 100644 --- a/snapshots/dos_endings.txt +++ b/snapshots/dos_endings.txt @@ -17,7 +17,7 @@ │ │ ├── flags: ∅ │ │ └── arguments: (length: 1) │ │ └── @ InterpolatedStringNode (location: (1,5)-(2,12)) - │ │ ├── flags: static_literal + │ │ ├── flags: ∅ │ │ ├── opening_loc: ∅ │ │ ├── parts: (length: 2) │ │ │ ├── @ StringNode (location: (1,5)-(1,9)) @@ -86,7 +86,7 @@ │ │ ├── flags: ∅ │ │ ├── receiver: │ │ │ @ InterpolatedStringNode (location: (17,8)-(17,14)) - │ │ │ ├── flags: static_literal + │ │ │ ├── flags: ∅ │ │ │ ├── opening_loc: (17,8)-(17,14) = "<<~EOF" │ │ │ ├── parts: (length: 2) │ │ │ │ ├── @ StringNode (location: (18,0)-(19,0)) diff --git a/snapshots/dstring.txt b/snapshots/dstring.txt index 7913cd010d..c136860fc4 100644 --- a/snapshots/dstring.txt +++ b/snapshots/dstring.txt @@ -41,7 +41,7 @@ │ │ └── closing_loc: (5,7)-(5,8) = "}" │ └── closing_loc: (5,8)-(5,9) = "\"" ├── @ InterpolatedStringNode (location: (7,0)-(9,2)) - │ ├── flags: newline, static_literal + │ ├── flags: newline │ ├── opening_loc: ∅ │ ├── parts: (length: 2) │ │ ├── @ StringNode (location: (7,0)-(8,2)) diff --git a/snapshots/heredocs_leading_whitespace.txt b/snapshots/heredocs_leading_whitespace.txt index 6101cd02d3..0594f1c5dd 100644 --- a/snapshots/heredocs_leading_whitespace.txt +++ b/snapshots/heredocs_leading_whitespace.txt @@ -30,7 +30,7 @@ │ ├── closing_loc: (19,0)-(20,0) = " FOO\n" │ └── unescaped: "a\nb\n" ├── @ InterpolatedStringNode (location: (21,0)-(21,10)) - │ ├── flags: newline, static_literal + │ ├── flags: newline │ ├── opening_loc: (21,0)-(21,10) = "<<~' FOO'" │ ├── parts: (length: 2) │ │ ├── @ StringNode (location: (22,0)-(23,0)) @@ -47,7 +47,7 @@ │ │ └── unescaped: "b\n" │ └── closing_loc: (24,0)-(25,0) = " FOO\n" └── @ InterpolatedStringNode (location: (26,0)-(26,10)) - ├── flags: newline, static_literal + ├── flags: newline ├── opening_loc: (26,0)-(26,10) = "<<~' FOO'" ├── parts: (length: 2) │ ├── @ StringNode (location: (27,0)-(28,0)) diff --git a/snapshots/heredocs_nested.txt b/snapshots/heredocs_nested.txt index 08576915dc..c2d13e4bdb 100644 --- a/snapshots/heredocs_nested.txt +++ b/snapshots/heredocs_nested.txt @@ -6,7 +6,7 @@ ├── flags: ∅ └── body: (length: 2) ├── @ InterpolatedStringNode (location: (1,0)-(1,7)) - │ ├── flags: newline, static_literal, mutable + │ ├── flags: newline │ ├── opening_loc: (1,0)-(1,7) = "<<~RUBY" │ ├── parts: (length: 4) │ │ ├── @ StringNode (location: (2,0)-(3,0)) diff --git a/snapshots/heredocs_with_fake_newlines.txt b/snapshots/heredocs_with_fake_newlines.txt index df59b29b94..46892adc3d 100644 --- a/snapshots/heredocs_with_fake_newlines.txt +++ b/snapshots/heredocs_with_fake_newlines.txt @@ -12,7 +12,7 @@ │ ├── closing_loc: (13,0)-(14,0) = "RUBY\n" │ └── unescaped: " \n\n \n\n exit\n \\n\n \n\n\n\n\n argh\n \\\n \\ foo\nbar\n \f\n ok\n" ├── @ InterpolatedStringNode (location: (15,0)-(15,7)) - │ ├── flags: newline, static_literal + │ ├── flags: newline │ ├── opening_loc: (15,0)-(15,7) = "<<~RUBY" │ ├── parts: (length: 11) │ │ ├── @ StringNode (location: (16,0)-(17,0)) diff --git a/snapshots/heredocs_with_ignored_newlines.txt b/snapshots/heredocs_with_ignored_newlines.txt index 16675029e1..53b373fb3c 100644 --- a/snapshots/heredocs_with_ignored_newlines.txt +++ b/snapshots/heredocs_with_ignored_newlines.txt @@ -12,7 +12,7 @@ │ ├── closing_loc: (2,0)-(3,0) = "HERE\n" │ └── unescaped: "" └── @ InterpolatedStringNode (location: (4,0)-(4,8)) - ├── flags: newline, static_literal + ├── flags: newline ├── opening_loc: (4,0)-(4,8) = "<<~THERE" ├── parts: (length: 9) │ ├── @ StringNode (location: (5,0)-(6,0)) diff --git a/snapshots/seattlerb/difficult0_.txt b/snapshots/seattlerb/difficult0_.txt index 233440b101..da977bdc52 100644 --- a/snapshots/seattlerb/difficult0_.txt +++ b/snapshots/seattlerb/difficult0_.txt @@ -37,7 +37,7 @@ │ │ │ ├── flags: ∅ │ │ │ └── arguments: (length: 1) │ │ │ └── @ InterpolatedStringNode (location: (1,9)-(4,4)) - │ │ │ ├── flags: static_literal + │ │ │ ├── flags: ∅ │ │ │ ├── opening_loc: (1,9)-(1,10) = "'" │ │ │ ├── parts: (length: 2) │ │ │ │ ├── @ StringNode (location: (1,10)-(2,0)) diff --git a/snapshots/seattlerb/dstr_str.txt b/snapshots/seattlerb/dstr_str.txt index 7b3e0e36ad..adce0b18fe 100644 --- a/snapshots/seattlerb/dstr_str.txt +++ b/snapshots/seattlerb/dstr_str.txt @@ -6,7 +6,7 @@ ├── flags: ∅ └── body: (length: 1) └── @ InterpolatedStringNode (location: (1,0)-(1,10)) - ├── flags: newline, static_literal, mutable + ├── flags: newline ├── opening_loc: (1,0)-(1,1) = "\"" ├── parts: (length: 2) │ ├── @ EmbeddedStatementsNode (location: (1,1)-(1,7)) diff --git a/snapshots/seattlerb/heredoc_nested.txt b/snapshots/seattlerb/heredoc_nested.txt index 4820ef6d4d..7e1a2ffb23 100644 --- a/snapshots/seattlerb/heredoc_nested.txt +++ b/snapshots/seattlerb/heredoc_nested.txt @@ -6,10 +6,10 @@ ├── flags: ∅ └── body: (length: 1) └── @ ArrayNode (location: (1,0)-(7,2)) - ├── flags: newline, static_literal + ├── flags: newline ├── elements: (length: 2) │ ├── @ InterpolatedStringNode (location: (1,1)-(1,4)) - │ │ ├── flags: static_literal, mutable + │ │ ├── flags: ∅ │ │ ├── opening_loc: (1,1)-(1,4) = "<flags = (pm_node_flags_t) ((part->flags | PM_NODE_FLAG_STATIC_LITERAL | PM_STRING_FLAGS_FROZEN) & ~PM_STRING_FLAGS_MUTABLE); break; case PM_INTERPOLATED_STRING_NODE: diff --git a/test/prism/result/static_literals_test.rb b/test/prism/result/static_literals_test.rb index dcfc692897..cc07027916 100644 --- a/test/prism/result/static_literals_test.rb +++ b/test/prism/result/static_literals_test.rb @@ -4,6 +4,11 @@ module Prism class StaticLiteralsTest < TestCase + def test_concatenanted_string_literal_is_not_static + node = Prism.parse_statement("'a' 'b'") + refute_predicate node, :static_literal? + end + def test_static_literals assert_warning("1") assert_warning("0xA", "10", "10") From 26f869c4b95d8c05698be2ca5bbd36d628f39b1e Mon Sep 17 00:00:00 2001 From: Earlopain <14981592+Earlopain@users.noreply.github.com> Date: Tue, 22 Jul 2025 09:11:02 +0200 Subject: [PATCH 071/333] Fix jruby CI The current version constraint is too specific and doesn't allow 10.0.1.0 which was recently released --- gemfiles/jruby/Gemfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gemfiles/jruby/Gemfile b/gemfiles/jruby/Gemfile index 23d09a18a7..b065e12c9d 100644 --- a/gemfiles/jruby/Gemfile +++ b/gemfiles/jruby/Gemfile @@ -2,7 +2,7 @@ source "https://rubygems.org" -ruby "~> 3.4.2", engine: "jruby", engine_version: "~> 10.0.0.0" +ruby "~> 3.4.2", engine: "jruby", engine_version: "~> 10.0.0" gemspec path: "../.." From afe60c48b87227d7357fccca48db601e4daf1108 Mon Sep 17 00:00:00 2001 From: Earlopain <14981592+Earlopain@users.noreply.github.com> Date: Tue, 22 Jul 2025 13:44:23 +0200 Subject: [PATCH 072/333] Pin JRuby to 10.0.0.0 to work around a bug --- .github/workflows/main.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ff5aeb45e1..4843bf5605 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -84,7 +84,7 @@ jobs: matrix: target: - { ruby: "head", gemfile: "3.5" } - - { ruby: "jruby", gemfile: "jruby" } + - { ruby: "jruby-10.0.0.0", gemfile: "jruby" } # https://github.com/jruby/jruby/issues/8923 - { ruby: "truffleruby", gemfile: "truffleruby" } runs-on: ubuntu-latest env: @@ -255,7 +255,7 @@ jobs: - { ruby: "3.3", os: "ubuntu-latest", gemfile: "3.3" } - { ruby: "3.4", os: "ubuntu-latest", gemfile: "3.4" } - { ruby: "head", os: "ubuntu-latest", gemfile: "3.5" } - - { ruby: "jruby", os: "ubuntu-latest", gemfile: "jruby" } + - { ruby: "jruby-10.0.0.0", os: "ubuntu-latest", gemfile: "jruby" } # https://github.com/jruby/jruby/issues/8923 - { ruby: "truffleruby", os: "ubuntu-latest", gemfile: "truffleruby" } - { ruby: "2.7", os: "macos-latest", gemfile: "2.7" } @@ -265,7 +265,7 @@ jobs: - { ruby: "3.3", os: "macos-latest", gemfile: "3.3" } - { ruby: "3.4", os: "macos-latest", gemfile: "3.4" } - { ruby: "head", os: "macos-latest", gemfile: "3.5" } - - { ruby: "jruby", os: "macos-latest", gemfile: "jruby" } + - { ruby: "jruby-10.0.0.0", os: "macos-latest", gemfile: "jruby" } # https://github.com/jruby/jruby/issues/8923 - { ruby: "truffleruby", os: "macos-latest", gemfile: "truffleruby" } - { ruby: "2.7", os: "windows-latest", gemfile: "2.7" } @@ -275,7 +275,7 @@ jobs: - { ruby: "3.3", os: "windows-latest", gemfile: "3.3" } - { ruby: "3.4", os: "windows-latest", gemfile: "3.4" } # - { ruby: "head", os: "windows-latest", gemfile: "3.5" } <-- failing certs, temporarily disabled - - { ruby: "jruby", os: "windows-latest", gemfile: "jruby" } + - { ruby: "jruby-10.0.0.0", os: "windows-latest", gemfile: "jruby" } # https://github.com/jruby/jruby/issues/8923 env: BUNDLE_GEMFILE: gemfiles/${{ matrix.target.gemfile }}/Gemfile runs-on: ${{ matrix.target.os }} From 1d1ecbf1e694968ec3c0150f4ac6dcf7770ff3fe Mon Sep 17 00:00:00 2001 From: Stan Lo Date: Tue, 22 Jul 2025 14:58:52 +0100 Subject: [PATCH 073/333] Add more Prism related tests to cruby-bindings workflow This should prevent Prism from breaking CRuby's CI. --- .github/workflows/cruby-bindings.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cruby-bindings.yml b/.github/workflows/cruby-bindings.yml index 087fb97c0f..23e62968b4 100644 --- a/.github/workflows/cruby-bindings.yml +++ b/.github/workflows/cruby-bindings.yml @@ -43,5 +43,5 @@ jobs: make -j2 working-directory: ruby/ruby - name: make test-all - run: make -j2 -s test-all TESTS="prism --no-retry" + run: make -j2 -s test-all TESTS="prism ruby/test_syntax.rb ruby/test_compile_prism.rb --no-retry" working-directory: ruby/ruby From 722af59ba393e9e78c19c430d0ba36484c6db9b9 Mon Sep 17 00:00:00 2001 From: Stan Lo Date: Thu, 17 Jul 2025 12:29:40 +0100 Subject: [PATCH 074/333] Allow command calls in endless method bodies within assignments Previously, endless method definitions in assignment contexts like `x = def f = p 1` would fail to parse because command calls (method calls without parentheses) were only accepted when the surrounding binding power was less than `PM_BINDING_POWER_COMPOSITION`. This fix specifically checks for assignment context and allows command calls in those cases while maintaining the existing behavior for other contexts. This ensures that: - `x = def f = p 1` parses correctly (previously failed) - `private def f = puts "Hello"` still produces the expected error --- snapshots/endless_methods.txt | 148 ++++++++++++------- src/prism.c | 10 +- test/prism/errors/private_endless_method.txt | 3 + test/prism/fixtures/endless_methods.txt | 2 + 4 files changed, 108 insertions(+), 55 deletions(-) create mode 100644 test/prism/errors/private_endless_method.txt diff --git a/snapshots/endless_methods.txt b/snapshots/endless_methods.txt index 29f701ed17..512c87d552 100644 --- a/snapshots/endless_methods.txt +++ b/snapshots/endless_methods.txt @@ -1,10 +1,10 @@ -@ ProgramNode (location: (1,0)-(5,22)) +@ ProgramNode (location: (1,0)-(7,15)) ├── flags: ∅ -├── locals: [] +├── locals: [:x] └── statements: - @ StatementsNode (location: (1,0)-(5,22)) + @ StatementsNode (location: (1,0)-(7,15)) ├── flags: ∅ - └── body: (length: 3) + └── body: (length: 4) ├── @ DefNode (location: (1,0)-(1,11)) │ ├── flags: newline │ ├── name: :foo @@ -61,55 +61,95 @@ │ ├── rparen_loc: ∅ │ ├── equal_loc: (3,8)-(3,9) = "=" │ └── end_keyword_loc: ∅ - └── @ DefNode (location: (5,0)-(5,22)) + ├── @ DefNode (location: (5,0)-(5,22)) + │ ├── flags: newline + │ ├── name: :method + │ ├── name_loc: (5,4)-(5,10) = "method" + │ ├── receiver: ∅ + │ ├── parameters: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (5,13)-(5,22)) + │ │ ├── flags: ∅ + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (5,13)-(5,22)) + │ │ ├── flags: ∅ + │ │ ├── receiver: + │ │ │ @ CallNode (location: (5,13)-(5,18)) + │ │ │ ├── flags: ∅ + │ │ │ ├── receiver: + │ │ │ │ @ IntegerNode (location: (5,13)-(5,14)) + │ │ │ │ ├── flags: static_literal, decimal + │ │ │ │ └── value: 1 + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :+ + │ │ │ ├── message_loc: (5,15)-(5,16) = "+" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: + │ │ │ │ @ ArgumentsNode (location: (5,17)-(5,18)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── arguments: (length: 1) + │ │ │ │ └── @ IntegerNode (location: (5,17)-(5,18)) + │ │ │ │ ├── flags: static_literal, decimal + │ │ │ │ └── value: 2 + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :+ + │ │ ├── message_loc: (5,19)-(5,20) = "+" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (5,21)-(5,22)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ IntegerNode (location: (5,21)-(5,22)) + │ │ │ ├── flags: static_literal, decimal + │ │ │ └── value: 3 + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── locals: [] + │ ├── def_keyword_loc: (5,0)-(5,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── equal_loc: (5,11)-(5,12) = "=" + │ └── end_keyword_loc: ∅ + └── @ LocalVariableWriteNode (location: (7,0)-(7,15)) ├── flags: newline - ├── name: :method - ├── name_loc: (5,4)-(5,10) = "method" - ├── receiver: ∅ - ├── parameters: ∅ - ├── body: - │ @ StatementsNode (location: (5,13)-(5,22)) + ├── name: :x + ├── depth: 0 + ├── name_loc: (7,0)-(7,1) = "x" + ├── value: + │ @ DefNode (location: (7,4)-(7,15)) │ ├── flags: ∅ - │ └── body: (length: 1) - │ └── @ CallNode (location: (5,13)-(5,22)) - │ ├── flags: ∅ - │ ├── receiver: - │ │ @ CallNode (location: (5,13)-(5,18)) - │ │ ├── flags: ∅ - │ │ ├── receiver: - │ │ │ @ IntegerNode (location: (5,13)-(5,14)) - │ │ │ ├── flags: static_literal, decimal - │ │ │ └── value: 1 - │ │ ├── call_operator_loc: ∅ - │ │ ├── name: :+ - │ │ ├── message_loc: (5,15)-(5,16) = "+" - │ │ ├── opening_loc: ∅ - │ │ ├── arguments: - │ │ │ @ ArgumentsNode (location: (5,17)-(5,18)) - │ │ │ ├── flags: ∅ - │ │ │ └── arguments: (length: 1) - │ │ │ └── @ IntegerNode (location: (5,17)-(5,18)) - │ │ │ ├── flags: static_literal, decimal - │ │ │ └── value: 2 - │ │ ├── closing_loc: ∅ - │ │ └── block: ∅ - │ ├── call_operator_loc: ∅ - │ ├── name: :+ - │ ├── message_loc: (5,19)-(5,20) = "+" - │ ├── opening_loc: ∅ - │ ├── arguments: - │ │ @ ArgumentsNode (location: (5,21)-(5,22)) - │ │ ├── flags: ∅ - │ │ └── arguments: (length: 1) - │ │ └── @ IntegerNode (location: (5,21)-(5,22)) - │ │ ├── flags: static_literal, decimal - │ │ └── value: 3 - │ ├── closing_loc: ∅ - │ └── block: ∅ - ├── locals: [] - ├── def_keyword_loc: (5,0)-(5,3) = "def" - ├── operator_loc: ∅ - ├── lparen_loc: ∅ - ├── rparen_loc: ∅ - ├── equal_loc: (5,11)-(5,12) = "=" - └── end_keyword_loc: ∅ + │ ├── name: :f + │ ├── name_loc: (7,8)-(7,9) = "f" + │ ├── receiver: ∅ + │ ├── parameters: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (7,12)-(7,15)) + │ │ ├── flags: ∅ + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (7,12)-(7,15)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :p + │ │ ├── message_loc: (7,12)-(7,13) = "p" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (7,14)-(7,15)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ IntegerNode (location: (7,14)-(7,15)) + │ │ │ ├── flags: static_literal, decimal + │ │ │ └── value: 1 + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── locals: [] + │ ├── def_keyword_loc: (7,4)-(7,7) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: ∅ + │ ├── rparen_loc: ∅ + │ ├── equal_loc: (7,10)-(7,11) = "=" + │ └── end_keyword_loc: ∅ + └── operator_loc: (7,2)-(7,3) = "=" diff --git a/src/prism.c b/src/prism.c index 8707330c95..4cc9cf0a1e 100644 --- a/src/prism.c +++ b/src/prism.c @@ -19505,7 +19505,15 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b pm_do_loop_stack_push(parser, false); statements = (pm_node_t *) pm_statements_node_create(parser); - pm_node_t *statement = parse_expression(parser, PM_BINDING_POWER_DEFINED + 1, binding_power < PM_BINDING_POWER_COMPOSITION, false, PM_ERR_DEF_ENDLESS, (uint16_t) (depth + 1)); + // In endless method bodies, we need to handle command calls carefully. + // We want to allow command calls in assignment context but maintain + // the same binding power to avoid changing how operators are parsed. + // Note that we're intentionally NOT allowing code like `private def foo = puts "Hello"` + // because the original parser, parse.y, can't handle it and we want to maintain the same behavior + bool allow_command_call = (binding_power == PM_BINDING_POWER_ASSIGNMENT) || + (binding_power < PM_BINDING_POWER_COMPOSITION); + + pm_node_t *statement = parse_expression(parser, PM_BINDING_POWER_DEFINED + 1, allow_command_call, false, PM_ERR_DEF_ENDLESS, (uint16_t) (depth + 1)); if (accept1(parser, PM_TOKEN_KEYWORD_RESCUE_MODIFIER)) { context_push(parser, PM_CONTEXT_RESCUE_MODIFIER); diff --git a/test/prism/errors/private_endless_method.txt b/test/prism/errors/private_endless_method.txt new file mode 100644 index 0000000000..8aae5e0cd3 --- /dev/null +++ b/test/prism/errors/private_endless_method.txt @@ -0,0 +1,3 @@ +private def foo = puts "Hello" + ^ unexpected string literal, expecting end-of-input + diff --git a/test/prism/fixtures/endless_methods.txt b/test/prism/fixtures/endless_methods.txt index 8c2f2a30cc..7eb3bf4318 100644 --- a/test/prism/fixtures/endless_methods.txt +++ b/test/prism/fixtures/endless_methods.txt @@ -3,3 +3,5 @@ def foo = 1 def bar = A "" def method = 1 + 2 + 3 + +x = def f = p 1 From 8318a113ca1d42d86f16f3854ba3bd3120a87d5b Mon Sep 17 00:00:00 2001 From: Earlopain <14981592+Earlopain@users.noreply.github.com> Date: Tue, 22 Jul 2025 13:16:40 +0200 Subject: [PATCH 075/333] Do not use `0` to indicate the latest ruby version to parse This makes it hard to do version checks against this value. The current version checks work because there are so few possible values at the moment. As an example, PR 3337 introduces new syntax for ruby 3.5 and uses `PM_OPTIONS_VERSION_LATEST` as its version guard. Because what is considered the latest changes every year, it must later be changed to `parser->version == parser->version == PM_OPTIONS_VERSION_CRUBY_3_5 || parser->version == PM_OPTIONS_VERSION_LATEST`, with one extra version each year. With this change, the PR can instead write `parser->version >= PM_OPTIONS_VERSION_CRUBY_3_5` which is self-explanatory and works for future versions. --- include/prism/options.h | 12 +++++++++--- java/org/prism/ParsingOptions.java | 5 +++-- javascript/src/parsePrism.js | 6 ++++-- lib/prism/ffi.rb | 4 ++-- src/options.c | 4 ++-- src/prism.c | 26 ++++++++++++++++---------- 6 files changed, 36 insertions(+), 21 deletions(-) diff --git a/include/prism/options.h b/include/prism/options.h index 2f64701b0c..092fda4f07 100644 --- a/include/prism/options.h +++ b/include/prism/options.h @@ -82,14 +82,20 @@ typedef void (*pm_options_shebang_callback_t)(struct pm_options *options, const * parse in the same way as a specific version of CRuby would have. */ typedef enum { - /** The current version of prism. */ - PM_OPTIONS_VERSION_LATEST = 0, + /** If an explicit version is not provided, the current version of prism will be used. */ + PM_OPTIONS_VERSION_UNSET = 0, /** The vendored version of prism in CRuby 3.3.x. */ PM_OPTIONS_VERSION_CRUBY_3_3 = 1, /** The vendored version of prism in CRuby 3.4.x. */ - PM_OPTIONS_VERSION_CRUBY_3_4 = 2 + PM_OPTIONS_VERSION_CRUBY_3_4 = 2, + + /** The vendored version of prism in CRuby 3.5.x. */ + PM_OPTIONS_VERSION_CRUBY_3_5 = 3, + + /** The current version of prism. */ + PM_OPTIONS_VERSION_LATEST = PM_OPTIONS_VERSION_CRUBY_3_5 } pm_options_version_t; /** diff --git a/java/org/prism/ParsingOptions.java b/java/org/prism/ParsingOptions.java index d4652f069a..4aff7dbe35 100644 --- a/java/org/prism/ParsingOptions.java +++ b/java/org/prism/ParsingOptions.java @@ -12,9 +12,10 @@ public abstract class ParsingOptions { * See pm_options_version_t in include/prism/options.h. */ public enum SyntaxVersion { - LATEST(0), + LATEST(0), // Handled in pm_parser_init V3_3(1), - V3_4(2); + V3_4(2), + V3_5(3); private final int value; diff --git a/javascript/src/parsePrism.js b/javascript/src/parsePrism.js index 535e6e9a0f..d021c63a9b 100644 --- a/javascript/src/parsePrism.js +++ b/javascript/src/parsePrism.js @@ -140,12 +140,14 @@ function dumpOptions(options) { values.push(dumpCommandLineOptions(options)); template.push("C"); - if (!options.version || options.version === "latest" || options.version.match(/^3\.5(\.\d+)?$/)) { - values.push(0); + if (!options.version || options.version === "latest") { + values.push(0); // Handled in pm_parser_init } else if (options.version.match(/^3\.3(\.\d+)?$/)) { values.push(1); } else if (options.version.match(/^3\.4(\.\d+)?$/)) { values.push(2); + } else if (options.version.match(/^3\.5(\.\d+)?$/)) { + values.push(3); } else { throw new Error(`Unsupported version '${options.version}' in compiler options`); } diff --git a/lib/prism/ffi.rb b/lib/prism/ffi.rb index 5a4ba09a4f..1e1bf8b1c8 100644 --- a/lib/prism/ffi.rb +++ b/lib/prism/ffi.rb @@ -422,13 +422,13 @@ def dump_options_command_line(options) def dump_options_version(version) case version when nil, "latest" - 0 + 0 # Handled in pm_parser_init when /\A3\.3(\.\d+)?\z/ 1 when /\A3\.4(\.\d+)?\z/ 2 when /\A3\.5(\.\d+)?\z/ - 0 + 3 else raise ArgumentError, "invalid version: #{version}" end diff --git a/src/options.c b/src/options.c index a457178ce8..1b5c022cf5 100644 --- a/src/options.c +++ b/src/options.c @@ -89,7 +89,7 @@ pm_options_version_set(pm_options_t *options, const char *version, size_t length } if (strncmp(version, "3.5", 3) == 0) { - options->version = PM_OPTIONS_VERSION_LATEST; + options->version = PM_OPTIONS_VERSION_CRUBY_3_5; return true; } @@ -108,7 +108,7 @@ pm_options_version_set(pm_options_t *options, const char *version, size_t length } if (strncmp(version, "3.5.", 4) == 0 && is_number(version + 4, length - 4)) { - options->version = PM_OPTIONS_VERSION_LATEST; + options->version = PM_OPTIONS_VERSION_CRUBY_3_5; return true; } } diff --git a/src/prism.c b/src/prism.c index 8707330c95..e071199590 100644 --- a/src/prism.c +++ b/src/prism.c @@ -1409,7 +1409,7 @@ pm_conditional_predicate_warn_write_literal_p(const pm_node_t *node) { static inline void pm_conditional_predicate_warn_write_literal(pm_parser_t *parser, const pm_node_t *node) { if (pm_conditional_predicate_warn_write_literal_p(node)) { - pm_parser_warn_node(parser, node, parser->version == PM_OPTIONS_VERSION_CRUBY_3_3 ? PM_WARN_EQUAL_IN_CONDITIONAL_3_3 : PM_WARN_EQUAL_IN_CONDITIONAL); + pm_parser_warn_node(parser, node, parser->version <= PM_OPTIONS_VERSION_CRUBY_3_3 ? PM_WARN_EQUAL_IN_CONDITIONAL_3_3 : PM_WARN_EQUAL_IN_CONDITIONAL); } } @@ -2976,7 +2976,7 @@ pm_call_and_write_node_create(pm_parser_t *parser, pm_call_node_t *target, const */ static void pm_index_arguments_check(pm_parser_t *parser, const pm_arguments_node_t *arguments, const pm_node_t *block) { - if (parser->version != PM_OPTIONS_VERSION_CRUBY_3_3) { + if (parser->version >= PM_OPTIONS_VERSION_CRUBY_3_4) { if (arguments != NULL && PM_NODE_FLAG_P(arguments, PM_ARGUMENTS_NODE_FLAGS_CONTAINS_KEYWORDS)) { pm_node_t *node; PM_NODE_LIST_FOREACH(&arguments->arguments, index, node) { @@ -9094,7 +9094,7 @@ lex_global_variable(pm_parser_t *parser) { } while ((width = char_is_identifier(parser, parser->current.end, parser->end - parser->current.end)) > 0); // $0 isn't allowed to be followed by anything. - pm_diagnostic_id_t diag_id = parser->version == PM_OPTIONS_VERSION_CRUBY_3_3 ? PM_ERR_INVALID_VARIABLE_GLOBAL_3_3 : PM_ERR_INVALID_VARIABLE_GLOBAL; + pm_diagnostic_id_t diag_id = parser->version <= PM_OPTIONS_VERSION_CRUBY_3_3 ? PM_ERR_INVALID_VARIABLE_GLOBAL_3_3 : PM_ERR_INVALID_VARIABLE_GLOBAL; PM_PARSER_ERR_TOKEN_FORMAT_CONTENT(parser, parser->current, diag_id); } @@ -9131,7 +9131,7 @@ lex_global_variable(pm_parser_t *parser) { } else { // If we get here, then we have a $ followed by something that // isn't recognized as a global variable. - pm_diagnostic_id_t diag_id = parser->version == PM_OPTIONS_VERSION_CRUBY_3_3 ? PM_ERR_INVALID_VARIABLE_GLOBAL_3_3 : PM_ERR_INVALID_VARIABLE_GLOBAL; + pm_diagnostic_id_t diag_id = parser->version <= PM_OPTIONS_VERSION_CRUBY_3_3 ? PM_ERR_INVALID_VARIABLE_GLOBAL_3_3 : PM_ERR_INVALID_VARIABLE_GLOBAL; const uint8_t *end = parser->current.end + parser->encoding->char_width(parser->current.end, parser->end - parser->current.end); PM_PARSER_ERR_FORMAT(parser, parser->current.start, end, diag_id, (int) (end - parser->current.start), (const char *) parser->current.start); } @@ -10158,7 +10158,7 @@ lex_at_variable(pm_parser_t *parser) { } } else if (parser->current.end < end && pm_char_is_decimal_digit(*parser->current.end)) { pm_diagnostic_id_t diag_id = (type == PM_TOKEN_CLASS_VARIABLE) ? PM_ERR_INCOMPLETE_VARIABLE_CLASS : PM_ERR_INCOMPLETE_VARIABLE_INSTANCE; - if (parser->version == PM_OPTIONS_VERSION_CRUBY_3_3) { + if (parser->version <= PM_OPTIONS_VERSION_CRUBY_3_3) { diag_id = (type == PM_TOKEN_CLASS_VARIABLE) ? PM_ERR_INCOMPLETE_VARIABLE_CLASS_3_3 : PM_ERR_INCOMPLETE_VARIABLE_INSTANCE_3_3; } @@ -14648,7 +14648,7 @@ parse_parameters( parser_lex(parser); pm_constant_id_t name_id = pm_parser_constant_id_token(parser, &name); - uint32_t reads = parser->version == PM_OPTIONS_VERSION_CRUBY_3_3 ? pm_locals_reads(&parser->current_scope->locals, name_id) : 0; + uint32_t reads = parser->version <= PM_OPTIONS_VERSION_CRUBY_3_3 ? pm_locals_reads(&parser->current_scope->locals, name_id) : 0; if (accepts_blocks_in_defaults) pm_accepts_block_stack_push(parser, true); pm_node_t *value = parse_value_expression(parser, binding_power, false, false, PM_ERR_PARAMETER_NO_DEFAULT, (uint16_t) (depth + 1)); @@ -14664,7 +14664,7 @@ parse_parameters( // If the value of the parameter increased the number of // reads of that parameter, then we need to warn that we // have a circular definition. - if ((parser->version == PM_OPTIONS_VERSION_CRUBY_3_3) && (pm_locals_reads(&parser->current_scope->locals, name_id) != reads)) { + if ((parser->version <= PM_OPTIONS_VERSION_CRUBY_3_3) && (pm_locals_reads(&parser->current_scope->locals, name_id) != reads)) { PM_PARSER_ERR_TOKEN_FORMAT_CONTENT(parser, name, PM_ERR_PARAMETER_CIRCULAR); } @@ -14749,13 +14749,13 @@ parse_parameters( if (token_begins_expression_p(parser->current.type)) { pm_constant_id_t name_id = pm_parser_constant_id_token(parser, &local); - uint32_t reads = parser->version == PM_OPTIONS_VERSION_CRUBY_3_3 ? pm_locals_reads(&parser->current_scope->locals, name_id) : 0; + uint32_t reads = parser->version <= PM_OPTIONS_VERSION_CRUBY_3_3 ? pm_locals_reads(&parser->current_scope->locals, name_id) : 0; if (accepts_blocks_in_defaults) pm_accepts_block_stack_push(parser, true); pm_node_t *value = parse_value_expression(parser, binding_power, false, false, PM_ERR_PARAMETER_NO_DEFAULT_KW, (uint16_t) (depth + 1)); if (accepts_blocks_in_defaults) pm_accepts_block_stack_pop(parser); - if (parser->version == PM_OPTIONS_VERSION_CRUBY_3_3 && (pm_locals_reads(&parser->current_scope->locals, name_id) != reads)) { + if (parser->version <= PM_OPTIONS_VERSION_CRUBY_3_3 && (pm_locals_reads(&parser->current_scope->locals, name_id) != reads)) { PM_PARSER_ERR_TOKEN_FORMAT_CONTENT(parser, local, PM_ERR_PARAMETER_CIRCULAR); } @@ -16459,7 +16459,7 @@ parse_variable(pm_parser_t *parser) { pm_node_list_append(¤t_scope->implicit_parameters, node); return node; - } else if ((parser->version != PM_OPTIONS_VERSION_CRUBY_3_3) && pm_token_is_it(parser->previous.start, parser->previous.end)) { + } else if ((parser->version >= PM_OPTIONS_VERSION_CRUBY_3_4) && pm_token_is_it(parser->previous.start, parser->previous.end)) { pm_node_t *node = (pm_node_t *) pm_it_local_variable_read_node_create(parser, &parser->previous); pm_node_list_append(¤t_scope->implicit_parameters, node); @@ -22628,6 +22628,12 @@ pm_parser_init(pm_parser_t *parser, const uint8_t *source, size_t size, const pm } } + // Now that we have established the user-provided options, check if + // a version was given and parse as the latest version otherwise. + if (parser->version == PM_OPTIONS_VERSION_UNSET) { + parser->version = PM_OPTIONS_VERSION_LATEST; + } + pm_accepts_block_stack_push(parser, true); // Skip past the UTF-8 BOM if it exists. From a6b448b10f7ef86a9baeff831ca56d132fb96437 Mon Sep 17 00:00:00 2001 From: S-H-GAMELINKS Date: Wed, 23 Jul 2025 21:20:50 +0900 Subject: [PATCH 076/333] Remove uneeded test --- test/prism/ruby/parser_test.rb | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/test/prism/ruby/parser_test.rb b/test/prism/ruby/parser_test.rb index add06dd8a6..82b5ea54a8 100644 --- a/test/prism/ruby/parser_test.rb +++ b/test/prism/ruby/parser_test.rb @@ -179,25 +179,6 @@ def test_it_block_parameter_syntax assert_equal(it_block_parameter_sexp, actual_ast.to_sexp) end - def test_it_assignment_syntax - it_assignment_fixture_path = Pathname(__dir__).join('../../../test/prism/fixtures/it_assignment.txt') - - buffer = Parser::Source::Buffer.new(it_assignment_fixture_path) - buffer.source = it_assignment_fixture_path.read - actual_ast = Prism::Translation::Parser34.new.tokenize(buffer)[0] - - it_assignment_sexp = parse_sexp { - s(:block, - s(:send, s(:int, 42), :tap), - s(:args), - s(:begin, - s(:lvasgn, :it, s(:lvar, :it)), - s(:send, nil, :p, s(:lvar, :it)))) - } - - assert_equal(it_assignment_sexp, actual_ast.to_sexp) - end - private def assert_equal_parses(fixture, compare_asts: true, compare_tokens: true, compare_comments: true) From 659d769621a461a889772aa37a5d9dbf0f8743fe Mon Sep 17 00:00:00 2001 From: S-H-GAMELINKS Date: Wed, 23 Jul 2025 21:23:47 +0900 Subject: [PATCH 077/333] Add it read and assignment test --- test/prism/fixtures/it_read_and_assignment.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 test/prism/fixtures/it_read_and_assignment.txt diff --git a/test/prism/fixtures/it_read_and_assignment.txt b/test/prism/fixtures/it_read_and_assignment.txt new file mode 100644 index 0000000000..2cceeb2a54 --- /dev/null +++ b/test/prism/fixtures/it_read_and_assignment.txt @@ -0,0 +1 @@ +42.tap { p it; it = it; p it } From 51e2b043a672d5ba75af42766cec72429060f622 Mon Sep 17 00:00:00 2001 From: S-H-GAMELINKS Date: Wed, 23 Jul 2025 21:53:35 +0900 Subject: [PATCH 078/333] Add snapshots --- snapshots/it_assignment.txt | 58 +++++++++++++++++++++ snapshots/it_read_and_assignment.txt | 75 ++++++++++++++++++++++++++++ 2 files changed, 133 insertions(+) create mode 100644 snapshots/it_assignment.txt create mode 100644 snapshots/it_read_and_assignment.txt diff --git a/snapshots/it_assignment.txt b/snapshots/it_assignment.txt new file mode 100644 index 0000000000..83469791c0 --- /dev/null +++ b/snapshots/it_assignment.txt @@ -0,0 +1,58 @@ +@ ProgramNode (location: (1,0)-(1,24)) +├── flags: ∅ +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,24)) + ├── flags: ∅ + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,24)) + ├── flags: newline + ├── receiver: + │ @ IntegerNode (location: (1,0)-(1,2)) + │ ├── flags: static_literal, decimal + │ └── value: 42 + ├── call_operator_loc: (1,2)-(1,3) = "." + ├── name: :tap + ├── message_loc: (1,3)-(1,6) = "tap" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: + @ BlockNode (location: (1,7)-(1,24)) + ├── flags: ∅ + ├── locals: [:it] + ├── parameters: ∅ + ├── body: + │ @ StatementsNode (location: (1,9)-(1,22)) + │ ├── flags: ∅ + │ └── body: (length: 2) + │ ├── @ LocalVariableWriteNode (location: (1,9)-(1,16)) + │ │ ├── flags: newline + │ │ ├── name: :it + │ │ ├── depth: 0 + │ │ ├── name_loc: (1,9)-(1,11) = "it" + │ │ ├── value: + │ │ │ @ LocalVariableReadNode (location: (1,14)-(1,16)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :it + │ │ │ └── depth: 0 + │ │ └── operator_loc: (1,12)-(1,13) = "=" + │ └── @ CallNode (location: (1,18)-(1,22)) + │ ├── flags: newline, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :p + │ ├── message_loc: (1,18)-(1,19) = "p" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,20)-(1,22)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ LocalVariableReadNode (location: (1,20)-(1,22)) + │ │ ├── flags: ∅ + │ │ ├── name: :it + │ │ └── depth: 0 + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── opening_loc: (1,7)-(1,8) = "{" + └── closing_loc: (1,23)-(1,24) = "}" diff --git a/snapshots/it_read_and_assignment.txt b/snapshots/it_read_and_assignment.txt new file mode 100644 index 0000000000..73aa2b5909 --- /dev/null +++ b/snapshots/it_read_and_assignment.txt @@ -0,0 +1,75 @@ +@ ProgramNode (location: (1,0)-(1,30)) +├── flags: ∅ +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,30)) + ├── flags: ∅ + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,30)) + ├── flags: newline + ├── receiver: + │ @ IntegerNode (location: (1,0)-(1,2)) + │ ├── flags: static_literal, decimal + │ └── value: 42 + ├── call_operator_loc: (1,2)-(1,3) = "." + ├── name: :tap + ├── message_loc: (1,3)-(1,6) = "tap" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: + @ BlockNode (location: (1,7)-(1,30)) + ├── flags: ∅ + ├── locals: [:it] + ├── parameters: + │ @ ItParametersNode (location: (1,7)-(1,30)) + │ └── flags: ∅ + ├── body: + │ @ StatementsNode (location: (1,9)-(1,28)) + │ ├── flags: ∅ + │ └── body: (length: 3) + │ ├── @ CallNode (location: (1,9)-(1,13)) + │ │ ├── flags: newline, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :p + │ │ ├── message_loc: (1,9)-(1,10) = "p" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (1,11)-(1,13)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ ItLocalVariableReadNode (location: (1,11)-(1,13)) + │ │ │ └── flags: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── @ LocalVariableWriteNode (location: (1,15)-(1,22)) + │ │ ├── flags: newline + │ │ ├── name: :it + │ │ ├── depth: 0 + │ │ ├── name_loc: (1,15)-(1,17) = "it" + │ │ ├── value: + │ │ │ @ LocalVariableReadNode (location: (1,20)-(1,22)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :it + │ │ │ └── depth: 0 + │ │ └── operator_loc: (1,18)-(1,19) = "=" + │ └── @ CallNode (location: (1,24)-(1,28)) + │ ├── flags: newline, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :p + │ ├── message_loc: (1,24)-(1,25) = "p" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,26)-(1,28)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ LocalVariableReadNode (location: (1,26)-(1,28)) + │ │ ├── flags: ∅ + │ │ ├── name: :it + │ │ └── depth: 0 + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── opening_loc: (1,7)-(1,8) = "{" + └── closing_loc: (1,29)-(1,30) = "}" From db9ae59e173e10895c45d138297150d5ce5febbf Mon Sep 17 00:00:00 2001 From: Jun Aruga Date: Wed, 23 Jul 2025 13:31:52 +0200 Subject: [PATCH 079/333] CI: Migrate Travis CI ppc64le/s390x cases to the GitHub Actions. Add a job for the ppc64le/s390x cases using GitHub Actions ppc64le/s390x service. https://github.com/IBM/actionspz We can run the job only in the registered upstream repositories. https://github.com/IBM/actionspz/blob/main/docs/FAQ.md#what-about-forked-repos --- .github/workflows/main.yml | 21 +++++++++++++++++++++ .travis.yml | 25 ------------------------- 2 files changed, 21 insertions(+), 25 deletions(-) delete mode 100644 .travis.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4843bf5605..7e2378c01b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -78,6 +78,27 @@ jobs: run: bundle exec rake shell: bash + build-ibm: + if: github.repository == 'ruby/prism' + strategy: + fail-fast: false + matrix: + os: + - ubuntu-24.04-ppc64le + - ubuntu-24.04-s390x + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v4 + - name: Set up Ruby + run: | + sudo apt-get update + sudo apt-get install ruby-full bundler libyaml-dev + - name: Install dependencies + run: sudo bundle install --jobs 2 + - name: Run Ruby tests + run: bundle exec rake + shell: bash + build-ffi: strategy: fail-fast: false diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index bcded51f4d..0000000000 --- a/.travis.yml +++ /dev/null @@ -1,25 +0,0 @@ -language: ruby - -dist: jammy - -matrix: - include: - - arch: ppc64le - - arch: s390x - fast_finish: true - -before_install: - - sudo apt update -yq - - sudo apt -yq install gcc-11 - - gcc-11 --version - -before_script: - # Enable the verbose option in mkmf.rb to print the compiling commands. - - export MAKEFLAGS="V=1 CC=gcc-11" - -notifications: - email: - recipients: - - jun.aruga@gmail.com - on_success: never - on_failure: always From 57ab577ffa2934af8fddbe812333396af2480af5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 23 Jul 2025 16:28:57 +0000 Subject: [PATCH 080/333] Bump nokogiri from 1.18.8 to 1.18.9 in /gemfiles/3.3 Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.18.8 to 1.18.9. - [Release notes](https://github.com/sparklemotion/nokogiri/releases) - [Changelog](https://github.com/sparklemotion/nokogiri/blob/main/CHANGELOG.md) - [Commits](https://github.com/sparklemotion/nokogiri/compare/v1.18.8...v1.18.9) --- updated-dependencies: - dependency-name: nokogiri dependency-version: 1.18.9 dependency-type: indirect ... Signed-off-by: dependabot[bot] --- gemfiles/3.3/Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gemfiles/3.3/Gemfile.lock b/gemfiles/3.3/Gemfile.lock index 1c7f24a4f3..99ccee0cbd 100644 --- a/gemfiles/3.3/Gemfile.lock +++ b/gemfiles/3.3/Gemfile.lock @@ -9,7 +9,7 @@ GEM ast (2.4.3) logger (1.7.0) mini_portile2 (2.8.9) - nokogiri (1.18.8) + nokogiri (1.18.9) mini_portile2 (~> 2.8.2) racc (~> 1.4) onigmo (0.1.0) From 015c940073399a8d6060bdb6b31f0fa988bdca9a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 23 Jul 2025 16:29:00 +0000 Subject: [PATCH 081/333] Bump nokogiri from 1.18.8 to 1.18.9 in /gemfiles/3.1 Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.18.8 to 1.18.9. - [Release notes](https://github.com/sparklemotion/nokogiri/releases) - [Changelog](https://github.com/sparklemotion/nokogiri/blob/main/CHANGELOG.md) - [Commits](https://github.com/sparklemotion/nokogiri/compare/v1.18.8...v1.18.9) --- updated-dependencies: - dependency-name: nokogiri dependency-version: 1.18.9 dependency-type: indirect ... Signed-off-by: dependabot[bot] --- gemfiles/3.1/Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gemfiles/3.1/Gemfile.lock b/gemfiles/3.1/Gemfile.lock index 7d5e598a41..62b7658126 100644 --- a/gemfiles/3.1/Gemfile.lock +++ b/gemfiles/3.1/Gemfile.lock @@ -9,7 +9,7 @@ GEM ast (2.4.3) logger (1.7.0) mini_portile2 (2.8.9) - nokogiri (1.18.8) + nokogiri (1.18.9) mini_portile2 (~> 2.8.2) racc (~> 1.4) onigmo (0.1.0) From fb136c6eb525747e88b46db3251201585cb5e0d2 Mon Sep 17 00:00:00 2001 From: S-H-GAMELINKS Date: Mon, 28 Jul 2025 23:25:49 +0900 Subject: [PATCH 082/333] Convert implicit parameter `it` to local variable in `parse_expression_infix` function --- src/prism.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/prism.c b/src/prism.c index f9aee2b72f..32930b900e 100644 --- a/src/prism.c +++ b/src/prism.c @@ -16456,13 +16456,6 @@ parse_variable(pm_parser_t *parser) { return node; } else if ((parser->version != PM_OPTIONS_VERSION_CRUBY_3_3) && pm_token_is_it(parser->previous.start, parser->previous.end)) { - if (match1(parser, PM_TOKEN_EQUAL)) { - pm_constant_id_t name_id = pm_parser_local_add_location(parser, parser->previous.start, parser->previous.end, 0); - pm_node_t *node = (pm_node_t *) pm_local_variable_read_node_create_constant_id(parser, &parser->previous, name_id, 0, false); - - return node; - } - pm_node_t *node = (pm_node_t *) pm_it_local_variable_read_node_create(parser, &parser->previous); pm_node_list_append(¤t_scope->implicit_parameters, node); @@ -21178,6 +21171,13 @@ parse_expression_infix(pm_parser_t *parser, pm_node_t *node, pm_binding_power_t } PRISM_FALLTHROUGH case PM_CASE_WRITABLE: { + // When we have `it = value`, we need to add `it` as a local + // variable before parsing the value, in case the value + // references the variable. + if (PM_NODE_TYPE_P(node, PM_IT_LOCAL_VARIABLE_READ_NODE)) { + pm_parser_local_add_location(parser, node->location.start, node->location.end, 0); + } + parser_lex(parser); pm_node_t *value = parse_assignment_values(parser, previous_binding_power, PM_NODE_TYPE_P(node, PM_MULTI_TARGET_NODE) ? PM_BINDING_POWER_MULTI_ASSIGNMENT + 1 : binding_power, accepts_command_call, PM_ERR_EXPECT_EXPRESSION_AFTER_EQUAL, (uint16_t) (depth + 1)); From c4d51c85e43b23cefe9f4c67fd512dd833535b6b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 28 Jul 2025 17:50:28 +0000 Subject: [PATCH 083/333] Bump org.junit.jupiter:junit-jupiter-engine Bumps the java-deps group in /java-wasm with 1 update: [org.junit.jupiter:junit-jupiter-engine](https://github.com/junit-team/junit-framework). Updates `org.junit.jupiter:junit-jupiter-engine` from 5.13.3 to 5.13.4 - [Release notes](https://github.com/junit-team/junit-framework/releases) - [Commits](https://github.com/junit-team/junit-framework/compare/r5.13.3...r5.13.4) --- updated-dependencies: - dependency-name: org.junit.jupiter:junit-jupiter-engine dependency-version: 5.13.4 dependency-type: direct:development update-type: version-update:semver-patch dependency-group: java-deps ... Signed-off-by: dependabot[bot] --- java-wasm/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java-wasm/pom.xml b/java-wasm/pom.xml index 7b313ca3d3..b0f3ab0730 100644 --- a/java-wasm/pom.xml +++ b/java-wasm/pom.xml @@ -16,7 +16,7 @@ 11 1.3.0 - 5.13.3 + 5.13.4 From 6bc85762d84adcb43602693464e682f296e979f9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 28 Jul 2025 20:43:29 +0000 Subject: [PATCH 084/333] Bump the ruby-deps group across 10 directories with 2 updates Bumps the ruby-deps group with 1 update in the /gemfiles/2.7 directory: [parser](https://github.com/whitequark/parser). Bumps the ruby-deps group with 1 update in the /gemfiles/3.0 directory: [parser](https://github.com/whitequark/parser). Bumps the ruby-deps group with 1 update in the /gemfiles/3.1 directory: [parser](https://github.com/whitequark/parser). Bumps the ruby-deps group with 1 update in the /gemfiles/3.2 directory: [parser](https://github.com/whitequark/parser). Bumps the ruby-deps group with 1 update in the /gemfiles/3.3 directory: [parser](https://github.com/whitequark/parser). Bumps the ruby-deps group with 1 update in the /gemfiles/3.4 directory: [parser](https://github.com/whitequark/parser). Bumps the ruby-deps group with 1 update in the /gemfiles/3.5 directory: [parser](https://github.com/whitequark/parser). Bumps the ruby-deps group with 1 update in the /gemfiles/jruby directory: [parser](https://github.com/whitequark/parser). Bumps the ruby-deps group with 1 update in the /gemfiles/truffleruby directory: [parser](https://github.com/whitequark/parser). Bumps the ruby-deps group with 2 updates in the /gemfiles/typecheck directory: [parser](https://github.com/whitequark/parser) and [sorbet](https://github.com/sorbet/sorbet). Updates `parser` from 3.3.8.0 to 3.3.9.0 - [Changelog](https://github.com/whitequark/parser/blob/master/CHANGELOG.md) - [Commits](https://github.com/whitequark/parser/compare/v3.3.8.0...v3.3.9.0) Updates `parser` from 3.3.8.0 to 3.3.9.0 - [Changelog](https://github.com/whitequark/parser/blob/master/CHANGELOG.md) - [Commits](https://github.com/whitequark/parser/compare/v3.3.8.0...v3.3.9.0) Updates `parser` from 3.3.8.0 to 3.3.9.0 - [Changelog](https://github.com/whitequark/parser/blob/master/CHANGELOG.md) - [Commits](https://github.com/whitequark/parser/compare/v3.3.8.0...v3.3.9.0) Updates `parser` from 3.3.8.0 to 3.3.9.0 - [Changelog](https://github.com/whitequark/parser/blob/master/CHANGELOG.md) - [Commits](https://github.com/whitequark/parser/compare/v3.3.8.0...v3.3.9.0) Updates `parser` from 3.3.8.0 to 3.3.9.0 - [Changelog](https://github.com/whitequark/parser/blob/master/CHANGELOG.md) - [Commits](https://github.com/whitequark/parser/compare/v3.3.8.0...v3.3.9.0) Updates `parser` from 3.3.8.0 to 3.3.9.0 - [Changelog](https://github.com/whitequark/parser/blob/master/CHANGELOG.md) - [Commits](https://github.com/whitequark/parser/compare/v3.3.8.0...v3.3.9.0) Updates `parser` from 3.3.8.0 to 3.3.9.0 - [Changelog](https://github.com/whitequark/parser/blob/master/CHANGELOG.md) - [Commits](https://github.com/whitequark/parser/compare/v3.3.8.0...v3.3.9.0) Updates `parser` from 3.3.8.0 to 3.3.9.0 - [Changelog](https://github.com/whitequark/parser/blob/master/CHANGELOG.md) - [Commits](https://github.com/whitequark/parser/compare/v3.3.8.0...v3.3.9.0) Updates `parser` from 3.3.8.0 to 3.3.9.0 - [Changelog](https://github.com/whitequark/parser/blob/master/CHANGELOG.md) - [Commits](https://github.com/whitequark/parser/compare/v3.3.8.0...v3.3.9.0) Updates `parser` from 3.3.8.0 to 3.3.9.0 - [Changelog](https://github.com/whitequark/parser/blob/master/CHANGELOG.md) - [Commits](https://github.com/whitequark/parser/compare/v3.3.8.0...v3.3.9.0) Updates `sorbet` from 0.5.12222 to 0.5.12358 - [Release notes](https://github.com/sorbet/sorbet/releases) - [Commits](https://github.com/sorbet/sorbet/commits) --- updated-dependencies: - dependency-name: parser dependency-version: 3.3.9.0 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps - dependency-name: parser dependency-version: 3.3.9.0 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps - dependency-name: parser dependency-version: 3.3.9.0 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps - dependency-name: parser dependency-version: 3.3.9.0 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps - dependency-name: parser dependency-version: 3.3.9.0 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps - dependency-name: parser dependency-version: 3.3.9.0 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps - dependency-name: parser dependency-version: 3.3.9.0 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps - dependency-name: parser dependency-version: 3.3.9.0 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps - dependency-name: parser dependency-version: 3.3.9.0 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps - dependency-name: parser dependency-version: 3.3.9.0 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps - dependency-name: sorbet dependency-version: 0.5.12358 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps ... Signed-off-by: dependabot[bot] --- 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/3.5/Gemfile.lock | 2 +- gemfiles/jruby/Gemfile.lock | 2 +- gemfiles/truffleruby/Gemfile.lock | 2 +- gemfiles/typecheck/Gemfile.lock | 18 +++++++++--------- 10 files changed, 18 insertions(+), 18 deletions(-) diff --git a/gemfiles/2.7/Gemfile.lock b/gemfiles/2.7/Gemfile.lock index 72745d80d2..4e0fad2836 100644 --- a/gemfiles/2.7/Gemfile.lock +++ b/gemfiles/2.7/Gemfile.lock @@ -8,7 +8,7 @@ GEM specs: ast (2.4.3) onigmo (0.1.0) - parser (3.3.8.0) + parser (3.3.9.0) ast (~> 2.4.1) racc power_assert (2.0.5) diff --git a/gemfiles/3.0/Gemfile.lock b/gemfiles/3.0/Gemfile.lock index 1c63d1d695..4ab2703d8f 100644 --- a/gemfiles/3.0/Gemfile.lock +++ b/gemfiles/3.0/Gemfile.lock @@ -13,7 +13,7 @@ GEM mini_portile2 (~> 2.8.2) racc (~> 1.4) onigmo (0.1.0) - parser (3.3.8.0) + parser (3.3.9.0) ast (~> 2.4.1) racc power_assert (2.0.5) diff --git a/gemfiles/3.1/Gemfile.lock b/gemfiles/3.1/Gemfile.lock index 62b7658126..c115307c27 100644 --- a/gemfiles/3.1/Gemfile.lock +++ b/gemfiles/3.1/Gemfile.lock @@ -13,7 +13,7 @@ GEM mini_portile2 (~> 2.8.2) racc (~> 1.4) onigmo (0.1.0) - parser (3.3.8.0) + parser (3.3.9.0) ast (~> 2.4.1) racc power_assert (2.0.5) diff --git a/gemfiles/3.2/Gemfile.lock b/gemfiles/3.2/Gemfile.lock index 1c766f367d..534c596118 100644 --- a/gemfiles/3.2/Gemfile.lock +++ b/gemfiles/3.2/Gemfile.lock @@ -13,7 +13,7 @@ GEM mini_portile2 (~> 2.8.2) racc (~> 1.4) onigmo (0.1.0) - parser (3.3.8.0) + parser (3.3.9.0) ast (~> 2.4.1) racc power_assert (2.0.5) diff --git a/gemfiles/3.3/Gemfile.lock b/gemfiles/3.3/Gemfile.lock index 99ccee0cbd..15c6d93ec8 100644 --- a/gemfiles/3.3/Gemfile.lock +++ b/gemfiles/3.3/Gemfile.lock @@ -13,7 +13,7 @@ GEM mini_portile2 (~> 2.8.2) racc (~> 1.4) onigmo (0.1.0) - parser (3.3.8.0) + parser (3.3.9.0) ast (~> 2.4.1) racc power_assert (2.0.5) diff --git a/gemfiles/3.4/Gemfile.lock b/gemfiles/3.4/Gemfile.lock index bc4478717a..5f6b164873 100644 --- a/gemfiles/3.4/Gemfile.lock +++ b/gemfiles/3.4/Gemfile.lock @@ -13,7 +13,7 @@ GEM mini_portile2 (~> 2.8.2) racc (~> 1.4) onigmo (0.1.0) - parser (3.3.8.0) + parser (3.3.9.0) ast (~> 2.4.1) racc power_assert (2.0.5) diff --git a/gemfiles/3.5/Gemfile.lock b/gemfiles/3.5/Gemfile.lock index 13e2ccb495..939a4d8152 100644 --- a/gemfiles/3.5/Gemfile.lock +++ b/gemfiles/3.5/Gemfile.lock @@ -14,7 +14,7 @@ GEM mini_portile2 (~> 2.8.2) racc (~> 1.4) onigmo (0.1.0) - parser (3.3.8.0) + parser (3.3.9.0) ast (~> 2.4.1) racc power_assert (2.0.5) diff --git a/gemfiles/jruby/Gemfile.lock b/gemfiles/jruby/Gemfile.lock index 86d641f8f9..dc74ae64f5 100644 --- a/gemfiles/jruby/Gemfile.lock +++ b/gemfiles/jruby/Gemfile.lock @@ -7,7 +7,7 @@ GEM remote: https://rubygems.org/ specs: ast (2.4.3) - parser (3.3.8.0) + parser (3.3.9.0) ast (~> 2.4.1) racc power_assert (2.0.5) diff --git a/gemfiles/truffleruby/Gemfile.lock b/gemfiles/truffleruby/Gemfile.lock index 44fb5b2a80..b46b447775 100644 --- a/gemfiles/truffleruby/Gemfile.lock +++ b/gemfiles/truffleruby/Gemfile.lock @@ -7,7 +7,7 @@ GEM remote: https://rubygems.org/ specs: ast (2.4.3) - parser (3.3.8.0) + parser (3.3.9.0) ast (~> 2.4.1) racc power_assert (2.0.5) diff --git a/gemfiles/typecheck/Gemfile.lock b/gemfiles/typecheck/Gemfile.lock index 274837fb4c..2b126857c6 100644 --- a/gemfiles/typecheck/Gemfile.lock +++ b/gemfiles/typecheck/Gemfile.lock @@ -38,7 +38,7 @@ GEM mutex_m (0.3.0) netrc (0.11.0) parallel (1.26.3) - parser (3.3.8.0) + parser (3.3.9.0) ast (~> 2.4.1) racc power_assert (2.0.5) @@ -62,14 +62,14 @@ GEM sexp_processor (~> 4.16) securerandom (0.4.1) sexp_processor (4.17.3) - sorbet (0.5.12222) - sorbet-static (= 0.5.12222) - sorbet-runtime (0.5.12222) - sorbet-static (0.5.12222-universal-darwin) - sorbet-static (0.5.12222-x86_64-linux) - sorbet-static-and-runtime (0.5.12222) - sorbet (= 0.5.12222) - sorbet-runtime (= 0.5.12222) + sorbet (0.5.12358) + sorbet-static (= 0.5.12358) + sorbet-runtime (0.5.12358) + sorbet-static (0.5.12358-universal-darwin) + sorbet-static (0.5.12358-x86_64-linux) + sorbet-static-and-runtime (0.5.12358) + sorbet (= 0.5.12358) + sorbet-runtime (= 0.5.12358) spoom (1.6.1) erubi (>= 1.10.0) prism (>= 0.28.0) From d1f80f761937ddddba86ebd0740285e5b4c9eecc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 29 Jul 2025 15:56:01 +0000 Subject: [PATCH 085/333] Bump thor from 1.3.2 to 1.4.0 in /gemfiles/typecheck Bumps [thor](https://github.com/rails/thor) from 1.3.2 to 1.4.0. - [Release notes](https://github.com/rails/thor/releases) - [Commits](https://github.com/rails/thor/compare/v1.3.2...v1.4.0) --- updated-dependencies: - dependency-name: thor dependency-version: 1.4.0 dependency-type: indirect ... Signed-off-by: dependabot[bot] --- gemfiles/typecheck/Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gemfiles/typecheck/Gemfile.lock b/gemfiles/typecheck/Gemfile.lock index 2b126857c6..4ca355aecb 100644 --- a/gemfiles/typecheck/Gemfile.lock +++ b/gemfiles/typecheck/Gemfile.lock @@ -108,7 +108,7 @@ GEM unicode-display_width (>= 1.1.1, < 4) test-unit (3.7.0) power_assert - thor (1.3.2) + thor (1.4.0) tzinfo (2.0.6) concurrent-ruby (~> 1.0) unicode-display_width (3.1.4) From 802ebad722839d2afc5d3c27cc49a0fa4b5c0ca5 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Tue, 29 Jul 2025 11:59:33 -0400 Subject: [PATCH 086/333] Bump nokogiri versions --- gemfiles/3.1/Gemfile.lock | 2 +- gemfiles/3.2/Gemfile.lock | 2 +- gemfiles/3.4/Gemfile.lock | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/gemfiles/3.1/Gemfile.lock b/gemfiles/3.1/Gemfile.lock index c115307c27..478fb15e93 100644 --- a/gemfiles/3.1/Gemfile.lock +++ b/gemfiles/3.1/Gemfile.lock @@ -45,4 +45,4 @@ RUBY VERSION ruby 3.1.4p223 BUNDLED WITH - 2.3.26 + 2.3.27 diff --git a/gemfiles/3.2/Gemfile.lock b/gemfiles/3.2/Gemfile.lock index 534c596118..dd992a90bb 100644 --- a/gemfiles/3.2/Gemfile.lock +++ b/gemfiles/3.2/Gemfile.lock @@ -9,7 +9,7 @@ GEM ast (2.4.3) logger (1.7.0) mini_portile2 (2.8.9) - nokogiri (1.18.8) + nokogiri (1.18.9) mini_portile2 (~> 2.8.2) racc (~> 1.4) onigmo (0.1.0) diff --git a/gemfiles/3.4/Gemfile.lock b/gemfiles/3.4/Gemfile.lock index 5f6b164873..19d441d8d7 100644 --- a/gemfiles/3.4/Gemfile.lock +++ b/gemfiles/3.4/Gemfile.lock @@ -8,8 +8,8 @@ GEM specs: ast (2.4.3) logger (1.7.0) - mini_portile2 (2.8.8) - nokogiri (1.18.8) + mini_portile2 (2.8.9) + nokogiri (1.18.9) mini_portile2 (~> 2.8.2) racc (~> 1.4) onigmo (0.1.0) From 3e99e77c166c0db5faeba0a8152e98ce0712f549 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Tue, 29 Jul 2025 12:00:18 -0400 Subject: [PATCH 087/333] Bump nokogiri in main Gemfile --- Gemfile.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index d5b5741d73..b753b3a01b 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -10,8 +10,8 @@ GEM benchmark-ips (2.14.0) date (3.4.1) ffi (1.17.1) - mini_portile2 (2.8.8) - nokogiri (1.18.5) + mini_portile2 (2.8.9) + nokogiri (1.18.9) mini_portile2 (~> 2.8.2) racc (~> 1.4) onigmo (0.1.0) From c2e372a8d820f8bfdba577b4893943a458c6f1f9 Mon Sep 17 00:00:00 2001 From: Justin Collins Date: Wed, 30 Jul 2025 16:58:05 -0600 Subject: [PATCH 088/333] RubyParser translation for stabby lambdas with `it` --- lib/prism/translation/ruby_parser.rb | 2 +- snapshots/it.txt | 67 +++++++++++++++++----------- test/prism/fixtures/it.txt | 2 + test/prism/ruby/parser_test.rb | 6 ++- 4 files changed, 49 insertions(+), 28 deletions(-) diff --git a/lib/prism/translation/ruby_parser.rb b/lib/prism/translation/ruby_parser.rb index 3808cd3130..1ac394b9f1 100644 --- a/lib/prism/translation/ruby_parser.rb +++ b/lib/prism/translation/ruby_parser.rb @@ -1151,7 +1151,7 @@ def visit_keyword_rest_parameter_node(node) def visit_lambda_node(node) parameters = case node.parameters - when nil, NumberedParametersNode + when nil, ItParametersNode, NumberedParametersNode s(node, :args) else visit(node.parameters) diff --git a/snapshots/it.txt b/snapshots/it.txt index d3d676f768..70a2916eb2 100644 --- a/snapshots/it.txt +++ b/snapshots/it.txt @@ -1,31 +1,46 @@ -@ ProgramNode (location: (1,0)-(3,3)) +@ ProgramNode (location: (1,0)-(5,9)) ├── flags: ∅ ├── locals: [] └── statements: - @ StatementsNode (location: (1,0)-(3,3)) + @ StatementsNode (location: (1,0)-(5,9)) ├── flags: ∅ - └── body: (length: 1) - └── @ CallNode (location: (1,0)-(3,3)) - ├── flags: newline, ignore_visibility - ├── receiver: ∅ - ├── call_operator_loc: ∅ - ├── name: :x - ├── message_loc: (1,0)-(1,1) = "x" - ├── opening_loc: ∅ - ├── arguments: ∅ - ├── closing_loc: ∅ - └── block: - @ BlockNode (location: (1,2)-(3,3)) + └── body: (length: 2) + ├── @ CallNode (location: (1,0)-(3,3)) + │ ├── flags: newline, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :x + │ ├── message_loc: (1,0)-(1,1) = "x" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (1,2)-(3,3)) + │ ├── flags: ∅ + │ ├── locals: [] + │ ├── parameters: + │ │ @ ItParametersNode (location: (1,2)-(3,3)) + │ │ └── flags: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (2,2)-(2,4)) + │ │ ├── flags: ∅ + │ │ └── body: (length: 1) + │ │ └── @ ItLocalVariableReadNode (location: (2,2)-(2,4)) + │ │ └── flags: newline + │ ├── opening_loc: (1,2)-(1,4) = "do" + │ └── closing_loc: (3,0)-(3,3) = "end" + └── @ LambdaNode (location: (5,0)-(5,9)) + ├── flags: newline + ├── locals: [] + ├── operator_loc: (5,0)-(5,2) = "->" + ├── opening_loc: (5,3)-(5,4) = "{" + ├── closing_loc: (5,8)-(5,9) = "}" + ├── parameters: + │ @ ItParametersNode (location: (5,0)-(5,9)) + │ └── flags: ∅ + └── body: + @ StatementsNode (location: (5,5)-(5,7)) ├── flags: ∅ - ├── locals: [] - ├── parameters: - │ @ ItParametersNode (location: (1,2)-(3,3)) - │ └── flags: ∅ - ├── body: - │ @ StatementsNode (location: (2,2)-(2,4)) - │ ├── flags: ∅ - │ └── body: (length: 1) - │ └── @ ItLocalVariableReadNode (location: (2,2)-(2,4)) - │ └── flags: newline - ├── opening_loc: (1,2)-(1,4) = "do" - └── closing_loc: (3,0)-(3,3) = "end" + └── body: (length: 1) + └── @ ItLocalVariableReadNode (location: (5,5)-(5,7)) + └── flags: newline diff --git a/test/prism/fixtures/it.txt b/test/prism/fixtures/it.txt index 76deb68028..5410b01e71 100644 --- a/test/prism/fixtures/it.txt +++ b/test/prism/fixtures/it.txt @@ -1,3 +1,5 @@ x do it end + +-> { it } diff --git a/test/prism/ruby/parser_test.rb b/test/prism/ruby/parser_test.rb index 82b5ea54a8..156e8f9e9f 100644 --- a/test/prism/ruby/parser_test.rb +++ b/test/prism/ruby/parser_test.rb @@ -171,9 +171,13 @@ def test_it_block_parameter_syntax actual_ast = Prism::Translation::Parser34.new.tokenize(buffer)[0] it_block_parameter_sexp = parse_sexp { + s(:begin, s(:itblock, s(:send, nil, :x), :it, - s(:lvar, :it)) + s(:lvar, :it)), + s(:itblock, + s(:lambda), :it, + s(:lvar, :it))) } assert_equal(it_block_parameter_sexp, actual_ast.to_sexp) From 9f55551b0991bd5f5dcfee0001c3e7640e7eb68f Mon Sep 17 00:00:00 2001 From: Justin Collins Date: Thu, 31 Jul 2025 19:14:48 -0600 Subject: [PATCH 089/333] Match RubyParser behavior for -> lambda args --- lib/prism/translation/ruby_parser.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/prism/translation/ruby_parser.rb b/lib/prism/translation/ruby_parser.rb index 1ac394b9f1..ac538a2e97 100644 --- a/lib/prism/translation/ruby_parser.rb +++ b/lib/prism/translation/ruby_parser.rb @@ -1152,7 +1152,7 @@ def visit_lambda_node(node) parameters = case node.parameters when nil, ItParametersNode, NumberedParametersNode - s(node, :args) + 0 else visit(node.parameters) end From 7362b114a3e2635571f0054ba97b1352a2a748a5 Mon Sep 17 00:00:00 2001 From: Justin Collins Date: Thu, 31 Jul 2025 19:15:21 -0600 Subject: [PATCH 090/333] Avoid monkey patching Sexp#== in RubyParser tests --- test/prism/ruby/ruby_parser_test.rb | 27 ++++++++------------------- 1 file changed, 8 insertions(+), 19 deletions(-) diff --git a/test/prism/ruby/ruby_parser_test.rb b/test/prism/ruby/ruby_parser_test.rb index 03bcfafc42..960e7f63e4 100644 --- a/test/prism/ruby/ruby_parser_test.rb +++ b/test/prism/ruby/ruby_parser_test.rb @@ -13,23 +13,11 @@ return end -# We want to also compare lines and files to make sure we're setting them -# correctly. -Sexp.prepend( - Module.new do - def ==(other) - super && line == other.line && file == other.file # && line_max == other.line_max - end - end -) - module Prism class RubyParserTest < TestCase todos = [ "encoding_euc_jp.txt", - "newline_terminated.txt", "regex_char_width.txt", - "seattlerb/bug169.txt", "seattlerb/masgn_colon3.txt", "seattlerb/messy_op_asgn_lineno.txt", "seattlerb/op_asgn_primary_colon_const_command_call.txt", @@ -37,15 +25,10 @@ class RubyParserTest < TestCase "seattlerb/str_lit_concat_bad_encodings.txt", "strings.txt", "unescaping.txt", - "unparser/corpus/literal/kwbegin.txt", - "unparser/corpus/literal/send.txt", "whitequark/masgn_const.txt", "whitequark/pattern_matching_constants.txt", - "whitequark/pattern_matching_implicit_array_match.txt", "whitequark/pattern_matching_single_match.txt", "whitequark/ruby_bug_12402.txt", - "whitequark/ruby_bug_14690.txt", - "whitequark/space_args_block.txt" ] # https://github.com/seattlerb/ruby_parser/issues/344 @@ -105,10 +88,16 @@ def assert_ruby_parser(fixture, allowed_failure) source = fixture.read expected = ignore_warnings { ::RubyParser.new.parse(source, fixture.path) } actual = Prism::Translation::RubyParser.new.parse(source, fixture.path) + on_failure = -> { message(expected, actual) } if !allowed_failure - assert_equal(expected, actual, -> { message(expected, actual) }) - elsif expected == actual + assert_equal(expected, actual, on_failure) + + unless actual.nil? + assert_equal(expected.line, actual.line, on_failure) + assert_equal(expected.file, actual.file, on_failure) + end + elsif expected == actual && expected.line && actual.line && expected.file == actual.file puts "#{name} now passes" end end From 8d15a90511ab4a2e8685972c830b4c579eb3af4d Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Thu, 17 Jul 2025 15:20:20 -0700 Subject: [PATCH 091/333] Add an `feof` callback to Prism stream parsing Checking the return value of `fgets` isn't good enough to determine whether the input stream has reached EOF or not. `fgets` could have run in to an error and returned NULL. Additionally, we can't just check the buffer contents for `\n` because `fgets` could have read the maximum buffer size (which may not have ended with a `\n`). I want to use this callback to implement a fix for: https://bugs.ruby-lang.org/issues/21188 --- ext/prism/extension.c | 10 +++++++++- include/prism.h | 12 ++++++++++-- lib/prism/ffi.rb | 4 +++- src/prism.c | 19 +++++++++++++------ 4 files changed, 35 insertions(+), 10 deletions(-) diff --git a/ext/prism/extension.c b/ext/prism/extension.c index 1533ca7bb3..83415d0c29 100644 --- a/ext/prism/extension.c +++ b/ext/prism/extension.c @@ -994,6 +994,14 @@ profile_file(int argc, VALUE *argv, VALUE self) { return Qnil; } +static int +parse_stream_eof(void *stream) { + if (rb_funcall((VALUE) stream, rb_intern("eof?"), 0)) { + return 1; + } + return 0; +} + /** * An implementation of fgets that is suitable for use with Ruby IO objects. */ @@ -1034,7 +1042,7 @@ parse_stream(int argc, VALUE *argv, VALUE self) { pm_parser_t parser; pm_buffer_t buffer; - pm_node_t *node = pm_parse_stream(&parser, &buffer, (void *) stream, parse_stream_fgets, &options); + pm_node_t *node = pm_parse_stream(&parser, &buffer, (void *) stream, parse_stream_fgets, parse_stream_eof, &options); rb_encoding *encoding = rb_enc_find(parser.encoding->name); VALUE source = pm_source_new(&parser, encoding, options.freeze); diff --git a/include/prism.h b/include/prism.h index 317568aa0c..e514ce60a1 100644 --- a/include/prism.h +++ b/include/prism.h @@ -87,6 +87,13 @@ PRISM_EXPORTED_FUNCTION pm_node_t * pm_parse(pm_parser_t *parser); */ typedef char * (pm_parse_stream_fgets_t)(char *string, int size, void *stream); +/** + * This function is used in pm_parse_stream to check whether a stream is EOF. + * It closely mirrors that of feof so that feof can be used as the + * default implementation. + */ +typedef int (pm_parse_stream_feof_t)(void *stream); + /** * Parse a stream of Ruby source and return the tree. * @@ -94,10 +101,11 @@ typedef char * (pm_parse_stream_fgets_t)(char *string, int size, void *stream); * @param buffer The buffer to use. * @param stream The stream to parse. * @param stream_fgets The function to use to read from the stream. + * @param stream_feof The function to use to determine if the stream has hit eof. * @param options The optional options to use when parsing. * @return The AST representing the source. */ -PRISM_EXPORTED_FUNCTION pm_node_t * pm_parse_stream(pm_parser_t *parser, pm_buffer_t *buffer, void *stream, pm_parse_stream_fgets_t *stream_fgets, const pm_options_t *options); +PRISM_EXPORTED_FUNCTION pm_node_t * pm_parse_stream(pm_parser_t *parser, pm_buffer_t *buffer, void *stream, pm_parse_stream_fgets_t *stream_fgets, pm_parse_stream_feof_t *stream_feof, const pm_options_t *options); // We optionally support serializing to a binary string. For systems that don't // want or need this functionality, it can be turned off with the @@ -113,7 +121,7 @@ PRISM_EXPORTED_FUNCTION pm_node_t * pm_parse_stream(pm_parser_t *parser, pm_buff * @param stream_fgets The function to use to read from the stream. * @param data The optional data to pass to the parser. */ -PRISM_EXPORTED_FUNCTION void pm_serialize_parse_stream(pm_buffer_t *buffer, void *stream, pm_parse_stream_fgets_t *stream_fgets, const char *data); +PRISM_EXPORTED_FUNCTION void pm_serialize_parse_stream(pm_buffer_t *buffer, void *stream, pm_parse_stream_fgets_t *stream_fgets, pm_parse_stream_feof_t *stream_feof, const char *data); /** * Serialize the given list of comments to the given buffer. diff --git a/lib/prism/ffi.rb b/lib/prism/ffi.rb index 1e1bf8b1c8..864c81a641 100644 --- a/lib/prism/ffi.rb +++ b/lib/prism/ffi.rb @@ -281,12 +281,14 @@ def parse_stream(stream, **options) end } + eof_callback = -> (_) { stream.eof? } + # In the pm_serialize_parse_stream function it accepts a pointer to the # IO object as a void* and then passes it through to the callback as the # third argument, but it never touches it itself. As such, since we have # access to the IO object already through the closure of the lambda, we # can pass a null pointer here and not worry. - LibRubyParser.pm_serialize_parse_stream(buffer.pointer, nil, callback, dump_options(options)) + LibRubyParser.pm_serialize_parse_stream(buffer.pointer, nil, callback, eof_callback, dump_options(options)) Prism.load(source, buffer.read, options.fetch(:freeze, false)) end end diff --git a/src/prism.c b/src/prism.c index f2e96b48c2..afd767b84c 100644 --- a/src/prism.c +++ b/src/prism.c @@ -22842,7 +22842,7 @@ pm_parse(pm_parser_t *parser) { * otherwise return true. */ static bool -pm_parse_stream_read(pm_buffer_t *buffer, void *stream, pm_parse_stream_fgets_t *stream_fgets) { +pm_parse_stream_read(pm_buffer_t *buffer, void *stream, pm_parse_stream_fgets_t *stream_fgets, pm_parse_stream_feof_t *stream_feof) { #define LINE_SIZE 4096 char line[LINE_SIZE]; @@ -22878,6 +22878,12 @@ pm_parse_stream_read(pm_buffer_t *buffer, void *stream, pm_parse_stream_fgets_t if (strncmp(line, "__END__\r\n", 9) == 0) return false; break; } + + // All data should be read via gets. If the string returned by gets + // _doesn't_ end with a newline, then we assume we hit EOF condition. + if (stream_feof(stream)) { + break; + } } return true; @@ -22913,16 +22919,17 @@ pm_parse_stream_unterminated_heredoc_p(pm_parser_t *parser) { * can stream stdin in to Ruby so we need to support a streaming API. */ PRISM_EXPORTED_FUNCTION pm_node_t * -pm_parse_stream(pm_parser_t *parser, pm_buffer_t *buffer, void *stream, pm_parse_stream_fgets_t *stream_fgets, const pm_options_t *options) { +pm_parse_stream(pm_parser_t *parser, pm_buffer_t *buffer, void *stream, pm_parse_stream_fgets_t *stream_fgets, pm_parse_stream_feof_t *stream_feof, const pm_options_t *options) { pm_buffer_init(buffer); - bool eof = pm_parse_stream_read(buffer, stream, stream_fgets); + bool eof = pm_parse_stream_read(buffer, stream, stream_fgets, stream_feof); + pm_parser_init(parser, (const uint8_t *) pm_buffer_value(buffer), pm_buffer_length(buffer), options); pm_node_t *node = pm_parse(parser); while (!eof && parser->error_list.size > 0 && (parser->lex_modes.index > 0 || pm_parse_stream_unterminated_heredoc_p(parser))) { pm_node_destroy(parser, node); - eof = pm_parse_stream_read(buffer, stream, stream_fgets); + eof = pm_parse_stream_read(buffer, stream, stream_fgets, stream_feof); pm_parser_free(parser); pm_parser_init(parser, (const uint8_t *) pm_buffer_value(buffer), pm_buffer_length(buffer), options); @@ -23014,13 +23021,13 @@ pm_serialize_parse(pm_buffer_t *buffer, const uint8_t *source, size_t size, cons * given stream into to the given buffer. */ PRISM_EXPORTED_FUNCTION void -pm_serialize_parse_stream(pm_buffer_t *buffer, void *stream, pm_parse_stream_fgets_t *stream_fgets, const char *data) { +pm_serialize_parse_stream(pm_buffer_t *buffer, void *stream, pm_parse_stream_fgets_t *stream_fgets, pm_parse_stream_feof_t *stream_feof, const char *data) { pm_parser_t parser; pm_options_t options = { 0 }; pm_options_read(&options, data); pm_buffer_t parser_buffer; - pm_node_t *node = pm_parse_stream(&parser, &parser_buffer, stream, stream_fgets, &options); + pm_node_t *node = pm_parse_stream(&parser, &parser_buffer, stream, stream_fgets, stream_feof, &options); pm_serialize_header(buffer); pm_serialize_content(&parser, node, buffer); pm_buffer_append_byte(buffer, '\0'); From 3254b0bfa08edb1580ca452ef9fd0a5e9db92da6 Mon Sep 17 00:00:00 2001 From: eileencodes Date: Tue, 29 Jul 2025 13:49:01 -0400 Subject: [PATCH 092/333] Fix ffi callback type --- lib/prism/ffi.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/prism/ffi.rb b/lib/prism/ffi.rb index 864c81a641..5ae177055f 100644 --- a/lib/prism/ffi.rb +++ b/lib/prism/ffi.rb @@ -86,6 +86,7 @@ def self.load_exported_functions_from(header, *functions, callbacks) end callback :pm_parse_stream_fgets_t, [:pointer, :int, :pointer], :pointer + callback :pm_parse_stream_feof_t, [:pointer], :int enum :pm_string_init_result_t, %i[PM_STRING_INIT_SUCCESS PM_STRING_INIT_ERROR_GENERIC PM_STRING_INIT_ERROR_DIRECTORY] enum :pm_string_query_t, [:PM_STRING_QUERY_ERROR, -1, :PM_STRING_QUERY_FALSE, :PM_STRING_QUERY_TRUE] @@ -101,7 +102,7 @@ def self.load_exported_functions_from(header, *functions, callbacks) "pm_string_query_local", "pm_string_query_constant", "pm_string_query_method_name", - [:pm_parse_stream_fgets_t] + [:pm_parse_stream_fgets_t, :pm_parse_stream_feof_t] ) load_exported_functions_from( From 802a1232c597df0c0e24b44ff18fda7ac3afb481 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Fri, 1 Aug 2025 10:33:36 -0700 Subject: [PATCH 093/333] Add documentation for stream_feof --- include/prism.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/prism.h b/include/prism.h index e514ce60a1..a6f22f1a5a 100644 --- a/include/prism.h +++ b/include/prism.h @@ -119,6 +119,7 @@ PRISM_EXPORTED_FUNCTION pm_node_t * pm_parse_stream(pm_parser_t *parser, pm_buff * @param buffer The buffer to serialize to. * @param stream The stream to parse. * @param stream_fgets The function to use to read from the stream. + * @param stream_feof The function to use to tell if the stream has hit eof. * @param data The optional data to pass to the parser. */ PRISM_EXPORTED_FUNCTION void pm_serialize_parse_stream(pm_buffer_t *buffer, void *stream, pm_parse_stream_fgets_t *stream_fgets, pm_parse_stream_feof_t *stream_feof, const char *data); From 063cefcebab0a8c3e5df815f4d7dae6e90728adf Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 4 Aug 2025 23:21:50 +0000 Subject: [PATCH 094/333] Bump sorbet Bumps the ruby-deps group with 1 update in the /gemfiles/typecheck directory: [sorbet](https://github.com/sorbet/sorbet). Updates `sorbet` from 0.5.12358 to 0.5.12371 - [Release notes](https://github.com/sorbet/sorbet/releases) - [Commits](https://github.com/sorbet/sorbet/commits) --- updated-dependencies: - dependency-name: sorbet dependency-version: 0.5.12371 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps ... Signed-off-by: dependabot[bot] --- gemfiles/typecheck/Gemfile.lock | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/gemfiles/typecheck/Gemfile.lock b/gemfiles/typecheck/Gemfile.lock index 4ca355aecb..be979b5549 100644 --- a/gemfiles/typecheck/Gemfile.lock +++ b/gemfiles/typecheck/Gemfile.lock @@ -62,14 +62,14 @@ GEM sexp_processor (~> 4.16) securerandom (0.4.1) sexp_processor (4.17.3) - sorbet (0.5.12358) - sorbet-static (= 0.5.12358) - sorbet-runtime (0.5.12358) - sorbet-static (0.5.12358-universal-darwin) - sorbet-static (0.5.12358-x86_64-linux) - sorbet-static-and-runtime (0.5.12358) - sorbet (= 0.5.12358) - sorbet-runtime (= 0.5.12358) + sorbet (0.5.12371) + sorbet-static (= 0.5.12371) + sorbet-runtime (0.5.12371) + sorbet-static (0.5.12371-universal-darwin) + sorbet-static (0.5.12371-x86_64-linux) + sorbet-static-and-runtime (0.5.12371) + sorbet (= 0.5.12371) + sorbet-runtime (= 0.5.12371) spoom (1.6.1) erubi (>= 1.10.0) prism (>= 0.28.0) From 90f3c83b783b3134f9d819e3878f4a097c503c22 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Tue, 5 Aug 2025 11:54:46 -0400 Subject: [PATCH 095/333] Reverse-sync CGI changes from upstream --- templates/lib/prism/dot_visitor.rb.erb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/templates/lib/prism/dot_visitor.rb.erb b/templates/lib/prism/dot_visitor.rb.erb index e9c81e4545..cd2998fe61 100644 --- a/templates/lib/prism/dot_visitor.rb.erb +++ b/templates/lib/prism/dot_visitor.rb.erb @@ -1,4 +1,5 @@ -require "cgi" +require "cgi/escape" +require "cgi/util" unless defined?(CGI::EscapeExt) module Prism # This visitor provides the ability to call Node#to_dot, which converts a From 16009b1776e91735943212ffa1b153f94bdfd9f7 Mon Sep 17 00:00:00 2001 From: Earlopain <14981592+Earlopain@users.noreply.github.com> Date: Wed, 6 Aug 2025 12:41:15 +0200 Subject: [PATCH 096/333] Bump dependencies ruby-3.5-dev requires stringio 3.1.7 to compile. See https://github.com/ruby/stringio/pull/129 Not sure how CI does it, but this makes bundle install possible locally with ruby-dev --- Gemfile.lock | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index b753b3a01b..d5f084d244 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -9,24 +9,26 @@ GEM ast (2.4.3) benchmark-ips (2.14.0) date (3.4.1) - ffi (1.17.1) + erb (5.0.2) + ffi (1.17.2) mini_portile2 (2.8.9) nokogiri (1.18.9) mini_portile2 (~> 2.8.2) racc (~> 1.4) onigmo (0.1.0) - parser (3.3.7.4) + parser (3.3.9.0) ast (~> 2.4.1) racc power_assert (2.0.5) - psych (5.2.3) + psych (5.2.6) date stringio racc (1.8.1) - rake (13.2.1) - rake-compiler (1.2.9) + rake (13.3.0) + rake-compiler (1.3.0) rake - rdoc (6.12.0) + rdoc (6.14.2) + erb psych (>= 4.0.0) ruby_memcheck (3.0.1) nokogiri @@ -34,8 +36,8 @@ GEM racc (~> 1.5) sexp_processor (~> 4.16) sexp_processor (4.17.3) - stringio (3.1.5) - test-unit (3.6.7) + stringio (3.1.7) + test-unit (3.7.0) power_assert PLATFORMS From a27ebc6816b09de47a7c29aad55a6197c24629d8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 11 Aug 2025 23:19:02 +0000 Subject: [PATCH 097/333] Bump sorbet Bumps the ruby-deps group with 1 update in the /gemfiles/typecheck directory: [sorbet](https://github.com/sorbet/sorbet). Updates `sorbet` from 0.5.12371 to 0.5.12383 - [Release notes](https://github.com/sorbet/sorbet/releases) - [Commits](https://github.com/sorbet/sorbet/commits) --- updated-dependencies: - dependency-name: sorbet dependency-version: 0.5.12383 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps ... Signed-off-by: dependabot[bot] --- gemfiles/typecheck/Gemfile.lock | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/gemfiles/typecheck/Gemfile.lock b/gemfiles/typecheck/Gemfile.lock index be979b5549..9d0353f620 100644 --- a/gemfiles/typecheck/Gemfile.lock +++ b/gemfiles/typecheck/Gemfile.lock @@ -62,14 +62,14 @@ GEM sexp_processor (~> 4.16) securerandom (0.4.1) sexp_processor (4.17.3) - sorbet (0.5.12371) - sorbet-static (= 0.5.12371) - sorbet-runtime (0.5.12371) - sorbet-static (0.5.12371-universal-darwin) - sorbet-static (0.5.12371-x86_64-linux) - sorbet-static-and-runtime (0.5.12371) - sorbet (= 0.5.12371) - sorbet-runtime (= 0.5.12371) + sorbet (0.5.12383) + sorbet-static (= 0.5.12383) + sorbet-runtime (0.5.12383) + sorbet-static (0.5.12383-universal-darwin) + sorbet-static (0.5.12383-x86_64-linux) + sorbet-static-and-runtime (0.5.12383) + sorbet (= 0.5.12383) + sorbet-runtime (= 0.5.12383) spoom (1.6.1) erubi (>= 1.10.0) prism (>= 0.28.0) From 4a3866af19cf4a25e7c4dc2e9be794aa84c7803d Mon Sep 17 00:00:00 2001 From: Earlopain <14981592+Earlopain@users.noreply.github.com> Date: Thu, 14 Aug 2025 17:05:54 +0200 Subject: [PATCH 098/333] Be more defensive in the parser translator lexer Generally I have been good about safely accessing the tokens but failed to properly guard against no tokens in places where it could theoretically happen through invalid syntax. I added a test case for one occurance, other changes are theoretical only. --- lib/prism/translation/parser/lexer.rb | 31 ++++++++++++++------------- test/prism/ruby/parser_test.rb | 16 ++++++++++++++ 2 files changed, 32 insertions(+), 15 deletions(-) diff --git a/lib/prism/translation/parser/lexer.rb b/lib/prism/translation/parser/lexer.rb index dd4867415c..222df74559 100644 --- a/lib/prism/translation/parser/lexer.rb +++ b/lib/prism/translation/parser/lexer.rb @@ -277,20 +277,20 @@ def to_a when :tCOMMENT if token.type == :EMBDOC_BEGIN - while !((next_token = lexed[index][0]) && next_token.type == :EMBDOC_END) && (index < length - 1) + while !((next_token = lexed[index]&.first) && next_token.type == :EMBDOC_END) && (index < length - 1) value += next_token.value index += 1 end value += next_token.value - location = range(token.location.start_offset, lexed[index][0].location.end_offset) + location = range(token.location.start_offset, next_token.location.end_offset) index += 1 else is_at_eol = value.chomp!.nil? location = range(token.location.start_offset, token.location.end_offset + (is_at_eol ? 0 : -1)) - prev_token = lexed[index - 2][0] if index - 2 >= 0 - next_token = lexed[index][0] + prev_token, _ = lexed[index - 2] if index - 2 >= 0 + next_token, _ = lexed[index] is_inline_comment = prev_token&.location&.start_line == token.location.start_line if is_inline_comment && !is_at_eol && !COMMENT_CONTINUATION_TYPES.include?(next_token&.type) @@ -309,7 +309,7 @@ def to_a end end when :tNL - next_token = next_token = lexed[index][0] + next_token, _ = lexed[index] # Newlines after comments are emitted out of order. if next_token&.type == :COMMENT comment_newline_location = location @@ -346,8 +346,8 @@ def to_a location = range(token.location.start_offset, token.location.start_offset + percent_array_leading_whitespace(value)) value = nil when :tSTRING_BEG - next_token = lexed[index][0] - next_next_token = lexed[index + 1][0] + next_token, _ = lexed[index] + next_next_token, _ = lexed[index + 1] basic_quotes = value == '"' || value == "'" if basic_quotes && next_token&.type == :STRING_END @@ -415,7 +415,8 @@ def to_a while token.type == :STRING_CONTENT current_length += token.value.bytesize # Heredoc interpolation can have multiple STRING_CONTENT nodes on the same line. - is_first_token_on_line = lexed[index - 1] && token.location.start_line != lexed[index - 2][0].location&.start_line + prev_token, _ = lexed[index - 2] if index - 2 >= 0 + is_first_token_on_line = prev_token && token.location.start_line != prev_token.location.start_line # The parser gem only removes indentation when the heredoc is not nested not_nested = heredoc_stack.size == 1 if is_percent_array @@ -434,7 +435,7 @@ def to_a tokens << [:tSTRING_CONTENT, [current_string, range(start_offset, start_offset + current_length)]] break end - token = lexed[index][0] + token, _ = lexed[index] index += 1 end else @@ -489,7 +490,7 @@ def to_a end if percent_array?(quote_stack.pop) - prev_token = lexed[index - 2][0] if index - 2 >= 0 + prev_token, _ = lexed[index - 2] if index - 2 >= 0 empty = %i[PERCENT_LOWER_I PERCENT_LOWER_W PERCENT_UPPER_I PERCENT_UPPER_W].include?(prev_token&.type) ends_with_whitespace = prev_token&.type == :WORDS_SEP # parser always emits a space token after content in a percent array, even if no actual whitespace is present. @@ -498,7 +499,7 @@ def to_a end end when :tSYMBEG - if (next_token = lexed[index][0]) && next_token.type != :STRING_CONTENT && next_token.type != :EMBEXPR_BEGIN && next_token.type != :EMBVAR && next_token.type != :STRING_END + if (next_token = lexed[index]&.first) && next_token.type != :STRING_CONTENT && next_token.type != :EMBEXPR_BEGIN && next_token.type != :EMBVAR && next_token.type != :STRING_END next_location = token.location.join(next_token.location) type = :tSYMBOL value = next_token.value @@ -513,13 +514,13 @@ def to_a type = :tIDENTIFIER end when :tXSTRING_BEG - if (next_token = lexed[index][0]) && !%i[STRING_CONTENT STRING_END EMBEXPR_BEGIN].include?(next_token.type) + if (next_token = lexed[index]&.first) && !%i[STRING_CONTENT STRING_END EMBEXPR_BEGIN].include?(next_token.type) # self.`() type = :tBACK_REF2 end quote_stack.push(value) when :tSYMBOLS_BEG, :tQSYMBOLS_BEG, :tWORDS_BEG, :tQWORDS_BEG - if (next_token = lexed[index][0]) && next_token.type == :WORDS_SEP + if (next_token = lexed[index]&.first) && next_token.type == :WORDS_SEP index += 1 end @@ -595,9 +596,9 @@ def calculate_heredoc_whitespace(heredoc_token_index) previous_line = -1 result = Float::MAX - while (lexed[next_token_index] && next_token = lexed[next_token_index][0]) + while (next_token = lexed[next_token_index]&.first) next_token_index += 1 - next_next_token = lexed[next_token_index] && lexed[next_token_index][0] + next_next_token, _ = lexed[next_token_index] first_token_on_line = next_token.location.start_column == 0 # String content inside nested heredocs and interpolation is ignored diff --git a/test/prism/ruby/parser_test.rb b/test/prism/ruby/parser_test.rb index 156e8f9e9f..2a4ea981bd 100644 --- a/test/prism/ruby/parser_test.rb +++ b/test/prism/ruby/parser_test.rb @@ -163,6 +163,22 @@ def test_current_parser_for_current_ruby end end + def test_invalid_syntax + code = <<~RUBY + foo do + case bar + when + end + end + RUBY + buffer = Parser::Source::Buffer.new("(string)") + buffer.source = code + + parser = Prism::Translation::Parser33.new + parser.diagnostics.all_errors_are_fatal = true + assert_raise(Parser::SyntaxError) { parser.tokenize(buffer) } + end + def test_it_block_parameter_syntax it_fixture_path = Pathname(__dir__).join("../../../test/prism/fixtures/it.txt") From 90b50efa7bb3c6f5f02554abb44fb6f33aecbc73 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Thu, 14 Aug 2025 13:21:17 -0400 Subject: [PATCH 099/333] Bump checkout actions version --- .github/workflows/build-artifacts.yml | 2 +- .github/workflows/cpp-bindings.yml | 2 +- .github/workflows/cruby-bindings.yml | 4 +-- .github/workflows/documentation.yml | 2 +- .github/workflows/github-pages.yml | 2 +- .github/workflows/java-wasm-bindings.yml | 2 +- .github/workflows/javascript-bindings.yml | 2 +- .github/workflows/main.yml | 36 +++++++++++------------ .github/workflows/rust-bindings.yml | 6 ++-- 9 files changed, 29 insertions(+), 29 deletions(-) diff --git a/.github/workflows/build-artifacts.yml b/.github/workflows/build-artifacts.yml index ec57121d3c..d1504b8adc 100644 --- a/.github/workflows/build-artifacts.yml +++ b/.github/workflows/build-artifacts.yml @@ -14,7 +14,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - name: Set up Ruby uses: ruby/setup-ruby@v1 diff --git a/.github/workflows/cpp-bindings.yml b/.github/workflows/cpp-bindings.yml index 12176470a5..7ac2c068dc 100644 --- a/.github/workflows/cpp-bindings.yml +++ b/.github/workflows/cpp-bindings.yml @@ -19,7 +19,7 @@ jobs: fail-fast: false runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - name: Set up Ruby uses: ruby/setup-ruby@v1 with: diff --git a/.github/workflows/cruby-bindings.yml b/.github/workflows/cruby-bindings.yml index 23e62968b4..1312293c32 100644 --- a/.github/workflows/cruby-bindings.yml +++ b/.github/workflows/cruby-bindings.yml @@ -19,7 +19,7 @@ jobs: with: ruby-version: head bundler: none - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 with: repository: ruby/ruby path: ruby/ruby @@ -29,7 +29,7 @@ jobs: set -x sudo apt-get update -q || : sudo apt-get install --no-install-recommends -q -y build-essential libssl-dev libyaml-dev libreadline6-dev zlib1g-dev libncurses5-dev libffi-dev libgdbm-dev autoconf ruby - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 with: path: ruby/prism fetch-depth: 1 diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index 785fa409c9..8f9b6901f7 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -14,7 +14,7 @@ jobs: check: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - name: Set up Ruby uses: ruby/setup-ruby@v1 with: diff --git a/.github/workflows/github-pages.yml b/.github/workflows/github-pages.yml index 96174d2a67..179b7ed867 100644 --- a/.github/workflows/github-pages.yml +++ b/.github/workflows/github-pages.yml @@ -27,7 +27,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v5 - name: Setup Ruby uses: ruby/setup-ruby@v1 with: diff --git a/.github/workflows/java-wasm-bindings.yml b/.github/workflows/java-wasm-bindings.yml index b3e427add0..ece0914f2f 100644 --- a/.github/workflows/java-wasm-bindings.yml +++ b/.github/workflows/java-wasm-bindings.yml @@ -15,7 +15,7 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - name: Set up Ruby uses: ruby/setup-ruby@v1 diff --git a/.github/workflows/javascript-bindings.yml b/.github/workflows/javascript-bindings.yml index fc91523a64..6431e5472c 100644 --- a/.github/workflows/javascript-bindings.yml +++ b/.github/workflows/javascript-bindings.yml @@ -15,7 +15,7 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - name: Set up Ruby uses: ruby/setup-ruby@v1 diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7e2378c01b..91277ae018 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -14,7 +14,7 @@ jobs: lint: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - name: Set up Ruby uses: ruby/setup-ruby@v1 with: @@ -28,7 +28,7 @@ jobs: env: BUNDLE_GEMFILE: gemfiles/2.7/Gemfile steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - name: Set up Ruby uses: ruby/setup-ruby@v1 with: @@ -44,7 +44,7 @@ jobs: env: BUNDLE_GEMFILE: gemfiles/typecheck/Gemfile steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - name: Set up Ruby uses: ruby/setup-ruby@v1 with: @@ -68,7 +68,7 @@ jobs: # - windows-latest <-- failing with fiddle error, temporarily disabled runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - name: Set up Ruby uses: ruby/setup-ruby@v1 with: @@ -88,7 +88,7 @@ jobs: - ubuntu-24.04-s390x runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v4 # v5 fails on these platforms - name: Set up Ruby run: | sudo apt-get update @@ -112,7 +112,7 @@ jobs: PRISM_FFI_BACKEND: "true" BUNDLE_GEMFILE: gemfiles/${{ matrix.target.gemfile }}/Gemfile steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - name: Set up Ruby uses: ruby/setup-ruby@v1 with: @@ -128,7 +128,7 @@ jobs: os: [ubuntu-22.04, ubuntu-24.04] runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - name: Set up Ruby uses: ruby/setup-ruby@v1 with: @@ -148,7 +148,7 @@ jobs: # - windows-latest <-- failing with fiddle error, temporarily disabled runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - name: Set up Ruby uses: ruby/setup-ruby@v1 with: @@ -162,7 +162,7 @@ jobs: build-minimal: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - name: Set up Ruby uses: ruby/setup-ruby@v1 with: @@ -178,7 +178,7 @@ jobs: env: JRUBY_OPTS: "--dev" steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - name: Set up JRuby uses: ruby/setup-ruby@v1 with: @@ -190,7 +190,7 @@ jobs: lex-ruby: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - name: Set up Ruby uses: ruby/setup-ruby@v1 with: @@ -202,7 +202,7 @@ jobs: lex-discourse: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - name: Set up Ruby uses: ruby/setup-ruby@v1 with: @@ -214,7 +214,7 @@ jobs: lex-top-100: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - name: Set up Ruby uses: ruby/setup-ruby@v1 with: @@ -234,7 +234,7 @@ jobs: memcheck: runs-on: ubuntu-24.04 steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - name: Install valgrind run: | sudo apt-get update @@ -250,7 +250,7 @@ jobs: gem-package: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - uses: ruby/setup-ruby@v1 with: ruby-version: head @@ -301,7 +301,7 @@ jobs: BUNDLE_GEMFILE: gemfiles/${{ matrix.target.gemfile }}/Gemfile runs-on: ${{ matrix.target.os }} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - uses: ruby/setup-ruby@v1 with: ruby-version: ${{ matrix.target.ruby }} @@ -323,7 +323,7 @@ jobs: gcc-analyzer: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - name: Set up Ruby uses: ruby/setup-ruby@v1 with: @@ -336,7 +336,7 @@ jobs: clang-analyzer: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - name: Set up Ruby uses: ruby/setup-ruby@v1 with: diff --git a/.github/workflows/rust-bindings.yml b/.github/workflows/rust-bindings.yml index f2b9d45431..111fd0773e 100644 --- a/.github/workflows/rust-bindings.yml +++ b/.github/workflows/rust-bindings.yml @@ -24,7 +24,7 @@ jobs: os: [ubuntu-latest, macos-latest, windows-latest] runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - name: Set up Ruby uses: ruby/setup-ruby@v1 with: @@ -58,7 +58,7 @@ jobs: fail-fast: false runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - name: Set up Ruby uses: ruby/setup-ruby@v1 with: @@ -92,7 +92,7 @@ jobs: matrix: sanitizer: [address] steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - name: Set up Ruby uses: ruby/setup-ruby@v1 with: From ce3f0456f770771e7a05d8cfe9263e4110003a03 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Thu, 14 Aug 2025 17:40:58 -0400 Subject: [PATCH 100/333] Upgrade download-artifact action --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 91277ae018..2d580abb46 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -305,7 +305,7 @@ jobs: - uses: ruby/setup-ruby@v1 with: ruby-version: ${{ matrix.target.ruby }} - - uses: actions/download-artifact@v4 + - uses: actions/download-artifact@v5 with: name: gem-package path: pkg From db1427700a0ca657d6f8b91fe812074455563637 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 18 Aug 2025 22:19:54 +0000 Subject: [PATCH 101/333] Bump sorbet Bumps the ruby-deps group with 1 update in the /gemfiles/typecheck directory: [sorbet](https://github.com/sorbet/sorbet). Updates `sorbet` from 0.5.12383 to 0.5.12414 - [Release notes](https://github.com/sorbet/sorbet/releases) - [Commits](https://github.com/sorbet/sorbet/commits) --- updated-dependencies: - dependency-name: sorbet dependency-version: 0.5.12414 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps ... Signed-off-by: dependabot[bot] --- gemfiles/typecheck/Gemfile.lock | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/gemfiles/typecheck/Gemfile.lock b/gemfiles/typecheck/Gemfile.lock index 9d0353f620..4fcbf99e93 100644 --- a/gemfiles/typecheck/Gemfile.lock +++ b/gemfiles/typecheck/Gemfile.lock @@ -62,14 +62,14 @@ GEM sexp_processor (~> 4.16) securerandom (0.4.1) sexp_processor (4.17.3) - sorbet (0.5.12383) - sorbet-static (= 0.5.12383) - sorbet-runtime (0.5.12383) - sorbet-static (0.5.12383-universal-darwin) - sorbet-static (0.5.12383-x86_64-linux) - sorbet-static-and-runtime (0.5.12383) - sorbet (= 0.5.12383) - sorbet-runtime (= 0.5.12383) + sorbet (0.5.12414) + sorbet-static (= 0.5.12414) + sorbet-runtime (0.5.12414) + sorbet-static (0.5.12414-universal-darwin) + sorbet-static (0.5.12414-x86_64-linux) + sorbet-static-and-runtime (0.5.12414) + sorbet (= 0.5.12414) + sorbet-runtime (= 0.5.12414) spoom (1.6.1) erubi (>= 1.10.0) prism (>= 0.28.0) From 851665165fe274aa79d2686175d787cccc7dc943 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Wed, 27 Aug 2025 14:49:01 -0400 Subject: [PATCH 102/333] Fix up type_ in rust bindings --- rust/ruby-prism/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rust/ruby-prism/src/lib.rs b/rust/ruby-prism/src/lib.rs index 0ae81172b1..7d7eab69a0 100644 --- a/rust/ruby-prism/src/lib.rs +++ b/rust/ruby-prism/src/lib.rs @@ -372,7 +372,7 @@ impl<'pr> Comment<'pr> { /// Returns the type of the comment. pub fn type_(&self) -> CommentType { - let type_ = unsafe { self.comment.as_ref().type_ }; + let type_ = unsafe { self.content.as_ref().type_ }; if type_ == pm_comment_type_t::PM_COMMENT_EMBDOC { CommentType::EmbDocComment } else { From f6052355cf45bfd1188806b663d2f7aa52c693d1 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Wed, 27 Aug 2025 14:55:48 -0400 Subject: [PATCH 103/333] Fix up cargo lint --- rust/ruby-prism/src/lib.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/rust/ruby-prism/src/lib.rs b/rust/ruby-prism/src/lib.rs index 7d7eab69a0..b46121f602 100644 --- a/rust/ruby-prism/src/lib.rs +++ b/rust/ruby-prism/src/lib.rs @@ -354,9 +354,9 @@ pub struct Comment<'pr> { /// The type of the comment #[derive(Debug, Clone, Copy, PartialEq, Eq)] pub enum CommentType { - /// InlineComment corresponds to comments that start with #. + /// `InlineComment` corresponds to comments that start with #. InlineComment, - /// EmbDocComment corresponds to comments that are surrounded by =begin and =end. + /// `EmbDocComment` corresponds to comments that are surrounded by =begin and =end. EmbDocComment, } @@ -371,6 +371,7 @@ impl<'pr> Comment<'pr> { } /// Returns the type of the comment. + #[must_use] pub fn type_(&self) -> CommentType { let type_ = unsafe { self.content.as_ref().type_ }; if type_ == pm_comment_type_t::PM_COMMENT_EMBDOC { From 64365b086b1f803a5930280b3f1397fabcd821c7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 27 Aug 2025 18:57:09 +0000 Subject: [PATCH 104/333] Bump sorbet Bumps the ruby-deps group with 1 update in the /gemfiles/typecheck directory: [sorbet](https://github.com/sorbet/sorbet). Updates `sorbet` from 0.5.12414 to 0.5.12435 - [Release notes](https://github.com/sorbet/sorbet/releases) - [Commits](https://github.com/sorbet/sorbet/commits) --- updated-dependencies: - dependency-name: sorbet dependency-version: 0.5.12435 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps ... Signed-off-by: dependabot[bot] --- gemfiles/typecheck/Gemfile.lock | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/gemfiles/typecheck/Gemfile.lock b/gemfiles/typecheck/Gemfile.lock index 4fcbf99e93..9c85096dcd 100644 --- a/gemfiles/typecheck/Gemfile.lock +++ b/gemfiles/typecheck/Gemfile.lock @@ -62,14 +62,14 @@ GEM sexp_processor (~> 4.16) securerandom (0.4.1) sexp_processor (4.17.3) - sorbet (0.5.12414) - sorbet-static (= 0.5.12414) - sorbet-runtime (0.5.12414) - sorbet-static (0.5.12414-universal-darwin) - sorbet-static (0.5.12414-x86_64-linux) - sorbet-static-and-runtime (0.5.12414) - sorbet (= 0.5.12414) - sorbet-runtime (= 0.5.12414) + sorbet (0.6.12449) + sorbet-static (= 0.6.12449) + sorbet-runtime (0.6.12449) + sorbet-static (0.6.12449-universal-darwin) + sorbet-static (0.6.12449-x86_64-linux) + sorbet-static-and-runtime (0.6.12449) + sorbet (= 0.6.12449) + sorbet-runtime (= 0.6.12449) spoom (1.6.1) erubi (>= 1.10.0) prism (>= 0.28.0) From 40ba771264df66c390feb4bbdbc53d0ff91f76b3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 27 Aug 2025 18:57:32 +0000 Subject: [PATCH 105/333] Bump the action-deps group with 3 updates Bumps the action-deps group with 3 updates: [actions/checkout](https://github.com/actions/checkout), [actions/upload-pages-artifact](https://github.com/actions/upload-pages-artifact) and [actions/setup-java](https://github.com/actions/setup-java). Updates `actions/checkout` from 4 to 5 - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v4...v5) Updates `actions/upload-pages-artifact` from 3 to 4 - [Release notes](https://github.com/actions/upload-pages-artifact/releases) - [Commits](https://github.com/actions/upload-pages-artifact/compare/v3...v4) Updates `actions/setup-java` from 4 to 5 - [Release notes](https://github.com/actions/setup-java/releases) - [Commits](https://github.com/actions/setup-java/compare/v4...v5) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: '5' dependency-type: direct:production update-type: version-update:semver-major dependency-group: action-deps - dependency-name: actions/upload-pages-artifact dependency-version: '4' dependency-type: direct:production update-type: version-update:semver-major dependency-group: action-deps - dependency-name: actions/setup-java dependency-version: '5' dependency-type: direct:production update-type: version-update:semver-major dependency-group: action-deps ... Signed-off-by: dependabot[bot] --- .github/workflows/github-pages.yml | 2 +- .github/workflows/java-wasm-bindings.yml | 2 +- .github/workflows/main.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/github-pages.yml b/.github/workflows/github-pages.yml index 179b7ed867..59dea2ce15 100644 --- a/.github/workflows/github-pages.yml +++ b/.github/workflows/github-pages.yml @@ -59,7 +59,7 @@ jobs: cargo doc --no-deps --target-dir ../doc/rust working-directory: rust - name: Upload artifact - uses: actions/upload-pages-artifact@v3 + uses: actions/upload-pages-artifact@v4 with: path: doc diff --git a/.github/workflows/java-wasm-bindings.yml b/.github/workflows/java-wasm-bindings.yml index ece0914f2f..4b863702eb 100644 --- a/.github/workflows/java-wasm-bindings.yml +++ b/.github/workflows/java-wasm-bindings.yml @@ -35,7 +35,7 @@ jobs: run: make java-wasm WASI_SDK_PATH=$(pwd)/wasi-sdk-25.0-x86_64-linux - name: Set up Java - uses: actions/setup-java@v4 + uses: actions/setup-java@v5 with: distribution: 'temurin' java-version: '17' diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2d580abb46..26511d00ea 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -88,7 +88,7 @@ jobs: - ubuntu-24.04-s390x runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v4 # v5 fails on these platforms + - uses: actions/checkout@v5 # v5 fails on these platforms - name: Set up Ruby run: | sudo apt-get update From dfd6941db7e69fb949ced46045a515c9c8d0588b Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Wed, 27 Aug 2025 20:08:39 -0400 Subject: [PATCH 106/333] actions/checkout no longer fails on ibm --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 26511d00ea..61624dee13 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -88,7 +88,7 @@ jobs: - ubuntu-24.04-s390x runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v5 # v5 fails on these platforms + - uses: actions/checkout@v5 - name: Set up Ruby run: | sudo apt-get update From f4af2a66631f576856824f4621326c04ce902e8d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 2 Sep 2025 05:46:48 +0000 Subject: [PATCH 107/333] Bump sorbet Bumps the ruby-deps group with 1 update in the /gemfiles/typecheck directory: [sorbet](https://github.com/sorbet/sorbet). Updates `sorbet` from 0.6.12449 to 0.6.12473 - [Release notes](https://github.com/sorbet/sorbet/releases) - [Commits](https://github.com/sorbet/sorbet/commits) --- updated-dependencies: - dependency-name: sorbet dependency-version: 0.6.12473 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps ... Signed-off-by: dependabot[bot] --- gemfiles/typecheck/Gemfile.lock | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/gemfiles/typecheck/Gemfile.lock b/gemfiles/typecheck/Gemfile.lock index 9c85096dcd..80d3f5dc2f 100644 --- a/gemfiles/typecheck/Gemfile.lock +++ b/gemfiles/typecheck/Gemfile.lock @@ -62,14 +62,14 @@ GEM sexp_processor (~> 4.16) securerandom (0.4.1) sexp_processor (4.17.3) - sorbet (0.6.12449) - sorbet-static (= 0.6.12449) - sorbet-runtime (0.6.12449) - sorbet-static (0.6.12449-universal-darwin) - sorbet-static (0.6.12449-x86_64-linux) - sorbet-static-and-runtime (0.6.12449) - sorbet (= 0.6.12449) - sorbet-runtime (= 0.6.12449) + sorbet (0.6.12473) + sorbet-static (= 0.6.12473) + sorbet-runtime (0.6.12473) + sorbet-static (0.6.12473-universal-darwin) + sorbet-static (0.6.12473-x86_64-linux) + sorbet-static-and-runtime (0.6.12473) + sorbet (= 0.6.12473) + sorbet-runtime (= 0.6.12473) spoom (1.6.1) erubi (>= 1.10.0) prism (>= 0.28.0) From 3c22e6fc3999ea2cfcd85b56404dacef2010e79d Mon Sep 17 00:00:00 2001 From: Yusuke Endoh Date: Mon, 8 Sep 2025 12:14:22 +0900 Subject: [PATCH 108/333] Use pm_arguments_end for function call MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Previously, the location of CallNode was incorrect when it accepts a block parameter: ``` $ ruby -rprism -e 'pp Prism.parse("foo(&blk)").value.statements.body[0]'] @ CallNode (location: (1,0)-(1,8)) # <=== It should be (1,0)-(1,9) ├── flags: ∅ ├── receiver: ∅ ├── call_operator_loc: ∅ ├── name: :foo ├── message_loc: (1,0)-(1,3) = "foo" ├── opening_loc: (1,3)-(1,4) = "(" ├── arguments: ∅ ├── closing_loc: (1,8)-(1,9) = ")" *snip* $ ruby -rprism -e 'pp Prism.parse("foo(&blk)").value.statements.body[0].slice' "foo(&blk" ``` Note that the slice lacks the closing parenthesis. --- snapshots/method_calls.txt | 6 +++--- snapshots/seattlerb/call_block_arg_named.txt | 6 +++--- snapshots/unparser/corpus/literal/send.txt | 6 +++--- snapshots/unparser/corpus/literal/since/31.txt | 8 ++++---- snapshots/whitequark/anonymous_blockarg.txt | 4 ++-- snapshots/whitequark/args_args_assocs.txt | 6 +++--- snapshots/whitequark/args_args_star.txt | 6 +++--- snapshots/whitequark/args_block_pass.txt | 6 +++--- snapshots/whitequark/args_star.txt | 6 +++--- src/prism.c | 14 ++++---------- 10 files changed, 31 insertions(+), 37 deletions(-) diff --git a/snapshots/method_calls.txt b/snapshots/method_calls.txt index f1d21b2762..e924613a82 100644 --- a/snapshots/method_calls.txt +++ b/snapshots/method_calls.txt @@ -278,7 +278,7 @@ │ ├── arguments: ∅ │ ├── closing_loc: ∅ │ └── block: ∅ - ├── @ CallNode (location: (25,0)-(25,8)) + ├── @ CallNode (location: (25,0)-(25,9)) │ ├── flags: newline, ignore_visibility │ ├── receiver: ∅ │ ├── call_operator_loc: ∅ @@ -781,7 +781,7 @@ │ │ └── block: ∅ │ ├── closing_loc: (58,9)-(58,10) = ")" │ └── block: ∅ - ├── @ CallNode (location: (60,0)-(60,39)) + ├── @ CallNode (location: (60,0)-(60,40)) │ ├── flags: newline, ignore_visibility │ ├── receiver: ∅ │ ├── call_operator_loc: ∅ @@ -1156,7 +1156,7 @@ │ │ └── operator_loc: ∅ │ ├── closing_loc: (70,40)-(70,41) = ")" │ └── block: ∅ - ├── @ CallNode (location: (72,0)-(72,35)) + ├── @ CallNode (location: (72,0)-(72,36)) │ ├── flags: newline, ignore_visibility │ ├── receiver: ∅ │ ├── call_operator_loc: ∅ diff --git a/snapshots/seattlerb/call_block_arg_named.txt b/snapshots/seattlerb/call_block_arg_named.txt index db6fc7a059..b74a1f69a9 100644 --- a/snapshots/seattlerb/call_block_arg_named.txt +++ b/snapshots/seattlerb/call_block_arg_named.txt @@ -1,11 +1,11 @@ -@ ProgramNode (location: (1,0)-(1,6)) +@ ProgramNode (location: (1,0)-(1,7)) ├── flags: ∅ ├── locals: [] └── statements: - @ StatementsNode (location: (1,0)-(1,6)) + @ StatementsNode (location: (1,0)-(1,7)) ├── flags: ∅ └── body: (length: 1) - └── @ CallNode (location: (1,0)-(1,6)) + └── @ CallNode (location: (1,0)-(1,7)) ├── flags: newline, ignore_visibility ├── receiver: ∅ ├── call_operator_loc: ∅ diff --git a/snapshots/unparser/corpus/literal/send.txt b/snapshots/unparser/corpus/literal/send.txt index de5c6e9f46..a0dd09f7d5 100644 --- a/snapshots/unparser/corpus/literal/send.txt +++ b/snapshots/unparser/corpus/literal/send.txt @@ -813,7 +813,7 @@ │ │ └── unescaped: "bar" │ ├── closing_loc: ∅ │ └── block: ∅ - ├── @ CallNode (location: (50,0)-(50,17)) + ├── @ CallNode (location: (50,0)-(50,18)) │ ├── flags: newline, ignore_visibility │ ├── receiver: ∅ │ ├── call_operator_loc: ∅ @@ -860,7 +860,7 @@ │ │ ├── opening_loc: (50,5)-(50,6) = "(" │ │ └── closing_loc: (50,16)-(50,17) = ")" │ └── operator_loc: (50,4)-(50,5) = "&" - ├── @ CallNode (location: (51,0)-(51,10)) + ├── @ CallNode (location: (51,0)-(51,11)) │ ├── flags: newline, ignore_visibility │ ├── receiver: ∅ │ ├── call_operator_loc: ∅ @@ -884,7 +884,7 @@ │ │ ├── closing_loc: ∅ │ │ └── block: ∅ │ └── operator_loc: (51,4)-(51,5) = "&" - ├── @ CallNode (location: (52,0)-(52,17)) + ├── @ CallNode (location: (52,0)-(52,18)) │ ├── flags: newline, ignore_visibility │ ├── receiver: ∅ │ ├── call_operator_loc: ∅ diff --git a/snapshots/unparser/corpus/literal/since/31.txt b/snapshots/unparser/corpus/literal/since/31.txt index 81bcd9662b..7890475124 100644 --- a/snapshots/unparser/corpus/literal/since/31.txt +++ b/snapshots/unparser/corpus/literal/since/31.txt @@ -26,10 +26,10 @@ │ │ ├── name_loc: ∅ │ │ └── operator_loc: (1,8)-(1,9) = "&" │ ├── body: - │ │ @ StatementsNode (location: (2,2)-(2,7)) + │ │ @ StatementsNode (location: (2,2)-(2,8)) │ │ ├── flags: ∅ │ │ └── body: (length: 1) - │ │ └── @ CallNode (location: (2,2)-(2,7)) + │ │ └── @ CallNode (location: (2,2)-(2,8)) │ │ ├── flags: newline, ignore_visibility │ │ ├── receiver: ∅ │ │ ├── call_operator_loc: ∅ @@ -74,10 +74,10 @@ │ ├── name_loc: ∅ │ └── operator_loc: (5,11)-(5,12) = "&" ├── body: - │ @ StatementsNode (location: (6,2)-(6,7)) + │ @ StatementsNode (location: (6,2)-(6,8)) │ ├── flags: ∅ │ └── body: (length: 1) - │ └── @ CallNode (location: (6,2)-(6,7)) + │ └── @ CallNode (location: (6,2)-(6,8)) │ ├── flags: newline, ignore_visibility │ ├── receiver: ∅ │ ├── call_operator_loc: ∅ diff --git a/snapshots/whitequark/anonymous_blockarg.txt b/snapshots/whitequark/anonymous_blockarg.txt index 7ae9500bb7..af4654ab82 100644 --- a/snapshots/whitequark/anonymous_blockarg.txt +++ b/snapshots/whitequark/anonymous_blockarg.txt @@ -26,10 +26,10 @@ │ ├── name_loc: ∅ │ └── operator_loc: (1,8)-(1,9) = "&" ├── body: - │ @ StatementsNode (location: (1,12)-(1,17)) + │ @ StatementsNode (location: (1,12)-(1,18)) │ ├── flags: ∅ │ └── body: (length: 1) - │ └── @ CallNode (location: (1,12)-(1,17)) + │ └── @ CallNode (location: (1,12)-(1,18)) │ ├── flags: newline, ignore_visibility │ ├── receiver: ∅ │ ├── call_operator_loc: ∅ diff --git a/snapshots/whitequark/args_args_assocs.txt b/snapshots/whitequark/args_args_assocs.txt index bc9615273e..67b53cc514 100644 --- a/snapshots/whitequark/args_args_assocs.txt +++ b/snapshots/whitequark/args_args_assocs.txt @@ -1,8 +1,8 @@ -@ ProgramNode (location: (1,0)-(3,24)) +@ ProgramNode (location: (1,0)-(3,25)) ├── flags: ∅ ├── locals: [] └── statements: - @ StatementsNode (location: (1,0)-(3,24)) + @ StatementsNode (location: (1,0)-(3,25)) ├── flags: ∅ └── body: (length: 2) ├── @ CallNode (location: (1,0)-(1,19)) @@ -45,7 +45,7 @@ │ │ └── operator_loc: (1,14)-(1,16) = "=>" │ ├── closing_loc: (1,18)-(1,19) = ")" │ └── block: ∅ - └── @ CallNode (location: (3,0)-(3,24)) + └── @ CallNode (location: (3,0)-(3,25)) ├── flags: newline, ignore_visibility ├── receiver: ∅ ├── call_operator_loc: ∅ diff --git a/snapshots/whitequark/args_args_star.txt b/snapshots/whitequark/args_args_star.txt index 32f8b6bafb..ffa19daba9 100644 --- a/snapshots/whitequark/args_args_star.txt +++ b/snapshots/whitequark/args_args_star.txt @@ -1,8 +1,8 @@ -@ ProgramNode (location: (1,0)-(3,19)) +@ ProgramNode (location: (1,0)-(3,20)) ├── flags: ∅ ├── locals: [] └── statements: - @ StatementsNode (location: (1,0)-(3,19)) + @ StatementsNode (location: (1,0)-(3,20)) ├── flags: ∅ └── body: (length: 2) ├── @ CallNode (location: (1,0)-(1,14)) @@ -42,7 +42,7 @@ │ │ └── block: ∅ │ ├── closing_loc: (1,13)-(1,14) = ")" │ └── block: ∅ - └── @ CallNode (location: (3,0)-(3,19)) + └── @ CallNode (location: (3,0)-(3,20)) ├── flags: newline, ignore_visibility ├── receiver: ∅ ├── call_operator_loc: ∅ diff --git a/snapshots/whitequark/args_block_pass.txt b/snapshots/whitequark/args_block_pass.txt index 495d8efd4f..22460638ce 100644 --- a/snapshots/whitequark/args_block_pass.txt +++ b/snapshots/whitequark/args_block_pass.txt @@ -1,11 +1,11 @@ -@ ProgramNode (location: (1,0)-(1,8)) +@ ProgramNode (location: (1,0)-(1,9)) ├── flags: ∅ ├── locals: [] └── statements: - @ StatementsNode (location: (1,0)-(1,8)) + @ StatementsNode (location: (1,0)-(1,9)) ├── flags: ∅ └── body: (length: 1) - └── @ CallNode (location: (1,0)-(1,8)) + └── @ CallNode (location: (1,0)-(1,9)) ├── flags: newline, ignore_visibility ├── receiver: ∅ ├── call_operator_loc: ∅ diff --git a/snapshots/whitequark/args_star.txt b/snapshots/whitequark/args_star.txt index 488b113dff..d28e53af19 100644 --- a/snapshots/whitequark/args_star.txt +++ b/snapshots/whitequark/args_star.txt @@ -1,8 +1,8 @@ -@ ProgramNode (location: (1,0)-(3,14)) +@ ProgramNode (location: (1,0)-(3,15)) ├── flags: ∅ ├── locals: [] └── statements: - @ StatementsNode (location: (1,0)-(3,14)) + @ StatementsNode (location: (1,0)-(3,15)) ├── flags: ∅ └── body: (length: 2) ├── @ CallNode (location: (1,0)-(1,9)) @@ -32,7 +32,7 @@ │ │ └── block: ∅ │ ├── closing_loc: (1,8)-(1,9) = ")" │ └── block: ∅ - └── @ CallNode (location: (3,0)-(3,14)) + └── @ CallNode (location: (3,0)-(3,15)) ├── flags: newline, ignore_visibility ├── receiver: ∅ ├── call_operator_loc: ∅ diff --git a/src/prism.c b/src/prism.c index afd767b84c..b7e2bdc1de 100644 --- a/src/prism.c +++ b/src/prism.c @@ -18570,17 +18570,11 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b call->closing_loc = arguments.closing_loc; call->block = arguments.block; - if (arguments.block != NULL) { - call->base.location.end = arguments.block->location.end; - } else if (arguments.closing_loc.start == NULL) { - if (arguments.arguments != NULL) { - call->base.location.end = arguments.arguments->base.location.end; - } else { - call->base.location.end = call->message_loc.end; - } - } else { - call->base.location.end = arguments.closing_loc.end; + const uint8_t *end = pm_arguments_end(&arguments); + if (!end) { + end = call->message_loc.end; } + call->base.location.end = end; } } else { // Otherwise, we know the identifier is in the local table. This From 450da4a02e6bd46545e2acdf6d3ac5f1d0148fd9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 8 Sep 2025 16:19:38 +0000 Subject: [PATCH 109/333] Bump the ruby-deps group across 6 directories with 2 updates Bumps the ruby-deps group with 1 update in the /gemfiles/3.1 directory: [rbs](https://github.com/ruby/rbs). Bumps the ruby-deps group with 1 update in the /gemfiles/3.2 directory: [rbs](https://github.com/ruby/rbs). Bumps the ruby-deps group with 1 update in the /gemfiles/3.3 directory: [rbs](https://github.com/ruby/rbs). Bumps the ruby-deps group with 1 update in the /gemfiles/3.4 directory: [rbs](https://github.com/ruby/rbs). Bumps the ruby-deps group with 1 update in the /gemfiles/3.5 directory: [rbs](https://github.com/ruby/rbs). Bumps the ruby-deps group with 2 updates in the /gemfiles/typecheck directory: [rbs](https://github.com/ruby/rbs) and [sorbet](https://github.com/sorbet/sorbet). Updates `rbs` from 3.9.4 to 3.9.5 - [Release notes](https://github.com/ruby/rbs/releases) - [Changelog](https://github.com/ruby/rbs/blob/master/CHANGELOG.md) - [Commits](https://github.com/ruby/rbs/compare/v3.9.4...v3.9.5) Updates `rbs` from 3.9.4 to 3.9.5 - [Release notes](https://github.com/ruby/rbs/releases) - [Changelog](https://github.com/ruby/rbs/blob/master/CHANGELOG.md) - [Commits](https://github.com/ruby/rbs/compare/v3.9.4...v3.9.5) Updates `rbs` from 3.9.4 to 3.9.5 - [Release notes](https://github.com/ruby/rbs/releases) - [Changelog](https://github.com/ruby/rbs/blob/master/CHANGELOG.md) - [Commits](https://github.com/ruby/rbs/compare/v3.9.4...v3.9.5) Updates `rbs` from 3.9.4 to 3.9.5 - [Release notes](https://github.com/ruby/rbs/releases) - [Changelog](https://github.com/ruby/rbs/blob/master/CHANGELOG.md) - [Commits](https://github.com/ruby/rbs/compare/v3.9.4...v3.9.5) Updates `rbs` from 3.9.4 to 3.9.5 - [Release notes](https://github.com/ruby/rbs/releases) - [Changelog](https://github.com/ruby/rbs/blob/master/CHANGELOG.md) - [Commits](https://github.com/ruby/rbs/compare/v3.9.4...v3.9.5) Updates `rbs` from 3.9.4 to 3.9.5 - [Release notes](https://github.com/ruby/rbs/releases) - [Changelog](https://github.com/ruby/rbs/blob/master/CHANGELOG.md) - [Commits](https://github.com/ruby/rbs/compare/v3.9.4...v3.9.5) Updates `sorbet` from 0.6.12473 to 0.6.12495 - [Release notes](https://github.com/sorbet/sorbet/releases) - [Commits](https://github.com/sorbet/sorbet/commits) --- updated-dependencies: - dependency-name: rbs dependency-version: 3.9.5 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps - dependency-name: rbs dependency-version: 3.9.5 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps - dependency-name: rbs dependency-version: 3.9.5 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps - dependency-name: rbs dependency-version: 3.9.5 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps - dependency-name: rbs dependency-version: 3.9.5 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps - dependency-name: rbs dependency-version: 3.9.5 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps - dependency-name: sorbet dependency-version: 0.6.12495 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps ... Signed-off-by: dependabot[bot] --- 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/3.5/Gemfile.lock | 2 +- gemfiles/typecheck/Gemfile.lock | 18 +++++++++--------- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/gemfiles/3.1/Gemfile.lock b/gemfiles/3.1/Gemfile.lock index 478fb15e93..cfac077d43 100644 --- a/gemfiles/3.1/Gemfile.lock +++ b/gemfiles/3.1/Gemfile.lock @@ -21,7 +21,7 @@ GEM rake (13.3.0) rake-compiler (1.3.0) rake - rbs (3.9.4) + rbs (3.9.5) logger ruby_memcheck (3.0.1) nokogiri diff --git a/gemfiles/3.2/Gemfile.lock b/gemfiles/3.2/Gemfile.lock index dd992a90bb..7426a7f177 100644 --- a/gemfiles/3.2/Gemfile.lock +++ b/gemfiles/3.2/Gemfile.lock @@ -21,7 +21,7 @@ GEM rake (13.3.0) rake-compiler (1.3.0) rake - rbs (3.9.4) + rbs (3.9.5) logger ruby_memcheck (3.0.1) nokogiri diff --git a/gemfiles/3.3/Gemfile.lock b/gemfiles/3.3/Gemfile.lock index 15c6d93ec8..2bff716955 100644 --- a/gemfiles/3.3/Gemfile.lock +++ b/gemfiles/3.3/Gemfile.lock @@ -21,7 +21,7 @@ GEM rake (13.3.0) rake-compiler (1.3.0) rake - rbs (3.9.4) + rbs (3.9.5) logger ruby_memcheck (3.0.1) nokogiri diff --git a/gemfiles/3.4/Gemfile.lock b/gemfiles/3.4/Gemfile.lock index 19d441d8d7..d44f56683c 100644 --- a/gemfiles/3.4/Gemfile.lock +++ b/gemfiles/3.4/Gemfile.lock @@ -21,7 +21,7 @@ GEM rake (13.3.0) rake-compiler (1.3.0) rake - rbs (3.9.4) + rbs (3.9.5) logger ruby_memcheck (3.0.1) nokogiri diff --git a/gemfiles/3.5/Gemfile.lock b/gemfiles/3.5/Gemfile.lock index 939a4d8152..5a4fd4e651 100644 --- a/gemfiles/3.5/Gemfile.lock +++ b/gemfiles/3.5/Gemfile.lock @@ -22,7 +22,7 @@ GEM rake (13.3.0) rake-compiler (1.3.0) rake - rbs (3.9.4) + rbs (3.9.5) logger ruby_memcheck (3.0.1) nokogiri diff --git a/gemfiles/typecheck/Gemfile.lock b/gemfiles/typecheck/Gemfile.lock index 80d3f5dc2f..7431e32936 100644 --- a/gemfiles/typecheck/Gemfile.lock +++ b/gemfiles/typecheck/Gemfile.lock @@ -55,21 +55,21 @@ GEM prism (~> 1.0) rbs (>= 3.4.4) sorbet-runtime (>= 0.5.9204) - rbs (3.9.4) + rbs (3.9.5) logger ruby_parser (3.21.1) racc (~> 1.5) sexp_processor (~> 4.16) securerandom (0.4.1) sexp_processor (4.17.3) - sorbet (0.6.12473) - sorbet-static (= 0.6.12473) - sorbet-runtime (0.6.12473) - sorbet-static (0.6.12473-universal-darwin) - sorbet-static (0.6.12473-x86_64-linux) - sorbet-static-and-runtime (0.6.12473) - sorbet (= 0.6.12473) - sorbet-runtime (= 0.6.12473) + sorbet (0.6.12495) + sorbet-static (= 0.6.12495) + sorbet-runtime (0.6.12495) + sorbet-static (0.6.12495-universal-darwin) + sorbet-static (0.6.12495-x86_64-linux) + sorbet-static-and-runtime (0.6.12495) + sorbet (= 0.6.12495) + sorbet-runtime (= 0.6.12495) spoom (1.6.1) erubi (>= 1.10.0) prism (>= 0.28.0) From 17e4a22f3a0b02a193344eb0e1f036a665444b5d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 8 Sep 2025 16:21:57 +0000 Subject: [PATCH 110/333] Bump actions/setup-node from 4 to 5 in the action-deps group Bumps the action-deps group with 1 update: [actions/setup-node](https://github.com/actions/setup-node). Updates `actions/setup-node` from 4 to 5 - [Release notes](https://github.com/actions/setup-node/releases) - [Commits](https://github.com/actions/setup-node/compare/v4...v5) --- updated-dependencies: - dependency-name: actions/setup-node dependency-version: '5' dependency-type: direct:production update-type: version-update:semver-major dependency-group: action-deps ... Signed-off-by: dependabot[bot] --- .github/workflows/javascript-bindings.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/javascript-bindings.yml b/.github/workflows/javascript-bindings.yml index 6431e5472c..ee6febd54a 100644 --- a/.github/workflows/javascript-bindings.yml +++ b/.github/workflows/javascript-bindings.yml @@ -39,7 +39,7 @@ jobs: name: prism.wasm path: javascript/src/prism.wasm - - uses: actions/setup-node@v4 + - uses: actions/setup-node@v5 with: node-version: 20.x From 939debb3e801ce93fe2649ce37010f58ca5d26f7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 11 Sep 2025 14:47:29 +0000 Subject: [PATCH 111/333] Bump nokogiri from 1.18.8 to 1.18.9 in /gemfiles/3.5 Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.18.8 to 1.18.9. - [Release notes](https://github.com/sparklemotion/nokogiri/releases) - [Changelog](https://github.com/sparklemotion/nokogiri/blob/main/CHANGELOG.md) - [Commits](https://github.com/sparklemotion/nokogiri/compare/v1.18.8...v1.18.9) --- updated-dependencies: - dependency-name: nokogiri dependency-version: 1.18.9 dependency-type: indirect ... Signed-off-by: dependabot[bot] --- gemfiles/3.5/Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gemfiles/3.5/Gemfile.lock b/gemfiles/3.5/Gemfile.lock index 939a4d8152..e9abc30245 100644 --- a/gemfiles/3.5/Gemfile.lock +++ b/gemfiles/3.5/Gemfile.lock @@ -10,7 +10,7 @@ GEM ffi (1.17.2) logger (1.7.0) mini_portile2 (2.8.9) - nokogiri (1.18.8) + nokogiri (1.18.9) mini_portile2 (~> 2.8.2) racc (~> 1.4) onigmo (0.1.0) From 3a38b192e399a1c5e993906e269fbd9ceb367a00 Mon Sep 17 00:00:00 2001 From: Earlopain <14981592+Earlopain@users.noreply.github.com> Date: Fri, 29 Aug 2025 22:35:51 +0200 Subject: [PATCH 112/333] Reject some cases with `return` and command calls The same also applies to `break`/`next`. https://bugs.ruby-lang.org/issues/21540 --- lib/prism/translation/parser/lexer.rb | 2 +- snapshots/break.txt | 195 ++++++++++++++++++------- snapshots/next.txt | 141 ++++++++++++++---- snapshots/return.txt | 91 +++++++++--- src/prism.c | 6 + test/prism/errors/command_calls_32.txt | 19 +++ test/prism/fixtures/break.txt | 4 + test/prism/fixtures/next.txt | 4 + test/prism/fixtures/return.txt | 3 + 9 files changed, 367 insertions(+), 98 deletions(-) create mode 100644 test/prism/errors/command_calls_32.txt diff --git a/lib/prism/translation/parser/lexer.rb b/lib/prism/translation/parser/lexer.rb index 222df74559..75c48ef667 100644 --- a/lib/prism/translation/parser/lexer.rb +++ b/lib/prism/translation/parser/lexer.rb @@ -203,7 +203,7 @@ class Lexer # The following token types are listed as those classified as `tLPAREN`. LPAREN_CONVERSION_TOKEN_TYPES = Set.new([ :kBREAK, :tCARET, :kCASE, :tDIVIDE, :kFOR, :kIF, :kNEXT, :kRETURN, :kUNTIL, :kWHILE, :tAMPER, :tANDOP, :tBANG, :tCOMMA, :tDOT2, :tDOT3, - :tEQL, :tLPAREN, :tLPAREN2, :tLPAREN_ARG, :tLSHFT, :tNL, :tOP_ASGN, :tOROP, :tPIPE, :tSEMI, :tSTRING_DBEG, :tUMINUS, :tUPLUS + :tEQL, :tLPAREN, :tLPAREN2, :tLPAREN_ARG, :tLSHFT, :tNL, :tOP_ASGN, :tOROP, :tPIPE, :tSEMI, :tSTRING_DBEG, :tUMINUS, :tUPLUS, :tLCURLY ]) # Types of tokens that are allowed to continue a method call with comments in-between. diff --git a/snapshots/break.txt b/snapshots/break.txt index 6e7bc9a2ee..7e5b8da0aa 100644 --- a/snapshots/break.txt +++ b/snapshots/break.txt @@ -1,10 +1,10 @@ -@ ProgramNode (location: (1,0)-(29,21)) +@ ProgramNode (location: (1,0)-(33,21)) ├── flags: ∅ ├── locals: [] └── statements: - @ StatementsNode (location: (1,0)-(29,21)) + @ StatementsNode (location: (1,0)-(33,21)) ├── flags: ∅ - └── body: (length: 13) + └── body: (length: 15) ├── @ CallNode (location: (1,0)-(1,13)) │ ├── flags: newline, ignore_visibility │ ├── receiver: ∅ @@ -343,76 +343,167 @@ │ │ └── keyword_loc: (21,6)-(21,11) = "break" │ ├── opening_loc: (21,4)-(21,5) = "{" │ └── closing_loc: (21,15)-(21,16) = "}" - ├── @ CallNode (location: (23,0)-(23,22)) + ├── @ CallNode (location: (23,0)-(23,17)) + │ ├── flags: newline, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :tap + │ ├── message_loc: (23,0)-(23,3) = "tap" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (23,4)-(23,17)) + │ ├── flags: ∅ + │ ├── locals: [] + │ ├── parameters: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (23,6)-(23,15)) + │ │ ├── flags: ∅ + │ │ └── body: (length: 1) + │ │ └── @ ParenthesesNode (location: (23,6)-(23,15)) + │ │ ├── flags: newline + │ │ ├── body: + │ │ │ @ StatementsNode (location: (23,7)-(23,14)) + │ │ │ ├── flags: ∅ + │ │ │ └── body: (length: 1) + │ │ │ └── @ BreakNode (location: (23,7)-(23,14)) + │ │ │ ├── flags: newline + │ │ │ ├── arguments: + │ │ │ │ @ ArgumentsNode (location: (23,13)-(23,14)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── arguments: (length: 1) + │ │ │ │ └── @ IntegerNode (location: (23,13)-(23,14)) + │ │ │ │ ├── flags: static_literal, decimal + │ │ │ │ └── value: 1 + │ │ │ └── keyword_loc: (23,7)-(23,12) = "break" + │ │ ├── opening_loc: (23,6)-(23,7) = "(" + │ │ └── closing_loc: (23,14)-(23,15) = ")" + │ ├── opening_loc: (23,4)-(23,5) = "{" + │ └── closing_loc: (23,16)-(23,17) = "}" + ├── @ CallNode (location: (25,0)-(25,24)) + │ ├── flags: newline, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :tap + │ ├── message_loc: (25,0)-(25,3) = "tap" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (25,4)-(25,24)) + │ ├── flags: ∅ + │ ├── locals: [] + │ ├── parameters: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (25,6)-(25,22)) + │ │ ├── flags: ∅ + │ │ └── body: (length: 1) + │ │ └── @ AndNode (location: (25,6)-(25,22)) + │ │ ├── flags: newline + │ │ ├── left: + │ │ │ @ CallNode (location: (25,6)-(25,9)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :foo + │ │ │ ├── message_loc: (25,6)-(25,9) = "foo" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── right: + │ │ │ @ ParenthesesNode (location: (25,13)-(25,22)) + │ │ │ ├── flags: ∅ + │ │ │ ├── body: + │ │ │ │ @ StatementsNode (location: (25,14)-(25,21)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ BreakNode (location: (25,14)-(25,21)) + │ │ │ │ ├── flags: newline + │ │ │ │ ├── arguments: + │ │ │ │ │ @ ArgumentsNode (location: (25,20)-(25,21)) + │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ └── arguments: (length: 1) + │ │ │ │ │ └── @ IntegerNode (location: (25,20)-(25,21)) + │ │ │ │ │ ├── flags: static_literal, decimal + │ │ │ │ │ └── value: 1 + │ │ │ │ └── keyword_loc: (25,14)-(25,19) = "break" + │ │ │ ├── opening_loc: (25,13)-(25,14) = "(" + │ │ │ └── closing_loc: (25,21)-(25,22) = ")" + │ │ └── operator_loc: (25,10)-(25,12) = "&&" + │ ├── opening_loc: (25,4)-(25,5) = "{" + │ └── closing_loc: (25,23)-(25,24) = "}" + ├── @ CallNode (location: (27,0)-(27,22)) │ ├── flags: newline │ ├── receiver: - │ │ @ CallNode (location: (23,0)-(23,16)) + │ │ @ CallNode (location: (27,0)-(27,16)) │ │ ├── flags: ignore_visibility │ │ ├── receiver: ∅ │ │ ├── call_operator_loc: ∅ │ │ ├── name: :foo - │ │ ├── message_loc: (23,0)-(23,3) = "foo" + │ │ ├── message_loc: (27,0)-(27,3) = "foo" │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ │ │ └── block: - │ │ @ BlockNode (location: (23,4)-(23,16)) + │ │ @ BlockNode (location: (27,4)-(27,16)) │ │ ├── flags: ∅ │ │ ├── locals: [] │ │ ├── parameters: ∅ │ │ ├── body: - │ │ │ @ StatementsNode (location: (23,6)-(23,14)) + │ │ │ @ StatementsNode (location: (27,6)-(27,14)) │ │ │ ├── flags: ∅ │ │ │ └── body: (length: 1) - │ │ │ └── @ BreakNode (location: (23,6)-(23,14)) + │ │ │ └── @ BreakNode (location: (27,6)-(27,14)) │ │ │ ├── flags: newline │ │ │ ├── arguments: - │ │ │ │ @ ArgumentsNode (location: (23,12)-(23,14)) + │ │ │ │ @ ArgumentsNode (location: (27,12)-(27,14)) │ │ │ │ ├── flags: ∅ │ │ │ │ └── arguments: (length: 1) - │ │ │ │ └── @ IntegerNode (location: (23,12)-(23,14)) + │ │ │ │ └── @ IntegerNode (location: (27,12)-(27,14)) │ │ │ │ ├── flags: static_literal, decimal │ │ │ │ └── value: 42 - │ │ │ └── keyword_loc: (23,6)-(23,11) = "break" - │ │ ├── opening_loc: (23,4)-(23,5) = "{" - │ │ └── closing_loc: (23,15)-(23,16) = "}" + │ │ │ └── keyword_loc: (27,6)-(27,11) = "break" + │ │ ├── opening_loc: (27,4)-(27,5) = "{" + │ │ └── closing_loc: (27,15)-(27,16) = "}" │ ├── call_operator_loc: ∅ │ ├── name: :== - │ ├── message_loc: (23,17)-(23,19) = "==" + │ ├── message_loc: (27,17)-(27,19) = "==" │ ├── opening_loc: ∅ │ ├── arguments: - │ │ @ ArgumentsNode (location: (23,20)-(23,22)) + │ │ @ ArgumentsNode (location: (27,20)-(27,22)) │ │ ├── flags: ∅ │ │ └── arguments: (length: 1) - │ │ └── @ IntegerNode (location: (23,20)-(23,22)) + │ │ └── @ IntegerNode (location: (27,20)-(27,22)) │ │ ├── flags: static_literal, decimal │ │ └── value: 42 │ ├── closing_loc: ∅ │ └── block: ∅ - ├── @ CallNode (location: (25,0)-(25,23)) + ├── @ CallNode (location: (29,0)-(29,23)) │ ├── flags: newline │ ├── receiver: - │ │ @ CallNode (location: (25,0)-(25,17)) + │ │ @ CallNode (location: (29,0)-(29,17)) │ │ ├── flags: ignore_visibility │ │ ├── receiver: ∅ │ │ ├── call_operator_loc: ∅ │ │ ├── name: :foo - │ │ ├── message_loc: (25,0)-(25,3) = "foo" + │ │ ├── message_loc: (29,0)-(29,3) = "foo" │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ │ │ └── block: - │ │ @ BlockNode (location: (25,4)-(25,17)) + │ │ @ BlockNode (location: (29,4)-(29,17)) │ │ ├── flags: ∅ │ │ ├── locals: [:a] │ │ ├── parameters: - │ │ │ @ BlockParametersNode (location: (25,6)-(25,9)) + │ │ │ @ BlockParametersNode (location: (29,6)-(29,9)) │ │ │ ├── flags: ∅ │ │ │ ├── parameters: - │ │ │ │ @ ParametersNode (location: (25,7)-(25,8)) + │ │ │ │ @ ParametersNode (location: (29,7)-(29,8)) │ │ │ │ ├── flags: ∅ │ │ │ │ ├── requireds: (length: 1) - │ │ │ │ │ └── @ RequiredParameterNode (location: (25,7)-(25,8)) + │ │ │ │ │ └── @ RequiredParameterNode (location: (29,7)-(29,8)) │ │ │ │ │ ├── flags: ∅ │ │ │ │ │ └── name: :a │ │ │ │ ├── optionals: (length: 0) @@ -422,80 +513,80 @@ │ │ │ │ ├── keyword_rest: ∅ │ │ │ │ └── block: ∅ │ │ │ ├── locals: (length: 0) - │ │ │ ├── opening_loc: (25,6)-(25,7) = "|" - │ │ │ └── closing_loc: (25,8)-(25,9) = "|" + │ │ │ ├── opening_loc: (29,6)-(29,7) = "|" + │ │ │ └── closing_loc: (29,8)-(29,9) = "|" │ │ ├── body: - │ │ │ @ StatementsNode (location: (25,10)-(25,15)) + │ │ │ @ StatementsNode (location: (29,10)-(29,15)) │ │ │ ├── flags: ∅ │ │ │ └── body: (length: 1) - │ │ │ └── @ BreakNode (location: (25,10)-(25,15)) + │ │ │ └── @ BreakNode (location: (29,10)-(29,15)) │ │ │ ├── flags: newline │ │ │ ├── arguments: ∅ - │ │ │ └── keyword_loc: (25,10)-(25,15) = "break" - │ │ ├── opening_loc: (25,4)-(25,5) = "{" - │ │ └── closing_loc: (25,16)-(25,17) = "}" + │ │ │ └── keyword_loc: (29,10)-(29,15) = "break" + │ │ ├── opening_loc: (29,4)-(29,5) = "{" + │ │ └── closing_loc: (29,16)-(29,17) = "}" │ ├── call_operator_loc: ∅ │ ├── name: :== - │ ├── message_loc: (25,18)-(25,20) = "==" + │ ├── message_loc: (29,18)-(29,20) = "==" │ ├── opening_loc: ∅ │ ├── arguments: - │ │ @ ArgumentsNode (location: (25,21)-(25,23)) + │ │ @ ArgumentsNode (location: (29,21)-(29,23)) │ │ ├── flags: ∅ │ │ └── arguments: (length: 1) - │ │ └── @ IntegerNode (location: (25,21)-(25,23)) + │ │ └── @ IntegerNode (location: (29,21)-(29,23)) │ │ ├── flags: static_literal, decimal │ │ └── value: 42 │ ├── closing_loc: ∅ │ └── block: ∅ - ├── @ WhileNode (location: (27,0)-(27,21)) + ├── @ WhileNode (location: (31,0)-(31,21)) │ ├── flags: newline - │ ├── keyword_loc: (27,0)-(27,5) = "while" + │ ├── keyword_loc: (31,0)-(31,5) = "while" │ ├── do_keyword_loc: ∅ - │ ├── closing_loc: (27,18)-(27,21) = "end" + │ ├── closing_loc: (31,18)-(31,21) = "end" │ ├── predicate: - │ │ @ AndNode (location: (27,6)-(27,16)) + │ │ @ AndNode (location: (31,6)-(31,16)) │ │ ├── flags: ∅ │ │ ├── left: - │ │ │ @ CallNode (location: (27,6)-(27,7)) + │ │ │ @ CallNode (location: (31,6)-(31,7)) │ │ │ ├── flags: variable_call, ignore_visibility │ │ │ ├── receiver: ∅ │ │ │ ├── call_operator_loc: ∅ │ │ │ ├── name: :_ - │ │ │ ├── message_loc: (27,6)-(27,7) = "_" + │ │ │ ├── message_loc: (31,6)-(31,7) = "_" │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ │ │ │ └── block: ∅ │ │ ├── right: - │ │ │ @ BreakNode (location: (27,11)-(27,16)) + │ │ │ @ BreakNode (location: (31,11)-(31,16)) │ │ │ ├── flags: ∅ │ │ │ ├── arguments: ∅ - │ │ │ └── keyword_loc: (27,11)-(27,16) = "break" - │ │ └── operator_loc: (27,8)-(27,10) = "&&" + │ │ │ └── keyword_loc: (31,11)-(31,16) = "break" + │ │ └── operator_loc: (31,8)-(31,10) = "&&" │ └── statements: ∅ - └── @ UntilNode (location: (29,0)-(29,21)) + └── @ UntilNode (location: (33,0)-(33,21)) ├── flags: newline - ├── keyword_loc: (29,0)-(29,5) = "until" + ├── keyword_loc: (33,0)-(33,5) = "until" ├── do_keyword_loc: ∅ - ├── closing_loc: (29,18)-(29,21) = "end" + ├── closing_loc: (33,18)-(33,21) = "end" ├── predicate: - │ @ AndNode (location: (29,6)-(29,16)) + │ @ AndNode (location: (33,6)-(33,16)) │ ├── flags: ∅ │ ├── left: - │ │ @ CallNode (location: (29,6)-(29,7)) + │ │ @ CallNode (location: (33,6)-(33,7)) │ │ ├── flags: variable_call, ignore_visibility │ │ ├── receiver: ∅ │ │ ├── call_operator_loc: ∅ │ │ ├── name: :_ - │ │ ├── message_loc: (29,6)-(29,7) = "_" + │ │ ├── message_loc: (33,6)-(33,7) = "_" │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ │ │ └── block: ∅ │ ├── right: - │ │ @ BreakNode (location: (29,11)-(29,16)) + │ │ @ BreakNode (location: (33,11)-(33,16)) │ │ ├── flags: ∅ │ │ ├── arguments: ∅ - │ │ └── keyword_loc: (29,11)-(29,16) = "break" - │ └── operator_loc: (29,8)-(29,10) = "&&" + │ │ └── keyword_loc: (33,11)-(33,16) = "break" + │ └── operator_loc: (33,8)-(33,10) = "&&" └── statements: ∅ diff --git a/snapshots/next.txt b/snapshots/next.txt index f38323e4e7..bf8447e837 100644 --- a/snapshots/next.txt +++ b/snapshots/next.txt @@ -1,10 +1,10 @@ -@ ProgramNode (location: (1,0)-(24,15)) +@ ProgramNode (location: (1,0)-(28,23)) ├── flags: ∅ ├── locals: [] └── statements: - @ StatementsNode (location: (1,0)-(24,15)) + @ StatementsNode (location: (1,0)-(28,23)) ├── flags: ∅ - └── body: (length: 10) + └── body: (length: 12) ├── @ CallNode (location: (1,0)-(1,12)) │ ├── flags: newline, ignore_visibility │ ├── receiver: ∅ @@ -332,41 +332,132 @@ │ │ └── keyword_loc: (22,6)-(22,10) = "next" │ ├── opening_loc: (22,4)-(22,5) = "{" │ └── closing_loc: (22,13)-(22,14) = "}" - └── @ CallNode (location: (24,0)-(24,15)) + ├── @ CallNode (location: (24,0)-(24,15)) + │ ├── flags: newline, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :tap + │ ├── message_loc: (24,0)-(24,3) = "tap" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (24,4)-(24,15)) + │ ├── flags: ∅ + │ ├── locals: [] + │ ├── parameters: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (24,6)-(24,13)) + │ │ ├── flags: ∅ + │ │ └── body: (length: 1) + │ │ └── @ NextNode (location: (24,6)-(24,13)) + │ │ ├── flags: newline + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (24,10)-(24,13)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ ParenthesesNode (location: (24,10)-(24,13)) + │ │ │ ├── flags: ∅ + │ │ │ ├── body: + │ │ │ │ @ StatementsNode (location: (24,11)-(24,12)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ IntegerNode (location: (24,11)-(24,12)) + │ │ │ │ ├── flags: newline, static_literal, decimal + │ │ │ │ └── value: 1 + │ │ │ ├── opening_loc: (24,10)-(24,11) = "(" + │ │ │ └── closing_loc: (24,12)-(24,13) = ")" + │ │ └── keyword_loc: (24,6)-(24,10) = "next" + │ ├── opening_loc: (24,4)-(24,5) = "{" + │ └── closing_loc: (24,14)-(24,15) = "}" + ├── @ CallNode (location: (26,0)-(26,16)) + │ ├── flags: newline, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :tap + │ ├── message_loc: (26,0)-(26,3) = "tap" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (26,4)-(26,16)) + │ ├── flags: ∅ + │ ├── locals: [] + │ ├── parameters: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (26,6)-(26,14)) + │ │ ├── flags: ∅ + │ │ └── body: (length: 1) + │ │ └── @ ParenthesesNode (location: (26,6)-(26,14)) + │ │ ├── flags: newline + │ │ ├── body: + │ │ │ @ StatementsNode (location: (26,7)-(26,13)) + │ │ │ ├── flags: ∅ + │ │ │ └── body: (length: 1) + │ │ │ └── @ NextNode (location: (26,7)-(26,13)) + │ │ │ ├── flags: newline + │ │ │ ├── arguments: + │ │ │ │ @ ArgumentsNode (location: (26,12)-(26,13)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── arguments: (length: 1) + │ │ │ │ └── @ IntegerNode (location: (26,12)-(26,13)) + │ │ │ │ ├── flags: static_literal, decimal + │ │ │ │ └── value: 1 + │ │ │ └── keyword_loc: (26,7)-(26,11) = "next" + │ │ ├── opening_loc: (26,6)-(26,7) = "(" + │ │ └── closing_loc: (26,13)-(26,14) = ")" + │ ├── opening_loc: (26,4)-(26,5) = "{" + │ └── closing_loc: (26,15)-(26,16) = "}" + └── @ CallNode (location: (28,0)-(28,23)) ├── flags: newline, ignore_visibility ├── receiver: ∅ ├── call_operator_loc: ∅ ├── name: :tap - ├── message_loc: (24,0)-(24,3) = "tap" + ├── message_loc: (28,0)-(28,3) = "tap" ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ └── block: - @ BlockNode (location: (24,4)-(24,15)) + @ BlockNode (location: (28,4)-(28,23)) ├── flags: ∅ ├── locals: [] ├── parameters: ∅ ├── body: - │ @ StatementsNode (location: (24,6)-(24,13)) + │ @ StatementsNode (location: (28,6)-(28,21)) │ ├── flags: ∅ │ └── body: (length: 1) - │ └── @ NextNode (location: (24,6)-(24,13)) + │ └── @ AndNode (location: (28,6)-(28,21)) │ ├── flags: newline - │ ├── arguments: - │ │ @ ArgumentsNode (location: (24,10)-(24,13)) + │ ├── left: + │ │ @ CallNode (location: (28,6)-(28,9)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (28,6)-(28,9) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── right: + │ │ @ ParenthesesNode (location: (28,13)-(28,21)) │ │ ├── flags: ∅ - │ │ └── arguments: (length: 1) - │ │ └── @ ParenthesesNode (location: (24,10)-(24,13)) - │ │ ├── flags: ∅ - │ │ ├── body: - │ │ │ @ StatementsNode (location: (24,11)-(24,12)) - │ │ │ ├── flags: ∅ - │ │ │ └── body: (length: 1) - │ │ │ └── @ IntegerNode (location: (24,11)-(24,12)) - │ │ │ ├── flags: newline, static_literal, decimal - │ │ │ └── value: 1 - │ │ ├── opening_loc: (24,10)-(24,11) = "(" - │ │ └── closing_loc: (24,12)-(24,13) = ")" - │ └── keyword_loc: (24,6)-(24,10) = "next" - ├── opening_loc: (24,4)-(24,5) = "{" - └── closing_loc: (24,14)-(24,15) = "}" + │ │ ├── body: + │ │ │ @ StatementsNode (location: (28,14)-(28,20)) + │ │ │ ├── flags: ∅ + │ │ │ └── body: (length: 1) + │ │ │ └── @ NextNode (location: (28,14)-(28,20)) + │ │ │ ├── flags: newline + │ │ │ ├── arguments: + │ │ │ │ @ ArgumentsNode (location: (28,19)-(28,20)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── arguments: (length: 1) + │ │ │ │ └── @ IntegerNode (location: (28,19)-(28,20)) + │ │ │ │ ├── flags: static_literal, decimal + │ │ │ │ └── value: 1 + │ │ │ └── keyword_loc: (28,14)-(28,18) = "next" + │ │ ├── opening_loc: (28,13)-(28,14) = "(" + │ │ └── closing_loc: (28,20)-(28,21) = ")" + │ └── operator_loc: (28,10)-(28,12) = "&&" + ├── opening_loc: (28,4)-(28,5) = "{" + └── closing_loc: (28,22)-(28,23) = "}" diff --git a/snapshots/return.txt b/snapshots/return.txt index ff297438b3..6fb103e99c 100644 --- a/snapshots/return.txt +++ b/snapshots/return.txt @@ -1,10 +1,10 @@ -@ ProgramNode (location: (1,0)-(23,9)) +@ ProgramNode (location: (1,0)-(27,17)) ├── flags: ∅ ├── locals: [] └── statements: - @ StatementsNode (location: (1,0)-(23,9)) + @ StatementsNode (location: (1,0)-(27,17)) ├── flags: ∅ - └── body: (length: 10) + └── body: (length: 12) ├── @ ReturnNode (location: (1,0)-(1,6)) │ ├── flags: newline │ ├── keyword_loc: (1,0)-(1,6) = "return" @@ -159,21 +159,72 @@ │ ├── body: ∅ │ ├── opening_loc: (21,6)-(21,7) = "(" │ └── closing_loc: (21,7)-(21,8) = ")" - └── @ ReturnNode (location: (23,0)-(23,9)) + ├── @ ReturnNode (location: (23,0)-(23,9)) + │ ├── flags: newline + │ ├── keyword_loc: (23,0)-(23,6) = "return" + │ └── arguments: + │ @ ArgumentsNode (location: (23,6)-(23,9)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ ParenthesesNode (location: (23,6)-(23,9)) + │ ├── flags: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (23,7)-(23,8)) + │ │ ├── flags: ∅ + │ │ └── body: (length: 1) + │ │ └── @ IntegerNode (location: (23,7)-(23,8)) + │ │ ├── flags: newline, static_literal, decimal + │ │ └── value: 1 + │ ├── opening_loc: (23,6)-(23,7) = "(" + │ └── closing_loc: (23,8)-(23,9) = ")" + ├── @ ParenthesesNode (location: (25,0)-(25,10)) + │ ├── flags: newline + │ ├── body: + │ │ @ StatementsNode (location: (25,1)-(25,9)) + │ │ ├── flags: ∅ + │ │ └── body: (length: 1) + │ │ └── @ ReturnNode (location: (25,1)-(25,9)) + │ │ ├── flags: newline + │ │ ├── keyword_loc: (25,1)-(25,7) = "return" + │ │ └── arguments: + │ │ @ ArgumentsNode (location: (25,8)-(25,9)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ IntegerNode (location: (25,8)-(25,9)) + │ │ ├── flags: static_literal, decimal + │ │ └── value: 1 + │ ├── opening_loc: (25,0)-(25,1) = "(" + │ └── closing_loc: (25,9)-(25,10) = ")" + └── @ AndNode (location: (27,0)-(27,17)) ├── flags: newline - ├── keyword_loc: (23,0)-(23,6) = "return" - └── arguments: - @ ArgumentsNode (location: (23,6)-(23,9)) - ├── flags: ∅ - └── arguments: (length: 1) - └── @ ParenthesesNode (location: (23,6)-(23,9)) - ├── flags: ∅ - ├── body: - │ @ StatementsNode (location: (23,7)-(23,8)) - │ ├── flags: ∅ - │ └── body: (length: 1) - │ └── @ IntegerNode (location: (23,7)-(23,8)) - │ ├── flags: newline, static_literal, decimal - │ └── value: 1 - ├── opening_loc: (23,6)-(23,7) = "(" - └── closing_loc: (23,8)-(23,9) = ")" + ├── left: + │ @ CallNode (location: (27,0)-(27,3)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :foo + │ ├── message_loc: (27,0)-(27,3) = "foo" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── right: + │ @ ParenthesesNode (location: (27,7)-(27,17)) + │ ├── flags: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (27,8)-(27,16)) + │ │ ├── flags: ∅ + │ │ └── body: (length: 1) + │ │ └── @ ReturnNode (location: (27,8)-(27,16)) + │ │ ├── flags: newline + │ │ ├── keyword_loc: (27,8)-(27,14) = "return" + │ │ └── arguments: + │ │ @ ArgumentsNode (location: (27,15)-(27,16)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ IntegerNode (location: (27,15)-(27,16)) + │ │ ├── flags: static_literal, decimal + │ │ └── value: 1 + │ ├── opening_loc: (27,7)-(27,8) = "(" + │ └── closing_loc: (27,16)-(27,17) = ")" + └── operator_loc: (27,4)-(27,6) = "&&" diff --git a/src/prism.c b/src/prism.c index b7e2bdc1de..2f7ce0b986 100644 --- a/src/prism.c +++ b/src/prism.c @@ -19102,7 +19102,13 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b pm_binding_power_t binding_power = pm_binding_powers[parser->current.type].left; if (binding_power == PM_BINDING_POWER_UNSET || binding_power >= PM_BINDING_POWER_RANGE) { + pm_token_t next = parser->current; parse_arguments(parser, &arguments, false, PM_TOKEN_EOF, (uint16_t) (depth + 1)); + + // Reject `foo && return bar`. + if (!accepts_command_call && arguments.arguments != NULL) { + PM_PARSER_ERR_TOKEN_FORMAT(parser, next, PM_ERR_EXPECT_EOL_AFTER_STATEMENT, pm_token_type_human(next.type)); + } } } diff --git a/test/prism/errors/command_calls_32.txt b/test/prism/errors/command_calls_32.txt new file mode 100644 index 0000000000..14488ca335 --- /dev/null +++ b/test/prism/errors/command_calls_32.txt @@ -0,0 +1,19 @@ +foo && return bar + ^~~ unexpected local variable or method, expecting end-of-input + +tap { foo && break bar } + ^~~ unexpected local variable or method, expecting end-of-input + +tap { foo && next bar } + ^~~ unexpected local variable or method, expecting end-of-input + +foo && return() + ^ unexpected '(', expecting end-of-input + +foo && return(bar) + ^ unexpected '(', expecting end-of-input + +foo && return(bar, baz) + ^~~~~~~~~~ unexpected write target + ^ unexpected '(', expecting end-of-input + diff --git a/test/prism/fixtures/break.txt b/test/prism/fixtures/break.txt index 5532322c5c..d823f866df 100644 --- a/test/prism/fixtures/break.txt +++ b/test/prism/fixtures/break.txt @@ -20,6 +20,10 @@ tap { break() } tap { break(1) } +tap { (break 1) } + +tap { foo && (break 1) } + foo { break 42 } == 42 foo { |a| break } == 42 diff --git a/test/prism/fixtures/next.txt b/test/prism/fixtures/next.txt index 2ef14c6304..0d2d6a11f5 100644 --- a/test/prism/fixtures/next.txt +++ b/test/prism/fixtures/next.txt @@ -22,3 +22,7 @@ tap { next tap { next() } tap { next(1) } + +tap { (next 1) } + +tap { foo && (next 1) } diff --git a/test/prism/fixtures/return.txt b/test/prism/fixtures/return.txt index a8b5b95fab..952fb80da8 100644 --- a/test/prism/fixtures/return.txt +++ b/test/prism/fixtures/return.txt @@ -22,3 +22,6 @@ return() return(1) +(return 1) + +foo && (return 1) From 03ca35b3abe1cb71a9c754cc742c3e5d1338d505 Mon Sep 17 00:00:00 2001 From: Herwin Date: Fri, 28 Jun 2024 11:56:05 +0200 Subject: [PATCH 113/333] Add field documentation for MatchRequiredNode --- config.yml | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/config.yml b/config.yml index b37b98cbdf..5453830008 100644 --- a/config.yml +++ b/config.yml @@ -3478,11 +3478,65 @@ nodes: - name: value type: node kind: non-void expression + comment: | + Represents the left-hand side of the operator. + + foo => bar + ^^^ - name: pattern type: node kind: pattern expression + comment: | + Represents the right-hand side of the operator. The type of the node depends on the expression. + + Anything that looks like a local variable name (including `_`) will result in a `LocalVariableTargetNode`. + + foo => a # This is equivalent to writing `a = foo` + ^ + + Using an explicit `Array` or combining expressions with `,` will result in a `ArrayPatternNode`. This can be preceded by a constant. + + foo => [a] + ^^^ + + foo => a, b + ^^^^ + + foo => Bar[a, b] + ^^^^^^^^^ + + If the array pattern contains at least two wildcard matches, a `FindPatternNode` is created instead. + + foo => *, 1, *a + ^^^^^ + + Using an explicit `Hash` or a constant with square brackets and hash keys in the square brackets will result in a `HashPatternNode`. + + foo => { a: 1, b: } + + foo => Bar[a: 1, b:] + + foo => Bar[**] + + To use any variable that needs run time evaluation, pinning is required. This results in a `PinnedVariableNode` + + foo => ^a + ^^ + + Similar, any expression can be used with pinning. This results in a `PinnedExpressionNode`. + + foo => ^(a + 1) + + Anything else will result in the regular node for that expression, for example a `ConstantReadNode`. + + foo => CONST - name: operator_loc type: location + comment: | + The location of the operator. + + foo => bar + ^^ comment: | Represents the use of the `=>` operator. From 193984b760c9bdf39672543482cc5d4ac9a49532 Mon Sep 17 00:00:00 2001 From: Herwin Date: Fri, 28 Jun 2024 11:58:02 +0200 Subject: [PATCH 114/333] Add pattern match documentation example to LocalVariableTargetNode --- config.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/config.yml b/config.yml index 5453830008..923e535ba9 100644 --- a/config.yml +++ b/config.yml @@ -3388,6 +3388,9 @@ nodes: foo, bar = baz ^^^ ^^^ + + foo => baz + ^^^ - name: LocalVariableWriteNode fields: - name: name From c80c4d958e58ec6141933cd53177f8eccc684689 Mon Sep 17 00:00:00 2001 From: Herwin Date: Fri, 28 Jun 2024 13:37:05 +0200 Subject: [PATCH 115/333] Add field documentation for ArrayPatternNode --- config.yml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/config.yml b/config.yml index 923e535ba9..f2e86a497c 100644 --- a/config.yml +++ b/config.yml @@ -992,8 +992,19 @@ nodes: - name: constant type: node? kind: - - ConstantReadNode - ConstantPathNode + - ConstantReadNode + comment: | + Represents the optional constant preceding the Array + + foo in Bar[] + ^^^ + + foo in Bar[1, 2, 3] + ^^^ + + foo in Bar::Baz[1, 2, 3] + ^^^^^^^^ - name: requireds type: node[] kind: pattern expression From 9b7dfcc3e076891bd08d0eb940b15cd8d6a63d98 Mon Sep 17 00:00:00 2001 From: Herwin Date: Fri, 28 Jun 2024 14:07:55 +0200 Subject: [PATCH 116/333] Add field documentation for HashPatternNode --- config.yml | 48 +++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 47 insertions(+), 1 deletion(-) diff --git a/config.yml b/config.yml index f2e86a497c..16754318b2 100644 --- a/config.yml +++ b/config.yml @@ -2725,20 +2725,60 @@ nodes: - name: constant type: node? kind: - - ConstantReadNode - ConstantPathNode + - ConstantReadNode + comment: | + Represents the optional constant preceding the Hash. + + foo => Bar[a: 1, b: 2] + ^^^ + + foo => Bar::Baz[a: 1, b: 2] + ^^^^^^^^ - name: elements type: node[] kind: AssocNode + comment: | + Represents the explicit named hash keys and values. + + foo => { a: 1, b:, ** } + ^^^^^^^^ - name: rest type: node? kind: - AssocSplatNode - NoKeywordsParameterNode + comment: | + Represents the rest of the Hash keys and values. This can be named, unnamed, or explicitly forbidden via `**nil`, this last one results in a `NoKeywordsParameterNode`. + + foo => { a: 1, b:, **c } + ^^^ + + foo => { a: 1, b:, ** } + ^^ + + foo => { a: 1, b:, **nil } + ^^^^^ - name: opening_loc type: location? + comment: | + The location of the opening brace. + + foo => { a: 1 } + ^ + + foo => Bar[a: 1] + ^ - name: closing_loc type: location? + comment: | + The location of the closing brace. + + foo => { a: 1 } + ^ + + foo => Bar[a: 1] + ^ comment: | Represents a hash pattern in pattern matching. @@ -2747,6 +2787,12 @@ nodes: foo => { a: 1, b: 2, **c } ^^^^^^^^^^^^^^^^^^^ + + foo => Bar[a: 1, b: 2] + ^^^^^^^^^^^^^^^ + + foo in { a: 1, b: 2 } + ^^^^^^^^^^^^^^ - name: IfNode fields: - name: if_keyword_loc From a0cc316e912881aa1ee8256cccd07c914e458cf3 Mon Sep 17 00:00:00 2001 From: Herwin Date: Fri, 28 Jun 2024 14:16:35 +0200 Subject: [PATCH 117/333] Add field documentation for FindPatternNode --- config.yml | 50 +++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 49 insertions(+), 1 deletion(-) diff --git a/config.yml b/config.yml index 16754318b2..de78d65462 100644 --- a/config.yml +++ b/config.yml @@ -2420,23 +2420,68 @@ nodes: - name: constant type: node? kind: - - ConstantReadNode - ConstantPathNode + - ConstantReadNode + comment: | + Represents the optional constant preceding the pattern + + foo in Foo(*bar, baz, *qux) + ^^^ - name: left type: node kind: SplatNode + comment: | + Represents the first wildcard node in the pattern. + + foo in *bar, baz, *qux + ^^^^ + + foo in Foo(*bar, baz, *qux) + ^^^^ - name: requireds type: node[] kind: pattern expression + comment: | + Represents the nodes in between the wildcards. + + foo in *bar, baz, *qux + ^^^ + + foo in Foo(*bar, baz, 1, *qux) + ^^^^^^ - name: right type: node kind: - SplatNode - on error: MissingNode + comment: | + Represents the second wildcard node in the pattern. + + foo in *bar, baz, *qux + ^^^^ + + foo in Foo(*bar, baz, *qux) + ^^^^ - name: opening_loc type: location? + comment: | + The location of the openingbrace. + + foo in [*bar, baz, *qux] + ^ + + foo in Foo(*bar, baz, *qux) + ^ - name: closing_loc type: location? + comment: | + The location of the closing brace. + + foo in [*bar, baz, *qux] + ^ + + foo in Foo(*bar, baz, *qux) + ^ comment: | Represents a find pattern in pattern matching. @@ -2448,6 +2493,9 @@ nodes: foo in Foo(*bar, baz, *qux) ^^^^^^^^^^^^^^^^^^^^ + + foo => *bar, baz, *qux + ^^^^^^^^^^^^^^^ - name: FlipFlopNode flags: RangeFlags fields: From af9047f3784fba9c4ccb44a5ef7b0ddb6ae69830 Mon Sep 17 00:00:00 2001 From: Herwin Date: Sat, 29 Jun 2024 17:17:16 +0200 Subject: [PATCH 118/333] Add field documentation for PinnedVariableNode --- config.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/config.yml b/config.yml index de78d65462..c53265b350 100644 --- a/config.yml +++ b/config.yml @@ -4098,8 +4098,18 @@ nodes: - NumberedReferenceReadNode # foo in ^$1 - ItLocalVariableReadNode # proc { 1 in ^it } - on error: MissingNode # foo in ^Bar + comment: | + The variable used in the pinned expression + + foo in ^bar + ^^^ - name: operator_loc type: location + comment: | + The location of the `^` operator + + foo in ^bar + ^ comment: | Represents the use of the `^` operator for pinning a variable in a pattern matching expression. From 0d94291416db5220a678d1d641e03202ded1620e Mon Sep 17 00:00:00 2001 From: Herwin Date: Tue, 2 Jul 2024 16:56:38 +0200 Subject: [PATCH 119/333] Add field documentation for PinnedExpressionNode --- config.yml | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/config.yml b/config.yml index c53265b350..3366b6235d 100644 --- a/config.yml +++ b/config.yml @@ -2465,7 +2465,7 @@ nodes: - name: opening_loc type: location? comment: | - The location of the openingbrace. + The location of the opening brace. foo in [*bar, baz, *qux] ^ @@ -4074,12 +4074,32 @@ nodes: - name: expression type: node kind: non-void expression + comment: | + The expression used in the pinned expression + + foo in ^(bar) + ^^^ - name: operator_loc type: location + comment: | + The location of the `^` operator + + foo in ^(bar) + ^ - name: lparen_loc type: location + comment: | + The location of the opening parenthesis. + + foo in ^(bar) + ^ - name: rparen_loc type: location + comment: | + The location of the closing parenthesis. + + foo in ^(bar) + ^ comment: | Represents the use of the `^` operator for pinning an expression in a pattern matching expression. From ed8f6307c16cce5004590c218b70f5fd2900515b Mon Sep 17 00:00:00 2001 From: Alexander Momchilov Date: Mon, 16 Sep 2024 09:45:23 -0400 Subject: [PATCH 120/333] Document lifetime of `pm_options_t` --- include/prism.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/include/prism.h b/include/prism.h index a6f22f1a5a..11e854eb35 100644 --- a/include/prism.h +++ b/include/prism.h @@ -49,10 +49,13 @@ PRISM_EXPORTED_FUNCTION const char * pm_version(void); /** * Initialize a parser with the given start and end pointers. * + * The resulting parser must eventually be freed with `pm_parser_free()`. + * * @param parser The parser to initialize. * @param source The source to parse. * @param size The size of the source. - * @param options The optional options to use when parsing. + * @param options The optional options to use when parsing. These options must + * live for the whole lifetime of this parser. */ PRISM_EXPORTED_FUNCTION void pm_parser_init(pm_parser_t *parser, const uint8_t *source, size_t size, const pm_options_t *options); @@ -68,6 +71,9 @@ PRISM_EXPORTED_FUNCTION void pm_parser_register_encoding_changed_callback(pm_par /** * Free any memory associated with the given parser. * + * This does not free the `pm_options_t` object that was used to initialize the + * parser. + * * @param parser The parser to free. */ PRISM_EXPORTED_FUNCTION void pm_parser_free(pm_parser_t *parser); From 3f58fa7705f2bd0c7978f327c66e79df8c07e146 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Sat, 21 Dec 2024 15:36:03 -0500 Subject: [PATCH 121/333] Support leading logical operators --- snapshots/leading_logical.txt | 109 ++++++++++++++++++++++++ src/prism.c | 94 ++++++++++++++++++-- test/prism/fixtures/leading_logical.txt | 21 +++++ test/prism/fixtures_test.rb | 2 + test/prism/lex_test.rb | 3 + test/prism/ruby/parser_test.rb | 3 + test/prism/ruby/ripper_test.rb | 3 + test/prism/ruby/ruby_parser_test.rb | 1 + 8 files changed, 229 insertions(+), 7 deletions(-) create mode 100644 snapshots/leading_logical.txt create mode 100644 test/prism/fixtures/leading_logical.txt diff --git a/snapshots/leading_logical.txt b/snapshots/leading_logical.txt new file mode 100644 index 0000000000..98b0042491 --- /dev/null +++ b/snapshots/leading_logical.txt @@ -0,0 +1,109 @@ +@ ProgramNode (location: (1,0)-(21,5)) +├── flags: ∅ +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(21,5)) + ├── flags: ∅ + └── body: (length: 8) + ├── @ AndNode (location: (1,0)-(3,4)) + │ ├── flags: newline + │ ├── left: + │ │ @ AndNode (location: (1,0)-(2,4)) + │ │ ├── flags: ∅ + │ │ ├── left: + │ │ │ @ IntegerNode (location: (1,0)-(1,1)) + │ │ │ ├── flags: static_literal, decimal + │ │ │ └── value: 1 + │ │ ├── right: + │ │ │ @ IntegerNode (location: (2,3)-(2,4)) + │ │ │ ├── flags: static_literal, decimal + │ │ │ └── value: 2 + │ │ └── operator_loc: (2,0)-(2,2) = "&&" + │ ├── right: + │ │ @ IntegerNode (location: (3,3)-(3,4)) + │ │ ├── flags: static_literal, decimal + │ │ └── value: 3 + │ └── operator_loc: (3,0)-(3,2) = "&&" + ├── @ OrNode (location: (5,0)-(7,4)) + │ ├── flags: newline + │ ├── left: + │ │ @ OrNode (location: (5,0)-(6,4)) + │ │ ├── flags: ∅ + │ │ ├── left: + │ │ │ @ IntegerNode (location: (5,0)-(5,1)) + │ │ │ ├── flags: static_literal, decimal + │ │ │ └── value: 1 + │ │ ├── right: + │ │ │ @ IntegerNode (location: (6,3)-(6,4)) + │ │ │ ├── flags: static_literal, decimal + │ │ │ └── value: 2 + │ │ └── operator_loc: (6,0)-(6,2) = "||" + │ ├── right: + │ │ @ IntegerNode (location: (7,3)-(7,4)) + │ │ ├── flags: static_literal, decimal + │ │ └── value: 3 + │ └── operator_loc: (7,0)-(7,2) = "||" + ├── @ AndNode (location: (9,0)-(11,5)) + │ ├── flags: newline + │ ├── left: + │ │ @ AndNode (location: (9,0)-(10,5)) + │ │ ├── flags: ∅ + │ │ ├── left: + │ │ │ @ IntegerNode (location: (9,0)-(9,1)) + │ │ │ ├── flags: static_literal, decimal + │ │ │ └── value: 1 + │ │ ├── right: + │ │ │ @ IntegerNode (location: (10,4)-(10,5)) + │ │ │ ├── flags: static_literal, decimal + │ │ │ └── value: 2 + │ │ └── operator_loc: (10,0)-(10,3) = "and" + │ ├── right: + │ │ @ IntegerNode (location: (11,4)-(11,5)) + │ │ ├── flags: static_literal, decimal + │ │ └── value: 3 + │ └── operator_loc: (11,0)-(11,3) = "and" + ├── @ OrNode (location: (13,0)-(15,4)) + │ ├── flags: newline + │ ├── left: + │ │ @ OrNode (location: (13,0)-(14,4)) + │ │ ├── flags: ∅ + │ │ ├── left: + │ │ │ @ IntegerNode (location: (13,0)-(13,1)) + │ │ │ ├── flags: static_literal, decimal + │ │ │ └── value: 1 + │ │ ├── right: + │ │ │ @ IntegerNode (location: (14,3)-(14,4)) + │ │ │ ├── flags: static_literal, decimal + │ │ │ └── value: 2 + │ │ └── operator_loc: (14,0)-(14,2) = "or" + │ ├── right: + │ │ @ IntegerNode (location: (15,3)-(15,4)) + │ │ ├── flags: static_literal, decimal + │ │ └── value: 3 + │ └── operator_loc: (15,0)-(15,2) = "or" + ├── @ IntegerNode (location: (17,0)-(17,1)) + │ ├── flags: newline, static_literal, decimal + │ └── value: 1 + ├── @ CallNode (location: (18,0)-(18,6)) + │ ├── flags: newline, variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :andfoo + │ ├── message_loc: (18,0)-(18,6) = "andfoo" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ IntegerNode (location: (20,0)-(20,1)) + │ ├── flags: newline, static_literal, decimal + │ └── value: 2 + └── @ CallNode (location: (21,0)-(21,5)) + ├── flags: newline, variable_call, ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :orfoo + ├── message_loc: (21,0)-(21,5) = "orfoo" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: ∅ diff --git a/src/prism.c b/src/prism.c index 2f7ce0b986..daf69d2ef9 100644 --- a/src/prism.c +++ b/src/prism.c @@ -10834,14 +10834,37 @@ parser_lex(pm_parser_t *parser) { following = next_newline(following, parser->end - following); } - // If the lex state was ignored, or we hit a '.' or a '&.', - // we will lex the ignored newline + // If the lex state was ignored, we will lex the + // ignored newline. + if (lex_state_ignored_p(parser)) { + if (!lexed_comment) parser_lex_ignored_newline(parser); + lexed_comment = false; + goto lex_next_token; + } + + // If we hit a '.' or a '&.' we will lex the ignored + // newline. + if (following && ( + (peek_at(parser, following) == '.') || + (peek_at(parser, following) == '&' && peek_at(parser, following + 1) == '.') + )) { + if (!lexed_comment) parser_lex_ignored_newline(parser); + lexed_comment = false; + goto lex_next_token; + } + + + // If we are parsing as CRuby 3.5 or later and we + // hit a '&&' or a '||' then we will lex the ignored + // newline. if ( - lex_state_ignored_p(parser) || - (following && ( - (peek_at(parser, following) == '.') || - (peek_at(parser, following) == '&' && peek_at(parser, following + 1) == '.') - )) + (parser->version >= PM_OPTIONS_VERSION_CRUBY_3_5) && + following && ( + (peek_at(parser, following) == '&' && peek_at(parser, following + 1) == '&') || + (peek_at(parser, following) == '|' && peek_at(parser, following + 1) == '|') || + (peek_at(parser, following) == 'a' && peek_at(parser, following + 1) == 'n' && peek_at(parser, following + 2) == 'd' && !char_is_identifier(parser, following + 3, parser->end - (following + 3))) || + (peek_at(parser, following) == 'o' && peek_at(parser, following + 1) == 'r' && !char_is_identifier(parser, following + 2, parser->end - (following + 2))) + ) ) { if (!lexed_comment) parser_lex_ignored_newline(parser); lexed_comment = false; @@ -10881,6 +10904,63 @@ parser_lex(pm_parser_t *parser) { parser->next_start = NULL; LEX(PM_TOKEN_AMPERSAND_DOT); } + + if (parser->version >= PM_OPTIONS_VERSION_CRUBY_3_5) { + // If we hit an && then we are in a logical chain + // and we need to return the logical operator. + if (peek_at(parser, next_content) == '&' && peek_at(parser, next_content + 1) == '&') { + if (!lexed_comment) parser_lex_ignored_newline(parser); + lex_state_set(parser, PM_LEX_STATE_BEG); + parser->current.start = next_content; + parser->current.end = next_content + 2; + parser->next_start = NULL; + LEX(PM_TOKEN_AMPERSAND_AMPERSAND); + } + + // If we hit a || then we are in a logical chain and + // we need to return the logical operator. + if (peek_at(parser, next_content) == '|' && peek_at(parser, next_content + 1) == '|') { + if (!lexed_comment) parser_lex_ignored_newline(parser); + lex_state_set(parser, PM_LEX_STATE_BEG); + parser->current.start = next_content; + parser->current.end = next_content + 2; + parser->next_start = NULL; + LEX(PM_TOKEN_PIPE_PIPE); + } + + // If we hit an 'and' then we are in a logical chain + // and we need to return the logical operator. + if ( + peek_at(parser, next_content) == 'a' && + peek_at(parser, next_content + 1) == 'n' && + peek_at(parser, next_content + 2) == 'd' && + !char_is_identifier(parser, next_content + 3, parser->end - (next_content + 3)) + ) { + if (!lexed_comment) parser_lex_ignored_newline(parser); + lex_state_set(parser, PM_LEX_STATE_BEG); + parser->current.start = next_content; + parser->current.end = next_content + 3; + parser->next_start = NULL; + parser->command_start = true; + LEX(PM_TOKEN_KEYWORD_AND); + } + + // If we hit a 'or' then we are in a logical chain + // and we need to return the logical operator. + if ( + peek_at(parser, next_content) == 'o' && + peek_at(parser, next_content + 1) == 'r' && + !char_is_identifier(parser, next_content + 2, parser->end - (next_content + 2)) + ) { + if (!lexed_comment) parser_lex_ignored_newline(parser); + lex_state_set(parser, PM_LEX_STATE_BEG); + parser->current.start = next_content; + parser->current.end = next_content + 2; + parser->next_start = NULL; + parser->command_start = true; + LEX(PM_TOKEN_KEYWORD_OR); + } + } } // At this point we know this is a regular newline, and we can set the diff --git a/test/prism/fixtures/leading_logical.txt b/test/prism/fixtures/leading_logical.txt new file mode 100644 index 0000000000..feb5ee245c --- /dev/null +++ b/test/prism/fixtures/leading_logical.txt @@ -0,0 +1,21 @@ +1 +&& 2 +&& 3 + +1 +|| 2 +|| 3 + +1 +and 2 +and 3 + +1 +or 2 +or 3 + +1 +andfoo + +2 +orfoo diff --git a/test/prism/fixtures_test.rb b/test/prism/fixtures_test.rb index 3b4a502b90..124a834317 100644 --- a/test/prism/fixtures_test.rb +++ b/test/prism/fixtures_test.rb @@ -25,6 +25,8 @@ class FixturesTest < TestCase except << "whitequark/ruby_bug_19281.txt" end + except << "leading_logical.txt" if RUBY_VERSION < "3.5.0" + Fixture.each(except: except) do |fixture| define_method(fixture.test_name) { assert_valid_syntax(fixture.read) } end diff --git a/test/prism/lex_test.rb b/test/prism/lex_test.rb index d34c3d9dd3..abce18a0ad 100644 --- a/test/prism/lex_test.rb +++ b/test/prism/lex_test.rb @@ -42,6 +42,9 @@ class LexTest < TestCase except << "whitequark/ruby_bug_19281.txt" end + # https://bugs.ruby-lang.org/issues/20925 + except << "leading_logical.txt" + Fixture.each(except: except) do |fixture| define_method(fixture.test_name) { assert_lex(fixture) } end diff --git a/test/prism/ruby/parser_test.rb b/test/prism/ruby/parser_test.rb index 2a4ea981bd..129c38a3b5 100644 --- a/test/prism/ruby/parser_test.rb +++ b/test/prism/ruby/parser_test.rb @@ -64,6 +64,9 @@ class ParserTest < TestCase # 1.. && 2 "ranges.txt", + + # Cannot yet handling leading logical operators. + "leading_logical.txt", ] # These files contain code that is being parsed incorrectly by the parser diff --git a/test/prism/ruby/ripper_test.rb b/test/prism/ruby/ripper_test.rb index 5c37178889..6372024878 100644 --- a/test/prism/ruby/ripper_test.rb +++ b/test/prism/ruby/ripper_test.rb @@ -8,6 +8,9 @@ module Prism class RipperTest < TestCase # Skip these tests that Ripper is reporting the wrong results for. incorrect = [ + # Not yet supported. + "leading_logical.txt", + # Ripper incorrectly attributes the block to the keyword. "seattlerb/block_break.txt", "seattlerb/block_next.txt", diff --git a/test/prism/ruby/ruby_parser_test.rb b/test/prism/ruby/ruby_parser_test.rb index 960e7f63e4..f4f0f331fb 100644 --- a/test/prism/ruby/ruby_parser_test.rb +++ b/test/prism/ruby/ruby_parser_test.rb @@ -38,6 +38,7 @@ class RubyParserTest < TestCase "dos_endings.txt", "heredocs_with_fake_newlines.txt", "heredocs_with_ignored_newlines.txt", + "leading_logical.txt", "method_calls.txt", "methods.txt", "multi_write.txt", From 8fd12d594cf07ab488e55952e7c837ef8cf02f69 Mon Sep 17 00:00:00 2001 From: Earlopain <14981592+Earlopain@users.noreply.github.com> Date: Tue, 2 Sep 2025 13:29:35 +0200 Subject: [PATCH 122/333] [Bug #17398] Allow `private def hello = puts "Hello"` This was a limitation of parse.y that prism intentionally replicated. --- snapshots/endless_methods_command_call.txt | 475 ++++++++++++++++++ src/prism.c | 14 +- .../errors/endless_method_command_call.txt | 3 + test/prism/errors/private_endless_method.txt | 3 - test/prism/errors_test.rb | 9 + .../fixtures/endless_methods_command_call.txt | 8 + test/prism/fixtures_test.rb | 5 +- test/prism/lex_test.rb | 3 + test/prism/locals_test.rb | 6 +- test/prism/ruby/parser_test.rb | 3 + test/prism/ruby/ripper_test.rb | 5 +- test/prism/ruby/ruby_parser_test.rb | 5 +- 12 files changed, 524 insertions(+), 15 deletions(-) create mode 100644 snapshots/endless_methods_command_call.txt create mode 100644 test/prism/errors/endless_method_command_call.txt delete mode 100644 test/prism/errors/private_endless_method.txt create mode 100644 test/prism/fixtures/endless_methods_command_call.txt diff --git a/snapshots/endless_methods_command_call.txt b/snapshots/endless_methods_command_call.txt new file mode 100644 index 0000000000..c6b34c2d5f --- /dev/null +++ b/snapshots/endless_methods_command_call.txt @@ -0,0 +1,475 @@ +@ ProgramNode (location: (1,0)-(8,31)) +├── flags: ∅ +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(8,31)) + ├── flags: ∅ + └── body: (length: 8) + ├── @ CallNode (location: (1,0)-(1,30)) + │ ├── flags: newline, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :private + │ ├── message_loc: (1,0)-(1,7) = "private" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,8)-(1,30)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ DefNode (location: (1,8)-(1,30)) + │ │ ├── flags: ∅ + │ │ ├── name: :foo + │ │ ├── name_loc: (1,12)-(1,15) = "foo" + │ │ ├── receiver: ∅ + │ │ ├── parameters: ∅ + │ │ ├── body: + │ │ │ @ StatementsNode (location: (1,18)-(1,30)) + │ │ │ ├── flags: ∅ + │ │ │ └── body: (length: 1) + │ │ │ └── @ CallNode (location: (1,18)-(1,30)) + │ │ │ ├── flags: ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :puts + │ │ │ ├── message_loc: (1,18)-(1,22) = "puts" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: + │ │ │ │ @ ArgumentsNode (location: (1,23)-(1,30)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── arguments: (length: 1) + │ │ │ │ └── @ StringNode (location: (1,23)-(1,30)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── opening_loc: (1,23)-(1,24) = "\"" + │ │ │ │ ├── content_loc: (1,24)-(1,29) = "Hello" + │ │ │ │ ├── closing_loc: (1,29)-(1,30) = "\"" + │ │ │ │ └── unescaped: "Hello" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── locals: [] + │ │ ├── def_keyword_loc: (1,8)-(1,11) = "def" + │ │ ├── operator_loc: ∅ + │ │ ├── lparen_loc: ∅ + │ │ ├── rparen_loc: ∅ + │ │ ├── equal_loc: (1,16)-(1,17) = "=" + │ │ └── end_keyword_loc: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (2,0)-(2,39)) + │ ├── flags: newline, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :private + │ ├── message_loc: (2,0)-(2,7) = "private" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (2,8)-(2,39)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ DefNode (location: (2,8)-(2,39)) + │ │ ├── flags: ∅ + │ │ ├── name: :foo + │ │ ├── name_loc: (2,12)-(2,15) = "foo" + │ │ ├── receiver: ∅ + │ │ ├── parameters: ∅ + │ │ ├── body: + │ │ │ @ StatementsNode (location: (2,18)-(2,39)) + │ │ │ ├── flags: ∅ + │ │ │ └── body: (length: 1) + │ │ │ └── @ CallNode (location: (2,18)-(2,39)) + │ │ │ ├── flags: ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :puts + │ │ │ ├── message_loc: (2,18)-(2,22) = "puts" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: + │ │ │ │ @ ArgumentsNode (location: (2,23)-(2,39)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── arguments: (length: 2) + │ │ │ │ ├── @ StringNode (location: (2,23)-(2,30)) + │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ ├── opening_loc: (2,23)-(2,24) = "\"" + │ │ │ │ │ ├── content_loc: (2,24)-(2,29) = "Hello" + │ │ │ │ │ ├── closing_loc: (2,29)-(2,30) = "\"" + │ │ │ │ │ └── unescaped: "Hello" + │ │ │ │ └── @ StringNode (location: (2,32)-(2,39)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── opening_loc: (2,32)-(2,33) = "\"" + │ │ │ │ ├── content_loc: (2,33)-(2,38) = "World" + │ │ │ │ ├── closing_loc: (2,38)-(2,39) = "\"" + │ │ │ │ └── unescaped: "World" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── locals: [] + │ │ ├── def_keyword_loc: (2,8)-(2,11) = "def" + │ │ ├── operator_loc: ∅ + │ │ ├── lparen_loc: ∅ + │ │ ├── rparen_loc: ∅ + │ │ ├── equal_loc: (2,16)-(2,17) = "=" + │ │ └── end_keyword_loc: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (3,0)-(3,42)) + │ ├── flags: newline, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :private + │ ├── message_loc: (3,0)-(3,7) = "private" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (3,8)-(3,30)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ DefNode (location: (3,8)-(3,30)) + │ │ ├── flags: ∅ + │ │ ├── name: :foo + │ │ ├── name_loc: (3,12)-(3,15) = "foo" + │ │ ├── receiver: ∅ + │ │ ├── parameters: ∅ + │ │ ├── body: + │ │ │ @ StatementsNode (location: (3,18)-(3,30)) + │ │ │ ├── flags: ∅ + │ │ │ └── body: (length: 1) + │ │ │ └── @ CallNode (location: (3,18)-(3,30)) + │ │ │ ├── flags: ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :puts + │ │ │ ├── message_loc: (3,18)-(3,22) = "puts" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: + │ │ │ │ @ ArgumentsNode (location: (3,23)-(3,30)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── arguments: (length: 1) + │ │ │ │ └── @ StringNode (location: (3,23)-(3,30)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── opening_loc: (3,23)-(3,24) = "\"" + │ │ │ │ ├── content_loc: (3,24)-(3,29) = "Hello" + │ │ │ │ ├── closing_loc: (3,29)-(3,30) = "\"" + │ │ │ │ └── unescaped: "Hello" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── locals: [] + │ │ ├── def_keyword_loc: (3,8)-(3,11) = "def" + │ │ ├── operator_loc: ∅ + │ │ ├── lparen_loc: ∅ + │ │ ├── rparen_loc: ∅ + │ │ ├── equal_loc: (3,16)-(3,17) = "=" + │ │ └── end_keyword_loc: ∅ + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (3,31)-(3,42)) + │ ├── flags: ∅ + │ ├── locals: [] + │ ├── parameters: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (3,34)-(3,38)) + │ │ ├── flags: ∅ + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (3,34)-(3,38)) + │ │ ├── flags: newline, variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :expr + │ │ ├── message_loc: (3,34)-(3,38) = "expr" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── opening_loc: (3,31)-(3,33) = "do" + │ └── closing_loc: (3,39)-(3,42) = "end" + ├── @ CallNode (location: (4,0)-(4,32)) + │ ├── flags: newline, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :private + │ ├── message_loc: (4,0)-(4,7) = "private" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (4,8)-(4,32)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ DefNode (location: (4,8)-(4,32)) + │ │ ├── flags: ∅ + │ │ ├── name: :foo + │ │ ├── name_loc: (4,12)-(4,15) = "foo" + │ │ ├── receiver: ∅ + │ │ ├── parameters: ∅ + │ │ ├── body: + │ │ │ @ StatementsNode (location: (4,20)-(4,32)) + │ │ │ ├── flags: ∅ + │ │ │ └── body: (length: 1) + │ │ │ └── @ CallNode (location: (4,20)-(4,32)) + │ │ │ ├── flags: ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :puts + │ │ │ ├── message_loc: (4,20)-(4,24) = "puts" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: + │ │ │ │ @ ArgumentsNode (location: (4,25)-(4,32)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── arguments: (length: 1) + │ │ │ │ └── @ StringNode (location: (4,25)-(4,32)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── opening_loc: (4,25)-(4,26) = "\"" + │ │ │ │ ├── content_loc: (4,26)-(4,31) = "Hello" + │ │ │ │ ├── closing_loc: (4,31)-(4,32) = "\"" + │ │ │ │ └── unescaped: "Hello" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── locals: [] + │ │ ├── def_keyword_loc: (4,8)-(4,11) = "def" + │ │ ├── operator_loc: ∅ + │ │ ├── lparen_loc: (4,15)-(4,16) = "(" + │ │ ├── rparen_loc: (4,16)-(4,17) = ")" + │ │ ├── equal_loc: (4,18)-(4,19) = "=" + │ │ └── end_keyword_loc: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (5,0)-(5,27)) + │ ├── flags: newline, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :private + │ ├── message_loc: (5,0)-(5,7) = "private" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (5,8)-(5,27)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ DefNode (location: (5,8)-(5,27)) + │ │ ├── flags: ∅ + │ │ ├── name: :foo + │ │ ├── name_loc: (5,12)-(5,15) = "foo" + │ │ ├── receiver: ∅ + │ │ ├── parameters: + │ │ │ @ ParametersNode (location: (5,16)-(5,17)) + │ │ │ ├── flags: ∅ + │ │ │ ├── requireds: (length: 1) + │ │ │ │ └── @ RequiredParameterNode (location: (5,16)-(5,17)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :x + │ │ │ ├── optionals: (length: 0) + │ │ │ ├── rest: ∅ + │ │ │ ├── posts: (length: 0) + │ │ │ ├── keywords: (length: 0) + │ │ │ ├── keyword_rest: ∅ + │ │ │ └── block: ∅ + │ │ ├── body: + │ │ │ @ StatementsNode (location: (5,21)-(5,27)) + │ │ │ ├── flags: ∅ + │ │ │ └── body: (length: 1) + │ │ │ └── @ CallNode (location: (5,21)-(5,27)) + │ │ │ ├── flags: ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :puts + │ │ │ ├── message_loc: (5,21)-(5,25) = "puts" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: + │ │ │ │ @ ArgumentsNode (location: (5,26)-(5,27)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── arguments: (length: 1) + │ │ │ │ └── @ LocalVariableReadNode (location: (5,26)-(5,27)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── name: :x + │ │ │ │ └── depth: 0 + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── locals: [:x] + │ │ ├── def_keyword_loc: (5,8)-(5,11) = "def" + │ │ ├── operator_loc: ∅ + │ │ ├── lparen_loc: (5,15)-(5,16) = "(" + │ │ ├── rparen_loc: (5,17)-(5,18) = ")" + │ │ ├── equal_loc: (5,19)-(5,20) = "=" + │ │ └── end_keyword_loc: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (6,0)-(6,34)) + │ ├── flags: newline, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :private + │ ├── message_loc: (6,0)-(6,7) = "private" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (6,8)-(6,34)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ DefNode (location: (6,8)-(6,34)) + │ │ ├── flags: ∅ + │ │ ├── name: :foo + │ │ ├── name_loc: (6,16)-(6,19) = "foo" + │ │ ├── receiver: + │ │ │ @ CallNode (location: (6,12)-(6,15)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :obj + │ │ │ ├── message_loc: (6,12)-(6,15) = "obj" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── parameters: ∅ + │ │ ├── body: + │ │ │ @ StatementsNode (location: (6,22)-(6,34)) + │ │ │ ├── flags: ∅ + │ │ │ └── body: (length: 1) + │ │ │ └── @ CallNode (location: (6,22)-(6,34)) + │ │ │ ├── flags: ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :puts + │ │ │ ├── message_loc: (6,22)-(6,26) = "puts" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: + │ │ │ │ @ ArgumentsNode (location: (6,27)-(6,34)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── arguments: (length: 1) + │ │ │ │ └── @ StringNode (location: (6,27)-(6,34)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── opening_loc: (6,27)-(6,28) = "\"" + │ │ │ │ ├── content_loc: (6,28)-(6,33) = "Hello" + │ │ │ │ ├── closing_loc: (6,33)-(6,34) = "\"" + │ │ │ │ └── unescaped: "Hello" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── locals: [] + │ │ ├── def_keyword_loc: (6,8)-(6,11) = "def" + │ │ ├── operator_loc: (6,15)-(6,16) = "." + │ │ ├── lparen_loc: ∅ + │ │ ├── rparen_loc: ∅ + │ │ ├── equal_loc: (6,20)-(6,21) = "=" + │ │ └── end_keyword_loc: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (7,0)-(7,36)) + │ ├── flags: newline, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :private + │ ├── message_loc: (7,0)-(7,7) = "private" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (7,8)-(7,36)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ DefNode (location: (7,8)-(7,36)) + │ │ ├── flags: ∅ + │ │ ├── name: :foo + │ │ ├── name_loc: (7,16)-(7,19) = "foo" + │ │ ├── receiver: + │ │ │ @ CallNode (location: (7,12)-(7,15)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :obj + │ │ │ ├── message_loc: (7,12)-(7,15) = "obj" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── parameters: ∅ + │ │ ├── body: + │ │ │ @ StatementsNode (location: (7,24)-(7,36)) + │ │ │ ├── flags: ∅ + │ │ │ └── body: (length: 1) + │ │ │ └── @ CallNode (location: (7,24)-(7,36)) + │ │ │ ├── flags: ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :puts + │ │ │ ├── message_loc: (7,24)-(7,28) = "puts" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: + │ │ │ │ @ ArgumentsNode (location: (7,29)-(7,36)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── arguments: (length: 1) + │ │ │ │ └── @ StringNode (location: (7,29)-(7,36)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── opening_loc: (7,29)-(7,30) = "\"" + │ │ │ │ ├── content_loc: (7,30)-(7,35) = "Hello" + │ │ │ │ ├── closing_loc: (7,35)-(7,36) = "\"" + │ │ │ │ └── unescaped: "Hello" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── locals: [] + │ │ ├── def_keyword_loc: (7,8)-(7,11) = "def" + │ │ ├── operator_loc: (7,15)-(7,16) = "." + │ │ ├── lparen_loc: (7,19)-(7,20) = "(" + │ │ ├── rparen_loc: (7,20)-(7,21) = ")" + │ │ ├── equal_loc: (7,22)-(7,23) = "=" + │ │ └── end_keyword_loc: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + └── @ CallNode (location: (8,0)-(8,31)) + ├── flags: newline, ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :private + ├── message_loc: (8,0)-(8,7) = "private" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (8,8)-(8,31)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ DefNode (location: (8,8)-(8,31)) + │ ├── flags: ∅ + │ ├── name: :foo + │ ├── name_loc: (8,16)-(8,19) = "foo" + │ ├── receiver: + │ │ @ CallNode (location: (8,12)-(8,15)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :obj + │ │ ├── message_loc: (8,12)-(8,15) = "obj" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── parameters: + │ │ @ ParametersNode (location: (8,20)-(8,21)) + │ │ ├── flags: ∅ + │ │ ├── requireds: (length: 1) + │ │ │ └── @ RequiredParameterNode (location: (8,20)-(8,21)) + │ │ │ ├── flags: ∅ + │ │ │ └── name: :x + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (8,25)-(8,31)) + │ │ ├── flags: ∅ + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (8,25)-(8,31)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :puts + │ │ ├── message_loc: (8,25)-(8,29) = "puts" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (8,30)-(8,31)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ LocalVariableReadNode (location: (8,30)-(8,31)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :x + │ │ │ └── depth: 0 + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── locals: [:x] + │ ├── def_keyword_loc: (8,8)-(8,11) = "def" + │ ├── operator_loc: (8,15)-(8,16) = "." + │ ├── lparen_loc: (8,19)-(8,20) = "(" + │ ├── rparen_loc: (8,21)-(8,22) = ")" + │ ├── equal_loc: (8,23)-(8,24) = "=" + │ └── end_keyword_loc: ∅ + ├── closing_loc: ∅ + └── block: ∅ diff --git a/src/prism.c b/src/prism.c index daf69d2ef9..337b77637b 100644 --- a/src/prism.c +++ b/src/prism.c @@ -19585,13 +19585,13 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b pm_do_loop_stack_push(parser, false); statements = (pm_node_t *) pm_statements_node_create(parser); - // In endless method bodies, we need to handle command calls carefully. - // We want to allow command calls in assignment context but maintain - // the same binding power to avoid changing how operators are parsed. - // Note that we're intentionally NOT allowing code like `private def foo = puts "Hello"` - // because the original parser, parse.y, can't handle it and we want to maintain the same behavior - bool allow_command_call = (binding_power == PM_BINDING_POWER_ASSIGNMENT) || - (binding_power < PM_BINDING_POWER_COMPOSITION); + bool allow_command_call; + if (parser->version >= PM_OPTIONS_VERSION_CRUBY_3_5) { + allow_command_call = accepts_command_call; + } else { + // Allow `def foo = puts "Hello"` but not `private def foo = puts "Hello"` + allow_command_call = binding_power == PM_BINDING_POWER_ASSIGNMENT || binding_power < PM_BINDING_POWER_COMPOSITION; + } pm_node_t *statement = parse_expression(parser, PM_BINDING_POWER_DEFINED + 1, allow_command_call, false, PM_ERR_DEF_ENDLESS, (uint16_t) (depth + 1)); diff --git a/test/prism/errors/endless_method_command_call.txt b/test/prism/errors/endless_method_command_call.txt new file mode 100644 index 0000000000..e6a328c294 --- /dev/null +++ b/test/prism/errors/endless_method_command_call.txt @@ -0,0 +1,3 @@ +private :m, def hello = puts "Hello" + ^ unexpected string literal, expecting end-of-input + diff --git a/test/prism/errors/private_endless_method.txt b/test/prism/errors/private_endless_method.txt deleted file mode 100644 index 8aae5e0cd3..0000000000 --- a/test/prism/errors/private_endless_method.txt +++ /dev/null @@ -1,3 +0,0 @@ -private def foo = puts "Hello" - ^ unexpected string literal, expecting end-of-input - diff --git a/test/prism/errors_test.rb b/test/prism/errors_test.rb index 62bbd8458b..9dd4aea728 100644 --- a/test/prism/errors_test.rb +++ b/test/prism/errors_test.rb @@ -100,6 +100,15 @@ def foo(bar: bar) = 42 end end + def test_private_endless_method + source = <<~RUBY + private def foo = puts "Hello" + RUBY + + assert_predicate Prism.parse(source, version: "3.4"), :failure? + assert_predicate Prism.parse(source), :success? + end + private def assert_errors(filepath) diff --git a/test/prism/fixtures/endless_methods_command_call.txt b/test/prism/fixtures/endless_methods_command_call.txt new file mode 100644 index 0000000000..91a9d156d5 --- /dev/null +++ b/test/prism/fixtures/endless_methods_command_call.txt @@ -0,0 +1,8 @@ +private def foo = puts "Hello" +private def foo = puts "Hello", "World" +private def foo = puts "Hello" do expr end +private def foo() = puts "Hello" +private def foo(x) = puts x +private def obj.foo = puts "Hello" +private def obj.foo() = puts "Hello" +private def obj.foo(x) = puts x diff --git a/test/prism/fixtures_test.rb b/test/prism/fixtures_test.rb index 124a834317..b4b656fcf4 100644 --- a/test/prism/fixtures_test.rb +++ b/test/prism/fixtures_test.rb @@ -8,7 +8,6 @@ module Prism class FixturesTest < TestCase except = [] - if RUBY_VERSION < "3.3.0" # Ruby < 3.3.0 cannot parse heredocs where there are leading whitespace # characters in the heredoc start. @@ -25,7 +24,9 @@ class FixturesTest < TestCase except << "whitequark/ruby_bug_19281.txt" end - except << "leading_logical.txt" if RUBY_VERSION < "3.5.0" + # Leaving these out until they are supported by parse.y. + except << "leading_logical.txt" + except << "endless_methods_command_call.txt" Fixture.each(except: except) do |fixture| define_method(fixture.test_name) { assert_valid_syntax(fixture.read) } diff --git a/test/prism/lex_test.rb b/test/prism/lex_test.rb index abce18a0ad..4eacbab3e1 100644 --- a/test/prism/lex_test.rb +++ b/test/prism/lex_test.rb @@ -45,6 +45,9 @@ class LexTest < TestCase # https://bugs.ruby-lang.org/issues/20925 except << "leading_logical.txt" + # https://bugs.ruby-lang.org/issues/17398#note-12 + except << "endless_methods_command_call.txt" + Fixture.each(except: except) do |fixture| define_method(fixture.test_name) { assert_lex(fixture) } end diff --git a/test/prism/locals_test.rb b/test/prism/locals_test.rb index e0e9a45855..950e7118af 100644 --- a/test/prism/locals_test.rb +++ b/test/prism/locals_test.rb @@ -29,7 +29,11 @@ class LocalsTest < TestCase except = [ # Skip this fixture because it has a different number of locals because # CRuby is eliminating dead code. - "whitequark/ruby_bug_10653.txt" + "whitequark/ruby_bug_10653.txt", + + # Leaving these out until they are supported by parse.y. + "leading_logical.txt", + "endless_methods_command_call.txt" ] Fixture.each(except: except) do |fixture| diff --git a/test/prism/ruby/parser_test.rb b/test/prism/ruby/parser_test.rb index 129c38a3b5..98740f0973 100644 --- a/test/prism/ruby/parser_test.rb +++ b/test/prism/ruby/parser_test.rb @@ -67,6 +67,9 @@ class ParserTest < TestCase # Cannot yet handling leading logical operators. "leading_logical.txt", + + # Ruby >= 3.5 specific syntax + "endless_methods_command_call.txt", ] # These files contain code that is being parsed incorrectly by the parser diff --git a/test/prism/ruby/ripper_test.rb b/test/prism/ruby/ripper_test.rb index 6372024878..39325137ba 100644 --- a/test/prism/ruby/ripper_test.rb +++ b/test/prism/ruby/ripper_test.rb @@ -29,7 +29,10 @@ class RipperTest < TestCase "whitequark/lvar_injecting_match.txt", # Ripper fails to understand some structures that span across heredocs. - "spanning_heredoc.txt" + "spanning_heredoc.txt", + + # https://bugs.ruby-lang.org/issues/17398#note-12 + "endless_methods_command_call.txt", ] # Skip these tests that we haven't implemented yet. diff --git a/test/prism/ruby/ruby_parser_test.rb b/test/prism/ruby/ruby_parser_test.rb index f4f0f331fb..bcaed79791 100644 --- a/test/prism/ruby/ruby_parser_test.rb +++ b/test/prism/ruby/ruby_parser_test.rb @@ -74,7 +74,10 @@ class RubyParserTest < TestCase "whitequark/ruby_bug_11989.txt", "whitequark/ruby_bug_18878.txt", "whitequark/ruby_bug_19281.txt", - "whitequark/slash_newline_in_heredocs.txt" + "whitequark/slash_newline_in_heredocs.txt", + + # Ruby >= 3.5 specific syntax + "endless_methods_command_call.txt", ] Fixture.each(except: failures) do |fixture| From d2d9a1f1a70cb13c9ec89bbf1cf05a20cd939e3a Mon Sep 17 00:00:00 2001 From: Alexander Momchilov Date: Fri, 30 Aug 2024 15:02:01 -0400 Subject: [PATCH 123/333] Add links to code refs in docs --- include/prism.h | 20 ++++++++++---------- include/prism/util/pm_string.h | 4 ++-- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/include/prism.h b/include/prism.h index 11e854eb35..555bda0851 100644 --- a/include/prism.h +++ b/include/prism.h @@ -322,10 +322,10 @@ PRISM_EXPORTED_FUNCTION pm_string_query_t pm_string_query_method_name(const uint * to want to use and be aware of are: * * * `pm_parser_t` - the main parser structure - * * `pm_parser_init` - initialize a parser - * * `pm_parse` - parse and return the root node - * * `pm_node_destroy` - deallocate the root node returned by `pm_parse` - * * `pm_parser_free` - free the internal memory of the parser + * * `pm_parser_init()` - initialize a parser + * * `pm_parse()` - parse and return the root node + * * `pm_node_destroy()` - deallocate the root node returned by `pm_parse()` + * * `pm_parser_free()` - free the internal memory of the parser * * Putting all of this together would look something like: * @@ -342,8 +342,8 @@ PRISM_EXPORTED_FUNCTION pm_string_query_t pm_string_query_method_name(const uint * } * ``` * - * All of the nodes "inherit" from `pm_node_t` by embedding those structures as - * their first member. This means you can downcast and upcast any node in the + * All of the nodes "inherit" from `pm_node_t` by embedding those structures + * as their first member. This means you can downcast and upcast any node in the * tree to a `pm_node_t`. * * @section serializing Serializing @@ -355,9 +355,9 @@ PRISM_EXPORTED_FUNCTION pm_string_query_t pm_string_query_method_name(const uint * use and be aware of are: * * * `pm_buffer_t` - a small buffer object that will hold the serialized AST - * * `pm_buffer_free` - free the memory associated with the buffer - * * `pm_serialize` - serialize the AST into a buffer - * * `pm_serialize_parse` - parse and serialize the AST into a buffer + * * `pm_buffer_free()` - free the memory associated with the buffer + * * `pm_serialize()` - serialize the AST into a buffer + * * `pm_serialize_parse()` - parse and serialize the AST into a buffer * * Putting all of this together would look something like: * @@ -375,7 +375,7 @@ PRISM_EXPORTED_FUNCTION pm_string_query_t pm_string_query_method_name(const uint * @section inspecting Inspecting * * Prism provides the ability to inspect the AST by pretty-printing nodes. You - * can do this with the `pm_prettyprint` function, which you would use like: + * can do this with the `pm_prettyprint()` function, which you would use like: * * ```c * void prettyprint(const uint8_t *source, size_t length) { diff --git a/include/prism/util/pm_string.h b/include/prism/util/pm_string.h index f99f1abdf3..ccf6648d26 100644 --- a/include/prism/util/pm_string.h +++ b/include/prism/util/pm_string.h @@ -45,11 +45,11 @@ typedef struct { /** This is a slice of another string, and should not be freed. */ PM_STRING_SHARED, - /** This string owns its memory, and should be freed using `pm_string_free`. */ + /** This string owns its memory, and should be freed using `pm_string_free()`. */ PM_STRING_OWNED, #ifdef PRISM_HAS_MMAP - /** This string is a memory-mapped file, and should be freed using `pm_string_free`. */ + /** This string is a memory-mapped file, and should be freed using `pm_string_free()`. */ PM_STRING_MAPPED #endif } type; From d1d216121974a2fe80f60e80b01a8d2dcb389dd3 Mon Sep 17 00:00:00 2001 From: Alexander Momchilov Date: Fri, 30 Aug 2024 16:11:50 -0400 Subject: [PATCH 124/333] Add `\memberof` annotations --- include/prism.h | 12 +++++++++++- include/prism/options.h | 34 +++++++++++++++++++++++++++++++++ include/prism/regexp.h | 4 ++-- include/prism/util/pm_buffer.h | 8 ++++++++ include/prism/util/pm_integer.h | 4 ++++ include/prism/util/pm_list.h | 6 ++++++ include/prism/util/pm_string.h | 10 ++++++++++ 7 files changed, 75 insertions(+), 3 deletions(-) diff --git a/include/prism.h b/include/prism.h index 555bda0851..dc31f26e78 100644 --- a/include/prism.h +++ b/include/prism.h @@ -56,6 +56,8 @@ PRISM_EXPORTED_FUNCTION const char * pm_version(void); * @param size The size of the source. * @param options The optional options to use when parsing. These options must * live for the whole lifetime of this parser. + * + * \public \memberof pm_parser */ PRISM_EXPORTED_FUNCTION void pm_parser_init(pm_parser_t *parser, const uint8_t *source, size_t size, const pm_options_t *options); @@ -65,6 +67,8 @@ PRISM_EXPORTED_FUNCTION void pm_parser_init(pm_parser_t *parser, const uint8_t * * * @param parser The parser to register the callback with. * @param callback The callback to register. + * + * \public \memberof pm_parser */ PRISM_EXPORTED_FUNCTION void pm_parser_register_encoding_changed_callback(pm_parser_t *parser, pm_encoding_changed_callback_t callback); @@ -75,6 +79,8 @@ PRISM_EXPORTED_FUNCTION void pm_parser_register_encoding_changed_callback(pm_par * parser. * * @param parser The parser to free. + * + * \public \memberof pm_parser */ PRISM_EXPORTED_FUNCTION void pm_parser_free(pm_parser_t *parser); @@ -83,11 +89,13 @@ PRISM_EXPORTED_FUNCTION void pm_parser_free(pm_parser_t *parser); * * @param parser The parser to use. * @return The AST representing the source. + * + * \public \memberof pm_parser */ PRISM_EXPORTED_FUNCTION pm_node_t * pm_parse(pm_parser_t *parser); /** - * This function is used in pm_parse_stream to retrieve a line of input from a + * This function is used in pm_parse_stream() to retrieve a line of input from a * stream. It closely mirrors that of fgets so that fgets can be used as the * default implementation. */ @@ -110,6 +118,8 @@ typedef int (pm_parse_stream_feof_t)(void *stream); * @param stream_feof The function to use to determine if the stream has hit eof. * @param options The optional options to use when parsing. * @return The AST representing the source. + * + * \public \memberof pm_parser */ PRISM_EXPORTED_FUNCTION pm_node_t * pm_parse_stream(pm_parser_t *parser, pm_buffer_t *buffer, void *stream, pm_parse_stream_fgets_t *stream_fgets, pm_parse_stream_feof_t *stream_feof, const pm_options_t *options); diff --git a/include/prism/options.h b/include/prism/options.h index 092fda4f07..1a92c470f1 100644 --- a/include/prism/options.h +++ b/include/prism/options.h @@ -237,6 +237,8 @@ static const uint8_t PM_OPTIONS_COMMAND_LINE_X = 0x20; * @param shebang_callback The shebang callback to set. * @param shebang_callback_data Any additional data that should be passed along * to the callback. + * + * \public \memberof pm_options */ PRISM_EXPORTED_FUNCTION void pm_options_shebang_callback_set(pm_options_t *options, pm_options_shebang_callback_t shebang_callback, void *shebang_callback_data); @@ -245,6 +247,8 @@ PRISM_EXPORTED_FUNCTION void pm_options_shebang_callback_set(pm_options_t *optio * * @param options The options struct to set the filepath on. * @param filepath The filepath to set. + * + * \public \memberof pm_options */ PRISM_EXPORTED_FUNCTION void pm_options_filepath_set(pm_options_t *options, const char *filepath); @@ -253,6 +257,8 @@ PRISM_EXPORTED_FUNCTION void pm_options_filepath_set(pm_options_t *options, cons * * @param options The options struct to set the line on. * @param line The line to set. + * + * \public \memberof pm_options */ PRISM_EXPORTED_FUNCTION void pm_options_line_set(pm_options_t *options, int32_t line); @@ -261,6 +267,8 @@ PRISM_EXPORTED_FUNCTION void pm_options_line_set(pm_options_t *options, int32_t * * @param options The options struct to set the encoding on. * @param encoding The encoding to set. + * + * \public \memberof pm_options */ PRISM_EXPORTED_FUNCTION void pm_options_encoding_set(pm_options_t *options, const char *encoding); @@ -269,6 +277,8 @@ PRISM_EXPORTED_FUNCTION void pm_options_encoding_set(pm_options_t *options, cons * * @param options The options struct to set the encoding_locked value on. * @param encoding_locked The encoding_locked value to set. + * + * \public \memberof pm_options */ PRISM_EXPORTED_FUNCTION void pm_options_encoding_locked_set(pm_options_t *options, bool encoding_locked); @@ -277,6 +287,8 @@ PRISM_EXPORTED_FUNCTION void pm_options_encoding_locked_set(pm_options_t *option * * @param options The options struct to set the frozen string literal value on. * @param frozen_string_literal The frozen string literal value to set. + * + * \public \memberof pm_options */ PRISM_EXPORTED_FUNCTION void pm_options_frozen_string_literal_set(pm_options_t *options, bool frozen_string_literal); @@ -285,6 +297,8 @@ PRISM_EXPORTED_FUNCTION void pm_options_frozen_string_literal_set(pm_options_t * * * @param options The options struct to set the command line option on. * @param command_line The command_line value to set. + * + * \public \memberof pm_options */ PRISM_EXPORTED_FUNCTION void pm_options_command_line_set(pm_options_t *options, uint8_t command_line); @@ -297,6 +311,8 @@ PRISM_EXPORTED_FUNCTION void pm_options_command_line_set(pm_options_t *options, * @param version The version to set. * @param length The length of the version string. * @return Whether or not the version was parsed successfully. + * + * \public \memberof pm_options */ PRISM_EXPORTED_FUNCTION bool pm_options_version_set(pm_options_t *options, const char *version, size_t length); @@ -305,6 +321,8 @@ PRISM_EXPORTED_FUNCTION bool pm_options_version_set(pm_options_t *options, const * * @param options The options struct to set the main script value on. * @param main_script The main script value to set. + * + * \public \memberof pm_options */ PRISM_EXPORTED_FUNCTION void pm_options_main_script_set(pm_options_t *options, bool main_script); @@ -313,6 +331,8 @@ PRISM_EXPORTED_FUNCTION void pm_options_main_script_set(pm_options_t *options, b * * @param options The options struct to set the partial script value on. * @param partial_script The partial script value to set. + * + * \public \memberof pm_options */ PRISM_EXPORTED_FUNCTION void pm_options_partial_script_set(pm_options_t *options, bool partial_script); @@ -321,6 +341,8 @@ PRISM_EXPORTED_FUNCTION void pm_options_partial_script_set(pm_options_t *options * * @param options The options struct to set the freeze value on. * @param freeze The freeze value to set. + * + * \public \memberof pm_options */ PRISM_EXPORTED_FUNCTION void pm_options_freeze_set(pm_options_t *options, bool freeze); @@ -330,6 +352,8 @@ PRISM_EXPORTED_FUNCTION void pm_options_freeze_set(pm_options_t *options, bool f * @param options The options struct to initialize the scopes array on. * @param scopes_count The number of scopes to allocate. * @return Whether or not the scopes array was initialized successfully. + * + * \public \memberof pm_options */ PRISM_EXPORTED_FUNCTION bool pm_options_scopes_init(pm_options_t *options, size_t scopes_count); @@ -339,6 +363,8 @@ PRISM_EXPORTED_FUNCTION bool pm_options_scopes_init(pm_options_t *options, size_ * @param options The options struct to get the scope from. * @param index The index of the scope to get. * @return A pointer to the scope at the given index. + * + * \public \memberof pm_options */ PRISM_EXPORTED_FUNCTION const pm_options_scope_t * pm_options_scope_get(const pm_options_t *options, size_t index); @@ -349,6 +375,8 @@ PRISM_EXPORTED_FUNCTION const pm_options_scope_t * pm_options_scope_get(const pm * @param scope The scope struct to initialize. * @param locals_count The number of locals to allocate. * @return Whether or not the scope was initialized successfully. + * + * \public \memberof pm_options */ PRISM_EXPORTED_FUNCTION bool pm_options_scope_init(pm_options_scope_t *scope, size_t locals_count); @@ -358,6 +386,8 @@ PRISM_EXPORTED_FUNCTION bool pm_options_scope_init(pm_options_scope_t *scope, si * @param scope The scope struct to get the local from. * @param index The index of the local to get. * @return A pointer to the local at the given index. + * + * \public \memberof pm_options */ PRISM_EXPORTED_FUNCTION const pm_string_t * pm_options_scope_local_get(const pm_options_scope_t *scope, size_t index); @@ -366,6 +396,8 @@ PRISM_EXPORTED_FUNCTION const pm_string_t * pm_options_scope_local_get(const pm_ * * @param scope The scope struct to set the forwarding on. * @param forwarding The forwarding value to set. + * + * \public \memberof pm_options */ PRISM_EXPORTED_FUNCTION void pm_options_scope_forwarding_set(pm_options_scope_t *scope, uint8_t forwarding); @@ -373,6 +405,8 @@ PRISM_EXPORTED_FUNCTION void pm_options_scope_forwarding_set(pm_options_scope_t * Free the internal memory associated with the options. * * @param options The options struct whose internal memory should be freed. + * + * \public \memberof pm_options */ PRISM_EXPORTED_FUNCTION void pm_options_free(pm_options_t *options); diff --git a/include/prism/regexp.h b/include/prism/regexp.h index c0b3163e93..5366b5a5a0 100644 --- a/include/prism/regexp.h +++ b/include/prism/regexp.h @@ -17,12 +17,12 @@ #include /** - * This callback is called when a named capture group is found. + * This callback is called by pm_regexp_parse() when a named capture group is found. */ typedef void (*pm_regexp_name_callback_t)(const pm_string_t *name, void *data); /** - * This callback is called when a parse error is found. + * This callback is called by pm_regexp_parse() when a parse error is found. */ typedef void (*pm_regexp_error_callback_t)(const uint8_t *start, const uint8_t *end, const char *message, void *data); diff --git a/include/prism/util/pm_buffer.h b/include/prism/util/pm_buffer.h index f3c20ab2a5..cb80f8b3ce 100644 --- a/include/prism/util/pm_buffer.h +++ b/include/prism/util/pm_buffer.h @@ -51,6 +51,8 @@ bool pm_buffer_init_capacity(pm_buffer_t *buffer, size_t capacity); * * @param buffer The buffer to initialize. * @returns True if the buffer was initialized successfully, false otherwise. + * + * \public \memberof pm_buffer_t */ PRISM_EXPORTED_FUNCTION bool pm_buffer_init(pm_buffer_t *buffer); @@ -59,6 +61,8 @@ PRISM_EXPORTED_FUNCTION bool pm_buffer_init(pm_buffer_t *buffer); * * @param buffer The buffer to get the value of. * @returns The value of the buffer. + * + * \public \memberof pm_buffer_t */ PRISM_EXPORTED_FUNCTION char * pm_buffer_value(const pm_buffer_t *buffer); @@ -67,6 +71,8 @@ PRISM_EXPORTED_FUNCTION char * pm_buffer_value(const pm_buffer_t *buffer); * * @param buffer The buffer to get the length of. * @returns The length of the buffer. + * + * \public \memberof pm_buffer_t */ PRISM_EXPORTED_FUNCTION size_t pm_buffer_length(const pm_buffer_t *buffer); @@ -222,6 +228,8 @@ void pm_buffer_insert(pm_buffer_t *buffer, size_t index, const char *value, size * Free the memory associated with the buffer. * * @param buffer The buffer to free. + * + * \public \memberof pm_buffer_t */ PRISM_EXPORTED_FUNCTION void pm_buffer_free(pm_buffer_t *buffer); diff --git a/include/prism/util/pm_integer.h b/include/prism/util/pm_integer.h index a9e2966703..304665e620 100644 --- a/include/prism/util/pm_integer.h +++ b/include/prism/util/pm_integer.h @@ -112,6 +112,8 @@ void pm_integers_reduce(pm_integer_t *numerator, pm_integer_t *denominator); * * @param buffer The buffer to append the string to. * @param integer The integer to convert to a string. + * + * \public \memberof pm_integer_t */ PRISM_EXPORTED_FUNCTION void pm_integer_string(pm_buffer_t *buffer, const pm_integer_t *integer); @@ -120,6 +122,8 @@ PRISM_EXPORTED_FUNCTION void pm_integer_string(pm_buffer_t *buffer, const pm_int * the integer exceeds the size of a single node in the linked list. * * @param integer The integer to free. + * + * \public \memberof pm_integer_t */ PRISM_EXPORTED_FUNCTION void pm_integer_free(pm_integer_t *integer); diff --git a/include/prism/util/pm_list.h b/include/prism/util/pm_list.h index 3512dee979..f544bb2943 100644 --- a/include/prism/util/pm_list.h +++ b/include/prism/util/pm_list.h @@ -68,6 +68,8 @@ typedef struct { * * @param list The list to check. * @return True if the given list is empty, otherwise false. + * + * \public \memberof pm_list_t */ PRISM_EXPORTED_FUNCTION bool pm_list_empty_p(pm_list_t *list); @@ -76,6 +78,8 @@ PRISM_EXPORTED_FUNCTION bool pm_list_empty_p(pm_list_t *list); * * @param list The list to check. * @return The size of the list. + * + * \public \memberof pm_list_t */ PRISM_EXPORTED_FUNCTION size_t pm_list_size(pm_list_t *list); @@ -91,6 +95,8 @@ void pm_list_append(pm_list_t *list, pm_list_node_t *node); * Deallocate the internal state of the given list. * * @param list The list to free. + * + * \public \memberof pm_list_t */ PRISM_EXPORTED_FUNCTION void pm_list_free(pm_list_t *list); diff --git a/include/prism/util/pm_string.h b/include/prism/util/pm_string.h index ccf6648d26..d8456ff294 100644 --- a/include/prism/util/pm_string.h +++ b/include/prism/util/pm_string.h @@ -130,6 +130,8 @@ typedef enum { * @param string The string to initialize. * @param filepath The filepath to read. * @return The success of the read, indicated by the value of the enum. + * + * \public \memberof pm_string_t */ PRISM_EXPORTED_FUNCTION pm_string_init_result_t pm_string_mapped_init(pm_string_t *string, const char *filepath); @@ -141,6 +143,8 @@ PRISM_EXPORTED_FUNCTION pm_string_init_result_t pm_string_mapped_init(pm_string_ * @param string The string to initialize. * @param filepath The filepath to read. * @return The success of the read, indicated by the value of the enum. + * + * \public \memberof pm_string_t */ PRISM_EXPORTED_FUNCTION pm_string_init_result_t pm_string_file_init(pm_string_t *string, const char *filepath); @@ -169,6 +173,8 @@ int pm_string_compare(const pm_string_t *left, const pm_string_t *right); * * @param string The string to get the length of. * @return The length of the string. + * + * \public \memberof pm_string_t */ PRISM_EXPORTED_FUNCTION size_t pm_string_length(const pm_string_t *string); @@ -177,6 +183,8 @@ PRISM_EXPORTED_FUNCTION size_t pm_string_length(const pm_string_t *string); * * @param string The string to get the start pointer of. * @return The start pointer of the string. + * + * \public \memberof pm_string_t */ PRISM_EXPORTED_FUNCTION const uint8_t * pm_string_source(const pm_string_t *string); @@ -184,6 +192,8 @@ PRISM_EXPORTED_FUNCTION const uint8_t * pm_string_source(const pm_string_t *stri * Free the associated memory of the given string. * * @param string The string to free. + * + * \public \memberof pm_string_t */ PRISM_EXPORTED_FUNCTION void pm_string_free(pm_string_t *string); From 194edab827b797c0c19e900681dbcd72351ede4f Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Fri, 12 Sep 2025 15:19:19 -0400 Subject: [PATCH 125/333] Bump to v1.5.0 --- CHANGELOG.md | 24 ++++++++++++++++++++- 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/3.5/Gemfile.lock | 2 +- gemfiles/jruby/Gemfile.lock | 2 +- gemfiles/truffleruby/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 +- 22 files changed, 47 insertions(+), 25 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index aa17d500bb..70fcead8d9 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.5.0] - 2025-09-12 + +### Added + +- Add `Prism::Translation::ParserCurrent`. +- Add `Integer::to_u32_digits` for the Rust API. +- Add `pm_comment_type_t` field for the Rust API. +- Support leading logical operators for CRuby 3.5+. + +### Changed + +- Mark Prism as ractor-safe. +- Enforce a minimum version for the parser translation layer. +- Many fixes to the parser translation layer. +- Accept a newline after the `defined?` keyword. +- Reject `true && not true`. +- Make `it = it` assign nil to match parse.y behavior [Bug #21139]. +- Some fixes to the ruby parser translation layer. +- Ensure call nodes have the correct ending location. +- Reject `foo && return bar`. + ## [1.4.0] - 2025-03-18 ### Added @@ -649,7 +670,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.4.0...HEAD +[unreleased]: https://github.com/ruby/prism/compare/v1.5.0...HEAD +[1.5.0]: https://github.com/ruby/prism/compare/v1.4.0...v1.5.0 [1.4.0]: https://github.com/ruby/prism/compare/v1.3.0...v1.4.0 [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 diff --git a/Gemfile.lock b/Gemfile.lock index d5f084d244..4279f2928b 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - prism (1.4.0) + prism (1.5.0) GEM remote: https://rubygems.org/ diff --git a/ext/prism/extension.h b/ext/prism/extension.h index 506da2fd6f..f4cb9c438d 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.4.0" +#define EXPECTED_PRISM_VERSION "1.5.0" #include #include diff --git a/gemfiles/2.7/Gemfile.lock b/gemfiles/2.7/Gemfile.lock index 4e0fad2836..dbca77fc1d 100644 --- a/gemfiles/2.7/Gemfile.lock +++ b/gemfiles/2.7/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: ../.. specs: - prism (1.4.0) + prism (1.5.0) GEM remote: https://rubygems.org/ diff --git a/gemfiles/3.0/Gemfile.lock b/gemfiles/3.0/Gemfile.lock index 4ab2703d8f..81e70a2ded 100644 --- a/gemfiles/3.0/Gemfile.lock +++ b/gemfiles/3.0/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: ../.. specs: - prism (1.4.0) + prism (1.5.0) GEM remote: https://rubygems.org/ diff --git a/gemfiles/3.1/Gemfile.lock b/gemfiles/3.1/Gemfile.lock index cfac077d43..138eef976e 100644 --- a/gemfiles/3.1/Gemfile.lock +++ b/gemfiles/3.1/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: ../.. specs: - prism (1.4.0) + prism (1.5.0) GEM remote: https://rubygems.org/ diff --git a/gemfiles/3.2/Gemfile.lock b/gemfiles/3.2/Gemfile.lock index 7426a7f177..9fb6602c60 100644 --- a/gemfiles/3.2/Gemfile.lock +++ b/gemfiles/3.2/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: ../.. specs: - prism (1.4.0) + prism (1.5.0) GEM remote: https://rubygems.org/ diff --git a/gemfiles/3.3/Gemfile.lock b/gemfiles/3.3/Gemfile.lock index 2bff716955..5e04141827 100644 --- a/gemfiles/3.3/Gemfile.lock +++ b/gemfiles/3.3/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: ../.. specs: - prism (1.4.0) + prism (1.5.0) GEM remote: https://rubygems.org/ diff --git a/gemfiles/3.4/Gemfile.lock b/gemfiles/3.4/Gemfile.lock index d44f56683c..4092a91ae1 100644 --- a/gemfiles/3.4/Gemfile.lock +++ b/gemfiles/3.4/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: ../.. specs: - prism (1.4.0) + prism (1.5.0) GEM remote: https://rubygems.org/ diff --git a/gemfiles/3.5/Gemfile.lock b/gemfiles/3.5/Gemfile.lock index 7644ef668a..88f55dad89 100644 --- a/gemfiles/3.5/Gemfile.lock +++ b/gemfiles/3.5/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: ../.. specs: - prism (1.4.0) + prism (1.5.0) GEM remote: https://rubygems.org/ diff --git a/gemfiles/jruby/Gemfile.lock b/gemfiles/jruby/Gemfile.lock index dc74ae64f5..8015a5ab54 100644 --- a/gemfiles/jruby/Gemfile.lock +++ b/gemfiles/jruby/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: ../.. specs: - prism (1.4.0) + prism (1.5.0) GEM remote: https://rubygems.org/ diff --git a/gemfiles/truffleruby/Gemfile.lock b/gemfiles/truffleruby/Gemfile.lock index b46b447775..de5b39c52d 100644 --- a/gemfiles/truffleruby/Gemfile.lock +++ b/gemfiles/truffleruby/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: ../.. specs: - prism (1.4.0) + prism (1.5.0) GEM remote: https://rubygems.org/ diff --git a/include/prism/version.h b/include/prism/version.h index 0a2a8c8fce..697c7b5ad6 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 4 +#define PRISM_VERSION_MINOR 5 /** * 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.4.0" +#define PRISM_VERSION "1.5.0" #endif diff --git a/javascript/package.json b/javascript/package.json index 75c1e78468..5db7c6f312 100644 --- a/javascript/package.json +++ b/javascript/package.json @@ -1,6 +1,6 @@ { "name": "@ruby/prism", - "version": "1.4.0", + "version": "1.5.0", "description": "Prism Ruby parser", "type": "module", "main": "src/index.js", diff --git a/prism.gemspec b/prism.gemspec index 4daa511300..74b9971a00 100644 --- a/prism.gemspec +++ b/prism.gemspec @@ -2,7 +2,7 @@ Gem::Specification.new do |spec| spec.name = "prism" - spec.version = "1.4.0" + spec.version = "1.5.0" spec.authors = ["Shopify"] spec.email = ["ruby@shopify.com"] diff --git a/rust/Cargo.lock b/rust/Cargo.lock index e51c0878e9..91caea4e74 100644 --- a/rust/Cargo.lock +++ b/rust/Cargo.lock @@ -224,7 +224,7 @@ checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" [[package]] name = "ruby-prism" -version = "1.4.0" +version = "1.5.0" dependencies = [ "ruby-prism-sys", "serde", @@ -233,7 +233,7 @@ dependencies = [ [[package]] name = "ruby-prism-sys" -version = "1.4.0" +version = "1.5.0" dependencies = [ "bindgen", "cc", diff --git a/rust/ruby-prism-sys/Cargo.toml b/rust/ruby-prism-sys/Cargo.toml index ae76e11a7e..371e6613ad 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.4.0" +version = "1.5.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 8ab12d620c..f25e4cbae5 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.4.0"); + assert_eq!(&cstring.to_string_lossy(), "1.5.0"); } #[test] diff --git a/rust/ruby-prism/Cargo.toml b/rust/ruby-prism/Cargo.toml index 4ef5d0f4b1..3c20917f4a 100644 --- a/rust/ruby-prism/Cargo.toml +++ b/rust/ruby-prism/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ruby-prism" -version = "1.4.0" +version = "1.5.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.4.0", path = "../ruby-prism-sys" } +ruby-prism-sys = { version = "1.5.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 629c8bbb8c..3109feba18 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) 4, "prism minor version does not match"); + expect((byte) 5, "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 643dd0dab5..1559dfa2e3 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 = 4; +const MINOR_VERSION = 5; 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 104b60f484..a5909e15bb 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 = 4 + MINOR_VERSION = 5 # The patch version of prism that we are expecting to find in the serialized # strings. From f117ec635463dfd9bba39f8f9718497f2c796da6 Mon Sep 17 00:00:00 2001 From: Takashi Kokubun Date: Fri, 12 Sep 2025 14:30:48 -0700 Subject: [PATCH 126/333] Revert "Merge pull request #3606 from tenderlove/clear-flags" This reverts commit 4052d93cf852989b07d2f5433aaf85cf775de093, reversing changes made to 47143d17b3f77a60afd97dd0e112fd8969726227. --- snapshots/dos_endings.txt | 4 ++-- snapshots/dstring.txt | 2 +- snapshots/heredocs_leading_whitespace.txt | 4 ++-- snapshots/heredocs_nested.txt | 2 +- snapshots/heredocs_with_fake_newlines.txt | 2 +- snapshots/heredocs_with_ignored_newlines.txt | 2 +- snapshots/seattlerb/difficult0_.txt | 2 +- snapshots/seattlerb/dstr_str.txt | 2 +- snapshots/seattlerb/heredoc_nested.txt | 4 ++-- snapshots/seattlerb/heredoc_squiggly.txt | 2 +- .../heredoc_squiggly_blank_lines.txt | 2 +- snapshots/seattlerb/heredoc_squiggly_tabs.txt | 2 +- .../seattlerb/heredoc_squiggly_tabs_extra.txt | 2 +- .../heredoc_squiggly_visually_blank_lines.txt | 2 +- .../str_lit_concat_bad_encodings.txt | 2 +- snapshots/seattlerb/str_str.txt | 2 +- snapshots/seattlerb/str_str_str.txt | 2 +- snapshots/spanning_heredoc.txt | 10 +++++----- snapshots/strings.txt | 2 +- snapshots/tilde_heredocs.txt | 20 +++++++++---------- snapshots/unparser/corpus/literal/literal.txt | 2 +- snapshots/unparser/corpus/semantic/dstr.txt | 4 ++-- snapshots/whitequark/dedenting_heredoc.txt | 20 +++++++++---------- ...olating_heredoc_fake_line_continuation.txt | 2 +- ...nterpolating_heredoc_line_continuation.txt | 2 +- snapshots/whitequark/parser_bug_640.txt | 2 +- snapshots/whitequark/ruby_bug_11990.txt | 2 +- .../whitequark/slash_newline_in_heredocs.txt | 2 +- src/prism.c | 4 ---- test/prism/result/static_literals_test.rb | 5 ----- 30 files changed, 54 insertions(+), 63 deletions(-) diff --git a/snapshots/dos_endings.txt b/snapshots/dos_endings.txt index 6ddb8b0a93..69d6b7cd7e 100644 --- a/snapshots/dos_endings.txt +++ b/snapshots/dos_endings.txt @@ -17,7 +17,7 @@ │ │ ├── flags: ∅ │ │ └── arguments: (length: 1) │ │ └── @ InterpolatedStringNode (location: (1,5)-(2,12)) - │ │ ├── flags: ∅ + │ │ ├── flags: static_literal │ │ ├── opening_loc: ∅ │ │ ├── parts: (length: 2) │ │ │ ├── @ StringNode (location: (1,5)-(1,9)) @@ -86,7 +86,7 @@ │ │ ├── flags: ∅ │ │ ├── receiver: │ │ │ @ InterpolatedStringNode (location: (17,8)-(17,14)) - │ │ │ ├── flags: ∅ + │ │ │ ├── flags: static_literal │ │ │ ├── opening_loc: (17,8)-(17,14) = "<<~EOF" │ │ │ ├── parts: (length: 2) │ │ │ │ ├── @ StringNode (location: (18,0)-(19,0)) diff --git a/snapshots/dstring.txt b/snapshots/dstring.txt index c136860fc4..7913cd010d 100644 --- a/snapshots/dstring.txt +++ b/snapshots/dstring.txt @@ -41,7 +41,7 @@ │ │ └── closing_loc: (5,7)-(5,8) = "}" │ └── closing_loc: (5,8)-(5,9) = "\"" ├── @ InterpolatedStringNode (location: (7,0)-(9,2)) - │ ├── flags: newline + │ ├── flags: newline, static_literal │ ├── opening_loc: ∅ │ ├── parts: (length: 2) │ │ ├── @ StringNode (location: (7,0)-(8,2)) diff --git a/snapshots/heredocs_leading_whitespace.txt b/snapshots/heredocs_leading_whitespace.txt index 0594f1c5dd..6101cd02d3 100644 --- a/snapshots/heredocs_leading_whitespace.txt +++ b/snapshots/heredocs_leading_whitespace.txt @@ -30,7 +30,7 @@ │ ├── closing_loc: (19,0)-(20,0) = " FOO\n" │ └── unescaped: "a\nb\n" ├── @ InterpolatedStringNode (location: (21,0)-(21,10)) - │ ├── flags: newline + │ ├── flags: newline, static_literal │ ├── opening_loc: (21,0)-(21,10) = "<<~' FOO'" │ ├── parts: (length: 2) │ │ ├── @ StringNode (location: (22,0)-(23,0)) @@ -47,7 +47,7 @@ │ │ └── unescaped: "b\n" │ └── closing_loc: (24,0)-(25,0) = " FOO\n" └── @ InterpolatedStringNode (location: (26,0)-(26,10)) - ├── flags: newline + ├── flags: newline, static_literal ├── opening_loc: (26,0)-(26,10) = "<<~' FOO'" ├── parts: (length: 2) │ ├── @ StringNode (location: (27,0)-(28,0)) diff --git a/snapshots/heredocs_nested.txt b/snapshots/heredocs_nested.txt index c2d13e4bdb..08576915dc 100644 --- a/snapshots/heredocs_nested.txt +++ b/snapshots/heredocs_nested.txt @@ -6,7 +6,7 @@ ├── flags: ∅ └── body: (length: 2) ├── @ InterpolatedStringNode (location: (1,0)-(1,7)) - │ ├── flags: newline + │ ├── flags: newline, static_literal, mutable │ ├── opening_loc: (1,0)-(1,7) = "<<~RUBY" │ ├── parts: (length: 4) │ │ ├── @ StringNode (location: (2,0)-(3,0)) diff --git a/snapshots/heredocs_with_fake_newlines.txt b/snapshots/heredocs_with_fake_newlines.txt index 46892adc3d..df59b29b94 100644 --- a/snapshots/heredocs_with_fake_newlines.txt +++ b/snapshots/heredocs_with_fake_newlines.txt @@ -12,7 +12,7 @@ │ ├── closing_loc: (13,0)-(14,0) = "RUBY\n" │ └── unescaped: " \n\n \n\n exit\n \\n\n \n\n\n\n\n argh\n \\\n \\ foo\nbar\n \f\n ok\n" ├── @ InterpolatedStringNode (location: (15,0)-(15,7)) - │ ├── flags: newline + │ ├── flags: newline, static_literal │ ├── opening_loc: (15,0)-(15,7) = "<<~RUBY" │ ├── parts: (length: 11) │ │ ├── @ StringNode (location: (16,0)-(17,0)) diff --git a/snapshots/heredocs_with_ignored_newlines.txt b/snapshots/heredocs_with_ignored_newlines.txt index 53b373fb3c..16675029e1 100644 --- a/snapshots/heredocs_with_ignored_newlines.txt +++ b/snapshots/heredocs_with_ignored_newlines.txt @@ -12,7 +12,7 @@ │ ├── closing_loc: (2,0)-(3,0) = "HERE\n" │ └── unescaped: "" └── @ InterpolatedStringNode (location: (4,0)-(4,8)) - ├── flags: newline + ├── flags: newline, static_literal ├── opening_loc: (4,0)-(4,8) = "<<~THERE" ├── parts: (length: 9) │ ├── @ StringNode (location: (5,0)-(6,0)) diff --git a/snapshots/seattlerb/difficult0_.txt b/snapshots/seattlerb/difficult0_.txt index da977bdc52..233440b101 100644 --- a/snapshots/seattlerb/difficult0_.txt +++ b/snapshots/seattlerb/difficult0_.txt @@ -37,7 +37,7 @@ │ │ │ ├── flags: ∅ │ │ │ └── arguments: (length: 1) │ │ │ └── @ InterpolatedStringNode (location: (1,9)-(4,4)) - │ │ │ ├── flags: ∅ + │ │ │ ├── flags: static_literal │ │ │ ├── opening_loc: (1,9)-(1,10) = "'" │ │ │ ├── parts: (length: 2) │ │ │ │ ├── @ StringNode (location: (1,10)-(2,0)) diff --git a/snapshots/seattlerb/dstr_str.txt b/snapshots/seattlerb/dstr_str.txt index adce0b18fe..7b3e0e36ad 100644 --- a/snapshots/seattlerb/dstr_str.txt +++ b/snapshots/seattlerb/dstr_str.txt @@ -6,7 +6,7 @@ ├── flags: ∅ └── body: (length: 1) └── @ InterpolatedStringNode (location: (1,0)-(1,10)) - ├── flags: newline + ├── flags: newline, static_literal, mutable ├── opening_loc: (1,0)-(1,1) = "\"" ├── parts: (length: 2) │ ├── @ EmbeddedStatementsNode (location: (1,1)-(1,7)) diff --git a/snapshots/seattlerb/heredoc_nested.txt b/snapshots/seattlerb/heredoc_nested.txt index 7e1a2ffb23..4820ef6d4d 100644 --- a/snapshots/seattlerb/heredoc_nested.txt +++ b/snapshots/seattlerb/heredoc_nested.txt @@ -6,10 +6,10 @@ ├── flags: ∅ └── body: (length: 1) └── @ ArrayNode (location: (1,0)-(7,2)) - ├── flags: newline + ├── flags: newline, static_literal ├── elements: (length: 2) │ ├── @ InterpolatedStringNode (location: (1,1)-(1,4)) - │ │ ├── flags: ∅ + │ │ ├── flags: static_literal, mutable │ │ ├── opening_loc: (1,1)-(1,4) = "<flags = (pm_node_flags_t) ((part->flags | PM_NODE_FLAG_STATIC_LITERAL | PM_STRING_FLAGS_FROZEN) & ~PM_STRING_FLAGS_MUTABLE); break; case PM_INTERPOLATED_STRING_NODE: diff --git a/test/prism/result/static_literals_test.rb b/test/prism/result/static_literals_test.rb index cc07027916..dcfc692897 100644 --- a/test/prism/result/static_literals_test.rb +++ b/test/prism/result/static_literals_test.rb @@ -4,11 +4,6 @@ module Prism class StaticLiteralsTest < TestCase - def test_concatenanted_string_literal_is_not_static - node = Prism.parse_statement("'a' 'b'") - refute_predicate node, :static_literal? - end - def test_static_literals assert_warning("1") assert_warning("0xA", "10", "10") From cac5118884ce28d43f746befc4ca3cfa79942459 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Sat, 13 Sep 2025 09:53:03 -0400 Subject: [PATCH 127/333] Bump to v1.5.1 --- CHANGELOG.md | 9 ++++++++- 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/3.5/Gemfile.lock | 2 +- gemfiles/jruby/Gemfile.lock | 2 +- gemfiles/truffleruby/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 +- 22 files changed, 32 insertions(+), 25 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 70fcead8d9..3f10fc259d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,12 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a ## [Unreleased] +## [1.5.1] - 2025-09-13 + +### Changed + +- Revert of a bug introduced with static literal flags on interpolated strings. + ## [1.5.0] - 2025-09-12 ### Added @@ -670,7 +676,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.5.0...HEAD +[unreleased]: https://github.com/ruby/prism/compare/v1.5.1...HEAD +[1.5.1]: https://github.com/ruby/prism/compare/v1.5.0...v1.5.1 [1.5.0]: https://github.com/ruby/prism/compare/v1.4.0...v1.5.0 [1.4.0]: https://github.com/ruby/prism/compare/v1.3.0...v1.4.0 [1.3.0]: https://github.com/ruby/prism/compare/v1.2.0...v1.3.0 diff --git a/Gemfile.lock b/Gemfile.lock index 4279f2928b..19d0fb4a86 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - prism (1.5.0) + prism (1.5.1) GEM remote: https://rubygems.org/ diff --git a/ext/prism/extension.h b/ext/prism/extension.h index f4cb9c438d..b18e770d92 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.5.0" +#define EXPECTED_PRISM_VERSION "1.5.1" #include #include diff --git a/gemfiles/2.7/Gemfile.lock b/gemfiles/2.7/Gemfile.lock index dbca77fc1d..738f47cc9c 100644 --- a/gemfiles/2.7/Gemfile.lock +++ b/gemfiles/2.7/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: ../.. specs: - prism (1.5.0) + prism (1.5.1) GEM remote: https://rubygems.org/ diff --git a/gemfiles/3.0/Gemfile.lock b/gemfiles/3.0/Gemfile.lock index 81e70a2ded..aa25f46c8b 100644 --- a/gemfiles/3.0/Gemfile.lock +++ b/gemfiles/3.0/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: ../.. specs: - prism (1.5.0) + prism (1.5.1) GEM remote: https://rubygems.org/ diff --git a/gemfiles/3.1/Gemfile.lock b/gemfiles/3.1/Gemfile.lock index 138eef976e..bf71c63817 100644 --- a/gemfiles/3.1/Gemfile.lock +++ b/gemfiles/3.1/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: ../.. specs: - prism (1.5.0) + prism (1.5.1) GEM remote: https://rubygems.org/ diff --git a/gemfiles/3.2/Gemfile.lock b/gemfiles/3.2/Gemfile.lock index 9fb6602c60..ed775841a9 100644 --- a/gemfiles/3.2/Gemfile.lock +++ b/gemfiles/3.2/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: ../.. specs: - prism (1.5.0) + prism (1.5.1) GEM remote: https://rubygems.org/ diff --git a/gemfiles/3.3/Gemfile.lock b/gemfiles/3.3/Gemfile.lock index 5e04141827..b076083b8f 100644 --- a/gemfiles/3.3/Gemfile.lock +++ b/gemfiles/3.3/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: ../.. specs: - prism (1.5.0) + prism (1.5.1) GEM remote: https://rubygems.org/ diff --git a/gemfiles/3.4/Gemfile.lock b/gemfiles/3.4/Gemfile.lock index 4092a91ae1..12fdf3a16e 100644 --- a/gemfiles/3.4/Gemfile.lock +++ b/gemfiles/3.4/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: ../.. specs: - prism (1.5.0) + prism (1.5.1) GEM remote: https://rubygems.org/ diff --git a/gemfiles/3.5/Gemfile.lock b/gemfiles/3.5/Gemfile.lock index 88f55dad89..0d57895538 100644 --- a/gemfiles/3.5/Gemfile.lock +++ b/gemfiles/3.5/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: ../.. specs: - prism (1.5.0) + prism (1.5.1) GEM remote: https://rubygems.org/ diff --git a/gemfiles/jruby/Gemfile.lock b/gemfiles/jruby/Gemfile.lock index 8015a5ab54..9835176bab 100644 --- a/gemfiles/jruby/Gemfile.lock +++ b/gemfiles/jruby/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: ../.. specs: - prism (1.5.0) + prism (1.5.1) GEM remote: https://rubygems.org/ diff --git a/gemfiles/truffleruby/Gemfile.lock b/gemfiles/truffleruby/Gemfile.lock index de5b39c52d..d43fab69db 100644 --- a/gemfiles/truffleruby/Gemfile.lock +++ b/gemfiles/truffleruby/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: ../.. specs: - prism (1.5.0) + prism (1.5.1) GEM remote: https://rubygems.org/ diff --git a/include/prism/version.h b/include/prism/version.h index 697c7b5ad6..697ba0647d 100644 --- a/include/prism/version.h +++ b/include/prism/version.h @@ -19,11 +19,11 @@ /** * The patch version of the Prism library as an int. */ -#define PRISM_VERSION_PATCH 0 +#define PRISM_VERSION_PATCH 1 /** * The version of the Prism library as a constant string. */ -#define PRISM_VERSION "1.5.0" +#define PRISM_VERSION "1.5.1" #endif diff --git a/javascript/package.json b/javascript/package.json index 5db7c6f312..be505af226 100644 --- a/javascript/package.json +++ b/javascript/package.json @@ -1,6 +1,6 @@ { "name": "@ruby/prism", - "version": "1.5.0", + "version": "1.5.1", "description": "Prism Ruby parser", "type": "module", "main": "src/index.js", diff --git a/prism.gemspec b/prism.gemspec index 74b9971a00..65305d0ec1 100644 --- a/prism.gemspec +++ b/prism.gemspec @@ -2,7 +2,7 @@ Gem::Specification.new do |spec| spec.name = "prism" - spec.version = "1.5.0" + spec.version = "1.5.1" spec.authors = ["Shopify"] spec.email = ["ruby@shopify.com"] diff --git a/rust/Cargo.lock b/rust/Cargo.lock index 91caea4e74..35f580e271 100644 --- a/rust/Cargo.lock +++ b/rust/Cargo.lock @@ -224,7 +224,7 @@ checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" [[package]] name = "ruby-prism" -version = "1.5.0" +version = "1.5.1" dependencies = [ "ruby-prism-sys", "serde", @@ -233,7 +233,7 @@ dependencies = [ [[package]] name = "ruby-prism-sys" -version = "1.5.0" +version = "1.5.1" dependencies = [ "bindgen", "cc", diff --git a/rust/ruby-prism-sys/Cargo.toml b/rust/ruby-prism-sys/Cargo.toml index 371e6613ad..b33261c657 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.5.0" +version = "1.5.1" 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 f25e4cbae5..06ca4f6247 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.5.0"); + assert_eq!(&cstring.to_string_lossy(), "1.5.1"); } #[test] diff --git a/rust/ruby-prism/Cargo.toml b/rust/ruby-prism/Cargo.toml index 3c20917f4a..9a5a84ece1 100644 --- a/rust/ruby-prism/Cargo.toml +++ b/rust/ruby-prism/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ruby-prism" -version = "1.5.0" +version = "1.5.1" 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.5.0", path = "../ruby-prism-sys" } +ruby-prism-sys = { version = "1.5.1", 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 3109feba18..0a069e784a 100644 --- a/templates/java/org/prism/Loader.java.erb +++ b/templates/java/org/prism/Loader.java.erb @@ -102,7 +102,7 @@ public class Loader { expect((byte) 1, "prism major version does not match"); expect((byte) 5, "prism minor version does not match"); - expect((byte) 0, "prism patch version does not match"); + expect((byte) 1, "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 1559dfa2e3..1f8b613a4f 100644 --- a/templates/javascript/src/deserialize.js.erb +++ b/templates/javascript/src/deserialize.js.erb @@ -2,7 +2,7 @@ import * as nodes from "./nodes.js"; const MAJOR_VERSION = 1; const MINOR_VERSION = 5; -const PATCH_VERSION = 0; +const PATCH_VERSION = 1; // The DataView getFloat64 function takes an optional second argument that // specifies whether the number is little-endian or big-endian. It does not diff --git a/templates/lib/prism/serialize.rb.erb b/templates/lib/prism/serialize.rb.erb index a5909e15bb..366878f709 100644 --- a/templates/lib/prism/serialize.rb.erb +++ b/templates/lib/prism/serialize.rb.erb @@ -14,7 +14,7 @@ module Prism # The patch version of prism that we are expecting to find in the serialized # strings. - PATCH_VERSION = 0 + PATCH_VERSION = 1 # Deserialize the dumped output from a request to parse or parse_file. # From 7285d1fbabc1f6ed33d0db85398f7349e51181ad Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Sat, 13 Sep 2025 10:09:09 -0400 Subject: [PATCH 128/333] Documentation for Prism::Translation::Parser Make it clear that it parses with the most recent version of Ruby syntax. --- lib/prism/translation/parser.rb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/prism/translation/parser.rb b/lib/prism/translation/parser.rb index a7888f77ec..1ad7a193c4 100644 --- a/lib/prism/translation/parser.rb +++ b/lib/prism/translation/parser.rb @@ -19,6 +19,13 @@ module Translation # whitequark/parser gem's syntax tree. It inherits from the base parser for # the parser gem, and overrides the parse* methods to parse with prism and # then translate. + # + # Note that this version of the parser always parses using the latest + # version of Ruby syntax supported by Prism. If you want specific version + # support, use one of the version-specific subclasses, such as + # `Prism::Translation::Parser34`. If you want to parse using the same + # version of Ruby syntax as the currently running version of Ruby, use + # `Prism::Translation::ParserCurrent`. class Parser < ::Parser::Base Diagnostic = ::Parser::Diagnostic # :nodoc: private_constant :Diagnostic @@ -77,7 +84,7 @@ def initialize(builder = Prism::Translation::Parser::Builder.new, parser: Prism) end def version # :nodoc: - 34 + 35 end # The default encoding for Ruby files is UTF-8. From 3496625346627af07ffe49504ee606a6db420039 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Sat, 13 Sep 2025 13:26:52 -0400 Subject: [PATCH 129/333] Bump deps for ruby 3.0 --- gemfiles/3.0/Gemfile.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gemfiles/3.0/Gemfile.lock b/gemfiles/3.0/Gemfile.lock index aa25f46c8b..cb4eb82cca 100644 --- a/gemfiles/3.0/Gemfile.lock +++ b/gemfiles/3.0/Gemfile.lock @@ -7,8 +7,8 @@ GEM remote: https://rubygems.org/ specs: ast (2.4.3) - logger (1.6.1) - mini_portile2 (2.8.8) + logger (1.7.0) + mini_portile2 (2.8.9) nokogiri (1.17.2) mini_portile2 (~> 2.8.2) racc (~> 1.4) From ad7de0c794f0c3215a8ed130c59ec6757af8d460 Mon Sep 17 00:00:00 2001 From: ParadoxV5 Date: Sat, 25 May 2024 14:22:21 -0600 Subject: [PATCH 130/333] Quiet `ar` with `ARFLAGS` rather than `> null` `ARFLAGS` is an implicit variable in GNU `make` (the `README` _specifies GNU_ `make`) and defaulted verbosely, so un-verbose-fy it is the more direct *and platform-agnostic* way to quiet `ar`. --- Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index afeb58ecd0..1c5d33ada0 100644 --- a/Makefile +++ b/Makefile @@ -15,6 +15,7 @@ CFLAGS := -g -O2 -std=c99 -Wall -Werror -Wextra -Wpedantic -Wundef -Wconversion JAVA_WASM_CFLAGS := -g -Oz -std=c99 -Wall -Werror -Wextra -Wpedantic -Wundef -Wconversion -Wno-missing-braces -fPIC -fvisibility=hidden -Wimplicit-fallthrough $(JAVA_WASM_CFLAGS) CC ?= cc AR ?= ar +ARFLAGS ?= -r$(V0:1=v) WASI_SDK_PATH := /opt/wasi-sdk MAKEDIRS ?= mkdir -p @@ -38,7 +39,7 @@ build/libprism.$(SOEXT): $(SHARED_OBJECTS) build/libprism.a: $(STATIC_OBJECTS) $(ECHO) "building $@ with $(AR)" - $(Q) $(AR) $(ARFLAGS) $@ $(STATIC_OBJECTS) $(Q1:0=>/dev/null) + $(Q) $(AR) $(ARFLAGS) $@ $(STATIC_OBJECTS) javascript/src/prism.wasm: Makefile $(SOURCES) $(HEADERS) $(ECHO) "building $@" From d7a70552ac2dce533af802e9eace565cfe6513a8 Mon Sep 17 00:00:00 2001 From: Earlopain <14981592+Earlopain@users.noreply.github.com> Date: Sun, 14 Sep 2025 11:40:46 +0200 Subject: [PATCH 131/333] Add `ruby_parser` to version-specific gemfiles It is only tested on ruby head at the moment --- gemfiles/2.7/Gemfile | 1 + gemfiles/2.7/Gemfile.lock | 5 +++++ gemfiles/3.0/Gemfile | 1 + gemfiles/3.0/Gemfile.lock | 5 +++++ gemfiles/3.1/Gemfile | 1 + gemfiles/3.1/Gemfile.lock | 5 +++++ gemfiles/3.2/Gemfile | 1 + gemfiles/3.2/Gemfile.lock | 5 +++++ gemfiles/3.3/Gemfile | 1 + gemfiles/3.3/Gemfile.lock | 5 +++++ gemfiles/3.4/Gemfile | 1 + gemfiles/3.4/Gemfile.lock | 5 +++++ gemfiles/3.5/Gemfile | 1 + gemfiles/3.5/Gemfile.lock | 5 +++++ gemfiles/jruby/Gemfile | 1 + gemfiles/jruby/Gemfile.lock | 5 +++++ gemfiles/truffleruby/Gemfile | 1 + gemfiles/truffleruby/Gemfile.lock | 5 +++++ 18 files changed, 54 insertions(+) diff --git a/gemfiles/2.7/Gemfile b/gemfiles/2.7/Gemfile index 35cf9d18b1..8d1fbb82cd 100644 --- a/gemfiles/2.7/Gemfile +++ b/gemfiles/2.7/Gemfile @@ -11,4 +11,5 @@ gem "parser" gem "rake-compiler" gem "rake" gem "rbs" +gem "ruby_parser" gem "test-unit" diff --git a/gemfiles/2.7/Gemfile.lock b/gemfiles/2.7/Gemfile.lock index 738f47cc9c..8afea53a6a 100644 --- a/gemfiles/2.7/Gemfile.lock +++ b/gemfiles/2.7/Gemfile.lock @@ -17,6 +17,10 @@ GEM rake-compiler (1.3.0) rake rbs (3.1.3) + ruby_parser (3.21.1) + racc (~> 1.5) + sexp_processor (~> 4.16) + sexp_processor (4.17.4) test-unit (3.7.0) power_assert @@ -30,6 +34,7 @@ DEPENDENCIES rake rake-compiler rbs + ruby_parser test-unit RUBY VERSION diff --git a/gemfiles/3.0/Gemfile b/gemfiles/3.0/Gemfile index e53808b48d..c52f90eaf8 100644 --- a/gemfiles/3.0/Gemfile +++ b/gemfiles/3.0/Gemfile @@ -12,4 +12,5 @@ gem "rake-compiler" gem "rake" gem "rbs" gem "ruby_memcheck" +gem "ruby_parser" gem "test-unit" diff --git a/gemfiles/3.0/Gemfile.lock b/gemfiles/3.0/Gemfile.lock index cb4eb82cca..da1f5bbb11 100644 --- a/gemfiles/3.0/Gemfile.lock +++ b/gemfiles/3.0/Gemfile.lock @@ -25,6 +25,10 @@ GEM logger ruby_memcheck (3.0.1) nokogiri + ruby_parser (3.21.1) + racc (~> 1.5) + sexp_processor (~> 4.16) + sexp_processor (4.17.4) test-unit (3.7.0) power_assert @@ -39,6 +43,7 @@ DEPENDENCIES rake-compiler rbs ruby_memcheck + ruby_parser test-unit RUBY VERSION diff --git a/gemfiles/3.1/Gemfile b/gemfiles/3.1/Gemfile index 39ac18ab72..b17401ffc3 100644 --- a/gemfiles/3.1/Gemfile +++ b/gemfiles/3.1/Gemfile @@ -12,4 +12,5 @@ gem "rake-compiler" gem "rake" gem "rbs" gem "ruby_memcheck" +gem "ruby_parser" gem "test-unit" diff --git a/gemfiles/3.1/Gemfile.lock b/gemfiles/3.1/Gemfile.lock index bf71c63817..5a460c4c93 100644 --- a/gemfiles/3.1/Gemfile.lock +++ b/gemfiles/3.1/Gemfile.lock @@ -25,6 +25,10 @@ GEM logger ruby_memcheck (3.0.1) nokogiri + ruby_parser (3.21.1) + racc (~> 1.5) + sexp_processor (~> 4.16) + sexp_processor (4.17.4) test-unit (3.7.0) power_assert @@ -39,6 +43,7 @@ DEPENDENCIES rake-compiler rbs ruby_memcheck + ruby_parser test-unit RUBY VERSION diff --git a/gemfiles/3.2/Gemfile b/gemfiles/3.2/Gemfile index 5c87ea3074..009b09ec1a 100644 --- a/gemfiles/3.2/Gemfile +++ b/gemfiles/3.2/Gemfile @@ -12,4 +12,5 @@ gem "rake-compiler" gem "rake" gem "rbs" gem "ruby_memcheck" +gem "ruby_parser" gem "test-unit" diff --git a/gemfiles/3.2/Gemfile.lock b/gemfiles/3.2/Gemfile.lock index ed775841a9..6d3107ce5b 100644 --- a/gemfiles/3.2/Gemfile.lock +++ b/gemfiles/3.2/Gemfile.lock @@ -25,6 +25,10 @@ GEM logger ruby_memcheck (3.0.1) nokogiri + ruby_parser (3.21.1) + racc (~> 1.5) + sexp_processor (~> 4.16) + sexp_processor (4.17.4) test-unit (3.7.0) power_assert @@ -39,6 +43,7 @@ DEPENDENCIES rake-compiler rbs ruby_memcheck + ruby_parser test-unit RUBY VERSION diff --git a/gemfiles/3.3/Gemfile b/gemfiles/3.3/Gemfile index 245b121938..73006ce144 100644 --- a/gemfiles/3.3/Gemfile +++ b/gemfiles/3.3/Gemfile @@ -12,4 +12,5 @@ gem "rake-compiler" gem "rake" gem "rbs" gem "ruby_memcheck" +gem "ruby_parser" gem "test-unit" diff --git a/gemfiles/3.3/Gemfile.lock b/gemfiles/3.3/Gemfile.lock index b076083b8f..066374e0f3 100644 --- a/gemfiles/3.3/Gemfile.lock +++ b/gemfiles/3.3/Gemfile.lock @@ -25,6 +25,10 @@ GEM logger ruby_memcheck (3.0.1) nokogiri + ruby_parser (3.21.1) + racc (~> 1.5) + sexp_processor (~> 4.16) + sexp_processor (4.17.4) test-unit (3.7.0) power_assert @@ -39,6 +43,7 @@ DEPENDENCIES rake-compiler rbs ruby_memcheck + ruby_parser test-unit RUBY VERSION diff --git a/gemfiles/3.4/Gemfile b/gemfiles/3.4/Gemfile index eb904ae3b2..2e86887f58 100644 --- a/gemfiles/3.4/Gemfile +++ b/gemfiles/3.4/Gemfile @@ -12,4 +12,5 @@ gem "rake-compiler" gem "rake" gem "rbs" gem "ruby_memcheck" +gem "ruby_parser" gem "test-unit" diff --git a/gemfiles/3.4/Gemfile.lock b/gemfiles/3.4/Gemfile.lock index 12fdf3a16e..dbb356048b 100644 --- a/gemfiles/3.4/Gemfile.lock +++ b/gemfiles/3.4/Gemfile.lock @@ -25,6 +25,10 @@ GEM logger ruby_memcheck (3.0.1) nokogiri + ruby_parser (3.21.1) + racc (~> 1.5) + sexp_processor (~> 4.16) + sexp_processor (4.17.4) test-unit (3.7.0) power_assert @@ -39,6 +43,7 @@ DEPENDENCIES rake-compiler rbs ruby_memcheck + ruby_parser test-unit RUBY VERSION diff --git a/gemfiles/3.5/Gemfile b/gemfiles/3.5/Gemfile index 84787640b0..af835826a1 100644 --- a/gemfiles/3.5/Gemfile +++ b/gemfiles/3.5/Gemfile @@ -13,4 +13,5 @@ gem "rake-compiler" gem "rake" gem "rbs" gem "ruby_memcheck" +gem "ruby_parser" gem "test-unit" diff --git a/gemfiles/3.5/Gemfile.lock b/gemfiles/3.5/Gemfile.lock index 0d57895538..57768351bb 100644 --- a/gemfiles/3.5/Gemfile.lock +++ b/gemfiles/3.5/Gemfile.lock @@ -26,6 +26,10 @@ GEM logger ruby_memcheck (3.0.1) nokogiri + ruby_parser (3.21.1) + racc (~> 1.5) + sexp_processor (~> 4.16) + sexp_processor (4.17.4) test-unit (3.7.0) power_assert @@ -41,6 +45,7 @@ DEPENDENCIES rake-compiler rbs ruby_memcheck + ruby_parser test-unit RUBY VERSION diff --git a/gemfiles/jruby/Gemfile b/gemfiles/jruby/Gemfile index b065e12c9d..957c4c01d9 100644 --- a/gemfiles/jruby/Gemfile +++ b/gemfiles/jruby/Gemfile @@ -9,4 +9,5 @@ gemspec path: "../.." gem "parser" gem "rake" gem "rake-compiler" +gem "ruby_parser" gem "test-unit" diff --git a/gemfiles/jruby/Gemfile.lock b/gemfiles/jruby/Gemfile.lock index 9835176bab..e8227137ec 100644 --- a/gemfiles/jruby/Gemfile.lock +++ b/gemfiles/jruby/Gemfile.lock @@ -16,6 +16,10 @@ GEM rake (13.3.0) rake-compiler (1.3.0) rake + ruby_parser (3.21.1) + racc (~> 1.5) + sexp_processor (~> 4.16) + sexp_processor (4.17.4) test-unit (3.7.0) power_assert @@ -33,6 +37,7 @@ DEPENDENCIES prism! rake rake-compiler + ruby_parser test-unit RUBY VERSION diff --git a/gemfiles/truffleruby/Gemfile b/gemfiles/truffleruby/Gemfile index f9b1976fa9..6160f8f120 100644 --- a/gemfiles/truffleruby/Gemfile +++ b/gemfiles/truffleruby/Gemfile @@ -9,4 +9,5 @@ gemspec path: "../.." gem "parser" gem "rake" gem "rake-compiler" +gem "ruby_parser" gem "test-unit" diff --git a/gemfiles/truffleruby/Gemfile.lock b/gemfiles/truffleruby/Gemfile.lock index d43fab69db..563b7fc9c1 100644 --- a/gemfiles/truffleruby/Gemfile.lock +++ b/gemfiles/truffleruby/Gemfile.lock @@ -15,6 +15,10 @@ GEM rake (13.3.0) rake-compiler (1.3.0) rake + ruby_parser (3.21.1) + racc (~> 1.5) + sexp_processor (~> 4.16) + sexp_processor (4.17.4) test-unit (3.7.0) power_assert @@ -26,6 +30,7 @@ DEPENDENCIES prism! rake rake-compiler + ruby_parser test-unit RUBY VERSION From 2de82b15fc3fcfb9fc4d78c1bfa329f12117bb2b Mon Sep 17 00:00:00 2001 From: Earlopain <14981592+Earlopain@users.noreply.github.com> Date: Sun, 14 Sep 2025 11:43:34 +0200 Subject: [PATCH 132/333] Fix back reference for ruby_parser on Ruby 2.7 Symbol#name is only a thing since Ruby 3.0 --- lib/prism/translation/ruby_parser.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/prism/translation/ruby_parser.rb b/lib/prism/translation/ruby_parser.rb index ac538a2e97..2ca7da0bf2 100644 --- a/lib/prism/translation/ruby_parser.rb +++ b/lib/prism/translation/ruby_parser.rb @@ -152,7 +152,7 @@ def visit_assoc_splat_node(node) # ^^ # ``` def visit_back_reference_read_node(node) - s(node, :back_ref, node.name.name.delete_prefix("$").to_sym) + s(node, :back_ref, node.name.to_s.delete_prefix("$").to_sym) end # ``` From dcedd143576c1e46c8d4f1177c204ea115c09a61 Mon Sep 17 00:00:00 2001 From: Earlopain <14981592+Earlopain@users.noreply.github.com> Date: Mon, 15 Sep 2025 08:39:30 +0200 Subject: [PATCH 133/333] Fix warn polyfill when no uplevel is provided An unspecified uplevel is not the same as an uplevel of 1: ``` $ irb irb(main):001> warn("foo") foo => nil irb(main):002> warn("foo", uplevel: 1) /home/user/.rbenv/versions/2.7.8/lib/ruby/gems/2.7.0/gems/irb-1.14.0/lib/irb/workspace.rb:121: warning: foo => nil ``` --- lib/prism/polyfill/warn.rb | 38 ++++++++++++++++---------------------- 1 file changed, 16 insertions(+), 22 deletions(-) diff --git a/lib/prism/polyfill/warn.rb b/lib/prism/polyfill/warn.rb index 560380d308..76a4264623 100644 --- a/lib/prism/polyfill/warn.rb +++ b/lib/prism/polyfill/warn.rb @@ -7,17 +7,14 @@ Kernel.prepend( Module.new { def warn(*msgs, uplevel: nil, category: nil) # :nodoc: - uplevel = - case uplevel - when nil - 1 - when Integer - uplevel + 1 - else - uplevel.to_int + 1 - end - - super(*msgs, uplevel: uplevel) + case uplevel + when nil + super(*msgs) + when Integer + super(*msgs, uplevel: uplevel + 1) + else + super(*msgs, uplevel: uplevel.to_int + 1) + end end } ) @@ -25,17 +22,14 @@ def warn(*msgs, uplevel: nil, category: nil) # :nodoc: Object.prepend( Module.new { def warn(*msgs, uplevel: nil, category: nil) # :nodoc: - uplevel = - case uplevel - when nil - 1 - when Integer - uplevel + 1 - else - uplevel.to_int + 1 - end - - super(*msgs, uplevel: uplevel) + case uplevel + when nil + super(*msgs) + when Integer + super(*msgs, uplevel: uplevel + 1) + else + super(*msgs, uplevel: uplevel.to_int + 1) + end end } ) From 6e3c16825b70a7322cb2a58e7b03ae87921de3a2 Mon Sep 17 00:00:00 2001 From: Jean Boussier Date: Mon, 15 Sep 2025 10:47:26 +0200 Subject: [PATCH 134/333] Fix race condition in `rake parse:topgems` `block.call(queue.shift) until queue.empty?` isn't thread safe. If there is one element left in the queue, two or more thread may see `queue.empty?` return `false` and call the blocking `shift` ending in a deadlock. The proper way to synchronize threads with a queue is to close the queue once no more elements need to be added. This should fix the occasional `fatal: No live threads left. Deadlock? (fatal)` failures on CI. --- rakelib/lex.rake | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/rakelib/lex.rake b/rakelib/lex.rake index 327339f75d..23807a81b6 100644 --- a/rakelib/lex.rake +++ b/rakelib/lex.rake @@ -62,11 +62,10 @@ module Prism def parallelize(items, &block) Thread.abort_on_exception = true - queue = Queue.new - items.each { |item| queue << item } + queue = Queue.new(items).close workers = - ENV.fetch("WORKERS") { 16 }.to_i.times.map do + ENV.fetch("WORKERS", "16").to_i.times.map do parallelize_thread(queue, &block) end @@ -77,7 +76,11 @@ module Prism # Create a new thread with a minimal number of locals that it can access. def parallelize_thread(queue, &block) - Thread.new { block.call(queue.shift) until queue.empty? } + Thread.new do + while item = queue.pop + block.call(item) + end + end end end end From 125c375d74b87a6622031980eaab239cc38be2c2 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Mon, 15 Sep 2025 10:18:46 -0400 Subject: [PATCH 135/333] Fix character literal forced encoding If a character literal was followed by a string concatenation, then the forced encoding of the string concatenation could accidentally overwrite the explicit encoding of the character literal. We now handle this properly. --- snapshots/character_literal.txt | 37 +++++++++++++++++++++++ src/prism.c | 30 +++++++++++------- test/prism/fixtures/character_literal.txt | 2 ++ test/prism/ruby/ruby_parser_test.rb | 1 + 4 files changed, 59 insertions(+), 11 deletions(-) create mode 100644 snapshots/character_literal.txt create mode 100644 test/prism/fixtures/character_literal.txt diff --git a/snapshots/character_literal.txt b/snapshots/character_literal.txt new file mode 100644 index 0000000000..89abc5473c --- /dev/null +++ b/snapshots/character_literal.txt @@ -0,0 +1,37 @@ +@ ProgramNode (location: (2,0)-(2,11)) +├── flags: ∅ +├── locals: [] +└── statements: + @ StatementsNode (location: (2,0)-(2,11)) + ├── flags: ∅ + └── body: (length: 1) + └── @ CallNode (location: (2,0)-(2,11)) + ├── flags: newline, ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :p + ├── message_loc: (2,0)-(2,1) = "p" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (2,2)-(2,11)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ InterpolatedStringNode (location: (2,2)-(2,11)) + │ ├── flags: static_literal + │ ├── opening_loc: ∅ + │ ├── parts: (length: 2) + │ │ ├── @ StringNode (location: (2,2)-(2,9)) + │ │ │ ├── flags: static_literal, forced_utf8_encoding, frozen + │ │ │ ├── opening_loc: (2,2)-(2,3) = "?" + │ │ │ ├── content_loc: (2,3)-(2,9) = "\\u3042" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "\x{E381}\x82" + │ │ └── @ StringNode (location: (2,9)-(2,11)) + │ │ ├── flags: static_literal, frozen + │ │ ├── opening_loc: (2,9)-(2,10) = "\"" + │ │ ├── content_loc: (2,10)-(2,10) = "" + │ │ ├── closing_loc: (2,10)-(2,11) = "\"" + │ │ └── unescaped: "" + │ └── closing_loc: ∅ + ├── closing_loc: ∅ + └── block: ∅ diff --git a/src/prism.c b/src/prism.c index 06419d1378..2e202c3745 100644 --- a/src/prism.c +++ b/src/prism.c @@ -18491,20 +18491,28 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b return (pm_node_t *) node; } case PM_TOKEN_CHARACTER_LITERAL: { - parser_lex(parser); - - pm_token_t opening = parser->previous; - opening.type = PM_TOKEN_STRING_BEGIN; - opening.end = opening.start + 1; - - pm_token_t content = parser->previous; - content.type = PM_TOKEN_STRING_CONTENT; - content.start = content.start + 1; - pm_token_t closing = not_provided(parser); - pm_node_t *node = (pm_node_t *) pm_string_node_create_current_string(parser, &opening, &content, &closing); + pm_node_t *node = (pm_node_t *) pm_string_node_create_current_string( + parser, + &(pm_token_t) { + .type = PM_TOKEN_STRING_BEGIN, + .start = parser->current.start, + .end = parser->current.start + 1 + }, + &(pm_token_t) { + .type = PM_TOKEN_STRING_CONTENT, + .start = parser->current.start + 1, + .end = parser->current.end + }, + &closing + ); + pm_node_flag_set(node, parse_unescaped_encoding(parser)); + // Skip past the character literal here, since now we have handled + // parser->explicit_encoding correctly. + parser_lex(parser); + // Characters can be followed by strings in which case they are // automatically concatenated. if (match1(parser, PM_TOKEN_STRING_BEGIN)) { diff --git a/test/prism/fixtures/character_literal.txt b/test/prism/fixtures/character_literal.txt new file mode 100644 index 0000000000..920332123f --- /dev/null +++ b/test/prism/fixtures/character_literal.txt @@ -0,0 +1,2 @@ +# encoding: Windows-31J +p ?\u3042"" diff --git a/test/prism/ruby/ruby_parser_test.rb b/test/prism/ruby/ruby_parser_test.rb index bcaed79791..b21ad81391 100644 --- a/test/prism/ruby/ruby_parser_test.rb +++ b/test/prism/ruby/ruby_parser_test.rb @@ -16,6 +16,7 @@ module Prism class RubyParserTest < TestCase todos = [ + "character_literal.txt", "encoding_euc_jp.txt", "regex_char_width.txt", "seattlerb/masgn_colon3.txt", From 88dadfead7a23a70771ea71740ac4b53986f4186 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Mon, 15 Sep 2025 10:34:44 -0400 Subject: [PATCH 136/333] Reverse-sync fix dangling pointers --- src/util/pm_string.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/util/pm_string.c b/src/util/pm_string.c index 75422fbdf2..cf79885fdd 100644 --- a/src/util/pm_string.c +++ b/src/util/pm_string.c @@ -182,7 +182,7 @@ pm_string_mapped_init(pm_string_t *string, const char *filepath) { if (size == 0) { close(fd); - const uint8_t source[] = ""; + static const uint8_t source[] = ""; *string = (pm_string_t) { .type = PM_STRING_CONSTANT, .source = source, .length = 0 }; return PM_STRING_INIT_SUCCESS; } @@ -278,7 +278,7 @@ pm_string_file_init(pm_string_t *string, const char *filepath) { size_t size = (size_t) sb.st_size; if (size == 0) { close(fd); - const uint8_t source[] = ""; + static const uint8_t source[] = ""; *string = (pm_string_t) { .type = PM_STRING_CONSTANT, .source = source, .length = 0 }; return PM_STRING_INIT_SUCCESS; } From 9afe299927a6a127d551c51186a9b386c020bd38 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 15 Sep 2025 16:50:57 +0000 Subject: [PATCH 137/333] Bump org.apache.maven.plugins:maven-surefire-plugin Bumps the java-deps group in /java-wasm with 1 update: [org.apache.maven.plugins:maven-surefire-plugin](https://github.com/apache/maven-surefire). Updates `org.apache.maven.plugins:maven-surefire-plugin` from 3.5.3 to 3.5.4 - [Release notes](https://github.com/apache/maven-surefire/releases) - [Commits](https://github.com/apache/maven-surefire/compare/surefire-3.5.3...surefire-3.5.4) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-surefire-plugin dependency-version: 3.5.4 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: java-deps ... Signed-off-by: dependabot[bot] --- java-wasm/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java-wasm/pom.xml b/java-wasm/pom.xml index b0f3ab0730..a4ab175e18 100644 --- a/java-wasm/pom.xml +++ b/java-wasm/pom.xml @@ -94,7 +94,7 @@ org.apache.maven.plugins maven-surefire-plugin - 3.5.3 + 3.5.4 org.codehaus.mojo From 593e1f382a04e93b4f1118334a6d9d5609b0a616 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 15 Sep 2025 17:07:11 +0000 Subject: [PATCH 138/333] Bump sorbet Bumps the ruby-deps group with 1 update in the /gemfiles/typecheck directory: [sorbet](https://github.com/sorbet/sorbet). Updates `sorbet` from 0.6.12495 to 0.6.12527 - [Release notes](https://github.com/sorbet/sorbet/releases) - [Commits](https://github.com/sorbet/sorbet/commits) --- updated-dependencies: - dependency-name: sorbet dependency-version: 0.6.12527 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps ... Signed-off-by: dependabot[bot] --- gemfiles/typecheck/Gemfile.lock | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/gemfiles/typecheck/Gemfile.lock b/gemfiles/typecheck/Gemfile.lock index 7431e32936..486d79c962 100644 --- a/gemfiles/typecheck/Gemfile.lock +++ b/gemfiles/typecheck/Gemfile.lock @@ -62,14 +62,14 @@ GEM sexp_processor (~> 4.16) securerandom (0.4.1) sexp_processor (4.17.3) - sorbet (0.6.12495) - sorbet-static (= 0.6.12495) - sorbet-runtime (0.6.12495) - sorbet-static (0.6.12495-universal-darwin) - sorbet-static (0.6.12495-x86_64-linux) - sorbet-static-and-runtime (0.6.12495) - sorbet (= 0.6.12495) - sorbet-runtime (= 0.6.12495) + sorbet (0.6.12527) + sorbet-static (= 0.6.12527) + sorbet-runtime (0.6.12527) + sorbet-static (0.6.12527-universal-darwin) + sorbet-static (0.6.12527-x86_64-linux) + sorbet-static-and-runtime (0.6.12527) + sorbet (= 0.6.12527) + sorbet-runtime (= 0.6.12527) spoom (1.6.1) erubi (>= 1.10.0) prism (>= 0.28.0) From 46b65f21af99f4454f3fab969a27ed4511e4fcb6 Mon Sep 17 00:00:00 2001 From: Earlopain <14981592+Earlopain@users.noreply.github.com> Date: Wed, 17 Sep 2025 14:34:46 +0200 Subject: [PATCH 139/333] Fix truffleruby CI Truffleruby 25 got released yesterday. --- gemfiles/truffleruby/Gemfile | 2 +- gemfiles/truffleruby/Gemfile.lock | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gemfiles/truffleruby/Gemfile b/gemfiles/truffleruby/Gemfile index 6160f8f120..ce1282eacb 100644 --- a/gemfiles/truffleruby/Gemfile +++ b/gemfiles/truffleruby/Gemfile @@ -2,7 +2,7 @@ source "https://rubygems.org" -ruby "~> 3.3.5", engine: "truffleruby", engine_version: "~> 24.2.0" +ruby "~> 3.3.7", engine: "truffleruby", engine_version: "~> 25.0.0" gemspec path: "../.." diff --git a/gemfiles/truffleruby/Gemfile.lock b/gemfiles/truffleruby/Gemfile.lock index 563b7fc9c1..b2b402f7f2 100644 --- a/gemfiles/truffleruby/Gemfile.lock +++ b/gemfiles/truffleruby/Gemfile.lock @@ -34,7 +34,7 @@ DEPENDENCIES test-unit RUBY VERSION - ruby 3.3.5p0 (truffleruby 24.2.0) + ruby 3.3.7p0 (truffleruby 25.0.0) BUNDLED WITH 2.4.19 From 7a13d3535b2ae1c879322cfdb8f09232b05ed1a5 Mon Sep 17 00:00:00 2001 From: Earlopain <14981592+Earlopain@users.noreply.github.com> Date: Wed, 17 Sep 2025 17:23:07 +0200 Subject: [PATCH 140/333] Reject `1 if foo = bar baz` and also `1 and foo = bar baz` This is a partial fix for https://github.com/ruby/prism/issues/3106 It still accepts `a = b c and 1` --- src/prism.c | 2 +- test/prism/errors/command_calls_33.txt | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 test/prism/errors/command_calls_33.txt diff --git a/src/prism.c b/src/prism.c index 2e202c3745..42a821e535 100644 --- a/src/prism.c +++ b/src/prism.c @@ -20909,7 +20909,7 @@ parse_assignment_values(pm_parser_t *parser, pm_binding_power_t previous_binding bool permitted = true; if (previous_binding_power != PM_BINDING_POWER_STATEMENT && match1(parser, PM_TOKEN_USTAR)) permitted = false; - pm_node_t *value = parse_starred_expression(parser, binding_power, previous_binding_power == PM_BINDING_POWER_ASSIGNMENT ? accepts_command_call : previous_binding_power < PM_BINDING_POWER_MATCH, diag_id, (uint16_t) (depth + 1)); + pm_node_t *value = parse_starred_expression(parser, binding_power, previous_binding_power == PM_BINDING_POWER_ASSIGNMENT ? accepts_command_call : previous_binding_power < PM_BINDING_POWER_MODIFIER, diag_id, (uint16_t) (depth + 1)); if (!permitted) pm_parser_err_node(parser, value, PM_ERR_UNEXPECTED_MULTI_WRITE); parse_assignment_value_local(parser, value); diff --git a/test/prism/errors/command_calls_33.txt b/test/prism/errors/command_calls_33.txt new file mode 100644 index 0000000000..13e3b35c9e --- /dev/null +++ b/test/prism/errors/command_calls_33.txt @@ -0,0 +1,6 @@ +1 if foo = bar baz + ^~~ unexpected local variable or method, expecting end-of-input + +1 and foo = bar baz + ^~~ unexpected local variable or method, expecting end-of-input + From 3a4e102d806beef410b383b942db01631d526312 Mon Sep 17 00:00:00 2001 From: Earlopain <14981592+Earlopain@users.noreply.github.com> Date: Wed, 17 Sep 2025 19:06:55 +0200 Subject: [PATCH 141/333] Reject argument command call taking a block with more trailing arguments https://bugs.ruby-lang.org/issues/21168#note-5 The added code samples align with `parse.y`, except for `foo(bar baz do end)` which `parse.y` currently rejects but shouldn't. --- snapshots/command_method_call_2.txt | 96 +++++++++++++++++++ src/prism.c | 11 +++ test/prism/errors/command_calls.txt | 7 ++ test/prism/errors/command_calls_34.txt | 24 +++++ test/prism/fixtures/command_method_call_2.txt | 3 + test/prism/fixtures_test.rb | 2 + test/prism/lex_test.rb | 3 + test/prism/ruby/parser_test.rb | 3 + test/prism/ruby/ripper_test.rb | 3 + test/prism/ruby/ruby_parser_test.rb | 3 + 10 files changed, 155 insertions(+) create mode 100644 snapshots/command_method_call_2.txt create mode 100644 test/prism/errors/command_calls_34.txt create mode 100644 test/prism/fixtures/command_method_call_2.txt diff --git a/snapshots/command_method_call_2.txt b/snapshots/command_method_call_2.txt new file mode 100644 index 0000000000..7f09f88128 --- /dev/null +++ b/snapshots/command_method_call_2.txt @@ -0,0 +1,96 @@ +@ ProgramNode (location: (1,0)-(3,17)) +├── flags: ∅ +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(3,17)) + ├── flags: ∅ + └── body: (length: 2) + ├── @ CallNode (location: (1,0)-(1,19)) + │ ├── flags: newline, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :foo + │ ├── message_loc: (1,0)-(1,3) = "foo" + │ ├── opening_loc: (1,3)-(1,4) = "(" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,4)-(1,18)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ CallNode (location: (1,4)-(1,18)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :bar + │ │ ├── message_loc: (1,4)-(1,7) = "bar" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (1,8)-(1,11)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ CallNode (location: (1,8)-(1,11)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :baz + │ │ │ ├── message_loc: (1,8)-(1,11) = "baz" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: + │ │ @ BlockNode (location: (1,12)-(1,18)) + │ │ ├── flags: ∅ + │ │ ├── locals: [] + │ │ ├── parameters: ∅ + │ │ ├── body: ∅ + │ │ ├── opening_loc: (1,12)-(1,14) = "do" + │ │ └── closing_loc: (1,15)-(1,18) = "end" + │ ├── closing_loc: (1,18)-(1,19) = ")" + │ └── block: ∅ + └── @ CallNode (location: (3,0)-(3,17)) + ├── flags: newline, ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :foo + ├── message_loc: (3,0)-(3,3) = "foo" + ├── opening_loc: (3,3)-(3,4) = "(" + ├── arguments: + │ @ ArgumentsNode (location: (3,4)-(3,16)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ CallNode (location: (3,4)-(3,16)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :bar + │ ├── message_loc: (3,4)-(3,7) = "bar" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (3,8)-(3,16)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 2) + │ │ ├── @ CallNode (location: (3,8)-(3,11)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :baz + │ │ │ ├── message_loc: (3,8)-(3,11) = "baz" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── @ CallNode (location: (3,13)-(3,16)) + │ │ ├── flags: variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :bat + │ │ ├── message_loc: (3,13)-(3,16) = "bat" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── closing_loc: (3,16)-(3,17) = ")" + └── block: ∅ diff --git a/src/prism.c b/src/prism.c index 42a821e535..6dd0b2ae73 100644 --- a/src/prism.c +++ b/src/prism.c @@ -14443,6 +14443,17 @@ parse_arguments(pm_parser_t *parser, pm_arguments_t *arguments, bool accepts_for if (accepted_newline) { pm_parser_err_previous(parser, PM_ERR_INVALID_COMMA); } + + // If this is a command call and an argument takes a block, + // there can be no further arguments. For example, + // `foo(bar 1 do end, 2)` should be rejected. + if (PM_NODE_TYPE_P(argument, PM_CALL_NODE)) { + pm_call_node_t *call = (pm_call_node_t *) argument; + if (call->opening_loc.start == NULL && call->arguments != NULL && call->block != NULL) { + pm_parser_err_previous(parser, PM_ERR_INVALID_COMMA); + break; + } + } } else { // If there is no comma at the end of the argument list then we're // done parsing arguments and can break out of this loop. diff --git a/test/prism/errors/command_calls.txt b/test/prism/errors/command_calls.txt index 19812a1d0a..6601e5fbbc 100644 --- a/test/prism/errors/command_calls.txt +++ b/test/prism/errors/command_calls.txt @@ -1,3 +1,10 @@ [a b] ^ unexpected local variable or method; expected a `,` separator for the array elements + +[ + a b do + ^ unexpected local variable or method; expected a `,` separator for the array elements + end, +] + diff --git a/test/prism/errors/command_calls_34.txt b/test/prism/errors/command_calls_34.txt new file mode 100644 index 0000000000..ce62bc1492 --- /dev/null +++ b/test/prism/errors/command_calls_34.txt @@ -0,0 +1,24 @@ +foo(bar 1 do end, 2) + ^ invalid comma + ^ unexpected integer; expected a `)` to close the arguments + ^ unexpected integer, expecting end-of-input + ^ unexpected ')', expecting end-of-input + ^ unexpected ')', ignoring it + +foo(bar 1 do end,) + ^ invalid comma + +foo(1, bar 2 do end) + ^ unexpected integer; expected a `)` to close the arguments + ^ unexpected integer, expecting end-of-input + ^~ unexpected 'do', expecting end-of-input + ^~ unexpected 'do', ignoring it + ^~~ unexpected 'end', ignoring it + ^ unexpected ')', ignoring it + +foo(1, bar 2) + ^ unexpected integer; expected a `)` to close the arguments + ^ unexpected integer, expecting end-of-input + ^ unexpected ')', expecting end-of-input + ^ unexpected ')', ignoring it + diff --git a/test/prism/fixtures/command_method_call_2.txt b/test/prism/fixtures/command_method_call_2.txt new file mode 100644 index 0000000000..165c45987a --- /dev/null +++ b/test/prism/fixtures/command_method_call_2.txt @@ -0,0 +1,3 @@ +foo(bar baz do end) + +foo(bar baz, bat) diff --git a/test/prism/fixtures_test.rb b/test/prism/fixtures_test.rb index b4b656fcf4..ddb6ffb40c 100644 --- a/test/prism/fixtures_test.rb +++ b/test/prism/fixtures_test.rb @@ -27,6 +27,8 @@ class FixturesTest < TestCase # Leaving these out until they are supported by parse.y. except << "leading_logical.txt" except << "endless_methods_command_call.txt" + # https://bugs.ruby-lang.org/issues/21168#note-5 + except << "command_method_call_2.txt" Fixture.each(except: except) do |fixture| define_method(fixture.test_name) { assert_valid_syntax(fixture.read) } diff --git a/test/prism/lex_test.rb b/test/prism/lex_test.rb index 4eacbab3e1..3a0da1a2d8 100644 --- a/test/prism/lex_test.rb +++ b/test/prism/lex_test.rb @@ -48,6 +48,9 @@ class LexTest < TestCase # https://bugs.ruby-lang.org/issues/17398#note-12 except << "endless_methods_command_call.txt" + # https://bugs.ruby-lang.org/issues/21168#note-5 + except << "command_method_call_2.txt" + Fixture.each(except: except) do |fixture| define_method(fixture.test_name) { assert_lex(fixture) } end diff --git a/test/prism/ruby/parser_test.rb b/test/prism/ruby/parser_test.rb index 98740f0973..10b5fca5ea 100644 --- a/test/prism/ruby/parser_test.rb +++ b/test/prism/ruby/parser_test.rb @@ -70,6 +70,9 @@ class ParserTest < TestCase # Ruby >= 3.5 specific syntax "endless_methods_command_call.txt", + + # https://bugs.ruby-lang.org/issues/21168#note-5 + "command_method_call_2.txt", ] # These files contain code that is being parsed incorrectly by the parser diff --git a/test/prism/ruby/ripper_test.rb b/test/prism/ruby/ripper_test.rb index 39325137ba..4916ec8d9d 100644 --- a/test/prism/ruby/ripper_test.rb +++ b/test/prism/ruby/ripper_test.rb @@ -33,6 +33,9 @@ class RipperTest < TestCase # https://bugs.ruby-lang.org/issues/17398#note-12 "endless_methods_command_call.txt", + + # https://bugs.ruby-lang.org/issues/21168#note-5 + "command_method_call_2.txt", ] # Skip these tests that we haven't implemented yet. diff --git a/test/prism/ruby/ruby_parser_test.rb b/test/prism/ruby/ruby_parser_test.rb index b21ad81391..ec55e41967 100644 --- a/test/prism/ruby/ruby_parser_test.rb +++ b/test/prism/ruby/ruby_parser_test.rb @@ -79,6 +79,9 @@ class RubyParserTest < TestCase # Ruby >= 3.5 specific syntax "endless_methods_command_call.txt", + + # https://bugs.ruby-lang.org/issues/21168#note-5 + "command_method_call_2.txt", ] Fixture.each(except: failures) do |fixture| From 10e4f82beceab2a4b62885a8e6bd1d74e7416077 Mon Sep 17 00:00:00 2001 From: andreatp Date: Wed, 17 Sep 2025 18:55:22 +0100 Subject: [PATCH 142/333] Bump Chicory to 1.5.1 --- java-wasm/pom.xml | 12 ++++++------ java-wasm/src/main/java/org/prism/Prism.java | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/java-wasm/pom.xml b/java-wasm/pom.xml index a4ab175e18..664cc4b454 100644 --- a/java-wasm/pom.xml +++ b/java-wasm/pom.xml @@ -15,7 +15,7 @@ 11 11 - 1.3.0 + 1.5.1 5.13.4 @@ -56,7 +56,7 @@ com.dylibso.chicory - host-module-annotations-experimental + annotations provided @@ -85,7 +85,7 @@ com.dylibso.chicory - host-module-processor-experimental + annotations-processor ${chicory.version} @@ -116,16 +116,16 @@ com.dylibso.chicory - aot-maven-plugin-experimental + chicory-compiler-maven-plugin ${chicory.version} prism - wasm-aot-gen + compile - org.prism.Prism + org.prism.PrismModule src/test/resources/prism.wasm diff --git a/java-wasm/src/main/java/org/prism/Prism.java b/java-wasm/src/main/java/org/prism/Prism.java index a4a8e65111..9578a441a1 100644 --- a/java-wasm/src/main/java/org/prism/Prism.java +++ b/java-wasm/src/main/java/org/prism/Prism.java @@ -1,7 +1,7 @@ package org.prism; import com.dylibso.chicory.runtime.ByteArrayMemory; -import com.dylibso.chicory.experimental.hostmodule.annotations.WasmModuleInterface; +import com.dylibso.chicory.annotations.WasmModuleInterface; import com.dylibso.chicory.runtime.ImportValues; import com.dylibso.chicory.runtime.Instance; import com.dylibso.chicory.wasi.WasiOptions; From 2ddedf650a9a9ef249e212bf455ba7e6494f8e24 Mon Sep 17 00:00:00 2001 From: Randy Stauner Date: Thu, 18 Sep 2025 08:54:25 -0700 Subject: [PATCH 143/333] Fix example marker for case statement predicate --- config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.yml b/config.yml index 3366b6235d..a8a8e70aac 100644 --- a/config.yml +++ b/config.yml @@ -1800,7 +1800,7 @@ nodes: Represents the predicate of the case statement. This can be either `nil` or any [non-void expressions](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). case true; when false; end - ^^^^ + ^^^^ - name: conditions type: node[] kind: WhenNode From f7a9a03a923da00b2c8c02cc8c9991ffc43f95a6 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Fri, 19 Sep 2025 22:13:09 +0900 Subject: [PATCH 144/333] Fix dangling pointers on Windows as well Share the empty source string in `pm_string_mapped_init` and `pm_string_file_init`. --- src/util/pm_string.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/util/pm_string.c b/src/util/pm_string.c index cf79885fdd..a7493c468b 100644 --- a/src/util/pm_string.c +++ b/src/util/pm_string.c @@ -1,5 +1,7 @@ #include "prism/util/pm_string.h" +static const uint8_t empty_source[] = ""; + /** * Returns the size of the pm_string_t struct. This is necessary to allocate the * correct amount of memory in the FFI backend. @@ -133,8 +135,7 @@ pm_string_mapped_init(pm_string_t *string, const char *filepath) { // the source to a constant empty string and return. if (file_size == 0) { pm_string_file_handle_close(&handle); - const uint8_t source[] = ""; - *string = (pm_string_t) { .type = PM_STRING_CONSTANT, .source = source, .length = 0 }; + *string = (pm_string_t) { .type = PM_STRING_CONSTANT, .source = empty_source, .length = 0 }; return PM_STRING_INIT_SUCCESS; } @@ -182,8 +183,7 @@ pm_string_mapped_init(pm_string_t *string, const char *filepath) { if (size == 0) { close(fd); - static const uint8_t source[] = ""; - *string = (pm_string_t) { .type = PM_STRING_CONSTANT, .source = source, .length = 0 }; + *string = (pm_string_t) { .type = PM_STRING_CONSTANT, .source = empty_source, .length = 0 }; return PM_STRING_INIT_SUCCESS; } @@ -225,8 +225,7 @@ pm_string_file_init(pm_string_t *string, const char *filepath) { // the source to a constant empty string and return. if (file_size == 0) { pm_string_file_handle_close(&handle); - const uint8_t source[] = ""; - *string = (pm_string_t) { .type = PM_STRING_CONSTANT, .source = source, .length = 0 }; + *string = (pm_string_t) { .type = PM_STRING_CONSTANT, .source = empty_source, .length = 0 }; return PM_STRING_INIT_SUCCESS; } @@ -278,8 +277,7 @@ pm_string_file_init(pm_string_t *string, const char *filepath) { size_t size = (size_t) sb.st_size; if (size == 0) { close(fd); - static const uint8_t source[] = ""; - *string = (pm_string_t) { .type = PM_STRING_CONSTANT, .source = source, .length = 0 }; + *string = (pm_string_t) { .type = PM_STRING_CONSTANT, .source = empty_source, .length = 0 }; return PM_STRING_INIT_SUCCESS; } From c62867bd680f4dd0b174f4e3ca3f1abd1b91737c Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Fri, 19 Sep 2025 12:50:35 -0400 Subject: [PATCH 145/333] Slight documentation phrasing --- docs/parser_translation.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/parser_translation.md b/docs/parser_translation.md index f4aeef9a95..8c080070fe 100644 --- a/docs/parser_translation.md +++ b/docs/parser_translation.md @@ -20,5 +20,5 @@ Prism::Translation::ParserCurrent.parse("puts 'Hello World!'") All the parsers are autoloaded, so you don't have to worry about requiring them yourself. -If you also need to parse Ruby versions below 3.3 (which `prism` has no support for), check out +If you also need to parse Ruby versions below 3.3 (for which the `prism` translation layer does not have explicit support), check out [this guide](https://github.com/whitequark/parser/blob/master/doc/PRISM_TRANSLATION.md) from the `parser` gem on how to use both in conjunction. From cb27f5a70a81e84a6e8e93fb69200f01e78419a7 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Fri, 19 Sep 2025 13:42:36 -0400 Subject: [PATCH 146/333] Turn off failing test for parse.y --- test/prism/locals_test.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/prism/locals_test.rb b/test/prism/locals_test.rb index 950e7118af..0194bc6e5e 100644 --- a/test/prism/locals_test.rb +++ b/test/prism/locals_test.rb @@ -33,7 +33,8 @@ class LocalsTest < TestCase # Leaving these out until they are supported by parse.y. "leading_logical.txt", - "endless_methods_command_call.txt" + "endless_methods_command_call.txt", + "test_command_method_call_2.txt" ] Fixture.each(except: except) do |fixture| From d1b22f59a0a5a2cc3125e819750c546f80f741ee Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Fri, 19 Sep 2025 14:34:59 -0400 Subject: [PATCH 147/333] Fix up locals test skip name --- test/prism/locals_test.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/prism/locals_test.rb b/test/prism/locals_test.rb index 0194bc6e5e..9a3224e8ef 100644 --- a/test/prism/locals_test.rb +++ b/test/prism/locals_test.rb @@ -34,7 +34,7 @@ class LocalsTest < TestCase # Leaving these out until they are supported by parse.y. "leading_logical.txt", "endless_methods_command_call.txt", - "test_command_method_call_2.txt" + "command_method_call_2.txt" ] Fixture.each(except: except) do |fixture| From b11bb794fb979c40bfe124bf66af2a22d70740a4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 22 Sep 2025 16:21:10 +0000 Subject: [PATCH 148/333] Bump org.apache.maven.plugins:maven-compiler-plugin Bumps the java-deps group in /java-wasm with 1 update: [org.apache.maven.plugins:maven-compiler-plugin](https://github.com/apache/maven-compiler-plugin). Updates `org.apache.maven.plugins:maven-compiler-plugin` from 3.14.0 to 3.14.1 - [Release notes](https://github.com/apache/maven-compiler-plugin/releases) - [Commits](https://github.com/apache/maven-compiler-plugin/compare/maven-compiler-plugin-3.14.0...maven-compiler-plugin-3.14.1) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-compiler-plugin dependency-version: 3.14.1 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: java-deps ... Signed-off-by: dependabot[bot] --- java-wasm/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java-wasm/pom.xml b/java-wasm/pom.xml index 664cc4b454..b093de2dd9 100644 --- a/java-wasm/pom.xml +++ b/java-wasm/pom.xml @@ -79,7 +79,7 @@ org.apache.maven.plugins maven-compiler-plugin - 3.14.0 + 3.14.1 11 From 257e30629316358981dd433055319b89b310c321 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 22 Sep 2025 16:25:21 +0000 Subject: [PATCH 149/333] Bump sorbet Bumps the ruby-deps group with 1 update in the /gemfiles/typecheck directory: [sorbet](https://github.com/sorbet/sorbet). Updates `sorbet` from 0.6.12527 to 0.6.12556 - [Release notes](https://github.com/sorbet/sorbet/releases) - [Commits](https://github.com/sorbet/sorbet/commits) --- updated-dependencies: - dependency-name: sorbet dependency-version: 0.6.12556 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps ... Signed-off-by: dependabot[bot] --- gemfiles/typecheck/Gemfile.lock | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/gemfiles/typecheck/Gemfile.lock b/gemfiles/typecheck/Gemfile.lock index 486d79c962..4e0cfea39d 100644 --- a/gemfiles/typecheck/Gemfile.lock +++ b/gemfiles/typecheck/Gemfile.lock @@ -62,14 +62,14 @@ GEM sexp_processor (~> 4.16) securerandom (0.4.1) sexp_processor (4.17.3) - sorbet (0.6.12527) - sorbet-static (= 0.6.12527) - sorbet-runtime (0.6.12527) - sorbet-static (0.6.12527-universal-darwin) - sorbet-static (0.6.12527-x86_64-linux) - sorbet-static-and-runtime (0.6.12527) - sorbet (= 0.6.12527) - sorbet-runtime (= 0.6.12527) + sorbet (0.6.12556) + sorbet-static (= 0.6.12556) + sorbet-runtime (0.6.12556) + sorbet-static (0.6.12556-universal-darwin) + sorbet-static (0.6.12556-x86_64-linux) + sorbet-static-and-runtime (0.6.12556) + sorbet (= 0.6.12556) + sorbet-runtime (= 0.6.12556) spoom (1.6.1) erubi (>= 1.10.0) prism (>= 0.28.0) From 78ecd2add56e509a0d4cbacc5d0fdef2bac4b1e6 Mon Sep 17 00:00:00 2001 From: viralpraxis Date: Fri, 26 Sep 2025 18:34:10 +0400 Subject: [PATCH 150/333] Add `unparser` into README library examples Unparser now uses Prism (if available) via Parser translator. --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 756f8a0eff..9d6056ef8c 100644 --- a/README.md +++ b/README.md @@ -135,6 +135,7 @@ Prism has been integrated into the majority of Ruby runtimes, many libraries, an * [sorbet-eraser](https://github.com/kddnewton/sorbet-eraser/pull/25) * [synvert](https://github.com/xinminlabs/synvert-core-ruby) * [typeprof](https://github.com/ruby/typeprof) +* [unparser](https://github.com/mbj/unparser) (via parser translator) ### Applications From d8d412c1581a2dea58353fcee8ec6a4951fcfba3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 29 Sep 2025 20:47:53 +0000 Subject: [PATCH 151/333] Bump sorbet Bumps the ruby-deps group with 1 update in the /gemfiles/typecheck directory: [sorbet](https://github.com/sorbet/sorbet). Updates `sorbet` from 0.6.12556 to 0.6.12586 - [Release notes](https://github.com/sorbet/sorbet/releases) - [Commits](https://github.com/sorbet/sorbet/commits) --- updated-dependencies: - dependency-name: sorbet dependency-version: 0.6.12586 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps ... Signed-off-by: dependabot[bot] --- gemfiles/typecheck/Gemfile.lock | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/gemfiles/typecheck/Gemfile.lock b/gemfiles/typecheck/Gemfile.lock index 4e0cfea39d..5e407195fa 100644 --- a/gemfiles/typecheck/Gemfile.lock +++ b/gemfiles/typecheck/Gemfile.lock @@ -62,14 +62,14 @@ GEM sexp_processor (~> 4.16) securerandom (0.4.1) sexp_processor (4.17.3) - sorbet (0.6.12556) - sorbet-static (= 0.6.12556) - sorbet-runtime (0.6.12556) - sorbet-static (0.6.12556-universal-darwin) - sorbet-static (0.6.12556-x86_64-linux) - sorbet-static-and-runtime (0.6.12556) - sorbet (= 0.6.12556) - sorbet-runtime (= 0.6.12556) + sorbet (0.6.12586) + sorbet-static (= 0.6.12586) + sorbet-runtime (0.6.12586) + sorbet-static (0.6.12586-universal-darwin) + sorbet-static (0.6.12586-x86_64-linux) + sorbet-static-and-runtime (0.6.12586) + sorbet (= 0.6.12586) + sorbet-runtime (= 0.6.12586) spoom (1.6.1) erubi (>= 1.10.0) prism (>= 0.28.0) From 064c712f6f237fb5bff45cddcefa66085f2d110a Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Mon, 29 Sep 2025 15:47:27 -0700 Subject: [PATCH 152/333] Default `MAKEFLAGS` to `-j` This tells `make` to run in parallel by default. If I do ``` $ rake clobber; time rake compile ``` On the main branch it's like this: ``` ________________________________________________________ Executed in 9.71 secs fish external usr time 8.41 secs 128.00 micros 8.41 secs sys time 1.16 secs 530.00 micros 1.16 secs ``` On this branch it's like this: ``` ________________________________________________________ Executed in 3.89 secs fish external usr time 11.49 secs 127.00 micros 11.49 secs sys time 2.00 secs 553.00 micros 2.00 secs ``` So this buys me about 6 seconds on my machine --- Rakefile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Rakefile b/Rakefile index 7a5e537039..b06877107e 100644 --- a/Rakefile +++ b/Rakefile @@ -11,7 +11,10 @@ desc "Generate all ERB template based files" task templates: Prism::Template::TEMPLATES make = RUBY_PLATFORM.match?(/openbsd|freebsd/) ? "gmake" : "make" -task(make: :templates) { sh(make) } +task(make: :templates) { + ENV["MAKEFLAGS"] ||= "-j" + sh(make) +} task(make_no_debug: :templates) { sh("#{make} all-no-debug") } task(make_minimal: :templates) { sh("#{make} minimal") } From e71aa980d82446dce2da6f6879df913945ffd473 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Mon, 29 Sep 2025 16:12:44 -0700 Subject: [PATCH 153/333] Add a "LAST" enum field to all flags enums This allows us to use the "last" of the enums in order to make masks, etc. This particular commit uses the call flag's last enum field as an offset so that we can define "private" flags but not accidentally clobber any newly added call node flags. --- src/prism.c | 9 +++++---- templates/include/prism/ast.h.erb | 2 ++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/prism.c b/src/prism.c index 6dd0b2ae73..875968f06b 100644 --- a/src/prism.c +++ b/src/prism.c @@ -2622,10 +2622,11 @@ pm_break_node_create(pm_parser_t *parser, const pm_token_t *keyword, pm_argument // There are certain flags that we want to use internally but don't want to // expose because they are not relevant beyond parsing. Therefore we'll define // them here and not define them in config.yml/a header file. -static const pm_node_flags_t PM_WRITE_NODE_FLAGS_IMPLICIT_ARRAY = 0x4; -static const pm_node_flags_t PM_CALL_NODE_FLAGS_IMPLICIT_ARRAY = 0x40; -static const pm_node_flags_t PM_CALL_NODE_FLAGS_COMPARISON = 0x80; -static const pm_node_flags_t PM_CALL_NODE_FLAGS_INDEX = 0x100; +static const pm_node_flags_t PM_WRITE_NODE_FLAGS_IMPLICIT_ARRAY = (1 << 2); + +static const pm_node_flags_t PM_CALL_NODE_FLAGS_IMPLICIT_ARRAY = ((PM_CALL_NODE_FLAGS_LAST - 1) << 1); +static const pm_node_flags_t PM_CALL_NODE_FLAGS_COMPARISON = ((PM_CALL_NODE_FLAGS_LAST - 1) << 2); +static const pm_node_flags_t PM_CALL_NODE_FLAGS_INDEX = ((PM_CALL_NODE_FLAGS_LAST - 1) << 3); /** * Allocate and initialize a new CallNode node. This sets everything to NULL or diff --git a/templates/include/prism/ast.h.erb b/templates/include/prism/ast.h.erb index 087eb81890..e82cb78fe3 100644 --- a/templates/include/prism/ast.h.erb +++ b/templates/include/prism/ast.h.erb @@ -212,6 +212,8 @@ typedef enum pm_<%= flag.human %> { /** <%= value.comment %> */ PM_<%= flag.human.upcase %>_<%= value.name %> = <%= 1 << (index + Prism::Template::COMMON_FLAGS_COUNT) %>, <%- end -%> + + PM_<%= flag.human.upcase %>_LAST, } pm_<%= flag.human %>_t; <%- end -%> From 610a24105c3633d312c7b230089aa69168738f04 Mon Sep 17 00:00:00 2001 From: Jun Aruga Date: Tue, 30 Sep 2025 14:06:24 +0100 Subject: [PATCH 154/333] CI: build-ibm: Use nproc instead of hard-coded number 2. --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 61624dee13..3e47e57974 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -94,7 +94,7 @@ jobs: sudo apt-get update sudo apt-get install ruby-full bundler libyaml-dev - name: Install dependencies - run: sudo bundle install --jobs 2 + run: sudo bundle install --jobs $(nproc) - name: Run Ruby tests run: bundle exec rake shell: bash From 474ad4259035c3df03f7b4b563ccd11cbac51ce6 Mon Sep 17 00:00:00 2001 From: Earlopain <14981592+Earlopain@users.noreply.github.com> Date: Wed, 1 Oct 2025 19:36:03 +0200 Subject: [PATCH 155/333] Clear `STATIC_LITERAL` flag on interpolated strings This is pretty much a more conservative redo of https://github.com/ruby/prism/commit/4052d93cf852989b07d2f5433aaf85cf775de093 The static literal flag must be removed. But frozen/modifiable state should be retained because they are in part derived from the frozen string literal comment. --- snapshots/character_literal.txt | 2 +- snapshots/dos_endings.txt | 4 +- snapshots/dstring.txt | 2 +- snapshots/heredocs_leading_whitespace.txt | 4 +- snapshots/heredocs_nested.txt | 2 +- snapshots/heredocs_with_fake_newlines.txt | 2 +- snapshots/heredocs_with_ignored_newlines.txt | 2 +- snapshots/seattlerb/difficult0_.txt | 2 +- snapshots/seattlerb/dstr_evstr.txt | 2 +- snapshots/seattlerb/dstr_str.txt | 2 +- snapshots/seattlerb/heredoc_nested.txt | 4 +- snapshots/seattlerb/heredoc_squiggly.txt | 2 +- .../heredoc_squiggly_blank_lines.txt | 2 +- snapshots/seattlerb/heredoc_squiggly_tabs.txt | 2 +- .../seattlerb/heredoc_squiggly_tabs_extra.txt | 2 +- .../heredoc_squiggly_visually_blank_lines.txt | 2 +- .../str_lit_concat_bad_encodings.txt | 2 +- snapshots/seattlerb/str_str.txt | 2 +- snapshots/seattlerb/str_str_str.txt | 2 +- snapshots/spanning_heredoc.txt | 10 +-- .../string_concatination_frozen_false.txt | 70 +++++++++++++++++++ .../string_concatination_frozen_true.txt | 70 +++++++++++++++++++ snapshots/strings.txt | 2 +- snapshots/tilde_heredocs.txt | 20 +++--- snapshots/unparser/corpus/literal/literal.txt | 2 +- snapshots/unparser/corpus/semantic/dstr.txt | 4 +- snapshots/whitequark/dedenting_heredoc.txt | 20 +++--- ...olating_heredoc_fake_line_continuation.txt | 2 +- ...nterpolating_heredoc_line_continuation.txt | 2 +- snapshots/whitequark/parser_bug_640.txt | 2 +- snapshots/whitequark/ruby_bug_11990.txt | 2 +- .../whitequark/slash_newline_in_heredocs.txt | 2 +- src/prism.c | 7 +- .../string_concatination_frozen_false.txt | 5 ++ .../string_concatination_frozen_true.txt | 5 ++ 35 files changed, 212 insertions(+), 57 deletions(-) create mode 100644 snapshots/string_concatination_frozen_false.txt create mode 100644 snapshots/string_concatination_frozen_true.txt create mode 100644 test/prism/fixtures/string_concatination_frozen_false.txt create mode 100644 test/prism/fixtures/string_concatination_frozen_true.txt diff --git a/snapshots/character_literal.txt b/snapshots/character_literal.txt index 89abc5473c..cf1023cc5b 100644 --- a/snapshots/character_literal.txt +++ b/snapshots/character_literal.txt @@ -17,7 +17,7 @@ │ ├── flags: ∅ │ └── arguments: (length: 1) │ └── @ InterpolatedStringNode (location: (2,2)-(2,11)) - │ ├── flags: static_literal + │ ├── flags: ∅ │ ├── opening_loc: ∅ │ ├── parts: (length: 2) │ │ ├── @ StringNode (location: (2,2)-(2,9)) diff --git a/snapshots/dos_endings.txt b/snapshots/dos_endings.txt index 69d6b7cd7e..6ddb8b0a93 100644 --- a/snapshots/dos_endings.txt +++ b/snapshots/dos_endings.txt @@ -17,7 +17,7 @@ │ │ ├── flags: ∅ │ │ └── arguments: (length: 1) │ │ └── @ InterpolatedStringNode (location: (1,5)-(2,12)) - │ │ ├── flags: static_literal + │ │ ├── flags: ∅ │ │ ├── opening_loc: ∅ │ │ ├── parts: (length: 2) │ │ │ ├── @ StringNode (location: (1,5)-(1,9)) @@ -86,7 +86,7 @@ │ │ ├── flags: ∅ │ │ ├── receiver: │ │ │ @ InterpolatedStringNode (location: (17,8)-(17,14)) - │ │ │ ├── flags: static_literal + │ │ │ ├── flags: ∅ │ │ │ ├── opening_loc: (17,8)-(17,14) = "<<~EOF" │ │ │ ├── parts: (length: 2) │ │ │ │ ├── @ StringNode (location: (18,0)-(19,0)) diff --git a/snapshots/dstring.txt b/snapshots/dstring.txt index 7913cd010d..c136860fc4 100644 --- a/snapshots/dstring.txt +++ b/snapshots/dstring.txt @@ -41,7 +41,7 @@ │ │ └── closing_loc: (5,7)-(5,8) = "}" │ └── closing_loc: (5,8)-(5,9) = "\"" ├── @ InterpolatedStringNode (location: (7,0)-(9,2)) - │ ├── flags: newline, static_literal + │ ├── flags: newline │ ├── opening_loc: ∅ │ ├── parts: (length: 2) │ │ ├── @ StringNode (location: (7,0)-(8,2)) diff --git a/snapshots/heredocs_leading_whitespace.txt b/snapshots/heredocs_leading_whitespace.txt index 6101cd02d3..0594f1c5dd 100644 --- a/snapshots/heredocs_leading_whitespace.txt +++ b/snapshots/heredocs_leading_whitespace.txt @@ -30,7 +30,7 @@ │ ├── closing_loc: (19,0)-(20,0) = " FOO\n" │ └── unescaped: "a\nb\n" ├── @ InterpolatedStringNode (location: (21,0)-(21,10)) - │ ├── flags: newline, static_literal + │ ├── flags: newline │ ├── opening_loc: (21,0)-(21,10) = "<<~' FOO'" │ ├── parts: (length: 2) │ │ ├── @ StringNode (location: (22,0)-(23,0)) @@ -47,7 +47,7 @@ │ │ └── unescaped: "b\n" │ └── closing_loc: (24,0)-(25,0) = " FOO\n" └── @ InterpolatedStringNode (location: (26,0)-(26,10)) - ├── flags: newline, static_literal + ├── flags: newline ├── opening_loc: (26,0)-(26,10) = "<<~' FOO'" ├── parts: (length: 2) │ ├── @ StringNode (location: (27,0)-(28,0)) diff --git a/snapshots/heredocs_nested.txt b/snapshots/heredocs_nested.txt index 08576915dc..c2d13e4bdb 100644 --- a/snapshots/heredocs_nested.txt +++ b/snapshots/heredocs_nested.txt @@ -6,7 +6,7 @@ ├── flags: ∅ └── body: (length: 2) ├── @ InterpolatedStringNode (location: (1,0)-(1,7)) - │ ├── flags: newline, static_literal, mutable + │ ├── flags: newline │ ├── opening_loc: (1,0)-(1,7) = "<<~RUBY" │ ├── parts: (length: 4) │ │ ├── @ StringNode (location: (2,0)-(3,0)) diff --git a/snapshots/heredocs_with_fake_newlines.txt b/snapshots/heredocs_with_fake_newlines.txt index df59b29b94..46892adc3d 100644 --- a/snapshots/heredocs_with_fake_newlines.txt +++ b/snapshots/heredocs_with_fake_newlines.txt @@ -12,7 +12,7 @@ │ ├── closing_loc: (13,0)-(14,0) = "RUBY\n" │ └── unescaped: " \n\n \n\n exit\n \\n\n \n\n\n\n\n argh\n \\\n \\ foo\nbar\n \f\n ok\n" ├── @ InterpolatedStringNode (location: (15,0)-(15,7)) - │ ├── flags: newline, static_literal + │ ├── flags: newline │ ├── opening_loc: (15,0)-(15,7) = "<<~RUBY" │ ├── parts: (length: 11) │ │ ├── @ StringNode (location: (16,0)-(17,0)) diff --git a/snapshots/heredocs_with_ignored_newlines.txt b/snapshots/heredocs_with_ignored_newlines.txt index 16675029e1..53b373fb3c 100644 --- a/snapshots/heredocs_with_ignored_newlines.txt +++ b/snapshots/heredocs_with_ignored_newlines.txt @@ -12,7 +12,7 @@ │ ├── closing_loc: (2,0)-(3,0) = "HERE\n" │ └── unescaped: "" └── @ InterpolatedStringNode (location: (4,0)-(4,8)) - ├── flags: newline, static_literal + ├── flags: newline ├── opening_loc: (4,0)-(4,8) = "<<~THERE" ├── parts: (length: 9) │ ├── @ StringNode (location: (5,0)-(6,0)) diff --git a/snapshots/seattlerb/difficult0_.txt b/snapshots/seattlerb/difficult0_.txt index 233440b101..da977bdc52 100644 --- a/snapshots/seattlerb/difficult0_.txt +++ b/snapshots/seattlerb/difficult0_.txt @@ -37,7 +37,7 @@ │ │ │ ├── flags: ∅ │ │ │ └── arguments: (length: 1) │ │ │ └── @ InterpolatedStringNode (location: (1,9)-(4,4)) - │ │ │ ├── flags: static_literal + │ │ │ ├── flags: ∅ │ │ │ ├── opening_loc: (1,9)-(1,10) = "'" │ │ │ ├── parts: (length: 2) │ │ │ │ ├── @ StringNode (location: (1,10)-(2,0)) diff --git a/snapshots/seattlerb/dstr_evstr.txt b/snapshots/seattlerb/dstr_evstr.txt index 143d8ff584..92a14c26e2 100644 --- a/snapshots/seattlerb/dstr_evstr.txt +++ b/snapshots/seattlerb/dstr_evstr.txt @@ -6,7 +6,7 @@ ├── flags: ∅ └── body: (length: 1) └── @ InterpolatedStringNode (location: (1,0)-(1,12)) - ├── flags: newline + ├── flags: newline, mutable ├── opening_loc: (1,0)-(1,1) = "\"" ├── parts: (length: 2) │ ├── @ EmbeddedStatementsNode (location: (1,1)-(1,7)) diff --git a/snapshots/seattlerb/dstr_str.txt b/snapshots/seattlerb/dstr_str.txt index 7b3e0e36ad..9e26a7ebc4 100644 --- a/snapshots/seattlerb/dstr_str.txt +++ b/snapshots/seattlerb/dstr_str.txt @@ -6,7 +6,7 @@ ├── flags: ∅ └── body: (length: 1) └── @ InterpolatedStringNode (location: (1,0)-(1,10)) - ├── flags: newline, static_literal, mutable + ├── flags: newline, mutable ├── opening_loc: (1,0)-(1,1) = "\"" ├── parts: (length: 2) │ ├── @ EmbeddedStatementsNode (location: (1,1)-(1,7)) diff --git a/snapshots/seattlerb/heredoc_nested.txt b/snapshots/seattlerb/heredoc_nested.txt index 4820ef6d4d..64a7d9ddca 100644 --- a/snapshots/seattlerb/heredoc_nested.txt +++ b/snapshots/seattlerb/heredoc_nested.txt @@ -6,10 +6,10 @@ ├── flags: ∅ └── body: (length: 1) └── @ ArrayNode (location: (1,0)-(7,2)) - ├── flags: newline, static_literal + ├── flags: newline ├── elements: (length: 2) │ ├── @ InterpolatedStringNode (location: (1,1)-(1,4)) - │ │ ├── flags: static_literal, mutable + │ │ ├── flags: mutable │ │ ├── opening_loc: (1,1)-(1,4) = "<flags = (pm_node_flags_t) ((part->flags | PM_NODE_FLAG_STATIC_LITERAL | PM_STRING_FLAGS_FROZEN) & ~PM_STRING_FLAGS_MUTABLE); break; case PM_INTERPOLATED_STRING_NODE: @@ -5319,7 +5324,7 @@ pm_interpolated_string_node_append(pm_interpolated_string_node_t *node, pm_node_ } else { // In all other cases, we lose the static literal flag here and // become mutable. - CLEAR_FLAGS(node); + pm_node_flag_unset((pm_node_t *) node, PM_NODE_FLAG_STATIC_LITERAL); } break; diff --git a/test/prism/fixtures/string_concatination_frozen_false.txt b/test/prism/fixtures/string_concatination_frozen_false.txt new file mode 100644 index 0000000000..abe9301408 --- /dev/null +++ b/test/prism/fixtures/string_concatination_frozen_false.txt @@ -0,0 +1,5 @@ +# frozen_string_literal: false + +'foo' 'bar' + +'foo' 'bar' "baz#{bat}" diff --git a/test/prism/fixtures/string_concatination_frozen_true.txt b/test/prism/fixtures/string_concatination_frozen_true.txt new file mode 100644 index 0000000000..829777f0a7 --- /dev/null +++ b/test/prism/fixtures/string_concatination_frozen_true.txt @@ -0,0 +1,5 @@ +# frozen_string_literal: true + +'foo' 'bar' + +'foo' 'bar' "baz#{bat}" From 4a80ba56ef104abf49b267bfedf8831aa20ce5c8 Mon Sep 17 00:00:00 2001 From: Earlopain <14981592+Earlopain@users.noreply.github.com> Date: Thu, 2 Oct 2025 09:02:08 +0200 Subject: [PATCH 156/333] Fix unintended change This is not needed for https://bugs.ruby-lang.org/issues/21187 It does not seem to change generated instructions either way but I think this is more correct. --- snapshots/seattlerb/dstr_evstr.txt | 2 +- snapshots/string_concatination_frozen_false.txt | 2 +- snapshots/string_concatination_frozen_true.txt | 2 +- src/prism.c | 5 +++-- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/snapshots/seattlerb/dstr_evstr.txt b/snapshots/seattlerb/dstr_evstr.txt index 92a14c26e2..143d8ff584 100644 --- a/snapshots/seattlerb/dstr_evstr.txt +++ b/snapshots/seattlerb/dstr_evstr.txt @@ -6,7 +6,7 @@ ├── flags: ∅ └── body: (length: 1) └── @ InterpolatedStringNode (location: (1,0)-(1,12)) - ├── flags: newline, mutable + ├── flags: newline ├── opening_loc: (1,0)-(1,1) = "\"" ├── parts: (length: 2) │ ├── @ EmbeddedStatementsNode (location: (1,1)-(1,7)) diff --git a/snapshots/string_concatination_frozen_false.txt b/snapshots/string_concatination_frozen_false.txt index c8b325931d..7346f8266e 100644 --- a/snapshots/string_concatination_frozen_false.txt +++ b/snapshots/string_concatination_frozen_false.txt @@ -39,7 +39,7 @@ │ │ ├── closing_loc: (5,10)-(5,11) = "'" │ │ └── unescaped: "bar" │ └── @ InterpolatedStringNode (location: (5,12)-(5,23)) - │ ├── flags: mutable + │ ├── flags: ∅ │ ├── opening_loc: (5,12)-(5,13) = "\"" │ ├── parts: (length: 2) │ │ ├── @ StringNode (location: (5,13)-(5,16)) diff --git a/snapshots/string_concatination_frozen_true.txt b/snapshots/string_concatination_frozen_true.txt index e94ced9387..e5263e8906 100644 --- a/snapshots/string_concatination_frozen_true.txt +++ b/snapshots/string_concatination_frozen_true.txt @@ -39,7 +39,7 @@ │ │ ├── closing_loc: (5,10)-(5,11) = "'" │ │ └── unescaped: "bar" │ └── @ InterpolatedStringNode (location: (5,12)-(5,23)) - │ ├── flags: frozen + │ ├── flags: ∅ │ ├── opening_loc: (5,12)-(5,13) = "\"" │ ├── parts: (length: 2) │ │ ├── @ StringNode (location: (5,13)-(5,16)) diff --git a/src/prism.c b/src/prism.c index 16f92f3c7f..22ac19b5e4 100644 --- a/src/prism.c +++ b/src/prism.c @@ -5281,7 +5281,8 @@ pm_interpolated_string_node_append(pm_interpolated_string_node_t *node, pm_node_ switch (PM_NODE_TYPE(part)) { case PM_STRING_NODE: // If inner string is not frozen, it stops being a static literal. We should *not* clear other flags, - // because concatenating two frozen strings (`'foo' 'bar'`) is still frozen. + // because concatenating two frozen strings (`'foo' 'bar'`) is still frozen. This holds true for + // as long as this interpolation only consists of other string literals. if (!PM_NODE_FLAG_P(part, PM_STRING_FLAGS_FROZEN)) { pm_node_flag_unset((pm_node_t *) node, PM_NODE_FLAG_STATIC_LITERAL); } @@ -5324,7 +5325,7 @@ pm_interpolated_string_node_append(pm_interpolated_string_node_t *node, pm_node_ } else { // In all other cases, we lose the static literal flag here and // become mutable. - pm_node_flag_unset((pm_node_t *) node, PM_NODE_FLAG_STATIC_LITERAL); + CLEAR_FLAGS(node); } break; From fdf9b8d24a0a30f04411ddfe068cf276537e9d4c Mon Sep 17 00:00:00 2001 From: Peter Zhu Date: Sun, 5 Oct 2025 17:29:30 -0400 Subject: [PATCH 157/333] Free current_block_exits for the program We need to free the current_block_exits in parse_program when we're done with it to prevent memory leaks. This fixes the following memory leak detected when running Ruby using `RUBY_FREE_AT_EXIT=1 ruby -nc -e "break"`: Direct leak of 32 byte(s) in 1 object(s) allocated from: #0 0x5bd3c5bc66c8 in realloc (miniruby+0x616c8) (BuildId: ba6a96e5a060aec6fd9f05ed7e95d9627e1dbd74) #1 0x5bd3c5f91fd9 in pm_node_list_grow prism/templates/src/node.c.erb:35:40 #2 0x5bd3c5f91e9d in pm_node_list_append prism/templates/src/node.c.erb:48:9 #3 0x5bd3c6001fa0 in parse_block_exit prism/prism.c:15788:17 #4 0x5bd3c5fee155 in parse_expression_prefix prism/prism.c:19221:50 #5 0x5bd3c5fe9970 in parse_expression prism/prism.c:22235:23 #6 0x5bd3c5fe0586 in parse_statements prism/prism.c:13976:27 #7 0x5bd3c5fd6792 in parse_program prism/prism.c:22508:40 --- src/prism.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/prism.c b/src/prism.c index 22ac19b5e4..f85a69332e 100644 --- a/src/prism.c +++ b/src/prism.c @@ -22524,9 +22524,10 @@ parse_program(pm_parser_t *parser) { statements = wrap_statements(parser, statements); } else { flush_block_exits(parser, previous_block_exits); - pm_node_list_free(¤t_block_exits); } + pm_node_list_free(¤t_block_exits); + // If this is an empty file, then we're still going to parse all of the // statements in order to gather up all of the comments and such. Here we'll // correct the location information. From bde06294bd9c8b8659d06e73e270a348e743ffcb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 6 Oct 2025 16:09:00 +0000 Subject: [PATCH 158/333] Bump the java-deps group in /java-wasm with 4 updates Bumps the java-deps group in /java-wasm with 4 updates: [com.dylibso.chicory:bom](https://github.com/dylibso/chicory), com.dylibso.chicory:annotations-processor, [com.dylibso.chicory:chicory-compiler-maven-plugin](https://github.com/dylibso/chicory) and [org.junit.jupiter:junit-jupiter-engine](https://github.com/junit-team/junit-framework). Updates `com.dylibso.chicory:bom` from 1.5.1 to 1.5.2 - [Release notes](https://github.com/dylibso/chicory/releases) - [Commits](https://github.com/dylibso/chicory/compare/1.5.1...1.5.2) Updates `com.dylibso.chicory:annotations-processor` from 1.5.1 to 1.5.2 Updates `com.dylibso.chicory:chicory-compiler-maven-plugin` from 1.5.1 to 1.5.2 - [Release notes](https://github.com/dylibso/chicory/releases) - [Commits](https://github.com/dylibso/chicory/compare/1.5.1...1.5.2) Updates `org.junit.jupiter:junit-jupiter-engine` from 5.13.4 to 6.0.0 - [Release notes](https://github.com/junit-team/junit-framework/releases) - [Commits](https://github.com/junit-team/junit-framework/compare/r5.13.4...r6.0.0) Updates `com.dylibso.chicory:annotations-processor` from 1.5.1 to 1.5.2 Updates `com.dylibso.chicory:chicory-compiler-maven-plugin` from 1.5.1 to 1.5.2 - [Release notes](https://github.com/dylibso/chicory/releases) - [Commits](https://github.com/dylibso/chicory/compare/1.5.1...1.5.2) --- updated-dependencies: - dependency-name: com.dylibso.chicory:bom dependency-version: 1.5.2 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: java-deps - dependency-name: com.dylibso.chicory:annotations-processor dependency-version: 1.5.2 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: java-deps - dependency-name: com.dylibso.chicory:chicory-compiler-maven-plugin dependency-version: 1.5.2 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: java-deps - dependency-name: org.junit.jupiter:junit-jupiter-engine dependency-version: 6.0.0 dependency-type: direct:development update-type: version-update:semver-major dependency-group: java-deps - dependency-name: com.dylibso.chicory:annotations-processor dependency-version: 1.5.2 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: java-deps - dependency-name: com.dylibso.chicory:chicory-compiler-maven-plugin dependency-version: 1.5.2 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: java-deps ... Signed-off-by: dependabot[bot] --- java-wasm/pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/java-wasm/pom.xml b/java-wasm/pom.xml index b093de2dd9..ac49aa1345 100644 --- a/java-wasm/pom.xml +++ b/java-wasm/pom.xml @@ -15,8 +15,8 @@ 11 11 - 1.5.1 - 5.13.4 + 1.5.2 + 6.0.0 From f6befc3a786cdc3572735ccf2e3b0c6d51015429 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 6 Oct 2025 16:12:30 +0000 Subject: [PATCH 159/333] Bump sorbet Bumps the ruby-deps group with 1 update in the /gemfiles/typecheck directory: [sorbet](https://github.com/sorbet/sorbet). Updates `sorbet` from 0.6.12586 to 0.6.12627 - [Release notes](https://github.com/sorbet/sorbet/releases) - [Commits](https://github.com/sorbet/sorbet/commits) --- updated-dependencies: - dependency-name: sorbet dependency-version: 0.6.12627 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps ... Signed-off-by: dependabot[bot] --- gemfiles/typecheck/Gemfile.lock | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/gemfiles/typecheck/Gemfile.lock b/gemfiles/typecheck/Gemfile.lock index 5e407195fa..844b369f7a 100644 --- a/gemfiles/typecheck/Gemfile.lock +++ b/gemfiles/typecheck/Gemfile.lock @@ -62,14 +62,14 @@ GEM sexp_processor (~> 4.16) securerandom (0.4.1) sexp_processor (4.17.3) - sorbet (0.6.12586) - sorbet-static (= 0.6.12586) - sorbet-runtime (0.6.12586) - sorbet-static (0.6.12586-universal-darwin) - sorbet-static (0.6.12586-x86_64-linux) - sorbet-static-and-runtime (0.6.12586) - sorbet (= 0.6.12586) - sorbet-runtime (= 0.6.12586) + sorbet (0.6.12627) + sorbet-static (= 0.6.12627) + sorbet-runtime (0.6.12627) + sorbet-static (0.6.12627-universal-darwin) + sorbet-static (0.6.12627-x86_64-linux) + sorbet-static-and-runtime (0.6.12627) + sorbet (= 0.6.12627) + sorbet-runtime (= 0.6.12627) spoom (1.6.1) erubi (>= 1.10.0) prism (>= 0.28.0) From c0f3ea703db5c86dd22895fddb570630b08fae8a Mon Sep 17 00:00:00 2001 From: Takashi Kokubun Date: Mon, 6 Oct 2025 16:56:10 -0700 Subject: [PATCH 160/333] Add a workflow to sync commits to ruby/ruby (#3673) --- .github/workflows/sync-ruby.yml | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .github/workflows/sync-ruby.yml diff --git a/.github/workflows/sync-ruby.yml b/.github/workflows/sync-ruby.yml new file mode 100644 index 0000000000..29c4344914 --- /dev/null +++ b/.github/workflows/sync-ruby.yml @@ -0,0 +1,33 @@ +name: Sync ruby +on: + push: + branches: [master] +jobs: + sync: + name: Sync ruby + runs-on: ubuntu-latest + if: ${{ github.repository_owner == 'ruby' }} + steps: + - uses: actions/checkout@v5 + + - name: Create GitHub App token + id: app-token + uses: actions/create-github-app-token@v2 + with: + app-id: 2060836 + private-key: ${{ secrets.RUBY_SYNC_DEFAULT_GEMS_PRIVATE_KEY }} + owner: ruby + repositories: ruby + + - name: Sync to ruby/ruby + uses: convictional/trigger-workflow-and-wait@v1.6.5 + with: + owner: ruby + repo: ruby + workflow_file_name: sync_default_gems.yml + github_token: ${{ steps.app-token.outputs.token }} + ref: master + client_payload: | + {"gem":"${{ github.event.repository.name }}","before":"${{ github.event.before }}","after":"${{ github.event.after }}"} + propagate_failure: true + wait_interval: 10 From c89ca2af12ba20b4fd2c5ff43ebe25da1d81d8db Mon Sep 17 00:00:00 2001 From: Takashi Kokubun Date: Mon, 6 Oct 2025 16:56:43 -0700 Subject: [PATCH 161/333] sync-ruby.yml: Fix the target push branch --- .github/workflows/sync-ruby.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sync-ruby.yml b/.github/workflows/sync-ruby.yml index 29c4344914..df0eaef010 100644 --- a/.github/workflows/sync-ruby.yml +++ b/.github/workflows/sync-ruby.yml @@ -1,7 +1,7 @@ name: Sync ruby on: push: - branches: [master] + branches: [main] jobs: sync: name: Sync ruby From e1910d4492a7026aa19938b126dec748057a7573 Mon Sep 17 00:00:00 2001 From: Earlopain <14981592+Earlopain@users.noreply.github.com> Date: Wed, 8 Oct 2025 14:54:14 +0200 Subject: [PATCH 162/333] For these special cases, there exists no optional argument type. Since a endless method is started with `=`, there was ambiguity here. We have to simply reject these in all cases. This adds a new error for the following reason: * `def foo arg = nil` is interpreted as a normal method call with optional `arg` without matching `end` * `def foo *arg = nil; end` is interpreted as a endless method call that has body `nil` with extraneous `end` `def foo *arg = nil` is somewhere inbetween and I don't know how to otherwise indicate the error. Now the second case above also shows the newly added error message. Fixes [Bug #21623] --- config.yml | 1 + src/prism.c | 32 +++++++++++++++++++ templates/src/diagnostic.c.erb | 1 + test/prism/errors/def_with_optional_splat.txt | 6 ++++ ...endless_method_command_call_parameters.txt | 24 ++++++++++++++ 5 files changed, 64 insertions(+) create mode 100644 test/prism/errors/def_with_optional_splat.txt create mode 100644 test/prism/errors/endless_method_command_call_parameters.txt diff --git a/config.yml b/config.yml index a8a8e70aac..ed5c9d8b9c 100644 --- a/config.yml +++ b/config.yml @@ -60,6 +60,7 @@ errors: - CONDITIONAL_WHILE_PREDICATE - CONSTANT_PATH_COLON_COLON_CONSTANT - DEF_ENDLESS + - DEF_ENDLESS_PARAMETERS - DEF_ENDLESS_SETTER - DEF_NAME - DEF_PARAMS_TERM diff --git a/src/prism.c b/src/prism.c index f85a69332e..cc1896ee34 100644 --- a/src/prism.c +++ b/src/prism.c @@ -14612,6 +14612,18 @@ update_parameter_state(pm_parser_t *parser, pm_token_t *token, pm_parameters_ord return true; } +/** + * Ensures that after parsing a parameter, the next token is not `=`. + * Some parameters like `def(* = 1)` cannot become optional. When no parens + * are present like in `def * = 1`, this creates ambiguity with endless method definitions. + */ +static inline void +refute_optional_parameter(pm_parser_t *parser) { + if (match1(parser, PM_TOKEN_EQUAL)) { + pm_parser_err_previous(parser, PM_ERR_DEF_ENDLESS_PARAMETERS); + } +} + /** * Parse a list of parameters on a method definition. */ @@ -14664,6 +14676,10 @@ parse_parameters( parser->current_scope->parameters |= PM_SCOPE_PARAMETERS_FORWARDING_BLOCK; } + if (!uses_parentheses) { + refute_optional_parameter(parser); + } + pm_block_parameter_node_t *param = pm_block_parameter_node_create(parser, &name, &operator); if (repeated) { pm_node_flag_set_repeated_parameter((pm_node_t *)param); @@ -14685,6 +14701,10 @@ parse_parameters( bool succeeded = update_parameter_state(parser, &parser->current, &order); parser_lex(parser); + if (!uses_parentheses) { + refute_optional_parameter(parser); + } + parser->current_scope->parameters |= PM_SCOPE_PARAMETERS_FORWARDING_ALL; pm_forwarding_parameter_node_t *param = pm_forwarding_parameter_node_create(parser, &parser->previous); @@ -14866,6 +14886,10 @@ parse_parameters( context_pop(parser); pm_parameters_node_keywords_append(params, param); + if (!uses_parentheses) { + refute_optional_parameter(parser); + } + // If parsing the value of the parameter resulted in error recovery, // then we can put a missing node in its place and stop parsing the // parameters entirely now. @@ -14897,6 +14921,10 @@ parse_parameters( parser->current_scope->parameters |= PM_SCOPE_PARAMETERS_FORWARDING_POSITIONALS; } + if (!uses_parentheses) { + refute_optional_parameter(parser); + } + pm_node_t *param = (pm_node_t *) pm_rest_parameter_node_create(parser, &operator, &name); if (repeated) { pm_node_flag_set_repeated_parameter(param); @@ -14945,6 +14973,10 @@ parse_parameters( } } + if (!uses_parentheses) { + refute_optional_parameter(parser); + } + if (params->keyword_rest == NULL) { pm_parameters_node_keyword_rest_set(params, param); } else { diff --git a/templates/src/diagnostic.c.erb b/templates/src/diagnostic.c.erb index 9a30a57e3b..2373253085 100644 --- a/templates/src/diagnostic.c.erb +++ b/templates/src/diagnostic.c.erb @@ -144,6 +144,7 @@ static const pm_diagnostic_data_t diagnostic_messages[PM_DIAGNOSTIC_ID_MAX] = { [PM_ERR_CONDITIONAL_WHILE_PREDICATE] = { "expected a predicate expression for the `while` statement", PM_ERROR_LEVEL_SYNTAX }, [PM_ERR_CONSTANT_PATH_COLON_COLON_CONSTANT] = { "expected a constant after the `::` operator", PM_ERROR_LEVEL_SYNTAX }, [PM_ERR_DEF_ENDLESS] = { "could not parse the endless method body", PM_ERROR_LEVEL_SYNTAX }, + [PM_ERR_DEF_ENDLESS_PARAMETERS] = { "could not parse the endless method parameters", PM_ERROR_LEVEL_SYNTAX }, [PM_ERR_DEF_ENDLESS_SETTER] = { "invalid method name; a setter method cannot be defined in an endless method definition", PM_ERROR_LEVEL_SYNTAX }, [PM_ERR_DEF_NAME] = { "unexpected %s; expected a method name", PM_ERROR_LEVEL_SYNTAX }, [PM_ERR_DEF_PARAMS_TERM] = { "expected a delimiter to close the parameters", PM_ERROR_LEVEL_SYNTAX }, diff --git a/test/prism/errors/def_with_optional_splat.txt b/test/prism/errors/def_with_optional_splat.txt new file mode 100644 index 0000000000..74a833ceec --- /dev/null +++ b/test/prism/errors/def_with_optional_splat.txt @@ -0,0 +1,6 @@ +def foo(*bar = nil); end + ^ unexpected '='; expected a `)` to close the parameters + ^ unexpected ')', expecting end-of-input + ^ unexpected ')', ignoring it + ^~~ unexpected 'end', ignoring it + diff --git a/test/prism/errors/endless_method_command_call_parameters.txt b/test/prism/errors/endless_method_command_call_parameters.txt new file mode 100644 index 0000000000..94c4f88fc8 --- /dev/null +++ b/test/prism/errors/endless_method_command_call_parameters.txt @@ -0,0 +1,24 @@ +def f x: = 1 + ^~ could not parse the endless method parameters + +def f ... = 1 + ^~~ could not parse the endless method parameters + +def f * = 1 + ^ could not parse the endless method parameters + +def f ** = 1 + ^~ could not parse the endless method parameters + +def f & = 1 + ^ could not parse the endless method parameters + +def f *a = 1 + ^ could not parse the endless method parameters + +def f **a = 1 + ^ could not parse the endless method parameters + +def f &a = 1 + ^ could not parse the endless method parameters + From 7574837b7b4217e00b0486f3934f60ef67453389 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Thu, 9 Oct 2025 09:18:12 -0400 Subject: [PATCH 163/333] Bump to v --- CHANGELOG.md | 12 +++- Gemfile.lock | 12 ++-- docs/releasing.md | 4 +- ext/prism/extension.h | 2 +- gemfiles/2.7/Gemfile.lock | 2 +- gemfiles/3.0/Gemfile.lock | 2 +- gemfiles/3.1/Gemfile.lock | 4 +- gemfiles/3.2/Gemfile.lock | 4 +- gemfiles/3.3/Gemfile.lock | 6 +- gemfiles/3.4/Gemfile.lock | 6 +- gemfiles/3.5/Gemfile.lock | 4 +- gemfiles/jruby/Gemfile.lock | 4 +- gemfiles/truffleruby/Gemfile.lock | 4 +- gemfiles/typecheck/Gemfile.lock | 61 +++++++++++---------- 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 +- 24 files changed, 84 insertions(+), 69 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3f10fc259d..948ea76b56 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,15 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a ## [Unreleased] +## [1.5.2] - 2025-10-09 + +### Changed + +- Fix character literal forced encoding when a unicode escape sequence is used. +- Reject `1 if foo = bar baz`. +- Clear static literal flag on interpolated strings. +- Reject optional argument/endless method definition ambiguity. + ## [1.5.1] - 2025-09-13 ### Changed @@ -676,7 +685,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.5.1...HEAD +[unreleased]: https://github.com/ruby/prism/compare/v1.5.2...HEAD +[1.5.2]: https://github.com/ruby/prism/compare/v1.5.1...v1.5.2 [1.5.1]: https://github.com/ruby/prism/compare/v1.5.0...v1.5.1 [1.5.0]: https://github.com/ruby/prism/compare/v1.4.0...v1.5.0 [1.4.0]: https://github.com/ruby/prism/compare/v1.3.0...v1.4.0 diff --git a/Gemfile.lock b/Gemfile.lock index 19d0fb4a86..fd87e1034e 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - prism (1.5.1) + prism (1.5.2) GEM remote: https://rubygems.org/ @@ -9,10 +9,10 @@ GEM ast (2.4.3) benchmark-ips (2.14.0) date (3.4.1) - erb (5.0.2) + erb (5.0.3) ffi (1.17.2) mini_portile2 (2.8.9) - nokogiri (1.18.9) + nokogiri (1.18.10) mini_portile2 (~> 2.8.2) racc (~> 1.4) onigmo (0.1.0) @@ -27,18 +27,20 @@ GEM rake (13.3.0) rake-compiler (1.3.0) rake - rdoc (6.14.2) + rdoc (6.15.0) erb psych (>= 4.0.0) + tsort ruby_memcheck (3.0.1) nokogiri ruby_parser (3.21.1) racc (~> 1.5) sexp_processor (~> 4.16) - sexp_processor (4.17.3) + sexp_processor (4.17.4) stringio (3.1.7) test-unit (3.7.0) power_assert + tsort (0.2.0) PLATFORMS ruby diff --git a/docs/releasing.md b/docs/releasing.md index d17602a320..f6bc69013d 100644 --- a/docs/releasing.md +++ b/docs/releasing.md @@ -47,7 +47,9 @@ bundle install * Update the version-specific lockfiles: ```sh -bin/prism bundle install +for VERSION in "2.7" "3.0" "3.1" "3.2" "3.3" "3.4"; do docker run -it --rm -v "$PWD":/usr/src/app -w /usr/src/app -e BUNDLE_GEMFILE="gemfiles/$VERSION/Gemfile" "ruby:$VERSION" bundle update; done +docker run -it --rm -v "$PWD":/usr/src/app -w /usr/src/app -e BUNDLE_GEMFILE="gemfiles/3.5/Gemfile" ruby:3.5.0-preview1 bundle update +BUNDLE_GEMFILE=gemfiles/truffleruby/Gemfile chruby-exec truffleruby -- bundle update ``` * Update the cargo lockfiles: diff --git a/ext/prism/extension.h b/ext/prism/extension.h index b18e770d92..1f15b775ff 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.5.1" +#define EXPECTED_PRISM_VERSION "1.5.2" #include #include diff --git a/gemfiles/2.7/Gemfile.lock b/gemfiles/2.7/Gemfile.lock index 8afea53a6a..ec55ee7fd6 100644 --- a/gemfiles/2.7/Gemfile.lock +++ b/gemfiles/2.7/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: ../.. specs: - prism (1.5.1) + prism (1.5.2) GEM remote: https://rubygems.org/ diff --git a/gemfiles/3.0/Gemfile.lock b/gemfiles/3.0/Gemfile.lock index da1f5bbb11..6931a2ae25 100644 --- a/gemfiles/3.0/Gemfile.lock +++ b/gemfiles/3.0/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: ../.. specs: - prism (1.5.1) + prism (1.5.2) GEM remote: https://rubygems.org/ diff --git a/gemfiles/3.1/Gemfile.lock b/gemfiles/3.1/Gemfile.lock index 5a460c4c93..89c201eb62 100644 --- a/gemfiles/3.1/Gemfile.lock +++ b/gemfiles/3.1/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: ../.. specs: - prism (1.5.1) + prism (1.5.2) GEM remote: https://rubygems.org/ @@ -9,7 +9,7 @@ GEM ast (2.4.3) logger (1.7.0) mini_portile2 (2.8.9) - nokogiri (1.18.9) + nokogiri (1.18.10) mini_portile2 (~> 2.8.2) racc (~> 1.4) onigmo (0.1.0) diff --git a/gemfiles/3.2/Gemfile.lock b/gemfiles/3.2/Gemfile.lock index 6d3107ce5b..5dc9eef55b 100644 --- a/gemfiles/3.2/Gemfile.lock +++ b/gemfiles/3.2/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: ../.. specs: - prism (1.5.1) + prism (1.5.2) GEM remote: https://rubygems.org/ @@ -9,7 +9,7 @@ GEM ast (2.4.3) logger (1.7.0) mini_portile2 (2.8.9) - nokogiri (1.18.9) + nokogiri (1.18.10) mini_portile2 (~> 2.8.2) racc (~> 1.4) onigmo (0.1.0) diff --git a/gemfiles/3.3/Gemfile.lock b/gemfiles/3.3/Gemfile.lock index 066374e0f3..4d0316184d 100644 --- a/gemfiles/3.3/Gemfile.lock +++ b/gemfiles/3.3/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: ../.. specs: - prism (1.5.1) + prism (1.5.2) GEM remote: https://rubygems.org/ @@ -9,7 +9,7 @@ GEM ast (2.4.3) logger (1.7.0) mini_portile2 (2.8.9) - nokogiri (1.18.9) + nokogiri (1.18.10) mini_portile2 (~> 2.8.2) racc (~> 1.4) onigmo (0.1.0) @@ -50,4 +50,4 @@ RUBY VERSION ruby 3.3.0p0 BUNDLED WITH - 2.5.16 + 2.5.22 diff --git a/gemfiles/3.4/Gemfile.lock b/gemfiles/3.4/Gemfile.lock index dbb356048b..0c062f7708 100644 --- a/gemfiles/3.4/Gemfile.lock +++ b/gemfiles/3.4/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: ../.. specs: - prism (1.5.1) + prism (1.5.2) GEM remote: https://rubygems.org/ @@ -9,7 +9,7 @@ GEM ast (2.4.3) logger (1.7.0) mini_portile2 (2.8.9) - nokogiri (1.18.9) + nokogiri (1.18.10) mini_portile2 (~> 2.8.2) racc (~> 1.4) onigmo (0.1.0) @@ -50,4 +50,4 @@ RUBY VERSION ruby 3.4.1p0 BUNDLED WITH - 2.6.2 + 2.6.9 diff --git a/gemfiles/3.5/Gemfile.lock b/gemfiles/3.5/Gemfile.lock index 57768351bb..b239919e13 100644 --- a/gemfiles/3.5/Gemfile.lock +++ b/gemfiles/3.5/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: ../.. specs: - prism (1.5.1) + prism (1.5.2) GEM remote: https://rubygems.org/ @@ -10,7 +10,7 @@ GEM ffi (1.17.2) logger (1.7.0) mini_portile2 (2.8.9) - nokogiri (1.18.9) + nokogiri (1.18.10) mini_portile2 (~> 2.8.2) racc (~> 1.4) onigmo (0.1.0) diff --git a/gemfiles/jruby/Gemfile.lock b/gemfiles/jruby/Gemfile.lock index e8227137ec..31d22f163f 100644 --- a/gemfiles/jruby/Gemfile.lock +++ b/gemfiles/jruby/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: ../.. specs: - prism (1.5.1) + prism (1.5.2) GEM remote: https://rubygems.org/ @@ -44,4 +44,4 @@ RUBY VERSION ruby 3.4.2p0 (jruby 10.0.0.0) BUNDLED WITH - 2.6.3 + 2.7.2 diff --git a/gemfiles/truffleruby/Gemfile.lock b/gemfiles/truffleruby/Gemfile.lock index b2b402f7f2..a9c0f1a057 100644 --- a/gemfiles/truffleruby/Gemfile.lock +++ b/gemfiles/truffleruby/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: ../.. specs: - prism (1.5.1) + prism (1.5.2) GEM remote: https://rubygems.org/ @@ -37,4 +37,4 @@ RUBY VERSION ruby 3.3.7p0 (truffleruby 25.0.0) BUNDLED WITH - 2.4.19 + 2.5.22 diff --git a/gemfiles/typecheck/Gemfile.lock b/gemfiles/typecheck/Gemfile.lock index 844b369f7a..a30bf3a007 100644 --- a/gemfiles/typecheck/Gemfile.lock +++ b/gemfiles/typecheck/Gemfile.lock @@ -1,7 +1,7 @@ GEM remote: https://rubygems.org/ specs: - activesupport (8.0.2) + activesupport (8.0.3) base64 benchmark (>= 0.3) bigdecimal @@ -15,34 +15,34 @@ GEM tzinfo (~> 2.0, >= 2.0.5) uri (>= 0.13.1) ast (2.4.3) - base64 (0.2.0) - benchmark (0.4.0) - bigdecimal (3.1.9) + base64 (0.3.0) + benchmark (0.4.1) + bigdecimal (3.3.0) concurrent-ruby (1.3.5) - connection_pool (2.5.0) - csv (3.3.3) - drb (2.2.1) + connection_pool (2.5.4) + csv (3.3.5) + drb (2.2.3) erubi (1.13.1) ffi (1.17.2-arm64-darwin) ffi (1.17.2-x86_64-linux-gnu) fileutils (1.7.3) i18n (1.14.7) concurrent-ruby (~> 1.0) - json (2.10.2) - language_server-protocol (3.17.0.4) + json (2.15.1) + language_server-protocol (3.17.0.5) listen (3.9.0) rb-fsevent (~> 0.10, >= 0.10.3) rb-inotify (~> 0.9, >= 0.9.10) logger (1.7.0) - minitest (5.25.5) + minitest (5.26.0) mutex_m (0.3.0) netrc (0.11.0) - parallel (1.26.3) + parallel (1.27.0) parser (3.3.9.0) ast (~> 2.4.1) racc power_assert (2.0.5) - prism (1.4.0) + prism (1.5.1) racc (1.8.1) rainbow (3.1.1) rake (13.3.0) @@ -51,29 +51,30 @@ GEM rb-fsevent (0.11.2) rb-inotify (0.11.1) ffi (~> 1.0) - rbi (0.3.1) + rbi (0.3.6) prism (~> 1.0) rbs (>= 3.4.4) - sorbet-runtime (>= 0.5.9204) rbs (3.9.5) logger + rexml (3.4.4) ruby_parser (3.21.1) racc (~> 1.5) sexp_processor (~> 4.16) securerandom (0.4.1) - sexp_processor (4.17.3) - sorbet (0.6.12627) - sorbet-static (= 0.6.12627) - sorbet-runtime (0.6.12627) - sorbet-static (0.6.12627-universal-darwin) - sorbet-static (0.6.12627-x86_64-linux) - sorbet-static-and-runtime (0.6.12627) - sorbet (= 0.6.12627) - sorbet-runtime (= 0.6.12627) - spoom (1.6.1) + sexp_processor (4.17.4) + sorbet (0.6.12632) + sorbet-static (= 0.6.12632) + sorbet-runtime (0.6.12632) + sorbet-static (0.6.12632-universal-darwin) + sorbet-static (0.6.12632-x86_64-linux) + sorbet-static-and-runtime (0.6.12632) + sorbet (= 0.6.12632) + sorbet-runtime (= 0.6.12632) + spoom (1.6.3) erubi (>= 1.10.0) prism (>= 0.28.0) - rbi (>= 0.2.3) + rbi (>= 0.3.3) + rexml (>= 3.2.6) sorbet-static-and-runtime (>= 0.5.10187) thor (>= 0.19.2) steep (1.10.0) @@ -93,7 +94,7 @@ GEM strscan (>= 1.0.0) terminal-table (>= 2, < 5) uri (>= 0.12.0) - strscan (3.1.2) + strscan (3.1.5) tapioca (0.16.11) benchmark bundler (>= 2.2.25) @@ -111,10 +112,10 @@ GEM thor (1.4.0) tzinfo (2.0.6) concurrent-ruby (~> 1.0) - unicode-display_width (3.1.4) - unicode-emoji (~> 4.0, >= 4.0.4) - unicode-emoji (4.0.4) - uri (1.0.3) + unicode-display_width (3.2.0) + unicode-emoji (~> 4.1) + unicode-emoji (4.1.0) + uri (1.0.4) yard (0.9.37) yard-sorbet (0.9.0) sorbet-runtime diff --git a/include/prism/version.h b/include/prism/version.h index 697ba0647d..c0d82dc8e2 100644 --- a/include/prism/version.h +++ b/include/prism/version.h @@ -19,11 +19,11 @@ /** * The patch version of the Prism library as an int. */ -#define PRISM_VERSION_PATCH 1 +#define PRISM_VERSION_PATCH 2 /** * The version of the Prism library as a constant string. */ -#define PRISM_VERSION "1.5.1" +#define PRISM_VERSION "1.5.2" #endif diff --git a/javascript/package.json b/javascript/package.json index be505af226..43a9553852 100644 --- a/javascript/package.json +++ b/javascript/package.json @@ -1,6 +1,6 @@ { "name": "@ruby/prism", - "version": "1.5.1", + "version": "1.5.2", "description": "Prism Ruby parser", "type": "module", "main": "src/index.js", diff --git a/prism.gemspec b/prism.gemspec index 65305d0ec1..8f6075ad96 100644 --- a/prism.gemspec +++ b/prism.gemspec @@ -2,7 +2,7 @@ Gem::Specification.new do |spec| spec.name = "prism" - spec.version = "1.5.1" + spec.version = "1.5.2" spec.authors = ["Shopify"] spec.email = ["ruby@shopify.com"] diff --git a/rust/Cargo.lock b/rust/Cargo.lock index 35f580e271..a3f8b92980 100644 --- a/rust/Cargo.lock +++ b/rust/Cargo.lock @@ -224,7 +224,7 @@ checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" [[package]] name = "ruby-prism" -version = "1.5.1" +version = "1.5.2" dependencies = [ "ruby-prism-sys", "serde", @@ -233,7 +233,7 @@ dependencies = [ [[package]] name = "ruby-prism-sys" -version = "1.5.1" +version = "1.5.2" dependencies = [ "bindgen", "cc", diff --git a/rust/ruby-prism-sys/Cargo.toml b/rust/ruby-prism-sys/Cargo.toml index b33261c657..f21c38ccff 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.5.1" +version = "1.5.2" 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 06ca4f6247..99e5fda9d0 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.5.1"); + assert_eq!(&cstring.to_string_lossy(), "1.5.2"); } #[test] diff --git a/rust/ruby-prism/Cargo.toml b/rust/ruby-prism/Cargo.toml index 9a5a84ece1..1e758164fb 100644 --- a/rust/ruby-prism/Cargo.toml +++ b/rust/ruby-prism/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ruby-prism" -version = "1.5.1" +version = "1.5.2" 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.5.1", path = "../ruby-prism-sys" } +ruby-prism-sys = { version = "1.5.2", 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 0a069e784a..a5e06c6125 100644 --- a/templates/java/org/prism/Loader.java.erb +++ b/templates/java/org/prism/Loader.java.erb @@ -102,7 +102,7 @@ public class Loader { expect((byte) 1, "prism major version does not match"); expect((byte) 5, "prism minor version does not match"); - expect((byte) 1, "prism patch version does not match"); + expect((byte) 2, "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 1f8b613a4f..046bad448b 100644 --- a/templates/javascript/src/deserialize.js.erb +++ b/templates/javascript/src/deserialize.js.erb @@ -2,7 +2,7 @@ import * as nodes from "./nodes.js"; const MAJOR_VERSION = 1; const MINOR_VERSION = 5; -const PATCH_VERSION = 1; +const PATCH_VERSION = 2; // The DataView getFloat64 function takes an optional second argument that // specifies whether the number is little-endian or big-endian. It does not diff --git a/templates/lib/prism/serialize.rb.erb b/templates/lib/prism/serialize.rb.erb index 366878f709..271631b5ac 100644 --- a/templates/lib/prism/serialize.rb.erb +++ b/templates/lib/prism/serialize.rb.erb @@ -14,7 +14,7 @@ module Prism # The patch version of prism that we are expecting to find in the serialized # strings. - PATCH_VERSION = 1 + PATCH_VERSION = 2 # Deserialize the dumped output from a request to parse or parse_file. # From ad1457fe2d82138f4dfac46e39d5b3833da2ac6a Mon Sep 17 00:00:00 2001 From: Vincent Lin Date: Sat, 11 Oct 2025 00:37:44 +0100 Subject: [PATCH 164/333] Fix broken tdop links in docs/design.md --- docs/design.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/design.md b/docs/design.md index 15045a10ce..e1bbe78168 100644 --- a/docs/design.md +++ b/docs/design.md @@ -18,11 +18,11 @@ The templated files contain all of the code required to allocate and initialize In order to provide the best possible error tolerance, the parser is hand-written. It is structured using Pratt parsing, a technique developed by Vaughan Pratt back in the 1970s. Below are a bunch of links to articles and papers that explain Pratt parsing in more detail. -* https://web.archive.org/web/20151223215421/http://hall.org.ua/halls/wizzard/pdf/Vaughan.Pratt.TDOP.pdf +* https://github.com/tdop/tdop.github.io/raw/master/original.pdf * https://tdop.github.io/ * https://journal.stuffwithstuff.com/2011/03/19/pratt-parsers-expression-parsing-made-easy/ * https://matklad.github.io/2020/04/13/simple-but-powerful-pratt-parsing.html -* https://chidiwilliams.com/post/on-recursive-descent-and-pratt-parsing/ +* https://chidiwilliams.com/posts/on-recursive-descent-and-pratt-parsing You can find most of the functions that correspond to constructs in the Pratt parsing algorithm in `prism.c`. As a couple of examples: From c7d9f2fff0da10de0ad7de58856ea1b2ac462081 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 Oct 2025 16:17:39 +0000 Subject: [PATCH 165/333] Bump the java-deps group in /java-wasm with 3 updates Bumps the java-deps group in /java-wasm with 3 updates: [com.dylibso.chicory:bom](https://github.com/dylibso/chicory), com.dylibso.chicory:annotations-processor and [com.dylibso.chicory:chicory-compiler-maven-plugin](https://github.com/dylibso/chicory). Updates `com.dylibso.chicory:bom` from 1.5.2 to 1.5.3 - [Release notes](https://github.com/dylibso/chicory/releases) - [Commits](https://github.com/dylibso/chicory/compare/1.5.2...1.5.3) Updates `com.dylibso.chicory:annotations-processor` from 1.5.2 to 1.5.3 Updates `com.dylibso.chicory:chicory-compiler-maven-plugin` from 1.5.2 to 1.5.3 - [Release notes](https://github.com/dylibso/chicory/releases) - [Commits](https://github.com/dylibso/chicory/compare/1.5.2...1.5.3) Updates `com.dylibso.chicory:annotations-processor` from 1.5.2 to 1.5.3 Updates `com.dylibso.chicory:chicory-compiler-maven-plugin` from 1.5.2 to 1.5.3 - [Release notes](https://github.com/dylibso/chicory/releases) - [Commits](https://github.com/dylibso/chicory/compare/1.5.2...1.5.3) --- updated-dependencies: - dependency-name: com.dylibso.chicory:bom dependency-version: 1.5.3 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: java-deps - dependency-name: com.dylibso.chicory:annotations-processor dependency-version: 1.5.3 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: java-deps - dependency-name: com.dylibso.chicory:chicory-compiler-maven-plugin dependency-version: 1.5.3 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: java-deps - dependency-name: com.dylibso.chicory:annotations-processor dependency-version: 1.5.3 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: java-deps - dependency-name: com.dylibso.chicory:chicory-compiler-maven-plugin dependency-version: 1.5.3 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: java-deps ... Signed-off-by: dependabot[bot] --- java-wasm/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java-wasm/pom.xml b/java-wasm/pom.xml index ac49aa1345..d09b0d9fd1 100644 --- a/java-wasm/pom.xml +++ b/java-wasm/pom.xml @@ -15,7 +15,7 @@ 11 11 - 1.5.2 + 1.5.3 6.0.0 From aa5da3b5b9f5cf09051d7be608ad6293d4a9e429 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 Oct 2025 16:21:51 +0000 Subject: [PATCH 166/333] Bump sorbet Bumps the ruby-deps group with 1 update in the /gemfiles/typecheck directory: [sorbet](https://github.com/sorbet/sorbet). Updates `sorbet` from 0.6.12632 to 0.6.12638 - [Release notes](https://github.com/sorbet/sorbet/releases) - [Commits](https://github.com/sorbet/sorbet/commits) --- updated-dependencies: - dependency-name: sorbet dependency-version: 0.6.12638 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps ... Signed-off-by: dependabot[bot] --- gemfiles/typecheck/Gemfile.lock | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/gemfiles/typecheck/Gemfile.lock b/gemfiles/typecheck/Gemfile.lock index a30bf3a007..1acebb4435 100644 --- a/gemfiles/typecheck/Gemfile.lock +++ b/gemfiles/typecheck/Gemfile.lock @@ -62,14 +62,14 @@ GEM sexp_processor (~> 4.16) securerandom (0.4.1) sexp_processor (4.17.4) - sorbet (0.6.12632) - sorbet-static (= 0.6.12632) - sorbet-runtime (0.6.12632) - sorbet-static (0.6.12632-universal-darwin) - sorbet-static (0.6.12632-x86_64-linux) - sorbet-static-and-runtime (0.6.12632) - sorbet (= 0.6.12632) - sorbet-runtime (= 0.6.12632) + sorbet (0.6.12638) + sorbet-static (= 0.6.12638) + sorbet-runtime (0.6.12638) + sorbet-static (0.6.12638-universal-darwin) + sorbet-static (0.6.12638-x86_64-linux) + sorbet-static-and-runtime (0.6.12638) + sorbet (= 0.6.12638) + sorbet-runtime (= 0.6.12638) spoom (1.6.3) erubi (>= 1.10.0) prism (>= 0.28.0) From 0b2710a6c995c8bf01849d5969c7ea4ab47092bc Mon Sep 17 00:00:00 2001 From: Nathan Froyd Date: Wed, 15 Oct 2025 13:24:56 -0400 Subject: [PATCH 167/333] explicitly cast shifted constant to unsigned to avoid undefined behavior --- src/prism.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/prism.c b/src/prism.c index cc1896ee34..d6ee50b301 100644 --- a/src/prism.c +++ b/src/prism.c @@ -8648,7 +8648,7 @@ static const uint32_t context_terminators[] = { static inline bool context_terminator(pm_context_t context, pm_token_t *token) { - return token->type < 32 && (context_terminators[context] & (1 << token->type)); + return token->type < 32 && (context_terminators[context] & (1U << token->type)); } /** From e7db2b06ab35195ec2df3fea39804c746ae73681 Mon Sep 17 00:00:00 2001 From: Nathan Froyd Date: Wed, 15 Oct 2025 13:26:01 -0400 Subject: [PATCH 168/333] explicitly cast constants in initializers as well --- src/prism.c | 106 ++++++++++++++++++++++++++-------------------------- 1 file changed, 53 insertions(+), 53 deletions(-) diff --git a/src/prism.c b/src/prism.c index d6ee50b301..0ebcae62f9 100644 --- a/src/prism.c +++ b/src/prism.c @@ -8591,59 +8591,59 @@ parser_lex_magic_comment(pm_parser_t *parser, bool semantic_token_seen) { static const uint32_t context_terminators[] = { [PM_CONTEXT_NONE] = 0, - [PM_CONTEXT_BEGIN] = (1 << PM_TOKEN_KEYWORD_ENSURE) | (1 << PM_TOKEN_KEYWORD_RESCUE) | (1 << PM_TOKEN_KEYWORD_ELSE) | (1 << PM_TOKEN_KEYWORD_END), - [PM_CONTEXT_BEGIN_ENSURE] = (1 << PM_TOKEN_KEYWORD_END), - [PM_CONTEXT_BEGIN_ELSE] = (1 << PM_TOKEN_KEYWORD_ENSURE) | (1 << PM_TOKEN_KEYWORD_END), - [PM_CONTEXT_BEGIN_RESCUE] = (1 << PM_TOKEN_KEYWORD_ENSURE) | (1 << PM_TOKEN_KEYWORD_RESCUE) | (1 << PM_TOKEN_KEYWORD_ELSE) | (1 << PM_TOKEN_KEYWORD_END), - [PM_CONTEXT_BLOCK_BRACES] = (1 << PM_TOKEN_BRACE_RIGHT), - [PM_CONTEXT_BLOCK_KEYWORDS] = (1 << PM_TOKEN_KEYWORD_END) | (1 << PM_TOKEN_KEYWORD_RESCUE) | (1 << PM_TOKEN_KEYWORD_ENSURE), - [PM_CONTEXT_BLOCK_ENSURE] = (1 << PM_TOKEN_KEYWORD_END), - [PM_CONTEXT_BLOCK_ELSE] = (1 << PM_TOKEN_KEYWORD_ENSURE) | (1 << PM_TOKEN_KEYWORD_END), - [PM_CONTEXT_BLOCK_RESCUE] = (1 << PM_TOKEN_KEYWORD_ENSURE) | (1 << PM_TOKEN_KEYWORD_RESCUE) | (1 << PM_TOKEN_KEYWORD_ELSE) | (1 << PM_TOKEN_KEYWORD_END), - [PM_CONTEXT_CASE_WHEN] = (1 << PM_TOKEN_KEYWORD_WHEN) | (1 << PM_TOKEN_KEYWORD_END) | (1 << PM_TOKEN_KEYWORD_ELSE), - [PM_CONTEXT_CASE_IN] = (1 << PM_TOKEN_KEYWORD_IN) | (1 << PM_TOKEN_KEYWORD_END) | (1 << PM_TOKEN_KEYWORD_ELSE), - [PM_CONTEXT_CLASS] = (1 << PM_TOKEN_KEYWORD_END) | (1 << PM_TOKEN_KEYWORD_RESCUE) | (1 << PM_TOKEN_KEYWORD_ENSURE), - [PM_CONTEXT_CLASS_ENSURE] = (1 << PM_TOKEN_KEYWORD_END), - [PM_CONTEXT_CLASS_ELSE] = (1 << PM_TOKEN_KEYWORD_ENSURE) | (1 << PM_TOKEN_KEYWORD_END), - [PM_CONTEXT_CLASS_RESCUE] = (1 << PM_TOKEN_KEYWORD_ENSURE) | (1 << PM_TOKEN_KEYWORD_RESCUE) | (1 << PM_TOKEN_KEYWORD_ELSE) | (1 << PM_TOKEN_KEYWORD_END), - [PM_CONTEXT_DEF] = (1 << PM_TOKEN_KEYWORD_END) | (1 << PM_TOKEN_KEYWORD_RESCUE) | (1 << PM_TOKEN_KEYWORD_ENSURE), - [PM_CONTEXT_DEF_ENSURE] = (1 << PM_TOKEN_KEYWORD_END), - [PM_CONTEXT_DEF_ELSE] = (1 << PM_TOKEN_KEYWORD_ENSURE) | (1 << PM_TOKEN_KEYWORD_END), - [PM_CONTEXT_DEF_RESCUE] = (1 << PM_TOKEN_KEYWORD_ENSURE) | (1 << PM_TOKEN_KEYWORD_RESCUE) | (1 << PM_TOKEN_KEYWORD_ELSE) | (1 << PM_TOKEN_KEYWORD_END), - [PM_CONTEXT_DEF_PARAMS] = (1 << PM_TOKEN_EOF), - [PM_CONTEXT_DEFINED] = (1 << PM_TOKEN_EOF), - [PM_CONTEXT_DEFAULT_PARAMS] = (1 << PM_TOKEN_COMMA) | (1 << PM_TOKEN_PARENTHESIS_RIGHT), - [PM_CONTEXT_ELSE] = (1 << PM_TOKEN_KEYWORD_END), - [PM_CONTEXT_ELSIF] = (1 << PM_TOKEN_KEYWORD_ELSE) | (1 << PM_TOKEN_KEYWORD_ELSIF) | (1 << PM_TOKEN_KEYWORD_END), - [PM_CONTEXT_EMBEXPR] = (1 << PM_TOKEN_EMBEXPR_END), - [PM_CONTEXT_FOR] = (1 << PM_TOKEN_KEYWORD_END), - [PM_CONTEXT_FOR_INDEX] = (1 << PM_TOKEN_KEYWORD_IN), - [PM_CONTEXT_IF] = (1 << PM_TOKEN_KEYWORD_ELSE) | (1 << PM_TOKEN_KEYWORD_ELSIF) | (1 << PM_TOKEN_KEYWORD_END), - [PM_CONTEXT_LAMBDA_BRACES] = (1 << PM_TOKEN_BRACE_RIGHT), - [PM_CONTEXT_LAMBDA_DO_END] = (1 << PM_TOKEN_KEYWORD_END) | (1 << PM_TOKEN_KEYWORD_RESCUE) | (1 << PM_TOKEN_KEYWORD_ENSURE), - [PM_CONTEXT_LAMBDA_ENSURE] = (1 << PM_TOKEN_KEYWORD_END), - [PM_CONTEXT_LAMBDA_ELSE] = (1 << PM_TOKEN_KEYWORD_ENSURE) | (1 << PM_TOKEN_KEYWORD_END), - [PM_CONTEXT_LAMBDA_RESCUE] = (1 << PM_TOKEN_KEYWORD_ENSURE) | (1 << PM_TOKEN_KEYWORD_RESCUE) | (1 << PM_TOKEN_KEYWORD_ELSE) | (1 << PM_TOKEN_KEYWORD_END), - [PM_CONTEXT_LOOP_PREDICATE] = (1 << PM_TOKEN_KEYWORD_DO) | (1 << PM_TOKEN_KEYWORD_THEN), - [PM_CONTEXT_MAIN] = (1 << PM_TOKEN_EOF), - [PM_CONTEXT_MODULE] = (1 << PM_TOKEN_KEYWORD_END) | (1 << PM_TOKEN_KEYWORD_RESCUE) | (1 << PM_TOKEN_KEYWORD_ENSURE), - [PM_CONTEXT_MODULE_ENSURE] = (1 << PM_TOKEN_KEYWORD_END), - [PM_CONTEXT_MODULE_ELSE] = (1 << PM_TOKEN_KEYWORD_ENSURE) | (1 << PM_TOKEN_KEYWORD_END), - [PM_CONTEXT_MODULE_RESCUE] = (1 << PM_TOKEN_KEYWORD_ENSURE) | (1 << PM_TOKEN_KEYWORD_RESCUE) | (1 << PM_TOKEN_KEYWORD_ELSE) | (1 << PM_TOKEN_KEYWORD_END), - [PM_CONTEXT_MULTI_TARGET] = (1 << PM_TOKEN_EOF), - [PM_CONTEXT_PARENS] = (1 << PM_TOKEN_PARENTHESIS_RIGHT), - [PM_CONTEXT_POSTEXE] = (1 << PM_TOKEN_BRACE_RIGHT), - [PM_CONTEXT_PREDICATE] = (1 << PM_TOKEN_KEYWORD_THEN) | (1 << PM_TOKEN_NEWLINE) | (1 << PM_TOKEN_SEMICOLON), - [PM_CONTEXT_PREEXE] = (1 << PM_TOKEN_BRACE_RIGHT), - [PM_CONTEXT_RESCUE_MODIFIER] = (1 << PM_TOKEN_EOF), - [PM_CONTEXT_SCLASS] = (1 << PM_TOKEN_KEYWORD_END) | (1 << PM_TOKEN_KEYWORD_RESCUE) | (1 << PM_TOKEN_KEYWORD_ENSURE), - [PM_CONTEXT_SCLASS_ENSURE] = (1 << PM_TOKEN_KEYWORD_END), - [PM_CONTEXT_SCLASS_ELSE] = (1 << PM_TOKEN_KEYWORD_ENSURE) | (1 << PM_TOKEN_KEYWORD_END), - [PM_CONTEXT_SCLASS_RESCUE] = (1 << PM_TOKEN_KEYWORD_ENSURE) | (1 << PM_TOKEN_KEYWORD_RESCUE) | (1 << PM_TOKEN_KEYWORD_ELSE) | (1 << PM_TOKEN_KEYWORD_END), - [PM_CONTEXT_TERNARY] = (1 << PM_TOKEN_EOF), - [PM_CONTEXT_UNLESS] = (1 << PM_TOKEN_KEYWORD_ELSE) | (1 << PM_TOKEN_KEYWORD_END), - [PM_CONTEXT_UNTIL] = (1 << PM_TOKEN_KEYWORD_END), - [PM_CONTEXT_WHILE] = (1 << PM_TOKEN_KEYWORD_END), + [PM_CONTEXT_BEGIN] = (1U << PM_TOKEN_KEYWORD_ENSURE) | (1U << PM_TOKEN_KEYWORD_RESCUE) | (1U << PM_TOKEN_KEYWORD_ELSE) | (1U << PM_TOKEN_KEYWORD_END), + [PM_CONTEXT_BEGIN_ENSURE] = (1U << PM_TOKEN_KEYWORD_END), + [PM_CONTEXT_BEGIN_ELSE] = (1U << PM_TOKEN_KEYWORD_ENSURE) | (1U << PM_TOKEN_KEYWORD_END), + [PM_CONTEXT_BEGIN_RESCUE] = (1U << PM_TOKEN_KEYWORD_ENSURE) | (1U << PM_TOKEN_KEYWORD_RESCUE) | (1U << PM_TOKEN_KEYWORD_ELSE) | (1U << PM_TOKEN_KEYWORD_END), + [PM_CONTEXT_BLOCK_BRACES] = (1U << PM_TOKEN_BRACE_RIGHT), + [PM_CONTEXT_BLOCK_KEYWORDS] = (1U << PM_TOKEN_KEYWORD_END) | (1U << PM_TOKEN_KEYWORD_RESCUE) | (1U << PM_TOKEN_KEYWORD_ENSURE), + [PM_CONTEXT_BLOCK_ENSURE] = (1U << PM_TOKEN_KEYWORD_END), + [PM_CONTEXT_BLOCK_ELSE] = (1U << PM_TOKEN_KEYWORD_ENSURE) | (1U << PM_TOKEN_KEYWORD_END), + [PM_CONTEXT_BLOCK_RESCUE] = (1U << PM_TOKEN_KEYWORD_ENSURE) | (1U << PM_TOKEN_KEYWORD_RESCUE) | (1U << PM_TOKEN_KEYWORD_ELSE) | (1U << PM_TOKEN_KEYWORD_END), + [PM_CONTEXT_CASE_WHEN] = (1U << PM_TOKEN_KEYWORD_WHEN) | (1U << PM_TOKEN_KEYWORD_END) | (1U << PM_TOKEN_KEYWORD_ELSE), + [PM_CONTEXT_CASE_IN] = (1U << PM_TOKEN_KEYWORD_IN) | (1U << PM_TOKEN_KEYWORD_END) | (1U << PM_TOKEN_KEYWORD_ELSE), + [PM_CONTEXT_CLASS] = (1U << PM_TOKEN_KEYWORD_END) | (1U << PM_TOKEN_KEYWORD_RESCUE) | (1U << PM_TOKEN_KEYWORD_ENSURE), + [PM_CONTEXT_CLASS_ENSURE] = (1U << PM_TOKEN_KEYWORD_END), + [PM_CONTEXT_CLASS_ELSE] = (1U << PM_TOKEN_KEYWORD_ENSURE) | (1U << PM_TOKEN_KEYWORD_END), + [PM_CONTEXT_CLASS_RESCUE] = (1U << PM_TOKEN_KEYWORD_ENSURE) | (1U << PM_TOKEN_KEYWORD_RESCUE) | (1U << PM_TOKEN_KEYWORD_ELSE) | (1U << PM_TOKEN_KEYWORD_END), + [PM_CONTEXT_DEF] = (1U << PM_TOKEN_KEYWORD_END) | (1U << PM_TOKEN_KEYWORD_RESCUE) | (1U << PM_TOKEN_KEYWORD_ENSURE), + [PM_CONTEXT_DEF_ENSURE] = (1U << PM_TOKEN_KEYWORD_END), + [PM_CONTEXT_DEF_ELSE] = (1U << PM_TOKEN_KEYWORD_ENSURE) | (1U << PM_TOKEN_KEYWORD_END), + [PM_CONTEXT_DEF_RESCUE] = (1U << PM_TOKEN_KEYWORD_ENSURE) | (1U << PM_TOKEN_KEYWORD_RESCUE) | (1U << PM_TOKEN_KEYWORD_ELSE) | (1U << PM_TOKEN_KEYWORD_END), + [PM_CONTEXT_DEF_PARAMS] = (1U << PM_TOKEN_EOF), + [PM_CONTEXT_DEFINED] = (1U << PM_TOKEN_EOF), + [PM_CONTEXT_DEFAULT_PARAMS] = (1U << PM_TOKEN_COMMA) | (1U << PM_TOKEN_PARENTHESIS_RIGHT), + [PM_CONTEXT_ELSE] = (1U << PM_TOKEN_KEYWORD_END), + [PM_CONTEXT_ELSIF] = (1U << PM_TOKEN_KEYWORD_ELSE) | (1U << PM_TOKEN_KEYWORD_ELSIF) | (1U << PM_TOKEN_KEYWORD_END), + [PM_CONTEXT_EMBEXPR] = (1U << PM_TOKEN_EMBEXPR_END), + [PM_CONTEXT_FOR] = (1U << PM_TOKEN_KEYWORD_END), + [PM_CONTEXT_FOR_INDEX] = (1U << PM_TOKEN_KEYWORD_IN), + [PM_CONTEXT_IF] = (1U << PM_TOKEN_KEYWORD_ELSE) | (1U << PM_TOKEN_KEYWORD_ELSIF) | (1U << PM_TOKEN_KEYWORD_END), + [PM_CONTEXT_LAMBDA_BRACES] = (1U << PM_TOKEN_BRACE_RIGHT), + [PM_CONTEXT_LAMBDA_DO_END] = (1U << PM_TOKEN_KEYWORD_END) | (1U << PM_TOKEN_KEYWORD_RESCUE) | (1U << PM_TOKEN_KEYWORD_ENSURE), + [PM_CONTEXT_LAMBDA_ENSURE] = (1U << PM_TOKEN_KEYWORD_END), + [PM_CONTEXT_LAMBDA_ELSE] = (1U << PM_TOKEN_KEYWORD_ENSURE) | (1U << PM_TOKEN_KEYWORD_END), + [PM_CONTEXT_LAMBDA_RESCUE] = (1U << PM_TOKEN_KEYWORD_ENSURE) | (1U << PM_TOKEN_KEYWORD_RESCUE) | (1U << PM_TOKEN_KEYWORD_ELSE) | (1U << PM_TOKEN_KEYWORD_END), + [PM_CONTEXT_LOOP_PREDICATE] = (1U << PM_TOKEN_KEYWORD_DO) | (1U << PM_TOKEN_KEYWORD_THEN), + [PM_CONTEXT_MAIN] = (1U << PM_TOKEN_EOF), + [PM_CONTEXT_MODULE] = (1U << PM_TOKEN_KEYWORD_END) | (1U << PM_TOKEN_KEYWORD_RESCUE) | (1U << PM_TOKEN_KEYWORD_ENSURE), + [PM_CONTEXT_MODULE_ENSURE] = (1U << PM_TOKEN_KEYWORD_END), + [PM_CONTEXT_MODULE_ELSE] = (1U << PM_TOKEN_KEYWORD_ENSURE) | (1U << PM_TOKEN_KEYWORD_END), + [PM_CONTEXT_MODULE_RESCUE] = (1U << PM_TOKEN_KEYWORD_ENSURE) | (1U << PM_TOKEN_KEYWORD_RESCUE) | (1U << PM_TOKEN_KEYWORD_ELSE) | (1U << PM_TOKEN_KEYWORD_END), + [PM_CONTEXT_MULTI_TARGET] = (1U << PM_TOKEN_EOF), + [PM_CONTEXT_PARENS] = (1U << PM_TOKEN_PARENTHESIS_RIGHT), + [PM_CONTEXT_POSTEXE] = (1U << PM_TOKEN_BRACE_RIGHT), + [PM_CONTEXT_PREDICATE] = (1U << PM_TOKEN_KEYWORD_THEN) | (1U << PM_TOKEN_NEWLINE) | (1U << PM_TOKEN_SEMICOLON), + [PM_CONTEXT_PREEXE] = (1U << PM_TOKEN_BRACE_RIGHT), + [PM_CONTEXT_RESCUE_MODIFIER] = (1U << PM_TOKEN_EOF), + [PM_CONTEXT_SCLASS] = (1U << PM_TOKEN_KEYWORD_END) | (1U << PM_TOKEN_KEYWORD_RESCUE) | (1U << PM_TOKEN_KEYWORD_ENSURE), + [PM_CONTEXT_SCLASS_ENSURE] = (1U << PM_TOKEN_KEYWORD_END), + [PM_CONTEXT_SCLASS_ELSE] = (1U << PM_TOKEN_KEYWORD_ENSURE) | (1U << PM_TOKEN_KEYWORD_END), + [PM_CONTEXT_SCLASS_RESCUE] = (1U << PM_TOKEN_KEYWORD_ENSURE) | (1U << PM_TOKEN_KEYWORD_RESCUE) | (1U << PM_TOKEN_KEYWORD_ELSE) | (1U << PM_TOKEN_KEYWORD_END), + [PM_CONTEXT_TERNARY] = (1U << PM_TOKEN_EOF), + [PM_CONTEXT_UNLESS] = (1U << PM_TOKEN_KEYWORD_ELSE) | (1U << PM_TOKEN_KEYWORD_END), + [PM_CONTEXT_UNTIL] = (1U << PM_TOKEN_KEYWORD_END), + [PM_CONTEXT_WHILE] = (1U << PM_TOKEN_KEYWORD_END), }; static inline bool From 6f563795b3c46aa579cfdaec0be3edf50e0eaf76 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Tue, 14 Oct 2025 17:03:55 -0700 Subject: [PATCH 169/333] Add gem publishing workflow --- .github/workflows/publish-gem.yml | 41 +++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 .github/workflows/publish-gem.yml diff --git a/.github/workflows/publish-gem.yml b/.github/workflows/publish-gem.yml new file mode 100644 index 0000000000..1c0864dd8a --- /dev/null +++ b/.github/workflows/publish-gem.yml @@ -0,0 +1,41 @@ +name: Publish gem to rubygems.org + +on: + push: + tags: + - 'v*' + +permissions: + contents: read + +jobs: + push: + if: github.repository == 'ruby/prism' + runs-on: ubuntu-latest + + environment: + name: rubygems.org + url: https://rubygems.org/gems/prism + + permissions: + contents: write + id-token: write + + steps: + - name: Harden Runner + uses: step-security/harden-runner@v2 + with: + egress-policy: audit + + - uses: actions/checkout@v4 + + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: "3.4" + + - name: Install dependencies + run: bundle install --jobs 4 --retry 3 + + - name: Publish to RubyGems + uses: rubygems/release-gem@v1 From 2b91919521ae671820fc4a2bc7918e263a71d9fe Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Tue, 14 Oct 2025 17:09:49 -0700 Subject: [PATCH 170/333] Add crates.io publishing workflow --- .github/workflows/publish-crate.yml | 32 +++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 .github/workflows/publish-crate.yml diff --git a/.github/workflows/publish-crate.yml b/.github/workflows/publish-crate.yml new file mode 100644 index 0000000000..3397b72553 --- /dev/null +++ b/.github/workflows/publish-crate.yml @@ -0,0 +1,32 @@ +name: Publish to crates.io +on: + push: + tags: ['v*'] # Triggers when pushing tags starting with 'v' +jobs: + publish: + if: github.repository == 'ruby/prism' + runs-on: ubuntu-latest + environment: release # Optional: for enhanced security + permissions: + id-token: write # Required for OIDC token exchange + steps: + - name: Harden Runner + uses: step-security/harden-runner@v2 + with: + egress-policy: audit + - uses: actions/checkout@v5 + + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby }} + + - name: Install dependencies + run: bundle install --jobs 4 --retry 3 + + - uses: rust-lang/crates-io-auth-action@v1 + id: auth + + - run: bundle exec rake cargo:publish:real + env: + CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }} From 64f3c2ad366cd5ec6a5f17464687ee6806899600 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Tue, 14 Oct 2025 17:17:54 -0700 Subject: [PATCH 171/333] Add npm publishing workflow --- .github/workflows/publish-npm.yml | 47 +++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 .github/workflows/publish-npm.yml diff --git a/.github/workflows/publish-npm.yml b/.github/workflows/publish-npm.yml new file mode 100644 index 0000000000..0bfc4123bf --- /dev/null +++ b/.github/workflows/publish-npm.yml @@ -0,0 +1,47 @@ +name: Publish to npmjs.com +on: + push: + tags: ['v*'] # Triggers when pushing tags starting with 'v' +jobs: + publish: + if: github.repository == 'ruby/prism' + runs-on: ubuntu-latest + environment: release # Optional: for enhanced security + permissions: + id-token: write # Required for OIDC token exchange + steps: + - name: Harden Runner + uses: step-security/harden-runner@v2 + with: + egress-policy: audit + - uses: actions/checkout@v5 + + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby }} + + - name: Set up node + uses: actions/setup-node@v4 + with: + node-version: '20' + registry-url: 'https://registry.npmjs.org' + + - name: Install dependencies + run: bundle install --jobs 4 --retry 3 + + - name: rake templates + run: bundle exec rake templates + + - name: Set up WASI-SDK + run: | + wget https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-25/wasi-sdk-25.0-x86_64-linux.tar.gz + tar xvf wasi-sdk-25.0-x86_64-linux.tar.gz + + - name: Build the project + run: make wasm WASI_SDK_PATH=$(pwd)/wasi-sdk-25.0-x86_64-linux + + - name: Update npm + run: npm install -g npm@latest + + - run: npm publish From f224797da298ad73e657965a80b5f9450f61cda2 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Wed, 15 Oct 2025 13:51:31 -0700 Subject: [PATCH 172/333] use bundler cache instead of bundle install --- .github/workflows/publish-crate.yml | 6 ++---- .github/workflows/publish-gem.yml | 4 +--- .github/workflows/publish-npm.yml | 6 ++---- 3 files changed, 5 insertions(+), 11 deletions(-) diff --git a/.github/workflows/publish-crate.yml b/.github/workflows/publish-crate.yml index 3397b72553..5d8aa2289e 100644 --- a/.github/workflows/publish-crate.yml +++ b/.github/workflows/publish-crate.yml @@ -19,10 +19,8 @@ jobs: - name: Set up Ruby uses: ruby/setup-ruby@v1 with: - ruby-version: ${{ matrix.ruby }} - - - name: Install dependencies - run: bundle install --jobs 4 --retry 3 + ruby-version: "3.4" + bundler-cache: true - uses: rust-lang/crates-io-auth-action@v1 id: auth diff --git a/.github/workflows/publish-gem.yml b/.github/workflows/publish-gem.yml index 1c0864dd8a..c64a65b66a 100644 --- a/.github/workflows/publish-gem.yml +++ b/.github/workflows/publish-gem.yml @@ -33,9 +33,7 @@ jobs: uses: ruby/setup-ruby@v1 with: ruby-version: "3.4" - - - name: Install dependencies - run: bundle install --jobs 4 --retry 3 + bundler-cache: true - name: Publish to RubyGems uses: rubygems/release-gem@v1 diff --git a/.github/workflows/publish-npm.yml b/.github/workflows/publish-npm.yml index 0bfc4123bf..9e498684ef 100644 --- a/.github/workflows/publish-npm.yml +++ b/.github/workflows/publish-npm.yml @@ -19,7 +19,8 @@ jobs: - name: Set up Ruby uses: ruby/setup-ruby@v1 with: - ruby-version: ${{ matrix.ruby }} + ruby-version: "3.4" + bundler-cache: true - name: Set up node uses: actions/setup-node@v4 @@ -27,9 +28,6 @@ jobs: node-version: '20' registry-url: 'https://registry.npmjs.org' - - name: Install dependencies - run: bundle install --jobs 4 --retry 3 - - name: rake templates run: bundle exec rake templates From 9c5cd205cf0a53f04310759e165de243efc68062 Mon Sep 17 00:00:00 2001 From: Earlopain <14981592+Earlopain@users.noreply.github.com> Date: Wed, 15 Oct 2025 08:46:32 +0200 Subject: [PATCH 173/333] Add support for `Prism.parse(foo, version: "current")` The docs currently say to use `Prism.parse(foo, version: RUBY_VERSION)` for this. By specifying "current" instead, we can have prism raise a more specifc error. Note: Does not use `ruby_version` from `ruby/version.h` because writing a test for that is not really possible. `RUBY_VERSION` is nicely stubbable for both the c-ext and FFI backend. --- ext/prism/extension.c | 13 +++++++++++-- lib/prism.rb | 21 +++++++++++++++++++++ lib/prism/ffi.rb | 10 ++++++++-- templates/sig/prism.rbs.erb | 4 ++++ test/prism/api/parse_test.rb | 30 ++++++++++++++++++++++++++++++ 5 files changed, 74 insertions(+), 4 deletions(-) diff --git a/ext/prism/extension.c b/ext/prism/extension.c index 83415d0c29..0c9d04225d 100644 --- a/ext/prism/extension.c +++ b/ext/prism/extension.c @@ -25,6 +25,7 @@ VALUE rb_cPrismLexResult; VALUE rb_cPrismParseLexResult; VALUE rb_cPrismStringQuery; VALUE rb_cPrismScope; +VALUE rb_cPrismCurrentVersionError; VALUE rb_cPrismDebugEncoding; @@ -199,7 +200,13 @@ build_options_i(VALUE key, VALUE value, VALUE argument) { if (!NIL_P(value)) { const char *version = check_string(value); - if (!pm_options_version_set(options, version, RSTRING_LEN(value))) { + if (RSTRING_LEN(value) == 7 && strncmp(version, "current", 7) == 0) { + VALUE current_ruby_value = rb_const_get(rb_cObject, rb_intern("RUBY_VERSION")); + const char *current_version = RSTRING_PTR(current_ruby_value); + if (!pm_options_version_set(options, current_version, 3)) { + rb_exc_raise(rb_exc_new_str(rb_cPrismCurrentVersionError, current_ruby_value)); + } + } else if (!pm_options_version_set(options, version, RSTRING_LEN(value))) { rb_raise(rb_eArgError, "invalid version: %" PRIsVALUE, value); } } @@ -888,7 +895,7 @@ parse_input(pm_string_t *input, const pm_options_t *options) { * version of Ruby syntax (which you can trigger with `nil` or * `"latest"`). You may also restrict the syntax to a specific version of * Ruby, e.g., with `"3.3.0"`. To parse with the same syntax version that - * the current Ruby is running use `version: RUBY_VERSION`. Raises + * the current Ruby is running use `version: "current"`. Raises * ArgumentError if the version is not currently supported by Prism. */ static VALUE @@ -1364,6 +1371,8 @@ Init_prism(void) { rb_cPrismStringQuery = rb_define_class_under(rb_cPrism, "StringQuery", rb_cObject); rb_cPrismScope = rb_define_class_under(rb_cPrism, "Scope", rb_cObject); + rb_cPrismCurrentVersionError = rb_const_get(rb_cPrism, rb_intern("CurrentVersionError")); + // Intern all of the IDs eagerly that we support so that we don't have to do // it every time we parse. rb_id_option_command_line = rb_intern_const("command_line"); diff --git a/lib/prism.rb b/lib/prism.rb index dceba4b1f5..2cbe196b57 100644 --- a/lib/prism.rb +++ b/lib/prism.rb @@ -37,6 +37,27 @@ module Prism private_constant :LexCompat private_constant :LexRipper + # Raised when requested to parse as the currently running Ruby version but Prism has no support for it. + class CurrentVersionError < ArgumentError + # Initialize a new exception for the given ruby version string. + def initialize(version) + message = +"invalid version: Requested to parse as `version: 'current'`; " + gem_version = + begin + Gem::Version.new(version) + rescue ArgumentError + end + + if gem_version && gem_version < Gem::Version.new("3.3.0") + message << " #{version} is below the minimum supported syntax." + else + message << " #{version} is unknown. Please update the `prism` gem." + end + + super(message) + end + end + # :call-seq: # Prism::lex_compat(source, **options) -> LexCompat::Result # diff --git a/lib/prism/ffi.rb b/lib/prism/ffi.rb index 5ae177055f..a3bf5786bd 100644 --- a/lib/prism/ffi.rb +++ b/lib/prism/ffi.rb @@ -423,7 +423,9 @@ def dump_options_command_line(options) # Return the value that should be dumped for the version option. def dump_options_version(version) - case version + current = version == "current" + + case current ? RUBY_VERSION : version when nil, "latest" 0 # Handled in pm_parser_init when /\A3\.3(\.\d+)?\z/ @@ -433,7 +435,11 @@ def dump_options_version(version) when /\A3\.5(\.\d+)?\z/ 3 else - raise ArgumentError, "invalid version: #{version}" + if current + raise CurrentVersionError, RUBY_VERSION + else + raise ArgumentError, "invalid version: #{version}" + end end end diff --git a/templates/sig/prism.rbs.erb b/templates/sig/prism.rbs.erb index 2f30cbc29f..5c74cee8f8 100644 --- a/templates/sig/prism.rbs.erb +++ b/templates/sig/prism.rbs.erb @@ -2,6 +2,10 @@ module Prism BACKEND: :CEXT | :FFI VERSION: String + class CurrentVersionError < ArgumentError + def initialize: (String version) -> void + end + # Methods taking a Ruby source code string: <%- { diff --git a/test/prism/api/parse_test.rb b/test/prism/api/parse_test.rb index bbce8a8fad..67a252c589 100644 --- a/test/prism/api/parse_test.rb +++ b/test/prism/api/parse_test.rb @@ -140,6 +140,25 @@ def test_version end end + def test_version_current + if RUBY_VERSION >= "3.3" + assert Prism.parse_success?("1 + 1", version: "current") + else + assert_raise(CurrentVersionError) { Prism.parse_success?("1 + 1", version: "current") } + end + + version = RUBY_VERSION.split(".").tap { |segments| segments[0] = segments[0].succ }.join(".") + stub_ruby_version(version) do + error = assert_raise(CurrentVersionError) { Prism.parse("1 + 1", version: "current") } + assert_includes error.message, "unknown" + end + + stub_ruby_version("2.7.0") do + error = assert_raise(CurrentVersionError) { Prism.parse("1 + 1", version: "current") } + assert_includes error.message, "minimum" + end + end + def test_scopes assert_kind_of Prism::CallNode, Prism.parse_statement("foo") assert_kind_of Prism::LocalVariableReadNode, Prism.parse_statement("foo", scopes: [[:foo]]) @@ -167,5 +186,16 @@ def find_source_file_node(program) queue.concat(node.compact_child_nodes) end end + + def stub_ruby_version(version) + old_version = RUBY_VERSION + + Object.send(:remove_const, :RUBY_VERSION) + Object.const_set(:RUBY_VERSION, version) + yield + ensure + Object.send(:remove_const, :RUBY_VERSION) + Object.const_set(:RUBY_VERSION, old_version) + end end end From b72fcc61833ffb4669140bb88ac1bc467affb153 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Thu, 16 Oct 2025 08:33:29 -0400 Subject: [PATCH 174/333] Bump to v1.6.0 --- CHANGELOG.md | 13 ++++++++++- Gemfile.lock | 4 ++-- docs/releasing.md | 25 ++------------------- 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/3.5/Gemfile.lock | 2 +- gemfiles/jruby/Gemfile.lock | 2 +- gemfiles/truffleruby/Gemfile.lock | 2 +- include/prism/version.h | 6 ++--- 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 | 4 ++-- templates/javascript/src/deserialize.js.erb | 4 ++-- templates/lib/prism/serialize.rb.erb | 4 ++-- 23 files changed, 43 insertions(+), 53 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 948ea76b56..4070ee860c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,16 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a ## [Unreleased] +## [1.6.0] - 2025-10-16 + +### Added + +- Add support for passing `"current"` as the version option to `Prism.*` APIs. + +### Changed + +- Remove a compiler warning for a missing unsigned cast for a shift value. + ## [1.5.2] - 2025-10-09 ### Changed @@ -685,7 +695,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.5.2...HEAD +[unreleased]: https://github.com/ruby/prism/compare/v1.6.0...HEAD +[1.6.0]: https://github.com/ruby/prism/compare/v1.5.2...v1.6.0 [1.5.2]: https://github.com/ruby/prism/compare/v1.5.1...v1.5.2 [1.5.1]: https://github.com/ruby/prism/compare/v1.5.0...v1.5.1 [1.5.0]: https://github.com/ruby/prism/compare/v1.4.0...v1.5.0 diff --git a/Gemfile.lock b/Gemfile.lock index fd87e1034e..d9879c8976 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - prism (1.5.2) + prism (1.6.0) GEM remote: https://rubygems.org/ @@ -9,7 +9,7 @@ GEM ast (2.4.3) benchmark-ips (2.14.0) date (3.4.1) - erb (5.0.3) + erb (5.1.1) ffi (1.17.2) mini_portile2 (2.8.9) nokogiri (1.18.10) diff --git a/docs/releasing.md b/docs/releasing.md index f6bc69013d..426f5f1132 100644 --- a/docs/releasing.md +++ b/docs/releasing.md @@ -49,6 +49,7 @@ bundle install ```sh for VERSION in "2.7" "3.0" "3.1" "3.2" "3.3" "3.4"; do docker run -it --rm -v "$PWD":/usr/src/app -w /usr/src/app -e BUNDLE_GEMFILE="gemfiles/$VERSION/Gemfile" "ruby:$VERSION" bundle update; done docker run -it --rm -v "$PWD":/usr/src/app -w /usr/src/app -e BUNDLE_GEMFILE="gemfiles/3.5/Gemfile" ruby:3.5.0-preview1 bundle update +docker run -it --rm -v "$PWD":/usr/src/app -w /usr/src/app -e BUNDLE_GEMFILE="gemfiles/jruby/Gemfile" jruby:latest bundle update BUNDLE_GEMFILE=gemfiles/truffleruby/Gemfile chruby-exec truffleruby -- bundle update ``` @@ -73,26 +74,4 @@ git push ## Publishing * Update the GitHub release page with a copy of the latest entry in the `CHANGELOG.md` file. -* Publish the gem to [rubygems.org](rubygems.org). Note that you must have access to the `prism` gem to do this. - -```sh -bundle exec rake release -``` - -* Generate the `wasm` artifact (or download it from GitHub actions and put it in `javascript/src/prism.wasm`). - -```sh -make wasm -``` - -* Publish the JavaScript package to [npmjs.com](npmjs.com). Note that you must have access to the `@ruby/prism` package to do this. - -```sh -npm publish -``` - -* Publish the rust crate to [crates.io](crates.io). Note that you must have access to the `ruby-prism-sys` and `ruby-prism` crates to do this. - -```sh -bundle exec rake cargo:publish:real -``` +* Push a new tag to the GitHub repository, following the `vX.Y.Z` format. diff --git a/ext/prism/extension.h b/ext/prism/extension.h index 1f15b775ff..70017a4ae3 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.5.2" +#define EXPECTED_PRISM_VERSION "1.6.0" #include #include diff --git a/gemfiles/2.7/Gemfile.lock b/gemfiles/2.7/Gemfile.lock index ec55ee7fd6..1b21359158 100644 --- a/gemfiles/2.7/Gemfile.lock +++ b/gemfiles/2.7/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: ../.. specs: - prism (1.5.2) + prism (1.6.0) GEM remote: https://rubygems.org/ diff --git a/gemfiles/3.0/Gemfile.lock b/gemfiles/3.0/Gemfile.lock index 6931a2ae25..20fb203a12 100644 --- a/gemfiles/3.0/Gemfile.lock +++ b/gemfiles/3.0/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: ../.. specs: - prism (1.5.2) + prism (1.6.0) GEM remote: https://rubygems.org/ diff --git a/gemfiles/3.1/Gemfile.lock b/gemfiles/3.1/Gemfile.lock index 89c201eb62..f38e75df4d 100644 --- a/gemfiles/3.1/Gemfile.lock +++ b/gemfiles/3.1/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: ../.. specs: - prism (1.5.2) + prism (1.6.0) GEM remote: https://rubygems.org/ diff --git a/gemfiles/3.2/Gemfile.lock b/gemfiles/3.2/Gemfile.lock index 5dc9eef55b..0215cd8eff 100644 --- a/gemfiles/3.2/Gemfile.lock +++ b/gemfiles/3.2/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: ../.. specs: - prism (1.5.2) + prism (1.6.0) GEM remote: https://rubygems.org/ diff --git a/gemfiles/3.3/Gemfile.lock b/gemfiles/3.3/Gemfile.lock index 4d0316184d..d2e2ea06ef 100644 --- a/gemfiles/3.3/Gemfile.lock +++ b/gemfiles/3.3/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: ../.. specs: - prism (1.5.2) + prism (1.6.0) GEM remote: https://rubygems.org/ diff --git a/gemfiles/3.4/Gemfile.lock b/gemfiles/3.4/Gemfile.lock index 0c062f7708..0d67386419 100644 --- a/gemfiles/3.4/Gemfile.lock +++ b/gemfiles/3.4/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: ../.. specs: - prism (1.5.2) + prism (1.6.0) GEM remote: https://rubygems.org/ diff --git a/gemfiles/3.5/Gemfile.lock b/gemfiles/3.5/Gemfile.lock index b239919e13..953068d2d5 100644 --- a/gemfiles/3.5/Gemfile.lock +++ b/gemfiles/3.5/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: ../.. specs: - prism (1.5.2) + prism (1.6.0) GEM remote: https://rubygems.org/ diff --git a/gemfiles/jruby/Gemfile.lock b/gemfiles/jruby/Gemfile.lock index 31d22f163f..77fe3e8fc8 100644 --- a/gemfiles/jruby/Gemfile.lock +++ b/gemfiles/jruby/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: ../.. specs: - prism (1.5.2) + prism (1.6.0) GEM remote: https://rubygems.org/ diff --git a/gemfiles/truffleruby/Gemfile.lock b/gemfiles/truffleruby/Gemfile.lock index a9c0f1a057..9a34d6570a 100644 --- a/gemfiles/truffleruby/Gemfile.lock +++ b/gemfiles/truffleruby/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: ../.. specs: - prism (1.5.2) + prism (1.6.0) GEM remote: https://rubygems.org/ diff --git a/include/prism/version.h b/include/prism/version.h index c0d82dc8e2..f202b0f4d7 100644 --- a/include/prism/version.h +++ b/include/prism/version.h @@ -14,16 +14,16 @@ /** * The minor version of the Prism library as an int. */ -#define PRISM_VERSION_MINOR 5 +#define PRISM_VERSION_MINOR 6 /** * The patch version of the Prism library as an int. */ -#define PRISM_VERSION_PATCH 2 +#define PRISM_VERSION_PATCH 0 /** * The version of the Prism library as a constant string. */ -#define PRISM_VERSION "1.5.2" +#define PRISM_VERSION "1.6.0" #endif diff --git a/javascript/package.json b/javascript/package.json index 43a9553852..c7f074e449 100644 --- a/javascript/package.json +++ b/javascript/package.json @@ -1,6 +1,6 @@ { "name": "@ruby/prism", - "version": "1.5.2", + "version": "1.6.0", "description": "Prism Ruby parser", "type": "module", "main": "src/index.js", diff --git a/prism.gemspec b/prism.gemspec index 8f6075ad96..168f8211ff 100644 --- a/prism.gemspec +++ b/prism.gemspec @@ -2,7 +2,7 @@ Gem::Specification.new do |spec| spec.name = "prism" - spec.version = "1.5.2" + spec.version = "1.6.0" spec.authors = ["Shopify"] spec.email = ["ruby@shopify.com"] diff --git a/rust/Cargo.lock b/rust/Cargo.lock index a3f8b92980..ee9187661a 100644 --- a/rust/Cargo.lock +++ b/rust/Cargo.lock @@ -224,7 +224,7 @@ checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" [[package]] name = "ruby-prism" -version = "1.5.2" +version = "1.6.0" dependencies = [ "ruby-prism-sys", "serde", @@ -233,7 +233,7 @@ dependencies = [ [[package]] name = "ruby-prism-sys" -version = "1.5.2" +version = "1.6.0" dependencies = [ "bindgen", "cc", diff --git a/rust/ruby-prism-sys/Cargo.toml b/rust/ruby-prism-sys/Cargo.toml index f21c38ccff..64228ddf63 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.5.2" +version = "1.6.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 99e5fda9d0..a5f1b916ba 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.5.2"); + assert_eq!(&cstring.to_string_lossy(), "1.6.0"); } #[test] diff --git a/rust/ruby-prism/Cargo.toml b/rust/ruby-prism/Cargo.toml index 1e758164fb..b7c4a8ecda 100644 --- a/rust/ruby-prism/Cargo.toml +++ b/rust/ruby-prism/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ruby-prism" -version = "1.5.2" +version = "1.6.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.5.2", path = "../ruby-prism-sys" } +ruby-prism-sys = { version = "1.6.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 a5e06c6125..6c52d36feb 100644 --- a/templates/java/org/prism/Loader.java.erb +++ b/templates/java/org/prism/Loader.java.erb @@ -101,8 +101,8 @@ public class Loader { expect((byte) 'M', "incorrect prism header"); expect((byte) 1, "prism major version does not match"); - expect((byte) 5, "prism minor version does not match"); - expect((byte) 2, "prism patch version does not match"); + expect((byte) 6, "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 046bad448b..a058d6cfeb 100644 --- a/templates/javascript/src/deserialize.js.erb +++ b/templates/javascript/src/deserialize.js.erb @@ -1,8 +1,8 @@ import * as nodes from "./nodes.js"; const MAJOR_VERSION = 1; -const MINOR_VERSION = 5; -const PATCH_VERSION = 2; +const MINOR_VERSION = 6; +const PATCH_VERSION = 0; // The DataView getFloat64 function takes an optional second argument that // specifies whether the number is little-endian or big-endian. It does not diff --git a/templates/lib/prism/serialize.rb.erb b/templates/lib/prism/serialize.rb.erb index 271631b5ac..526be67431 100644 --- a/templates/lib/prism/serialize.rb.erb +++ b/templates/lib/prism/serialize.rb.erb @@ -10,11 +10,11 @@ module Prism # The minor version of prism that we are expecting to find in the serialized # strings. - MINOR_VERSION = 5 + MINOR_VERSION = 6 # The patch version of prism that we are expecting to find in the serialized # strings. - PATCH_VERSION = 2 + PATCH_VERSION = 0 # Deserialize the dumped output from a request to parse or parse_file. # From 2466940e497a82cb102abae348a3a839ae7b20bd Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Thu, 16 Oct 2025 09:20:03 -0400 Subject: [PATCH 175/333] Do not rely on Gem being loaded --- lib/prism.rb | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/lib/prism.rb b/lib/prism.rb index 2cbe196b57..bae5427e79 100644 --- a/lib/prism.rb +++ b/lib/prism.rb @@ -42,13 +42,12 @@ class CurrentVersionError < ArgumentError # Initialize a new exception for the given ruby version string. def initialize(version) message = +"invalid version: Requested to parse as `version: 'current'`; " - gem_version = - begin - Gem::Version.new(version) - rescue ArgumentError + segments = + if version.match?(/\A\d+\.\d+.\d+\z/) + version.split(".").map(&:to_i) end - if gem_version && gem_version < Gem::Version.new("3.3.0") + if segments && (segments[0] < 3) || (segments[0] == 3 && segments[1] < 3) message << " #{version} is below the minimum supported syntax." else message << " #{version} is unknown. Please update the `prism` gem." From ebf4425d49197e4c903d6aae061c56ac6266a652 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Thu, 16 Oct 2025 09:59:47 -0400 Subject: [PATCH 176/333] Create a new string for the current version error --- ext/prism/extension.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/ext/prism/extension.c b/ext/prism/extension.c index 0c9d04225d..71c2d91b98 100644 --- a/ext/prism/extension.c +++ b/ext/prism/extension.c @@ -201,10 +201,9 @@ build_options_i(VALUE key, VALUE value, VALUE argument) { const char *version = check_string(value); if (RSTRING_LEN(value) == 7 && strncmp(version, "current", 7) == 0) { - VALUE current_ruby_value = rb_const_get(rb_cObject, rb_intern("RUBY_VERSION")); - const char *current_version = RSTRING_PTR(current_ruby_value); + const char *current_version = RSTRING_PTR(rb_const_get(rb_cObject, rb_intern("RUBY_VERSION"))); if (!pm_options_version_set(options, current_version, 3)) { - rb_exc_raise(rb_exc_new_str(rb_cPrismCurrentVersionError, current_ruby_value)); + rb_exc_raise(rb_exc_new_cstr(rb_cPrismCurrentVersionError, current_version)); } } else if (!pm_options_version_set(options, version, RSTRING_LEN(value))) { rb_raise(rb_eArgError, "invalid version: %" PRIsVALUE, value); From 44c43062471d40ded436148cf34b0ade568df030 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Thu, 16 Oct 2025 10:10:02 -0400 Subject: [PATCH 177/333] Do not stub Ruby version --- test/prism/api/parse_test.rb | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/test/prism/api/parse_test.rb b/test/prism/api/parse_test.rb index 67a252c589..96aec7c838 100644 --- a/test/prism/api/parse_test.rb +++ b/test/prism/api/parse_test.rb @@ -148,15 +148,8 @@ def test_version_current end version = RUBY_VERSION.split(".").tap { |segments| segments[0] = segments[0].succ }.join(".") - stub_ruby_version(version) do - error = assert_raise(CurrentVersionError) { Prism.parse("1 + 1", version: "current") } - assert_includes error.message, "unknown" - end - - stub_ruby_version("2.7.0") do - error = assert_raise(CurrentVersionError) { Prism.parse("1 + 1", version: "current") } - assert_includes error.message, "minimum" - end + assert_includes CurrentVersionError.new(version).message, "unknown" + assert_includes CurrentVersionError.new("2.7").message, "minimum" end def test_scopes @@ -186,16 +179,5 @@ def find_source_file_node(program) queue.concat(node.compact_child_nodes) end end - - def stub_ruby_version(version) - old_version = RUBY_VERSION - - Object.send(:remove_const, :RUBY_VERSION) - Object.const_set(:RUBY_VERSION, version) - yield - ensure - Object.send(:remove_const, :RUBY_VERSION) - Object.const_set(:RUBY_VERSION, old_version) - end end end From dda0dc81df4bb568534d0141234beddc57842a04 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Thu, 16 Oct 2025 10:29:11 -0400 Subject: [PATCH 178/333] Handle RUBY_VERSION being nil --- lib/prism.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/prism.rb b/lib/prism.rb index bae5427e79..f6ad0c1fd1 100644 --- a/lib/prism.rb +++ b/lib/prism.rb @@ -47,7 +47,7 @@ def initialize(version) version.split(".").map(&:to_i) end - if segments && (segments[0] < 3) || (segments[0] == 3 && segments[1] < 3) + if segments && ((segments[0] < 3) || (segments[0] == 3 && segments[1] < 3)) message << " #{version} is below the minimum supported syntax." else message << " #{version} is unknown. Please update the `prism` gem." From 34428946db3da0f74c6f6408fe9f7958e970f91a Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Thu, 16 Oct 2025 10:37:42 -0400 Subject: [PATCH 179/333] Do not rely on RUBY_VERSION being consistent --- test/prism/api/parse_test.rb | 4 ---- 1 file changed, 4 deletions(-) diff --git a/test/prism/api/parse_test.rb b/test/prism/api/parse_test.rb index 96aec7c838..1f885fa493 100644 --- a/test/prism/api/parse_test.rb +++ b/test/prism/api/parse_test.rb @@ -146,10 +146,6 @@ def test_version_current else assert_raise(CurrentVersionError) { Prism.parse_success?("1 + 1", version: "current") } end - - version = RUBY_VERSION.split(".").tap { |segments| segments[0] = segments[0].succ }.join(".") - assert_includes CurrentVersionError.new(version).message, "unknown" - assert_includes CurrentVersionError.new("2.7").message, "minimum" end def test_scopes From 158b77c692a11dc181cbc3bb4eba8ed2ed217859 Mon Sep 17 00:00:00 2001 From: Earlopain <14981592+Earlopain@users.noreply.github.com> Date: Thu, 16 Oct 2025 17:37:53 +0200 Subject: [PATCH 180/333] Test against everything from CRuby It doesn't take that much longer. If a change in prism breaks CRuby tests, the PR should be made in ruby/ruby instead. --- .github/workflows/cruby-bindings.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cruby-bindings.yml b/.github/workflows/cruby-bindings.yml index 1312293c32..317a06f878 100644 --- a/.github/workflows/cruby-bindings.yml +++ b/.github/workflows/cruby-bindings.yml @@ -43,5 +43,5 @@ jobs: make -j2 working-directory: ruby/ruby - name: make test-all - run: make -j2 -s test-all TESTS="prism ruby/test_syntax.rb ruby/test_compile_prism.rb --no-retry" + run: make -j2 -s test-all working-directory: ruby/ruby From 3c2bd26f1ed0888e315066f792023b68056abf6e Mon Sep 17 00:00:00 2001 From: Earlopain <14981592+Earlopain@users.noreply.github.com> Date: Thu, 16 Oct 2025 17:56:33 +0200 Subject: [PATCH 181/333] Use `nproc` for make in CI Github CI actually has 4 cores, this should be faster --- .github/workflows/cruby-bindings.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cruby-bindings.yml b/.github/workflows/cruby-bindings.yml index 317a06f878..a13a691b99 100644 --- a/.github/workflows/cruby-bindings.yml +++ b/.github/workflows/cruby-bindings.yml @@ -40,8 +40,8 @@ jobs: ruby tool/downloader.rb -d tool -e gnu config.guess config.sub autoconf ./configure -C --disable-install-doc - make -j2 + make -j$(nproc) working-directory: ruby/ruby - name: make test-all - run: make -j2 -s test-all + run: make -j$(nproc) -s test-all working-directory: ruby/ruby From 5191b1aa6869795ef12b52a7637e343f00b11fc5 Mon Sep 17 00:00:00 2001 From: Earlopain <14981592+Earlopain@users.noreply.github.com> Date: Fri, 17 Oct 2025 16:19:56 +0200 Subject: [PATCH 182/333] Make error and snapshot tests multi-version aware This one has been on my mind for a while now. Currently, there are only tests against the latest syntax version. This changes the snapshot structure as follows: * Snapshots at their current location are tested against all syntax versions * Snapshots inside a version folder like "3.3" are tested against all versions starting from that version * Snapshots inside a version folder like "3.3-4.2" are tested against all versions in the given range. This makes sure that as new syntax is added, older versions still work as expected. I also added a few tests for now valid syntax that should be invalid in older versions (and the other way around as well) These tests run really fast. So even though it does 3x the work for these, I am still able to run the whole test suite in just 11 seconds. --- .../block_args_in_array_assignment.txt | 50 ++ snapshots/3.3-3.3/it.txt | 58 +++ snapshots/3.3-3.3/it_indirect_writes.txt | 455 ++++++++++++++++++ snapshots/3.3-3.3/it_read_and_assignment.txt | 81 ++++ .../3.3-3.3/it_with_ordinary_parameter.txt | 43 ++ .../keyword_args_in_array_assignment.txt | 56 +++ snapshots/3.3-3.3/return_in_sclass.txt | 25 + snapshots/3.4/circular_parameters.txt | 167 +++++++ snapshots/{ => 3.4}/it.txt | 0 snapshots/3.4/it_assignment.txt | 58 +++ snapshots/{ => 3.4}/it_indirect_writes.txt | 0 .../{ => 3.4}/it_read_and_assignment.txt | 0 .../endless_methods_command_call.txt | 0 snapshots/{ => 3.5}/leading_logical.txt | 0 src/prism.c | 2 +- .../errors/3.3-3.3/circular_parameters.txt | 12 + test/prism/errors/3.3-3.4/leading_logical.txt | 34 ++ .../errors/3.3-3.4/private_endless_method.txt | 3 + .../block_args_in_array_assignment.txt | 0 .../dont_allow_return_inside_sclass_body.txt | 0 .../{ => 3.4}/it_with_ordinary_parameter.txt | 0 .../keyword_args_in_array_assignment.txt | 0 test/prism/errors_test.rb | 65 +-- .../block_args_in_array_assignment.txt | 1 + test/prism/fixtures/{ => 3.3-3.3}/it.txt | 0 .../{ => 3.3-3.3}/it_indirect_writes.txt | 0 .../{ => 3.3-3.3}/it_read_and_assignment.txt | 0 .../3.3-3.3/it_with_ordinary_parameter.txt | 1 + .../keyword_args_in_array_assignment.txt | 1 + .../fixtures/3.3-3.3/return_in_sclass.txt | 1 + .../fixtures/3.4/circular_parameters.txt | 4 + test/prism/fixtures/3.4/it.txt | 5 + .../prism/fixtures/3.4/it_indirect_writes.txt | 23 + .../fixtures/3.4/it_read_and_assignment.txt | 1 + .../endless_methods_command_call.txt | 0 .../fixtures/{ => 3.5}/leading_logical.txt | 0 test/prism/fixtures_test.rb | 8 +- test/prism/lex_test.rb | 14 +- test/prism/locals_test.rb | 4 +- test/prism/ruby/parser_test.rb | 13 +- test/prism/ruby/ripper_test.rb | 12 +- test/prism/ruby/ruby_parser_test.rb | 12 +- test/prism/snapshots_test.rb | 18 +- test/prism/snippets_test.rb | 12 +- test/prism/test_helper.rb | 47 +- 45 files changed, 1196 insertions(+), 90 deletions(-) create mode 100644 snapshots/3.3-3.3/block_args_in_array_assignment.txt create mode 100644 snapshots/3.3-3.3/it.txt create mode 100644 snapshots/3.3-3.3/it_indirect_writes.txt create mode 100644 snapshots/3.3-3.3/it_read_and_assignment.txt create mode 100644 snapshots/3.3-3.3/it_with_ordinary_parameter.txt create mode 100644 snapshots/3.3-3.3/keyword_args_in_array_assignment.txt create mode 100644 snapshots/3.3-3.3/return_in_sclass.txt create mode 100644 snapshots/3.4/circular_parameters.txt rename snapshots/{ => 3.4}/it.txt (100%) create mode 100644 snapshots/3.4/it_assignment.txt rename snapshots/{ => 3.4}/it_indirect_writes.txt (100%) rename snapshots/{ => 3.4}/it_read_and_assignment.txt (100%) rename snapshots/{ => 3.5}/endless_methods_command_call.txt (100%) rename snapshots/{ => 3.5}/leading_logical.txt (100%) create mode 100644 test/prism/errors/3.3-3.3/circular_parameters.txt create mode 100644 test/prism/errors/3.3-3.4/leading_logical.txt create mode 100644 test/prism/errors/3.3-3.4/private_endless_method.txt rename test/prism/errors/{ => 3.4}/block_args_in_array_assignment.txt (100%) rename test/prism/errors/{ => 3.4}/dont_allow_return_inside_sclass_body.txt (100%) rename test/prism/errors/{ => 3.4}/it_with_ordinary_parameter.txt (100%) rename test/prism/errors/{ => 3.4}/keyword_args_in_array_assignment.txt (100%) create mode 100644 test/prism/fixtures/3.3-3.3/block_args_in_array_assignment.txt rename test/prism/fixtures/{ => 3.3-3.3}/it.txt (100%) rename test/prism/fixtures/{ => 3.3-3.3}/it_indirect_writes.txt (100%) rename test/prism/fixtures/{ => 3.3-3.3}/it_read_and_assignment.txt (100%) create mode 100644 test/prism/fixtures/3.3-3.3/it_with_ordinary_parameter.txt create mode 100644 test/prism/fixtures/3.3-3.3/keyword_args_in_array_assignment.txt create mode 100644 test/prism/fixtures/3.3-3.3/return_in_sclass.txt create mode 100644 test/prism/fixtures/3.4/circular_parameters.txt create mode 100644 test/prism/fixtures/3.4/it.txt create mode 100644 test/prism/fixtures/3.4/it_indirect_writes.txt create mode 100644 test/prism/fixtures/3.4/it_read_and_assignment.txt rename test/prism/fixtures/{ => 3.5}/endless_methods_command_call.txt (100%) rename test/prism/fixtures/{ => 3.5}/leading_logical.txt (100%) diff --git a/snapshots/3.3-3.3/block_args_in_array_assignment.txt b/snapshots/3.3-3.3/block_args_in_array_assignment.txt new file mode 100644 index 0000000000..03327a51f6 --- /dev/null +++ b/snapshots/3.3-3.3/block_args_in_array_assignment.txt @@ -0,0 +1,50 @@ +@ ProgramNode (location: (1,0)-(1,21)) +├── flags: ∅ +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,21)) + ├── flags: ∅ + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,21)) + ├── flags: newline, attribute_write + ├── receiver: + │ @ CallNode (location: (1,0)-(1,6)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :matrix + │ ├── message_loc: (1,0)-(1,6) = "matrix" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── call_operator_loc: ∅ + ├── name: :[]= + ├── message_loc: (1,6)-(1,17) = "[5, &block]" + ├── opening_loc: (1,6)-(1,7) = "[" + ├── arguments: + │ @ ArgumentsNode (location: (1,7)-(1,21)) + │ ├── flags: ∅ + │ └── arguments: (length: 2) + │ ├── @ IntegerNode (location: (1,7)-(1,8)) + │ │ ├── flags: static_literal, decimal + │ │ └── value: 5 + │ └── @ IntegerNode (location: (1,20)-(1,21)) + │ ├── flags: static_literal, decimal + │ └── value: 8 + ├── closing_loc: (1,16)-(1,17) = "]" + └── block: + @ BlockArgumentNode (location: (1,10)-(1,16)) + ├── flags: ∅ + ├── expression: + │ @ CallNode (location: (1,11)-(1,16)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :block + │ ├── message_loc: (1,11)-(1,16) = "block" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + └── operator_loc: (1,10)-(1,11) = "&" diff --git a/snapshots/3.3-3.3/it.txt b/snapshots/3.3-3.3/it.txt new file mode 100644 index 0000000000..a8a8d521c0 --- /dev/null +++ b/snapshots/3.3-3.3/it.txt @@ -0,0 +1,58 @@ +@ ProgramNode (location: (1,0)-(5,9)) +├── flags: ∅ +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(5,9)) + ├── flags: ∅ + └── body: (length: 2) + ├── @ CallNode (location: (1,0)-(3,3)) + │ ├── flags: newline, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :x + │ ├── message_loc: (1,0)-(1,1) = "x" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (1,2)-(3,3)) + │ ├── flags: ∅ + │ ├── locals: [] + │ ├── parameters: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (2,2)-(2,4)) + │ │ ├── flags: ∅ + │ │ └── body: (length: 1) + │ │ └── @ CallNode (location: (2,2)-(2,4)) + │ │ ├── flags: newline, variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :it + │ │ ├── message_loc: (2,2)-(2,4) = "it" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── opening_loc: (1,2)-(1,4) = "do" + │ └── closing_loc: (3,0)-(3,3) = "end" + └── @ LambdaNode (location: (5,0)-(5,9)) + ├── flags: newline + ├── locals: [] + ├── operator_loc: (5,0)-(5,2) = "->" + ├── opening_loc: (5,3)-(5,4) = "{" + ├── closing_loc: (5,8)-(5,9) = "}" + ├── parameters: ∅ + └── body: + @ StatementsNode (location: (5,5)-(5,7)) + ├── flags: ∅ + └── body: (length: 1) + └── @ CallNode (location: (5,5)-(5,7)) + ├── flags: newline, variable_call, ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :it + ├── message_loc: (5,5)-(5,7) = "it" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: ∅ diff --git a/snapshots/3.3-3.3/it_indirect_writes.txt b/snapshots/3.3-3.3/it_indirect_writes.txt new file mode 100644 index 0000000000..918eca9a37 --- /dev/null +++ b/snapshots/3.3-3.3/it_indirect_writes.txt @@ -0,0 +1,455 @@ +@ ProgramNode (location: (1,0)-(23,24)) +├── flags: ∅ +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(23,24)) + ├── flags: ∅ + └── body: (length: 12) + ├── @ CallNode (location: (1,0)-(1,15)) + │ ├── flags: newline, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :tap + │ ├── message_loc: (1,0)-(1,3) = "tap" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (1,4)-(1,15)) + │ ├── flags: ∅ + │ ├── locals: [:it] + │ ├── parameters: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (1,6)-(1,13)) + │ │ ├── flags: ∅ + │ │ └── body: (length: 1) + │ │ └── @ LocalVariableOperatorWriteNode (location: (1,6)-(1,13)) + │ │ ├── flags: newline + │ │ ├── name_loc: (1,6)-(1,8) = "it" + │ │ ├── binary_operator_loc: (1,9)-(1,11) = "+=" + │ │ ├── value: + │ │ │ @ IntegerNode (location: (1,12)-(1,13)) + │ │ │ ├── flags: static_literal, decimal + │ │ │ └── value: 1 + │ │ ├── name: :it + │ │ ├── binary_operator: :+ + │ │ └── depth: 0 + │ ├── opening_loc: (1,4)-(1,5) = "{" + │ └── closing_loc: (1,14)-(1,15) = "}" + ├── @ CallNode (location: (3,0)-(3,16)) + │ ├── flags: newline, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :tap + │ ├── message_loc: (3,0)-(3,3) = "tap" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (3,4)-(3,16)) + │ ├── flags: ∅ + │ ├── locals: [:it] + │ ├── parameters: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (3,6)-(3,14)) + │ │ ├── flags: ∅ + │ │ └── body: (length: 1) + │ │ └── @ LocalVariableOrWriteNode (location: (3,6)-(3,14)) + │ │ ├── flags: newline + │ │ ├── name_loc: (3,6)-(3,8) = "it" + │ │ ├── operator_loc: (3,9)-(3,12) = "||=" + │ │ ├── value: + │ │ │ @ IntegerNode (location: (3,13)-(3,14)) + │ │ │ ├── flags: static_literal, decimal + │ │ │ └── value: 1 + │ │ ├── name: :it + │ │ └── depth: 0 + │ ├── opening_loc: (3,4)-(3,5) = "{" + │ └── closing_loc: (3,15)-(3,16) = "}" + ├── @ CallNode (location: (5,0)-(5,16)) + │ ├── flags: newline, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :tap + │ ├── message_loc: (5,0)-(5,3) = "tap" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (5,4)-(5,16)) + │ ├── flags: ∅ + │ ├── locals: [:it] + │ ├── parameters: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (5,6)-(5,14)) + │ │ ├── flags: ∅ + │ │ └── body: (length: 1) + │ │ └── @ LocalVariableAndWriteNode (location: (5,6)-(5,14)) + │ │ ├── flags: newline + │ │ ├── name_loc: (5,6)-(5,8) = "it" + │ │ ├── operator_loc: (5,9)-(5,12) = "&&=" + │ │ ├── value: + │ │ │ @ IntegerNode (location: (5,13)-(5,14)) + │ │ │ ├── flags: static_literal, decimal + │ │ │ └── value: 1 + │ │ ├── name: :it + │ │ └── depth: 0 + │ ├── opening_loc: (5,4)-(5,5) = "{" + │ └── closing_loc: (5,15)-(5,16) = "}" + ├── @ CallNode (location: (7,0)-(7,19)) + │ ├── flags: newline, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :tap + │ ├── message_loc: (7,0)-(7,3) = "tap" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (7,4)-(7,19)) + │ ├── flags: ∅ + │ ├── locals: [:it] + │ ├── parameters: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (7,6)-(7,17)) + │ │ ├── flags: ∅ + │ │ └── body: (length: 2) + │ │ ├── @ CallNode (location: (7,6)-(7,8)) + │ │ │ ├── flags: newline, variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :it + │ │ │ ├── message_loc: (7,6)-(7,8) = "it" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── @ LocalVariableOperatorWriteNode (location: (7,10)-(7,17)) + │ │ ├── flags: newline + │ │ ├── name_loc: (7,10)-(7,12) = "it" + │ │ ├── binary_operator_loc: (7,13)-(7,15) = "+=" + │ │ ├── value: + │ │ │ @ IntegerNode (location: (7,16)-(7,17)) + │ │ │ ├── flags: static_literal, decimal + │ │ │ └── value: 1 + │ │ ├── name: :it + │ │ ├── binary_operator: :+ + │ │ └── depth: 0 + │ ├── opening_loc: (7,4)-(7,5) = "{" + │ └── closing_loc: (7,18)-(7,19) = "}" + ├── @ CallNode (location: (9,0)-(9,20)) + │ ├── flags: newline, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :tap + │ ├── message_loc: (9,0)-(9,3) = "tap" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (9,4)-(9,20)) + │ ├── flags: ∅ + │ ├── locals: [:it] + │ ├── parameters: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (9,6)-(9,18)) + │ │ ├── flags: ∅ + │ │ └── body: (length: 2) + │ │ ├── @ CallNode (location: (9,6)-(9,8)) + │ │ │ ├── flags: newline, variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :it + │ │ │ ├── message_loc: (9,6)-(9,8) = "it" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── @ LocalVariableOrWriteNode (location: (9,10)-(9,18)) + │ │ ├── flags: newline + │ │ ├── name_loc: (9,10)-(9,12) = "it" + │ │ ├── operator_loc: (9,13)-(9,16) = "||=" + │ │ ├── value: + │ │ │ @ IntegerNode (location: (9,17)-(9,18)) + │ │ │ ├── flags: static_literal, decimal + │ │ │ └── value: 1 + │ │ ├── name: :it + │ │ └── depth: 0 + │ ├── opening_loc: (9,4)-(9,5) = "{" + │ └── closing_loc: (9,19)-(9,20) = "}" + ├── @ CallNode (location: (11,0)-(11,20)) + │ ├── flags: newline, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :tap + │ ├── message_loc: (11,0)-(11,3) = "tap" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (11,4)-(11,20)) + │ ├── flags: ∅ + │ ├── locals: [:it] + │ ├── parameters: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (11,6)-(11,18)) + │ │ ├── flags: ∅ + │ │ └── body: (length: 2) + │ │ ├── @ CallNode (location: (11,6)-(11,8)) + │ │ │ ├── flags: newline, variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :it + │ │ │ ├── message_loc: (11,6)-(11,8) = "it" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── @ LocalVariableAndWriteNode (location: (11,10)-(11,18)) + │ │ ├── flags: newline + │ │ ├── name_loc: (11,10)-(11,12) = "it" + │ │ ├── operator_loc: (11,13)-(11,16) = "&&=" + │ │ ├── value: + │ │ │ @ IntegerNode (location: (11,17)-(11,18)) + │ │ │ ├── flags: static_literal, decimal + │ │ │ └── value: 1 + │ │ ├── name: :it + │ │ └── depth: 0 + │ ├── opening_loc: (11,4)-(11,5) = "{" + │ └── closing_loc: (11,19)-(11,20) = "}" + ├── @ CallNode (location: (13,0)-(13,19)) + │ ├── flags: newline, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :tap + │ ├── message_loc: (13,0)-(13,3) = "tap" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (13,4)-(13,19)) + │ ├── flags: ∅ + │ ├── locals: [:it] + │ ├── parameters: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (13,6)-(13,17)) + │ │ ├── flags: ∅ + │ │ └── body: (length: 2) + │ │ ├── @ LocalVariableOperatorWriteNode (location: (13,6)-(13,13)) + │ │ │ ├── flags: newline + │ │ │ ├── name_loc: (13,6)-(13,8) = "it" + │ │ │ ├── binary_operator_loc: (13,9)-(13,11) = "+=" + │ │ │ ├── value: + │ │ │ │ @ IntegerNode (location: (13,12)-(13,13)) + │ │ │ │ ├── flags: static_literal, decimal + │ │ │ │ └── value: 1 + │ │ │ ├── name: :it + │ │ │ ├── binary_operator: :+ + │ │ │ └── depth: 0 + │ │ └── @ LocalVariableReadNode (location: (13,15)-(13,17)) + │ │ ├── flags: newline + │ │ ├── name: :it + │ │ └── depth: 0 + │ ├── opening_loc: (13,4)-(13,5) = "{" + │ └── closing_loc: (13,18)-(13,19) = "}" + ├── @ CallNode (location: (15,0)-(15,20)) + │ ├── flags: newline, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :tap + │ ├── message_loc: (15,0)-(15,3) = "tap" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (15,4)-(15,20)) + │ ├── flags: ∅ + │ ├── locals: [:it] + │ ├── parameters: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (15,6)-(15,18)) + │ │ ├── flags: ∅ + │ │ └── body: (length: 2) + │ │ ├── @ LocalVariableOrWriteNode (location: (15,6)-(15,14)) + │ │ │ ├── flags: newline + │ │ │ ├── name_loc: (15,6)-(15,8) = "it" + │ │ │ ├── operator_loc: (15,9)-(15,12) = "||=" + │ │ │ ├── value: + │ │ │ │ @ IntegerNode (location: (15,13)-(15,14)) + │ │ │ │ ├── flags: static_literal, decimal + │ │ │ │ └── value: 1 + │ │ │ ├── name: :it + │ │ │ └── depth: 0 + │ │ └── @ LocalVariableReadNode (location: (15,16)-(15,18)) + │ │ ├── flags: newline + │ │ ├── name: :it + │ │ └── depth: 0 + │ ├── opening_loc: (15,4)-(15,5) = "{" + │ └── closing_loc: (15,19)-(15,20) = "}" + ├── @ CallNode (location: (17,0)-(17,20)) + │ ├── flags: newline, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :tap + │ ├── message_loc: (17,0)-(17,3) = "tap" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (17,4)-(17,20)) + │ ├── flags: ∅ + │ ├── locals: [:it] + │ ├── parameters: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (17,6)-(17,18)) + │ │ ├── flags: ∅ + │ │ └── body: (length: 2) + │ │ ├── @ LocalVariableAndWriteNode (location: (17,6)-(17,14)) + │ │ │ ├── flags: newline + │ │ │ ├── name_loc: (17,6)-(17,8) = "it" + │ │ │ ├── operator_loc: (17,9)-(17,12) = "&&=" + │ │ │ ├── value: + │ │ │ │ @ IntegerNode (location: (17,13)-(17,14)) + │ │ │ │ ├── flags: static_literal, decimal + │ │ │ │ └── value: 1 + │ │ │ ├── name: :it + │ │ │ └── depth: 0 + │ │ └── @ LocalVariableReadNode (location: (17,16)-(17,18)) + │ │ ├── flags: newline + │ │ ├── name: :it + │ │ └── depth: 0 + │ ├── opening_loc: (17,4)-(17,5) = "{" + │ └── closing_loc: (17,19)-(17,20) = "}" + ├── @ CallNode (location: (19,0)-(19,23)) + │ ├── flags: newline, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :tap + │ ├── message_loc: (19,0)-(19,3) = "tap" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (19,4)-(19,23)) + │ ├── flags: ∅ + │ ├── locals: [:it] + │ ├── parameters: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (19,6)-(19,21)) + │ │ ├── flags: ∅ + │ │ └── body: (length: 3) + │ │ ├── @ CallNode (location: (19,6)-(19,8)) + │ │ │ ├── flags: newline, variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :it + │ │ │ ├── message_loc: (19,6)-(19,8) = "it" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── @ LocalVariableOperatorWriteNode (location: (19,10)-(19,17)) + │ │ │ ├── flags: newline + │ │ │ ├── name_loc: (19,10)-(19,12) = "it" + │ │ │ ├── binary_operator_loc: (19,13)-(19,15) = "+=" + │ │ │ ├── value: + │ │ │ │ @ IntegerNode (location: (19,16)-(19,17)) + │ │ │ │ ├── flags: static_literal, decimal + │ │ │ │ └── value: 1 + │ │ │ ├── name: :it + │ │ │ ├── binary_operator: :+ + │ │ │ └── depth: 0 + │ │ └── @ LocalVariableReadNode (location: (19,19)-(19,21)) + │ │ ├── flags: newline + │ │ ├── name: :it + │ │ └── depth: 0 + │ ├── opening_loc: (19,4)-(19,5) = "{" + │ └── closing_loc: (19,22)-(19,23) = "}" + ├── @ CallNode (location: (21,0)-(21,24)) + │ ├── flags: newline, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :tap + │ ├── message_loc: (21,0)-(21,3) = "tap" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (21,4)-(21,24)) + │ ├── flags: ∅ + │ ├── locals: [:it] + │ ├── parameters: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (21,6)-(21,22)) + │ │ ├── flags: ∅ + │ │ └── body: (length: 3) + │ │ ├── @ CallNode (location: (21,6)-(21,8)) + │ │ │ ├── flags: newline, variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :it + │ │ │ ├── message_loc: (21,6)-(21,8) = "it" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── @ LocalVariableOrWriteNode (location: (21,10)-(21,18)) + │ │ │ ├── flags: newline + │ │ │ ├── name_loc: (21,10)-(21,12) = "it" + │ │ │ ├── operator_loc: (21,13)-(21,16) = "||=" + │ │ │ ├── value: + │ │ │ │ @ IntegerNode (location: (21,17)-(21,18)) + │ │ │ │ ├── flags: static_literal, decimal + │ │ │ │ └── value: 1 + │ │ │ ├── name: :it + │ │ │ └── depth: 0 + │ │ └── @ LocalVariableReadNode (location: (21,20)-(21,22)) + │ │ ├── flags: newline + │ │ ├── name: :it + │ │ └── depth: 0 + │ ├── opening_loc: (21,4)-(21,5) = "{" + │ └── closing_loc: (21,23)-(21,24) = "}" + └── @ CallNode (location: (23,0)-(23,24)) + ├── flags: newline, ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :tap + ├── message_loc: (23,0)-(23,3) = "tap" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: + @ BlockNode (location: (23,4)-(23,24)) + ├── flags: ∅ + ├── locals: [:it] + ├── parameters: ∅ + ├── body: + │ @ StatementsNode (location: (23,6)-(23,22)) + │ ├── flags: ∅ + │ └── body: (length: 3) + │ ├── @ CallNode (location: (23,6)-(23,8)) + │ │ ├── flags: newline, variable_call, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :it + │ │ ├── message_loc: (23,6)-(23,8) = "it" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── @ LocalVariableAndWriteNode (location: (23,10)-(23,18)) + │ │ ├── flags: newline + │ │ ├── name_loc: (23,10)-(23,12) = "it" + │ │ ├── operator_loc: (23,13)-(23,16) = "&&=" + │ │ ├── value: + │ │ │ @ IntegerNode (location: (23,17)-(23,18)) + │ │ │ ├── flags: static_literal, decimal + │ │ │ └── value: 1 + │ │ ├── name: :it + │ │ └── depth: 0 + │ └── @ LocalVariableReadNode (location: (23,20)-(23,22)) + │ ├── flags: newline + │ ├── name: :it + │ └── depth: 0 + ├── opening_loc: (23,4)-(23,5) = "{" + └── closing_loc: (23,23)-(23,24) = "}" diff --git a/snapshots/3.3-3.3/it_read_and_assignment.txt b/snapshots/3.3-3.3/it_read_and_assignment.txt new file mode 100644 index 0000000000..d30b9c2902 --- /dev/null +++ b/snapshots/3.3-3.3/it_read_and_assignment.txt @@ -0,0 +1,81 @@ +@ ProgramNode (location: (1,0)-(1,30)) +├── flags: ∅ +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,30)) + ├── flags: ∅ + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,30)) + ├── flags: newline + ├── receiver: + │ @ IntegerNode (location: (1,0)-(1,2)) + │ ├── flags: static_literal, decimal + │ └── value: 42 + ├── call_operator_loc: (1,2)-(1,3) = "." + ├── name: :tap + ├── message_loc: (1,3)-(1,6) = "tap" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: + @ BlockNode (location: (1,7)-(1,30)) + ├── flags: ∅ + ├── locals: [:it] + ├── parameters: ∅ + ├── body: + │ @ StatementsNode (location: (1,9)-(1,28)) + │ ├── flags: ∅ + │ └── body: (length: 3) + │ ├── @ CallNode (location: (1,9)-(1,13)) + │ │ ├── flags: newline, ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :p + │ │ ├── message_loc: (1,9)-(1,10) = "p" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (1,11)-(1,13)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ CallNode (location: (1,11)-(1,13)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :it + │ │ │ ├── message_loc: (1,11)-(1,13) = "it" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── closing_loc: ∅ + │ │ └── block: ∅ + │ ├── @ LocalVariableWriteNode (location: (1,15)-(1,22)) + │ │ ├── flags: newline + │ │ ├── name: :it + │ │ ├── depth: 0 + │ │ ├── name_loc: (1,15)-(1,17) = "it" + │ │ ├── value: + │ │ │ @ LocalVariableReadNode (location: (1,20)-(1,22)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :it + │ │ │ └── depth: 0 + │ │ └── operator_loc: (1,18)-(1,19) = "=" + │ └── @ CallNode (location: (1,24)-(1,28)) + │ ├── flags: newline, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :p + │ ├── message_loc: (1,24)-(1,25) = "p" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,26)-(1,28)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ LocalVariableReadNode (location: (1,26)-(1,28)) + │ │ ├── flags: ∅ + │ │ ├── name: :it + │ │ └── depth: 0 + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── opening_loc: (1,7)-(1,8) = "{" + └── closing_loc: (1,29)-(1,30) = "}" diff --git a/snapshots/3.3-3.3/it_with_ordinary_parameter.txt b/snapshots/3.3-3.3/it_with_ordinary_parameter.txt new file mode 100644 index 0000000000..ab3178de33 --- /dev/null +++ b/snapshots/3.3-3.3/it_with_ordinary_parameter.txt @@ -0,0 +1,43 @@ +@ ProgramNode (location: (1,0)-(1,14)) +├── flags: ∅ +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,14)) + ├── flags: ∅ + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,14)) + ├── flags: newline, ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :proc + ├── message_loc: (1,0)-(1,4) = "proc" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: + @ BlockNode (location: (1,5)-(1,14)) + ├── flags: ∅ + ├── locals: [] + ├── parameters: + │ @ BlockParametersNode (location: (1,7)-(1,9)) + │ ├── flags: ∅ + │ ├── parameters: ∅ + │ ├── locals: (length: 0) + │ ├── opening_loc: (1,7)-(1,8) = "|" + │ └── closing_loc: (1,8)-(1,9) = "|" + ├── body: + │ @ StatementsNode (location: (1,10)-(1,12)) + │ ├── flags: ∅ + │ └── body: (length: 1) + │ └── @ CallNode (location: (1,10)-(1,12)) + │ ├── flags: newline, variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :it + │ ├── message_loc: (1,10)-(1,12) = "it" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── opening_loc: (1,5)-(1,6) = "{" + └── closing_loc: (1,13)-(1,14) = "}" diff --git a/snapshots/3.3-3.3/keyword_args_in_array_assignment.txt b/snapshots/3.3-3.3/keyword_args_in_array_assignment.txt new file mode 100644 index 0000000000..785542a3e5 --- /dev/null +++ b/snapshots/3.3-3.3/keyword_args_in_array_assignment.txt @@ -0,0 +1,56 @@ +@ ProgramNode (location: (1,0)-(1,23)) +├── flags: ∅ +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,23)) + ├── flags: ∅ + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,23)) + ├── flags: newline, attribute_write + ├── receiver: + │ @ CallNode (location: (1,0)-(1,6)) + │ ├── flags: variable_call, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :matrix + │ ├── message_loc: (1,0)-(1,6) = "matrix" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── call_operator_loc: ∅ + ├── name: :[]= + ├── message_loc: (1,6)-(1,19) = "[5, axis: :y]" + ├── opening_loc: (1,6)-(1,7) = "[" + ├── arguments: + │ @ ArgumentsNode (location: (1,7)-(1,23)) + │ ├── flags: contains_keywords + │ └── arguments: (length: 3) + │ ├── @ IntegerNode (location: (1,7)-(1,8)) + │ │ ├── flags: static_literal, decimal + │ │ └── value: 5 + │ ├── @ KeywordHashNode (location: (1,10)-(1,18)) + │ │ ├── flags: symbol_keys + │ │ └── elements: (length: 1) + │ │ └── @ AssocNode (location: (1,10)-(1,18)) + │ │ ├── flags: static_literal + │ │ ├── key: + │ │ │ @ SymbolNode (location: (1,10)-(1,15)) + │ │ │ ├── flags: static_literal, forced_us_ascii_encoding + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── value_loc: (1,10)-(1,14) = "axis" + │ │ │ ├── closing_loc: (1,14)-(1,15) = ":" + │ │ │ └── unescaped: "axis" + │ │ ├── value: + │ │ │ @ SymbolNode (location: (1,16)-(1,18)) + │ │ │ ├── flags: static_literal, forced_us_ascii_encoding + │ │ │ ├── opening_loc: (1,16)-(1,17) = ":" + │ │ │ ├── value_loc: (1,17)-(1,18) = "y" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "y" + │ │ └── operator_loc: ∅ + │ └── @ IntegerNode (location: (1,22)-(1,23)) + │ ├── flags: static_literal, decimal + │ └── value: 8 + ├── closing_loc: (1,18)-(1,19) = "]" + └── block: ∅ diff --git a/snapshots/3.3-3.3/return_in_sclass.txt b/snapshots/3.3-3.3/return_in_sclass.txt new file mode 100644 index 0000000000..d8f298b23a --- /dev/null +++ b/snapshots/3.3-3.3/return_in_sclass.txt @@ -0,0 +1,25 @@ +@ ProgramNode (location: (1,0)-(1,23)) +├── flags: ∅ +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,23)) + ├── flags: ∅ + └── body: (length: 1) + └── @ SingletonClassNode (location: (1,0)-(1,23)) + ├── flags: newline + ├── locals: [] + ├── class_keyword_loc: (1,0)-(1,5) = "class" + ├── operator_loc: (1,6)-(1,8) = "<<" + ├── expression: + │ @ ConstantReadNode (location: (1,9)-(1,10)) + │ ├── flags: ∅ + │ └── name: :A + ├── body: + │ @ StatementsNode (location: (1,12)-(1,18)) + │ ├── flags: ∅ + │ └── body: (length: 1) + │ └── @ ReturnNode (location: (1,12)-(1,18)) + │ ├── flags: newline + │ ├── keyword_loc: (1,12)-(1,18) = "return" + │ └── arguments: ∅ + └── end_keyword_loc: (1,20)-(1,23) = "end" diff --git a/snapshots/3.4/circular_parameters.txt b/snapshots/3.4/circular_parameters.txt new file mode 100644 index 0000000000..3e74882f6c --- /dev/null +++ b/snapshots/3.4/circular_parameters.txt @@ -0,0 +1,167 @@ +@ ProgramNode (location: (1,0)-(4,19)) +├── flags: ∅ +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(4,19)) + ├── flags: ∅ + └── body: (length: 4) + ├── @ DefNode (location: (1,0)-(1,23)) + │ ├── flags: newline + │ ├── name: :foo + │ ├── name_loc: (1,4)-(1,7) = "foo" + │ ├── receiver: ∅ + │ ├── parameters: + │ │ @ ParametersNode (location: (1,8)-(1,17)) + │ │ ├── flags: ∅ + │ │ ├── requireds: (length: 0) + │ │ ├── optionals: (length: 1) + │ │ │ └── @ OptionalParameterNode (location: (1,8)-(1,17)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :bar + │ │ │ ├── name_loc: (1,8)-(1,11) = "bar" + │ │ │ ├── operator_loc: (1,12)-(1,13) = "=" + │ │ │ └── value: + │ │ │ @ LocalVariableReadNode (location: (1,14)-(1,17)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :bar + │ │ │ └── depth: 0 + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (1,21)-(1,23)) + │ │ ├── flags: ∅ + │ │ └── body: (length: 1) + │ │ └── @ IntegerNode (location: (1,21)-(1,23)) + │ │ ├── flags: static_literal, decimal + │ │ └── value: 42 + │ ├── locals: [:bar] + │ ├── def_keyword_loc: (1,0)-(1,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: (1,7)-(1,8) = "(" + │ ├── rparen_loc: (1,17)-(1,18) = ")" + │ ├── equal_loc: (1,19)-(1,20) = "=" + │ └── end_keyword_loc: ∅ + ├── @ DefNode (location: (2,0)-(2,22)) + │ ├── flags: newline + │ ├── name: :foo + │ ├── name_loc: (2,4)-(2,7) = "foo" + │ ├── receiver: ∅ + │ ├── parameters: + │ │ @ ParametersNode (location: (2,8)-(2,16)) + │ │ ├── flags: ∅ + │ │ ├── requireds: (length: 0) + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 1) + │ │ │ └── @ OptionalKeywordParameterNode (location: (2,8)-(2,16)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :bar + │ │ │ ├── name_loc: (2,8)-(2,12) = "bar:" + │ │ │ └── value: + │ │ │ @ LocalVariableReadNode (location: (2,13)-(2,16)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :bar + │ │ │ └── depth: 0 + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (2,20)-(2,22)) + │ │ ├── flags: ∅ + │ │ └── body: (length: 1) + │ │ └── @ IntegerNode (location: (2,20)-(2,22)) + │ │ ├── flags: static_literal, decimal + │ │ └── value: 42 + │ ├── locals: [:bar] + │ ├── def_keyword_loc: (2,0)-(2,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: (2,7)-(2,8) = "(" + │ ├── rparen_loc: (2,16)-(2,17) = ")" + │ ├── equal_loc: (2,18)-(2,19) = "=" + │ └── end_keyword_loc: ∅ + ├── @ CallNode (location: (3,0)-(3,20)) + │ ├── flags: newline, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :proc + │ ├── message_loc: (3,0)-(3,4) = "proc" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: + │ @ BlockNode (location: (3,5)-(3,20)) + │ ├── flags: ∅ + │ ├── locals: [:foo] + │ ├── parameters: + │ │ @ BlockParametersNode (location: (3,7)-(3,18)) + │ │ ├── flags: ∅ + │ │ ├── parameters: + │ │ │ @ ParametersNode (location: (3,8)-(3,17)) + │ │ │ ├── flags: ∅ + │ │ │ ├── requireds: (length: 0) + │ │ │ ├── optionals: (length: 1) + │ │ │ │ └── @ OptionalParameterNode (location: (3,8)-(3,17)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── name: :foo + │ │ │ │ ├── name_loc: (3,8)-(3,11) = "foo" + │ │ │ │ ├── operator_loc: (3,12)-(3,13) = "=" + │ │ │ │ └── value: + │ │ │ │ @ LocalVariableReadNode (location: (3,14)-(3,17)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── name: :foo + │ │ │ │ └── depth: 0 + │ │ │ ├── rest: ∅ + │ │ │ ├── posts: (length: 0) + │ │ │ ├── keywords: (length: 0) + │ │ │ ├── keyword_rest: ∅ + │ │ │ └── block: ∅ + │ │ ├── locals: (length: 0) + │ │ ├── opening_loc: (3,7)-(3,8) = "|" + │ │ └── closing_loc: (3,17)-(3,18) = "|" + │ ├── body: ∅ + │ ├── opening_loc: (3,5)-(3,6) = "{" + │ └── closing_loc: (3,19)-(3,20) = "}" + └── @ CallNode (location: (4,0)-(4,19)) + ├── flags: newline, ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :proc + ├── message_loc: (4,0)-(4,4) = "proc" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: + @ BlockNode (location: (4,5)-(4,19)) + ├── flags: ∅ + ├── locals: [:foo] + ├── parameters: + │ @ BlockParametersNode (location: (4,7)-(4,17)) + │ ├── flags: ∅ + │ ├── parameters: + │ │ @ ParametersNode (location: (4,8)-(4,16)) + │ │ ├── flags: ∅ + │ │ ├── requireds: (length: 0) + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 1) + │ │ │ └── @ OptionalKeywordParameterNode (location: (4,8)-(4,16)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :foo + │ │ │ ├── name_loc: (4,8)-(4,12) = "foo:" + │ │ │ └── value: + │ │ │ @ LocalVariableReadNode (location: (4,13)-(4,16)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :foo + │ │ │ └── depth: 0 + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── locals: (length: 0) + │ ├── opening_loc: (4,7)-(4,8) = "|" + │ └── closing_loc: (4,16)-(4,17) = "|" + ├── body: ∅ + ├── opening_loc: (4,5)-(4,6) = "{" + └── closing_loc: (4,18)-(4,19) = "}" diff --git a/snapshots/it.txt b/snapshots/3.4/it.txt similarity index 100% rename from snapshots/it.txt rename to snapshots/3.4/it.txt diff --git a/snapshots/3.4/it_assignment.txt b/snapshots/3.4/it_assignment.txt new file mode 100644 index 0000000000..83469791c0 --- /dev/null +++ b/snapshots/3.4/it_assignment.txt @@ -0,0 +1,58 @@ +@ ProgramNode (location: (1,0)-(1,24)) +├── flags: ∅ +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,24)) + ├── flags: ∅ + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,24)) + ├── flags: newline + ├── receiver: + │ @ IntegerNode (location: (1,0)-(1,2)) + │ ├── flags: static_literal, decimal + │ └── value: 42 + ├── call_operator_loc: (1,2)-(1,3) = "." + ├── name: :tap + ├── message_loc: (1,3)-(1,6) = "tap" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: + @ BlockNode (location: (1,7)-(1,24)) + ├── flags: ∅ + ├── locals: [:it] + ├── parameters: ∅ + ├── body: + │ @ StatementsNode (location: (1,9)-(1,22)) + │ ├── flags: ∅ + │ └── body: (length: 2) + │ ├── @ LocalVariableWriteNode (location: (1,9)-(1,16)) + │ │ ├── flags: newline + │ │ ├── name: :it + │ │ ├── depth: 0 + │ │ ├── name_loc: (1,9)-(1,11) = "it" + │ │ ├── value: + │ │ │ @ LocalVariableReadNode (location: (1,14)-(1,16)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :it + │ │ │ └── depth: 0 + │ │ └── operator_loc: (1,12)-(1,13) = "=" + │ └── @ CallNode (location: (1,18)-(1,22)) + │ ├── flags: newline, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :p + │ ├── message_loc: (1,18)-(1,19) = "p" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,20)-(1,22)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ LocalVariableReadNode (location: (1,20)-(1,22)) + │ │ ├── flags: ∅ + │ │ ├── name: :it + │ │ └── depth: 0 + │ ├── closing_loc: ∅ + │ └── block: ∅ + ├── opening_loc: (1,7)-(1,8) = "{" + └── closing_loc: (1,23)-(1,24) = "}" diff --git a/snapshots/it_indirect_writes.txt b/snapshots/3.4/it_indirect_writes.txt similarity index 100% rename from snapshots/it_indirect_writes.txt rename to snapshots/3.4/it_indirect_writes.txt diff --git a/snapshots/it_read_and_assignment.txt b/snapshots/3.4/it_read_and_assignment.txt similarity index 100% rename from snapshots/it_read_and_assignment.txt rename to snapshots/3.4/it_read_and_assignment.txt diff --git a/snapshots/endless_methods_command_call.txt b/snapshots/3.5/endless_methods_command_call.txt similarity index 100% rename from snapshots/endless_methods_command_call.txt rename to snapshots/3.5/endless_methods_command_call.txt diff --git a/snapshots/leading_logical.txt b/snapshots/3.5/leading_logical.txt similarity index 100% rename from snapshots/leading_logical.txt rename to snapshots/3.5/leading_logical.txt diff --git a/src/prism.c b/src/prism.c index 0ebcae62f9..95e7d09050 100644 --- a/src/prism.c +++ b/src/prism.c @@ -15764,7 +15764,7 @@ parse_return(pm_parser_t *parser, pm_node_t *node) { break; } } - if (in_sclass) { + if (in_sclass && parser->version >= PM_OPTIONS_VERSION_CRUBY_3_4) { pm_parser_err_node(parser, node, PM_ERR_RETURN_INVALID); } } diff --git a/test/prism/errors/3.3-3.3/circular_parameters.txt b/test/prism/errors/3.3-3.3/circular_parameters.txt new file mode 100644 index 0000000000..ef9642b075 --- /dev/null +++ b/test/prism/errors/3.3-3.3/circular_parameters.txt @@ -0,0 +1,12 @@ +def foo(bar = bar) = 42 + ^~~ circular argument reference - bar + +def foo(bar: bar) = 42 + ^~~ circular argument reference - bar + +proc { |foo = foo| } + ^~~ circular argument reference - foo + +proc { |foo: foo| } + ^~~ circular argument reference - foo + diff --git a/test/prism/errors/3.3-3.4/leading_logical.txt b/test/prism/errors/3.3-3.4/leading_logical.txt new file mode 100644 index 0000000000..2a702e281d --- /dev/null +++ b/test/prism/errors/3.3-3.4/leading_logical.txt @@ -0,0 +1,34 @@ +1 +&& 2 +^~ unexpected '&&', ignoring it +&& 3 +^~ unexpected '&&', ignoring it + +1 +|| 2 +^ unexpected '|', ignoring it + ^ unexpected '|', ignoring it +|| 3 +^ unexpected '|', ignoring it + ^ unexpected '|', ignoring it + +1 +and 2 +^~~ unexpected 'and', ignoring it +and 3 +^~~ unexpected 'and', ignoring it + +1 +or 2 +^~ unexpected 'or', ignoring it +or 3 +^~ unexpected 'or', ignoring it + +1 +and foo +^~~ unexpected 'and', ignoring it + +2 +or foo +^~ unexpected 'or', ignoring it + diff --git a/test/prism/errors/3.3-3.4/private_endless_method.txt b/test/prism/errors/3.3-3.4/private_endless_method.txt new file mode 100644 index 0000000000..8aae5e0cd3 --- /dev/null +++ b/test/prism/errors/3.3-3.4/private_endless_method.txt @@ -0,0 +1,3 @@ +private def foo = puts "Hello" + ^ unexpected string literal, expecting end-of-input + diff --git a/test/prism/errors/block_args_in_array_assignment.txt b/test/prism/errors/3.4/block_args_in_array_assignment.txt similarity index 100% rename from test/prism/errors/block_args_in_array_assignment.txt rename to test/prism/errors/3.4/block_args_in_array_assignment.txt diff --git a/test/prism/errors/dont_allow_return_inside_sclass_body.txt b/test/prism/errors/3.4/dont_allow_return_inside_sclass_body.txt similarity index 100% rename from test/prism/errors/dont_allow_return_inside_sclass_body.txt rename to test/prism/errors/3.4/dont_allow_return_inside_sclass_body.txt diff --git a/test/prism/errors/it_with_ordinary_parameter.txt b/test/prism/errors/3.4/it_with_ordinary_parameter.txt similarity index 100% rename from test/prism/errors/it_with_ordinary_parameter.txt rename to test/prism/errors/3.4/it_with_ordinary_parameter.txt diff --git a/test/prism/errors/keyword_args_in_array_assignment.txt b/test/prism/errors/3.4/keyword_args_in_array_assignment.txt similarity index 100% rename from test/prism/errors/keyword_args_in_array_assignment.txt rename to test/prism/errors/3.4/keyword_args_in_array_assignment.txt diff --git a/test/prism/errors_test.rb b/test/prism/errors_test.rb index 9dd4aea728..9abed92652 100644 --- a/test/prism/errors_test.rb +++ b/test/prism/errors_test.rb @@ -1,41 +1,19 @@ # frozen_string_literal: true +return if RUBY_VERSION < "3.3.0" + require_relative "test_helper" module Prism class ErrorsTest < TestCase base = File.expand_path("errors", __dir__) - filepaths = Dir["*.txt", base: base] - - if RUBY_VERSION < "3.0" - filepaths -= [ - "cannot_assign_to_a_reserved_numbered_parameter.txt", - "writing_numbered_parameter.txt", - "targeting_numbered_parameter.txt", - "defining_numbered_parameter.txt", - "defining_numbered_parameter_2.txt", - "numbered_parameters_in_block_arguments.txt", - "numbered_and_write.txt", - "numbered_or_write.txt", - "numbered_operator_write.txt" - ] - end - - if RUBY_VERSION < "3.4" - filepaths -= [ - "it_with_ordinary_parameter.txt", - "block_args_in_array_assignment.txt", - "keyword_args_in_array_assignment.txt" - ] - end - - if RUBY_VERSION < "3.4" || RUBY_RELEASE_DATE < "2024-07-24" - filepaths -= ["dont_allow_return_inside_sclass_body.txt"] - end + filepaths = Dir["**/*.txt", base: base] filepaths.each do |filepath| - define_method(:"test_#{File.basename(filepath, ".txt")}") do - assert_errors(File.join(base, filepath)) + ruby_versions_for(filepath).each do |version| + define_method(:"test_#{version}_#{File.basename(filepath, ".txt")}") do + assert_errors(File.join(base, filepath), version) + end end end @@ -86,38 +64,15 @@ def test_invalid_message_name assert_equal :"", Prism.parse_statement("+.@foo,+=foo").write_name end - def test_circular_parameters - source = <<~RUBY - def foo(bar = bar) = 42 - def foo(bar: bar) = 42 - proc { |foo = foo| } - proc { |foo: foo| } - RUBY - - source.each_line do |line| - assert_predicate Prism.parse(line, version: "3.3.0"), :failure? - assert_predicate Prism.parse(line), :success? - end - end - - def test_private_endless_method - source = <<~RUBY - private def foo = puts "Hello" - RUBY - - assert_predicate Prism.parse(source, version: "3.4"), :failure? - assert_predicate Prism.parse(source), :success? - end - private - def assert_errors(filepath) + def assert_errors(filepath, version) expected = File.read(filepath, binmode: true, external_encoding: Encoding::UTF_8) source = expected.lines.grep_v(/^\s*\^/).join.gsub(/\n*\z/, "") - refute_valid_syntax(source) + refute_valid_syntax(source) if current_major_minor == version - result = Prism.parse(source) + result = Prism.parse(source, version: version) errors = result.errors refute_empty errors, "Expected errors in #{filepath}" diff --git a/test/prism/fixtures/3.3-3.3/block_args_in_array_assignment.txt b/test/prism/fixtures/3.3-3.3/block_args_in_array_assignment.txt new file mode 100644 index 0000000000..6d6b052681 --- /dev/null +++ b/test/prism/fixtures/3.3-3.3/block_args_in_array_assignment.txt @@ -0,0 +1 @@ +matrix[5, &block] = 8 diff --git a/test/prism/fixtures/it.txt b/test/prism/fixtures/3.3-3.3/it.txt similarity index 100% rename from test/prism/fixtures/it.txt rename to test/prism/fixtures/3.3-3.3/it.txt diff --git a/test/prism/fixtures/it_indirect_writes.txt b/test/prism/fixtures/3.3-3.3/it_indirect_writes.txt similarity index 100% rename from test/prism/fixtures/it_indirect_writes.txt rename to test/prism/fixtures/3.3-3.3/it_indirect_writes.txt diff --git a/test/prism/fixtures/it_read_and_assignment.txt b/test/prism/fixtures/3.3-3.3/it_read_and_assignment.txt similarity index 100% rename from test/prism/fixtures/it_read_and_assignment.txt rename to test/prism/fixtures/3.3-3.3/it_read_and_assignment.txt diff --git a/test/prism/fixtures/3.3-3.3/it_with_ordinary_parameter.txt b/test/prism/fixtures/3.3-3.3/it_with_ordinary_parameter.txt new file mode 100644 index 0000000000..178b641e6b --- /dev/null +++ b/test/prism/fixtures/3.3-3.3/it_with_ordinary_parameter.txt @@ -0,0 +1 @@ +proc { || it } diff --git a/test/prism/fixtures/3.3-3.3/keyword_args_in_array_assignment.txt b/test/prism/fixtures/3.3-3.3/keyword_args_in_array_assignment.txt new file mode 100644 index 0000000000..88016c2afe --- /dev/null +++ b/test/prism/fixtures/3.3-3.3/keyword_args_in_array_assignment.txt @@ -0,0 +1 @@ +matrix[5, axis: :y] = 8 diff --git a/test/prism/fixtures/3.3-3.3/return_in_sclass.txt b/test/prism/fixtures/3.3-3.3/return_in_sclass.txt new file mode 100644 index 0000000000..f1fde5771a --- /dev/null +++ b/test/prism/fixtures/3.3-3.3/return_in_sclass.txt @@ -0,0 +1 @@ +class << A; return; end diff --git a/test/prism/fixtures/3.4/circular_parameters.txt b/test/prism/fixtures/3.4/circular_parameters.txt new file mode 100644 index 0000000000..11537023ad --- /dev/null +++ b/test/prism/fixtures/3.4/circular_parameters.txt @@ -0,0 +1,4 @@ +def foo(bar = bar) = 42 +def foo(bar: bar) = 42 +proc { |foo = foo| } +proc { |foo: foo| } diff --git a/test/prism/fixtures/3.4/it.txt b/test/prism/fixtures/3.4/it.txt new file mode 100644 index 0000000000..5410b01e71 --- /dev/null +++ b/test/prism/fixtures/3.4/it.txt @@ -0,0 +1,5 @@ +x do + it +end + +-> { it } diff --git a/test/prism/fixtures/3.4/it_indirect_writes.txt b/test/prism/fixtures/3.4/it_indirect_writes.txt new file mode 100644 index 0000000000..bb87e9483e --- /dev/null +++ b/test/prism/fixtures/3.4/it_indirect_writes.txt @@ -0,0 +1,23 @@ +tap { it += 1 } + +tap { it ||= 1 } + +tap { it &&= 1 } + +tap { it; it += 1 } + +tap { it; it ||= 1 } + +tap { it; it &&= 1 } + +tap { it += 1; it } + +tap { it ||= 1; it } + +tap { it &&= 1; it } + +tap { it; it += 1; it } + +tap { it; it ||= 1; it } + +tap { it; it &&= 1; it } diff --git a/test/prism/fixtures/3.4/it_read_and_assignment.txt b/test/prism/fixtures/3.4/it_read_and_assignment.txt new file mode 100644 index 0000000000..2cceeb2a54 --- /dev/null +++ b/test/prism/fixtures/3.4/it_read_and_assignment.txt @@ -0,0 +1 @@ +42.tap { p it; it = it; p it } diff --git a/test/prism/fixtures/endless_methods_command_call.txt b/test/prism/fixtures/3.5/endless_methods_command_call.txt similarity index 100% rename from test/prism/fixtures/endless_methods_command_call.txt rename to test/prism/fixtures/3.5/endless_methods_command_call.txt diff --git a/test/prism/fixtures/leading_logical.txt b/test/prism/fixtures/3.5/leading_logical.txt similarity index 100% rename from test/prism/fixtures/leading_logical.txt rename to test/prism/fixtures/3.5/leading_logical.txt diff --git a/test/prism/fixtures_test.rb b/test/prism/fixtures_test.rb index ddb6ffb40c..9d2acfdc1b 100644 --- a/test/prism/fixtures_test.rb +++ b/test/prism/fixtures_test.rb @@ -24,9 +24,13 @@ class FixturesTest < TestCase except << "whitequark/ruby_bug_19281.txt" end + if RUBY_VERSION < "3.4.0" + except << "3.4/circular_parameters.txt" + end + # Leaving these out until they are supported by parse.y. - except << "leading_logical.txt" - except << "endless_methods_command_call.txt" + except << "3.5/leading_logical.txt" + except << "3.5/endless_methods_command_call.txt" # https://bugs.ruby-lang.org/issues/21168#note-5 except << "command_method_call_2.txt" diff --git a/test/prism/lex_test.rb b/test/prism/lex_test.rb index 3a0da1a2d8..9682bf8a32 100644 --- a/test/prism/lex_test.rb +++ b/test/prism/lex_test.rb @@ -43,16 +43,16 @@ class LexTest < TestCase end # https://bugs.ruby-lang.org/issues/20925 - except << "leading_logical.txt" + except << "3.5/leading_logical.txt" # https://bugs.ruby-lang.org/issues/17398#note-12 - except << "endless_methods_command_call.txt" + except << "3.5/endless_methods_command_call.txt" # https://bugs.ruby-lang.org/issues/21168#note-5 except << "command_method_call_2.txt" - Fixture.each(except: except) do |fixture| - define_method(fixture.test_name) { assert_lex(fixture) } + Fixture.each_with_version(except: except) do |fixture, version| + define_method(fixture.test_name(version)) { assert_lex(fixture, version) } end def test_lex_file @@ -97,10 +97,12 @@ def test_parse_lex_file private - def assert_lex(fixture) + def assert_lex(fixture, version) + return unless current_major_minor == version + source = fixture.read - result = Prism.lex_compat(source) + result = Prism.lex_compat(source, version: version) assert_equal [], result.errors Prism.lex_ripper(source).zip(result.value).each do |(ripper, prism)| diff --git a/test/prism/locals_test.rb b/test/prism/locals_test.rb index 9a3224e8ef..d5def0d18f 100644 --- a/test/prism/locals_test.rb +++ b/test/prism/locals_test.rb @@ -32,8 +32,8 @@ class LocalsTest < TestCase "whitequark/ruby_bug_10653.txt", # Leaving these out until they are supported by parse.y. - "leading_logical.txt", - "endless_methods_command_call.txt", + "3.5/leading_logical.txt", + "3.5/endless_methods_command_call.txt", "command_method_call_2.txt" ] diff --git a/test/prism/ruby/parser_test.rb b/test/prism/ruby/parser_test.rb index 10b5fca5ea..016fda91f0 100644 --- a/test/prism/ruby/parser_test.rb +++ b/test/prism/ruby/parser_test.rb @@ -65,11 +65,14 @@ class ParserTest < TestCase # 1.. && 2 "ranges.txt", + # https://bugs.ruby-lang.org/issues/20478 + "3.4/circular_parameters.txt", + # Cannot yet handling leading logical operators. - "leading_logical.txt", + "3.5/leading_logical.txt", # Ruby >= 3.5 specific syntax - "endless_methods_command_call.txt", + "3.5/endless_methods_command_call.txt", # https://bugs.ruby-lang.org/issues/21168#note-5 "command_method_call_2.txt", @@ -165,9 +168,9 @@ def test_non_prism_builder_class_deprecated if RUBY_VERSION >= "3.3" def test_current_parser_for_current_ruby - major, minor, _patch = Gem::Version.new(RUBY_VERSION).segments + major, minor = current_major_minor.split(".") # Let's just hope there never is a Ruby 3.10 or similar - expected = major * 10 + minor + expected = major.to_i * 10 + minor.to_i assert_equal(expected, Translation::ParserCurrent.new.version) end end @@ -189,7 +192,7 @@ def test_invalid_syntax end def test_it_block_parameter_syntax - it_fixture_path = Pathname(__dir__).join("../../../test/prism/fixtures/it.txt") + it_fixture_path = Pathname(__dir__).join("../../../test/prism/fixtures/3.4/it.txt") buffer = Parser::Source::Buffer.new(it_fixture_path) buffer.source = it_fixture_path.read diff --git a/test/prism/ruby/ripper_test.rb b/test/prism/ruby/ripper_test.rb index 4916ec8d9d..12c854aea6 100644 --- a/test/prism/ruby/ripper_test.rb +++ b/test/prism/ruby/ripper_test.rb @@ -9,7 +9,7 @@ class RipperTest < TestCase # Skip these tests that Ripper is reporting the wrong results for. incorrect = [ # Not yet supported. - "leading_logical.txt", + "3.5/leading_logical.txt", # Ripper incorrectly attributes the block to the keyword. "seattlerb/block_break.txt", @@ -31,8 +31,16 @@ class RipperTest < TestCase # Ripper fails to understand some structures that span across heredocs. "spanning_heredoc.txt", + "3.3-3.3/block_args_in_array_assignment.txt", + "3.3-3.3/it_with_ordinary_parameter.txt", + "3.3-3.3/keyword_args_in_array_assignment.txt", + "3.3-3.3/return_in_sclass.txt", + + # https://bugs.ruby-lang.org/issues/20478 + "3.4/circular_parameters.txt", + # https://bugs.ruby-lang.org/issues/17398#note-12 - "endless_methods_command_call.txt", + "3.5/endless_methods_command_call.txt", # https://bugs.ruby-lang.org/issues/21168#note-5 "command_method_call_2.txt", diff --git a/test/prism/ruby/ruby_parser_test.rb b/test/prism/ruby/ruby_parser_test.rb index ec55e41967..7640ddaf1c 100644 --- a/test/prism/ruby/ruby_parser_test.rb +++ b/test/prism/ruby/ruby_parser_test.rb @@ -39,7 +39,6 @@ class RubyParserTest < TestCase "dos_endings.txt", "heredocs_with_fake_newlines.txt", "heredocs_with_ignored_newlines.txt", - "leading_logical.txt", "method_calls.txt", "methods.txt", "multi_write.txt", @@ -77,8 +76,15 @@ class RubyParserTest < TestCase "whitequark/ruby_bug_19281.txt", "whitequark/slash_newline_in_heredocs.txt", - # Ruby >= 3.5 specific syntax - "endless_methods_command_call.txt", + "3.3-3.3/block_args_in_array_assignment.txt", + "3.3-3.3/it_with_ordinary_parameter.txt", + "3.3-3.3/keyword_args_in_array_assignment.txt", + "3.3-3.3/return_in_sclass.txt", + + "3.4/circular_parameters.txt", + + "3.5/endless_methods_command_call.txt", + "3.5/leading_logical.txt", # https://bugs.ruby-lang.org/issues/21168#note-5 "command_method_call_2.txt", diff --git a/test/prism/snapshots_test.rb b/test/prism/snapshots_test.rb index 3fbda1f86e..20cdf44d90 100644 --- a/test/prism/snapshots_test.rb +++ b/test/prism/snapshots_test.rb @@ -36,16 +36,16 @@ def teardown ) end - Fixture.each(except: except) do |fixture| - define_method(fixture.test_name) { assert_snapshot(fixture) } + Fixture.each_with_version(except: except) do |fixture, version| + define_method(fixture.test_name(version)) { assert_snapshot(fixture, version) } end private - def assert_snapshot(fixture) + def assert_snapshot(fixture, version) source = fixture.read - result = Prism.parse(source, filepath: fixture.path) + result = Prism.parse(source, filepath: fixture.path, version: version) assert result.success? printed = PP.pp(result.value, +"", 79) @@ -57,8 +57,14 @@ def assert_snapshot(fixture) # If the snapshot file exists, but the printed value does not match the # snapshot, then update the snapshot file. if printed != saved - File.write(snapshot, printed) - warn("Updated snapshot at #{snapshot}.") + if ENV["UPDATE_SNAPSHOTS"] + File.write(snapshot, printed) + else + warn("Snapshot at #{snapshot} outdated for #{version}. Run with UPDATE_SNAPSHOTS=1 " \ + "to regenerate the files. If modifying behaviour for a subset of ruby versions, " \ + "instead move the fixture and snapshot into versioned directories. For more details, " \ + "see `Prism::TestCase.ruby_versions_for`.") + end end # If the snapshot file exists, then assert that the printed value diff --git a/test/prism/snippets_test.rb b/test/prism/snippets_test.rb index 66802c5dc3..3160442cc0 100644 --- a/test/prism/snippets_test.rb +++ b/test/prism/snippets_test.rb @@ -18,24 +18,24 @@ class SnippetsTest < TestCase "whitequark/multiple_pattern_matches.txt" ] - Fixture.each(except: except) do |fixture| - define_method(fixture.test_name) { assert_snippets(fixture) } + Fixture.each_with_version(except: except) do |fixture, version| + define_method(fixture.test_name(version)) { assert_snippets(fixture, version) } end private # We test every snippet (separated by \n\n) in isolation to ensure the # parser does not try to read bytes further than the end of each snippet. - def assert_snippets(fixture) + def assert_snippets(fixture, version) fixture.read.split(/(?<=\S)\n\n(?=\S)/).each do |snippet| snippet = snippet.rstrip - result = Prism.parse(snippet, filepath: fixture.path) + result = Prism.parse(snippet, filepath: fixture.path, version: version) assert result.success? if !ENV["PRISM_BUILD_MINIMAL"] - dumped = Prism.dump(snippet, filepath: fixture.path) - assert_equal_nodes(result.value, Prism.load(snippet, dumped).value) + dumped = Prism.dump(snippet, filepath: fixture.path, version: version) + assert_equal_nodes(result.value, Prism.load(snippet, dumped, version: version).value) end end end diff --git a/test/prism/test_helper.rb b/test/prism/test_helper.rb index 0be9d1e7da..84871722c9 100644 --- a/test/prism/test_helper.rb +++ b/test/prism/test_helper.rb @@ -58,8 +58,12 @@ def snapshot_path File.join(File.expand_path("../..", __dir__), "snapshots", path) end - def test_name - :"test_#{path}" + def test_name(version = nil) + if version + :"test_#{version}_#{path}" + else + :"test_#{path}" + end end def self.each(except: [], &block) @@ -68,6 +72,14 @@ def self.each(except: [], &block) paths.each { |path| yield Fixture.new(path) } end + def self.each_with_version(except: [], &block) + each(except: except) do |fixture| + TestCase.ruby_versions_for(fixture.path).each do |version| + yield fixture, version + end + end + end + def self.custom_base_path? ENV.key?("FIXTURE_BASE") end @@ -217,6 +229,37 @@ def self.windows? RbConfig::CONFIG["host_os"].match?(/bccwin|cygwin|djgpp|mingw|mswin|wince/i) end + # All versions that prism can parse + SYNTAX_VERSIONS = %w[3.3 3.4 3.5] + + # Returns an array of ruby versions that a given filepath should test against: + # test.txt # => all available versions + # 3.4/test.txt # => versions since 3.4 (inclusive) + # 3.4-4.2/test.txt # => verisions since 3.4 (inclusive) up to 4.2 (inclusive) + def self.ruby_versions_for(filepath) + return [ENV['SYNTAX_VERSION']] if ENV['SYNTAX_VERSION'] + + parts = filepath.split("/") + return SYNTAX_VERSIONS if parts.size == 1 + + version_start, version_stop = parts[0].split("-") + if version_stop + SYNTAX_VERSIONS[SYNTAX_VERSIONS.index(version_start)..SYNTAX_VERSIONS.index(version_stop)] + else + SYNTAX_VERSIONS[SYNTAX_VERSIONS.index(version_start)..] + end + end + + def current_major_minor + RUBY_VERSION.split(".")[0, 2].join(".") + end + + if RUBY_VERSION >= "3.3.0" + def test_all_syntax_versions_present + assert_include(SYNTAX_VERSIONS, current_major_minor) + end + end + private if RUBY_ENGINE == "ruby" && RubyVM::InstructionSequence.compile("").to_a[4][:parser] != :prism From 240afe74438c4e974d1c1400e67db0cd760dfb7c Mon Sep 17 00:00:00 2001 From: Earlopain <14981592+Earlopain@users.noreply.github.com> Date: Mon, 20 Oct 2025 13:25:39 +0200 Subject: [PATCH 183/333] Reenable windows head Disabled in https://github.com/ruby/prism/commit/2a2a1ebe008861445d137647d53c4cde87cdd6b6 I'd hope this is fixed by now --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3e47e57974..ec5e14564d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -295,7 +295,7 @@ jobs: - { ruby: "3.2", os: "windows-latest", gemfile: "3.2" } - { ruby: "3.3", os: "windows-latest", gemfile: "3.3" } - { ruby: "3.4", os: "windows-latest", gemfile: "3.4" } - # - { ruby: "head", os: "windows-latest", gemfile: "3.5" } <-- failing certs, temporarily disabled + - { ruby: "head", os: "windows-latest", gemfile: "3.5" } - { ruby: "jruby-10.0.0.0", os: "windows-latest", gemfile: "jruby" } # https://github.com/jruby/jruby/issues/8923 env: BUNDLE_GEMFILE: gemfiles/${{ matrix.target.gemfile }}/Gemfile From 25e46a2319cea50da7f0ee6ba80afc265755324f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 20 Oct 2025 16:29:31 +0000 Subject: [PATCH 184/333] Bump the action-deps group with 2 updates Bumps the action-deps group with 2 updates: [actions/checkout](https://github.com/actions/checkout) and [actions/setup-node](https://github.com/actions/setup-node). Updates `actions/checkout` from 4 to 5 - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v4...v5) Updates `actions/setup-node` from 4 to 6 - [Release notes](https://github.com/actions/setup-node/releases) - [Commits](https://github.com/actions/setup-node/compare/v4...v6) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: '5' dependency-type: direct:production update-type: version-update:semver-major dependency-group: action-deps - dependency-name: actions/setup-node dependency-version: '6' dependency-type: direct:production update-type: version-update:semver-major dependency-group: action-deps ... Signed-off-by: dependabot[bot] --- .github/workflows/javascript-bindings.yml | 2 +- .github/workflows/publish-gem.yml | 2 +- .github/workflows/publish-npm.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/javascript-bindings.yml b/.github/workflows/javascript-bindings.yml index ee6febd54a..c8d68e6550 100644 --- a/.github/workflows/javascript-bindings.yml +++ b/.github/workflows/javascript-bindings.yml @@ -39,7 +39,7 @@ jobs: name: prism.wasm path: javascript/src/prism.wasm - - uses: actions/setup-node@v5 + - uses: actions/setup-node@v6 with: node-version: 20.x diff --git a/.github/workflows/publish-gem.yml b/.github/workflows/publish-gem.yml index c64a65b66a..f5da7292b2 100644 --- a/.github/workflows/publish-gem.yml +++ b/.github/workflows/publish-gem.yml @@ -27,7 +27,7 @@ jobs: with: egress-policy: audit - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - name: Set up Ruby uses: ruby/setup-ruby@v1 diff --git a/.github/workflows/publish-npm.yml b/.github/workflows/publish-npm.yml index 9e498684ef..c93093987f 100644 --- a/.github/workflows/publish-npm.yml +++ b/.github/workflows/publish-npm.yml @@ -23,7 +23,7 @@ jobs: bundler-cache: true - name: Set up node - uses: actions/setup-node@v4 + uses: actions/setup-node@v6 with: node-version: '20' registry-url: 'https://registry.npmjs.org' From c38b078d6fb6c182496d93ac4636ac2648f46704 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 20 Oct 2025 16:34:10 +0000 Subject: [PATCH 185/333] Bump sorbet Bumps the ruby-deps group with 1 update in the /gemfiles/typecheck directory: [sorbet](https://github.com/sorbet/sorbet). Updates `sorbet` from 0.6.12638 to 0.6.12650 - [Release notes](https://github.com/sorbet/sorbet/releases) - [Commits](https://github.com/sorbet/sorbet/commits) --- updated-dependencies: - dependency-name: sorbet dependency-version: 0.6.12650 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps ... Signed-off-by: dependabot[bot] --- gemfiles/typecheck/Gemfile.lock | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/gemfiles/typecheck/Gemfile.lock b/gemfiles/typecheck/Gemfile.lock index 1acebb4435..c8f1405218 100644 --- a/gemfiles/typecheck/Gemfile.lock +++ b/gemfiles/typecheck/Gemfile.lock @@ -62,14 +62,14 @@ GEM sexp_processor (~> 4.16) securerandom (0.4.1) sexp_processor (4.17.4) - sorbet (0.6.12638) - sorbet-static (= 0.6.12638) - sorbet-runtime (0.6.12638) - sorbet-static (0.6.12638-universal-darwin) - sorbet-static (0.6.12638-x86_64-linux) - sorbet-static-and-runtime (0.6.12638) - sorbet (= 0.6.12638) - sorbet-runtime (= 0.6.12638) + sorbet (0.6.12650) + sorbet-static (= 0.6.12650) + sorbet-runtime (0.6.12650) + sorbet-static (0.6.12650-universal-darwin) + sorbet-static (0.6.12650-x86_64-linux) + sorbet-static-and-runtime (0.6.12650) + sorbet (= 0.6.12650) + sorbet-runtime (= 0.6.12650) spoom (1.6.3) erubi (>= 1.10.0) prism (>= 0.28.0) From 98e1cd5c04bf4c92a4e889ccb403940585a4b08d Mon Sep 17 00:00:00 2001 From: Earlopain <14981592+Earlopain@users.noreply.github.com> Date: Wed, 22 Oct 2025 18:57:33 +0200 Subject: [PATCH 186/333] Test against parse.y https://github.com/ruby/prism/commit/17a6a19bbae5c8b438a94816ed67c3852547d859 broke ruby/ruby CI because some tests are only run against parse.y This will catch that in the future. --- .github/workflows/cruby-bindings.yml | 12 +++++++++++- test/prism/fixtures_test.rb | 6 ++++++ test/prism/locals_test.rb | 6 ++++++ 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cruby-bindings.yml b/.github/workflows/cruby-bindings.yml index a13a691b99..918e87b333 100644 --- a/.github/workflows/cruby-bindings.yml +++ b/.github/workflows/cruby-bindings.yml @@ -12,6 +12,14 @@ on: jobs: test-all: + strategy: + matrix: + # Some tests in this repository are only run against parse.y + # We test them here in order to not fail ruby/ruby CI. + parser: + - prism + - parse.y + runs-on: ubuntu-24.04 steps: - name: Set up latest ruby head @@ -39,9 +47,11 @@ jobs: run: | ruby tool/downloader.rb -d tool -e gnu config.guess config.sub autoconf - ./configure -C --disable-install-doc + ./configure -C --disable-install-doc --with-parser=${{ matrix.parser }} make -j$(nproc) working-directory: ruby/ruby - name: make test-all + env: + RUN_OPTS: --parser=${{ matrix.parser }} run: make -j$(nproc) -s test-all working-directory: ruby/ruby diff --git a/test/prism/fixtures_test.rb b/test/prism/fixtures_test.rb index 9d2acfdc1b..0f0577c10d 100644 --- a/test/prism/fixtures_test.rb +++ b/test/prism/fixtures_test.rb @@ -28,6 +28,12 @@ class FixturesTest < TestCase except << "3.4/circular_parameters.txt" end + # Valid only on Ruby 3.3 + except << "3.3-3.3/block_args_in_array_assignment.txt" + except << "3.3-3.3/it_with_ordinary_parameter.txt" + except << "3.3-3.3/keyword_args_in_array_assignment.txt" + except << "3.3-3.3/return_in_sclass.txt" + # Leaving these out until they are supported by parse.y. except << "3.5/leading_logical.txt" except << "3.5/endless_methods_command_call.txt" diff --git a/test/prism/locals_test.rb b/test/prism/locals_test.rb index d5def0d18f..439625b750 100644 --- a/test/prism/locals_test.rb +++ b/test/prism/locals_test.rb @@ -31,6 +31,12 @@ class LocalsTest < TestCase # CRuby is eliminating dead code. "whitequark/ruby_bug_10653.txt", + # Valid only on Ruby 3.3 + "3.3-3.3/block_args_in_array_assignment.txt", + "3.3-3.3/it_with_ordinary_parameter.txt", + "3.3-3.3/keyword_args_in_array_assignment.txt", + "3.3-3.3/return_in_sclass.txt", + # Leaving these out until they are supported by parse.y. "3.5/leading_logical.txt", "3.5/endless_methods_command_call.txt", From c0dfdd4f7a966a13e37c0a641137c8ee818726bb Mon Sep 17 00:00:00 2001 From: Edouard CHIN Date: Wed, 22 Oct 2025 15:51:51 +0200 Subject: [PATCH 187/333] Allow compiling from source on windows: - I'm trying to compile Prism from source on a Windows machine but it unforunately fails when trying to render the template due to the shebang that doesn't exist on Windows. I modified the `system` call to call ruby with its full path directly instead. --- ext/prism/extconf.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/prism/extconf.rb b/ext/prism/extconf.rb index 20ba28fe46..ae1691c979 100644 --- a/ext/prism/extconf.rb +++ b/ext/prism/extconf.rb @@ -37,7 +37,7 @@ def generate_templates Dir.chdir(File.expand_path("../..", __dir__)) do if !File.exist?("include/prism/ast.h") && Dir.exist?(".git") - system("templates/template.rb", exception: true) + system(RbConfig.ruby, "templates/template.rb", exception: true) end end end From bfc798a7ec3bfdedd2ccf91b6c3a3fa96d7b6647 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Sun, 26 Oct 2025 16:16:41 -0400 Subject: [PATCH 188/333] Add equal_loc to call nodes In the case of attribute writes, there are use cases where you want to know the location of the = sign. (Internally we actually need this for translation to the writequark AST.) --- config.yml | 10 + lib/prism/translation/parser/compiler.rb | 32 +-- .../block_args_in_array_assignment.txt | 3 + snapshots/3.3-3.3/it.txt | 3 + snapshots/3.3-3.3/it_indirect_writes.txt | 18 ++ snapshots/3.3-3.3/it_read_and_assignment.txt | 4 + .../3.3-3.3/it_with_ordinary_parameter.txt | 2 + .../keyword_args_in_array_assignment.txt | 2 + snapshots/3.4/circular_parameters.txt | 2 + snapshots/3.4/it.txt | 1 + snapshots/3.4/it_indirect_writes.txt | 12 ++ snapshots/3.4/it_read_and_assignment.txt | 3 + .../3.5/endless_methods_command_call.txt | 20 ++ snapshots/3.5/leading_logical.txt | 2 + snapshots/arithmetic.txt | 22 +++ snapshots/arrays.txt | 84 ++++++++ snapshots/begin_ensure.txt | 11 ++ snapshots/begin_rescue.txt | 35 ++++ snapshots/blocks.txt | 39 ++++ snapshots/boolean_operators.txt | 3 + snapshots/break.txt | 18 ++ snapshots/case.txt | 14 ++ snapshots/case_in_hash_key.txt | 4 + snapshots/character_literal.txt | 1 + snapshots/classes.txt | 9 + snapshots/command_method_call.txt | 45 +++++ snapshots/command_method_call_2.txt | 7 + snapshots/comment_single.txt | 1 + snapshots/comments.txt | 14 ++ snapshots/constants.txt | 88 +++++++++ snapshots/dash_heredocs.txt | 6 + snapshots/defined.txt | 2 + snapshots/dos_endings.txt | 3 + snapshots/dstring.txt | 1 + snapshots/emoji_method_calls.txt | 2 + snapshots/endless_methods.txt | 4 + snapshots/hashes.txt | 17 ++ snapshots/heredoc_with_comment.txt | 1 + .../heredoc_with_escaped_newline_at_start.txt | 2 + snapshots/if.txt | 18 ++ snapshots/integer_operations.txt | 32 +++ snapshots/it_assignment.txt | 2 + snapshots/keyword_method_names.txt | 2 + snapshots/keywords.txt | 1 + snapshots/lambda.txt | 10 + snapshots/method_calls.txt | 126 ++++++++++++ snapshots/methods.txt | 25 +++ snapshots/modules.txt | 4 + snapshots/next.txt | 13 ++ snapshots/non_alphanumeric_methods.txt | 1 + snapshots/not.txt | 31 +++ snapshots/patterns.txt | 184 ++++++++++++++++++ snapshots/procs.txt | 3 + snapshots/ranges.txt | 19 ++ snapshots/regex.txt | 16 ++ snapshots/regex_char_width.txt | 1 + snapshots/regex_escape_encoding.txt | 1 + snapshots/rescue.txt | 25 +++ snapshots/rescue_modifier.txt | 12 ++ snapshots/return.txt | 1 + snapshots/seattlerb/TestRubyParserShared.txt | 3 + snapshots/seattlerb/and_multi.txt | 1 + .../seattlerb/array_lits_trailing_calls.txt | 2 + snapshots/seattlerb/assoc__bare.txt | 1 + snapshots/seattlerb/assoc_label.txt | 1 + snapshots/seattlerb/attr_asgn_colon_id.txt | 1 + snapshots/seattlerb/attrasgn_array_arg.txt | 2 + snapshots/seattlerb/attrasgn_array_lhs.txt | 3 + .../attrasgn_primary_dot_constant.txt | 2 + .../backticks_interpolation_line.txt | 2 + snapshots/seattlerb/bang_eq.txt | 1 + snapshots/seattlerb/bdot2.txt | 2 + snapshots/seattlerb/bdot3.txt | 2 + snapshots/seattlerb/block_arg_kwsplat.txt | 1 + .../seattlerb/block_arg_opt_arg_block.txt | 1 + snapshots/seattlerb/block_arg_opt_splat.txt | 1 + .../block_arg_opt_splat_arg_block_omfg.txt | 1 + snapshots/seattlerb/block_arg_optional.txt | 1 + snapshots/seattlerb/block_arg_scope.txt | 1 + snapshots/seattlerb/block_arg_scope2.txt | 1 + snapshots/seattlerb/block_arg_splat_arg.txt | 1 + snapshots/seattlerb/block_args_kwargs.txt | 1 + snapshots/seattlerb/block_args_no_kwargs.txt | 1 + snapshots/seattlerb/block_args_opt1.txt | 1 + snapshots/seattlerb/block_args_opt2.txt | 1 + snapshots/seattlerb/block_args_opt2_2.txt | 1 + snapshots/seattlerb/block_args_opt3.txt | 1 + .../block_call_defn_call_block_call.txt | 4 + .../block_call_dot_op2_brace_block.txt | 6 + .../block_call_dot_op2_cmd_args_do_block.txt | 7 + .../seattlerb/block_call_operation_colon.txt | 4 + .../seattlerb/block_call_operation_dot.txt | 4 + .../block_call_paren_call_block_call.txt | 4 + .../block_command_operation_colon.txt | 2 + .../seattlerb/block_command_operation_dot.txt | 2 + .../seattlerb/block_decomp_anon_splat_arg.txt | 1 + .../seattlerb/block_decomp_arg_splat.txt | 1 + .../seattlerb/block_decomp_arg_splat_arg.txt | 1 + snapshots/seattlerb/block_decomp_splat.txt | 1 + snapshots/seattlerb/block_kw.txt | 1 + snapshots/seattlerb/block_kw__required.txt | 1 + snapshots/seattlerb/block_kwarg_lvar.txt | 1 + .../seattlerb/block_kwarg_lvar_multiple.txt | 1 + snapshots/seattlerb/block_opt_arg.txt | 1 + snapshots/seattlerb/block_opt_splat.txt | 1 + .../block_opt_splat_arg_block_omfg.txt | 1 + snapshots/seattlerb/block_optarg.txt | 1 + snapshots/seattlerb/block_paren_splat.txt | 1 + snapshots/seattlerb/block_reg_optarg.txt | 1 + snapshots/seattlerb/block_return.txt | 2 + snapshots/seattlerb/block_scope.txt | 1 + snapshots/seattlerb/block_splat_reg.txt | 1 + snapshots/seattlerb/bug169.txt | 1 + snapshots/seattlerb/bug179.txt | 1 + snapshots/seattlerb/bug191.txt | 4 + snapshots/seattlerb/bug236.txt | 2 + snapshots/seattlerb/bug290.txt | 1 + snapshots/seattlerb/bug_187.txt | 3 + snapshots/seattlerb/bug_249.txt | 3 + snapshots/seattlerb/bug_args__19.txt | 2 + snapshots/seattlerb/bug_args_masgn.txt | 1 + snapshots/seattlerb/bug_args_masgn2.txt | 1 + .../bug_args_masgn_outer_parens__19.txt | 1 + .../seattlerb/bug_call_arglist_parens.txt | 3 + snapshots/seattlerb/bug_comma.txt | 2 + snapshots/seattlerb/bug_hash_args.txt | 1 + .../bug_hash_args_trailing_comma.txt | 1 + snapshots/seattlerb/bug_masgn_right.txt | 1 + snapshots/seattlerb/bug_not_parens.txt | 2 + snapshots/seattlerb/bug_op_asgn_rescue.txt | 1 + snapshots/seattlerb/call_and.txt | 1 + snapshots/seattlerb/call_arg_assoc.txt | 1 + .../seattlerb/call_arg_assoc_kwsplat.txt | 1 + snapshots/seattlerb/call_arg_kwsplat.txt | 2 + .../seattlerb/call_args_assoc_quoted.txt | 4 + .../call_args_assoc_trailing_comma.txt | 1 + snapshots/seattlerb/call_args_command.txt | 4 + snapshots/seattlerb/call_array_arg.txt | 1 + snapshots/seattlerb/call_array_block_call.txt | 2 + .../call_array_lambda_block_call.txt | 1 + .../seattlerb/call_array_lit_inline_hash.txt | 1 + snapshots/seattlerb/call_assoc.txt | 1 + snapshots/seattlerb/call_assoc_new.txt | 1 + .../seattlerb/call_assoc_new_if_multiline.txt | 1 + .../seattlerb/call_assoc_trailing_comma.txt | 1 + .../seattlerb/call_bang_command_call.txt | 3 + snapshots/seattlerb/call_bang_squiggle.txt | 1 + .../seattlerb/call_begin_call_block_call.txt | 3 + snapshots/seattlerb/call_block_arg_named.txt | 2 + snapshots/seattlerb/call_carat.txt | 1 + snapshots/seattlerb/call_colon2.txt | 1 + snapshots/seattlerb/call_colon_parens.txt | 1 + snapshots/seattlerb/call_div.txt | 1 + snapshots/seattlerb/call_dot_parens.txt | 1 + snapshots/seattlerb/call_env.txt | 2 + snapshots/seattlerb/call_eq3.txt | 1 + snapshots/seattlerb/call_gt.txt | 1 + snapshots/seattlerb/call_kwsplat.txt | 1 + snapshots/seattlerb/call_leading_dots.txt | 3 + .../seattlerb/call_leading_dots_comment.txt | 3 + snapshots/seattlerb/call_lt.txt | 1 + snapshots/seattlerb/call_lte.txt | 1 + snapshots/seattlerb/call_not.txt | 1 + snapshots/seattlerb/call_pipe.txt | 1 + snapshots/seattlerb/call_rshift.txt | 1 + snapshots/seattlerb/call_self_brackets.txt | 1 + snapshots/seattlerb/call_spaceship.txt | 1 + .../call_stabby_do_end_with_block.txt | 1 + .../call_stabby_with_braces_block.txt | 1 + snapshots/seattlerb/call_star.txt | 1 + snapshots/seattlerb/call_star2.txt | 1 + snapshots/seattlerb/call_trailing_comma.txt | 1 + snapshots/seattlerb/call_trailing_dots.txt | 3 + snapshots/seattlerb/call_unary_bang.txt | 1 + snapshots/seattlerb/case_in.txt | 1 + snapshots/seattlerb/defn_arg_forward_args.txt | 1 + .../seattlerb/defn_args_forward_args.txt | 1 + snapshots/seattlerb/defn_endless_command.txt | 1 + .../seattlerb/defn_endless_command_rescue.txt | 1 + snapshots/seattlerb/defn_forward_args.txt | 1 + .../defn_forward_args__no_parens.txt | 1 + snapshots/seattlerb/defn_kwarg_env.txt | 1 + snapshots/seattlerb/defn_oneliner.txt | 1 + snapshots/seattlerb/defn_oneliner_noargs.txt | 1 + .../defn_oneliner_noargs_parentheses.txt | 1 + snapshots/seattlerb/defn_oneliner_rescue.txt | 3 + .../defs_as_arg_with_do_block_inside.txt | 3 + snapshots/seattlerb/defs_endless_command.txt | 2 + .../seattlerb/defs_endless_command_rescue.txt | 2 + snapshots/seattlerb/defs_oneliner.txt | 1 + snapshots/seattlerb/defs_oneliner_rescue.txt | 3 + snapshots/seattlerb/difficult0_.txt | 3 + .../seattlerb/difficult1_line_numbers.txt | 18 ++ .../seattlerb/difficult1_line_numbers2.txt | 3 + snapshots/seattlerb/difficult2_.txt | 2 + snapshots/seattlerb/difficult3_.txt | 1 + snapshots/seattlerb/difficult3_2.txt | 1 + snapshots/seattlerb/difficult3_3.txt | 1 + snapshots/seattlerb/difficult3_4.txt | 1 + snapshots/seattlerb/difficult3_5.txt | 2 + snapshots/seattlerb/difficult3__10.txt | 1 + snapshots/seattlerb/difficult3__11.txt | 1 + snapshots/seattlerb/difficult3__12.txt | 1 + snapshots/seattlerb/difficult3__6.txt | 1 + snapshots/seattlerb/difficult3__7.txt | 1 + snapshots/seattlerb/difficult3__8.txt | 1 + snapshots/seattlerb/difficult3__9.txt | 1 + .../seattlerb/difficult4__leading_dots.txt | 2 + snapshots/seattlerb/difficult6_.txt | 1 + snapshots/seattlerb/difficult6__7.txt | 3 + snapshots/seattlerb/difficult6__8.txt | 3 + snapshots/seattlerb/difficult7_.txt | 4 + snapshots/seattlerb/do_bug.txt | 3 + snapshots/seattlerb/dot2_nil__26.txt | 1 + snapshots/seattlerb/dot3_nil__26.txt | 1 + snapshots/seattlerb/dstr_evstr.txt | 1 + snapshots/seattlerb/dstr_evstr_empty_end.txt | 1 + snapshots/seattlerb/dstr_lex_state.txt | 1 + ...gin_why_wont_people_use_their_spacebar.txt | 3 + snapshots/seattlerb/evstr_evstr.txt | 2 + snapshots/seattlerb/evstr_str.txt | 1 + snapshots/seattlerb/expr_not_bang.txt | 3 + snapshots/seattlerb/flip2_env_lvar.txt | 2 + ...squiggly_blank_line_plus_interpolation.txt | 3 + .../heredoc_trailing_slash_continued_call.txt | 1 + snapshots/seattlerb/if_symbol.txt | 1 + snapshots/seattlerb/index_0.txt | 3 + snapshots/seattlerb/index_0_opasgn.txt | 2 + snapshots/seattlerb/iter_args_1.txt | 1 + snapshots/seattlerb/iter_args_10_1.txt | 1 + snapshots/seattlerb/iter_args_10_2.txt | 1 + snapshots/seattlerb/iter_args_11_1.txt | 1 + snapshots/seattlerb/iter_args_11_2.txt | 1 + snapshots/seattlerb/iter_args_2__19.txt | 1 + snapshots/seattlerb/iter_args_3.txt | 1 + snapshots/seattlerb/iter_args_4.txt | 1 + snapshots/seattlerb/iter_args_5.txt | 1 + snapshots/seattlerb/iter_args_6.txt | 1 + snapshots/seattlerb/iter_args_7_1.txt | 1 + snapshots/seattlerb/iter_args_7_2.txt | 1 + snapshots/seattlerb/iter_args_8_1.txt | 1 + snapshots/seattlerb/iter_args_8_2.txt | 1 + snapshots/seattlerb/iter_args_9_1.txt | 1 + snapshots/seattlerb/iter_args_9_2.txt | 1 + snapshots/seattlerb/iter_kwarg.txt | 1 + snapshots/seattlerb/iter_kwarg_kwsplat.txt | 1 + snapshots/seattlerb/label_vs_string.txt | 2 + snapshots/seattlerb/lambda_do_vs_brace.txt | 4 + .../lasgn_call_bracket_rescue_arg.txt | 1 + .../lasgn_call_nobracket_rescue_arg.txt | 1 + snapshots/seattlerb/lasgn_command.txt | 2 + .../seattlerb/lasgn_lasgn_command_call.txt | 1 + snapshots/seattlerb/lasgn_middle_splat.txt | 3 + snapshots/seattlerb/masgn_anon_splat_arg.txt | 1 + snapshots/seattlerb/masgn_arg_colon_arg.txt | 2 + snapshots/seattlerb/masgn_arg_ident.txt | 2 + snapshots/seattlerb/masgn_arg_splat_arg.txt | 1 + snapshots/seattlerb/masgn_colon2.txt | 1 + snapshots/seattlerb/masgn_command_call.txt | 2 + snapshots/seattlerb/masgn_double_paren.txt | 1 + snapshots/seattlerb/masgn_paren.txt | 2 + snapshots/seattlerb/masgn_splat_arg.txt | 1 + snapshots/seattlerb/masgn_splat_arg_arg.txt | 1 + snapshots/seattlerb/masgn_var_star_var.txt | 1 + snapshots/seattlerb/messy_op_asgn_lineno.txt | 3 + .../method_call_assoc_trailing_comma.txt | 2 + .../seattlerb/method_call_trailing_comma.txt | 2 + snapshots/seattlerb/mlhs_back_anonsplat.txt | 1 + snapshots/seattlerb/mlhs_back_splat.txt | 1 + snapshots/seattlerb/mlhs_front_anonsplat.txt | 1 + snapshots/seattlerb/mlhs_front_splat.txt | 1 + snapshots/seattlerb/mlhs_keyword.txt | 2 + snapshots/seattlerb/mlhs_mid_anonsplat.txt | 1 + snapshots/seattlerb/mlhs_mid_splat.txt | 1 + snapshots/seattlerb/mlhs_rescue.txt | 1 + .../seattlerb/multiline_hash_declaration.txt | 3 + snapshots/seattlerb/op_asgn_command_call.txt | 2 + .../op_asgn_dot_ident_command_call.txt | 1 + .../seattlerb/op_asgn_index_command_call.txt | 2 + ..._asgn_primary_colon_const_command_call.txt | 2 + ..._primary_colon_identifier_command_call.txt | 2 + .../op_asgn_val_dot_ident_command_call.txt | 2 + .../seattlerb/parse_if_not_canonical.txt | 3 + .../seattlerb/parse_if_not_noncanonical.txt | 3 + snapshots/seattlerb/parse_line_block.txt | 1 + .../parse_line_block_inline_comment.txt | 3 + ..._block_inline_comment_leading_newlines.txt | 3 + ...se_line_block_inline_multiline_comment.txt | 3 + ...ine_call_ivar_arg_no_parens_line_break.txt | 1 + .../parse_line_call_ivar_line_break_paren.txt | 1 + .../seattlerb/parse_line_call_no_args.txt | 2 + .../seattlerb/parse_line_defn_complex.txt | 1 + snapshots/seattlerb/parse_line_dot2.txt | 3 + snapshots/seattlerb/parse_line_dot2_open.txt | 2 + snapshots/seattlerb/parse_line_dot3.txt | 3 + snapshots/seattlerb/parse_line_dot3_open.txt | 2 + .../parse_line_evstr_after_break.txt | 1 + snapshots/seattlerb/parse_line_heredoc.txt | 2 + .../seattlerb/parse_line_heredoc_evstr.txt | 1 + .../parse_line_heredoc_regexp_chars.txt | 1 + .../parse_line_iter_call_no_parens.txt | 3 + .../seattlerb/parse_line_iter_call_parens.txt | 3 + snapshots/seattlerb/parse_line_op_asgn.txt | 2 + snapshots/seattlerb/parse_line_postexe.txt | 1 + snapshots/seattlerb/parse_line_preexe.txt | 1 + snapshots/seattlerb/parse_line_rescue.txt | 3 + .../parse_line_str_with_newline_escape.txt | 1 + snapshots/seattlerb/parse_line_to_ary.txt | 2 + .../parse_line_trailing_newlines.txt | 2 + .../parse_opt_call_args_assocs_comma.txt | 1 + .../parse_opt_call_args_lit_comma.txt | 1 + snapshots/seattlerb/parse_pattern_044.txt | 1 + .../seattlerb/parse_until_not_canonical.txt | 3 + .../parse_until_not_noncanonical.txt | 3 + .../seattlerb/parse_while_not_canonical.txt | 3 + .../parse_while_not_noncanonical.txt | 3 + snapshots/seattlerb/pipe_semicolon.txt | 2 + snapshots/seattlerb/pipe_space.txt | 2 + snapshots/seattlerb/qsymbols_interp.txt | 1 + .../seattlerb/quoted_symbol_hash_arg.txt | 1 + .../seattlerb/rescue_do_end_ensure_result.txt | 2 + .../seattlerb/rescue_do_end_no_raise.txt | 1 + snapshots/seattlerb/rescue_do_end_raised.txt | 2 + snapshots/seattlerb/rescue_do_end_rescued.txt | 2 + snapshots/seattlerb/rescue_in_block.txt | 2 + snapshots/seattlerb/rescue_parens.txt | 3 + snapshots/seattlerb/return_call_assocs.txt | 5 + snapshots/seattlerb/safe_attrasgn.txt | 2 + .../seattlerb/safe_attrasgn_constant.txt | 2 + snapshots/seattlerb/safe_call.txt | 2 + .../seattlerb/safe_call_after_newline.txt | 2 + snapshots/seattlerb/safe_call_dot_parens.txt | 2 + snapshots/seattlerb/safe_call_newline.txt | 2 + snapshots/seattlerb/safe_call_operator.txt | 2 + snapshots/seattlerb/safe_call_rhs_newline.txt | 2 + snapshots/seattlerb/safe_calls.txt | 3 + snapshots/seattlerb/safe_op_asgn.txt | 2 + snapshots/seattlerb/safe_op_asgn2.txt | 2 + .../slashy_newlines_within_string.txt | 4 + .../seattlerb/stabby_block_iter_call.txt | 3 + ...bby_block_iter_call_no_target_with_arg.txt | 2 + snapshots/seattlerb/str_backslashes.txt | 1 + .../str_double_double_escaped_newline.txt | 2 + .../seattlerb/str_double_escaped_newline.txt | 2 + snapshots/seattlerb/str_double_newline.txt | 2 + snapshots/seattlerb/str_evstr.txt | 1 + snapshots/seattlerb/str_evstr_escape.txt | 1 + snapshots/seattlerb/str_heredoc_interp.txt | 1 + .../seattlerb/str_interp_ternary_or_label.txt | 5 + snapshots/seattlerb/str_pct_Q_nested.txt | 1 + .../str_single_double_escaped_newline.txt | 2 + .../seattlerb/str_single_escaped_newline.txt | 2 + snapshots/seattlerb/str_single_newline.txt | 2 + snapshots/seattlerb/symbol_list.txt | 2 + snapshots/seattlerb/thingy.txt | 4 + snapshots/seattlerb/unary_minus.txt | 2 + snapshots/seattlerb/unary_plus.txt | 2 + snapshots/seattlerb/unary_plus_on_literal.txt | 1 + snapshots/seattlerb/unary_tilde.txt | 2 + snapshots/seattlerb/utf8_bom.txt | 1 + snapshots/seattlerb/when_splat.txt | 2 + snapshots/single_method_call_with_bang.txt | 1 + snapshots/spanning_heredoc.txt | 10 + snapshots/spanning_heredoc_newlines.txt | 6 + .../string_concatination_frozen_false.txt | 1 + .../string_concatination_frozen_true.txt | 1 + snapshots/strings.txt | 6 + snapshots/symbols.txt | 1 + snapshots/ternary_operator.txt | 14 ++ snapshots/unless.txt | 4 + .../unparser/corpus/literal/assignment.txt | 22 +++ snapshots/unparser/corpus/literal/block.txt | 65 +++++++ snapshots/unparser/corpus/literal/case.txt | 28 +++ snapshots/unparser/corpus/literal/class.txt | 5 + snapshots/unparser/corpus/literal/def.txt | 26 +++ snapshots/unparser/corpus/literal/defs.txt | 14 ++ snapshots/unparser/corpus/literal/dstr.txt | 5 + .../unparser/corpus/literal/flipflop.txt | 12 ++ snapshots/unparser/corpus/literal/for.txt | 9 + snapshots/unparser/corpus/literal/hookexe.txt | 3 + snapshots/unparser/corpus/literal/if.txt | 7 + snapshots/unparser/corpus/literal/kwbegin.txt | 16 ++ snapshots/unparser/corpus/literal/lambda.txt | 2 + snapshots/unparser/corpus/literal/literal.txt | 16 ++ snapshots/unparser/corpus/literal/module.txt | 2 + snapshots/unparser/corpus/literal/opasgn.txt | 15 ++ snapshots/unparser/corpus/literal/pattern.txt | 4 + snapshots/unparser/corpus/literal/pragma.txt | 1 + snapshots/unparser/corpus/literal/rescue.txt | 6 + snapshots/unparser/corpus/literal/send.txt | 156 +++++++++++++++ .../unparser/corpus/literal/since/27.txt | 1 + .../unparser/corpus/literal/since/31.txt | 2 + .../unparser/corpus/literal/since/32.txt | 2 + snapshots/unparser/corpus/literal/super.txt | 15 ++ snapshots/unparser/corpus/literal/unary.txt | 24 +++ .../unparser/corpus/literal/variables.txt | 1 + snapshots/unparser/corpus/literal/while.txt | 26 +++ snapshots/unparser/corpus/semantic/and.txt | 16 ++ snapshots/unparser/corpus/semantic/block.txt | 7 + snapshots/unparser/corpus/semantic/def.txt | 4 + .../unparser/corpus/semantic/kwbegin.txt | 10 + .../unparser/corpus/semantic/literal.txt | 3 + snapshots/unparser/corpus/semantic/opasgn.txt | 1 + snapshots/unparser/corpus/semantic/send.txt | 14 ++ snapshots/unparser/corpus/semantic/while.txt | 13 ++ snapshots/until.txt | 6 + snapshots/variables.txt | 4 + snapshots/while.txt | 15 ++ ...iuous_quoted_label_in_ternary_operator.txt | 3 + snapshots/whitequark/and.txt | 4 + snapshots/whitequark/and_asgn.txt | 2 + snapshots/whitequark/and_or_masgn.txt | 4 + snapshots/whitequark/anonymous_blockarg.txt | 1 + snapshots/whitequark/arg_label.txt | 4 + snapshots/whitequark/arg_scope.txt | 1 + snapshots/whitequark/args_args_assocs.txt | 5 + .../whitequark/args_args_assocs_comma.txt | 3 + snapshots/whitequark/args_args_comma.txt | 3 + snapshots/whitequark/args_args_star.txt | 7 + snapshots/whitequark/args_assocs_comma.txt | 2 + snapshots/whitequark/args_block_pass.txt | 2 + snapshots/whitequark/args_cmd.txt | 3 + snapshots/whitequark/args_star.txt | 5 + snapshots/whitequark/array_splat.txt | 3 + snapshots/whitequark/array_symbols_interp.txt | 2 + snapshots/whitequark/array_words_interp.txt | 2 + snapshots/whitequark/asgn_cmd.txt | 2 + snapshots/whitequark/asgn_mrhs.txt | 4 + snapshots/whitequark/bang.txt | 2 + snapshots/whitequark/bang_cmd.txt | 3 + snapshots/whitequark/begin_cmdarg.txt | 2 + .../beginless_erange_after_newline.txt | 1 + .../beginless_irange_after_newline.txt | 1 + .../whitequark/block_arg_combinations.txt | 28 +++ snapshots/whitequark/block_kwarg.txt | 1 + .../whitequark/block_kwarg_combinations.txt | 3 + snapshots/whitequark/blockargs.txt | 35 ++++ snapshots/whitequark/bug_447.txt | 2 + snapshots/whitequark/bug_452.txt | 4 + snapshots/whitequark/bug_466.txt | 3 + snapshots/whitequark/bug_473.txt | 1 + snapshots/whitequark/bug_480.txt | 1 + snapshots/whitequark/bug_481.txt | 2 + .../whitequark/bug_cmd_string_lookahead.txt | 1 + snapshots/whitequark/bug_cmdarg.txt | 5 + .../whitequark/bug_do_block_in_call_args.txt | 2 + .../whitequark/bug_do_block_in_cmdarg.txt | 2 + .../whitequark/bug_do_block_in_hash_brace.txt | 16 ++ snapshots/whitequark/bug_heredoc_do.txt | 1 + snapshots/whitequark/bug_lambda_leakage.txt | 1 + .../whitequark/bug_while_not_parens_do.txt | 1 + snapshots/whitequark/case_cond.txt | 1 + snapshots/whitequark/case_cond_else.txt | 1 + snapshots/whitequark/case_expr.txt | 2 + snapshots/whitequark/case_expr_else.txt | 3 + snapshots/whitequark/class_super_label.txt | 1 + .../comments_before_leading_dot__27.txt | 8 + snapshots/whitequark/cond_begin.txt | 2 + snapshots/whitequark/cond_begin_masgn.txt | 2 + snapshots/whitequark/cond_eflipflop.txt | 5 + .../cond_eflipflop_with_beginless_range.txt | 1 + .../cond_eflipflop_with_endless_range.txt | 1 + snapshots/whitequark/cond_iflipflop.txt | 5 + .../cond_iflipflop_with_beginless_range.txt | 1 + .../cond_iflipflop_with_endless_range.txt | 1 + .../whitequark/cond_match_current_line.txt | 1 + snapshots/whitequark/dedenting_heredoc.txt | 18 ++ snapshots/whitequark/defined.txt | 2 + snapshots/whitequark/defs.txt | 1 + .../emit_arg_inside_procarg0_legacy.txt | 1 + .../whitequark/endless_comparison_method.txt | 6 + snapshots/whitequark/endless_method.txt | 4 + .../endless_method_command_syntax.txt | 11 ++ .../endless_method_forwarded_args_legacy.txt | 1 + snapshots/whitequark/ensure.txt | 2 + snapshots/whitequark/find_pattern.txt | 4 + snapshots/whitequark/for.txt | 4 + snapshots/whitequark/for_mlhs.txt | 2 + snapshots/whitequark/forward_arg.txt | 1 + .../whitequark/forward_arg_with_open_args.txt | 8 + snapshots/whitequark/forward_args_legacy.txt | 1 + .../forwarded_argument_with_kwrestarg.txt | 1 + .../forwarded_argument_with_restarg.txt | 1 + snapshots/whitequark/forwarded_kwrestarg.txt | 1 + ...warded_kwrestarg_with_additional_kwarg.txt | 1 + snapshots/whitequark/forwarded_restarg.txt | 1 + snapshots/whitequark/hash_kwsplat.txt | 1 + snapshots/whitequark/hash_label_end.txt | 2 + .../whitequark/hash_pair_value_omission.txt | 3 + snapshots/whitequark/if.txt | 4 + snapshots/whitequark/if_else.txt | 6 + snapshots/whitequark/if_elsif.txt | 3 + snapshots/whitequark/if_masgn__24.txt | 1 + snapshots/whitequark/if_mod.txt | 2 + snapshots/whitequark/if_nl_then.txt | 2 + .../whitequark/keyword_argument_omission.txt | 3 + snapshots/whitequark/kwbegin_compstmt.txt | 2 + snapshots/whitequark/kwnilarg.txt | 1 + ...targ_with_kwrestarg_and_forwarded_args.txt | 1 + .../lbrace_arg_after_command_args.txt | 2 + .../lparenarg_after_lvar__since_25.txt | 4 + snapshots/whitequark/lvar.txt | 1 + snapshots/whitequark/lvar_injecting_match.txt | 4 + snapshots/whitequark/masgn_cmd.txt | 1 + snapshots/whitequark/masgn_nested.txt | 2 + snapshots/whitequark/masgn_splat.txt | 11 ++ .../method_definition_in_while_cond.txt | 4 + .../multiple_args_with_trailing_comma.txt | 1 + .../whitequark/newline_in_hash_argument.txt | 5 + .../whitequark/non_lvar_injecting_match.txt | 1 + snapshots/whitequark/not.txt | 5 + snapshots/whitequark/not_cmd.txt | 3 + snapshots/whitequark/not_masgn__24.txt | 2 + .../whitequark/numbered_args_after_27.txt | 6 + .../whitequark/numparam_outside_block.txt | 6 + .../whitequark/numparam_ruby_bug_19025.txt | 2 + snapshots/whitequark/op_asgn.txt | 3 + snapshots/whitequark/op_asgn_cmd.txt | 12 ++ snapshots/whitequark/op_asgn_index.txt | 1 + snapshots/whitequark/op_asgn_index_cmd.txt | 3 + snapshots/whitequark/or.txt | 4 + snapshots/whitequark/or_asgn.txt | 2 + snapshots/whitequark/parser_bug_272.txt | 1 + snapshots/whitequark/parser_bug_525.txt | 3 + snapshots/whitequark/parser_bug_604.txt | 4 + .../pattern_matching__FILE__LINE_literals.txt | 1 + .../pattern_matching_const_pattern.txt | 6 + .../whitequark/pattern_matching_constants.txt | 3 + .../pattern_matching_explicit_array_match.txt | 10 + .../pattern_matching_expr_in_paren.txt | 1 + .../whitequark/pattern_matching_hash.txt | 16 ++ .../pattern_matching_if_unless_modifiers.txt | 2 + .../pattern_matching_implicit_array_match.txt | 8 + .../pattern_matching_keyword_variable.txt | 1 + .../whitequark/pattern_matching_lambda.txt | 1 + .../whitequark/pattern_matching_match_alt.txt | 1 + .../whitequark/pattern_matching_match_as.txt | 1 + .../pattern_matching_nil_pattern.txt | 1 + .../whitequark/pattern_matching_no_body.txt | 1 + .../whitequark/pattern_matching_ranges.txt | 6 + .../pattern_matching_single_match.txt | 1 + snapshots/whitequark/pin_expr.txt | 8 + snapshots/whitequark/procarg0.txt | 2 + snapshots/whitequark/procarg0_legacy.txt | 1 + snapshots/whitequark/regex_interp.txt | 1 + snapshots/whitequark/resbody_list.txt | 2 + snapshots/whitequark/resbody_list_mrhs.txt | 3 + snapshots/whitequark/resbody_list_var.txt | 3 + snapshots/whitequark/resbody_var.txt | 4 + snapshots/whitequark/rescue.txt | 2 + snapshots/whitequark/rescue_else.txt | 3 + snapshots/whitequark/rescue_else_ensure.txt | 4 + snapshots/whitequark/rescue_ensure.txt | 3 + snapshots/whitequark/rescue_mod.txt | 2 + snapshots/whitequark/rescue_mod_asgn.txt | 2 + snapshots/whitequark/rescue_mod_masgn.txt | 1 + snapshots/whitequark/rescue_mod_op_assign.txt | 2 + .../whitequark/rescue_without_begin_end.txt | 3 + snapshots/whitequark/return.txt | 2 + snapshots/whitequark/return_block.txt | 2 + snapshots/whitequark/ruby_bug_10653.txt | 6 + snapshots/whitequark/ruby_bug_11107.txt | 2 + snapshots/whitequark/ruby_bug_11380.txt | 1 + snapshots/whitequark/ruby_bug_11873.txt | 48 +++++ snapshots/whitequark/ruby_bug_11873_a.txt | 80 ++++++++ snapshots/whitequark/ruby_bug_11873_b.txt | 7 + snapshots/whitequark/ruby_bug_11989.txt | 1 + snapshots/whitequark/ruby_bug_11990.txt | 1 + snapshots/whitequark/ruby_bug_12073.txt | 2 + snapshots/whitequark/ruby_bug_12402.txt | 28 +++ snapshots/whitequark/ruby_bug_12669.txt | 4 + snapshots/whitequark/ruby_bug_12686.txt | 2 + snapshots/whitequark/ruby_bug_13547.txt | 2 + snapshots/whitequark/ruby_bug_14690.txt | 3 + snapshots/whitequark/ruby_bug_15789.txt | 2 + snapshots/whitequark/ruby_bug_18878.txt | 1 + snapshots/whitequark/ruby_bug_19281.txt | 6 + snapshots/whitequark/sclass.txt | 1 + snapshots/whitequark/send_attr_asgn.txt | 7 + .../whitequark/send_attr_asgn_conditional.txt | 2 + snapshots/whitequark/send_binary_op.txt | 42 ++++ snapshots/whitequark/send_block_chain_cmd.txt | 20 ++ .../whitequark/send_block_conditional.txt | 2 + snapshots/whitequark/send_call.txt | 4 + snapshots/whitequark/send_conditional.txt | 2 + snapshots/whitequark/send_index.txt | 2 + snapshots/whitequark/send_index_asgn.txt | 2 + .../whitequark/send_index_asgn_legacy.txt | 2 + snapshots/whitequark/send_index_cmd.txt | 4 + snapshots/whitequark/send_index_legacy.txt | 2 + .../whitequark/send_op_asgn_conditional.txt | 1 + snapshots/whitequark/send_plain.txt | 6 + snapshots/whitequark/send_plain_cmd.txt | 9 + snapshots/whitequark/send_self.txt | 3 + snapshots/whitequark/send_self_block.txt | 4 + snapshots/whitequark/send_unary_op.txt | 6 + snapshots/whitequark/space_args_arg.txt | 1 + snapshots/whitequark/space_args_arg_block.txt | 5 + snapshots/whitequark/space_args_arg_call.txt | 2 + .../whitequark/space_args_arg_newline.txt | 1 + snapshots/whitequark/space_args_block.txt | 1 + snapshots/whitequark/space_args_cmd.txt | 3 + snapshots/whitequark/string_interp.txt | 1 + snapshots/whitequark/super.txt | 2 + snapshots/whitequark/super_block.txt | 2 + snapshots/whitequark/symbol_interp.txt | 1 + snapshots/whitequark/ternary.txt | 1 + .../whitequark/ternary_ambiguous_symbol.txt | 1 + snapshots/whitequark/trailing_forward_arg.txt | 1 + .../whitequark/unary_num_pow_precedence.txt | 5 + snapshots/whitequark/unless.txt | 4 + snapshots/whitequark/unless_else.txt | 6 + snapshots/whitequark/unless_mod.txt | 2 + snapshots/whitequark/until.txt | 4 + snapshots/whitequark/until_mod.txt | 2 + snapshots/whitequark/until_post.txt | 2 + snapshots/whitequark/var_op_asgn_cmd.txt | 1 + snapshots/whitequark/when_multi.txt | 2 + snapshots/whitequark/when_splat.txt | 4 + snapshots/whitequark/when_then.txt | 2 + snapshots/whitequark/while.txt | 4 + snapshots/whitequark/while_mod.txt | 2 + snapshots/whitequark/while_post.txt | 2 + snapshots/whitequark/xstring_interp.txt | 1 + snapshots/xstring.txt | 1 + src/prism.c | 3 + 626 files changed, 3114 insertions(+), 16 deletions(-) diff --git a/config.yml b/config.yml index ed5c9d8b9c..7d71d52de4 100644 --- a/config.yml +++ b/config.yml @@ -1515,6 +1515,16 @@ nodes: foo(bar) ^ + - name: equal_loc + type: location? + comment: | + Represents the location of the equal sign, in the case that this is an attribute write. + + foo.bar = value + ^ + + foo[bar] = value + ^ - name: block type: node? kind: diff --git a/lib/prism/translation/parser/compiler.rb b/lib/prism/translation/parser/compiler.rb index 6e0618890d..8805614603 100644 --- a/lib/prism/translation/parser/compiler.rb +++ b/lib/prism/translation/parser/compiler.rb @@ -217,7 +217,7 @@ def visit_begin_node(node) rescue_clause.exceptions.any? ? builder.array(nil, visit_all(rescue_clause.exceptions), nil) : nil, token(rescue_clause.operator_loc), visit(rescue_clause.reference), - srange_find(find_start_offset, find_end_offset, ";"), + srange_semicolon(find_start_offset, find_end_offset), visit(rescue_clause.statements) ) end until (rescue_clause = rescue_clause.subsequent).nil? @@ -323,7 +323,7 @@ def visit_call_node(node) visit_all(arguments), token(node.closing_loc), ), - srange_find(node.message_loc.end_offset, node.arguments.arguments.last.location.start_offset, "="), + token(node.equal_loc), visit(node.arguments.arguments.last) ), block @@ -340,7 +340,7 @@ def visit_call_node(node) if name.end_with?("=") && !message_loc.slice.end_with?("=") && node.arguments && block.nil? builder.assign( builder.attr_asgn(visit(node.receiver), call_operator, token(message_loc)), - srange_find(message_loc.end_offset, node.arguments.location.start_offset, "="), + token(node.equal_loc), visit(node.arguments.arguments.last) ) else @@ -789,7 +789,7 @@ def visit_for_node(node) if (do_keyword_loc = node.do_keyword_loc) token(do_keyword_loc) else - srange_find(node.collection.location.end_offset, (node.statements&.location || node.end_keyword_loc).start_offset, ";") + srange_semicolon(node.collection.location.end_offset, (node.statements&.location || node.end_keyword_loc).start_offset) end, visit(node.statements), token(node.end_keyword_loc) @@ -921,7 +921,7 @@ def visit_if_node(node) if (then_keyword_loc = node.then_keyword_loc) token(then_keyword_loc) else - srange_find(node.predicate.location.end_offset, (node.statements&.location || node.subsequent&.location || node.end_keyword_loc).start_offset, ";") + srange_semicolon(node.predicate.location.end_offset, (node.statements&.location || node.subsequent&.location || node.end_keyword_loc).start_offset) end, visit(node.statements), case node.subsequent @@ -987,7 +987,7 @@ def visit_in_node(node) if (then_loc = node.then_loc) token(then_loc) else - srange_find(node.pattern.location.end_offset, node.statements&.location&.start_offset, ";") + srange_semicolon(node.pattern.location.end_offset, node.statements&.location&.start_offset) end, visit(node.statements) ) @@ -1808,7 +1808,7 @@ def visit_unless_node(node) if (then_keyword_loc = node.then_keyword_loc) token(then_keyword_loc) else - srange_find(node.predicate.location.end_offset, (node.statements&.location || node.else_clause&.location || node.end_keyword_loc).start_offset, ";") + srange_semicolon(node.predicate.location.end_offset, (node.statements&.location || node.else_clause&.location || node.end_keyword_loc).start_offset) end, visit(node.else_clause), token(node.else_clause&.else_keyword_loc), @@ -1839,7 +1839,7 @@ def visit_until_node(node) if (do_keyword_loc = node.do_keyword_loc) token(do_keyword_loc) else - srange_find(node.predicate.location.end_offset, (node.statements&.location || node.closing_loc).start_offset, ";") + srange_semicolon(node.predicate.location.end_offset, (node.statements&.location || node.closing_loc).start_offset) end, visit(node.statements), token(node.closing_loc) @@ -1863,7 +1863,7 @@ def visit_when_node(node) if (then_keyword_loc = node.then_keyword_loc) token(then_keyword_loc) else - srange_find(node.conditions.last.location.end_offset, node.statements&.location&.start_offset, ";") + srange_semicolon(node.conditions.last.location.end_offset, node.statements&.location&.start_offset) end, visit(node.statements) ) @@ -1883,7 +1883,7 @@ def visit_while_node(node) if (do_keyword_loc = node.do_keyword_loc) token(do_keyword_loc) else - srange_find(node.predicate.location.end_offset, (node.statements&.location || node.closing_loc).start_offset, ";") + srange_semicolon(node.predicate.location.end_offset, (node.statements&.location || node.closing_loc).start_offset) end, visit(node.statements), token(node.closing_loc) @@ -2012,16 +2012,16 @@ def srange_offsets(start_offset, end_offset) Range.new(source_buffer, offset_cache[start_offset], offset_cache[end_offset]) end - # Constructs a new source range by finding the given character between - # the given start offset and end offset. If the needle is not found, it - # returns nil. Importantly it does not search past newlines or comments. + # Constructs a new source range by finding a semicolon between the given + # start offset and end offset. If the semicolon is not found, it returns + # nil. Importantly it does not search past newlines or comments. # # Note that end_offset is allowed to be nil, in which case this will # search until the end of the string. - def srange_find(start_offset, end_offset, character) - if (match = source_buffer.source.byteslice(start_offset...end_offset)[/\A\s*#{character}/]) + def srange_semicolon(start_offset, end_offset) + if (match = source_buffer.source.byteslice(start_offset...end_offset)[/\A\s*;/]) final_offset = start_offset + match.bytesize - [character, Range.new(source_buffer, offset_cache[final_offset - character.bytesize], offset_cache[final_offset])] + [";", Range.new(source_buffer, offset_cache[final_offset - 1], offset_cache[final_offset])] end end diff --git a/snapshots/3.3-3.3/block_args_in_array_assignment.txt b/snapshots/3.3-3.3/block_args_in_array_assignment.txt index 03327a51f6..aebf7deb8e 100644 --- a/snapshots/3.3-3.3/block_args_in_array_assignment.txt +++ b/snapshots/3.3-3.3/block_args_in_array_assignment.txt @@ -17,6 +17,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── call_operator_loc: ∅ ├── name: :[]= @@ -33,6 +34,7 @@ │ ├── flags: static_literal, decimal │ └── value: 8 ├── closing_loc: (1,16)-(1,17) = "]" + ├── equal_loc: (1,18)-(1,19) = "=" └── block: @ BlockArgumentNode (location: (1,10)-(1,16)) ├── flags: ∅ @@ -46,5 +48,6 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ └── operator_loc: (1,10)-(1,11) = "&" diff --git a/snapshots/3.3-3.3/it.txt b/snapshots/3.3-3.3/it.txt index a8a8d521c0..b2559ebe85 100644 --- a/snapshots/3.3-3.3/it.txt +++ b/snapshots/3.3-3.3/it.txt @@ -14,6 +14,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (1,2)-(3,3)) │ ├── flags: ∅ @@ -32,6 +33,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── opening_loc: (1,2)-(1,4) = "do" │ └── closing_loc: (3,0)-(3,3) = "end" @@ -55,4 +57,5 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/3.3-3.3/it_indirect_writes.txt b/snapshots/3.3-3.3/it_indirect_writes.txt index 918eca9a37..5b0e2e9d42 100644 --- a/snapshots/3.3-3.3/it_indirect_writes.txt +++ b/snapshots/3.3-3.3/it_indirect_writes.txt @@ -14,6 +14,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (1,4)-(1,15)) │ ├── flags: ∅ @@ -45,6 +46,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (3,4)-(3,16)) │ ├── flags: ∅ @@ -75,6 +77,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (5,4)-(5,16)) │ ├── flags: ∅ @@ -105,6 +108,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (7,4)-(7,19)) │ ├── flags: ∅ @@ -123,6 +127,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── @ LocalVariableOperatorWriteNode (location: (7,10)-(7,17)) │ │ ├── flags: newline @@ -146,6 +151,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (9,4)-(9,20)) │ ├── flags: ∅ @@ -164,6 +170,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── @ LocalVariableOrWriteNode (location: (9,10)-(9,18)) │ │ ├── flags: newline @@ -186,6 +193,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (11,4)-(11,20)) │ ├── flags: ∅ @@ -204,6 +212,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── @ LocalVariableAndWriteNode (location: (11,10)-(11,18)) │ │ ├── flags: newline @@ -226,6 +235,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (13,4)-(13,19)) │ ├── flags: ∅ @@ -261,6 +271,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (15,4)-(15,20)) │ ├── flags: ∅ @@ -295,6 +306,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (17,4)-(17,20)) │ ├── flags: ∅ @@ -329,6 +341,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (19,4)-(19,23)) │ ├── flags: ∅ @@ -347,6 +360,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── @ LocalVariableOperatorWriteNode (location: (19,10)-(19,17)) │ │ │ ├── flags: newline @@ -374,6 +388,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (21,4)-(21,24)) │ ├── flags: ∅ @@ -392,6 +407,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── @ LocalVariableOrWriteNode (location: (21,10)-(21,18)) │ │ │ ├── flags: newline @@ -418,6 +434,7 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: @ BlockNode (location: (23,4)-(23,24)) ├── flags: ∅ @@ -436,6 +453,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── @ LocalVariableAndWriteNode (location: (23,10)-(23,18)) │ │ ├── flags: newline diff --git a/snapshots/3.3-3.3/it_read_and_assignment.txt b/snapshots/3.3-3.3/it_read_and_assignment.txt index d30b9c2902..1914c1208c 100644 --- a/snapshots/3.3-3.3/it_read_and_assignment.txt +++ b/snapshots/3.3-3.3/it_read_and_assignment.txt @@ -17,6 +17,7 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: @ BlockNode (location: (1,7)-(1,30)) ├── flags: ∅ @@ -46,8 +47,10 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── @ LocalVariableWriteNode (location: (1,15)-(1,22)) │ │ ├── flags: newline @@ -76,6 +79,7 @@ │ │ ├── name: :it │ │ └── depth: 0 │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── opening_loc: (1,7)-(1,8) = "{" └── closing_loc: (1,29)-(1,30) = "}" diff --git a/snapshots/3.3-3.3/it_with_ordinary_parameter.txt b/snapshots/3.3-3.3/it_with_ordinary_parameter.txt index ab3178de33..cdd8ef59af 100644 --- a/snapshots/3.3-3.3/it_with_ordinary_parameter.txt +++ b/snapshots/3.3-3.3/it_with_ordinary_parameter.txt @@ -14,6 +14,7 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: @ BlockNode (location: (1,5)-(1,14)) ├── flags: ∅ @@ -38,6 +39,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── opening_loc: (1,5)-(1,6) = "{" └── closing_loc: (1,13)-(1,14) = "}" diff --git a/snapshots/3.3-3.3/keyword_args_in_array_assignment.txt b/snapshots/3.3-3.3/keyword_args_in_array_assignment.txt index 785542a3e5..8d8ee48547 100644 --- a/snapshots/3.3-3.3/keyword_args_in_array_assignment.txt +++ b/snapshots/3.3-3.3/keyword_args_in_array_assignment.txt @@ -17,6 +17,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── call_operator_loc: ∅ ├── name: :[]= @@ -53,4 +54,5 @@ │ ├── flags: static_literal, decimal │ └── value: 8 ├── closing_loc: (1,18)-(1,19) = "]" + ├── equal_loc: (1,20)-(1,21) = "=" └── block: ∅ diff --git a/snapshots/3.4/circular_parameters.txt b/snapshots/3.4/circular_parameters.txt index 3e74882f6c..967f1cb83c 100644 --- a/snapshots/3.4/circular_parameters.txt +++ b/snapshots/3.4/circular_parameters.txt @@ -91,6 +91,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (3,5)-(3,20)) │ ├── flags: ∅ @@ -133,6 +134,7 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: @ BlockNode (location: (4,5)-(4,19)) ├── flags: ∅ diff --git a/snapshots/3.4/it.txt b/snapshots/3.4/it.txt index 70a2916eb2..6567f94a32 100644 --- a/snapshots/3.4/it.txt +++ b/snapshots/3.4/it.txt @@ -14,6 +14,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (1,2)-(3,3)) │ ├── flags: ∅ diff --git a/snapshots/3.4/it_indirect_writes.txt b/snapshots/3.4/it_indirect_writes.txt index 165aececc6..f62753346f 100644 --- a/snapshots/3.4/it_indirect_writes.txt +++ b/snapshots/3.4/it_indirect_writes.txt @@ -14,6 +14,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (1,4)-(1,15)) │ ├── flags: ∅ @@ -45,6 +46,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (3,4)-(3,16)) │ ├── flags: ∅ @@ -75,6 +77,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (5,4)-(5,16)) │ ├── flags: ∅ @@ -105,6 +108,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (7,4)-(7,19)) │ ├── flags: ∅ @@ -140,6 +144,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (9,4)-(9,20)) │ ├── flags: ∅ @@ -174,6 +179,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (11,4)-(11,20)) │ ├── flags: ∅ @@ -208,6 +214,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (13,4)-(13,19)) │ ├── flags: ∅ @@ -243,6 +250,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (15,4)-(15,20)) │ ├── flags: ∅ @@ -277,6 +285,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (17,4)-(17,20)) │ ├── flags: ∅ @@ -311,6 +320,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (19,4)-(19,23)) │ ├── flags: ∅ @@ -350,6 +360,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (21,4)-(21,24)) │ ├── flags: ∅ @@ -388,6 +399,7 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: @ BlockNode (location: (23,4)-(23,24)) ├── flags: ∅ diff --git a/snapshots/3.4/it_read_and_assignment.txt b/snapshots/3.4/it_read_and_assignment.txt index 73aa2b5909..6801732cf2 100644 --- a/snapshots/3.4/it_read_and_assignment.txt +++ b/snapshots/3.4/it_read_and_assignment.txt @@ -17,6 +17,7 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: @ BlockNode (location: (1,7)-(1,30)) ├── flags: ∅ @@ -42,6 +43,7 @@ │ │ │ └── @ ItLocalVariableReadNode (location: (1,11)-(1,13)) │ │ │ └── flags: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── @ LocalVariableWriteNode (location: (1,15)-(1,22)) │ │ ├── flags: newline @@ -70,6 +72,7 @@ │ │ ├── name: :it │ │ └── depth: 0 │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── opening_loc: (1,7)-(1,8) = "{" └── closing_loc: (1,29)-(1,30) = "}" diff --git a/snapshots/3.5/endless_methods_command_call.txt b/snapshots/3.5/endless_methods_command_call.txt index c6b34c2d5f..d2c58ec8b0 100644 --- a/snapshots/3.5/endless_methods_command_call.txt +++ b/snapshots/3.5/endless_methods_command_call.txt @@ -44,6 +44,7 @@ │ │ │ │ ├── closing_loc: (1,29)-(1,30) = "\"" │ │ │ │ └── unescaped: "Hello" │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── locals: [] │ │ ├── def_keyword_loc: (1,8)-(1,11) = "def" @@ -53,6 +54,7 @@ │ │ ├── equal_loc: (1,16)-(1,17) = "=" │ │ └── end_keyword_loc: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (2,0)-(2,39)) │ ├── flags: newline, ignore_visibility @@ -99,6 +101,7 @@ │ │ │ │ ├── closing_loc: (2,38)-(2,39) = "\"" │ │ │ │ └── unescaped: "World" │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── locals: [] │ │ ├── def_keyword_loc: (2,8)-(2,11) = "def" @@ -108,6 +111,7 @@ │ │ ├── equal_loc: (2,16)-(2,17) = "=" │ │ └── end_keyword_loc: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (3,0)-(3,42)) │ ├── flags: newline, ignore_visibility @@ -148,6 +152,7 @@ │ │ │ │ ├── closing_loc: (3,29)-(3,30) = "\"" │ │ │ │ └── unescaped: "Hello" │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── locals: [] │ │ ├── def_keyword_loc: (3,8)-(3,11) = "def" @@ -157,6 +162,7 @@ │ │ ├── equal_loc: (3,16)-(3,17) = "=" │ │ └── end_keyword_loc: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (3,31)-(3,42)) │ ├── flags: ∅ @@ -175,6 +181,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── opening_loc: (3,31)-(3,33) = "do" │ └── closing_loc: (3,39)-(3,42) = "end" @@ -217,6 +224,7 @@ │ │ │ │ ├── closing_loc: (4,31)-(4,32) = "\"" │ │ │ │ └── unescaped: "Hello" │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── locals: [] │ │ ├── def_keyword_loc: (4,8)-(4,11) = "def" @@ -226,6 +234,7 @@ │ │ ├── equal_loc: (4,18)-(4,19) = "=" │ │ └── end_keyword_loc: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (5,0)-(5,27)) │ ├── flags: newline, ignore_visibility @@ -276,6 +285,7 @@ │ │ │ │ ├── name: :x │ │ │ │ └── depth: 0 │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── locals: [:x] │ │ ├── def_keyword_loc: (5,8)-(5,11) = "def" @@ -285,6 +295,7 @@ │ │ ├── equal_loc: (5,19)-(5,20) = "=" │ │ └── end_keyword_loc: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (6,0)-(6,34)) │ ├── flags: newline, ignore_visibility @@ -311,6 +322,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── parameters: ∅ │ │ ├── body: @@ -335,6 +347,7 @@ │ │ │ │ ├── closing_loc: (6,33)-(6,34) = "\"" │ │ │ │ └── unescaped: "Hello" │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── locals: [] │ │ ├── def_keyword_loc: (6,8)-(6,11) = "def" @@ -344,6 +357,7 @@ │ │ ├── equal_loc: (6,20)-(6,21) = "=" │ │ └── end_keyword_loc: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (7,0)-(7,36)) │ ├── flags: newline, ignore_visibility @@ -370,6 +384,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── parameters: ∅ │ │ ├── body: @@ -394,6 +409,7 @@ │ │ │ │ ├── closing_loc: (7,35)-(7,36) = "\"" │ │ │ │ └── unescaped: "Hello" │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── locals: [] │ │ ├── def_keyword_loc: (7,8)-(7,11) = "def" @@ -403,6 +419,7 @@ │ │ ├── equal_loc: (7,22)-(7,23) = "=" │ │ └── end_keyword_loc: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ └── @ CallNode (location: (8,0)-(8,31)) ├── flags: newline, ignore_visibility @@ -429,6 +446,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── parameters: │ │ @ ParametersNode (location: (8,20)-(8,21)) @@ -463,6 +481,7 @@ │ │ │ ├── name: :x │ │ │ └── depth: 0 │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── locals: [:x] │ ├── def_keyword_loc: (8,8)-(8,11) = "def" @@ -472,4 +491,5 @@ │ ├── equal_loc: (8,23)-(8,24) = "=" │ └── end_keyword_loc: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/3.5/leading_logical.txt b/snapshots/3.5/leading_logical.txt index 98b0042491..9e043a88ce 100644 --- a/snapshots/3.5/leading_logical.txt +++ b/snapshots/3.5/leading_logical.txt @@ -93,6 +93,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ IntegerNode (location: (20,0)-(20,1)) │ ├── flags: newline, static_literal, decimal @@ -106,4 +107,5 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/arithmetic.txt b/snapshots/arithmetic.txt index 963080e0d9..c7a82a234c 100644 --- a/snapshots/arithmetic.txt +++ b/snapshots/arithmetic.txt @@ -28,6 +28,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── call_operator_loc: ∅ │ │ ├── name: :! @@ -35,8 +36,10 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (3,0)-(3,8)) │ ├── flags: newline @@ -53,6 +56,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── call_operator_loc: ∅ │ │ ├── name: :-@ @@ -60,6 +64,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: ∅ │ ├── name: :* @@ -78,8 +83,10 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (5,0)-(5,9)) │ ├── flags: newline @@ -96,6 +103,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── call_operator_loc: ∅ │ │ ├── name: :+@ @@ -103,6 +111,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: ∅ │ ├── name: :** @@ -121,8 +130,10 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (7,0)-(7,8)) │ ├── flags: newline, ignore_visibility @@ -147,6 +158,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── call_operator_loc: ∅ │ │ ├── name: :~ @@ -154,8 +166,10 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (9,0)-(9,17)) │ ├── flags: newline @@ -172,6 +186,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── call_operator_loc: ∅ │ │ ├── name: :<< @@ -190,8 +205,10 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: ∅ │ ├── name: :<< @@ -210,8 +227,10 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (11,0)-(11,5)) │ ├── flags: newline @@ -234,6 +253,7 @@ │ │ │ ├── flags: static_literal, decimal │ │ │ └── value: 2 │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: ∅ │ ├── name: :-@ @@ -241,6 +261,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ └── @ CallNode (location: (13,0)-(13,8)) ├── flags: newline @@ -254,4 +275,5 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/arrays.txt b/snapshots/arrays.txt index a8a334cd19..62944b80b8 100644 --- a/snapshots/arrays.txt +++ b/snapshots/arrays.txt @@ -21,6 +21,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── opening_loc: (1,0)-(1,1) = "[" │ └── closing_loc: (1,3)-(1,4) = "]" @@ -36,6 +37,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: ∅ │ ├── name: :[]= @@ -54,6 +56,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── @ CallNode (location: (3,9)-(3,12)) │ │ │ ├── flags: variable_call, ignore_visibility @@ -64,6 +67,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── @ ArrayNode (location: (3,16)-(3,23)) │ │ ├── flags: static_literal @@ -80,6 +84,7 @@ │ │ ├── opening_loc: ∅ │ │ └── closing_loc: ∅ │ ├── closing_loc: (3,12)-(3,13) = "]" + │ ├── equal_loc: (3,14)-(3,15) = "=" │ └── block: ∅ ├── @ ArrayNode (location: (5,0)-(5,13)) │ ├── flags: newline @@ -199,6 +204,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── value: │ │ │ @ CallNode (location: (28,8)-(28,11)) @@ -210,6 +216,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── operator_loc: (28,5)-(28,7) = "=>" │ ├── opening_loc: (28,0)-(28,1) = "[" @@ -229,6 +236,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── call_operator_loc: ∅ │ │ ├── name: :[] @@ -247,8 +255,10 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── closing_loc: (30,7)-(30,8) = "]" + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: ∅ │ ├── name: :[]= @@ -267,6 +277,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── @ CallNode (location: (30,16)-(30,19)) │ │ ├── flags: variable_call, ignore_visibility @@ -277,8 +288,10 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── closing_loc: (30,12)-(30,13) = "]" + │ ├── equal_loc: (30,14)-(30,15) = "=" │ └── block: ∅ ├── @ CallNode (location: (32,0)-(32,13)) │ ├── flags: newline @@ -295,6 +308,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── call_operator_loc: ∅ │ │ ├── name: :[] @@ -313,8 +327,10 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── closing_loc: (32,7)-(32,8) = "]" + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: ∅ │ ├── name: :[] @@ -333,8 +349,10 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── closing_loc: (32,12)-(32,13) = "]" + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ ArrayNode (location: (34,0)-(35,1)) │ ├── flags: newline, static_literal @@ -353,6 +371,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: ∅ │ ├── name: :[] @@ -371,6 +390,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── @ CallNode (location: (37,9)-(37,12)) │ │ ├── flags: variable_call, ignore_visibility @@ -381,8 +401,10 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── closing_loc: (37,12)-(37,13) = "]" + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (39,0)-(39,19)) │ ├── flags: newline, attribute_write @@ -396,6 +418,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: ∅ │ ├── name: :[]= @@ -414,6 +437,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── @ CallNode (location: (39,9)-(39,12)) │ │ │ ├── flags: variable_call, ignore_visibility @@ -424,6 +448,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── @ CallNode (location: (39,16)-(39,19)) │ │ ├── flags: variable_call, ignore_visibility @@ -434,8 +459,10 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── closing_loc: (39,12)-(39,13) = "]" + │ ├── equal_loc: (39,14)-(39,15) = "=" │ └── block: ∅ ├── @ MultiWriteNode (location: (41,0)-(41,21)) │ ├── flags: newline @@ -452,6 +479,7 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ ├── opening_loc: (41,3)-(41,4) = "[" │ │ │ ├── arguments: @@ -475,6 +503,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── opening_loc: (41,11)-(41,12) = "[" │ │ ├── arguments: @@ -515,6 +544,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: ∅ │ ├── name: :[] @@ -536,6 +566,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── call_operator_loc: ∅ │ │ ├── name: :[]= @@ -554,6 +585,7 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ └── @ CallNode (location: (43,15)-(43,18)) │ │ │ ├── flags: variable_call, ignore_visibility @@ -564,10 +596,13 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── closing_loc: (43,11)-(43,12) = "]" + │ │ ├── equal_loc: (43,13)-(43,14) = "=" │ │ └── block: ∅ │ ├── closing_loc: (43,18)-(43,19) = "]" + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (45,0)-(45,8)) │ ├── flags: newline @@ -581,6 +616,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: ∅ │ ├── name: :[] @@ -599,8 +635,10 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── closing_loc: (45,7)-(45,8) = "]" + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (47,0)-(47,14)) │ ├── flags: newline, attribute_write @@ -614,6 +652,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: ∅ │ ├── name: :[]= @@ -632,6 +671,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── @ CallNode (location: (47,11)-(47,14)) │ │ ├── flags: variable_call, ignore_visibility @@ -642,8 +682,10 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── closing_loc: (47,7)-(47,8) = "]" + │ ├── equal_loc: (47,9)-(47,10) = "=" │ └── block: ∅ ├── @ ArrayNode (location: (49,0)-(49,6)) │ ├── flags: newline @@ -680,6 +722,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── operator_loc: (51,1)-(51,3) = "**" │ ├── opening_loc: (51,0)-(51,1) = "[" @@ -705,6 +748,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── operator_loc: (53,4)-(53,6) = "**" │ ├── opening_loc: (53,0)-(53,1) = "[" @@ -730,6 +774,7 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ └── operator_loc: (55,4)-(55,6) = "**" │ │ ├── @ AssocSplatNode (location: (55,10)-(55,14)) @@ -753,6 +798,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── operator_loc: (55,16)-(55,18) = "**" │ ├── opening_loc: (55,0)-(55,1) = "[" @@ -775,6 +821,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── value: │ │ │ @ CallNode (location: (58,9)-(58,12)) @@ -786,6 +833,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── operator_loc: (58,6)-(58,8) = "=>" │ ├── opening_loc: (57,0)-(57,1) = "[" @@ -969,6 +1017,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: ∅ │ ├── opening_loc: (84,3)-(84,4) = "[" @@ -993,6 +1042,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: ∅ │ ├── opening_loc: (86,3)-(86,4) = "[" @@ -1016,6 +1066,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: ∅ │ ├── opening_loc: (88,3)-(88,4) = "[" @@ -1042,6 +1093,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── call_operator_loc: (90,3)-(90,4) = "." │ │ ├── name: :foo @@ -1049,6 +1101,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: ∅ │ ├── opening_loc: (90,7)-(90,8) = "[" @@ -1076,6 +1129,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── call_operator_loc: (92,3)-(92,4) = "." │ │ ├── name: :foo @@ -1083,6 +1137,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: ∅ │ ├── opening_loc: (92,7)-(92,8) = "[" @@ -1109,6 +1164,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── call_operator_loc: (94,3)-(94,4) = "." │ │ ├── name: :foo @@ -1116,6 +1172,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: ∅ │ ├── opening_loc: (94,7)-(94,8) = "[" @@ -1139,6 +1196,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: ∅ │ ├── opening_loc: (96,3)-(96,4) = "[" @@ -1155,6 +1213,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── closing_loc: (96,7)-(96,8) = "]" │ ├── block: ∅ @@ -1176,6 +1235,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: ∅ │ ├── opening_loc: (98,3)-(98,4) = "[" @@ -1192,6 +1252,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── closing_loc: (98,7)-(98,8) = "]" │ ├── block: ∅ @@ -1212,6 +1273,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: ∅ │ ├── opening_loc: (100,3)-(100,4) = "[" @@ -1228,6 +1290,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── closing_loc: (100,7)-(100,8) = "]" │ ├── block: ∅ @@ -1251,6 +1314,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── call_operator_loc: (102,3)-(102,4) = "." │ │ ├── name: :foo @@ -1258,6 +1322,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: ∅ │ ├── opening_loc: (102,7)-(102,8) = "[" @@ -1274,6 +1339,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── closing_loc: (102,11)-(102,12) = "]" │ ├── block: ∅ @@ -1298,6 +1364,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── call_operator_loc: (104,3)-(104,4) = "." │ │ ├── name: :foo @@ -1305,6 +1372,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: ∅ │ ├── opening_loc: (104,7)-(104,8) = "[" @@ -1321,6 +1389,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── closing_loc: (104,11)-(104,12) = "]" │ ├── block: ∅ @@ -1344,6 +1413,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── call_operator_loc: (106,3)-(106,4) = "." │ │ ├── name: :foo @@ -1351,6 +1421,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: ∅ │ ├── opening_loc: (106,7)-(106,8) = "[" @@ -1367,6 +1438,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── closing_loc: (106,11)-(106,12) = "]" │ ├── block: ∅ @@ -1411,6 +1483,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── call_operator_loc: ∅ │ │ ├── name: :[] @@ -1425,6 +1498,7 @@ │ │ │ ├── operator_loc: (108,12)-(108,13) = "*" │ │ │ └── expression: ∅ │ │ ├── closing_loc: (108,13)-(108,14) = "]" + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── locals: [] │ ├── def_keyword_loc: (108,0)-(108,3) = "def" @@ -1469,6 +1543,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── call_operator_loc: ∅ │ │ ├── name: :[] @@ -1486,6 +1561,7 @@ │ │ │ ├── operator_loc: (110,15)-(110,16) = "*" │ │ │ └── expression: ∅ │ │ ├── closing_loc: (110,16)-(110,17) = "]" + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── locals: [] │ ├── def_keyword_loc: (110,0)-(110,3) = "def" @@ -1530,6 +1606,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── call_operator_loc: ∅ │ │ ├── name: :[]= @@ -1547,6 +1624,7 @@ │ │ │ ├── flags: static_literal, decimal │ │ │ └── value: 1 │ │ ├── closing_loc: (112,13)-(112,14) = "]" + │ │ ├── equal_loc: (112,15)-(112,16) = "=" │ │ └── block: ∅ │ ├── locals: [] │ ├── def_keyword_loc: (112,0)-(112,3) = "def" @@ -1591,6 +1669,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── call_operator_loc: ∅ │ │ ├── name: :[]= @@ -1611,6 +1690,7 @@ │ │ │ ├── flags: static_literal, decimal │ │ │ └── value: 1 │ │ ├── closing_loc: (114,16)-(114,17) = "]" + │ │ ├── equal_loc: (114,18)-(114,19) = "=" │ │ └── block: ∅ │ ├── locals: [] │ ├── def_keyword_loc: (114,0)-(114,3) = "def" @@ -1655,6 +1735,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── call_operator_loc: ∅ │ │ ├── opening_loc: (116,11)-(116,12) = "[" @@ -1717,6 +1798,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── call_operator_loc: ∅ │ │ ├── opening_loc: (118,11)-(118,12) = "[" @@ -1789,6 +1871,7 @@ │ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ │ ├── arguments: ∅ │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ ├── equal_loc: ∅ │ │ │ │ │ └── block: ∅ │ │ │ │ ├── opening_loc: (120,21)-(120,22) = "[" │ │ │ │ ├── arguments: @@ -1858,6 +1941,7 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ ├── opening_loc: (122,21)-(122,22) = "[" │ │ │ ├── arguments: diff --git a/snapshots/begin_ensure.txt b/snapshots/begin_ensure.txt index 2f127cd11f..f78e6632c8 100644 --- a/snapshots/begin_ensure.txt +++ b/snapshots/begin_ensure.txt @@ -21,6 +21,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── rescue_clause: ∅ │ ├── else_clause: ∅ @@ -41,6 +42,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── end_keyword_loc: (5,0)-(5,3) = "end" │ └── end_keyword_loc: (5,0)-(5,3) = "end" @@ -60,6 +62,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── rescue_clause: ∅ │ ├── else_clause: ∅ @@ -80,6 +83,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── end_keyword_loc: (7,21)-(7,24) = "end" │ └── end_keyword_loc: (7,21)-(7,24) = "end" @@ -99,6 +103,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── rescue_clause: ∅ │ ├── else_clause: ∅ @@ -119,6 +124,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── end_keyword_loc: (11,1)-(11,4) = "end" │ └── end_keyword_loc: (11,1)-(11,4) = "end" @@ -138,6 +144,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── rescue_clause: ∅ │ ├── else_clause: ∅ @@ -158,6 +165,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── end_keyword_loc: (13,19)-(13,22) = "end" │ └── end_keyword_loc: (13,19)-(13,22) = "end" @@ -218,6 +226,7 @@ │ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ │ ├── arguments: ∅ │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ ├── equal_loc: ∅ │ │ │ │ │ └── block: │ │ │ │ │ @ BlockNode (location: (15,40)-(21,3)) │ │ │ │ │ ├── flags: ∅ @@ -260,6 +269,7 @@ │ │ │ │ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ │ │ │ │ ├── arguments: ∅ │ │ │ │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ │ │ │ ├── equal_loc: ∅ │ │ │ │ │ │ │ │ └── block: │ │ │ │ │ │ │ │ @ BlockNode (location: (18,22)-(19,7)) │ │ │ │ │ │ │ │ ├── flags: ∅ @@ -275,6 +285,7 @@ │ │ │ │ └── end_keyword_loc: (21,4)-(21,7) = "end" │ │ │ └── end_keyword_loc: (21,4)-(21,7) = "end" │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── rescue_clause: ∅ │ ├── else_clause: ∅ diff --git a/snapshots/begin_rescue.txt b/snapshots/begin_rescue.txt index edfe88dac4..7e1ae368a1 100644 --- a/snapshots/begin_rescue.txt +++ b/snapshots/begin_rescue.txt @@ -21,6 +21,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── rescue_clause: │ │ @ RescueNode (location: (1,10)-(1,19)) @@ -43,6 +44,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── subsequent: ∅ │ ├── else_clause: @@ -62,6 +64,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── end_keyword_loc: (1,30)-(1,33) = "end" │ ├── ensure_clause: ∅ @@ -82,6 +85,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── rescue_clause: │ │ @ RescueNode (location: (3,10)-(3,19)) @@ -104,6 +108,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── subsequent: ∅ │ ├── else_clause: @@ -123,6 +128,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── end_keyword_loc: (3,30)-(3,36) = "ensure" │ ├── ensure_clause: @@ -142,6 +148,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── end_keyword_loc: (3,41)-(3,44) = "end" │ └── end_keyword_loc: (3,41)-(3,44) = "end" @@ -222,6 +229,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── rescue_clause: ∅ │ ├── else_clause: ∅ @@ -243,6 +251,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── rescue_clause: ∅ │ ├── else_clause: ∅ @@ -264,6 +273,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── rescue_clause: ∅ │ ├── else_clause: ∅ @@ -285,6 +295,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── rescue_clause: ∅ │ ├── else_clause: ∅ @@ -306,6 +317,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── rescue_clause: │ │ @ RescueNode (location: (24,0)-(29,1)) @@ -328,6 +340,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── subsequent: │ │ @ RescueNode (location: (26,0)-(29,1)) @@ -350,6 +363,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── subsequent: │ │ @ RescueNode (location: (28,0)-(29,1)) @@ -372,6 +386,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── subsequent: ∅ │ ├── else_clause: ∅ @@ -393,6 +408,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── rescue_clause: │ │ @ RescueNode (location: (34,0)-(37,3)) @@ -422,6 +438,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── subsequent: │ │ @ RescueNode (location: (36,0)-(37,3)) @@ -454,6 +471,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── subsequent: ∅ │ ├── else_clause: ∅ @@ -475,6 +493,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── rescue_clause: │ │ @ RescueNode (location: (42,0)-(43,3)) @@ -504,6 +523,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── subsequent: ∅ │ ├── else_clause: ∅ @@ -524,6 +544,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── end_keyword_loc: (46,0)-(46,3) = "end" │ └── end_keyword_loc: (46,0)-(46,3) = "end" @@ -549,6 +570,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── rescue_clause: │ │ @ RescueNode (location: (52,0)-(53,1)) @@ -571,6 +593,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── subsequent: ∅ │ ├── else_clause: ∅ @@ -592,6 +615,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── rescue_clause: │ │ @ RescueNode (location: (56,8)-(56,16)) @@ -614,6 +638,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── subsequent: ∅ │ ├── else_clause: ∅ @@ -635,6 +660,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── rescue_clause: │ │ @ RescueNode (location: (59,2)-(60,1)) @@ -657,6 +683,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── subsequent: ∅ │ ├── else_clause: ∅ @@ -678,6 +705,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── rescue_clause: │ │ @ RescueNode (location: (64,0)-(65,1)) @@ -703,6 +731,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── subsequent: ∅ │ ├── else_clause: ∅ @@ -724,6 +753,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── rescue_clause: │ │ @ RescueNode (location: (70,0)-(71,1)) @@ -752,6 +782,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── subsequent: ∅ │ ├── else_clause: ∅ @@ -773,6 +804,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── rescue_clause: │ │ @ RescueNode (location: (76,0)-(77,3)) @@ -805,6 +837,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── subsequent: ∅ │ ├── else_clause: ∅ @@ -826,6 +859,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── rescue_clause: │ @ RescueNode (location: (82,0)-(83,3)) @@ -855,6 +889,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ └── subsequent: ∅ ├── else_clause: ∅ diff --git a/snapshots/blocks.txt b/snapshots/blocks.txt index 4090abfd90..62943535e1 100644 --- a/snapshots/blocks.txt +++ b/snapshots/blocks.txt @@ -17,6 +17,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: ∅ │ ├── name: :[] @@ -35,8 +36,10 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── closing_loc: (1,7)-(1,8) = "]" + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (1,9)-(1,16)) │ ├── flags: ∅ @@ -55,6 +58,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── opening_loc: (1,9)-(1,10) = "{" │ └── closing_loc: (1,15)-(1,16) = "}" @@ -70,6 +74,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: ∅ │ ├── name: :[] @@ -88,8 +93,10 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── closing_loc: (3,7)-(3,8) = "]" + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (3,9)-(5,3)) │ ├── flags: ∅ @@ -108,6 +115,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── opening_loc: (3,9)-(3,11) = "do" │ └── closing_loc: (5,0)-(5,3) = "end" @@ -123,6 +131,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: (7,1)-(7,2) = "." │ ├── name: :reduce @@ -136,6 +145,7 @@ │ │ ├── flags: static_literal, decimal │ │ └── value: 0 │ ├── closing_loc: (7,10)-(7,11) = ")" + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (7,12)-(7,35)) │ ├── flags: ∅ @@ -189,6 +199,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (9,4)-(9,10)) │ ├── flags: ∅ @@ -217,6 +228,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── @ ParenthesesNode (location: (11,9)-(11,21)) │ │ ├── flags: ∅ @@ -233,6 +245,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: │ │ │ @ BlockNode (location: (11,14)-(11,20)) │ │ │ ├── flags: ∅ @@ -244,6 +257,7 @@ │ │ ├── opening_loc: (11,9)-(11,10) = "(" │ │ └── closing_loc: (11,20)-(11,21) = ")" │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (13,0)-(13,14)) │ ├── flags: newline, ignore_visibility @@ -265,8 +279,10 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (13,8)-(13,14)) │ ├── flags: ∅ @@ -306,10 +322,13 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (15,12)-(15,18)) │ ├── flags: ∅ @@ -327,6 +346,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (17,4)-(18,3)) │ ├── flags: ∅ @@ -357,6 +377,7 @@ │ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ │ ├── arguments: ∅ │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ ├── equal_loc: ∅ │ │ │ │ │ └── block: ∅ │ │ │ │ ├── call_operator_loc: ∅ │ │ │ │ ├── name: :[] @@ -370,6 +391,7 @@ │ │ │ │ │ ├── flags: static_literal, decimal │ │ │ │ │ └── value: 1 │ │ │ │ ├── closing_loc: (17,15)-(17,16) = "]" + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ ├── rest: ∅ │ │ │ ├── posts: (length: 0) @@ -391,6 +413,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (20,4)-(22,3)) │ ├── flags: ∅ @@ -425,6 +448,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (24,4)-(29,3)) │ ├── flags: ∅ @@ -443,6 +467,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: │ │ @ BlockNode (location: (25,6)-(28,5)) │ │ ├── flags: ∅ @@ -461,6 +486,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: │ │ │ @ BlockNode (location: (26,8)-(27,7)) │ │ │ ├── flags: ∅ @@ -485,6 +511,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: ∅ │ ├── name: :[] @@ -503,8 +530,10 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── closing_loc: (31,7)-(31,8) = "]" + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (31,9)-(31,16)) │ ├── flags: ∅ @@ -523,6 +552,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── opening_loc: (31,9)-(31,10) = "{" │ └── closing_loc: (31,15)-(31,16) = "}" @@ -535,6 +565,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (33,4)-(33,24)) │ ├── flags: ∅ @@ -590,6 +621,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (35,4)-(35,11)) │ ├── flags: ∅ @@ -635,6 +667,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (38,5)-(39,3)) │ ├── flags: ∅ @@ -670,6 +703,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (41,5)-(41,12)) │ ├── flags: ∅ @@ -705,6 +739,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (43,2)-(44,3)) │ ├── flags: ∅ @@ -722,6 +757,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (46,2)-(46,4)) │ ├── flags: ∅ @@ -750,6 +786,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: │ │ @ BlockNode (location: (48,11)-(52,1)) │ │ ├── flags: ∅ @@ -790,6 +827,7 @@ │ │ ├── opening_loc: (48,11)-(48,12) = "{" │ │ └── closing_loc: (52,0)-(52,1) = "}" │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ └── @ CallNode (location: (54,0)-(54,17)) ├── flags: newline, ignore_visibility @@ -800,6 +838,7 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: @ BlockNode (location: (54,4)-(54,17)) ├── flags: ∅ diff --git a/snapshots/boolean_operators.txt b/snapshots/boolean_operators.txt index bde70d6509..57483e7e3e 100644 --- a/snapshots/boolean_operators.txt +++ b/snapshots/boolean_operators.txt @@ -19,6 +19,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── name: :a │ └── depth: 0 @@ -36,6 +37,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── name: :a │ ├── binary_operator: :+ @@ -54,6 +56,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── name: :a └── depth: 0 diff --git a/snapshots/break.txt b/snapshots/break.txt index 7e5b8da0aa..df29276b90 100644 --- a/snapshots/break.txt +++ b/snapshots/break.txt @@ -14,6 +14,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (1,4)-(1,13)) │ ├── flags: ∅ @@ -38,6 +39,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (3,4)-(3,27)) │ ├── flags: ∅ @@ -98,6 +100,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (5,4)-(5,15)) │ ├── flags: ∅ @@ -128,6 +131,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (7,4)-(8,3)) │ ├── flags: ∅ @@ -164,6 +168,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (10,4)-(10,21)) │ ├── flags: ∅ @@ -200,6 +205,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (12,4)-(12,23)) │ ├── flags: ∅ @@ -241,6 +247,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (14,4)-(17,3)) │ ├── flags: ∅ @@ -282,6 +289,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (19,4)-(19,15)) │ ├── flags: ∅ @@ -314,6 +322,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (21,4)-(21,16)) │ ├── flags: ∅ @@ -352,6 +361,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (23,4)-(23,17)) │ ├── flags: ∅ @@ -390,6 +400,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (25,4)-(25,24)) │ ├── flags: ∅ @@ -411,6 +422,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── right: │ │ │ @ ParenthesesNode (location: (25,13)-(25,22)) @@ -446,6 +458,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: │ │ @ BlockNode (location: (27,4)-(27,16)) │ │ ├── flags: ∅ @@ -479,6 +492,7 @@ │ │ ├── flags: static_literal, decimal │ │ └── value: 42 │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (29,0)-(29,23)) │ ├── flags: newline @@ -492,6 +506,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: │ │ @ BlockNode (location: (29,4)-(29,17)) │ │ ├── flags: ∅ @@ -537,6 +552,7 @@ │ │ ├── flags: static_literal, decimal │ │ └── value: 42 │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ WhileNode (location: (31,0)-(31,21)) │ ├── flags: newline @@ -556,6 +572,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── right: │ │ │ @ BreakNode (location: (31,11)-(31,16)) @@ -582,6 +599,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── right: │ │ @ BreakNode (location: (33,11)-(33,16)) diff --git a/snapshots/case.txt b/snapshots/case.txt index 3afc25826c..5a569ad6cf 100644 --- a/snapshots/case.txt +++ b/snapshots/case.txt @@ -65,6 +65,7 @@ │ │ │ │ ├── closing_loc: ∅ │ │ │ │ └── unescaped: "hi" │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── @ WhenNode (location: (5,32)-(5,53)) │ │ ├── flags: ∅ @@ -95,6 +96,7 @@ │ │ │ ├── closing_loc: ∅ │ │ │ └── unescaped: "bye" │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── else_clause: ∅ │ ├── case_keyword_loc: (5,0)-(5,4) = "case" @@ -120,6 +122,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── then_keyword_loc: ∅ │ │ └── statements: ∅ @@ -177,6 +180,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── conditions: (length: 1) │ │ └── @ WhenNode (location: (15,11)-(15,31)) @@ -214,6 +218,7 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ ├── call_operator_loc: ∅ │ │ │ ├── name: :== @@ -232,8 +237,10 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── then_keyword_loc: ∅ │ │ └── statements: ∅ @@ -257,6 +264,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── then_keyword_loc: ∅ │ │ └── statements: ∅ @@ -280,6 +288,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── conditions: (length: 1) │ │ └── @ WhenNode (location: (28,3)-(28,10)) @@ -438,6 +447,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── conditions: (length: 1) │ │ └── @ InNode (location: (47,0)-(48,3)) @@ -459,6 +469,7 @@ │ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ │ ├── arguments: ∅ │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ ├── equal_loc: ∅ │ │ │ │ │ └── block: ∅ │ │ │ │ ├── right: │ │ │ │ │ @ CallNode (location: (47,14)-(47,15)) @@ -470,6 +481,7 @@ │ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ │ ├── arguments: ∅ │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ ├── equal_loc: ∅ │ │ │ │ │ └── block: ∅ │ │ │ │ └── operator_loc: (47,10)-(47,13) = "and" │ │ │ ├── then_keyword_loc: ∅ @@ -496,6 +508,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── in_loc: (47,0)-(47,2) = "in" │ │ └── then_loc: ∅ @@ -514,6 +527,7 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: @ BlockNode (location: (51,7)-(55,3)) ├── flags: ∅ diff --git a/snapshots/case_in_hash_key.txt b/snapshots/case_in_hash_key.txt index 0753362dc0..db6811b8dc 100644 --- a/snapshots/case_in_hash_key.txt +++ b/snapshots/case_in_hash_key.txt @@ -61,9 +61,11 @@ │ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ │ ├── arguments: ∅ │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ ├── equal_loc: ∅ │ │ │ │ │ └── block: ∅ │ │ │ │ └── operator_loc: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── in_loc: (2,0)-(2,2) = "in" │ │ └── then_loc: ∅ @@ -116,9 +118,11 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ └── operator_loc: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── in_loc: (4,0)-(4,2) = "in" │ └── then_loc: ∅ diff --git a/snapshots/character_literal.txt b/snapshots/character_literal.txt index cf1023cc5b..6a591c8b01 100644 --- a/snapshots/character_literal.txt +++ b/snapshots/character_literal.txt @@ -34,4 +34,5 @@ │ │ └── unescaped: "" │ └── closing_loc: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/classes.txt b/snapshots/classes.txt index 8dd66ba12c..8633bb0f9c 100644 --- a/snapshots/classes.txt +++ b/snapshots/classes.txt @@ -144,6 +144,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── call_operator_loc: ∅ │ │ ├── name: :! @@ -151,6 +152,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── body: ∅ │ └── end_keyword_loc: (12,0)-(12,3) = "end" @@ -264,6 +266,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── call_operator_loc: (18,12)-(18,13) = "." │ │ ├── name: :bar @@ -271,6 +274,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── body: ∅ │ └── end_keyword_loc: (19,0)-(19,3) = "end" @@ -292,6 +296,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── call_operator_loc: (21,12)-(21,13) = "." │ │ ├── name: :bar @@ -299,6 +304,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── body: ∅ │ └── end_keyword_loc: (21,17)-(21,20) = "end" @@ -352,6 +358,7 @@ │ │ │ ├── flags: static_literal, decimal │ │ │ └── value: 2 │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ └── end_keyword_loc: (30,0)-(30,3) = "end" ├── @ SingletonClassNode (location: (32,0)-(32,23)) @@ -384,6 +391,7 @@ │ │ │ ├── flags: static_literal, decimal │ │ │ └── value: 2 │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ └── end_keyword_loc: (32,20)-(32,23) = "end" └── @ ClassNode (location: (34,0)-(35,3)) @@ -414,6 +422,7 @@ │ │ ├── flags: static_literal, decimal │ │ └── value: 1 │ ├── closing_loc: (34,13)-(34,14) = "]" + │ ├── equal_loc: ∅ │ └── block: ∅ ├── body: ∅ ├── end_keyword_loc: (35,0)-(35,3) = "end" diff --git a/snapshots/command_method_call.txt b/snapshots/command_method_call.txt index 87db5a9acf..772484a117 100644 --- a/snapshots/command_method_call.txt +++ b/snapshots/command_method_call.txt @@ -20,6 +20,7 @@ │ │ ├── flags: static_literal, decimal │ │ └── value: 1 │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (3,0)-(3,9)) │ ├── flags: newline, ignore_visibility @@ -47,8 +48,10 @@ │ │ │ ├── flags: static_literal, decimal │ │ │ └── value: 1 │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ IfNode (location: (5,0)-(5,14)) │ ├── flags: newline @@ -69,6 +72,7 @@ │ │ │ ├── flags: static_literal, decimal │ │ │ └── value: 2 │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── then_keyword_loc: ∅ │ ├── statements: @@ -90,6 +94,7 @@ │ │ │ ├── flags: static_literal, decimal │ │ │ └── value: 1 │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── subsequent: ∅ │ └── end_keyword_loc: ∅ @@ -112,6 +117,7 @@ │ │ │ ├── flags: static_literal, decimal │ │ │ └── value: 2 │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── then_keyword_loc: ∅ │ ├── statements: @@ -133,6 +139,7 @@ │ │ │ ├── flags: static_literal, decimal │ │ │ └── value: 1 │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── else_clause: ∅ │ └── end_keyword_loc: ∅ @@ -157,6 +164,7 @@ │ │ │ ├── flags: static_literal, decimal │ │ │ └── value: 2 │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ └── statements: │ @ StatementsNode (location: (9,0)-(9,5)) @@ -177,6 +185,7 @@ │ │ ├── flags: static_literal, decimal │ │ └── value: 1 │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ UntilNode (location: (11,0)-(11,17)) │ ├── flags: newline @@ -199,6 +208,7 @@ │ │ │ ├── flags: static_literal, decimal │ │ │ └── value: 2 │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ └── statements: │ @ StatementsNode (location: (11,0)-(11,5)) @@ -219,6 +229,7 @@ │ │ ├── flags: static_literal, decimal │ │ └── value: 1 │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ RescueModifierNode (location: (13,0)-(13,18)) │ ├── flags: newline @@ -238,6 +249,7 @@ │ │ │ ├── flags: static_literal, decimal │ │ │ └── value: 1 │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── keyword_loc: (13,6)-(13,12) = "rescue" │ └── rescue_expression: @@ -256,6 +268,7 @@ │ │ ├── flags: static_literal, decimal │ │ └── value: 2 │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (15,0)-(15,10)) │ ├── flags: newline @@ -269,6 +282,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: ∅ │ ├── name: :[] @@ -293,8 +307,10 @@ │ │ │ ├── flags: static_literal, decimal │ │ │ └── value: 1 │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── closing_loc: (15,9)-(15,10) = "]" + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ AndNode (location: (17,0)-(17,15)) │ ├── flags: newline @@ -314,6 +330,7 @@ │ │ │ ├── flags: static_literal, decimal │ │ │ └── value: 1 │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── right: │ │ @ CallNode (location: (17,10)-(17,15)) @@ -331,6 +348,7 @@ │ │ │ ├── flags: static_literal, decimal │ │ │ └── value: 2 │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ └── operator_loc: (17,6)-(17,9) = "and" ├── @ OrNode (location: (19,0)-(19,14)) @@ -351,6 +369,7 @@ │ │ │ ├── flags: static_literal, decimal │ │ │ └── value: 1 │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── right: │ │ @ CallNode (location: (19,9)-(19,14)) @@ -368,6 +387,7 @@ │ │ │ ├── flags: static_literal, decimal │ │ │ └── value: 2 │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ └── operator_loc: (19,6)-(19,8) = "or" ├── @ CallNode (location: (21,0)-(21,9)) @@ -388,6 +408,7 @@ │ │ │ ├── flags: static_literal, decimal │ │ │ └── value: 1 │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: ∅ │ ├── name: :! @@ -395,6 +416,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ LocalVariableWriteNode (location: (23,0)-(23,17)) │ ├── flags: newline @@ -423,6 +445,7 @@ │ │ │ │ ├── flags: static_literal, decimal │ │ │ │ └── value: 1 │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── operator_loc: (23,10)-(23,11) = "=" │ └── operator_loc: (23,4)-(23,5) = "=" @@ -451,6 +474,7 @@ │ │ │ ├── flags: static_literal, decimal │ │ │ └── value: 1 │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── locals: [] │ ├── def_keyword_loc: (25,0)-(25,3) = "def" @@ -477,6 +501,7 @@ │ │ ├── flags: static_literal, decimal │ │ └── value: 2 │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (29,0)-(29,11)) │ ├── flags: newline @@ -493,6 +518,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: (29,5)-(29,6) = "." │ ├── name: :bar @@ -506,6 +532,7 @@ │ │ ├── flags: static_literal, decimal │ │ └── value: 2 │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (31,0)-(31,14)) │ ├── flags: newline @@ -525,6 +552,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── call_operator_loc: ∅ │ │ ├── name: :[] @@ -538,6 +566,7 @@ │ │ │ ├── flags: static_literal, decimal │ │ │ └── value: 2 │ │ ├── closing_loc: (31,7)-(31,8) = "]" + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: (31,8)-(31,9) = "." │ ├── name: :bar @@ -551,6 +580,7 @@ │ │ ├── flags: static_literal, decimal │ │ └── value: 3 │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (33,0)-(33,14)) │ ├── flags: newline @@ -573,6 +603,7 @@ │ │ │ ├── flags: static_literal, decimal │ │ │ └── value: 2 │ │ ├── closing_loc: (33,7)-(33,8) = ")" + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: (33,8)-(33,9) = "." │ ├── name: :bar @@ -586,6 +617,7 @@ │ │ ├── flags: static_literal, decimal │ │ └── value: 3 │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (35,0)-(35,15)) │ ├── flags: newline @@ -602,6 +634,7 @@ │ │ ├── opening_loc: (35,5)-(35,6) = "(" │ │ ├── arguments: ∅ │ │ ├── closing_loc: (35,8)-(35,9) = ")" + │ │ ├── equal_loc: ∅ │ │ └── block: │ │ @ BlockArgumentNode (location: (35,6)-(35,8)) │ │ ├── flags: ∅ @@ -622,6 +655,7 @@ │ │ ├── flags: static_literal, decimal │ │ └── value: 3 │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ AndNode (location: (37,0)-(37,17)) │ ├── flags: newline @@ -644,6 +678,7 @@ │ │ │ │ ├── flags: static_literal, decimal │ │ │ │ └── value: 1 │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── call_operator_loc: ∅ │ │ ├── name: :! @@ -651,6 +686,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── right: │ │ @ CallNode (location: (37,11)-(37,17)) @@ -671,6 +707,7 @@ │ │ │ │ ├── flags: static_literal, decimal │ │ │ │ └── value: 2 │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── call_operator_loc: ∅ │ │ ├── name: :! @@ -678,6 +715,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ └── operator_loc: (37,7)-(37,10) = "and" ├── @ OrNode (location: (39,0)-(39,16)) @@ -701,6 +739,7 @@ │ │ │ │ ├── flags: static_literal, decimal │ │ │ │ └── value: 1 │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── call_operator_loc: ∅ │ │ ├── name: :! @@ -708,6 +747,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── right: │ │ @ CallNode (location: (39,10)-(39,16)) @@ -728,6 +768,7 @@ │ │ │ │ ├── flags: static_literal, decimal │ │ │ │ └── value: 2 │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── call_operator_loc: ∅ │ │ ├── name: :! @@ -735,6 +776,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ └── operator_loc: (39,7)-(39,9) = "or" └── @ CallNode (location: (41,0)-(41,10)) @@ -758,6 +800,7 @@ │ │ │ ├── flags: static_literal, decimal │ │ │ └── value: 1 │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: ∅ │ ├── name: :! @@ -765,6 +808,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── call_operator_loc: ∅ ├── name: :! @@ -772,4 +816,5 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/command_method_call_2.txt b/snapshots/command_method_call_2.txt index 7f09f88128..ef3e73201c 100644 --- a/snapshots/command_method_call_2.txt +++ b/snapshots/command_method_call_2.txt @@ -36,8 +36,10 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: │ │ @ BlockNode (location: (1,12)-(1,18)) │ │ ├── flags: ∅ @@ -47,6 +49,7 @@ │ │ ├── opening_loc: (1,12)-(1,14) = "do" │ │ └── closing_loc: (1,15)-(1,18) = "end" │ ├── closing_loc: (1,18)-(1,19) = ")" + │ ├── equal_loc: ∅ │ └── block: ∅ └── @ CallNode (location: (3,0)-(3,17)) ├── flags: newline, ignore_visibility @@ -79,6 +82,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── @ CallNode (location: (3,13)-(3,16)) │ │ ├── flags: variable_call, ignore_visibility @@ -89,8 +93,11 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── closing_loc: (3,16)-(3,17) = ")" + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/comment_single.txt b/snapshots/comment_single.txt index 3de3483075..786532cacb 100644 --- a/snapshots/comment_single.txt +++ b/snapshots/comment_single.txt @@ -14,4 +14,5 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/comments.txt b/snapshots/comments.txt index 66869bc2a9..8727f8831f 100644 --- a/snapshots/comments.txt +++ b/snapshots/comments.txt @@ -14,6 +14,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (3,0)-(3,1)) │ ├── flags: newline, variable_call, ignore_visibility @@ -24,6 +25,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (5,0)-(5,1)) │ ├── flags: newline, variable_call, ignore_visibility @@ -34,6 +36,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (6,0)-(6,1)) │ ├── flags: newline, variable_call, ignore_visibility @@ -44,6 +47,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (8,0)-(10,4)) │ ├── flags: newline @@ -57,6 +61,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: (10,2)-(10,3) = "." │ ├── name: :f @@ -64,6 +69,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (12,0)-(14,2)) │ ├── flags: newline @@ -77,6 +83,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: (14,0)-(14,1) = "." │ ├── name: :h @@ -84,6 +91,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (16,0)-(17,2)) │ ├── flags: newline @@ -97,6 +105,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: (17,0)-(17,1) = "." │ ├── name: :j @@ -104,6 +113,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (19,0)-(20,4)) │ ├── flags: newline @@ -117,6 +127,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: (20,2)-(20,3) = "." │ ├── name: :l @@ -124,6 +135,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ └── @ CallNode (location: (22,0)-(24,5)) ├── flags: newline, safe_navigation @@ -137,6 +149,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── call_operator_loc: (24,2)-(24,4) = "&." ├── name: :n @@ -144,4 +157,5 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/constants.txt b/snapshots/constants.txt index e1aada8e96..2cf8c8d871 100644 --- a/snapshots/constants.txt +++ b/snapshots/constants.txt @@ -41,6 +41,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── name: :B │ ├── delimiter_loc: (5,1)-(5,3) = "::" @@ -89,6 +90,7 @@ │ │ ├── flags: static_literal, decimal │ │ └── value: 1 │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (15,0)-(15,8)) │ ├── flags: newline, ignore_visibility @@ -114,8 +116,10 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (17,0)-(17,9)) │ ├── flags: newline, ignore_visibility @@ -143,9 +147,11 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── operator_loc: (17,4)-(17,6) = "**" │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (19,0)-(19,8)) │ ├── flags: newline, ignore_visibility @@ -156,6 +162,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockArgumentNode (location: (19,4)-(19,8)) │ ├── flags: ∅ @@ -169,6 +176,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ └── operator_loc: (19,4)-(19,5) = "&" ├── @ CallNode (location: (21,0)-(21,13)) @@ -198,8 +206,10 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (23,0)-(23,14)) │ ├── flags: newline @@ -230,9 +240,11 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── operator_loc: (23,9)-(23,11) = "**" │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (25,0)-(25,13)) │ ├── flags: newline @@ -246,6 +258,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockArgumentNode (location: (25,9)-(25,13)) │ ├── flags: ∅ @@ -259,6 +272,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ └── operator_loc: (25,9)-(25,10) = "&" ├── @ CallNode (location: (27,0)-(27,8)) @@ -276,6 +290,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ ConstantPathWriteNode (location: (29,0)-(29,7)) │ ├── flags: newline @@ -341,6 +356,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (39,0)-(39,10)) │ ├── flags: newline @@ -360,6 +376,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (41,0)-(41,4)) │ ├── flags: newline @@ -373,6 +390,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (43,0)-(43,4)) │ ├── flags: newline @@ -386,6 +404,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (45,0)-(45,4)) │ ├── flags: newline @@ -399,6 +418,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (47,0)-(47,5)) │ ├── flags: newline @@ -412,6 +432,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (49,0)-(49,4)) │ ├── flags: newline @@ -425,6 +446,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (51,0)-(51,5)) │ ├── flags: newline @@ -438,6 +460,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (53,0)-(53,6)) │ ├── flags: newline @@ -451,6 +474,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (55,0)-(55,5)) │ ├── flags: newline @@ -464,6 +488,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (57,0)-(57,4)) │ ├── flags: newline @@ -477,6 +502,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (59,0)-(59,5)) │ ├── flags: newline @@ -490,6 +516,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (61,0)-(61,5)) │ ├── flags: newline @@ -503,6 +530,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (63,0)-(63,5)) │ ├── flags: newline @@ -516,6 +544,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ ConstantPathNode (location: (65,0)-(67,1)) │ ├── flags: newline @@ -538,6 +567,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (71,0)-(71,6)) │ ├── flags: newline @@ -551,6 +581,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (73,0)-(73,8)) │ ├── flags: newline @@ -564,6 +595,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ ConstantPathNode (location: (75,0)-(75,8)) │ ├── flags: newline @@ -586,6 +618,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (79,0)-(79,8)) │ ├── flags: newline @@ -599,6 +632,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (81,0)-(81,6)) │ ├── flags: newline @@ -612,6 +646,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (83,0)-(83,10)) │ ├── flags: newline @@ -625,6 +660,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (85,0)-(85,5)) │ ├── flags: newline @@ -638,6 +674,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (87,0)-(87,7)) │ ├── flags: newline @@ -651,6 +688,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (89,0)-(89,8)) │ ├── flags: newline @@ -664,6 +702,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (91,0)-(91,6)) │ ├── flags: newline @@ -677,6 +716,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ ConstantPathNode (location: (93,0)-(93,6)) │ ├── flags: newline @@ -699,6 +739,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (97,0)-(97,8)) │ ├── flags: newline @@ -712,6 +753,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (99,0)-(99,6)) │ ├── flags: newline @@ -725,6 +767,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (101,0)-(101,5)) │ ├── flags: newline @@ -738,6 +781,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (103,0)-(103,5)) │ ├── flags: newline @@ -751,6 +795,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (105,0)-(105,7)) │ ├── flags: newline @@ -764,6 +809,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (107,0)-(107,6)) │ ├── flags: newline @@ -777,6 +823,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (109,0)-(109,6)) │ ├── flags: newline @@ -790,6 +837,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (111,0)-(111,5)) │ ├── flags: newline @@ -803,6 +851,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (113,0)-(113,7)) │ ├── flags: newline @@ -816,6 +865,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (115,0)-(115,9)) │ ├── flags: newline @@ -829,6 +879,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (117,0)-(117,8)) │ ├── flags: newline @@ -842,6 +893,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (119,0)-(119,9)) │ ├── flags: newline @@ -855,6 +907,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (121,0)-(121,7)) │ ├── flags: newline @@ -868,6 +921,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (123,0)-(123,8)) │ ├── flags: newline @@ -881,6 +935,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (125,0)-(125,7)) │ ├── flags: newline @@ -894,6 +949,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (127,0)-(127,7)) │ ├── flags: newline @@ -907,6 +963,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (129,0)-(129,8)) │ ├── flags: newline @@ -920,6 +977,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (131,0)-(131,9)) │ ├── flags: newline @@ -933,6 +991,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (133,0)-(133,8)) │ ├── flags: newline @@ -946,6 +1005,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (135,0)-(135,7)) │ ├── flags: newline @@ -959,6 +1019,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (137,0)-(137,8)) │ ├── flags: newline @@ -972,6 +1033,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (139,0)-(139,8)) │ ├── flags: newline @@ -985,6 +1047,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (141,0)-(141,15)) │ ├── flags: newline @@ -998,6 +1061,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (143,0)-(143,11)) │ ├── flags: newline @@ -1011,6 +1075,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (145,0)-(145,11)) │ ├── flags: newline @@ -1024,6 +1089,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (147,0)-(147,4)) │ ├── flags: newline @@ -1037,6 +1103,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (149,0)-(149,6)) │ ├── flags: newline @@ -1050,6 +1117,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (151,0)-(151,5)) │ ├── flags: newline @@ -1063,6 +1131,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (153,0)-(153,4)) │ ├── flags: newline @@ -1076,6 +1145,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (155,0)-(155,4)) │ ├── flags: newline @@ -1089,6 +1159,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (157,0)-(157,5)) │ ├── flags: newline @@ -1113,8 +1184,10 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (159,0)-(159,5)) │ ├── flags: newline @@ -1139,8 +1212,10 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (161,0)-(161,5)) │ ├── flags: newline @@ -1165,8 +1240,10 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (163,0)-(163,5)) │ ├── flags: newline @@ -1186,6 +1263,7 @@ │ │ ├── flags: ∅ │ │ └── name: :I │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (165,0)-(165,5)) │ ├── flags: newline @@ -1205,6 +1283,7 @@ │ │ ├── flags: ∅ │ │ └── name: :W │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (167,0)-(167,4)) │ ├── flags: newline @@ -1218,6 +1297,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (169,0)-(169,4)) │ ├── flags: newline @@ -1231,6 +1311,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (171,0)-(171,4)) │ ├── flags: newline @@ -1244,6 +1325,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (173,0)-(173,4)) │ ├── flags: newline @@ -1257,6 +1339,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (175,0)-(175,5)) │ ├── flags: newline @@ -1270,6 +1353,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (177,0)-(177,4)) │ ├── flags: newline @@ -1283,6 +1367,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ ConstantPathNode (location: (179,0)-(180,1)) │ ├── flags: newline @@ -1299,6 +1384,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── name: :C │ ├── delimiter_loc: (179,4)-(179,6) = "::" @@ -1318,6 +1404,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── right: │ @ CallNode (location: (184,0)-(184,10)) @@ -1332,5 +1419,6 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ └── operator_loc: (182,4)-(182,6) = ".." diff --git a/snapshots/dash_heredocs.txt b/snapshots/dash_heredocs.txt index 1ca8b4f73d..402aee8b5c 100644 --- a/snapshots/dash_heredocs.txt +++ b/snapshots/dash_heredocs.txt @@ -35,6 +35,7 @@ │ │ ├── closing_loc: (9,0)-(10,0) = "SECOND\n" │ │ └── unescaped: " b\n" │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ InterpolatedXStringNode (location: (11,0)-(11,8)) │ ├── flags: newline @@ -62,6 +63,7 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ └── closing_loc: (13,3)-(13,4) = "}" │ │ └── @ StringNode (location: (13,4)-(14,0)) @@ -109,6 +111,7 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ └── closing_loc: (27,3)-(27,4) = "}" │ │ └── @ StringNode (location: (27,4)-(28,0)) @@ -144,6 +147,7 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ └── closing_loc: (32,3)-(32,4) = "}" │ │ └── @ StringNode (location: (32,4)-(33,0)) @@ -223,6 +227,7 @@ │ │ │ └── unescaped: "\n" │ │ └── closing_loc: (55,0)-(56,0) = "B\n" │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ └── @ CallNode (location: (57,0)-(57,11)) ├── flags: newline @@ -270,4 +275,5 @@ │ │ └── unescaped: "\n" │ └── closing_loc: (63,0)-(64,0) = "B\n" ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/defined.txt b/snapshots/defined.txt index a3807a5fcc..650e800a09 100644 --- a/snapshots/defined.txt +++ b/snapshots/defined.txt @@ -61,6 +61,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── right: │ │ │ @ CallNode (location: (5,17)-(5,20)) @@ -72,6 +73,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── operator_loc: (5,13)-(5,16) = "and" │ ├── rparen_loc: (5,20)-(5,21) = ")" diff --git a/snapshots/dos_endings.txt b/snapshots/dos_endings.txt index 6ddb8b0a93..eaa98f310c 100644 --- a/snapshots/dos_endings.txt +++ b/snapshots/dos_endings.txt @@ -34,6 +34,7 @@ │ │ │ └── unescaped: "there" │ │ └── closing_loc: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ ArrayNode (location: (4,0)-(5,2)) │ ├── flags: newline, static_literal @@ -108,7 +109,9 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── closing_loc: (17,19)-(17,20) = ")" + │ ├── equal_loc: ∅ │ └── block: ∅ └── operator_loc: (17,2)-(17,3) = "=" diff --git a/snapshots/dstring.txt b/snapshots/dstring.txt index c136860fc4..516b7b3595 100644 --- a/snapshots/dstring.txt +++ b/snapshots/dstring.txt @@ -37,6 +37,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── closing_loc: (5,7)-(5,8) = "}" │ └── closing_loc: (5,8)-(5,9) = "\"" diff --git a/snapshots/emoji_method_calls.txt b/snapshots/emoji_method_calls.txt index f6f1bc4162..7e4c6af8e8 100644 --- a/snapshots/emoji_method_calls.txt +++ b/snapshots/emoji_method_calls.txt @@ -17,6 +17,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── call_operator_loc: (1,3)-(1,4) = "." ├── name: :🌊= @@ -30,4 +31,5 @@ │ ├── flags: static_literal, decimal │ └── value: 1 ├── closing_loc: ∅ + ├── equal_loc: (1,9)-(1,10) = "=" └── block: ∅ diff --git a/snapshots/endless_methods.txt b/snapshots/endless_methods.txt index 512c87d552..938ec25a56 100644 --- a/snapshots/endless_methods.txt +++ b/snapshots/endless_methods.txt @@ -53,6 +53,7 @@ │ │ │ ├── closing_loc: (3,13)-(3,14) = "\"" │ │ │ └── unescaped: "" │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── locals: [] │ ├── def_keyword_loc: (3,0)-(3,3) = "def" @@ -92,6 +93,7 @@ │ │ │ │ ├── flags: static_literal, decimal │ │ │ │ └── value: 2 │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── call_operator_loc: ∅ │ │ ├── name: :+ @@ -105,6 +107,7 @@ │ │ │ ├── flags: static_literal, decimal │ │ │ └── value: 3 │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── locals: [] │ ├── def_keyword_loc: (5,0)-(5,3) = "def" @@ -144,6 +147,7 @@ │ │ │ ├── flags: static_literal, decimal │ │ │ └── value: 1 │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── locals: [] │ ├── def_keyword_loc: (7,4)-(7,7) = "def" diff --git a/snapshots/hashes.txt b/snapshots/hashes.txt index 8462c28994..0890f13667 100644 --- a/snapshots/hashes.txt +++ b/snapshots/hashes.txt @@ -31,6 +31,7 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ ├── value: │ │ │ │ @ CallNode (location: (6,7)-(6,8)) @@ -42,6 +43,7 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ └── operator_loc: (6,4)-(6,6) = "=>" │ │ └── @ AssocNode (location: (6,10)-(6,16)) @@ -56,6 +58,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── value: │ │ │ @ CallNode (location: (6,15)-(6,16)) @@ -67,6 +70,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── operator_loc: (6,12)-(6,14) = "=>" │ └── closing_loc: (6,17)-(6,18) = "}" @@ -86,6 +90,7 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ ├── value: │ │ │ │ @ CallNode (location: (8,7)-(8,8)) @@ -97,6 +102,7 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ └── operator_loc: (8,4)-(8,6) = "=>" │ │ └── @ AssocSplatNode (location: (8,10)-(8,13)) @@ -111,6 +117,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── operator_loc: (8,10)-(8,12) = "**" │ └── closing_loc: (8,14)-(8,15) = "}" @@ -137,6 +144,7 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ └── operator_loc: ∅ │ │ └── @ AssocNode (location: (12,6)-(12,10)) @@ -158,6 +166,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── operator_loc: ∅ │ └── closing_loc: (16,4)-(16,5) = "}" @@ -184,6 +193,7 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ └── operator_loc: ∅ │ │ ├── @ AssocNode (location: (18,8)-(18,12)) @@ -205,6 +215,7 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ └── operator_loc: ∅ │ │ ├── @ AssocSplatNode (location: (18,14)-(18,17)) @@ -219,6 +230,7 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ └── operator_loc: (18,14)-(18,16) = "**" │ │ └── @ AssocNode (location: (18,19)-(18,23)) @@ -240,6 +252,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── operator_loc: ∅ │ └── closing_loc: (18,24)-(18,25) = "}" @@ -269,6 +282,7 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ ├── call_operator_loc: ∅ │ │ │ ├── name: :! @@ -276,6 +290,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── operator_loc: ∅ │ └── closing_loc: (20,11)-(20,12) = "}" @@ -298,6 +313,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (23,4)-(26,3)) │ ├── flags: ∅ @@ -379,6 +395,7 @@ │ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ │ ├── arguments: ∅ │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ ├── equal_loc: ∅ │ │ │ │ │ └── block: ∅ │ │ │ │ └── operator_loc: ∅ │ │ │ └── @ AssocNode (location: (25,16)-(25,18)) diff --git a/snapshots/heredoc_with_comment.txt b/snapshots/heredoc_with_comment.txt index 5c244e50e4..fdc82a43ec 100644 --- a/snapshots/heredoc_with_comment.txt +++ b/snapshots/heredoc_with_comment.txt @@ -20,4 +20,5 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/heredoc_with_escaped_newline_at_start.txt b/snapshots/heredoc_with_escaped_newline_at_start.txt index d20d481e33..49d493feb1 100644 --- a/snapshots/heredoc_with_escaped_newline_at_start.txt +++ b/snapshots/heredoc_with_escaped_newline_at_start.txt @@ -35,6 +35,7 @@ │ │ ├── closing_loc: (1,24)-(1,25) = "'" │ │ └── unescaped: "" │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ └── @ CallNode (location: (5,0)-(5,25)) ├── flags: newline @@ -66,4 +67,5 @@ │ ├── closing_loc: (5,24)-(5,25) = "'" │ └── unescaped: "" ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/if.txt b/snapshots/if.txt index ca39adf412..fce59fd80c 100644 --- a/snapshots/if.txt +++ b/snapshots/if.txt @@ -128,6 +128,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (10,4)-(10,21)) │ ├── flags: ∅ @@ -165,6 +166,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (12,4)-(12,20)) │ ├── flags: ∅ @@ -219,6 +221,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (16,4)-(16,38)) │ ├── flags: ∅ @@ -241,6 +244,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── then_keyword_loc: (16,19)-(16,23) = "then" │ │ ├── statements: @@ -274,6 +278,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── then_keyword_loc: (19,0)-(19,4) = "then" │ ├── statements: @@ -289,6 +294,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── subsequent: ∅ │ └── end_keyword_loc: (20,0)-(20,3) = "end" @@ -305,6 +311,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── then_keyword_loc: ∅ │ ├── statements: @@ -324,6 +331,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── then_keyword_loc: ∅ │ │ ├── statements: @@ -339,6 +347,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── subsequent: ∅ │ │ └── end_keyword_loc: ∅ @@ -391,9 +400,11 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ └── operator_loc: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── subsequent: │ │ @ ElseNode (location: (26,0)-(27,3)) @@ -418,6 +429,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── pattern: │ │ │ @ IntegerNode (location: (29,11)-(29,12)) @@ -443,6 +455,7 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ ├── pattern: │ │ │ │ @ ConstantReadNode (location: (30,14)-(30,15)) @@ -467,6 +480,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── then_keyword_loc: ∅ ├── statements: @@ -482,6 +496,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (34,9)-(35,5)) │ ├── flags: ∅ @@ -522,6 +537,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── then_keyword_loc: ∅ │ ├── statements: @@ -537,6 +553,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: │ │ @ BlockNode (location: (37,9)-(38,5)) │ │ ├── flags: ∅ @@ -580,6 +597,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: │ │ │ @ BlockNode (location: (40,9)-(41,5)) │ │ │ ├── flags: ∅ diff --git a/snapshots/integer_operations.txt b/snapshots/integer_operations.txt index 9962ccf247..22736d3030 100644 --- a/snapshots/integer_operations.txt +++ b/snapshots/integer_operations.txt @@ -17,6 +17,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (3,0)-(3,2)) │ ├── flags: newline @@ -30,6 +31,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (5,0)-(5,6)) │ ├── flags: newline @@ -49,6 +51,7 @@ │ │ ├── flags: static_literal, decimal │ │ └── value: 2 │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (7,0)-(7,6)) │ ├── flags: newline @@ -68,6 +71,7 @@ │ │ ├── flags: static_literal, decimal │ │ └── value: 2 │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (9,0)-(9,5)) │ ├── flags: newline @@ -87,6 +91,7 @@ │ │ ├── flags: static_literal, decimal │ │ └── value: 2 │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (11,0)-(11,5)) │ ├── flags: newline @@ -106,6 +111,7 @@ │ │ ├── flags: static_literal, decimal │ │ └── value: 2 │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (13,0)-(13,5)) │ ├── flags: newline @@ -125,6 +131,7 @@ │ │ ├── flags: static_literal, decimal │ │ └── value: 2 │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (15,0)-(15,4)) │ ├── flags: newline @@ -144,6 +151,7 @@ │ │ ├── flags: static_literal, decimal │ │ └── value: 2 │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (17,0)-(17,5)) │ ├── flags: newline @@ -163,6 +171,7 @@ │ │ ├── flags: static_literal, decimal │ │ └── value: 2 │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (19,0)-(19,5)) │ ├── flags: newline @@ -182,6 +191,7 @@ │ │ ├── flags: static_literal, decimal │ │ └── value: 2 │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (21,0)-(21,5)) │ ├── flags: newline @@ -201,6 +211,7 @@ │ │ ├── flags: static_literal, decimal │ │ └── value: 2 │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (23,0)-(23,5)) │ ├── flags: newline @@ -223,6 +234,7 @@ │ │ │ ├── flags: static_literal, decimal │ │ │ └── value: 2 │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: ∅ │ ├── name: :/ @@ -236,6 +248,7 @@ │ │ ├── flags: static_literal, decimal │ │ └── value: 3 │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (25,0)-(25,5)) │ ├── flags: newline @@ -255,6 +268,7 @@ │ │ ├── flags: static_literal, decimal │ │ └── value: 2 │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (27,0)-(27,6)) │ ├── flags: newline @@ -274,6 +288,7 @@ │ │ ├── flags: static_literal, decimal │ │ └── value: 2 │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (29,0)-(29,6)) │ ├── flags: newline @@ -293,6 +308,7 @@ │ │ ├── flags: static_literal, decimal │ │ └── value: 2 │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (31,0)-(31,7)) │ ├── flags: newline @@ -312,6 +328,7 @@ │ │ ├── flags: static_literal, decimal │ │ └── value: 2 │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (33,0)-(33,6)) │ ├── flags: newline @@ -331,6 +348,7 @@ │ │ ├── flags: static_literal, decimal │ │ └── value: 2 │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (35,0)-(35,7)) │ ├── flags: newline @@ -350,6 +368,7 @@ │ │ ├── flags: static_literal, decimal │ │ └── value: 2 │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (37,0)-(37,6)) │ ├── flags: newline @@ -369,6 +388,7 @@ │ │ ├── flags: static_literal, decimal │ │ └── value: 2 │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (39,0)-(39,5)) │ ├── flags: newline @@ -388,6 +408,7 @@ │ │ ├── flags: static_literal, decimal │ │ └── value: 2 │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (41,0)-(41,6)) │ ├── flags: newline @@ -407,6 +428,7 @@ │ │ ├── flags: static_literal, decimal │ │ └── value: 2 │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (43,0)-(43,6)) │ ├── flags: newline @@ -426,6 +448,7 @@ │ │ ├── flags: static_literal, decimal │ │ └── value: 2 │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (45,0)-(45,5)) │ ├── flags: newline @@ -445,6 +468,7 @@ │ │ ├── flags: static_literal, decimal │ │ └── value: 2 │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (47,0)-(47,5)) │ ├── flags: newline @@ -464,6 +488,7 @@ │ │ ├── flags: static_literal, decimal │ │ └── value: 2 │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ AndNode (location: (49,0)-(49,6)) │ ├── flags: newline @@ -519,8 +544,10 @@ │ │ │ ├── flags: static_literal, decimal │ │ │ └── value: 3 │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (55,0)-(55,9)) │ ├── flags: newline @@ -543,6 +570,7 @@ │ │ │ ├── flags: static_literal, decimal │ │ │ └── value: 2 │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: ∅ │ ├── name: :+ @@ -556,6 +584,7 @@ │ │ ├── flags: static_literal, decimal │ │ └── value: 3 │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ OrNode (location: (57,0)-(57,6)) │ ├── flags: newline @@ -611,8 +640,10 @@ │ │ │ ├── flags: static_literal, decimal │ │ │ └── value: 3 │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ └── @ ParenthesesNode (location: (63,0)-(63,7)) ├── flags: newline @@ -638,6 +669,7 @@ │ │ ├── flags: static_literal, decimal │ │ └── value: 1 │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── opening_loc: (63,0)-(63,1) = "(" └── closing_loc: (63,6)-(63,7) = ")" diff --git a/snapshots/it_assignment.txt b/snapshots/it_assignment.txt index 83469791c0..2c1fe8d63f 100644 --- a/snapshots/it_assignment.txt +++ b/snapshots/it_assignment.txt @@ -17,6 +17,7 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: @ BlockNode (location: (1,7)-(1,24)) ├── flags: ∅ @@ -53,6 +54,7 @@ │ │ ├── name: :it │ │ └── depth: 0 │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── opening_loc: (1,7)-(1,8) = "{" └── closing_loc: (1,23)-(1,24) = "}" diff --git a/snapshots/keyword_method_names.txt b/snapshots/keyword_method_names.txt index 6b33f09b38..661d5676ea 100644 --- a/snapshots/keyword_method_names.txt +++ b/snapshots/keyword_method_names.txt @@ -65,6 +65,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: │ │ │ @ BlockNode (location: (8,6)-(9,5)) │ │ │ ├── flags: ∅ @@ -81,6 +82,7 @@ │ │ ├── equal_loc: ∅ │ │ └── end_keyword_loc: (10,0)-(10,3) = "end" │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ DefNode (location: (12,0)-(13,3)) │ ├── flags: newline diff --git a/snapshots/keywords.txt b/snapshots/keywords.txt index efec77270c..8cd2d3b687 100644 --- a/snapshots/keywords.txt +++ b/snapshots/keywords.txt @@ -14,6 +14,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (1,4)-(1,12)) │ ├── flags: ∅ diff --git a/snapshots/lambda.txt b/snapshots/lambda.txt index 546abfb55e..7ca05ab7bb 100644 --- a/snapshots/lambda.txt +++ b/snapshots/lambda.txt @@ -79,6 +79,7 @@ │ │ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ │ │ ├── arguments: ∅ │ │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ │ ├── equal_loc: ∅ │ │ │ │ │ │ └── block: ∅ │ │ │ │ │ └── closing_loc: (5,11)-(5,12) = "}" │ │ │ │ └── closing_loc: (5,12)-(5,13) = "\"" @@ -122,6 +123,7 @@ │ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ │ ├── arguments: ∅ │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ ├── equal_loc: ∅ │ │ │ │ │ └── block: ∅ │ │ │ │ ├── call_operator_loc: ∅ │ │ │ │ ├── name: :* @@ -135,6 +137,7 @@ │ │ │ │ │ ├── flags: static_literal, decimal │ │ │ │ │ └── value: 3 │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ ├── keyword_rest: ∅ │ │ │ └── block: ∅ @@ -171,6 +174,7 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ ├── rest: ∅ │ │ │ ├── posts: (length: 0) @@ -212,6 +216,7 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ ├── keyword_rest: ∅ │ │ │ └── block: ∅ @@ -288,6 +293,7 @@ │ │ │ ├── value: ∅ │ │ │ └── operator_loc: (14,16)-(14,18) = "**" │ │ ├── closing_loc: (14,18)-(14,19) = ")" + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── locals: [] │ ├── def_keyword_loc: (13,0)-(13,3) = "def" @@ -305,6 +311,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (17,1)-(18,3)) │ ├── flags: ∅ @@ -334,6 +341,7 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ ├── keyword_rest: ∅ │ │ │ └── block: ∅ @@ -374,6 +382,7 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ ├── keyword_rest: ∅ │ │ │ └── block: ∅ @@ -412,6 +421,7 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ ├── keyword_rest: ∅ │ │ │ └── block: ∅ diff --git a/snapshots/method_calls.txt b/snapshots/method_calls.txt index e924613a82..31389341ed 100644 --- a/snapshots/method_calls.txt +++ b/snapshots/method_calls.txt @@ -17,6 +17,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: (1,3)-(1,4) = "." │ ├── name: :bar @@ -33,6 +34,7 @@ │ │ ├── closing_loc: (1,13)-(1,14) = "}" │ │ └── unescaped: "baz" │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (3,0)-(3,9)) │ ├── flags: newline @@ -46,6 +48,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: (3,1)-(3,2) = "." │ ├── name: :b @@ -64,6 +67,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── @ CallNode (location: (3,7)-(3,8)) │ │ ├── flags: variable_call, ignore_visibility @@ -74,8 +78,10 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── closing_loc: (3,8)-(3,9) = ")" + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (5,0)-(5,5)) │ ├── flags: newline @@ -89,6 +95,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: (5,1)-(5,2) = "." │ ├── name: :b @@ -96,6 +103,7 @@ │ ├── opening_loc: (5,3)-(5,4) = "(" │ ├── arguments: ∅ │ ├── closing_loc: (5,4)-(5,5) = ")" + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (7,0)-(9,7)) │ ├── flags: newline, safe_navigation @@ -112,6 +120,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── call_operator_loc: (8,2)-(8,3) = "." │ │ ├── name: :bar @@ -119,6 +128,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: (9,2)-(9,4) = "&." │ ├── name: :baz @@ -126,6 +136,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (11,0)-(11,2)) │ ├── flags: newline, ignore_visibility @@ -136,6 +147,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (13,0)-(13,4)) │ ├── flags: newline @@ -149,6 +161,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: (13,1)-(13,2) = "." │ ├── name: :call @@ -156,6 +169,7 @@ │ ├── opening_loc: (13,2)-(13,3) = "(" │ ├── arguments: ∅ │ ├── closing_loc: (13,3)-(13,4) = ")" + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (15,0)-(15,11)) │ ├── flags: newline @@ -169,6 +183,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: (15,1)-(15,2) = "." │ ├── name: :call @@ -188,6 +203,7 @@ │ │ ├── flags: static_literal, decimal │ │ └── value: 3 │ ├── closing_loc: (15,10)-(15,11) = ")" + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (17,0)-(17,4)) │ ├── flags: newline @@ -201,6 +217,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: (17,1)-(17,3) = "::" │ ├── name: :b @@ -208,6 +225,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (19,0)-(19,6)) │ ├── flags: newline @@ -221,6 +239,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: (19,1)-(19,3) = "::" │ ├── name: :b @@ -239,8 +258,10 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (21,0)-(21,11)) │ ├── flags: newline, attribute_write @@ -254,6 +275,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: (21,3)-(21,4) = "." │ ├── name: :bar= @@ -267,6 +289,7 @@ │ │ ├── flags: static_literal, decimal │ │ └── value: 1 │ ├── closing_loc: ∅ + │ ├── equal_loc: (21,8)-(21,9) = "=" │ └── block: ∅ ├── @ CallNode (location: (23,0)-(23,2)) │ ├── flags: newline, ignore_visibility @@ -277,6 +300,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (25,0)-(25,9)) │ ├── flags: newline, ignore_visibility @@ -287,6 +311,7 @@ │ ├── opening_loc: (25,1)-(25,2) = "(" │ ├── arguments: ∅ │ ├── closing_loc: (25,8)-(25,9) = ")" + │ ├── equal_loc: ∅ │ └── block: │ @ BlockArgumentNode (location: (25,2)-(25,8)) │ ├── flags: ∅ @@ -300,6 +325,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ └── operator_loc: (25,2)-(25,3) = "&" ├── @ CallNode (location: (27,0)-(27,11)) @@ -328,9 +354,11 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── operator_loc: (27,2)-(27,4) = "**" │ ├── closing_loc: (27,10)-(27,11) = ")" + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (29,0)-(29,5)) │ ├── flags: newline @@ -347,6 +375,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── call_operator_loc: (29,1)-(29,2) = "." │ │ ├── name: :b @@ -354,6 +383,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: (29,3)-(29,4) = "." │ ├── name: :c @@ -361,6 +391,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (31,0)-(31,7)) │ ├── flags: newline, ignore_visibility @@ -382,6 +413,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── @ CallNode (location: (31,5)-(31,6)) │ │ ├── flags: variable_call, ignore_visibility @@ -392,8 +424,10 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── closing_loc: (31,6)-(31,7) = ")" + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (33,0)-(33,3)) │ ├── flags: newline, ignore_visibility @@ -404,6 +438,7 @@ │ ├── opening_loc: (33,1)-(33,2) = "(" │ ├── arguments: ∅ │ ├── closing_loc: (33,2)-(33,3) = ")" + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (35,0)-(35,8)) │ ├── flags: newline, ignore_visibility @@ -429,8 +464,10 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── closing_loc: (35,7)-(35,8) = ")" + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (37,0)-(37,6)) │ ├── flags: newline, ignore_visibility @@ -452,6 +489,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── @ CallNode (location: (37,5)-(37,6)) │ │ ├── flags: variable_call, ignore_visibility @@ -462,8 +500,10 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (39,0)-(39,8)) │ ├── flags: newline @@ -477,6 +517,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: (39,1)-(39,2) = "." │ ├── name: :b @@ -495,6 +536,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── @ CallNode (location: (39,7)-(39,8)) │ │ ├── flags: variable_call, ignore_visibility @@ -505,8 +547,10 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ MultiWriteNode (location: (41,0)-(41,23)) │ ├── flags: newline @@ -523,6 +567,7 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ ├── call_operator_loc: (41,3)-(41,4) = "." │ │ │ ├── name: :foo= @@ -539,6 +584,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── call_operator_loc: (41,12)-(41,13) = "." │ │ ├── name: :bar= @@ -572,6 +618,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: (43,1)-(43,3) = "&." │ ├── name: :b @@ -579,6 +626,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (45,0)-(45,5)) │ ├── flags: newline, safe_navigation @@ -592,6 +640,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: (45,1)-(45,3) = "&." │ ├── name: :call @@ -599,6 +648,7 @@ │ ├── opening_loc: (45,3)-(45,4) = "(" │ ├── arguments: ∅ │ ├── closing_loc: (45,4)-(45,5) = ")" + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (47,0)-(47,7)) │ ├── flags: newline, safe_navigation @@ -612,6 +662,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: (47,1)-(47,3) = "&." │ ├── name: :b @@ -630,8 +681,10 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── closing_loc: (47,6)-(47,7) = ")" + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (49,0)-(49,6)) │ ├── flags: newline, safe_navigation @@ -645,6 +698,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: (49,1)-(49,3) = "&." │ ├── name: :b @@ -652,6 +706,7 @@ │ ├── opening_loc: (49,4)-(49,5) = "(" │ ├── arguments: ∅ │ ├── closing_loc: (49,5)-(49,6) = ")" + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ IfNode (location: (51,0)-(51,33)) │ ├── flags: newline @@ -672,6 +727,7 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ ├── right: │ │ │ │ @ CallNode (location: (51,22)-(51,25)) @@ -683,6 +739,7 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ └── operator_loc: (51,19)-(51,21) = "or" │ │ ├── right: @@ -695,6 +752,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── operator_loc: (51,26)-(51,29) = "and" │ ├── then_keyword_loc: ∅ @@ -726,6 +784,7 @@ │ │ │ ├── closing_loc: ∅ │ │ │ └── unescaped: "b" │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── subsequent: ∅ │ └── end_keyword_loc: ∅ @@ -753,6 +812,7 @@ │ │ ├── closing_loc: ∅ │ │ └── unescaped: "b" │ ├── closing_loc: (56,0)-(56,1) = ")" + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (58,0)-(58,10)) │ ├── flags: newline, ignore_visibility @@ -778,8 +838,10 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── closing_loc: (58,9)-(58,10) = ")" + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (60,0)-(60,40)) │ ├── flags: newline, ignore_visibility @@ -847,6 +909,7 @@ │ │ │ └── unescaped: "b" │ │ └── operator_loc: (60,27)-(60,29) = "=>" │ ├── closing_loc: (60,39)-(60,40) = ")" + │ ├── equal_loc: ∅ │ └── block: │ @ BlockArgumentNode (location: (60,34)-(60,39)) │ ├── flags: ∅ @@ -921,6 +984,7 @@ │ │ │ └── operator_loc: ∅ │ │ └── closing_loc: (62,48)-(62,49) = "}" │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (64,0)-(64,36)) │ ├── flags: newline, ignore_visibility @@ -956,6 +1020,7 @@ │ │ │ └── flags: static_literal │ │ └── operator_loc: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (64,16)-(64,36)) │ ├── flags: ∅ @@ -1002,6 +1067,7 @@ │ │ │ ├── name: :a │ │ │ └── depth: 0 │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── opening_loc: (64,16)-(64,18) = "do" │ └── closing_loc: (64,33)-(64,36) = "end" @@ -1037,6 +1103,7 @@ │ │ │ └── unescaped: "friend" │ │ └── operator_loc: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (68,0)-(68,40)) │ ├── flags: newline, ignore_visibility @@ -1096,6 +1163,7 @@ │ │ │ └── unescaped: "dog" │ │ └── operator_loc: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (70,0)-(70,41)) │ ├── flags: newline, ignore_visibility @@ -1155,6 +1223,7 @@ │ │ │ └── unescaped: "dog" │ │ └── operator_loc: ∅ │ ├── closing_loc: (70,40)-(70,41) = ")" + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (72,0)-(72,36)) │ ├── flags: newline, ignore_visibility @@ -1199,6 +1268,7 @@ │ │ │ └── operator_loc: ∅ │ │ └── closing_loc: (72,25)-(72,26) = "}" │ ├── closing_loc: (72,35)-(72,36) = ")" + │ ├── equal_loc: ∅ │ └── block: │ @ BlockArgumentNode (location: (72,28)-(72,35)) │ ├── flags: ∅ @@ -1242,6 +1312,7 @@ │ │ │ └── unescaped: "friend" │ │ └── operator_loc: (74,10)-(74,12) = "=>" │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (76,0)-(78,1)) │ ├── flags: newline, ignore_visibility @@ -1267,6 +1338,7 @@ │ │ ├── closing_loc: ∅ │ │ └── unescaped: "b" │ ├── closing_loc: (78,0)-(78,1) = ")" + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (80,0)-(83,1)) │ ├── flags: newline, ignore_visibility @@ -1306,6 +1378,7 @@ │ │ │ └── unescaped: "c" │ │ └── operator_loc: ∅ │ ├── closing_loc: (83,0)-(83,1) = ")" + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (85,0)-(85,11)) │ ├── flags: newline, ignore_visibility @@ -1316,6 +1389,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockArgumentNode (location: (85,4)-(85,11)) │ ├── flags: ∅ @@ -1368,6 +1442,7 @@ │ │ │ └── flags: static_literal │ │ └── operator_loc: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockArgumentNode (location: (87,23)-(87,30)) │ ├── flags: ∅ @@ -1411,6 +1486,7 @@ │ │ │ └── value: 2 │ │ └── operator_loc: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (91,0)-(91,18)) │ ├── flags: newline @@ -1430,6 +1506,7 @@ │ │ ├── flags: static_literal, decimal │ │ └── value: 10 │ ├── closing_loc: (91,17)-(91,18) = ")" + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (93,0)-(93,10)) │ ├── flags: newline @@ -1443,6 +1520,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: (93,1)-(93,2) = "." │ ├── name: :each @@ -1450,6 +1528,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (93,7)-(93,10)) │ ├── flags: ∅ @@ -1470,6 +1549,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: (95,3)-(95,4) = "." │ ├── name: :map @@ -1477,6 +1557,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (95,8)-(95,14)) │ ├── flags: ∅ @@ -1518,6 +1599,7 @@ │ │ ├── closing_loc: ∅ │ │ └── unescaped: "foo" │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (99,0)-(99,13)) │ ├── flags: newline @@ -1546,6 +1628,7 @@ │ │ ├── closing_loc: ∅ │ │ └── unescaped: "foo" │ ├── closing_loc: (99,12)-(99,13) = ")" + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (101,0)-(101,17)) │ ├── flags: newline @@ -1574,6 +1657,7 @@ │ │ ├── closing_loc: ∅ │ │ └── unescaped: "foo" │ ├── closing_loc: (101,12)-(101,13) = ")" + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (101,14)-(101,17)) │ ├── flags: ∅ @@ -1611,6 +1695,7 @@ │ │ │ └── value: -1 │ │ └── operator_loc: ∅ │ ├── closing_loc: (103,11)-(103,12) = ")" + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (105,0)-(105,28)) │ ├── flags: newline, ignore_visibility @@ -1659,6 +1744,7 @@ │ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ │ ├── arguments: ∅ │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ ├── equal_loc: ∅ │ │ │ │ │ └── block: │ │ │ │ │ @ BlockNode (location: (105,20)-(105,26)) │ │ │ │ │ ├── flags: ∅ @@ -1671,6 +1757,7 @@ │ │ │ └── closing_loc: (105,27)-(105,28) = "}" │ │ └── operator_loc: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (107,0)-(107,24)) │ ├── flags: newline, ignore_visibility @@ -1712,6 +1799,7 @@ │ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ │ ├── arguments: ∅ │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ ├── equal_loc: ∅ │ │ │ │ │ └── block: │ │ │ │ │ @ BlockNode (location: (107,16)-(107,22)) │ │ │ │ │ ├── flags: ∅ @@ -1724,6 +1812,7 @@ │ │ │ └── closing_loc: (107,23)-(107,24) = "}" │ │ └── operator_loc: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (109,0)-(109,36)) │ ├── flags: newline, ignore_visibility @@ -1759,6 +1848,7 @@ │ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ │ ├── arguments: ∅ │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ ├── equal_loc: ∅ │ │ │ │ │ └── block: ∅ │ │ │ │ ├── call_operator_loc: (109,10)-(109,11) = "." │ │ │ │ ├── name: :map @@ -1766,6 +1856,7 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: │ │ │ │ @ BlockNode (location: (109,15)-(109,27)) │ │ │ │ ├── flags: ∅ @@ -1786,6 +1877,7 @@ │ │ │ └── closing_loc: (109,27)-(109,28) = "}" │ │ └── closing_loc: (109,28)-(109,29) = "\"" │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (109,30)-(109,36)) │ ├── flags: ∅ @@ -1828,6 +1920,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: │ │ │ @ BlockNode (location: (111,18)-(111,24)) │ │ │ ├── flags: ∅ @@ -1839,6 +1932,7 @@ │ │ ├── end_keyword_loc: (111,25)-(111,28) = "end" │ │ └── name: :Bar │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (113,0)-(113,29)) │ ├── flags: newline, ignore_visibility @@ -1872,6 +1966,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: │ │ │ @ BlockNode (location: (113,19)-(113,25)) │ │ │ ├── flags: ∅ @@ -1883,6 +1978,7 @@ │ │ ├── end_keyword_loc: (113,26)-(113,29) = "end" │ │ └── name: :Bar │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (115,0)-(115,16)) │ ├── flags: newline, ignore_visibility @@ -1907,6 +2003,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: │ │ │ @ BlockNode (location: (115,9)-(115,15)) │ │ │ ├── flags: ∅ @@ -1918,6 +2015,7 @@ │ │ ├── opening_loc: (115,4)-(115,5) = "[" │ │ └── closing_loc: (115,15)-(115,16) = "]" │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (117,0)-(117,28)) │ ├── flags: newline, ignore_visibility @@ -1949,6 +2047,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: │ │ │ @ BlockNode (location: (117,16)-(117,24)) │ │ │ ├── flags: ∅ @@ -1968,6 +2067,7 @@ │ │ ├── ensure_clause: ∅ │ │ └── end_keyword_loc: (117,25)-(117,28) = "end" │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (119,0)-(124,5)) │ ├── flags: newline, ignore_visibility @@ -1999,6 +2099,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── then_keyword_loc: ∅ │ │ ├── statements: @@ -2014,6 +2115,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: │ │ │ @ BlockNode (location: (121,8)-(123,7)) │ │ │ ├── flags: ∅ @@ -2050,6 +2152,7 @@ │ │ ├── subsequent: ∅ │ │ └── end_keyword_loc: (124,2)-(124,5) = "end" │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (126,0)-(135,5)) │ ├── flags: newline, ignore_visibility @@ -2083,6 +2186,7 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ └── statements: │ │ │ @ StatementsNode (location: (128,4)-(130,7)) @@ -2097,6 +2201,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: │ │ │ @ BlockNode (location: (128,8)-(130,7)) │ │ │ ├── flags: ∅ @@ -2145,6 +2250,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── statements: │ │ @ StatementsNode (location: (133,4)-(134,7)) @@ -2159,6 +2265,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: │ │ @ BlockNode (location: (133,8)-(134,7)) │ │ ├── flags: ∅ @@ -2168,6 +2275,7 @@ │ │ ├── opening_loc: (133,8)-(133,10) = "do" │ │ └── closing_loc: (134,4)-(134,7) = "end" │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (137,0)-(137,9)) │ ├── flags: newline @@ -2194,6 +2302,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: │ │ @ BlockNode (location: (137,7)-(137,9)) │ │ ├── flags: ∅ @@ -2203,6 +2312,7 @@ │ │ ├── opening_loc: (137,7)-(137,8) = "{" │ │ └── closing_loc: (137,8)-(137,9) = "}" │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (139,0)-(139,16)) │ ├── flags: newline @@ -2229,6 +2339,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: │ │ @ BlockNode (location: (139,7)-(139,16)) │ │ ├── flags: ∅ @@ -2263,6 +2374,7 @@ │ │ ├── opening_loc: (139,7)-(139,8) = "{" │ │ └── closing_loc: (139,15)-(139,16) = "}" │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (141,0)-(141,11)) │ ├── flags: newline @@ -2276,6 +2388,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: │ │ @ BlockNode (location: (141,2)-(141,4)) │ │ ├── flags: ∅ @@ -2301,6 +2414,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: │ │ @ BlockNode (location: (141,9)-(141,11)) │ │ ├── flags: ∅ @@ -2310,6 +2424,7 @@ │ │ ├── opening_loc: (141,9)-(141,10) = "{" │ │ └── closing_loc: (141,10)-(141,11) = "}" │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (143,0)-(143,11)) │ ├── flags: newline @@ -2323,6 +2438,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: ∅ │ ├── name: :<< @@ -2341,6 +2457,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: │ │ @ BlockNode (location: (143,9)-(143,11)) │ │ ├── flags: ∅ @@ -2350,6 +2467,7 @@ │ │ ├── opening_loc: (143,9)-(143,10) = "{" │ │ └── closing_loc: (143,10)-(143,11) = "}" │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ InterpolatedStringNode (location: (145,0)-(145,17)) │ ├── flags: newline @@ -2388,6 +2506,7 @@ │ │ │ │ ├── opening_loc: (145,9)-(145,10) = "(" │ │ │ │ └── closing_loc: (145,13)-(145,14) = ")" │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── closing_loc: (145,15)-(145,16) = "}" │ └── closing_loc: (145,16)-(145,17) = "\"" @@ -2417,6 +2536,7 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ ├── opening_loc: (147,3)-(147,4) = "(" │ │ │ └── closing_loc: (147,5)-(147,6) = ")" @@ -2462,6 +2582,7 @@ │ │ │ ├── operator_loc: (149,12)-(149,13) = "*" │ │ │ └── expression: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── locals: [] │ ├── def_keyword_loc: (149,0)-(149,3) = "def" @@ -2493,6 +2614,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: │ │ @ BlockNode (location: (151,11)-(151,16)) │ │ ├── flags: ∅ @@ -2508,6 +2630,7 @@ │ │ ├── opening_loc: (151,11)-(151,12) = "{" │ │ └── closing_loc: (151,15)-(151,16) = "}" │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ LocalVariableWriteNode (location: (153,0)-(153,7)) │ ├── flags: newline @@ -2528,6 +2651,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (154,4)-(154,6)) │ ├── flags: ∅ @@ -2582,6 +2706,7 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ └── closing_loc: (156,13)-(156,14) = "}" │ │ └── closing_loc: (156,14)-(156,16) = "\":" @@ -2591,4 +2716,5 @@ │ │ └── value: 42 │ └── operator_loc: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/methods.txt b/snapshots/methods.txt index 6a77ac0c5b..c4589de427 100644 --- a/snapshots/methods.txt +++ b/snapshots/methods.txt @@ -143,6 +143,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── opening_loc: (10,4)-(10,5) = "(" │ │ └── closing_loc: (10,6)-(10,7) = ")" @@ -172,6 +173,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── opening_loc: (13,4)-(13,5) = "(" │ │ └── closing_loc: (13,6)-(13,7) = ")" @@ -256,6 +258,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── parameters: ∅ │ ├── body: ∅ @@ -1049,6 +1052,7 @@ │ │ │ ├── operator_loc: (110,12)-(110,13) = "*" │ │ │ └── expression: ∅ │ │ ├── closing_loc: (110,13)-(110,14) = ")" + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── locals: [] │ ├── def_keyword_loc: (110,0)-(110,3) = "def" @@ -1095,6 +1099,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: │ │ @ BlockNode (location: (112,16)-(112,28)) │ │ ├── flags: ∅ @@ -1127,6 +1132,7 @@ │ │ │ │ ├── value: ∅ │ │ │ │ └── operator_loc: (112,23)-(112,25) = "**" │ │ │ ├── closing_loc: (112,25)-(112,26) = ")" + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── opening_loc: (112,16)-(112,17) = "{" │ │ └── closing_loc: (112,27)-(112,28) = "}" @@ -1172,6 +1178,7 @@ │ │ │ └── @ ForwardingArgumentsNode (location: (114,14)-(114,17)) │ │ │ └── flags: ∅ │ │ ├── closing_loc: (114,17)-(114,18) = ")" + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── locals: [] │ ├── def_keyword_loc: (114,0)-(114,3) = "def" @@ -1221,6 +1228,7 @@ │ │ │ └── @ ForwardingArgumentsNode (location: (116,20)-(116,23)) │ │ │ └── flags: ∅ │ │ ├── closing_loc: (116,23)-(116,24) = ")" + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── locals: [] │ ├── def_keyword_loc: (116,0)-(116,3) = "def" @@ -1252,6 +1260,7 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ └── operator_loc: (118,7)-(118,8) = "=" │ │ ├── opening_loc: (118,4)-(118,5) = "(" @@ -1361,6 +1370,7 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ └── operator_loc: (130,7)-(130,8) = "=" │ │ ├── opening_loc: (130,4)-(130,5) = "(" @@ -1468,6 +1478,7 @@ │ │ │ │ │ └── @ ForwardingArgumentsNode (location: (138,20)-(138,23)) │ │ │ │ │ └── flags: ∅ │ │ │ │ ├── closing_loc: (138,23)-(138,24) = ")" + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ └── closing_loc: (138,24)-(138,25) = "}" │ │ └── closing_loc: (138,25)-(138,26) = "\"" @@ -1519,6 +1530,7 @@ │ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ │ ├── arguments: ∅ │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ ├── equal_loc: ∅ │ │ │ │ │ └── block: ∅ │ │ │ │ └── operator_loc: (141,11)-(141,13) = "**" │ │ │ ├── @ AssocSplatNode (location: (141,18)-(141,23)) @@ -1533,6 +1545,7 @@ │ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ │ ├── arguments: ∅ │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ ├── equal_loc: ∅ │ │ │ │ │ └── block: ∅ │ │ │ │ └── operator_loc: (141,18)-(141,20) = "**" │ │ │ └── @ AssocSplatNode (location: (141,25)-(141,30)) @@ -1547,9 +1560,11 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ └── operator_loc: (141,25)-(141,27) = "**" │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── locals: [] │ ├── def_keyword_loc: (140,0)-(140,3) = "def" @@ -1865,6 +1880,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── call_operator_loc: ∅ │ │ ├── name: :>> @@ -1883,6 +1899,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: │ │ │ @ BlockNode (location: (163,12)-(163,14)) │ │ │ ├── flags: ∅ @@ -1892,6 +1909,7 @@ │ │ │ ├── opening_loc: (163,12)-(163,13) = "{" │ │ │ └── closing_loc: (163,13)-(163,14) = "}" │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── locals: [:a] │ ├── def_keyword_loc: (162,0)-(162,3) = "def" @@ -1998,6 +2016,7 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ ├── call_operator_loc: ∅ │ │ │ ├── name: :-@ @@ -2005,6 +2024,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── keyword_rest: ∅ │ │ └── block: ∅ @@ -2046,6 +2066,7 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ ├── call_operator_loc: ∅ │ │ │ ├── name: :+@ @@ -2053,6 +2074,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── keyword_rest: ∅ │ │ └── block: ∅ @@ -2094,6 +2116,7 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ ├── call_operator_loc: ∅ │ │ │ ├── name: :! @@ -2101,6 +2124,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── keyword_rest: ∅ │ │ └── block: ∅ @@ -2181,6 +2205,7 @@ │ │ │ └── @ ForwardingArgumentsNode (location: (180,6)-(180,9)) │ │ │ └── flags: ∅ │ │ ├── closing_loc: (180,9)-(180,10) = ")" + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── locals: [] │ ├── def_keyword_loc: (179,0)-(179,3) = "def" diff --git a/snapshots/modules.txt b/snapshots/modules.txt index 8bd25a7340..3eb4974319 100644 --- a/snapshots/modules.txt +++ b/snapshots/modules.txt @@ -55,6 +55,7 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ └── closing_loc: (3,12)-(3,13) = "}" │ │ └── @ StringNode (location: (3,13)-(3,17)) @@ -81,6 +82,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── name: :M │ │ ├── delimiter_loc: (5,8)-(5,10) = "::" @@ -163,6 +165,7 @@ │ │ │ ├── opening_loc: (14,8)-(14,9) = "[" │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: (14,9)-(14,10) = "]" + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── name: :B │ │ ├── delimiter_loc: (14,10)-(14,12) = "::" @@ -196,6 +199,7 @@ │ │ │ ├── flags: static_literal, decimal │ │ │ └── value: 1 │ │ ├── closing_loc: (17,10)-(17,11) = "]" + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── name: :B │ ├── delimiter_loc: (17,11)-(17,13) = "::" diff --git a/snapshots/next.txt b/snapshots/next.txt index bf8447e837..edcb9c1d6d 100644 --- a/snapshots/next.txt +++ b/snapshots/next.txt @@ -14,6 +14,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (1,4)-(1,12)) │ ├── flags: ∅ @@ -38,6 +39,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (3,4)-(3,26)) │ ├── flags: ∅ @@ -98,6 +100,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (5,4)-(5,14)) │ ├── flags: ∅ @@ -128,6 +131,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (7,4)-(8,3)) │ ├── flags: ∅ @@ -164,6 +168,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (10,4)-(10,20)) │ ├── flags: ∅ @@ -200,6 +205,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (12,4)-(12,22)) │ ├── flags: ∅ @@ -241,6 +247,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (14,4)-(17,3)) │ ├── flags: ∅ @@ -282,6 +289,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (19,4)-(20,3)) │ ├── flags: ∅ @@ -309,6 +317,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (22,4)-(22,14)) │ ├── flags: ∅ @@ -341,6 +350,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (24,4)-(24,15)) │ ├── flags: ∅ @@ -379,6 +389,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (26,4)-(26,16)) │ ├── flags: ∅ @@ -417,6 +428,7 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: @ BlockNode (location: (28,4)-(28,23)) ├── flags: ∅ @@ -438,6 +450,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── right: │ │ @ ParenthesesNode (location: (28,13)-(28,21)) diff --git a/snapshots/non_alphanumeric_methods.txt b/snapshots/non_alphanumeric_methods.txt index 2d29d365e4..240a6e7816 100644 --- a/snapshots/non_alphanumeric_methods.txt +++ b/snapshots/non_alphanumeric_methods.txt @@ -265,6 +265,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── parameters: ∅ │ ├── body: ∅ diff --git a/snapshots/not.txt b/snapshots/not.txt index e164b18813..0ec160a71e 100644 --- a/snapshots/not.txt +++ b/snapshots/not.txt @@ -20,6 +20,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── call_operator_loc: ∅ │ │ ├── name: :! @@ -27,6 +28,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── right: │ │ @ CallNode (location: (1,12)-(1,19)) @@ -41,6 +43,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── call_operator_loc: ∅ │ │ ├── name: :! @@ -48,6 +51,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ └── operator_loc: (1,8)-(1,11) = "and" ├── @ CallNode (location: (3,0)-(3,16)) @@ -65,6 +69,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── right: │ │ │ @ CallNode (location: (3,12)-(3,15)) @@ -76,6 +81,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── operator_loc: (3,8)-(3,11) = "and" │ ├── call_operator_loc: ∅ @@ -84,6 +90,7 @@ │ ├── opening_loc: (3,3)-(3,4) = "(" │ ├── arguments: ∅ │ ├── closing_loc: (3,15)-(3,16) = ")" + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (5,0)-(5,7)) │ ├── flags: newline @@ -97,6 +104,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: ∅ │ ├── name: :! @@ -104,6 +112,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ AndNode (location: (7,0)-(8,5)) │ ├── flags: newline @@ -120,6 +129,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── call_operator_loc: ∅ │ │ ├── name: :! @@ -127,6 +137,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── right: │ │ @ CallNode (location: (7,12)-(8,5)) @@ -141,6 +152,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── call_operator_loc: ∅ │ │ ├── name: :! @@ -148,6 +160,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ └── operator_loc: (7,8)-(7,11) = "and" ├── @ AndNode (location: (11,0)-(13,5)) @@ -165,6 +178,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── call_operator_loc: ∅ │ │ ├── name: :! @@ -172,6 +186,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── right: │ │ @ CallNode (location: (12,4)-(13,5)) @@ -186,6 +201,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── call_operator_loc: ∅ │ │ ├── name: :! @@ -193,6 +209,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ └── operator_loc: (11,8)-(11,11) = "and" ├── @ AndNode (location: (16,0)-(20,5)) @@ -210,6 +227,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── call_operator_loc: ∅ │ │ ├── name: :! @@ -217,6 +235,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── right: │ │ @ CallNode (location: (17,2)-(20,5)) @@ -231,6 +250,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── call_operator_loc: ∅ │ │ ├── name: :! @@ -238,6 +258,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ └── operator_loc: (16,8)-(16,11) = "and" ├── @ CallNode (location: (22,0)-(25,1)) @@ -252,6 +273,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: ∅ │ ├── name: :! @@ -259,6 +281,7 @@ │ ├── opening_loc: (22,3)-(22,4) = "(" │ ├── arguments: ∅ │ ├── closing_loc: (25,0)-(25,1) = ")" + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (27,0)-(33,3)) │ ├── flags: newline @@ -272,6 +295,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: ∅ │ ├── name: :! @@ -279,6 +303,7 @@ │ ├── opening_loc: (27,3)-(27,4) = "(" │ ├── arguments: ∅ │ ├── closing_loc: (33,2)-(33,3) = ")" + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (35,0)-(35,14)) │ ├── flags: newline @@ -295,6 +320,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── right: │ │ │ @ CallNode (location: (35,11)-(35,14)) @@ -306,6 +332,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── operator_loc: (35,8)-(35,10) = ".." │ ├── call_operator_loc: ∅ @@ -314,6 +341,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ └── @ CallNode (location: (37,0)-(37,16)) ├── flags: newline @@ -336,6 +364,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── right: │ │ │ @ CallNode (location: (37,12)-(37,15)) @@ -347,6 +376,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── operator_loc: (37,9)-(37,11) = ".." │ ├── opening_loc: (37,4)-(37,5) = "(" @@ -357,4 +387,5 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/patterns.txt b/snapshots/patterns.txt index 96c765a3c8..20c9b1f994 100644 --- a/snapshots/patterns.txt +++ b/snapshots/patterns.txt @@ -17,6 +17,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── pattern: │ │ @ LocalVariableTargetNode (location: (1,7)-(1,10)) @@ -36,6 +37,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── pattern: │ │ @ IntegerNode (location: (2,7)-(2,8)) @@ -54,6 +56,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── pattern: │ │ @ FloatNode (location: (3,7)-(3,10)) @@ -72,6 +75,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── pattern: │ │ @ ImaginaryNode (location: (4,7)-(4,9)) @@ -93,6 +97,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── pattern: │ │ @ RationalNode (location: (5,7)-(5,9)) @@ -112,6 +117,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── pattern: │ │ @ SymbolNode (location: (6,7)-(6,11)) @@ -133,6 +139,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── pattern: │ │ @ SymbolNode (location: (7,7)-(7,14)) @@ -154,6 +161,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── pattern: │ │ @ SymbolNode (location: (8,7)-(8,13)) @@ -175,6 +183,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── pattern: │ │ @ RegularExpressionNode (location: (9,7)-(9,12)) @@ -196,6 +205,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── pattern: │ │ @ XStringNode (location: (10,7)-(10,12)) @@ -217,6 +227,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── pattern: │ │ @ XStringNode (location: (11,7)-(11,14)) @@ -238,6 +249,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── pattern: │ │ @ ArrayNode (location: (12,7)-(12,14)) @@ -264,6 +276,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── pattern: │ │ @ ArrayNode (location: (13,7)-(13,14)) @@ -290,6 +303,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── pattern: │ │ @ ArrayNode (location: (14,7)-(14,14)) @@ -316,6 +330,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── pattern: │ │ @ ArrayNode (location: (15,7)-(15,14)) @@ -342,6 +357,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── pattern: │ │ @ StringNode (location: (16,7)-(16,14)) @@ -363,6 +379,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── pattern: │ │ @ StringNode (location: (17,7)-(17,14)) @@ -384,6 +401,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── pattern: │ │ @ StringNode (location: (18,7)-(18,12)) @@ -405,6 +423,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── pattern: │ │ @ NilNode (location: (19,7)-(19,10)) @@ -422,6 +441,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── pattern: │ │ @ SelfNode (location: (20,7)-(20,11)) @@ -439,6 +459,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── pattern: │ │ @ TrueNode (location: (21,7)-(21,11)) @@ -456,6 +477,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── pattern: │ │ @ FalseNode (location: (22,7)-(22,12)) @@ -473,6 +495,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── pattern: │ │ @ SourceFileNode (location: (23,7)-(23,15)) @@ -491,6 +514,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── pattern: │ │ @ SourceLineNode (location: (24,7)-(24,15)) @@ -508,6 +532,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── pattern: │ │ @ SourceEncodingNode (location: (25,7)-(25,19)) @@ -525,6 +550,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── pattern: │ │ @ LambdaNode (location: (26,7)-(26,17)) @@ -555,6 +581,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── pattern: │ │ @ RangeNode (location: (28,7)-(28,13)) @@ -581,6 +608,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── pattern: │ │ @ RangeNode (location: (29,7)-(29,17)) @@ -607,6 +635,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── pattern: │ │ @ RangeNode (location: (30,7)-(30,15)) @@ -639,6 +668,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── pattern: │ │ @ RangeNode (location: (31,7)-(31,15)) @@ -667,6 +697,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── pattern: │ │ @ RangeNode (location: (32,7)-(32,19)) @@ -699,6 +730,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── pattern: │ │ @ RangeNode (location: (33,7)-(33,25)) @@ -731,6 +763,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── pattern: │ │ @ RangeNode (location: (34,7)-(34,23)) @@ -763,6 +796,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── pattern: │ │ @ RangeNode (location: (35,7)-(35,21)) @@ -795,6 +829,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── pattern: │ │ @ RangeNode (location: (36,7)-(36,21)) @@ -827,6 +862,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── pattern: │ │ @ RangeNode (location: (37,7)-(37,25)) @@ -859,6 +895,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── pattern: │ │ @ RangeNode (location: (38,7)-(38,25)) @@ -901,6 +938,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── pattern: │ │ @ RangeNode (location: (39,7)-(39,25)) @@ -943,6 +981,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── pattern: │ │ @ RangeNode (location: (40,7)-(40,25)) @@ -985,6 +1024,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── pattern: │ │ @ RangeNode (location: (41,7)-(41,25)) @@ -1027,6 +1067,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── pattern: │ │ @ RangeNode (location: (42,7)-(42,25)) @@ -1059,6 +1100,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── pattern: │ │ @ RangeNode (location: (43,7)-(43,25)) @@ -1091,6 +1133,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── pattern: │ │ @ RangeNode (location: (44,7)-(44,21)) @@ -1123,6 +1166,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── pattern: │ │ @ RangeNode (location: (45,7)-(45,17)) @@ -1147,6 +1191,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── pattern: │ │ @ RangeNode (location: (46,7)-(46,19)) @@ -1171,6 +1216,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── pattern: │ │ @ RangeNode (location: (47,7)-(47,19)) @@ -1195,6 +1241,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── pattern: │ │ @ RangeNode (location: (48,7)-(48,21)) @@ -1219,6 +1266,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── pattern: │ │ @ RangeNode (location: (49,7)-(49,27)) @@ -1245,6 +1293,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── pattern: │ │ @ RangeNode (location: (50,7)-(50,27)) @@ -1269,6 +1318,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── pattern: │ │ @ RangeNode (location: (51,7)-(51,35)) @@ -1293,6 +1343,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── pattern: │ │ @ RangeNode (location: (52,7)-(52,31)) @@ -1353,6 +1404,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── pattern: │ │ @ PinnedVariableNode (location: (54,16)-(54,20)) @@ -1376,6 +1428,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── pattern: │ │ @ PinnedVariableNode (location: (55,7)-(55,12)) @@ -1398,6 +1451,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── pattern: │ │ @ PinnedVariableNode (location: (56,7)-(56,13)) @@ -1420,6 +1474,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── pattern: │ │ @ PinnedVariableNode (location: (57,7)-(57,12)) @@ -1442,6 +1497,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── pattern: │ │ @ PinnedExpressionNode (location: (59,7)-(59,11)) @@ -1466,6 +1522,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── pattern: │ │ @ PinnedExpressionNode (location: (60,7)-(60,13)) @@ -1489,6 +1546,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── pattern: │ │ @ PinnedExpressionNode (location: (61,7)-(61,23)) @@ -1518,6 +1576,7 @@ │ │ │ │ ├── closing_loc: (61,21)-(61,22) = "\"" │ │ │ │ └── unescaped: "baz" │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── operator_loc: (61,7)-(61,8) = "^" │ │ ├── lparen_loc: (61,8)-(61,9) = "(" @@ -1535,6 +1594,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── pattern: │ │ @ ConstantReadNode (location: (63,7)-(63,10)) @@ -1553,6 +1613,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── pattern: │ │ @ ConstantPathNode (location: (64,7)-(64,20)) @@ -1583,6 +1644,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── pattern: │ │ @ ConstantPathNode (location: (65,7)-(65,12)) @@ -1604,6 +1666,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── pattern: │ │ @ ConstantPathNode (location: (66,7)-(66,22)) @@ -1637,6 +1700,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── pattern: │ │ @ ArrayPatternNode (location: (68,7)-(68,12)) @@ -1663,6 +1727,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── pattern: │ │ @ ArrayPatternNode (location: (69,7)-(69,13)) @@ -1692,6 +1757,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── pattern: │ │ @ ArrayPatternNode (location: (70,7)-(70,19)) @@ -1727,6 +1793,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── pattern: │ │ @ ArrayPatternNode (location: (71,7)-(71,15)) @@ -1757,6 +1824,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── pattern: │ │ @ ArrayPatternNode (location: (72,7)-(72,21)) @@ -1795,6 +1863,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── pattern: │ │ @ ArrayPatternNode (location: (73,7)-(73,21)) @@ -1833,6 +1902,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── pattern: │ │ @ FindPatternNode (location: (74,7)-(74,27)) @@ -1879,6 +1949,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── pattern: │ │ @ ArrayPatternNode (location: (76,7)-(76,12)) @@ -1905,6 +1976,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── pattern: │ │ @ ArrayPatternNode (location: (77,7)-(77,13)) @@ -1934,6 +2006,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── pattern: │ │ @ ArrayPatternNode (location: (78,7)-(78,19)) @@ -1969,6 +2042,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── pattern: │ │ @ ArrayPatternNode (location: (79,7)-(79,17)) @@ -2006,6 +2080,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── pattern: │ │ @ ArrayPatternNode (location: (80,7)-(80,15)) @@ -2036,6 +2111,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── pattern: │ │ @ ArrayPatternNode (location: (81,7)-(81,21)) @@ -2074,6 +2150,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── pattern: │ │ @ ArrayPatternNode (location: (82,7)-(82,21)) @@ -2112,6 +2189,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── pattern: │ │ @ FindPatternNode (location: (83,7)-(83,27)) @@ -2158,6 +2236,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── pattern: │ │ @ ArrayPatternNode (location: (85,7)-(85,11)) @@ -2189,6 +2268,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── pattern: │ │ @ ArrayPatternNode (location: (86,7)-(86,21)) @@ -2228,6 +2308,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── pattern: │ │ @ ArrayPatternNode (location: (87,7)-(87,21)) @@ -2267,6 +2348,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── pattern: │ │ @ ArrayPatternNode (location: (88,7)-(88,21)) @@ -2306,6 +2388,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── pattern: │ │ @ FindPatternNode (location: (89,7)-(89,22)) @@ -2349,6 +2432,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── pattern: │ │ @ ArrayPatternNode (location: (90,7)-(90,11)) @@ -2378,6 +2462,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── pattern: │ │ @ ArrayPatternNode (location: (92,7)-(92,9)) @@ -2401,6 +2486,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── pattern: │ │ @ ArrayPatternNode (location: (93,7)-(93,17)) @@ -2456,6 +2542,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── pattern: │ │ @ ArrayPatternNode (location: (95,7)-(95,13)) @@ -2487,6 +2574,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── pattern: │ │ @ ArrayPatternNode (location: (96,7)-(96,23)) @@ -2526,6 +2614,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── pattern: │ │ @ ArrayPatternNode (location: (97,7)-(97,23)) @@ -2565,6 +2654,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── pattern: │ │ @ ArrayPatternNode (location: (98,7)-(98,23)) @@ -2604,6 +2694,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── pattern: │ │ @ FindPatternNode (location: (99,7)-(99,24)) @@ -2647,6 +2738,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── pattern: │ │ @ LocalVariableTargetNode (location: (101,7)-(101,10)) @@ -2666,6 +2758,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── pattern: │ │ @ IntegerNode (location: (102,7)-(102,8)) @@ -2684,6 +2777,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── pattern: │ │ @ FloatNode (location: (103,7)-(103,10)) @@ -2702,6 +2796,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── pattern: │ │ @ ImaginaryNode (location: (104,7)-(104,9)) @@ -2723,6 +2818,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── pattern: │ │ @ RationalNode (location: (105,7)-(105,9)) @@ -2742,6 +2838,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── pattern: │ │ @ SymbolNode (location: (106,7)-(106,11)) @@ -2763,6 +2860,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── pattern: │ │ @ SymbolNode (location: (107,7)-(107,14)) @@ -2784,6 +2882,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── pattern: │ │ @ SymbolNode (location: (108,7)-(108,13)) @@ -2805,6 +2904,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── pattern: │ │ @ RegularExpressionNode (location: (109,7)-(109,12)) @@ -2826,6 +2926,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── pattern: │ │ @ XStringNode (location: (110,7)-(110,12)) @@ -2847,6 +2948,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── pattern: │ │ @ XStringNode (location: (111,7)-(111,14)) @@ -2868,6 +2970,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── pattern: │ │ @ ArrayNode (location: (112,7)-(112,14)) @@ -2894,6 +2997,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── pattern: │ │ @ ArrayNode (location: (113,7)-(113,14)) @@ -2920,6 +3024,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── pattern: │ │ @ ArrayNode (location: (114,7)-(114,14)) @@ -2946,6 +3051,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── pattern: │ │ @ ArrayNode (location: (115,7)-(115,14)) @@ -2972,6 +3078,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── pattern: │ │ @ StringNode (location: (116,7)-(116,14)) @@ -2993,6 +3100,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── pattern: │ │ @ StringNode (location: (117,7)-(117,14)) @@ -3014,6 +3122,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── pattern: │ │ @ StringNode (location: (118,7)-(118,12)) @@ -3035,6 +3144,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── pattern: │ │ @ NilNode (location: (119,7)-(119,10)) @@ -3052,6 +3162,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── pattern: │ │ @ SelfNode (location: (120,7)-(120,11)) @@ -3069,6 +3180,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── pattern: │ │ @ TrueNode (location: (121,7)-(121,11)) @@ -3086,6 +3198,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── pattern: │ │ @ FalseNode (location: (122,7)-(122,12)) @@ -3103,6 +3216,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── pattern: │ │ @ SourceFileNode (location: (123,7)-(123,15)) @@ -3121,6 +3235,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── pattern: │ │ @ SourceLineNode (location: (124,7)-(124,15)) @@ -3138,6 +3253,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── pattern: │ │ @ SourceEncodingNode (location: (125,7)-(125,19)) @@ -3155,6 +3271,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── pattern: │ │ @ LambdaNode (location: (126,7)-(126,17)) @@ -3185,6 +3302,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── pattern: │ │ @ ArrayPatternNode (location: (127,7)-(127,11)) @@ -3214,6 +3332,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── conditions: (length: 1) │ │ └── @ InNode (location: (129,10)-(129,21)) @@ -3241,6 +3360,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── conditions: (length: 1) │ │ └── @ InNode (location: (130,10)-(130,19)) @@ -3267,6 +3387,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── conditions: (length: 1) │ │ └── @ InNode (location: (131,10)-(131,21)) @@ -3293,6 +3414,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── conditions: (length: 1) │ │ └── @ InNode (location: (132,10)-(132,20)) @@ -3322,6 +3444,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── conditions: (length: 1) │ │ └── @ InNode (location: (133,10)-(133,20)) @@ -3349,6 +3472,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── conditions: (length: 1) │ │ └── @ InNode (location: (134,10)-(134,22)) @@ -3378,6 +3502,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── conditions: (length: 1) │ │ └── @ InNode (location: (135,10)-(135,25)) @@ -3407,6 +3532,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── conditions: (length: 1) │ │ └── @ InNode (location: (136,10)-(136,24)) @@ -3436,6 +3562,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── conditions: (length: 1) │ │ └── @ InNode (location: (137,10)-(137,23)) @@ -3465,6 +3592,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── conditions: (length: 1) │ │ └── @ InNode (location: (138,10)-(138,23)) @@ -3494,6 +3622,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── conditions: (length: 1) │ │ └── @ InNode (location: (139,10)-(139,25)) @@ -3523,6 +3652,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── conditions: (length: 1) │ │ └── @ InNode (location: (140,10)-(140,25)) @@ -3557,6 +3687,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── conditions: (length: 1) │ │ └── @ InNode (location: (141,10)-(141,25)) @@ -3591,6 +3722,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── conditions: (length: 1) │ │ └── @ InNode (location: (142,10)-(142,25)) @@ -3625,6 +3757,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── conditions: (length: 1) │ │ └── @ InNode (location: (143,10)-(143,25)) @@ -3659,6 +3792,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── conditions: (length: 1) │ │ └── @ InNode (location: (144,10)-(144,25)) @@ -3688,6 +3822,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── conditions: (length: 1) │ │ └── @ InNode (location: (145,10)-(145,25)) @@ -3717,6 +3852,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── conditions: (length: 1) │ │ └── @ InNode (location: (146,10)-(146,23)) @@ -3746,6 +3882,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── conditions: (length: 1) │ │ └── @ InNode (location: (147,10)-(147,21)) @@ -3771,6 +3908,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── conditions: (length: 1) │ │ └── @ InNode (location: (148,10)-(148,22)) @@ -3796,6 +3934,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── conditions: (length: 1) │ │ └── @ InNode (location: (149,10)-(149,22)) @@ -3821,6 +3960,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── conditions: (length: 1) │ │ └── @ InNode (location: (150,10)-(150,23)) @@ -3846,6 +3986,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── conditions: (length: 1) │ │ └── @ InNode (location: (151,10)-(151,26)) @@ -3872,6 +4013,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── conditions: (length: 1) │ │ └── @ InNode (location: (152,10)-(152,26)) @@ -3897,6 +4039,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── conditions: (length: 1) │ │ └── @ InNode (location: (153,10)-(153,30)) @@ -3922,6 +4065,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── conditions: (length: 1) │ │ └── @ InNode (location: (154,10)-(154,28)) @@ -3960,6 +4104,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── conditions: (length: 1) │ │ └── @ InNode (location: (156,10)-(156,28)) @@ -4002,6 +4147,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── conditions: (length: 1) │ │ └── @ InNode (location: (157,10)-(157,26)) @@ -4043,6 +4189,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── conditions: (length: 1) │ │ └── @ InNode (location: (158,10)-(158,28)) @@ -4084,6 +4231,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── conditions: (length: 1) │ │ └── @ InNode (location: (159,10)-(159,27)) @@ -4128,6 +4276,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── conditions: (length: 1) │ │ └── @ InNode (location: (160,10)-(160,27)) @@ -4170,6 +4319,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── conditions: (length: 1) │ │ └── @ InNode (location: (161,10)-(161,29)) @@ -4214,6 +4364,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── conditions: (length: 1) │ │ └── @ InNode (location: (162,10)-(162,32)) @@ -4258,6 +4409,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── conditions: (length: 1) │ │ └── @ InNode (location: (163,10)-(163,31)) @@ -4302,6 +4454,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── conditions: (length: 1) │ │ └── @ InNode (location: (164,10)-(164,30)) @@ -4346,6 +4499,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── conditions: (length: 1) │ │ └── @ InNode (location: (165,10)-(165,30)) @@ -4390,6 +4544,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── conditions: (length: 1) │ │ └── @ InNode (location: (166,10)-(166,32)) @@ -4434,6 +4589,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── conditions: (length: 1) │ │ └── @ InNode (location: (167,10)-(167,32)) @@ -4483,6 +4639,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── conditions: (length: 1) │ │ └── @ InNode (location: (168,10)-(168,32)) @@ -4532,6 +4689,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── conditions: (length: 1) │ │ └── @ InNode (location: (169,10)-(169,32)) @@ -4581,6 +4739,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── conditions: (length: 1) │ │ └── @ InNode (location: (170,10)-(170,32)) @@ -4630,6 +4789,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── conditions: (length: 1) │ │ └── @ InNode (location: (171,10)-(171,32)) @@ -4674,6 +4834,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── conditions: (length: 1) │ │ └── @ InNode (location: (172,10)-(172,32)) @@ -4718,6 +4879,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── conditions: (length: 1) │ │ └── @ InNode (location: (173,10)-(173,30)) @@ -4762,6 +4924,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── conditions: (length: 1) │ │ └── @ InNode (location: (174,10)-(174,28)) @@ -4802,6 +4965,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── conditions: (length: 1) │ │ └── @ InNode (location: (175,10)-(175,29)) @@ -4842,6 +5006,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── conditions: (length: 1) │ │ └── @ InNode (location: (176,10)-(176,29)) @@ -4882,6 +5047,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── conditions: (length: 1) │ │ └── @ InNode (location: (177,10)-(177,30)) @@ -4922,6 +5088,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── conditions: (length: 1) │ │ └── @ InNode (location: (178,10)-(178,33)) @@ -4963,6 +5130,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── conditions: (length: 1) │ │ └── @ InNode (location: (179,10)-(179,33)) @@ -5003,6 +5171,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── conditions: (length: 1) │ │ └── @ InNode (location: (180,10)-(180,37)) @@ -5043,6 +5212,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── conditions: (length: 1) │ │ └── @ InNode (location: (181,10)-(181,35)) @@ -5100,6 +5270,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── pattern: │ │ │ @ ArrayPatternNode (location: (183,8)-(183,10)) @@ -5127,6 +5298,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── pattern: │ │ @ ArrayPatternNode (location: (186,5)-(188,1)) @@ -5154,6 +5326,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── pattern: │ │ @ HashPatternNode (location: (190,7)-(194,1)) @@ -5215,6 +5388,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── pattern: │ │ @ CapturePatternNode (location: (196,7)-(196,17)) @@ -5243,6 +5417,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── pattern: │ │ @ CapturePatternNode (location: (197,7)-(197,17)) @@ -5300,6 +5475,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (200,4)-(202,3)) │ ├── flags: ∅ @@ -5409,6 +5585,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (206,7)-(206,19)) │ ├── flags: ∅ @@ -5465,6 +5642,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CaseMatchNode (location: (213,0)-(213,25)) │ ├── flags: newline @@ -5641,6 +5819,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ └── operator_loc: (217,8)-(217,11) = "and" ├── @ OrNode (location: (218,0)-(218,12)) @@ -5679,6 +5858,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ └── operator_loc: (218,8)-(218,10) = "or" ├── @ AndNode (location: (219,0)-(219,15)) @@ -5725,6 +5905,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ └── operator_loc: (219,10)-(219,13) = "and" ├── @ OrNode (location: (220,0)-(220,14)) @@ -5771,6 +5952,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ └── operator_loc: (220,10)-(220,12) = "or" ├── @ MatchRequiredNode (location: (222,0)-(222,14)) @@ -5804,6 +5986,7 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ ├── opening_loc: (222,7)-(222,8) = "[" │ │ │ └── closing_loc: (222,12)-(222,13) = "]" @@ -5844,6 +6027,7 @@ │ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ │ ├── arguments: ∅ │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ ├── equal_loc: ∅ │ │ │ │ │ └── block: ∅ │ │ │ │ └── operator_loc: (223,8)-(223,10) = "**" │ │ │ ├── opening_loc: (223,7)-(223,8) = "[" diff --git a/snapshots/procs.txt b/snapshots/procs.txt index 6d554889bf..a52eb78484 100644 --- a/snapshots/procs.txt +++ b/snapshots/procs.txt @@ -123,6 +123,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ LambdaNode (location: (15,0)-(15,15)) │ ├── flags: newline @@ -144,6 +145,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ LambdaNode (location: (17,0)-(17,29)) │ ├── flags: newline @@ -408,6 +410,7 @@ │ │ ├── name: :b │ │ └── depth: 0 │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ └── @ LambdaNode (location: (27,0)-(27,19)) ├── flags: newline diff --git a/snapshots/ranges.txt b/snapshots/ranges.txt index 59af913fa4..5808698003 100644 --- a/snapshots/ranges.txt +++ b/snapshots/ranges.txt @@ -76,6 +76,7 @@ │ │ ├── opening_loc: (5,4)-(5,5) = "(" │ │ └── closing_loc: (5,11)-(5,12) = ")" │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ RangeNode (location: (7,0)-(7,5)) │ ├── flags: newline, static_literal, exclude_end @@ -100,6 +101,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: ∅ │ ├── name: :[] @@ -118,6 +120,7 @@ │ │ │ └── value: 2 │ │ └── operator_loc: (9,4)-(9,7) = "..." │ ├── closing_loc: (9,8)-(9,9) = "]" + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ HashNode (location: (11,0)-(11,15)) │ ├── flags: newline @@ -146,6 +149,7 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ └── operator_loc: (11,7)-(11,10) = "..." │ │ └── operator_loc: ∅ @@ -204,6 +208,7 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ └── operator_loc: (17,7)-(17,9) = ".." │ │ └── operator_loc: ∅ @@ -279,6 +284,7 @@ │ │ ├── flags: static_literal, decimal │ │ └── value: 2 │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (27,0)-(27,8)) │ ├── flags: newline @@ -303,6 +309,7 @@ │ │ ├── flags: static_literal, decimal │ │ └── value: 2 │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (29,0)-(29,9)) │ ├── flags: newline @@ -327,6 +334,7 @@ │ │ ├── flags: static_literal, decimal │ │ └── value: 2 │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (31,0)-(31,9)) │ ├── flags: newline @@ -351,6 +359,7 @@ │ │ ├── flags: static_literal, decimal │ │ └── value: 2 │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (33,0)-(33,8)) │ ├── flags: newline @@ -375,6 +384,7 @@ │ │ ├── flags: static_literal, decimal │ │ └── value: 2 │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (35,0)-(35,8)) │ ├── flags: newline @@ -399,6 +409,7 @@ │ │ ├── flags: static_literal, decimal │ │ └── value: 2 │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (37,0)-(37,7)) │ ├── flags: newline @@ -423,6 +434,7 @@ │ │ ├── flags: static_literal, decimal │ │ └── value: 2 │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (39,0)-(39,7)) │ ├── flags: newline @@ -447,6 +459,7 @@ │ │ ├── flags: static_literal, decimal │ │ └── value: 2 │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (41,0)-(41,8)) │ ├── flags: newline @@ -471,6 +484,7 @@ │ │ ├── flags: static_literal, decimal │ │ └── value: 2 │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (43,0)-(43,8)) │ ├── flags: newline @@ -495,6 +509,7 @@ │ │ ├── flags: static_literal, decimal │ │ └── value: 2 │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (45,0)-(45,8)) │ ├── flags: newline @@ -519,6 +534,7 @@ │ │ ├── flags: static_literal, decimal │ │ └── value: 2 │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (47,0)-(47,8)) │ ├── flags: newline @@ -543,6 +559,7 @@ │ │ ├── flags: static_literal, decimal │ │ └── value: 2 │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ RangeNode (location: (49,0)-(49,7)) │ ├── flags: newline @@ -563,6 +580,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ └── operator_loc: (49,1)-(49,3) = ".." └── @ RangeNode (location: (51,0)-(51,7)) @@ -584,5 +602,6 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ └── operator_loc: (51,1)-(51,3) = ".." diff --git a/snapshots/regex.txt b/snapshots/regex.txt index e8835648ee..b26c1dd78b 100644 --- a/snapshots/regex.txt +++ b/snapshots/regex.txt @@ -23,6 +23,7 @@ │ │ ├── closing_loc: (1,8)-(1,9) = "/" │ │ └── unescaped: "bar" │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ RegularExpressionNode (location: (3,0)-(3,8)) │ ├── flags: newline, static_literal, ignore_case, forced_us_ascii_encoding @@ -80,6 +81,7 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ └── closing_loc: (9,10)-(9,11) = "}" │ │ └── @ StringNode (location: (9,11)-(9,15)) @@ -121,8 +123,10 @@ │ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ │ ├── arguments: ∅ │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ ├── equal_loc: ∅ │ │ │ │ │ └── block: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ └── targets: (length: 1) │ │ │ └── @ LocalVariableTargetNode (location: (11,5)-(11,8)) @@ -189,6 +193,7 @@ │ │ ├── closing_loc: (26,15)-(26,16) = "\"" │ │ └── unescaped: "hi" │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ RegularExpressionNode (location: (28,0)-(28,9)) │ ├── flags: newline, static_literal, forced_us_ascii_encoding @@ -222,6 +227,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── closing_loc: (30,10)-(30,11) = "}" │ └── closing_loc: (30,11)-(30,13) = "/o" @@ -252,6 +258,7 @@ │ │ │ ├── closing_loc: (33,9)-(33,10) = "\"" │ │ │ └── unescaped: "" │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ └── targets: (length: 1) │ └── @ LocalVariableTargetNode (location: (32,0)-(33,4)) @@ -289,6 +296,7 @@ │ │ │ ├── closing_loc: (35,23)-(35,24) = "\"" │ │ │ └── unescaped: "" │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ └── targets: (length: 1) │ └── @ LocalVariableTargetNode (location: (35,4)-(35,7)) @@ -323,6 +331,7 @@ │ │ ├── closing_loc: (37,15)-(37,16) = "\"" │ │ └── unescaped: "" │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ LocalVariableWriteNode (location: (39,0)-(39,5)) │ ├── flags: newline @@ -343,6 +352,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (40,4)-(40,24)) │ ├── flags: ∅ @@ -381,8 +391,10 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── targets: (length: 1) │ │ └── @ LocalVariableTargetNode (location: (40,10)-(40,11)) @@ -418,6 +430,7 @@ │ │ │ ├── closing_loc: (42,15)-(42,16) = "\"" │ │ │ └── unescaped: "" │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ └── targets: (length: 1) │ └── @ LocalVariableTargetNode (location: (42,4)-(42,7)) @@ -448,6 +461,7 @@ │ │ ├── closing_loc: (43,15)-(43,16) = "\"" │ │ └── unescaped: "" │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (45,0)-(45,16)) │ ├── flags: newline @@ -473,6 +487,7 @@ │ │ ├── closing_loc: (45,15)-(45,16) = "\"" │ │ └── unescaped: "" │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ DefNode (location: (46,0)-(46,32)) │ ├── flags: newline @@ -524,6 +539,7 @@ │ │ │ │ ├── closing_loc: (46,31)-(46,32) = "\"" │ │ │ │ └── unescaped: "" │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── targets: (length: 1) │ │ └── @ LocalVariableTargetNode (location: (46,20)-(46,23)) diff --git a/snapshots/regex_char_width.txt b/snapshots/regex_char_width.txt index 664e4e8850..d08fe8dda7 100644 --- a/snapshots/regex_char_width.txt +++ b/snapshots/regex_char_width.txt @@ -32,6 +32,7 @@ │ │ │ ├── closing_loc: (2,35)-(2,36) = "'" │ │ │ └── unescaped: "\x{E285}\xA7a\x{E285}\xA9b" │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ └── targets: (length: 2) │ ├── @ LocalVariableTargetNode (location: (2,7)-(2,8)) diff --git a/snapshots/regex_escape_encoding.txt b/snapshots/regex_escape_encoding.txt index 0f2dcc2c54..ee073c6c58 100644 --- a/snapshots/regex_escape_encoding.txt +++ b/snapshots/regex_escape_encoding.txt @@ -40,4 +40,5 @@ │ ├── closing_loc: (3,20)-(3,21) = "/" │ └── unescaped: "hello \\u{fc}" ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/rescue.txt b/snapshots/rescue.txt index 6b20e6e5ce..0ee20ee218 100644 --- a/snapshots/rescue.txt +++ b/snapshots/rescue.txt @@ -17,6 +17,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── keyword_loc: (1,4)-(1,10) = "rescue" │ └── rescue_expression: @@ -34,6 +35,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── keyword_loc: (3,4)-(3,10) = "rescue" │ └── rescue_expression: @@ -48,6 +50,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (6,4)-(6,24)) │ ├── flags: ∅ @@ -79,6 +82,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (8,4)-(8,23)) │ ├── flags: ∅ @@ -124,6 +128,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── keyword_loc: (12,4)-(12,10) = "rescue" │ └── rescue_expression: @@ -149,6 +154,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── keyword_loc: (14,4)-(14,10) = "rescue" │ └── rescue_expression: @@ -195,6 +201,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── rescue_clause: │ │ @ RescueNode (location: (16,10)-(16,19)) @@ -214,6 +221,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── operator_loc: ∅ │ │ ├── reference: ∅ @@ -232,6 +240,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (18,4)-(20,3)) │ ├── flags: ∅ @@ -282,8 +291,10 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ ├── closing_loc: (19,7)-(19,8) = ")" + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── keyword_loc: (19,9)-(19,15) = "rescue" │ │ └── rescue_expression: @@ -316,8 +327,10 @@ │ │ │ │ ├── closing_loc: (19,39)-(19,40) = "\"" │ │ │ │ └── unescaped: "baz" │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── opening_loc: (18,4)-(18,6) = "do" │ └── closing_loc: (20,0)-(20,3) = "end" @@ -343,6 +356,7 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ ├── keyword_loc: (22,11)-(22,17) = "rescue" │ │ │ └── rescue_expression: @@ -363,6 +377,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── subsequent: ∅ │ └── end_keyword_loc: (24,0)-(24,3) = "end" @@ -394,6 +409,7 @@ │ │ │ │ ├── flags: static_literal, decimal │ │ │ │ └── value: 42 │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── keyword_loc: (26,34)-(26,40) = "rescue" │ │ └── rescue_expression: @@ -456,9 +472,11 @@ │ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ │ ├── arguments: ∅ │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ ├── equal_loc: ∅ │ │ │ │ │ └── block: ∅ │ │ │ │ └── operator_loc: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── rescue_clause: │ │ │ @ RescueNode (location: (30,0)-(30,6)) @@ -496,6 +514,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── then_keyword_loc: ∅ │ │ ├── statements: @@ -511,6 +530,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── subsequent: ∅ │ │ └── end_keyword_loc: ∅ @@ -525,6 +545,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ LocalVariableWriteNode (location: (35,0)-(35,18)) │ ├── flags: newline @@ -555,8 +576,10 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── keyword_loc: (35,8)-(35,14) = "rescue" │ │ └── rescue_expression: @@ -580,8 +603,10 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ └── operator_loc: (35,2)-(35,3) = "=" └── @ BeginNode (location: (37,0)-(39,3)) diff --git a/snapshots/rescue_modifier.txt b/snapshots/rescue_modifier.txt index 0a27a3bb49..c6d6e67ef2 100644 --- a/snapshots/rescue_modifier.txt +++ b/snapshots/rescue_modifier.txt @@ -18,6 +18,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── then_keyword_loc: ∅ │ ├── statements: @@ -36,6 +37,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── keyword_loc: (1,2)-(1,8) = "rescue" │ │ └── rescue_expression: @@ -48,6 +50,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── subsequent: ∅ │ └── end_keyword_loc: ∅ @@ -64,6 +67,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── then_keyword_loc: ∅ │ ├── statements: @@ -88,6 +92,7 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ ├── keyword_loc: (3,6)-(3,12) = "rescue" │ │ │ └── rescue_expression: @@ -100,6 +105,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── operator_loc: (3,2)-(3,3) = "=" │ ├── subsequent: ∅ @@ -117,6 +123,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── then_keyword_loc: ∅ │ ├── statements: @@ -150,6 +157,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── keyword_loc: (5,7)-(5,13) = "rescue" │ │ └── rescue_expression: @@ -162,6 +170,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── subsequent: ∅ │ └── end_keyword_loc: ∅ @@ -178,6 +187,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── then_keyword_loc: ∅ ├── statements: @@ -206,6 +216,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── keyword_loc: (7,10)-(7,16) = "rescue" │ │ └── rescue_expression: @@ -218,6 +229,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── locals: [] │ ├── def_keyword_loc: (7,0)-(7,3) = "def" diff --git a/snapshots/return.txt b/snapshots/return.txt index 6fb103e99c..25d43e00e1 100644 --- a/snapshots/return.txt +++ b/snapshots/return.txt @@ -207,6 +207,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── right: │ @ ParenthesesNode (location: (27,7)-(27,17)) diff --git a/snapshots/seattlerb/TestRubyParserShared.txt b/snapshots/seattlerb/TestRubyParserShared.txt index 7a488a20aa..548b112dde 100644 --- a/snapshots/seattlerb/TestRubyParserShared.txt +++ b/snapshots/seattlerb/TestRubyParserShared.txt @@ -177,6 +177,7 @@ │ │ │ │ ├── name: :b │ │ │ │ └── depth: 0 │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── locals: [:a, :b] │ │ ├── def_keyword_loc: (52,2)-(52,5) = "def" @@ -287,6 +288,7 @@ │ │ │ │ ├── name: :b │ │ │ │ └── depth: 0 │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── locals: [:a, :b] │ │ ├── def_keyword_loc: (67,2)-(67,5) = "def" @@ -395,4 +397,5 @@ │ ├── closing_loc: ∅ │ └── unescaped: "line3" ├── closing_loc: (92,0)-(92,1) = ")" + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/seattlerb/and_multi.txt b/snapshots/seattlerb/and_multi.txt index f98ad67e10..a32921fa07 100644 --- a/snapshots/seattlerb/and_multi.txt +++ b/snapshots/seattlerb/and_multi.txt @@ -25,6 +25,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ └── operator_loc: (1,5)-(1,8) = "and" ├── right: diff --git a/snapshots/seattlerb/array_lits_trailing_calls.txt b/snapshots/seattlerb/array_lits_trailing_calls.txt index 2de5a054a6..08c95ac88b 100644 --- a/snapshots/seattlerb/array_lits_trailing_calls.txt +++ b/snapshots/seattlerb/array_lits_trailing_calls.txt @@ -19,6 +19,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ └── @ CallNode (location: (3,0)-(3,4)) ├── flags: newline @@ -34,4 +35,5 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/seattlerb/assoc__bare.txt b/snapshots/seattlerb/assoc__bare.txt index 530360ef66..72d8f387a5 100644 --- a/snapshots/seattlerb/assoc__bare.txt +++ b/snapshots/seattlerb/assoc__bare.txt @@ -31,6 +31,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ └── operator_loc: ∅ └── closing_loc: (1,5)-(1,6) = "}" diff --git a/snapshots/seattlerb/assoc_label.txt b/snapshots/seattlerb/assoc_label.txt index 91b94bbc1c..ae9fc3a318 100644 --- a/snapshots/seattlerb/assoc_label.txt +++ b/snapshots/seattlerb/assoc_label.txt @@ -34,4 +34,5 @@ │ │ └── value: 1 │ └── operator_loc: ∅ ├── closing_loc: (1,5)-(1,6) = ")" + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/seattlerb/attr_asgn_colon_id.txt b/snapshots/seattlerb/attr_asgn_colon_id.txt index 67802fc8a4..9e2c641649 100644 --- a/snapshots/seattlerb/attr_asgn_colon_id.txt +++ b/snapshots/seattlerb/attr_asgn_colon_id.txt @@ -23,4 +23,5 @@ │ ├── flags: static_literal, decimal │ └── value: 1 ├── closing_loc: ∅ + ├── equal_loc: (1,5)-(1,6) = "=" └── block: ∅ diff --git a/snapshots/seattlerb/attrasgn_array_arg.txt b/snapshots/seattlerb/attrasgn_array_arg.txt index 43853b4ef9..e5224e9353 100644 --- a/snapshots/seattlerb/attrasgn_array_arg.txt +++ b/snapshots/seattlerb/attrasgn_array_arg.txt @@ -17,6 +17,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── call_operator_loc: ∅ ├── name: :[]= @@ -41,4 +42,5 @@ │ ├── flags: static_literal, decimal │ └── value: 3 ├── closing_loc: (1,8)-(1,9) = "]" + ├── equal_loc: (1,10)-(1,11) = "=" └── block: ∅ diff --git a/snapshots/seattlerb/attrasgn_array_lhs.txt b/snapshots/seattlerb/attrasgn_array_lhs.txt index 5729407edc..1cc64d3e07 100644 --- a/snapshots/seattlerb/attrasgn_array_lhs.txt +++ b/snapshots/seattlerb/attrasgn_array_lhs.txt @@ -45,6 +45,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── right: │ │ │ @ CallNode (location: (1,21)-(1,23)) @@ -56,6 +57,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── operator_loc: (1,18)-(1,20) = ".." │ └── @ ArrayNode (location: (1,27)-(1,42)) @@ -82,4 +84,5 @@ │ ├── opening_loc: (1,27)-(1,28) = "[" │ └── closing_loc: (1,41)-(1,42) = "]" ├── closing_loc: (1,23)-(1,24) = "]" + ├── equal_loc: (1,25)-(1,26) = "=" └── block: ∅ diff --git a/snapshots/seattlerb/attrasgn_primary_dot_constant.txt b/snapshots/seattlerb/attrasgn_primary_dot_constant.txt index 2c06df2609..299bfe79d8 100644 --- a/snapshots/seattlerb/attrasgn_primary_dot_constant.txt +++ b/snapshots/seattlerb/attrasgn_primary_dot_constant.txt @@ -17,6 +17,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── call_operator_loc: (1,1)-(1,2) = "." ├── name: :B= @@ -30,4 +31,5 @@ │ ├── flags: static_literal, decimal │ └── value: 1 ├── closing_loc: ∅ + ├── equal_loc: (1,4)-(1,5) = "=" └── block: ∅ diff --git a/snapshots/seattlerb/backticks_interpolation_line.txt b/snapshots/seattlerb/backticks_interpolation_line.txt index 8c6a163c48..d18aef6139 100644 --- a/snapshots/seattlerb/backticks_interpolation_line.txt +++ b/snapshots/seattlerb/backticks_interpolation_line.txt @@ -36,8 +36,10 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── closing_loc: (1,6)-(1,7) = "}" │ └── closing_loc: (1,7)-(1,8) = "`" ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/seattlerb/bang_eq.txt b/snapshots/seattlerb/bang_eq.txt index 6bbd4a6ea2..5a534501f3 100644 --- a/snapshots/seattlerb/bang_eq.txt +++ b/snapshots/seattlerb/bang_eq.txt @@ -23,4 +23,5 @@ │ ├── flags: static_literal, decimal │ └── value: 2 ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/seattlerb/bdot2.txt b/snapshots/seattlerb/bdot2.txt index b1c05c0fc4..fb363fc4d9 100644 --- a/snapshots/seattlerb/bdot2.txt +++ b/snapshots/seattlerb/bdot2.txt @@ -26,6 +26,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ └── operator_loc: (2,2)-(2,4) = ".." └── @ CallNode (location: (3,2)-(3,3)) @@ -37,4 +38,5 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/seattlerb/bdot3.txt b/snapshots/seattlerb/bdot3.txt index 0b35268f19..08df7f22f0 100644 --- a/snapshots/seattlerb/bdot3.txt +++ b/snapshots/seattlerb/bdot3.txt @@ -26,6 +26,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ └── operator_loc: (2,2)-(2,5) = "..." └── @ CallNode (location: (3,2)-(3,3)) @@ -37,4 +38,5 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/seattlerb/block_arg_kwsplat.txt b/snapshots/seattlerb/block_arg_kwsplat.txt index 20756c8378..671338da94 100644 --- a/snapshots/seattlerb/block_arg_kwsplat.txt +++ b/snapshots/seattlerb/block_arg_kwsplat.txt @@ -14,6 +14,7 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: @ BlockNode (location: (1,2)-(1,11)) ├── flags: ∅ diff --git a/snapshots/seattlerb/block_arg_opt_arg_block.txt b/snapshots/seattlerb/block_arg_opt_arg_block.txt index dd89df907d..f04012b531 100644 --- a/snapshots/seattlerb/block_arg_opt_arg_block.txt +++ b/snapshots/seattlerb/block_arg_opt_arg_block.txt @@ -14,6 +14,7 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: @ BlockNode (location: (1,2)-(1,21)) ├── flags: ∅ diff --git a/snapshots/seattlerb/block_arg_opt_splat.txt b/snapshots/seattlerb/block_arg_opt_splat.txt index cefc1a8515..0d4308afc5 100644 --- a/snapshots/seattlerb/block_arg_opt_splat.txt +++ b/snapshots/seattlerb/block_arg_opt_splat.txt @@ -14,6 +14,7 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: @ BlockNode (location: (1,2)-(1,20)) ├── flags: ∅ diff --git a/snapshots/seattlerb/block_arg_opt_splat_arg_block_omfg.txt b/snapshots/seattlerb/block_arg_opt_splat_arg_block_omfg.txt index bf66e376fd..a8c6ba341e 100644 --- a/snapshots/seattlerb/block_arg_opt_splat_arg_block_omfg.txt +++ b/snapshots/seattlerb/block_arg_opt_splat_arg_block_omfg.txt @@ -14,6 +14,7 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: @ BlockNode (location: (1,2)-(1,25)) ├── flags: ∅ diff --git a/snapshots/seattlerb/block_arg_optional.txt b/snapshots/seattlerb/block_arg_optional.txt index 5fecfc31ab..99f2449a0c 100644 --- a/snapshots/seattlerb/block_arg_optional.txt +++ b/snapshots/seattlerb/block_arg_optional.txt @@ -14,6 +14,7 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: @ BlockNode (location: (1,2)-(1,13)) ├── flags: ∅ diff --git a/snapshots/seattlerb/block_arg_scope.txt b/snapshots/seattlerb/block_arg_scope.txt index e90d6445b2..ccdb3c6aa2 100644 --- a/snapshots/seattlerb/block_arg_scope.txt +++ b/snapshots/seattlerb/block_arg_scope.txt @@ -14,6 +14,7 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: @ BlockNode (location: (1,2)-(1,12)) ├── flags: ∅ diff --git a/snapshots/seattlerb/block_arg_scope2.txt b/snapshots/seattlerb/block_arg_scope2.txt index c9f7242d8a..a3874e6311 100644 --- a/snapshots/seattlerb/block_arg_scope2.txt +++ b/snapshots/seattlerb/block_arg_scope2.txt @@ -14,6 +14,7 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: @ BlockNode (location: (1,2)-(1,14)) ├── flags: ∅ diff --git a/snapshots/seattlerb/block_arg_splat_arg.txt b/snapshots/seattlerb/block_arg_splat_arg.txt index 6ae1b1dade..4865dc04b2 100644 --- a/snapshots/seattlerb/block_arg_splat_arg.txt +++ b/snapshots/seattlerb/block_arg_splat_arg.txt @@ -14,6 +14,7 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: @ BlockNode (location: (1,2)-(1,16)) ├── flags: ∅ diff --git a/snapshots/seattlerb/block_args_kwargs.txt b/snapshots/seattlerb/block_args_kwargs.txt index 45876c6dc1..3b1ea21611 100644 --- a/snapshots/seattlerb/block_args_kwargs.txt +++ b/snapshots/seattlerb/block_args_kwargs.txt @@ -14,6 +14,7 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: @ BlockNode (location: (1,2)-(1,23)) ├── flags: ∅ diff --git a/snapshots/seattlerb/block_args_no_kwargs.txt b/snapshots/seattlerb/block_args_no_kwargs.txt index 298bc26ce0..e1e997d8cf 100644 --- a/snapshots/seattlerb/block_args_no_kwargs.txt +++ b/snapshots/seattlerb/block_args_no_kwargs.txt @@ -14,6 +14,7 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: @ BlockNode (location: (1,2)-(1,13)) ├── flags: ∅ diff --git a/snapshots/seattlerb/block_args_opt1.txt b/snapshots/seattlerb/block_args_opt1.txt index d23bd5edce..151f34188a 100644 --- a/snapshots/seattlerb/block_args_opt1.txt +++ b/snapshots/seattlerb/block_args_opt1.txt @@ -14,6 +14,7 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: @ BlockNode (location: (1,2)-(1,24)) ├── flags: ∅ diff --git a/snapshots/seattlerb/block_args_opt2.txt b/snapshots/seattlerb/block_args_opt2.txt index 7170768b1c..b8bc9bc343 100644 --- a/snapshots/seattlerb/block_args_opt2.txt +++ b/snapshots/seattlerb/block_args_opt2.txt @@ -14,6 +14,7 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: @ BlockNode (location: (1,2)-(1,18)) ├── flags: ∅ diff --git a/snapshots/seattlerb/block_args_opt2_2.txt b/snapshots/seattlerb/block_args_opt2_2.txt index 34d04dbe54..5c36d15e1b 100644 --- a/snapshots/seattlerb/block_args_opt2_2.txt +++ b/snapshots/seattlerb/block_args_opt2_2.txt @@ -14,6 +14,7 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: @ BlockNode (location: (1,2)-(1,35)) ├── flags: ∅ diff --git a/snapshots/seattlerb/block_args_opt3.txt b/snapshots/seattlerb/block_args_opt3.txt index 508d062ce2..229e05b02f 100644 --- a/snapshots/seattlerb/block_args_opt3.txt +++ b/snapshots/seattlerb/block_args_opt3.txt @@ -14,6 +14,7 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: @ BlockNode (location: (1,2)-(1,42)) ├── flags: ∅ diff --git a/snapshots/seattlerb/block_call_defn_call_block_call.txt b/snapshots/seattlerb/block_call_defn_call_block_call.txt index 4e6ad90afd..93d74188bc 100644 --- a/snapshots/seattlerb/block_call_defn_call_block_call.txt +++ b/snapshots/seattlerb/block_call_defn_call_block_call.txt @@ -47,6 +47,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── locals: [:c] │ │ ├── def_keyword_loc: (1,2)-(1,5) = "def" @@ -56,6 +57,7 @@ │ │ ├── equal_loc: ∅ │ │ └── end_keyword_loc: (3,1)-(3,4) = "end" │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ └── @ CallNode (location: (4,1)-(4,11)) ├── flags: newline @@ -69,6 +71,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── call_operator_loc: (4,2)-(4,3) = "." ├── name: :f @@ -76,6 +79,7 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: @ BlockNode (location: (4,5)-(4,11)) ├── flags: ∅ diff --git a/snapshots/seattlerb/block_call_dot_op2_brace_block.txt b/snapshots/seattlerb/block_call_dot_op2_brace_block.txt index 5f05b1f6ff..ff837f9de2 100644 --- a/snapshots/seattlerb/block_call_dot_op2_brace_block.txt +++ b/snapshots/seattlerb/block_call_dot_op2_brace_block.txt @@ -20,6 +20,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: (1,1)-(1,2) = "." │ ├── name: :b @@ -38,8 +39,10 @@ │ │ ├── opening_loc: (1,5)-(1,6) = "(" │ │ ├── arguments: ∅ │ │ ├── closing_loc: (1,6)-(1,7) = ")" + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (1,8)-(1,16)) │ ├── flags: ∅ @@ -58,6 +61,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── opening_loc: (1,8)-(1,10) = "do" │ └── closing_loc: (1,13)-(1,16) = "end" @@ -67,6 +71,7 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: @ BlockNode (location: (1,19)-(1,31)) ├── flags: ∅ @@ -103,6 +108,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── opening_loc: (1,19)-(1,21) = "do" └── closing_loc: (1,28)-(1,31) = "end" diff --git a/snapshots/seattlerb/block_call_dot_op2_cmd_args_do_block.txt b/snapshots/seattlerb/block_call_dot_op2_cmd_args_do_block.txt index ca141580b7..f55ce46120 100644 --- a/snapshots/seattlerb/block_call_dot_op2_cmd_args_do_block.txt +++ b/snapshots/seattlerb/block_call_dot_op2_cmd_args_do_block.txt @@ -20,6 +20,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: (1,1)-(1,2) = "." │ ├── name: :b @@ -38,8 +39,10 @@ │ │ ├── opening_loc: (1,5)-(1,6) = "(" │ │ ├── arguments: ∅ │ │ ├── closing_loc: (1,6)-(1,7) = ")" + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (1,8)-(1,16)) │ ├── flags: ∅ @@ -58,6 +61,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── opening_loc: (1,8)-(1,10) = "do" │ └── closing_loc: (1,13)-(1,16) = "end" @@ -78,8 +82,10 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: @ BlockNode (location: (1,21)-(1,33)) ├── flags: ∅ @@ -116,6 +122,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── opening_loc: (1,21)-(1,23) = "do" └── closing_loc: (1,30)-(1,33) = "end" diff --git a/snapshots/seattlerb/block_call_operation_colon.txt b/snapshots/seattlerb/block_call_operation_colon.txt index cecd421263..6c1740536f 100644 --- a/snapshots/seattlerb/block_call_operation_colon.txt +++ b/snapshots/seattlerb/block_call_operation_colon.txt @@ -20,6 +20,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: (1,1)-(1,2) = "." │ ├── name: :b @@ -38,8 +39,10 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (1,6)-(1,12)) │ ├── flags: ∅ @@ -54,4 +57,5 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/seattlerb/block_call_operation_dot.txt b/snapshots/seattlerb/block_call_operation_dot.txt index 5c661fb49a..09f19632ad 100644 --- a/snapshots/seattlerb/block_call_operation_dot.txt +++ b/snapshots/seattlerb/block_call_operation_dot.txt @@ -20,6 +20,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: (1,1)-(1,2) = "." │ ├── name: :b @@ -38,8 +39,10 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (1,6)-(1,12)) │ ├── flags: ∅ @@ -54,4 +57,5 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/seattlerb/block_call_paren_call_block_call.txt b/snapshots/seattlerb/block_call_paren_call_block_call.txt index 93c4b05f9b..3fb5905a4c 100644 --- a/snapshots/seattlerb/block_call_paren_call_block_call.txt +++ b/snapshots/seattlerb/block_call_paren_call_block_call.txt @@ -31,10 +31,12 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── opening_loc: (1,2)-(1,3) = "(" │ │ └── closing_loc: (1,4)-(1,5) = ")" │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ └── @ CallNode (location: (2,0)-(2,10)) ├── flags: newline @@ -48,6 +50,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── call_operator_loc: (2,1)-(2,2) = "." ├── name: :d @@ -55,6 +58,7 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: @ BlockNode (location: (2,4)-(2,10)) ├── flags: ∅ diff --git a/snapshots/seattlerb/block_command_operation_colon.txt b/snapshots/seattlerb/block_command_operation_colon.txt index c71fbe2f4a..c40d5108ac 100644 --- a/snapshots/seattlerb/block_command_operation_colon.txt +++ b/snapshots/seattlerb/block_command_operation_colon.txt @@ -26,6 +26,7 @@ │ │ ├── closing_loc: ∅ │ │ └── unescaped: "b" │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (1,5)-(1,11)) │ ├── flags: ∅ @@ -49,4 +50,5 @@ │ ├── closing_loc: ∅ │ └── unescaped: "d" ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/seattlerb/block_command_operation_dot.txt b/snapshots/seattlerb/block_command_operation_dot.txt index 68d98c99b4..cd04ccd4ef 100644 --- a/snapshots/seattlerb/block_command_operation_dot.txt +++ b/snapshots/seattlerb/block_command_operation_dot.txt @@ -26,6 +26,7 @@ │ │ ├── closing_loc: ∅ │ │ └── unescaped: "b" │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (1,5)-(1,11)) │ ├── flags: ∅ @@ -49,4 +50,5 @@ │ ├── closing_loc: ∅ │ └── unescaped: "d" ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/seattlerb/block_decomp_anon_splat_arg.txt b/snapshots/seattlerb/block_decomp_anon_splat_arg.txt index 5628cacc97..4b3b985e52 100644 --- a/snapshots/seattlerb/block_decomp_anon_splat_arg.txt +++ b/snapshots/seattlerb/block_decomp_anon_splat_arg.txt @@ -14,6 +14,7 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: @ BlockNode (location: (1,2)-(1,14)) ├── flags: ∅ diff --git a/snapshots/seattlerb/block_decomp_arg_splat.txt b/snapshots/seattlerb/block_decomp_arg_splat.txt index b13e13d167..55a55081a9 100644 --- a/snapshots/seattlerb/block_decomp_arg_splat.txt +++ b/snapshots/seattlerb/block_decomp_arg_splat.txt @@ -14,6 +14,7 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: @ BlockNode (location: (1,2)-(1,14)) ├── flags: ∅ diff --git a/snapshots/seattlerb/block_decomp_arg_splat_arg.txt b/snapshots/seattlerb/block_decomp_arg_splat_arg.txt index ba0a6202ce..abf6412b1c 100644 --- a/snapshots/seattlerb/block_decomp_arg_splat_arg.txt +++ b/snapshots/seattlerb/block_decomp_arg_splat_arg.txt @@ -14,6 +14,7 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: @ BlockNode (location: (1,2)-(1,18)) ├── flags: ∅ diff --git a/snapshots/seattlerb/block_decomp_splat.txt b/snapshots/seattlerb/block_decomp_splat.txt index fd8ad4bda1..1ebce5f29a 100644 --- a/snapshots/seattlerb/block_decomp_splat.txt +++ b/snapshots/seattlerb/block_decomp_splat.txt @@ -14,6 +14,7 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: @ BlockNode (location: (1,2)-(1,12)) ├── flags: ∅ diff --git a/snapshots/seattlerb/block_kw.txt b/snapshots/seattlerb/block_kw.txt index d76998ecb6..b68e4409b7 100644 --- a/snapshots/seattlerb/block_kw.txt +++ b/snapshots/seattlerb/block_kw.txt @@ -14,6 +14,7 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: @ BlockNode (location: (1,5)-(1,15)) ├── flags: ∅ diff --git a/snapshots/seattlerb/block_kw__required.txt b/snapshots/seattlerb/block_kw__required.txt index f04987d854..b7e56e6907 100644 --- a/snapshots/seattlerb/block_kw__required.txt +++ b/snapshots/seattlerb/block_kw__required.txt @@ -14,6 +14,7 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: @ BlockNode (location: (1,5)-(1,16)) ├── flags: ∅ diff --git a/snapshots/seattlerb/block_kwarg_lvar.txt b/snapshots/seattlerb/block_kwarg_lvar.txt index 861348f2a2..74e1034aad 100644 --- a/snapshots/seattlerb/block_kwarg_lvar.txt +++ b/snapshots/seattlerb/block_kwarg_lvar.txt @@ -14,6 +14,7 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: @ BlockNode (location: (1,3)-(1,20)) ├── flags: ∅ diff --git a/snapshots/seattlerb/block_kwarg_lvar_multiple.txt b/snapshots/seattlerb/block_kwarg_lvar_multiple.txt index f1c1fef8a3..b3649eae6d 100644 --- a/snapshots/seattlerb/block_kwarg_lvar_multiple.txt +++ b/snapshots/seattlerb/block_kwarg_lvar_multiple.txt @@ -14,6 +14,7 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: @ BlockNode (location: (1,3)-(1,33)) ├── flags: ∅ diff --git a/snapshots/seattlerb/block_opt_arg.txt b/snapshots/seattlerb/block_opt_arg.txt index 39be11ac92..f1df1ff429 100644 --- a/snapshots/seattlerb/block_opt_arg.txt +++ b/snapshots/seattlerb/block_opt_arg.txt @@ -14,6 +14,7 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: @ BlockNode (location: (1,2)-(1,14)) ├── flags: ∅ diff --git a/snapshots/seattlerb/block_opt_splat.txt b/snapshots/seattlerb/block_opt_splat.txt index 3898212dc0..9cb8ab91e5 100644 --- a/snapshots/seattlerb/block_opt_splat.txt +++ b/snapshots/seattlerb/block_opt_splat.txt @@ -14,6 +14,7 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: @ BlockNode (location: (1,2)-(1,17)) ├── flags: ∅ diff --git a/snapshots/seattlerb/block_opt_splat_arg_block_omfg.txt b/snapshots/seattlerb/block_opt_splat_arg_block_omfg.txt index ed4857ad25..b79bebf6d6 100644 --- a/snapshots/seattlerb/block_opt_splat_arg_block_omfg.txt +++ b/snapshots/seattlerb/block_opt_splat_arg_block_omfg.txt @@ -14,6 +14,7 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: @ BlockNode (location: (1,2)-(1,22)) ├── flags: ∅ diff --git a/snapshots/seattlerb/block_optarg.txt b/snapshots/seattlerb/block_optarg.txt index 2172571eb1..76ff4779d6 100644 --- a/snapshots/seattlerb/block_optarg.txt +++ b/snapshots/seattlerb/block_optarg.txt @@ -14,6 +14,7 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: @ BlockNode (location: (1,2)-(1,14)) ├── flags: ∅ diff --git a/snapshots/seattlerb/block_paren_splat.txt b/snapshots/seattlerb/block_paren_splat.txt index b6c2da679b..fafe9fd1b2 100644 --- a/snapshots/seattlerb/block_paren_splat.txt +++ b/snapshots/seattlerb/block_paren_splat.txt @@ -14,6 +14,7 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: @ BlockNode (location: (1,2)-(1,15)) ├── flags: ∅ diff --git a/snapshots/seattlerb/block_reg_optarg.txt b/snapshots/seattlerb/block_reg_optarg.txt index 0173b92e8f..82a4d1c87d 100644 --- a/snapshots/seattlerb/block_reg_optarg.txt +++ b/snapshots/seattlerb/block_reg_optarg.txt @@ -14,6 +14,7 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: @ BlockNode (location: (1,2)-(1,17)) ├── flags: ∅ diff --git a/snapshots/seattlerb/block_return.txt b/snapshots/seattlerb/block_return.txt index 0eee33c844..d0528da318 100644 --- a/snapshots/seattlerb/block_return.txt +++ b/snapshots/seattlerb/block_return.txt @@ -32,8 +32,10 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: @ BlockNode (location: (1,15)-(1,27)) ├── flags: ∅ diff --git a/snapshots/seattlerb/block_scope.txt b/snapshots/seattlerb/block_scope.txt index ef659bb38e..24e701d566 100644 --- a/snapshots/seattlerb/block_scope.txt +++ b/snapshots/seattlerb/block_scope.txt @@ -14,6 +14,7 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: @ BlockNode (location: (1,2)-(1,10)) ├── flags: ∅ diff --git a/snapshots/seattlerb/block_splat_reg.txt b/snapshots/seattlerb/block_splat_reg.txt index b5eb009c52..453132bb12 100644 --- a/snapshots/seattlerb/block_splat_reg.txt +++ b/snapshots/seattlerb/block_splat_reg.txt @@ -14,6 +14,7 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: @ BlockNode (location: (1,2)-(1,13)) ├── flags: ∅ diff --git a/snapshots/seattlerb/bug169.txt b/snapshots/seattlerb/bug169.txt index c55df4257d..66862b9211 100644 --- a/snapshots/seattlerb/bug169.txt +++ b/snapshots/seattlerb/bug169.txt @@ -22,6 +22,7 @@ │ ├── opening_loc: (1,2)-(1,3) = "(" │ └── closing_loc: (1,3)-(1,4) = ")" ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: @ BlockNode (location: (1,5)-(1,7)) ├── flags: ∅ diff --git a/snapshots/seattlerb/bug179.txt b/snapshots/seattlerb/bug179.txt index 4392d5ec27..99c541c247 100644 --- a/snapshots/seattlerb/bug179.txt +++ b/snapshots/seattlerb/bug179.txt @@ -29,4 +29,5 @@ │ │ └── flags: static_literal │ └── operator_loc: (1,4)-(1,6) = ".." ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/seattlerb/bug191.txt b/snapshots/seattlerb/bug191.txt index 27b7f97f45..ec99bd73e2 100644 --- a/snapshots/seattlerb/bug191.txt +++ b/snapshots/seattlerb/bug191.txt @@ -18,6 +18,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── then_keyword_loc: (1,2)-(1,3) = "?" │ ├── statements: @@ -47,6 +48,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── end_keyword_loc: ∅ │ └── end_keyword_loc: ∅ @@ -63,6 +65,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── then_keyword_loc: (3,2)-(3,3) = "?" ├── statements: @@ -92,6 +95,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ └── end_keyword_loc: ∅ └── end_keyword_loc: ∅ diff --git a/snapshots/seattlerb/bug236.txt b/snapshots/seattlerb/bug236.txt index 792020dc78..fc93297fe1 100644 --- a/snapshots/seattlerb/bug236.txt +++ b/snapshots/seattlerb/bug236.txt @@ -14,6 +14,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (1,1)-(1,7)) │ ├── flags: ∅ @@ -51,6 +52,7 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: @ BlockNode (location: (3,1)-(3,6)) ├── flags: ∅ diff --git a/snapshots/seattlerb/bug290.txt b/snapshots/seattlerb/bug290.txt index 85d75c0d16..2460ec80bb 100644 --- a/snapshots/seattlerb/bug290.txt +++ b/snapshots/seattlerb/bug290.txt @@ -21,6 +21,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── rescue_clause: ∅ ├── else_clause: ∅ diff --git a/snapshots/seattlerb/bug_187.txt b/snapshots/seattlerb/bug_187.txt index 6a5786e34a..489556c6f5 100644 --- a/snapshots/seattlerb/bug_187.txt +++ b/snapshots/seattlerb/bug_187.txt @@ -38,6 +38,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── call_operator_loc: (2,1)-(2,2) = "." │ │ ├── name: :b @@ -45,6 +46,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: │ │ @ BlockNode (location: (2,4)-(2,10)) │ │ ├── flags: ∅ @@ -61,4 +63,5 @@ │ ├── equal_loc: ∅ │ └── end_keyword_loc: (3,0)-(3,3) = "end" ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/seattlerb/bug_249.txt b/snapshots/seattlerb/bug_249.txt index 06daa80e41..2cd226915e 100644 --- a/snapshots/seattlerb/bug_249.txt +++ b/snapshots/seattlerb/bug_249.txt @@ -37,6 +37,7 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: │ │ │ │ @ BlockNode (location: (1,17)-(4,4)) │ │ │ │ ├── flags: ∅ @@ -70,6 +71,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ └── @ KeywordHashNode (location: (4,11)-(4,28)) │ ├── flags: symbol_keys @@ -92,4 +94,5 @@ │ │ └── unescaped: "endpoint" │ └── operator_loc: (4,15)-(4,17) = "=>" ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/seattlerb/bug_args__19.txt b/snapshots/seattlerb/bug_args__19.txt index 5b1d897718..55eb1b8787 100644 --- a/snapshots/seattlerb/bug_args__19.txt +++ b/snapshots/seattlerb/bug_args__19.txt @@ -14,6 +14,7 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: @ BlockNode (location: (1,2)-(1,16)) ├── flags: ∅ @@ -60,6 +61,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── opening_loc: (1,2)-(1,3) = "{" └── closing_loc: (1,15)-(1,16) = "}" diff --git a/snapshots/seattlerb/bug_args_masgn.txt b/snapshots/seattlerb/bug_args_masgn.txt index 6456d82ecc..9914cbb1dc 100644 --- a/snapshots/seattlerb/bug_args_masgn.txt +++ b/snapshots/seattlerb/bug_args_masgn.txt @@ -14,6 +14,7 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: @ BlockNode (location: (1,2)-(1,17)) ├── flags: ∅ diff --git a/snapshots/seattlerb/bug_args_masgn2.txt b/snapshots/seattlerb/bug_args_masgn2.txt index bd9fc61161..ecb608247a 100644 --- a/snapshots/seattlerb/bug_args_masgn2.txt +++ b/snapshots/seattlerb/bug_args_masgn2.txt @@ -14,6 +14,7 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: @ BlockNode (location: (1,2)-(1,22)) ├── flags: ∅ diff --git a/snapshots/seattlerb/bug_args_masgn_outer_parens__19.txt b/snapshots/seattlerb/bug_args_masgn_outer_parens__19.txt index ad62bd4daa..8801adffa9 100644 --- a/snapshots/seattlerb/bug_args_masgn_outer_parens__19.txt +++ b/snapshots/seattlerb/bug_args_masgn_outer_parens__19.txt @@ -14,6 +14,7 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: @ BlockNode (location: (1,2)-(1,19)) ├── flags: ∅ diff --git a/snapshots/seattlerb/bug_call_arglist_parens.txt b/snapshots/seattlerb/bug_call_arglist_parens.txt index 6954854bae..28a3eafb84 100644 --- a/snapshots/seattlerb/bug_call_arglist_parens.txt +++ b/snapshots/seattlerb/bug_call_arglist_parens.txt @@ -41,6 +41,7 @@ │ │ │ ├── flags: static_literal, decimal │ │ │ └── value: 2 │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── locals: [] │ ├── def_keyword_loc: (1,6)-(1,9) = "def" @@ -85,6 +86,7 @@ │ │ │ ├── flags: static_literal, decimal │ │ │ └── value: 2 │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── locals: [] │ ├── def_keyword_loc: (6,6)-(6,9) = "def" @@ -119,4 +121,5 @@ │ ├── flags: static_literal, decimal │ └── value: 2 ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/seattlerb/bug_comma.txt b/snapshots/seattlerb/bug_comma.txt index d370ea0ac0..4ffe4b972d 100644 --- a/snapshots/seattlerb/bug_comma.txt +++ b/snapshots/seattlerb/bug_comma.txt @@ -35,8 +35,10 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── then_keyword_loc: (1,16)-(1,20) = "then" ├── statements: ∅ diff --git a/snapshots/seattlerb/bug_hash_args.txt b/snapshots/seattlerb/bug_hash_args.txt index cd90f0ebc6..f3002ef7f6 100644 --- a/snapshots/seattlerb/bug_hash_args.txt +++ b/snapshots/seattlerb/bug_hash_args.txt @@ -39,4 +39,5 @@ │ │ └── flags: static_literal │ └── operator_loc: ∅ ├── closing_loc: (1,18)-(1,19) = ")" + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/seattlerb/bug_hash_args_trailing_comma.txt b/snapshots/seattlerb/bug_hash_args_trailing_comma.txt index 8c06cabf1c..2eccde82c0 100644 --- a/snapshots/seattlerb/bug_hash_args_trailing_comma.txt +++ b/snapshots/seattlerb/bug_hash_args_trailing_comma.txt @@ -39,4 +39,5 @@ │ │ └── flags: static_literal │ └── operator_loc: ∅ ├── closing_loc: (1,19)-(1,20) = ")" + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/seattlerb/bug_masgn_right.txt b/snapshots/seattlerb/bug_masgn_right.txt index e5b635d802..b3c9924bd3 100644 --- a/snapshots/seattlerb/bug_masgn_right.txt +++ b/snapshots/seattlerb/bug_masgn_right.txt @@ -14,6 +14,7 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: @ BlockNode (location: (1,2)-(1,17)) ├── flags: ∅ diff --git a/snapshots/seattlerb/bug_not_parens.txt b/snapshots/seattlerb/bug_not_parens.txt index 163fb79564..39550d72b3 100644 --- a/snapshots/seattlerb/bug_not_parens.txt +++ b/snapshots/seattlerb/bug_not_parens.txt @@ -17,6 +17,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── call_operator_loc: ∅ ├── name: :! @@ -24,4 +25,5 @@ ├── opening_loc: (1,3)-(1,4) = "(" ├── arguments: ∅ ├── closing_loc: (1,5)-(1,6) = ")" + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/seattlerb/bug_op_asgn_rescue.txt b/snapshots/seattlerb/bug_op_asgn_rescue.txt index 9da753aece..b12d5e9a43 100644 --- a/snapshots/seattlerb/bug_op_asgn_rescue.txt +++ b/snapshots/seattlerb/bug_op_asgn_rescue.txt @@ -22,6 +22,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── keyword_loc: (1,8)-(1,14) = "rescue" │ └── rescue_expression: diff --git a/snapshots/seattlerb/call_and.txt b/snapshots/seattlerb/call_and.txt index 640f355c4a..c74913c47e 100644 --- a/snapshots/seattlerb/call_and.txt +++ b/snapshots/seattlerb/call_and.txt @@ -23,4 +23,5 @@ │ ├── flags: static_literal, decimal │ └── value: 2 ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/seattlerb/call_arg_assoc.txt b/snapshots/seattlerb/call_arg_assoc.txt index b8ec907031..3c780c6e19 100644 --- a/snapshots/seattlerb/call_arg_assoc.txt +++ b/snapshots/seattlerb/call_arg_assoc.txt @@ -34,4 +34,5 @@ │ │ └── value: 3 │ └── operator_loc: (1,6)-(1,8) = "=>" ├── closing_loc: (1,9)-(1,10) = ")" + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/seattlerb/call_arg_assoc_kwsplat.txt b/snapshots/seattlerb/call_arg_assoc_kwsplat.txt index 11142b2721..e80ab7a106 100644 --- a/snapshots/seattlerb/call_arg_assoc_kwsplat.txt +++ b/snapshots/seattlerb/call_arg_assoc_kwsplat.txt @@ -44,4 +44,5 @@ │ │ └── value: 3 │ └── operator_loc: (1,12)-(1,14) = "**" ├── closing_loc: (1,15)-(1,16) = ")" + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/seattlerb/call_arg_kwsplat.txt b/snapshots/seattlerb/call_arg_kwsplat.txt index 853f7103e3..097188f8cf 100644 --- a/snapshots/seattlerb/call_arg_kwsplat.txt +++ b/snapshots/seattlerb/call_arg_kwsplat.txt @@ -25,6 +25,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ └── @ KeywordHashNode (location: (1,5)-(1,8)) │ ├── flags: ∅ @@ -37,4 +38,5 @@ │ │ └── value: 1 │ └── operator_loc: (1,5)-(1,7) = "**" ├── closing_loc: (1,8)-(1,9) = ")" + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/seattlerb/call_args_assoc_quoted.txt b/snapshots/seattlerb/call_args_assoc_quoted.txt index 615bee5b4a..adb1413554 100644 --- a/snapshots/seattlerb/call_args_assoc_quoted.txt +++ b/snapshots/seattlerb/call_args_assoc_quoted.txt @@ -42,6 +42,7 @@ │ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ │ ├── arguments: ∅ │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ ├── equal_loc: ∅ │ │ │ │ │ └── block: ∅ │ │ │ │ └── closing_loc: (1,6)-(1,7) = "}" │ │ │ └── closing_loc: (1,7)-(1,9) = "\":" @@ -51,6 +52,7 @@ │ │ │ └── value: 42 │ │ └── operator_loc: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (3,0)-(3,8)) │ ├── flags: newline, ignore_visibility @@ -81,6 +83,7 @@ │ │ │ └── value: 42 │ │ └── operator_loc: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ └── @ CallNode (location: (5,0)-(5,8)) ├── flags: newline, ignore_visibility @@ -111,4 +114,5 @@ │ │ └── value: 42 │ └── operator_loc: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/seattlerb/call_args_assoc_trailing_comma.txt b/snapshots/seattlerb/call_args_assoc_trailing_comma.txt index 00bc620f54..615ccb92c2 100644 --- a/snapshots/seattlerb/call_args_assoc_trailing_comma.txt +++ b/snapshots/seattlerb/call_args_assoc_trailing_comma.txt @@ -34,4 +34,5 @@ │ │ └── value: 3 │ └── operator_loc: (1,6)-(1,8) = "=>" ├── closing_loc: (1,10)-(1,11) = ")" + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/seattlerb/call_args_command.txt b/snapshots/seattlerb/call_args_command.txt index 6fe112f224..33608409f3 100644 --- a/snapshots/seattlerb/call_args_command.txt +++ b/snapshots/seattlerb/call_args_command.txt @@ -17,6 +17,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── call_operator_loc: (1,1)-(1,2) = "." ├── name: :b @@ -38,6 +39,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: (1,5)-(1,6) = "." │ ├── name: :d @@ -51,6 +53,8 @@ │ │ ├── flags: static_literal, decimal │ │ └── value: 1 │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/seattlerb/call_array_arg.txt b/snapshots/seattlerb/call_array_arg.txt index cec613bc58..71f0c2f80e 100644 --- a/snapshots/seattlerb/call_array_arg.txt +++ b/snapshots/seattlerb/call_array_arg.txt @@ -37,4 +37,5 @@ │ ├── opening_loc: (1,5)-(1,6) = "[" │ └── closing_loc: (1,12)-(1,13) = "]" ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/seattlerb/call_array_block_call.txt b/snapshots/seattlerb/call_array_block_call.txt index 4a044924e9..7461b0529a 100644 --- a/snapshots/seattlerb/call_array_block_call.txt +++ b/snapshots/seattlerb/call_array_block_call.txt @@ -30,6 +30,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: │ │ @ BlockNode (location: (1,11)-(1,17)) │ │ ├── flags: ∅ @@ -41,4 +42,5 @@ │ ├── opening_loc: (1,2)-(1,3) = "[" │ └── closing_loc: (1,18)-(1,19) = "]" ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/seattlerb/call_array_lambda_block_call.txt b/snapshots/seattlerb/call_array_lambda_block_call.txt index dca64e5f7b..a2575f5780 100644 --- a/snapshots/seattlerb/call_array_lambda_block_call.txt +++ b/snapshots/seattlerb/call_array_lambda_block_call.txt @@ -36,6 +36,7 @@ │ ├── opening_loc: (1,2)-(1,3) = "[" │ └── closing_loc: (1,10)-(1,11) = "]" ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: @ BlockNode (location: (1,12)-(2,3)) ├── flags: ∅ diff --git a/snapshots/seattlerb/call_array_lit_inline_hash.txt b/snapshots/seattlerb/call_array_lit_inline_hash.txt index f83c7a55e5..3b38a1c0af 100644 --- a/snapshots/seattlerb/call_array_lit_inline_hash.txt +++ b/snapshots/seattlerb/call_array_lit_inline_hash.txt @@ -45,4 +45,5 @@ │ ├── opening_loc: (1,2)-(1,3) = "[" │ └── closing_loc: (1,14)-(1,15) = "]" ├── closing_loc: (1,15)-(1,16) = ")" + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/seattlerb/call_assoc.txt b/snapshots/seattlerb/call_assoc.txt index a4e4512a08..464b532574 100644 --- a/snapshots/seattlerb/call_assoc.txt +++ b/snapshots/seattlerb/call_assoc.txt @@ -31,4 +31,5 @@ │ │ └── value: 3 │ └── operator_loc: (1,3)-(1,5) = "=>" ├── closing_loc: (1,6)-(1,7) = ")" + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/seattlerb/call_assoc_new.txt b/snapshots/seattlerb/call_assoc_new.txt index 6cbc942a6b..2b252e5d5e 100644 --- a/snapshots/seattlerb/call_assoc_new.txt +++ b/snapshots/seattlerb/call_assoc_new.txt @@ -34,4 +34,5 @@ │ │ └── value: 3 │ └── operator_loc: ∅ ├── closing_loc: (1,5)-(1,6) = ")" + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/seattlerb/call_assoc_new_if_multiline.txt b/snapshots/seattlerb/call_assoc_new_if_multiline.txt index a258b734a3..078dba18e9 100644 --- a/snapshots/seattlerb/call_assoc_new_if_multiline.txt +++ b/snapshots/seattlerb/call_assoc_new_if_multiline.txt @@ -62,4 +62,5 @@ │ │ └── end_keyword_loc: (5,0)-(5,3) = "end" │ └── operator_loc: ∅ ├── closing_loc: (5,3)-(5,4) = ")" + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/seattlerb/call_assoc_trailing_comma.txt b/snapshots/seattlerb/call_assoc_trailing_comma.txt index a240775d69..1e4c77855a 100644 --- a/snapshots/seattlerb/call_assoc_trailing_comma.txt +++ b/snapshots/seattlerb/call_assoc_trailing_comma.txt @@ -31,4 +31,5 @@ │ │ └── value: 2 │ └── operator_loc: (1,3)-(1,5) = "=>" ├── closing_loc: (1,7)-(1,8) = ")" + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/seattlerb/call_bang_command_call.txt b/snapshots/seattlerb/call_bang_command_call.txt index e226d65278..a133c530cf 100644 --- a/snapshots/seattlerb/call_bang_command_call.txt +++ b/snapshots/seattlerb/call_bang_command_call.txt @@ -20,6 +20,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: (1,3)-(1,4) = "." │ ├── name: :b @@ -33,6 +34,7 @@ │ │ ├── flags: static_literal, decimal │ │ └── value: 1 │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── call_operator_loc: ∅ ├── name: :! @@ -40,4 +42,5 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/seattlerb/call_bang_squiggle.txt b/snapshots/seattlerb/call_bang_squiggle.txt index 5c10841f73..95d08a81c9 100644 --- a/snapshots/seattlerb/call_bang_squiggle.txt +++ b/snapshots/seattlerb/call_bang_squiggle.txt @@ -23,4 +23,5 @@ │ ├── flags: static_literal, decimal │ └── value: 2 ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/seattlerb/call_begin_call_block_call.txt b/snapshots/seattlerb/call_begin_call_block_call.txt index 240a3aaa76..c9397059af 100644 --- a/snapshots/seattlerb/call_begin_call_block_call.txt +++ b/snapshots/seattlerb/call_begin_call_block_call.txt @@ -35,6 +35,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── call_operator_loc: (2,1)-(2,2) = "." │ │ ├── name: :c @@ -42,6 +43,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: │ │ @ BlockNode (location: (2,4)-(2,10)) │ │ ├── flags: ∅ @@ -55,4 +57,5 @@ │ ├── ensure_clause: ∅ │ └── end_keyword_loc: (3,0)-(3,3) = "end" ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/seattlerb/call_block_arg_named.txt b/snapshots/seattlerb/call_block_arg_named.txt index b74a1f69a9..9c93a4c040 100644 --- a/snapshots/seattlerb/call_block_arg_named.txt +++ b/snapshots/seattlerb/call_block_arg_named.txt @@ -14,6 +14,7 @@ ├── opening_loc: (1,1)-(1,2) = "(" ├── arguments: ∅ ├── closing_loc: (1,6)-(1,7) = ")" + ├── equal_loc: ∅ └── block: @ BlockArgumentNode (location: (1,2)-(1,6)) ├── flags: ∅ @@ -27,5 +28,6 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ └── operator_loc: (1,2)-(1,3) = "&" diff --git a/snapshots/seattlerb/call_carat.txt b/snapshots/seattlerb/call_carat.txt index 88ed832aca..c074ae8403 100644 --- a/snapshots/seattlerb/call_carat.txt +++ b/snapshots/seattlerb/call_carat.txt @@ -23,4 +23,5 @@ │ ├── flags: static_literal, decimal │ └── value: 2 ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/seattlerb/call_colon2.txt b/snapshots/seattlerb/call_colon2.txt index 85e39cd363..dcca399fbf 100644 --- a/snapshots/seattlerb/call_colon2.txt +++ b/snapshots/seattlerb/call_colon2.txt @@ -17,4 +17,5 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/seattlerb/call_colon_parens.txt b/snapshots/seattlerb/call_colon_parens.txt index 19141c3413..f2902d10e8 100644 --- a/snapshots/seattlerb/call_colon_parens.txt +++ b/snapshots/seattlerb/call_colon_parens.txt @@ -17,4 +17,5 @@ ├── opening_loc: (1,3)-(1,4) = "(" ├── arguments: ∅ ├── closing_loc: (1,4)-(1,5) = ")" + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/seattlerb/call_div.txt b/snapshots/seattlerb/call_div.txt index 55a410977c..6ffb409e3e 100644 --- a/snapshots/seattlerb/call_div.txt +++ b/snapshots/seattlerb/call_div.txt @@ -23,4 +23,5 @@ │ ├── flags: static_literal, decimal │ └── value: 2 ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/seattlerb/call_dot_parens.txt b/snapshots/seattlerb/call_dot_parens.txt index 29b592a960..42652196ff 100644 --- a/snapshots/seattlerb/call_dot_parens.txt +++ b/snapshots/seattlerb/call_dot_parens.txt @@ -17,4 +17,5 @@ ├── opening_loc: (1,2)-(1,3) = "(" ├── arguments: ∅ ├── closing_loc: (1,3)-(1,4) = ")" + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/seattlerb/call_env.txt b/snapshots/seattlerb/call_env.txt index 933621594f..413df446b7 100644 --- a/snapshots/seattlerb/call_env.txt +++ b/snapshots/seattlerb/call_env.txt @@ -17,6 +17,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── call_operator_loc: (1,1)-(1,2) = "." ├── name: :happy @@ -24,4 +25,5 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/seattlerb/call_eq3.txt b/snapshots/seattlerb/call_eq3.txt index 52e4b00c5c..7c9cb05eb8 100644 --- a/snapshots/seattlerb/call_eq3.txt +++ b/snapshots/seattlerb/call_eq3.txt @@ -23,4 +23,5 @@ │ ├── flags: static_literal, decimal │ └── value: 2 ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/seattlerb/call_gt.txt b/snapshots/seattlerb/call_gt.txt index 22371dd8ca..c80c2ab0b2 100644 --- a/snapshots/seattlerb/call_gt.txt +++ b/snapshots/seattlerb/call_gt.txt @@ -23,4 +23,5 @@ │ ├── flags: static_literal, decimal │ └── value: 2 ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/seattlerb/call_kwsplat.txt b/snapshots/seattlerb/call_kwsplat.txt index 17773e7693..7b53cfc361 100644 --- a/snapshots/seattlerb/call_kwsplat.txt +++ b/snapshots/seattlerb/call_kwsplat.txt @@ -27,4 +27,5 @@ │ │ └── value: 1 │ └── operator_loc: (1,2)-(1,4) = "**" ├── closing_loc: (1,5)-(1,6) = ")" + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/seattlerb/call_leading_dots.txt b/snapshots/seattlerb/call_leading_dots.txt index 5562afcd70..7fbeee4337 100644 --- a/snapshots/seattlerb/call_leading_dots.txt +++ b/snapshots/seattlerb/call_leading_dots.txt @@ -20,6 +20,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: (2,0)-(2,1) = "." │ ├── name: :b @@ -27,6 +28,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── call_operator_loc: (3,0)-(3,1) = "." ├── name: :c @@ -34,4 +36,5 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/seattlerb/call_leading_dots_comment.txt b/snapshots/seattlerb/call_leading_dots_comment.txt index f285e42cbf..497096733a 100644 --- a/snapshots/seattlerb/call_leading_dots_comment.txt +++ b/snapshots/seattlerb/call_leading_dots_comment.txt @@ -20,6 +20,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: (2,0)-(2,1) = "." │ ├── name: :b @@ -27,6 +28,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── call_operator_loc: (4,0)-(4,1) = "." ├── name: :d @@ -34,4 +36,5 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/seattlerb/call_lt.txt b/snapshots/seattlerb/call_lt.txt index bec3deddd0..41a88ac3d7 100644 --- a/snapshots/seattlerb/call_lt.txt +++ b/snapshots/seattlerb/call_lt.txt @@ -23,4 +23,5 @@ │ ├── flags: static_literal, decimal │ └── value: 2 ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/seattlerb/call_lte.txt b/snapshots/seattlerb/call_lte.txt index a71e03ee12..0333ceb774 100644 --- a/snapshots/seattlerb/call_lte.txt +++ b/snapshots/seattlerb/call_lte.txt @@ -23,4 +23,5 @@ │ ├── flags: static_literal, decimal │ └── value: 2 ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/seattlerb/call_not.txt b/snapshots/seattlerb/call_not.txt index e9df80fb9f..af4a1cab34 100644 --- a/snapshots/seattlerb/call_not.txt +++ b/snapshots/seattlerb/call_not.txt @@ -17,4 +17,5 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/seattlerb/call_pipe.txt b/snapshots/seattlerb/call_pipe.txt index 8cf68211a9..66aec7af3f 100644 --- a/snapshots/seattlerb/call_pipe.txt +++ b/snapshots/seattlerb/call_pipe.txt @@ -23,4 +23,5 @@ │ ├── flags: static_literal, decimal │ └── value: 2 ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/seattlerb/call_rshift.txt b/snapshots/seattlerb/call_rshift.txt index 28948a044f..1c539107b5 100644 --- a/snapshots/seattlerb/call_rshift.txt +++ b/snapshots/seattlerb/call_rshift.txt @@ -23,4 +23,5 @@ │ ├── flags: static_literal, decimal │ └── value: 2 ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/seattlerb/call_self_brackets.txt b/snapshots/seattlerb/call_self_brackets.txt index e4f5e2c413..59a70e6db5 100644 --- a/snapshots/seattlerb/call_self_brackets.txt +++ b/snapshots/seattlerb/call_self_brackets.txt @@ -22,4 +22,5 @@ │ ├── flags: static_literal, decimal │ └── value: 1 ├── closing_loc: (1,6)-(1,7) = "]" + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/seattlerb/call_spaceship.txt b/snapshots/seattlerb/call_spaceship.txt index 4ea67f2e00..9087b69321 100644 --- a/snapshots/seattlerb/call_spaceship.txt +++ b/snapshots/seattlerb/call_spaceship.txt @@ -23,4 +23,5 @@ │ ├── flags: static_literal, decimal │ └── value: 2 ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/seattlerb/call_stabby_do_end_with_block.txt b/snapshots/seattlerb/call_stabby_do_end_with_block.txt index 0e83d334ca..8bea34eae6 100644 --- a/snapshots/seattlerb/call_stabby_do_end_with_block.txt +++ b/snapshots/seattlerb/call_stabby_do_end_with_block.txt @@ -31,6 +31,7 @@ │ ├── flags: newline, static_literal, decimal │ └── value: 1 ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: @ BlockNode (location: (1,14)-(1,22)) ├── flags: ∅ diff --git a/snapshots/seattlerb/call_stabby_with_braces_block.txt b/snapshots/seattlerb/call_stabby_with_braces_block.txt index 705f8b8d02..4d604748d6 100644 --- a/snapshots/seattlerb/call_stabby_with_braces_block.txt +++ b/snapshots/seattlerb/call_stabby_with_braces_block.txt @@ -31,6 +31,7 @@ │ ├── flags: newline, static_literal, decimal │ └── value: 1 ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: @ BlockNode (location: (1,11)-(1,19)) ├── flags: ∅ diff --git a/snapshots/seattlerb/call_star.txt b/snapshots/seattlerb/call_star.txt index 06bee81f30..f757447606 100644 --- a/snapshots/seattlerb/call_star.txt +++ b/snapshots/seattlerb/call_star.txt @@ -23,4 +23,5 @@ │ ├── flags: static_literal, decimal │ └── value: 2 ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/seattlerb/call_star2.txt b/snapshots/seattlerb/call_star2.txt index bd367d2e75..731cea7731 100644 --- a/snapshots/seattlerb/call_star2.txt +++ b/snapshots/seattlerb/call_star2.txt @@ -23,4 +23,5 @@ │ ├── flags: static_literal, decimal │ └── value: 2 ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/seattlerb/call_trailing_comma.txt b/snapshots/seattlerb/call_trailing_comma.txt index 01cb77a25a..bc91c9d966 100644 --- a/snapshots/seattlerb/call_trailing_comma.txt +++ b/snapshots/seattlerb/call_trailing_comma.txt @@ -20,4 +20,5 @@ │ ├── flags: static_literal, decimal │ └── value: 1 ├── closing_loc: (1,4)-(1,5) = ")" + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/seattlerb/call_trailing_dots.txt b/snapshots/seattlerb/call_trailing_dots.txt index 73ffd855ad..dda8ca355e 100644 --- a/snapshots/seattlerb/call_trailing_dots.txt +++ b/snapshots/seattlerb/call_trailing_dots.txt @@ -20,6 +20,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: (1,1)-(1,2) = "." │ ├── name: :b @@ -27,6 +28,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── call_operator_loc: (2,1)-(2,2) = "." ├── name: :c @@ -34,4 +36,5 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/seattlerb/call_unary_bang.txt b/snapshots/seattlerb/call_unary_bang.txt index b08f070693..3d95afeace 100644 --- a/snapshots/seattlerb/call_unary_bang.txt +++ b/snapshots/seattlerb/call_unary_bang.txt @@ -17,4 +17,5 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/seattlerb/case_in.txt b/snapshots/seattlerb/case_in.txt index 929cca0d38..80a29db396 100644 --- a/snapshots/seattlerb/case_in.txt +++ b/snapshots/seattlerb/case_in.txt @@ -917,6 +917,7 @@ │ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ │ ├── arguments: ∅ │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ ├── equal_loc: ∅ │ │ │ │ │ └── block: ∅ │ │ │ │ ├── operator_loc: (90,4)-(90,5) = "^" │ │ │ │ ├── lparen_loc: (90,5)-(90,6) = "(" diff --git a/snapshots/seattlerb/defn_arg_forward_args.txt b/snapshots/seattlerb/defn_arg_forward_args.txt index ababd94b11..76ffa41db5 100644 --- a/snapshots/seattlerb/defn_arg_forward_args.txt +++ b/snapshots/seattlerb/defn_arg_forward_args.txt @@ -47,6 +47,7 @@ │ │ └── @ ForwardingArgumentsNode (location: (1,20)-(1,23)) │ │ └── flags: ∅ │ ├── closing_loc: (1,23)-(1,24) = ")" + │ ├── equal_loc: ∅ │ └── block: ∅ ├── locals: [:x] ├── def_keyword_loc: (1,0)-(1,3) = "def" diff --git a/snapshots/seattlerb/defn_args_forward_args.txt b/snapshots/seattlerb/defn_args_forward_args.txt index d689049433..5cba1311d7 100644 --- a/snapshots/seattlerb/defn_args_forward_args.txt +++ b/snapshots/seattlerb/defn_args_forward_args.txt @@ -59,6 +59,7 @@ │ │ └── @ ForwardingArgumentsNode (location: (1,32)-(1,35)) │ │ └── flags: ∅ │ ├── closing_loc: (1,35)-(1,36) = ")" + │ ├── equal_loc: ∅ │ └── block: ∅ ├── locals: [:x, :y, :z] ├── def_keyword_loc: (1,0)-(1,3) = "def" diff --git a/snapshots/seattlerb/defn_endless_command.txt b/snapshots/seattlerb/defn_endless_command.txt index 12149a821c..1aa2e2c12a 100644 --- a/snapshots/seattlerb/defn_endless_command.txt +++ b/snapshots/seattlerb/defn_endless_command.txt @@ -30,6 +30,7 @@ │ │ ├── flags: static_literal, decimal │ │ └── value: 42 │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── locals: [] ├── def_keyword_loc: (1,0)-(1,3) = "def" diff --git a/snapshots/seattlerb/defn_endless_command_rescue.txt b/snapshots/seattlerb/defn_endless_command_rescue.txt index 99194a5ce9..4046cbcb3e 100644 --- a/snapshots/seattlerb/defn_endless_command_rescue.txt +++ b/snapshots/seattlerb/defn_endless_command_rescue.txt @@ -33,6 +33,7 @@ │ │ │ ├── flags: static_literal, decimal │ │ │ └── value: 42 │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── keyword_loc: (1,34)-(1,40) = "rescue" │ └── rescue_expression: diff --git a/snapshots/seattlerb/defn_forward_args.txt b/snapshots/seattlerb/defn_forward_args.txt index 58a97028c6..b912c58721 100644 --- a/snapshots/seattlerb/defn_forward_args.txt +++ b/snapshots/seattlerb/defn_forward_args.txt @@ -40,6 +40,7 @@ │ │ └── @ ForwardingArgumentsNode (location: (1,14)-(1,17)) │ │ └── flags: ∅ │ ├── closing_loc: (1,17)-(1,18) = ")" + │ ├── equal_loc: ∅ │ └── block: ∅ ├── locals: [] ├── def_keyword_loc: (1,0)-(1,3) = "def" diff --git a/snapshots/seattlerb/defn_forward_args__no_parens.txt b/snapshots/seattlerb/defn_forward_args__no_parens.txt index 5d8e09f6c0..af9aa9c11e 100644 --- a/snapshots/seattlerb/defn_forward_args__no_parens.txt +++ b/snapshots/seattlerb/defn_forward_args__no_parens.txt @@ -40,6 +40,7 @@ │ │ └── @ ForwardingArgumentsNode (location: (2,4)-(2,7)) │ │ └── flags: ∅ │ ├── closing_loc: (2,7)-(2,8) = ")" + │ ├── equal_loc: ∅ │ └── block: ∅ ├── locals: [] ├── def_keyword_loc: (1,0)-(1,3) = "def" diff --git a/snapshots/seattlerb/defn_kwarg_env.txt b/snapshots/seattlerb/defn_kwarg_env.txt index 0df82b5dc2..281e779877 100644 --- a/snapshots/seattlerb/defn_kwarg_env.txt +++ b/snapshots/seattlerb/defn_kwarg_env.txt @@ -52,6 +52,7 @@ │ │ │ └── depth: 0 │ │ └── operator_loc: (1,31)-(1,33) = "**" │ ├── closing_loc: (1,40)-(1,41) = ")" + │ ├── equal_loc: ∅ │ └── block: ∅ ├── locals: [:testing] ├── def_keyword_loc: (1,0)-(1,3) = "def" diff --git a/snapshots/seattlerb/defn_oneliner.txt b/snapshots/seattlerb/defn_oneliner.txt index 81ca22f010..387955d934 100644 --- a/snapshots/seattlerb/defn_oneliner.txt +++ b/snapshots/seattlerb/defn_oneliner.txt @@ -43,6 +43,7 @@ │ │ ├── name: :cmd │ │ └── depth: 0 │ ├── closing_loc: (1,26)-(1,27) = ")" + │ ├── equal_loc: ∅ │ └── block: ∅ ├── locals: [:cmd] ├── def_keyword_loc: (1,0)-(1,3) = "def" diff --git a/snapshots/seattlerb/defn_oneliner_noargs.txt b/snapshots/seattlerb/defn_oneliner_noargs.txt index 5928f64179..42d716cdcc 100644 --- a/snapshots/seattlerb/defn_oneliner_noargs.txt +++ b/snapshots/seattlerb/defn_oneliner_noargs.txt @@ -24,6 +24,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── locals: [] ├── def_keyword_loc: (1,0)-(1,3) = "def" diff --git a/snapshots/seattlerb/defn_oneliner_noargs_parentheses.txt b/snapshots/seattlerb/defn_oneliner_noargs_parentheses.txt index d0cd777039..b3fa26c683 100644 --- a/snapshots/seattlerb/defn_oneliner_noargs_parentheses.txt +++ b/snapshots/seattlerb/defn_oneliner_noargs_parentheses.txt @@ -24,6 +24,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── locals: [] ├── def_keyword_loc: (1,0)-(1,3) = "def" diff --git a/snapshots/seattlerb/defn_oneliner_rescue.txt b/snapshots/seattlerb/defn_oneliner_rescue.txt index 4c4e9aef2a..4d22657cfe 100644 --- a/snapshots/seattlerb/defn_oneliner_rescue.txt +++ b/snapshots/seattlerb/defn_oneliner_rescue.txt @@ -47,6 +47,7 @@ │ │ │ │ ├── name: :cmd │ │ │ │ └── depth: 0 │ │ │ ├── closing_loc: (2,12)-(2,13) = ")" + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── rescue_clause: │ │ │ @ RescueNode (location: (3,0)-(4,5)) @@ -114,6 +115,7 @@ │ │ │ │ ├── name: :cmd │ │ │ │ └── depth: 0 │ │ │ ├── closing_loc: (9,12)-(9,13) = ")" + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── keyword_loc: (9,14)-(9,20) = "rescue" │ │ └── rescue_expression: @@ -167,6 +169,7 @@ │ │ │ ├── name: :cmd │ │ │ └── depth: 0 │ │ ├── closing_loc: (13,26)-(13,27) = ")" + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── keyword_loc: (13,28)-(13,34) = "rescue" │ └── rescue_expression: diff --git a/snapshots/seattlerb/defs_as_arg_with_do_block_inside.txt b/snapshots/seattlerb/defs_as_arg_with_do_block_inside.txt index f9479eb11b..994cd742bc 100644 --- a/snapshots/seattlerb/defs_as_arg_with_do_block_inside.txt +++ b/snapshots/seattlerb/defs_as_arg_with_do_block_inside.txt @@ -40,6 +40,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── call_operator_loc: (1,15)-(1,16) = "." │ │ ├── name: :y @@ -47,6 +48,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: │ │ @ BlockNode (location: (1,18)-(1,25)) │ │ ├── flags: ∅ @@ -63,4 +65,5 @@ │ ├── equal_loc: ∅ │ └── end_keyword_loc: (1,27)-(1,30) = "end" ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/seattlerb/defs_endless_command.txt b/snapshots/seattlerb/defs_endless_command.txt index f34d667901..d8db9cd1b9 100644 --- a/snapshots/seattlerb/defs_endless_command.txt +++ b/snapshots/seattlerb/defs_endless_command.txt @@ -19,6 +19,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── parameters: ∅ ├── body: @@ -40,6 +41,7 @@ │ │ ├── flags: static_literal, decimal │ │ └── value: 42 │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── locals: [] ├── def_keyword_loc: (1,0)-(1,3) = "def" diff --git a/snapshots/seattlerb/defs_endless_command_rescue.txt b/snapshots/seattlerb/defs_endless_command_rescue.txt index fe85936940..862623427d 100644 --- a/snapshots/seattlerb/defs_endless_command_rescue.txt +++ b/snapshots/seattlerb/defs_endless_command_rescue.txt @@ -19,6 +19,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── parameters: ∅ ├── body: @@ -43,6 +44,7 @@ │ │ │ ├── flags: static_literal, decimal │ │ │ └── value: 42 │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── keyword_loc: (1,36)-(1,42) = "rescue" │ └── rescue_expression: diff --git a/snapshots/seattlerb/defs_oneliner.txt b/snapshots/seattlerb/defs_oneliner.txt index c99b810844..23033d429b 100644 --- a/snapshots/seattlerb/defs_oneliner.txt +++ b/snapshots/seattlerb/defs_oneliner.txt @@ -45,6 +45,7 @@ │ │ ├── name: :cmd │ │ └── depth: 0 │ ├── closing_loc: (1,31)-(1,32) = ")" + │ ├── equal_loc: ∅ │ └── block: ∅ ├── locals: [:cmd] ├── def_keyword_loc: (1,0)-(1,3) = "def" diff --git a/snapshots/seattlerb/defs_oneliner_rescue.txt b/snapshots/seattlerb/defs_oneliner_rescue.txt index e620fbd178..40bde573c4 100644 --- a/snapshots/seattlerb/defs_oneliner_rescue.txt +++ b/snapshots/seattlerb/defs_oneliner_rescue.txt @@ -49,6 +49,7 @@ │ │ │ │ ├── name: :cmd │ │ │ │ └── depth: 0 │ │ │ ├── closing_loc: (2,12)-(2,13) = ")" + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── rescue_clause: │ │ │ @ RescueNode (location: (3,0)-(4,5)) @@ -118,6 +119,7 @@ │ │ │ │ ├── name: :cmd │ │ │ │ └── depth: 0 │ │ │ ├── closing_loc: (9,12)-(9,13) = ")" + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── keyword_loc: (9,14)-(9,20) = "rescue" │ │ └── rescue_expression: @@ -173,6 +175,7 @@ │ │ │ ├── name: :cmd │ │ │ └── depth: 0 │ │ ├── closing_loc: (13,31)-(13,32) = ")" + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── keyword_loc: (13,33)-(13,39) = "rescue" │ └── rescue_expression: diff --git a/snapshots/seattlerb/difficult0_.txt b/snapshots/seattlerb/difficult0_.txt index da977bdc52..0c7ebb3d30 100644 --- a/snapshots/seattlerb/difficult0_.txt +++ b/snapshots/seattlerb/difficult0_.txt @@ -54,6 +54,7 @@ │ │ │ │ └── unescaped: " c" │ │ │ └── closing_loc: (4,3)-(4,4) = "'" │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: ∅ │ ├── name: :+ @@ -70,6 +71,8 @@ │ │ ├── closing_loc: (4,7)-(4,8) = "'" │ │ └── unescaped: "d" │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/seattlerb/difficult1_line_numbers.txt b/snapshots/seattlerb/difficult1_line_numbers.txt index c34579e6ac..0d293c5ba3 100644 --- a/snapshots/seattlerb/difficult1_line_numbers.txt +++ b/snapshots/seattlerb/difficult1_line_numbers.txt @@ -31,6 +31,7 @@ │ │ │ ├── flags: static_literal, decimal │ │ │ └── value: 1 │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── @ CallNode (location: (3,2)-(3,7)) │ │ ├── flags: newline @@ -44,6 +45,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── call_operator_loc: (3,3)-(3,4) = "." │ │ ├── name: :b @@ -57,6 +59,7 @@ │ │ │ ├── flags: static_literal, decimal │ │ │ └── value: 2 │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── @ CallNode (location: (4,2)-(4,10)) │ │ ├── flags: newline @@ -70,6 +73,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── call_operator_loc: (4,3)-(4,4) = "." │ │ ├── name: :d @@ -86,6 +90,7 @@ │ │ │ ├── flags: static_literal, decimal │ │ │ └── value: 4 │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── @ CallNode (location: (5,2)-(5,7)) │ │ ├── flags: newline @@ -99,6 +104,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── call_operator_loc: (5,3)-(5,4) = "." │ │ ├── name: :f @@ -112,6 +118,7 @@ │ │ │ ├── flags: static_literal, decimal │ │ │ └── value: 5 │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── @ CallNode (location: (6,2)-(6,10)) │ │ ├── flags: newline @@ -125,6 +132,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── call_operator_loc: (6,3)-(6,4) = "." │ │ ├── name: :h @@ -141,6 +149,7 @@ │ │ │ ├── flags: static_literal, decimal │ │ │ └── value: 7 │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── @ CallNode (location: (7,2)-(7,6)) │ │ ├── flags: newline, ignore_visibility @@ -157,6 +166,7 @@ │ │ │ ├── flags: static_literal, decimal │ │ │ └── value: 1 │ │ ├── closing_loc: (7,5)-(7,6) = ")" + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── @ CallNode (location: (8,2)-(8,8)) │ │ ├── flags: newline @@ -170,6 +180,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── call_operator_loc: (8,3)-(8,4) = "." │ │ ├── name: :b @@ -183,6 +194,7 @@ │ │ │ ├── flags: static_literal, decimal │ │ │ └── value: 2 │ │ ├── closing_loc: (8,7)-(8,8) = ")" + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── @ CallNode (location: (9,2)-(9,11)) │ │ ├── flags: newline @@ -196,6 +208,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── call_operator_loc: (9,3)-(9,4) = "." │ │ ├── name: :d @@ -212,6 +225,7 @@ │ │ │ ├── flags: static_literal, decimal │ │ │ └── value: 4 │ │ ├── closing_loc: (9,10)-(9,11) = ")" + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── @ CallNode (location: (10,2)-(10,8)) │ │ ├── flags: newline @@ -225,6 +239,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── call_operator_loc: (10,3)-(10,4) = "." │ │ ├── name: :f @@ -238,6 +253,7 @@ │ │ │ ├── flags: static_literal, decimal │ │ │ └── value: 5 │ │ ├── closing_loc: (10,7)-(10,8) = ")" + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ └── @ CallNode (location: (11,2)-(11,11)) │ ├── flags: newline @@ -251,6 +267,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: (11,3)-(11,4) = "." │ ├── name: :h @@ -267,6 +284,7 @@ │ │ ├── flags: static_literal, decimal │ │ └── value: 7 │ ├── closing_loc: (11,10)-(11,11) = ")" + │ ├── equal_loc: ∅ │ └── block: ∅ ├── subsequent: ∅ └── end_keyword_loc: (12,0)-(12,3) = "end" diff --git a/snapshots/seattlerb/difficult1_line_numbers2.txt b/snapshots/seattlerb/difficult1_line_numbers2.txt index ae710f997f..83d97619d1 100644 --- a/snapshots/seattlerb/difficult1_line_numbers2.txt +++ b/snapshots/seattlerb/difficult1_line_numbers2.txt @@ -34,6 +34,7 @@ │ │ │ │ ├── closing_loc: (2,6)-(2,7) = "\"" │ │ │ │ └── unescaped: "a" │ │ │ ├── closing_loc: (2,7)-(2,8) = ")" + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── @ LocalVariableWriteNode (location: (3,2)-(3,7)) │ │ │ ├── flags: newline @@ -61,6 +62,7 @@ │ │ │ │ ├── name: :b │ │ │ │ └── depth: 0 │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── @ LocalVariableWriteNode (location: (5,2)-(5,6)) │ │ ├── flags: newline @@ -83,4 +85,5 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/seattlerb/difficult2_.txt b/snapshots/seattlerb/difficult2_.txt index 2a7e8e49d0..721cd3a5c0 100644 --- a/snapshots/seattlerb/difficult2_.txt +++ b/snapshots/seattlerb/difficult2_.txt @@ -35,6 +35,7 @@ │ │ │ ├── closing_loc: (1,7)-(1,8) = "'" │ │ │ └── unescaped: "" │ │ ├── closing_loc: (1,8)-(1,9) = ")" + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── subsequent: │ │ @ ElseNode (location: (1,10)-(1,13)) @@ -78,4 +79,5 @@ │ │ └── value: 3 │ └── operator_loc: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/seattlerb/difficult3_.txt b/snapshots/seattlerb/difficult3_.txt index 313cfa4cf2..d79dad8d9f 100644 --- a/snapshots/seattlerb/difficult3_.txt +++ b/snapshots/seattlerb/difficult3_.txt @@ -14,6 +14,7 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: @ BlockNode (location: (1,2)-(1,18)) ├── flags: ∅ diff --git a/snapshots/seattlerb/difficult3_2.txt b/snapshots/seattlerb/difficult3_2.txt index e1eed78c79..3bd8803c45 100644 --- a/snapshots/seattlerb/difficult3_2.txt +++ b/snapshots/seattlerb/difficult3_2.txt @@ -14,6 +14,7 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: @ BlockNode (location: (1,2)-(1,13)) ├── flags: ∅ diff --git a/snapshots/seattlerb/difficult3_3.txt b/snapshots/seattlerb/difficult3_3.txt index 5dcd71d651..e193e6d4fd 100644 --- a/snapshots/seattlerb/difficult3_3.txt +++ b/snapshots/seattlerb/difficult3_3.txt @@ -14,6 +14,7 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: @ BlockNode (location: (1,2)-(1,17)) ├── flags: ∅ diff --git a/snapshots/seattlerb/difficult3_4.txt b/snapshots/seattlerb/difficult3_4.txt index b733c42265..070378d75b 100644 --- a/snapshots/seattlerb/difficult3_4.txt +++ b/snapshots/seattlerb/difficult3_4.txt @@ -24,6 +24,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── then_keyword_loc: (1,4)-(1,5) = "?" │ ├── statements: diff --git a/snapshots/seattlerb/difficult3_5.txt b/snapshots/seattlerb/difficult3_5.txt index b8bbbdc03e..619e3eacff 100644 --- a/snapshots/seattlerb/difficult3_5.txt +++ b/snapshots/seattlerb/difficult3_5.txt @@ -42,6 +42,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (1,11)-(1,17)) │ ├── flags: ∅ @@ -51,4 +52,5 @@ │ ├── opening_loc: (1,11)-(1,13) = "do" │ └── closing_loc: (1,14)-(1,17) = "end" ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/seattlerb/difficult3__10.txt b/snapshots/seattlerb/difficult3__10.txt index a5ce0762f1..c02f1985de 100644 --- a/snapshots/seattlerb/difficult3__10.txt +++ b/snapshots/seattlerb/difficult3__10.txt @@ -14,6 +14,7 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: @ BlockNode (location: (1,2)-(1,18)) ├── flags: ∅ diff --git a/snapshots/seattlerb/difficult3__11.txt b/snapshots/seattlerb/difficult3__11.txt index c1017885d8..fdd84d7862 100644 --- a/snapshots/seattlerb/difficult3__11.txt +++ b/snapshots/seattlerb/difficult3__11.txt @@ -14,6 +14,7 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: @ BlockNode (location: (1,2)-(1,14)) ├── flags: ∅ diff --git a/snapshots/seattlerb/difficult3__12.txt b/snapshots/seattlerb/difficult3__12.txt index bbcfad48b4..70af34502b 100644 --- a/snapshots/seattlerb/difficult3__12.txt +++ b/snapshots/seattlerb/difficult3__12.txt @@ -14,6 +14,7 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: @ BlockNode (location: (1,2)-(1,17)) ├── flags: ∅ diff --git a/snapshots/seattlerb/difficult3__6.txt b/snapshots/seattlerb/difficult3__6.txt index 95d1ac39b5..952539317f 100644 --- a/snapshots/seattlerb/difficult3__6.txt +++ b/snapshots/seattlerb/difficult3__6.txt @@ -14,6 +14,7 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: @ BlockNode (location: (1,2)-(1,21)) ├── flags: ∅ diff --git a/snapshots/seattlerb/difficult3__7.txt b/snapshots/seattlerb/difficult3__7.txt index 4640cfdb53..69f59c0982 100644 --- a/snapshots/seattlerb/difficult3__7.txt +++ b/snapshots/seattlerb/difficult3__7.txt @@ -14,6 +14,7 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: @ BlockNode (location: (1,2)-(1,17)) ├── flags: ∅ diff --git a/snapshots/seattlerb/difficult3__8.txt b/snapshots/seattlerb/difficult3__8.txt index e19cbfc279..1289c37b0e 100644 --- a/snapshots/seattlerb/difficult3__8.txt +++ b/snapshots/seattlerb/difficult3__8.txt @@ -14,6 +14,7 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: @ BlockNode (location: (1,2)-(1,20)) ├── flags: ∅ diff --git a/snapshots/seattlerb/difficult3__9.txt b/snapshots/seattlerb/difficult3__9.txt index 2259351b41..e6b0879bdb 100644 --- a/snapshots/seattlerb/difficult3__9.txt +++ b/snapshots/seattlerb/difficult3__9.txt @@ -14,6 +14,7 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: @ BlockNode (location: (1,2)-(1,15)) ├── flags: ∅ diff --git a/snapshots/seattlerb/difficult4__leading_dots.txt b/snapshots/seattlerb/difficult4__leading_dots.txt index 4201ed00aa..aaf0dafd0f 100644 --- a/snapshots/seattlerb/difficult4__leading_dots.txt +++ b/snapshots/seattlerb/difficult4__leading_dots.txt @@ -17,6 +17,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── call_operator_loc: (2,0)-(2,1) = "." ├── name: :b @@ -24,4 +25,5 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/seattlerb/difficult6_.txt b/snapshots/seattlerb/difficult6_.txt index fc273bda46..f061f034d2 100644 --- a/snapshots/seattlerb/difficult6_.txt +++ b/snapshots/seattlerb/difficult6_.txt @@ -67,4 +67,5 @@ │ ├── opening_loc: (1,17)-(1,18) = "[" │ └── closing_loc: (1,22)-(1,23) = "]" ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/seattlerb/difficult6__7.txt b/snapshots/seattlerb/difficult6__7.txt index 509da6914f..027409dab4 100644 --- a/snapshots/seattlerb/difficult6__7.txt +++ b/snapshots/seattlerb/difficult6__7.txt @@ -17,6 +17,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── call_operator_loc: (1,1)-(1,2) = "." ├── name: :b @@ -38,6 +39,7 @@ │ ├── opening_loc: (1,4)-(1,5) = "(" │ └── closing_loc: (1,6)-(1,7) = ")" ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: @ BlockNode (location: (1,8)-(1,11)) ├── flags: ∅ @@ -56,6 +58,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── opening_loc: (1,8)-(1,9) = "{" └── closing_loc: (1,10)-(1,11) = "}" diff --git a/snapshots/seattlerb/difficult6__8.txt b/snapshots/seattlerb/difficult6__8.txt index c6fece62cb..b16b36b60e 100644 --- a/snapshots/seattlerb/difficult6__8.txt +++ b/snapshots/seattlerb/difficult6__8.txt @@ -17,6 +17,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── call_operator_loc: (1,1)-(1,3) = "::" ├── name: :b @@ -38,6 +39,7 @@ │ ├── opening_loc: (1,5)-(1,6) = "(" │ └── closing_loc: (1,7)-(1,8) = ")" ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: @ BlockNode (location: (1,9)-(1,12)) ├── flags: ∅ @@ -56,6 +58,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── opening_loc: (1,9)-(1,10) = "{" └── closing_loc: (1,11)-(1,12) = "}" diff --git a/snapshots/seattlerb/difficult7_.txt b/snapshots/seattlerb/difficult7_.txt index 2cf03ce57e..bd19aedcb7 100644 --- a/snapshots/seattlerb/difficult7_.txt +++ b/snapshots/seattlerb/difficult7_.txt @@ -28,6 +28,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: │ │ │ @ BlockNode (location: (2,18)-(2,33)) │ │ │ ├── flags: ∅ @@ -50,6 +51,7 @@ │ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ │ ├── arguments: ∅ │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ ├── equal_loc: ∅ │ │ │ │ │ └── block: ∅ │ │ │ │ ├── then_keyword_loc: (2,22)-(2,23) = "?" │ │ │ │ ├── statements: @@ -65,6 +67,7 @@ │ │ │ │ │ ├── opening_loc: (2,25)-(2,26) = "(" │ │ │ │ │ ├── arguments: ∅ │ │ │ │ │ ├── closing_loc: (2,26)-(2,27) = ")" + │ │ │ │ │ ├── equal_loc: ∅ │ │ │ │ │ └── block: ∅ │ │ │ │ ├── subsequent: │ │ │ │ │ @ ElseNode (location: (2,28)-(2,31)) @@ -83,6 +86,7 @@ │ │ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ │ │ ├── arguments: ∅ │ │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ │ ├── equal_loc: ∅ │ │ │ │ │ │ └── block: ∅ │ │ │ │ │ └── end_keyword_loc: ∅ │ │ │ │ └── end_keyword_loc: ∅ diff --git a/snapshots/seattlerb/do_bug.txt b/snapshots/seattlerb/do_bug.txt index 8d1a0b786c..591bbfc0f3 100644 --- a/snapshots/seattlerb/do_bug.txt +++ b/snapshots/seattlerb/do_bug.txt @@ -20,6 +20,7 @@ │ │ ├── flags: static_literal, decimal │ │ └── value: 1 │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ └── @ CallNode (location: (2,0)-(4,3)) ├── flags: newline @@ -33,6 +34,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── call_operator_loc: (2,1)-(2,2) = "." ├── name: :b @@ -40,6 +42,7 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: @ BlockNode (location: (2,4)-(4,3)) ├── flags: ∅ diff --git a/snapshots/seattlerb/dot2_nil__26.txt b/snapshots/seattlerb/dot2_nil__26.txt index fc5122055f..eb81e7a6a1 100644 --- a/snapshots/seattlerb/dot2_nil__26.txt +++ b/snapshots/seattlerb/dot2_nil__26.txt @@ -17,6 +17,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── right: ∅ └── operator_loc: (1,1)-(1,3) = ".." diff --git a/snapshots/seattlerb/dot3_nil__26.txt b/snapshots/seattlerb/dot3_nil__26.txt index c2277975db..3149e48d2b 100644 --- a/snapshots/seattlerb/dot3_nil__26.txt +++ b/snapshots/seattlerb/dot3_nil__26.txt @@ -17,6 +17,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── right: ∅ └── operator_loc: (1,1)-(1,4) = "..." diff --git a/snapshots/seattlerb/dstr_evstr.txt b/snapshots/seattlerb/dstr_evstr.txt index 143d8ff584..c3b5b23628 100644 --- a/snapshots/seattlerb/dstr_evstr.txt +++ b/snapshots/seattlerb/dstr_evstr.txt @@ -39,6 +39,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ └── closing_loc: (1,10)-(1,11) = "}" └── closing_loc: (1,11)-(1,12) = "\"" diff --git a/snapshots/seattlerb/dstr_evstr_empty_end.txt b/snapshots/seattlerb/dstr_evstr_empty_end.txt index 8e3ade63c9..de61550358 100644 --- a/snapshots/seattlerb/dstr_evstr_empty_end.txt +++ b/snapshots/seattlerb/dstr_evstr_empty_end.txt @@ -25,6 +25,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ └── closing_loc: (1,9)-(1,10) = "}" └── closing_loc: (1,10)-(1,11) = "\"" diff --git a/snapshots/seattlerb/dstr_lex_state.txt b/snapshots/seattlerb/dstr_lex_state.txt index 2bdeab0834..36afd84bd5 100644 --- a/snapshots/seattlerb/dstr_lex_state.txt +++ b/snapshots/seattlerb/dstr_lex_state.txt @@ -34,6 +34,7 @@ │ │ │ ├── closing_loc: ∅ │ │ │ └── unescaped: "a" │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ └── closing_loc: (1,6)-(1,7) = "}" └── closing_loc: (1,7)-(1,8) = "\"" diff --git a/snapshots/seattlerb/eq_begin_why_wont_people_use_their_spacebar.txt b/snapshots/seattlerb/eq_begin_why_wont_people_use_their_spacebar.txt index 5f6a3fe62e..fcb4da7534 100644 --- a/snapshots/seattlerb/eq_begin_why_wont_people_use_their_spacebar.txt +++ b/snapshots/seattlerb/eq_begin_why_wont_people_use_their_spacebar.txt @@ -17,6 +17,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── call_operator_loc: ∅ ├── name: :[]= @@ -35,6 +36,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ └── @ BeginNode (location: (1,5)-(3,8)) │ ├── flags: ∅ @@ -51,4 +53,5 @@ │ ├── ensure_clause: ∅ │ └── end_keyword_loc: (3,5)-(3,8) = "end" ├── closing_loc: (1,3)-(1,4) = "]" + ├── equal_loc: (1,4)-(1,5) = "=" └── block: ∅ diff --git a/snapshots/seattlerb/evstr_evstr.txt b/snapshots/seattlerb/evstr_evstr.txt index c8dba1c3e5..fc692727d1 100644 --- a/snapshots/seattlerb/evstr_evstr.txt +++ b/snapshots/seattlerb/evstr_evstr.txt @@ -25,6 +25,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── closing_loc: (1,4)-(1,5) = "}" │ └── @ EmbeddedStatementsNode (location: (1,5)-(1,9)) @@ -43,6 +44,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ └── closing_loc: (1,8)-(1,9) = "}" └── closing_loc: (1,9)-(1,10) = "\"" diff --git a/snapshots/seattlerb/evstr_str.txt b/snapshots/seattlerb/evstr_str.txt index 69a992b19a..1f279216e1 100644 --- a/snapshots/seattlerb/evstr_str.txt +++ b/snapshots/seattlerb/evstr_str.txt @@ -25,6 +25,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── closing_loc: (1,4)-(1,5) = "}" │ └── @ StringNode (location: (1,5)-(1,7)) diff --git a/snapshots/seattlerb/expr_not_bang.txt b/snapshots/seattlerb/expr_not_bang.txt index 868ef85648..f347268565 100644 --- a/snapshots/seattlerb/expr_not_bang.txt +++ b/snapshots/seattlerb/expr_not_bang.txt @@ -28,8 +28,10 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── call_operator_loc: ∅ ├── name: :! @@ -37,4 +39,5 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/seattlerb/flip2_env_lvar.txt b/snapshots/seattlerb/flip2_env_lvar.txt index def6ffaf3a..fc26c8a1da 100644 --- a/snapshots/seattlerb/flip2_env_lvar.txt +++ b/snapshots/seattlerb/flip2_env_lvar.txt @@ -21,6 +21,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── right: │ │ @ CallNode (location: (1,6)-(1,7)) @@ -32,6 +33,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ └── operator_loc: (1,4)-(1,6) = ".." ├── then_keyword_loc: (1,8)-(1,12) = "then" diff --git a/snapshots/seattlerb/heredoc_squiggly_blank_line_plus_interpolation.txt b/snapshots/seattlerb/heredoc_squiggly_blank_line_plus_interpolation.txt index ce8f1d7043..ebee7080a2 100644 --- a/snapshots/seattlerb/heredoc_squiggly_blank_line_plus_interpolation.txt +++ b/snapshots/seattlerb/heredoc_squiggly_blank_line_plus_interpolation.txt @@ -51,6 +51,7 @@ │ │ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ │ │ ├── arguments: ∅ │ │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ │ ├── equal_loc: ∅ │ │ │ │ │ │ └── block: ∅ │ │ │ │ │ └── closing_loc: (3,9)-(3,10) = "}" │ │ │ │ └── @ StringNode (location: (3,10)-(4,0)) @@ -66,7 +67,9 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── closing_loc: (1,19)-(1,20) = ")" + │ ├── equal_loc: ∅ │ └── block: ∅ └── operator_loc: (1,2)-(1,3) = "=" diff --git a/snapshots/seattlerb/heredoc_trailing_slash_continued_call.txt b/snapshots/seattlerb/heredoc_trailing_slash_continued_call.txt index 758a4c9122..e79e5d72e1 100644 --- a/snapshots/seattlerb/heredoc_trailing_slash_continued_call.txt +++ b/snapshots/seattlerb/heredoc_trailing_slash_continued_call.txt @@ -20,4 +20,5 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/seattlerb/if_symbol.txt b/snapshots/seattlerb/if_symbol.txt index d1680869f1..f01b04ed07 100644 --- a/snapshots/seattlerb/if_symbol.txt +++ b/snapshots/seattlerb/if_symbol.txt @@ -27,6 +27,7 @@ │ │ ├── closing_loc: ∅ │ │ └── unescaped: "x" │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── then_keyword_loc: ∅ ├── statements: ∅ diff --git a/snapshots/seattlerb/index_0.txt b/snapshots/seattlerb/index_0.txt index 186e84dd64..be4677bc0e 100644 --- a/snapshots/seattlerb/index_0.txt +++ b/snapshots/seattlerb/index_0.txt @@ -17,6 +17,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── call_operator_loc: ∅ ├── name: :[]= @@ -35,6 +36,8 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── closing_loc: (1,2)-(1,3) = "]" + ├── equal_loc: (1,4)-(1,5) = "=" └── block: ∅ diff --git a/snapshots/seattlerb/index_0_opasgn.txt b/snapshots/seattlerb/index_0_opasgn.txt index 036128546a..8f349f3ba0 100644 --- a/snapshots/seattlerb/index_0_opasgn.txt +++ b/snapshots/seattlerb/index_0_opasgn.txt @@ -17,6 +17,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── call_operator_loc: ∅ ├── opening_loc: (1,1)-(1,2) = "[" @@ -35,4 +36,5 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/seattlerb/iter_args_1.txt b/snapshots/seattlerb/iter_args_1.txt index 7c3e7a3e22..72ebb6b1bc 100644 --- a/snapshots/seattlerb/iter_args_1.txt +++ b/snapshots/seattlerb/iter_args_1.txt @@ -14,6 +14,7 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: @ BlockNode (location: (1,2)-(1,11)) ├── flags: ∅ diff --git a/snapshots/seattlerb/iter_args_10_1.txt b/snapshots/seattlerb/iter_args_10_1.txt index b8d908757a..cba3b4fac3 100644 --- a/snapshots/seattlerb/iter_args_10_1.txt +++ b/snapshots/seattlerb/iter_args_10_1.txt @@ -14,6 +14,7 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: @ BlockNode (location: (1,2)-(1,21)) ├── flags: ∅ diff --git a/snapshots/seattlerb/iter_args_10_2.txt b/snapshots/seattlerb/iter_args_10_2.txt index 4c668599e1..7f4c84ea6d 100644 --- a/snapshots/seattlerb/iter_args_10_2.txt +++ b/snapshots/seattlerb/iter_args_10_2.txt @@ -14,6 +14,7 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: @ BlockNode (location: (1,2)-(1,25)) ├── flags: ∅ diff --git a/snapshots/seattlerb/iter_args_11_1.txt b/snapshots/seattlerb/iter_args_11_1.txt index 6e08e008ed..d4ceaf6432 100644 --- a/snapshots/seattlerb/iter_args_11_1.txt +++ b/snapshots/seattlerb/iter_args_11_1.txt @@ -14,6 +14,7 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: @ BlockNode (location: (1,2)-(1,24)) ├── flags: ∅ diff --git a/snapshots/seattlerb/iter_args_11_2.txt b/snapshots/seattlerb/iter_args_11_2.txt index 04a15a3310..1d54d97293 100644 --- a/snapshots/seattlerb/iter_args_11_2.txt +++ b/snapshots/seattlerb/iter_args_11_2.txt @@ -14,6 +14,7 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: @ BlockNode (location: (1,2)-(1,28)) ├── flags: ∅ diff --git a/snapshots/seattlerb/iter_args_2__19.txt b/snapshots/seattlerb/iter_args_2__19.txt index 3015ea93c5..ad0945ce67 100644 --- a/snapshots/seattlerb/iter_args_2__19.txt +++ b/snapshots/seattlerb/iter_args_2__19.txt @@ -14,6 +14,7 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: @ BlockNode (location: (1,2)-(1,14)) ├── flags: ∅ diff --git a/snapshots/seattlerb/iter_args_3.txt b/snapshots/seattlerb/iter_args_3.txt index d85fd374aa..b3b6fea8a6 100644 --- a/snapshots/seattlerb/iter_args_3.txt +++ b/snapshots/seattlerb/iter_args_3.txt @@ -14,6 +14,7 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: @ BlockNode (location: (1,2)-(1,20)) ├── flags: ∅ diff --git a/snapshots/seattlerb/iter_args_4.txt b/snapshots/seattlerb/iter_args_4.txt index 8f5a7043fe..a3807082d4 100644 --- a/snapshots/seattlerb/iter_args_4.txt +++ b/snapshots/seattlerb/iter_args_4.txt @@ -14,6 +14,7 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: @ BlockNode (location: (1,2)-(1,16)) ├── flags: ∅ diff --git a/snapshots/seattlerb/iter_args_5.txt b/snapshots/seattlerb/iter_args_5.txt index 227703347d..d798ed935a 100644 --- a/snapshots/seattlerb/iter_args_5.txt +++ b/snapshots/seattlerb/iter_args_5.txt @@ -14,6 +14,7 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: @ BlockNode (location: (1,2)-(1,13)) ├── flags: ∅ diff --git a/snapshots/seattlerb/iter_args_6.txt b/snapshots/seattlerb/iter_args_6.txt index 40f75f5e83..f967af437d 100644 --- a/snapshots/seattlerb/iter_args_6.txt +++ b/snapshots/seattlerb/iter_args_6.txt @@ -14,6 +14,7 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: @ BlockNode (location: (1,2)-(1,18)) ├── flags: ∅ diff --git a/snapshots/seattlerb/iter_args_7_1.txt b/snapshots/seattlerb/iter_args_7_1.txt index fd0934b6f2..8e8a8e5743 100644 --- a/snapshots/seattlerb/iter_args_7_1.txt +++ b/snapshots/seattlerb/iter_args_7_1.txt @@ -14,6 +14,7 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: @ BlockNode (location: (1,2)-(1,18)) ├── flags: ∅ diff --git a/snapshots/seattlerb/iter_args_7_2.txt b/snapshots/seattlerb/iter_args_7_2.txt index 7fe4912654..5992dc47a6 100644 --- a/snapshots/seattlerb/iter_args_7_2.txt +++ b/snapshots/seattlerb/iter_args_7_2.txt @@ -14,6 +14,7 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: @ BlockNode (location: (1,2)-(1,22)) ├── flags: ∅ diff --git a/snapshots/seattlerb/iter_args_8_1.txt b/snapshots/seattlerb/iter_args_8_1.txt index 89d73272ed..7cccd4aa37 100644 --- a/snapshots/seattlerb/iter_args_8_1.txt +++ b/snapshots/seattlerb/iter_args_8_1.txt @@ -14,6 +14,7 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: @ BlockNode (location: (1,2)-(1,21)) ├── flags: ∅ diff --git a/snapshots/seattlerb/iter_args_8_2.txt b/snapshots/seattlerb/iter_args_8_2.txt index 5cb728ec55..5ecf92dd55 100644 --- a/snapshots/seattlerb/iter_args_8_2.txt +++ b/snapshots/seattlerb/iter_args_8_2.txt @@ -14,6 +14,7 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: @ BlockNode (location: (1,2)-(1,25)) ├── flags: ∅ diff --git a/snapshots/seattlerb/iter_args_9_1.txt b/snapshots/seattlerb/iter_args_9_1.txt index 8f47ae6b54..b243bea2c0 100644 --- a/snapshots/seattlerb/iter_args_9_1.txt +++ b/snapshots/seattlerb/iter_args_9_1.txt @@ -14,6 +14,7 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: @ BlockNode (location: (1,2)-(1,17)) ├── flags: ∅ diff --git a/snapshots/seattlerb/iter_args_9_2.txt b/snapshots/seattlerb/iter_args_9_2.txt index 686c249cbf..a16bb081d8 100644 --- a/snapshots/seattlerb/iter_args_9_2.txt +++ b/snapshots/seattlerb/iter_args_9_2.txt @@ -14,6 +14,7 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: @ BlockNode (location: (1,2)-(1,21)) ├── flags: ∅ diff --git a/snapshots/seattlerb/iter_kwarg.txt b/snapshots/seattlerb/iter_kwarg.txt index c5d5a74768..2c6c637ba6 100644 --- a/snapshots/seattlerb/iter_kwarg.txt +++ b/snapshots/seattlerb/iter_kwarg.txt @@ -14,6 +14,7 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: @ BlockNode (location: (1,2)-(1,12)) ├── flags: ∅ diff --git a/snapshots/seattlerb/iter_kwarg_kwsplat.txt b/snapshots/seattlerb/iter_kwarg_kwsplat.txt index bab054537b..333a6862ee 100644 --- a/snapshots/seattlerb/iter_kwarg_kwsplat.txt +++ b/snapshots/seattlerb/iter_kwarg_kwsplat.txt @@ -14,6 +14,7 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: @ BlockNode (location: (1,2)-(1,17)) ├── flags: ∅ diff --git a/snapshots/seattlerb/label_vs_string.txt b/snapshots/seattlerb/label_vs_string.txt index 1de1fd1ff7..4193626143 100644 --- a/snapshots/seattlerb/label_vs_string.txt +++ b/snapshots/seattlerb/label_vs_string.txt @@ -17,6 +17,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── call_operator_loc: ∅ ├── name: :<< @@ -33,4 +34,5 @@ │ ├── closing_loc: (2,0)-(2,1) = "'" │ └── unescaped: ":\n" ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/seattlerb/lambda_do_vs_brace.txt b/snapshots/seattlerb/lambda_do_vs_brace.txt index dc08fa4de3..25a83896ce 100644 --- a/snapshots/seattlerb/lambda_do_vs_brace.txt +++ b/snapshots/seattlerb/lambda_do_vs_brace.txt @@ -25,6 +25,7 @@ │ │ ├── parameters: ∅ │ │ └── body: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (3,0)-(3,7)) │ ├── flags: newline, ignore_visibility @@ -46,6 +47,7 @@ │ │ ├── parameters: ∅ │ │ └── body: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (5,0)-(5,13)) │ ├── flags: newline, ignore_visibility @@ -73,6 +75,7 @@ │ │ │ └── closing_loc: (5,5)-(5,6) = ")" │ │ └── body: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ └── @ CallNode (location: (7,0)-(7,9)) ├── flags: newline, ignore_visibility @@ -100,4 +103,5 @@ │ │ └── closing_loc: (7,5)-(7,6) = ")" │ └── body: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/seattlerb/lasgn_call_bracket_rescue_arg.txt b/snapshots/seattlerb/lasgn_call_bracket_rescue_arg.txt index e6fba67dbd..362273d3c0 100644 --- a/snapshots/seattlerb/lasgn_call_bracket_rescue_arg.txt +++ b/snapshots/seattlerb/lasgn_call_bracket_rescue_arg.txt @@ -29,6 +29,7 @@ │ │ │ ├── flags: static_literal, decimal │ │ │ └── value: 1 │ │ ├── closing_loc: (1,7)-(1,8) = ")" + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── keyword_loc: (1,9)-(1,15) = "rescue" │ └── rescue_expression: diff --git a/snapshots/seattlerb/lasgn_call_nobracket_rescue_arg.txt b/snapshots/seattlerb/lasgn_call_nobracket_rescue_arg.txt index 15e77296ce..a1c291bb86 100644 --- a/snapshots/seattlerb/lasgn_call_nobracket_rescue_arg.txt +++ b/snapshots/seattlerb/lasgn_call_nobracket_rescue_arg.txt @@ -29,6 +29,7 @@ │ │ │ ├── flags: static_literal, decimal │ │ │ └── value: 1 │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── keyword_loc: (1,8)-(1,14) = "rescue" │ └── rescue_expression: diff --git a/snapshots/seattlerb/lasgn_command.txt b/snapshots/seattlerb/lasgn_command.txt index 5aa47305c2..5f1f8bed95 100644 --- a/snapshots/seattlerb/lasgn_command.txt +++ b/snapshots/seattlerb/lasgn_command.txt @@ -23,6 +23,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: (1,5)-(1,6) = "." │ ├── name: :c @@ -36,5 +37,6 @@ │ │ ├── flags: static_literal, decimal │ │ └── value: 1 │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ └── operator_loc: (1,2)-(1,3) = "=" diff --git a/snapshots/seattlerb/lasgn_lasgn_command_call.txt b/snapshots/seattlerb/lasgn_lasgn_command_call.txt index 012be1771a..78a798b1fc 100644 --- a/snapshots/seattlerb/lasgn_lasgn_command_call.txt +++ b/snapshots/seattlerb/lasgn_lasgn_command_call.txt @@ -32,6 +32,7 @@ │ │ │ ├── flags: static_literal, decimal │ │ │ └── value: 1 │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ └── operator_loc: (1,6)-(1,7) = "=" └── operator_loc: (1,2)-(1,3) = "=" diff --git a/snapshots/seattlerb/lasgn_middle_splat.txt b/snapshots/seattlerb/lasgn_middle_splat.txt index ebd47f54b6..c4a16ce235 100644 --- a/snapshots/seattlerb/lasgn_middle_splat.txt +++ b/snapshots/seattlerb/lasgn_middle_splat.txt @@ -23,6 +23,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── @ SplatNode (location: (1,7)-(1,9)) │ │ │ ├── flags: ∅ @@ -37,6 +38,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── @ CallNode (location: (1,11)-(1,12)) │ │ ├── flags: variable_call, ignore_visibility @@ -47,6 +49,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── opening_loc: ∅ │ └── closing_loc: ∅ diff --git a/snapshots/seattlerb/masgn_anon_splat_arg.txt b/snapshots/seattlerb/masgn_anon_splat_arg.txt index e0546c4ba3..d3e4d73a8a 100644 --- a/snapshots/seattlerb/masgn_anon_splat_arg.txt +++ b/snapshots/seattlerb/masgn_anon_splat_arg.txt @@ -31,4 +31,5 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/seattlerb/masgn_arg_colon_arg.txt b/snapshots/seattlerb/masgn_arg_colon_arg.txt index 5c22571e91..c13344c7c6 100644 --- a/snapshots/seattlerb/masgn_arg_colon_arg.txt +++ b/snapshots/seattlerb/masgn_arg_colon_arg.txt @@ -24,6 +24,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: (1,4)-(1,6) = "::" │ ├── name: :c= @@ -43,4 +44,5 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/seattlerb/masgn_arg_ident.txt b/snapshots/seattlerb/masgn_arg_ident.txt index 83cd356423..79dcf7425a 100644 --- a/snapshots/seattlerb/masgn_arg_ident.txt +++ b/snapshots/seattlerb/masgn_arg_ident.txt @@ -24,6 +24,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: (1,4)-(1,5) = "." │ ├── name: :C= @@ -43,4 +44,5 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/seattlerb/masgn_arg_splat_arg.txt b/snapshots/seattlerb/masgn_arg_splat_arg.txt index c5a3b9433a..698212d4bb 100644 --- a/snapshots/seattlerb/masgn_arg_splat_arg.txt +++ b/snapshots/seattlerb/masgn_arg_splat_arg.txt @@ -39,4 +39,5 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/seattlerb/masgn_colon2.txt b/snapshots/seattlerb/masgn_colon2.txt index 59380bfcd6..299e8708da 100644 --- a/snapshots/seattlerb/masgn_colon2.txt +++ b/snapshots/seattlerb/masgn_colon2.txt @@ -24,6 +24,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── name: :C │ ├── delimiter_loc: (1,4)-(1,6) = "::" diff --git a/snapshots/seattlerb/masgn_command_call.txt b/snapshots/seattlerb/masgn_command_call.txt index 60162e0e42..5477439504 100644 --- a/snapshots/seattlerb/masgn_command_call.txt +++ b/snapshots/seattlerb/masgn_command_call.txt @@ -32,6 +32,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── call_operator_loc: (1,6)-(1,7) = "." ├── name: :c @@ -45,4 +46,5 @@ │ ├── flags: static_literal, decimal │ └── value: 1 ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/seattlerb/masgn_double_paren.txt b/snapshots/seattlerb/masgn_double_paren.txt index 7497801c26..cfb30f670b 100644 --- a/snapshots/seattlerb/masgn_double_paren.txt +++ b/snapshots/seattlerb/masgn_double_paren.txt @@ -38,4 +38,5 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/seattlerb/masgn_paren.txt b/snapshots/seattlerb/masgn_paren.txt index 6418b6e9fc..950e7551b3 100644 --- a/snapshots/seattlerb/masgn_paren.txt +++ b/snapshots/seattlerb/masgn_paren.txt @@ -34,6 +34,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── call_operator_loc: (1,10)-(1,11) = "." ├── name: :d @@ -41,4 +42,5 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/seattlerb/masgn_splat_arg.txt b/snapshots/seattlerb/masgn_splat_arg.txt index 0a80c9bbfd..29a38d9c6c 100644 --- a/snapshots/seattlerb/masgn_splat_arg.txt +++ b/snapshots/seattlerb/masgn_splat_arg.txt @@ -35,4 +35,5 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/seattlerb/masgn_splat_arg_arg.txt b/snapshots/seattlerb/masgn_splat_arg_arg.txt index 1bd31b5ffc..736f347004 100644 --- a/snapshots/seattlerb/masgn_splat_arg_arg.txt +++ b/snapshots/seattlerb/masgn_splat_arg_arg.txt @@ -39,4 +39,5 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/seattlerb/masgn_var_star_var.txt b/snapshots/seattlerb/masgn_var_star_var.txt index 6c92113ff6..c281a29432 100644 --- a/snapshots/seattlerb/masgn_var_star_var.txt +++ b/snapshots/seattlerb/masgn_var_star_var.txt @@ -35,4 +35,5 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/seattlerb/messy_op_asgn_lineno.txt b/snapshots/seattlerb/messy_op_asgn_lineno.txt index b11d08a747..99221e3ee6 100644 --- a/snapshots/seattlerb/messy_op_asgn_lineno.txt +++ b/snapshots/seattlerb/messy_op_asgn_lineno.txt @@ -56,11 +56,14 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── binary_operator: :* │ ├── opening_loc: (1,2)-(1,3) = "(" │ └── closing_loc: (1,14)-(1,15) = ")" ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/seattlerb/method_call_assoc_trailing_comma.txt b/snapshots/seattlerb/method_call_assoc_trailing_comma.txt index 62a45c5d8b..331bbac123 100644 --- a/snapshots/seattlerb/method_call_assoc_trailing_comma.txt +++ b/snapshots/seattlerb/method_call_assoc_trailing_comma.txt @@ -17,6 +17,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── call_operator_loc: (1,1)-(1,2) = "." ├── name: :f @@ -41,4 +42,5 @@ │ │ └── value: 2 │ └── operator_loc: (1,5)-(1,7) = "=>" ├── closing_loc: (1,9)-(1,10) = ")" + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/seattlerb/method_call_trailing_comma.txt b/snapshots/seattlerb/method_call_trailing_comma.txt index 6a3573ddfc..f6f3c3797b 100644 --- a/snapshots/seattlerb/method_call_trailing_comma.txt +++ b/snapshots/seattlerb/method_call_trailing_comma.txt @@ -17,6 +17,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── call_operator_loc: (1,1)-(1,2) = "." ├── name: :f @@ -30,4 +31,5 @@ │ ├── flags: static_literal, decimal │ └── value: 1 ├── closing_loc: (1,6)-(1,7) = ")" + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/seattlerb/mlhs_back_anonsplat.txt b/snapshots/seattlerb/mlhs_back_anonsplat.txt index 0cfc1b3c60..397875c012 100644 --- a/snapshots/seattlerb/mlhs_back_anonsplat.txt +++ b/snapshots/seattlerb/mlhs_back_anonsplat.txt @@ -39,4 +39,5 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/seattlerb/mlhs_back_splat.txt b/snapshots/seattlerb/mlhs_back_splat.txt index 1d9aab3830..a3de793fa3 100644 --- a/snapshots/seattlerb/mlhs_back_splat.txt +++ b/snapshots/seattlerb/mlhs_back_splat.txt @@ -43,4 +43,5 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/seattlerb/mlhs_front_anonsplat.txt b/snapshots/seattlerb/mlhs_front_anonsplat.txt index d98d4dedd3..bdcc1ae0fe 100644 --- a/snapshots/seattlerb/mlhs_front_anonsplat.txt +++ b/snapshots/seattlerb/mlhs_front_anonsplat.txt @@ -39,4 +39,5 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/seattlerb/mlhs_front_splat.txt b/snapshots/seattlerb/mlhs_front_splat.txt index 85016f0ca8..07a774572c 100644 --- a/snapshots/seattlerb/mlhs_front_splat.txt +++ b/snapshots/seattlerb/mlhs_front_splat.txt @@ -43,4 +43,5 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/seattlerb/mlhs_keyword.txt b/snapshots/seattlerb/mlhs_keyword.txt index 22a0391e4a..2f50494abf 100644 --- a/snapshots/seattlerb/mlhs_keyword.txt +++ b/snapshots/seattlerb/mlhs_keyword.txt @@ -17,6 +17,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── call_operator_loc: (1,1)-(1,2) = "." ├── name: :!= @@ -31,4 +32,5 @@ │ └── @ TrueNode (location: (1,11)-(1,15)) │ └── flags: static_literal ├── closing_loc: (1,15)-(1,16) = ")" + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/seattlerb/mlhs_mid_anonsplat.txt b/snapshots/seattlerb/mlhs_mid_anonsplat.txt index 7a0894db30..4fee84a519 100644 --- a/snapshots/seattlerb/mlhs_mid_anonsplat.txt +++ b/snapshots/seattlerb/mlhs_mid_anonsplat.txt @@ -51,4 +51,5 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/seattlerb/mlhs_mid_splat.txt b/snapshots/seattlerb/mlhs_mid_splat.txt index d7671b6fe6..6870875493 100644 --- a/snapshots/seattlerb/mlhs_mid_splat.txt +++ b/snapshots/seattlerb/mlhs_mid_splat.txt @@ -55,4 +55,5 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/seattlerb/mlhs_rescue.txt b/snapshots/seattlerb/mlhs_rescue.txt index d888306a9a..9c1342421c 100644 --- a/snapshots/seattlerb/mlhs_rescue.txt +++ b/snapshots/seattlerb/mlhs_rescue.txt @@ -34,6 +34,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── keyword_loc: (1,9)-(1,15) = "rescue" └── rescue_expression: diff --git a/snapshots/seattlerb/multiline_hash_declaration.txt b/snapshots/seattlerb/multiline_hash_declaration.txt index 7760698d13..e8e06c4408 100644 --- a/snapshots/seattlerb/multiline_hash_declaration.txt +++ b/snapshots/seattlerb/multiline_hash_declaration.txt @@ -36,6 +36,7 @@ │ │ │ └── closing_loc: (3,0)-(3,1) = "}" │ │ └── operator_loc: ∅ │ ├── closing_loc: (3,1)-(3,2) = ")" + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (5,0)-(6,2)) │ ├── flags: newline, ignore_visibility @@ -68,6 +69,7 @@ │ │ │ └── closing_loc: (6,0)-(6,1) = "}" │ │ └── operator_loc: ∅ │ ├── closing_loc: (6,1)-(6,2) = ")" + │ ├── equal_loc: ∅ │ └── block: ∅ └── @ CallNode (location: (8,0)-(8,12)) ├── flags: newline, ignore_visibility @@ -100,4 +102,5 @@ │ │ └── closing_loc: (8,10)-(8,11) = "}" │ └── operator_loc: ∅ ├── closing_loc: (8,11)-(8,12) = ")" + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/seattlerb/op_asgn_command_call.txt b/snapshots/seattlerb/op_asgn_command_call.txt index 810c203054..ca365aaf60 100644 --- a/snapshots/seattlerb/op_asgn_command_call.txt +++ b/snapshots/seattlerb/op_asgn_command_call.txt @@ -22,6 +22,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: (1,7)-(1,8) = "." │ ├── name: :c @@ -35,6 +36,7 @@ │ │ ├── flags: static_literal, decimal │ │ └── value: 2 │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── name: :a └── depth: 0 diff --git a/snapshots/seattlerb/op_asgn_dot_ident_command_call.txt b/snapshots/seattlerb/op_asgn_dot_ident_command_call.txt index 6f6fbb6dd9..9158482b93 100644 --- a/snapshots/seattlerb/op_asgn_dot_ident_command_call.txt +++ b/snapshots/seattlerb/op_asgn_dot_ident_command_call.txt @@ -32,4 +32,5 @@ │ ├── flags: static_literal, decimal │ └── value: 1 ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/seattlerb/op_asgn_index_command_call.txt b/snapshots/seattlerb/op_asgn_index_command_call.txt index ccf77c4823..23453cc431 100644 --- a/snapshots/seattlerb/op_asgn_index_command_call.txt +++ b/snapshots/seattlerb/op_asgn_index_command_call.txt @@ -17,6 +17,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── call_operator_loc: ∅ ├── opening_loc: (1,1)-(1,2) = "[" @@ -52,4 +53,5 @@ │ ├── flags: static_literal, decimal │ └── value: 2 ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/seattlerb/op_asgn_primary_colon_const_command_call.txt b/snapshots/seattlerb/op_asgn_primary_colon_const_command_call.txt index a86a9269e1..447fb848bd 100644 --- a/snapshots/seattlerb/op_asgn_primary_colon_const_command_call.txt +++ b/snapshots/seattlerb/op_asgn_primary_colon_const_command_call.txt @@ -39,7 +39,9 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ └── binary_operator: :* diff --git a/snapshots/seattlerb/op_asgn_primary_colon_identifier_command_call.txt b/snapshots/seattlerb/op_asgn_primary_colon_identifier_command_call.txt index ad52f68c10..e84e392df0 100644 --- a/snapshots/seattlerb/op_asgn_primary_colon_identifier_command_call.txt +++ b/snapshots/seattlerb/op_asgn_primary_colon_identifier_command_call.txt @@ -38,6 +38,8 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/seattlerb/op_asgn_val_dot_ident_command_call.txt b/snapshots/seattlerb/op_asgn_val_dot_ident_command_call.txt index 881bd60e63..4a2066f165 100644 --- a/snapshots/seattlerb/op_asgn_val_dot_ident_command_call.txt +++ b/snapshots/seattlerb/op_asgn_val_dot_ident_command_call.txt @@ -17,6 +17,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── call_operator_loc: (1,1)-(1,2) = "." ├── message_loc: (1,2)-(1,3) = "b" @@ -39,4 +40,5 @@ │ ├── flags: static_literal, decimal │ └── value: 1 ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/seattlerb/parse_if_not_canonical.txt b/snapshots/seattlerb/parse_if_not_canonical.txt index 23cc1f7929..efe91a7379 100644 --- a/snapshots/seattlerb/parse_if_not_canonical.txt +++ b/snapshots/seattlerb/parse_if_not_canonical.txt @@ -24,6 +24,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── call_operator_loc: (1,10)-(1,11) = "." │ │ ├── name: :nil? @@ -31,6 +32,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: ∅ │ ├── name: :! @@ -38,6 +40,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── then_keyword_loc: (1,16)-(1,20) = "then" ├── statements: diff --git a/snapshots/seattlerb/parse_if_not_noncanonical.txt b/snapshots/seattlerb/parse_if_not_noncanonical.txt index 23cc1f7929..efe91a7379 100644 --- a/snapshots/seattlerb/parse_if_not_noncanonical.txt +++ b/snapshots/seattlerb/parse_if_not_noncanonical.txt @@ -24,6 +24,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── call_operator_loc: (1,10)-(1,11) = "." │ │ ├── name: :nil? @@ -31,6 +32,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: ∅ │ ├── name: :! @@ -38,6 +40,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── then_keyword_loc: (1,16)-(1,20) = "then" ├── statements: diff --git a/snapshots/seattlerb/parse_line_block.txt b/snapshots/seattlerb/parse_line_block.txt index fcb4aee490..655450e4f4 100644 --- a/snapshots/seattlerb/parse_line_block.txt +++ b/snapshots/seattlerb/parse_line_block.txt @@ -31,4 +31,5 @@ │ ├── name: :a │ └── depth: 0 ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/seattlerb/parse_line_block_inline_comment.txt b/snapshots/seattlerb/parse_line_block_inline_comment.txt index 2cf5d6de00..d5cfa8b4cd 100644 --- a/snapshots/seattlerb/parse_line_block_inline_comment.txt +++ b/snapshots/seattlerb/parse_line_block_inline_comment.txt @@ -14,6 +14,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (2,0)-(2,1)) │ ├── flags: newline, variable_call, ignore_visibility @@ -24,6 +25,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ └── @ CallNode (location: (3,0)-(3,1)) ├── flags: newline, variable_call, ignore_visibility @@ -34,4 +36,5 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/seattlerb/parse_line_block_inline_comment_leading_newlines.txt b/snapshots/seattlerb/parse_line_block_inline_comment_leading_newlines.txt index f376453c0d..f3e49af954 100644 --- a/snapshots/seattlerb/parse_line_block_inline_comment_leading_newlines.txt +++ b/snapshots/seattlerb/parse_line_block_inline_comment_leading_newlines.txt @@ -14,6 +14,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (5,0)-(5,1)) │ ├── flags: newline, variable_call, ignore_visibility @@ -24,6 +25,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ └── @ CallNode (location: (7,0)-(7,1)) ├── flags: newline, variable_call, ignore_visibility @@ -34,4 +36,5 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/seattlerb/parse_line_block_inline_multiline_comment.txt b/snapshots/seattlerb/parse_line_block_inline_multiline_comment.txt index 21b6623652..ea1ef72ab5 100644 --- a/snapshots/seattlerb/parse_line_block_inline_multiline_comment.txt +++ b/snapshots/seattlerb/parse_line_block_inline_multiline_comment.txt @@ -14,6 +14,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (2,0)-(2,1)) │ ├── flags: newline, variable_call, ignore_visibility @@ -24,6 +25,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ └── @ CallNode (location: (4,0)-(4,1)) ├── flags: newline, variable_call, ignore_visibility @@ -34,4 +36,5 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/seattlerb/parse_line_call_ivar_arg_no_parens_line_break.txt b/snapshots/seattlerb/parse_line_call_ivar_arg_no_parens_line_break.txt index 9ed31de459..b4f4ecb161 100644 --- a/snapshots/seattlerb/parse_line_call_ivar_arg_no_parens_line_break.txt +++ b/snapshots/seattlerb/parse_line_call_ivar_arg_no_parens_line_break.txt @@ -20,4 +20,5 @@ │ ├── flags: ∅ │ └── name: :@b ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/seattlerb/parse_line_call_ivar_line_break_paren.txt b/snapshots/seattlerb/parse_line_call_ivar_line_break_paren.txt index 32dbc0f02a..49f24eea79 100644 --- a/snapshots/seattlerb/parse_line_call_ivar_line_break_paren.txt +++ b/snapshots/seattlerb/parse_line_call_ivar_line_break_paren.txt @@ -20,4 +20,5 @@ │ ├── flags: ∅ │ └── name: :@b ├── closing_loc: (2,0)-(2,1) = ")" + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/seattlerb/parse_line_call_no_args.txt b/snapshots/seattlerb/parse_line_call_no_args.txt index 03b657d687..d7f4c17368 100644 --- a/snapshots/seattlerb/parse_line_call_no_args.txt +++ b/snapshots/seattlerb/parse_line_call_no_args.txt @@ -14,6 +14,7 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: @ BlockNode (location: (1,2)-(3,3)) ├── flags: ∅ @@ -64,6 +65,7 @@ │ │ ├── name: :y │ │ └── depth: 0 │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── opening_loc: (1,2)-(1,4) = "do" └── closing_loc: (3,0)-(3,3) = "end" diff --git a/snapshots/seattlerb/parse_line_defn_complex.txt b/snapshots/seattlerb/parse_line_defn_complex.txt index fb4d1940f2..35c0fae8a6 100644 --- a/snapshots/seattlerb/parse_line_defn_complex.txt +++ b/snapshots/seattlerb/parse_line_defn_complex.txt @@ -43,6 +43,7 @@ │ │ │ ├── name: :y │ │ │ └── depth: 0 │ │ ├── closing_loc: (2,5)-(2,6) = ")" + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── @ LocalVariableOperatorWriteNode (location: (3,2)-(3,8)) │ │ ├── flags: newline diff --git a/snapshots/seattlerb/parse_line_dot2.txt b/snapshots/seattlerb/parse_line_dot2.txt index 29f6e68a18..ec0651a460 100644 --- a/snapshots/seattlerb/parse_line_dot2.txt +++ b/snapshots/seattlerb/parse_line_dot2.txt @@ -28,6 +28,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── right: │ │ @ CallNode (location: (4,0)-(4,1)) @@ -39,6 +40,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ └── operator_loc: (3,1)-(3,3) = ".." └── @ CallNode (location: (5,0)-(5,1)) @@ -50,4 +52,5 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/seattlerb/parse_line_dot2_open.txt b/snapshots/seattlerb/parse_line_dot2_open.txt index d368ac7654..88a12a3379 100644 --- a/snapshots/seattlerb/parse_line_dot2_open.txt +++ b/snapshots/seattlerb/parse_line_dot2_open.txt @@ -25,6 +25,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── right: ∅ │ └── operator_loc: (2,3)-(2,5) = ".." @@ -37,4 +38,5 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/seattlerb/parse_line_dot3.txt b/snapshots/seattlerb/parse_line_dot3.txt index 7515617cea..378a2e6d94 100644 --- a/snapshots/seattlerb/parse_line_dot3.txt +++ b/snapshots/seattlerb/parse_line_dot3.txt @@ -28,6 +28,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── right: │ │ @ CallNode (location: (4,0)-(4,1)) @@ -39,6 +40,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ └── operator_loc: (3,1)-(3,4) = "..." └── @ CallNode (location: (5,0)-(5,1)) @@ -50,4 +52,5 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/seattlerb/parse_line_dot3_open.txt b/snapshots/seattlerb/parse_line_dot3_open.txt index 789b490a28..f851cde85f 100644 --- a/snapshots/seattlerb/parse_line_dot3_open.txt +++ b/snapshots/seattlerb/parse_line_dot3_open.txt @@ -25,6 +25,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── right: ∅ │ └── operator_loc: (2,3)-(2,6) = "..." @@ -37,4 +38,5 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/seattlerb/parse_line_evstr_after_break.txt b/snapshots/seattlerb/parse_line_evstr_after_break.txt index 446534f7ca..1e1ca35daf 100644 --- a/snapshots/seattlerb/parse_line_evstr_after_break.txt +++ b/snapshots/seattlerb/parse_line_evstr_after_break.txt @@ -35,6 +35,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── closing_loc: (2,4)-(2,5) = "}" │ └── closing_loc: (2,5)-(2,6) = "\"" diff --git a/snapshots/seattlerb/parse_line_heredoc.txt b/snapshots/seattlerb/parse_line_heredoc.txt index e2c8e8a159..e858c7777c 100644 --- a/snapshots/seattlerb/parse_line_heredoc.txt +++ b/snapshots/seattlerb/parse_line_heredoc.txt @@ -26,6 +26,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ └── operator_loc: (1,13)-(1,14) = "=" └── @ CallNode (location: (4,6)-(4,17)) @@ -44,4 +45,5 @@ │ ├── name: :string │ └── depth: 0 ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/seattlerb/parse_line_heredoc_evstr.txt b/snapshots/seattlerb/parse_line_heredoc_evstr.txt index 68b3300430..ff34a3bc17 100644 --- a/snapshots/seattlerb/parse_line_heredoc_evstr.txt +++ b/snapshots/seattlerb/parse_line_heredoc_evstr.txt @@ -31,6 +31,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── closing_loc: (3,3)-(3,4) = "}" │ └── @ StringNode (location: (3,4)-(4,0)) diff --git a/snapshots/seattlerb/parse_line_heredoc_regexp_chars.txt b/snapshots/seattlerb/parse_line_heredoc_regexp_chars.txt index a188a8ff41..013f4f230d 100644 --- a/snapshots/seattlerb/parse_line_heredoc_regexp_chars.txt +++ b/snapshots/seattlerb/parse_line_heredoc_regexp_chars.txt @@ -34,4 +34,5 @@ │ ├── name: :string │ └── depth: 0 ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/seattlerb/parse_line_iter_call_no_parens.txt b/snapshots/seattlerb/parse_line_iter_call_no_parens.txt index d9ec88b3bb..edd3ef1d31 100644 --- a/snapshots/seattlerb/parse_line_iter_call_no_parens.txt +++ b/snapshots/seattlerb/parse_line_iter_call_no_parens.txt @@ -25,8 +25,10 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: @ BlockNode (location: (1,4)-(3,3)) ├── flags: ∅ @@ -77,6 +79,7 @@ │ │ ├── name: :y │ │ └── depth: 0 │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── opening_loc: (1,4)-(1,6) = "do" └── closing_loc: (3,0)-(3,3) = "end" diff --git a/snapshots/seattlerb/parse_line_iter_call_parens.txt b/snapshots/seattlerb/parse_line_iter_call_parens.txt index 27ea8d2e3e..1956e1bdd6 100644 --- a/snapshots/seattlerb/parse_line_iter_call_parens.txt +++ b/snapshots/seattlerb/parse_line_iter_call_parens.txt @@ -25,8 +25,10 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── closing_loc: (1,3)-(1,4) = ")" + ├── equal_loc: ∅ └── block: @ BlockNode (location: (1,5)-(3,3)) ├── flags: ∅ @@ -77,6 +79,7 @@ │ │ ├── name: :y │ │ └── depth: 0 │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── opening_loc: (1,5)-(1,7) = "do" └── closing_loc: (3,0)-(3,3) = "end" diff --git a/snapshots/seattlerb/parse_line_op_asgn.txt b/snapshots/seattlerb/parse_line_op_asgn.txt index f2c62b60d1..4c7805d08a 100644 --- a/snapshots/seattlerb/parse_line_op_asgn.txt +++ b/snapshots/seattlerb/parse_line_op_asgn.txt @@ -19,6 +19,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── name: :foo │ ├── binary_operator: :+ @@ -32,4 +33,5 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/seattlerb/parse_line_postexe.txt b/snapshots/seattlerb/parse_line_postexe.txt index afa30a72c0..ef17b63fa0 100644 --- a/snapshots/seattlerb/parse_line_postexe.txt +++ b/snapshots/seattlerb/parse_line_postexe.txt @@ -20,6 +20,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── keyword_loc: (1,0)-(1,3) = "END" ├── opening_loc: (1,4)-(1,5) = "{" diff --git a/snapshots/seattlerb/parse_line_preexe.txt b/snapshots/seattlerb/parse_line_preexe.txt index 4c670f30f6..a106d56fc2 100644 --- a/snapshots/seattlerb/parse_line_preexe.txt +++ b/snapshots/seattlerb/parse_line_preexe.txt @@ -20,6 +20,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── keyword_loc: (1,0)-(1,5) = "BEGIN" ├── opening_loc: (1,6)-(1,7) = "{" diff --git a/snapshots/seattlerb/parse_line_rescue.txt b/snapshots/seattlerb/parse_line_rescue.txt index f56eb4fbe1..a935d2501f 100644 --- a/snapshots/seattlerb/parse_line_rescue.txt +++ b/snapshots/seattlerb/parse_line_rescue.txt @@ -21,6 +21,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── rescue_clause: │ @ RescueNode (location: (3,0)-(6,3)) @@ -43,6 +44,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ └── subsequent: │ @ RescueNode (location: (5,0)-(6,3)) @@ -65,6 +67,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ └── subsequent: ∅ ├── else_clause: ∅ diff --git a/snapshots/seattlerb/parse_line_str_with_newline_escape.txt b/snapshots/seattlerb/parse_line_str_with_newline_escape.txt index 307e2af5f7..27b4af6f04 100644 --- a/snapshots/seattlerb/parse_line_str_with_newline_escape.txt +++ b/snapshots/seattlerb/parse_line_str_with_newline_escape.txt @@ -25,4 +25,5 @@ │ └── @ TrueNode (location: (1,8)-(1,12)) │ └── flags: static_literal ├── closing_loc: (1,12)-(1,13) = ")" + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/seattlerb/parse_line_to_ary.txt b/snapshots/seattlerb/parse_line_to_ary.txt index d1b21f313c..be3856aabd 100644 --- a/snapshots/seattlerb/parse_line_to_ary.txt +++ b/snapshots/seattlerb/parse_line_to_ary.txt @@ -31,6 +31,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ └── @ CallNode (location: (3,0)-(3,1)) ├── flags: newline, variable_call, ignore_visibility @@ -41,4 +42,5 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/seattlerb/parse_line_trailing_newlines.txt b/snapshots/seattlerb/parse_line_trailing_newlines.txt index 459c13e9f5..f523401767 100644 --- a/snapshots/seattlerb/parse_line_trailing_newlines.txt +++ b/snapshots/seattlerb/parse_line_trailing_newlines.txt @@ -14,6 +14,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ └── @ CallNode (location: (2,0)-(2,1)) ├── flags: newline, variable_call, ignore_visibility @@ -24,4 +25,5 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/seattlerb/parse_opt_call_args_assocs_comma.txt b/snapshots/seattlerb/parse_opt_call_args_assocs_comma.txt index d60a693d0e..6842ba3e53 100644 --- a/snapshots/seattlerb/parse_opt_call_args_assocs_comma.txt +++ b/snapshots/seattlerb/parse_opt_call_args_assocs_comma.txt @@ -34,4 +34,5 @@ │ │ └── value: 3 │ └── operator_loc: (1,3)-(1,5) = "=>" ├── closing_loc: (1,7)-(1,8) = "]" + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/seattlerb/parse_opt_call_args_lit_comma.txt b/snapshots/seattlerb/parse_opt_call_args_lit_comma.txt index 753464b393..80ad331093 100644 --- a/snapshots/seattlerb/parse_opt_call_args_lit_comma.txt +++ b/snapshots/seattlerb/parse_opt_call_args_lit_comma.txt @@ -23,4 +23,5 @@ │ ├── flags: static_literal, decimal │ └── value: 2 ├── closing_loc: (1,4)-(1,5) = "]" + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/seattlerb/parse_pattern_044.txt b/snapshots/seattlerb/parse_pattern_044.txt index 0aca275aa0..310928d523 100644 --- a/snapshots/seattlerb/parse_pattern_044.txt +++ b/snapshots/seattlerb/parse_pattern_044.txt @@ -17,6 +17,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── conditions: (length: 1) │ └── @ InNode (location: (2,0)-(3,6)) diff --git a/snapshots/seattlerb/parse_until_not_canonical.txt b/snapshots/seattlerb/parse_until_not_canonical.txt index 11a77c10d5..792c34a71b 100644 --- a/snapshots/seattlerb/parse_until_not_canonical.txt +++ b/snapshots/seattlerb/parse_until_not_canonical.txt @@ -26,6 +26,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── call_operator_loc: (1,13)-(1,14) = "." │ │ ├── name: :nil? @@ -33,6 +34,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: ∅ │ ├── name: :! @@ -40,6 +42,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ └── statements: @ StatementsNode (location: (2,2)-(2,7)) diff --git a/snapshots/seattlerb/parse_until_not_noncanonical.txt b/snapshots/seattlerb/parse_until_not_noncanonical.txt index 11a77c10d5..792c34a71b 100644 --- a/snapshots/seattlerb/parse_until_not_noncanonical.txt +++ b/snapshots/seattlerb/parse_until_not_noncanonical.txt @@ -26,6 +26,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── call_operator_loc: (1,13)-(1,14) = "." │ │ ├── name: :nil? @@ -33,6 +34,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: ∅ │ ├── name: :! @@ -40,6 +42,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ └── statements: @ StatementsNode (location: (2,2)-(2,7)) diff --git a/snapshots/seattlerb/parse_while_not_canonical.txt b/snapshots/seattlerb/parse_while_not_canonical.txt index 618ebb72db..9100273a4d 100644 --- a/snapshots/seattlerb/parse_while_not_canonical.txt +++ b/snapshots/seattlerb/parse_while_not_canonical.txt @@ -26,6 +26,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── call_operator_loc: (1,13)-(1,14) = "." │ │ ├── name: :nil? @@ -33,6 +34,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: ∅ │ ├── name: :! @@ -40,6 +42,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ └── statements: @ StatementsNode (location: (2,2)-(2,7)) diff --git a/snapshots/seattlerb/parse_while_not_noncanonical.txt b/snapshots/seattlerb/parse_while_not_noncanonical.txt index 618ebb72db..9100273a4d 100644 --- a/snapshots/seattlerb/parse_while_not_noncanonical.txt +++ b/snapshots/seattlerb/parse_while_not_noncanonical.txt @@ -26,6 +26,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── call_operator_loc: (1,13)-(1,14) = "." │ │ ├── name: :nil? @@ -33,6 +34,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: ∅ │ ├── name: :! @@ -40,6 +42,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ └── statements: @ StatementsNode (location: (2,2)-(2,7)) diff --git a/snapshots/seattlerb/pipe_semicolon.txt b/snapshots/seattlerb/pipe_semicolon.txt index 14b4ad4d54..2830158dd1 100644 --- a/snapshots/seattlerb/pipe_semicolon.txt +++ b/snapshots/seattlerb/pipe_semicolon.txt @@ -17,6 +17,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── call_operator_loc: (1,1)-(1,2) = "." ├── name: :b @@ -24,6 +25,7 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: @ BlockNode (location: (1,4)-(1,18)) ├── flags: ∅ diff --git a/snapshots/seattlerb/pipe_space.txt b/snapshots/seattlerb/pipe_space.txt index 00aba740dd..aea2e19695 100644 --- a/snapshots/seattlerb/pipe_space.txt +++ b/snapshots/seattlerb/pipe_space.txt @@ -17,6 +17,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── call_operator_loc: (1,1)-(1,2) = "." ├── name: :b @@ -24,6 +25,7 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: @ BlockNode (location: (1,4)-(1,14)) ├── flags: ∅ diff --git a/snapshots/seattlerb/qsymbols_interp.txt b/snapshots/seattlerb/qsymbols_interp.txt index 844decfc43..4d2ffbaede 100644 --- a/snapshots/seattlerb/qsymbols_interp.txt +++ b/snapshots/seattlerb/qsymbols_interp.txt @@ -49,6 +49,7 @@ │ │ │ │ │ ├── flags: static_literal, decimal │ │ │ │ │ └── value: 1 │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ └── closing_loc: (1,11)-(1,12) = "}" │ │ └── closing_loc: ∅ diff --git a/snapshots/seattlerb/quoted_symbol_hash_arg.txt b/snapshots/seattlerb/quoted_symbol_hash_arg.txt index 9484ed9d04..0b38975740 100644 --- a/snapshots/seattlerb/quoted_symbol_hash_arg.txt +++ b/snapshots/seattlerb/quoted_symbol_hash_arg.txt @@ -36,4 +36,5 @@ │ │ └── closing_loc: (1,11)-(1,12) = "}" │ └── operator_loc: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/seattlerb/rescue_do_end_ensure_result.txt b/snapshots/seattlerb/rescue_do_end_ensure_result.txt index bc3c34446b..b82a5bbe6d 100644 --- a/snapshots/seattlerb/rescue_do_end_ensure_result.txt +++ b/snapshots/seattlerb/rescue_do_end_ensure_result.txt @@ -17,6 +17,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (1,5)-(5,3)) │ ├── flags: ∅ @@ -62,4 +63,5 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/seattlerb/rescue_do_end_no_raise.txt b/snapshots/seattlerb/rescue_do_end_no_raise.txt index d68a7b980f..54dc129f87 100644 --- a/snapshots/seattlerb/rescue_do_end_no_raise.txt +++ b/snapshots/seattlerb/rescue_do_end_no_raise.txt @@ -14,6 +14,7 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: @ BlockNode (location: (1,4)-(9,3)) ├── flags: ∅ diff --git a/snapshots/seattlerb/rescue_do_end_raised.txt b/snapshots/seattlerb/rescue_do_end_raised.txt index 53b77c1ea5..4da067406c 100644 --- a/snapshots/seattlerb/rescue_do_end_raised.txt +++ b/snapshots/seattlerb/rescue_do_end_raised.txt @@ -14,6 +14,7 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: @ BlockNode (location: (1,4)-(5,3)) ├── flags: ∅ @@ -36,6 +37,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── rescue_clause: ∅ │ ├── else_clause: ∅ diff --git a/snapshots/seattlerb/rescue_do_end_rescued.txt b/snapshots/seattlerb/rescue_do_end_rescued.txt index 3f0efc2f59..acbd737b1d 100644 --- a/snapshots/seattlerb/rescue_do_end_rescued.txt +++ b/snapshots/seattlerb/rescue_do_end_rescued.txt @@ -14,6 +14,7 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: @ BlockNode (location: (1,4)-(9,3)) ├── flags: ∅ @@ -36,6 +37,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── rescue_clause: │ │ @ RescueNode (location: (3,0)-(4,9)) diff --git a/snapshots/seattlerb/rescue_in_block.txt b/snapshots/seattlerb/rescue_in_block.txt index a45766a4f3..56c3f91e31 100644 --- a/snapshots/seattlerb/rescue_in_block.txt +++ b/snapshots/seattlerb/rescue_in_block.txt @@ -14,6 +14,7 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: @ BlockNode (location: (1,5)-(4,3)) ├── flags: ∅ @@ -45,6 +46,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── subsequent: ∅ │ ├── else_clause: ∅ diff --git a/snapshots/seattlerb/rescue_parens.txt b/snapshots/seattlerb/rescue_parens.txt index 2232ebb7a5..4940b736c8 100644 --- a/snapshots/seattlerb/rescue_parens.txt +++ b/snapshots/seattlerb/rescue_parens.txt @@ -34,6 +34,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── keyword_loc: (1,5)-(1,11) = "rescue" │ │ └── rescue_expression: @@ -46,8 +47,10 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── opening_loc: (1,2)-(1,3) = "(" │ └── closing_loc: (1,13)-(1,14) = ")" ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/seattlerb/return_call_assocs.txt b/snapshots/seattlerb/return_call_assocs.txt index 58c34b41d6..7ba81a364b 100644 --- a/snapshots/seattlerb/return_call_assocs.txt +++ b/snapshots/seattlerb/return_call_assocs.txt @@ -109,6 +109,7 @@ │ │ │ └── value: 1 │ │ └── operator_loc: (5,11)-(5,13) = "=>" │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ ReturnNode (location: (7,0)-(7,12)) │ ├── flags: newline @@ -146,6 +147,7 @@ │ │ │ └── value: 1 │ │ └── operator_loc: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ ReturnNode (location: (9,0)-(9,13)) │ ├── flags: newline @@ -183,6 +185,7 @@ │ │ │ └── value: 1 │ │ └── operator_loc: ∅ │ ├── closing_loc: (9,12)-(9,13) = ")" + │ ├── equal_loc: ∅ │ └── block: ∅ └── @ ReturnNode (location: (11,0)-(11,14)) ├── flags: newline @@ -217,6 +220,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── value: │ │ @ IntegerNode (location: (11,12)-(11,13)) @@ -224,4 +228,5 @@ │ │ └── value: 1 │ └── operator_loc: (11,10)-(11,12) = "=>" ├── closing_loc: (11,13)-(11,14) = ")" + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/seattlerb/safe_attrasgn.txt b/snapshots/seattlerb/safe_attrasgn.txt index cb849e3f05..db552e4a92 100644 --- a/snapshots/seattlerb/safe_attrasgn.txt +++ b/snapshots/seattlerb/safe_attrasgn.txt @@ -17,6 +17,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── call_operator_loc: (1,1)-(1,3) = "&." ├── name: :b= @@ -30,4 +31,5 @@ │ ├── flags: static_literal, decimal │ └── value: 1 ├── closing_loc: ∅ + ├── equal_loc: (1,5)-(1,6) = "=" └── block: ∅ diff --git a/snapshots/seattlerb/safe_attrasgn_constant.txt b/snapshots/seattlerb/safe_attrasgn_constant.txt index dc37648a08..04d47f4675 100644 --- a/snapshots/seattlerb/safe_attrasgn_constant.txt +++ b/snapshots/seattlerb/safe_attrasgn_constant.txt @@ -17,6 +17,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── call_operator_loc: (1,1)-(1,3) = "&." ├── name: :B= @@ -30,4 +31,5 @@ │ ├── flags: static_literal, decimal │ └── value: 1 ├── closing_loc: ∅ + ├── equal_loc: (1,5)-(1,6) = "=" └── block: ∅ diff --git a/snapshots/seattlerb/safe_call.txt b/snapshots/seattlerb/safe_call.txt index 7faa6ac04e..54d8f588d7 100644 --- a/snapshots/seattlerb/safe_call.txt +++ b/snapshots/seattlerb/safe_call.txt @@ -17,6 +17,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── call_operator_loc: (1,1)-(1,3) = "&." ├── name: :b @@ -24,4 +25,5 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/seattlerb/safe_call_after_newline.txt b/snapshots/seattlerb/safe_call_after_newline.txt index f55fcdd21b..d3f6b79759 100644 --- a/snapshots/seattlerb/safe_call_after_newline.txt +++ b/snapshots/seattlerb/safe_call_after_newline.txt @@ -17,6 +17,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── call_operator_loc: (2,0)-(2,2) = "&." ├── name: :b @@ -24,4 +25,5 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/seattlerb/safe_call_dot_parens.txt b/snapshots/seattlerb/safe_call_dot_parens.txt index b4d8616f38..5c97b1351a 100644 --- a/snapshots/seattlerb/safe_call_dot_parens.txt +++ b/snapshots/seattlerb/safe_call_dot_parens.txt @@ -17,6 +17,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── call_operator_loc: (1,1)-(1,3) = "&." ├── name: :call @@ -24,4 +25,5 @@ ├── opening_loc: (1,3)-(1,4) = "(" ├── arguments: ∅ ├── closing_loc: (1,4)-(1,5) = ")" + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/seattlerb/safe_call_newline.txt b/snapshots/seattlerb/safe_call_newline.txt index 7faa6ac04e..54d8f588d7 100644 --- a/snapshots/seattlerb/safe_call_newline.txt +++ b/snapshots/seattlerb/safe_call_newline.txt @@ -17,6 +17,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── call_operator_loc: (1,1)-(1,3) = "&." ├── name: :b @@ -24,4 +25,5 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/seattlerb/safe_call_operator.txt b/snapshots/seattlerb/safe_call_operator.txt index 918cbe1828..6be552b4c1 100644 --- a/snapshots/seattlerb/safe_call_operator.txt +++ b/snapshots/seattlerb/safe_call_operator.txt @@ -17,6 +17,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── call_operator_loc: (1,1)-(1,3) = "&." ├── name: :> @@ -30,4 +31,5 @@ │ ├── flags: static_literal, decimal │ └── value: 1 ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/seattlerb/safe_call_rhs_newline.txt b/snapshots/seattlerb/safe_call_rhs_newline.txt index 50d03b7044..37e32fab4a 100644 --- a/snapshots/seattlerb/safe_call_rhs_newline.txt +++ b/snapshots/seattlerb/safe_call_rhs_newline.txt @@ -23,6 +23,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: (1,5)-(1,7) = "&." │ ├── name: :b @@ -30,5 +31,6 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ └── operator_loc: (1,2)-(1,3) = "=" diff --git a/snapshots/seattlerb/safe_calls.txt b/snapshots/seattlerb/safe_calls.txt index 5d853af648..4004aa882d 100644 --- a/snapshots/seattlerb/safe_calls.txt +++ b/snapshots/seattlerb/safe_calls.txt @@ -20,6 +20,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: (1,1)-(1,3) = "&." │ ├── name: :b @@ -27,6 +28,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── call_operator_loc: (1,4)-(1,6) = "&." ├── name: :c @@ -40,4 +42,5 @@ │ ├── flags: static_literal, decimal │ └── value: 1 ├── closing_loc: (1,9)-(1,10) = ")" + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/seattlerb/safe_op_asgn.txt b/snapshots/seattlerb/safe_op_asgn.txt index 31ad5a813d..8abb5bf82b 100644 --- a/snapshots/seattlerb/safe_op_asgn.txt +++ b/snapshots/seattlerb/safe_op_asgn.txt @@ -17,6 +17,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── call_operator_loc: (1,1)-(1,3) = "&." ├── message_loc: (1,3)-(1,4) = "b" @@ -40,4 +41,5 @@ │ ├── flags: static_literal, decimal │ └── value: 1 ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/seattlerb/safe_op_asgn2.txt b/snapshots/seattlerb/safe_op_asgn2.txt index 81d42aac63..2e5a80ad15 100644 --- a/snapshots/seattlerb/safe_op_asgn2.txt +++ b/snapshots/seattlerb/safe_op_asgn2.txt @@ -17,6 +17,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── call_operator_loc: (1,1)-(1,3) = "&." ├── message_loc: (1,3)-(1,4) = "b" @@ -33,4 +34,5 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/seattlerb/slashy_newlines_within_string.txt b/snapshots/seattlerb/slashy_newlines_within_string.txt index 061e67ca6a..5cc044993e 100644 --- a/snapshots/seattlerb/slashy_newlines_within_string.txt +++ b/snapshots/seattlerb/slashy_newlines_within_string.txt @@ -23,6 +23,7 @@ │ │ ├── closing_loc: (4,7)-(4,8) = "\"" │ │ └── unescaped: "hello my dear friend" │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ └── @ CallNode (location: (6,0)-(6,5)) ├── flags: newline @@ -36,6 +37,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── call_operator_loc: ∅ ├── name: :+ @@ -54,6 +56,8 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/seattlerb/stabby_block_iter_call.txt b/snapshots/seattlerb/stabby_block_iter_call.txt index 9769563607..232727ee9d 100644 --- a/snapshots/seattlerb/stabby_block_iter_call.txt +++ b/snapshots/seattlerb/stabby_block_iter_call.txt @@ -45,6 +45,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: (2,1)-(2,2) = "." │ ├── name: :b @@ -52,6 +53,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (2,4)-(3,3)) │ ├── flags: ∅ @@ -61,4 +63,5 @@ │ ├── opening_loc: (2,4)-(2,6) = "do" │ └── closing_loc: (3,0)-(3,3) = "end" ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/seattlerb/stabby_block_iter_call_no_target_with_arg.txt b/snapshots/seattlerb/stabby_block_iter_call_no_target_with_arg.txt index 5d60be6e86..a75e64faf0 100644 --- a/snapshots/seattlerb/stabby_block_iter_call_no_target_with_arg.txt +++ b/snapshots/seattlerb/stabby_block_iter_call_no_target_with_arg.txt @@ -48,6 +48,7 @@ │ │ ├── flags: static_literal, decimal │ │ └── value: 1 │ ├── closing_loc: (2,3)-(2,4) = ")" + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (2,5)-(3,3)) │ ├── flags: ∅ @@ -57,4 +58,5 @@ │ ├── opening_loc: (2,5)-(2,7) = "do" │ └── closing_loc: (3,0)-(3,3) = "end" ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/seattlerb/str_backslashes.txt b/snapshots/seattlerb/str_backslashes.txt index e73793beb8..48a119c73a 100644 --- a/snapshots/seattlerb/str_backslashes.txt +++ b/snapshots/seattlerb/str_backslashes.txt @@ -23,4 +23,5 @@ │ ├── closing_loc: (1,203)-(1,204) = "'" │ └── unescaped: "\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n" ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/seattlerb/str_double_double_escaped_newline.txt b/snapshots/seattlerb/str_double_double_escaped_newline.txt index fa7444d7e7..5187bfb43c 100644 --- a/snapshots/seattlerb/str_double_double_escaped_newline.txt +++ b/snapshots/seattlerb/str_double_double_escaped_newline.txt @@ -23,6 +23,7 @@ │ │ ├── closing_loc: (1,6)-(1,7) = "\"" │ │ └── unescaped: "\\n" │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ └── @ CallNode (location: (1,8)-(1,9)) ├── flags: newline, variable_call, ignore_visibility @@ -33,4 +34,5 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/seattlerb/str_double_escaped_newline.txt b/snapshots/seattlerb/str_double_escaped_newline.txt index c91c913919..4c61b94ef8 100644 --- a/snapshots/seattlerb/str_double_escaped_newline.txt +++ b/snapshots/seattlerb/str_double_escaped_newline.txt @@ -23,6 +23,7 @@ │ │ ├── closing_loc: (1,5)-(1,6) = "\"" │ │ └── unescaped: "\n" │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ └── @ CallNode (location: (1,7)-(1,8)) ├── flags: newline, variable_call, ignore_visibility @@ -33,4 +34,5 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/seattlerb/str_double_newline.txt b/snapshots/seattlerb/str_double_newline.txt index 7809a9aaff..83283ddca6 100644 --- a/snapshots/seattlerb/str_double_newline.txt +++ b/snapshots/seattlerb/str_double_newline.txt @@ -23,6 +23,7 @@ │ │ ├── closing_loc: (2,0)-(2,1) = "\"" │ │ └── unescaped: "\n" │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ └── @ CallNode (location: (2,2)-(2,3)) ├── flags: newline, variable_call, ignore_visibility @@ -33,4 +34,5 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/seattlerb/str_evstr.txt b/snapshots/seattlerb/str_evstr.txt index 98b65f00f8..05bedf388b 100644 --- a/snapshots/seattlerb/str_evstr.txt +++ b/snapshots/seattlerb/str_evstr.txt @@ -31,6 +31,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ └── closing_loc: (1,6)-(1,7) = "}" └── closing_loc: (1,7)-(1,8) = "\"" diff --git a/snapshots/seattlerb/str_evstr_escape.txt b/snapshots/seattlerb/str_evstr_escape.txt index f6559cc822..0f4e8c8e31 100644 --- a/snapshots/seattlerb/str_evstr_escape.txt +++ b/snapshots/seattlerb/str_evstr_escape.txt @@ -31,6 +31,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── closing_loc: (1,6)-(1,7) = "}" │ └── @ StringNode (location: (1,7)-(1,15)) diff --git a/snapshots/seattlerb/str_heredoc_interp.txt b/snapshots/seattlerb/str_heredoc_interp.txt index 1261eec6c3..e6f09298c6 100644 --- a/snapshots/seattlerb/str_heredoc_interp.txt +++ b/snapshots/seattlerb/str_heredoc_interp.txt @@ -25,6 +25,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── closing_loc: (2,3)-(2,4) = "}" │ └── @ StringNode (location: (2,4)-(4,0)) diff --git a/snapshots/seattlerb/str_interp_ternary_or_label.txt b/snapshots/seattlerb/str_interp_ternary_or_label.txt index 8161109337..72a3cf7898 100644 --- a/snapshots/seattlerb/str_interp_ternary_or_label.txt +++ b/snapshots/seattlerb/str_interp_ternary_or_label.txt @@ -32,6 +32,7 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ ├── call_operator_loc: (1,4)-(1,5) = "." │ │ │ ├── name: :b? @@ -39,6 +40,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── then_keyword_loc: (1,8)-(1,9) = "?" │ │ ├── statements: @@ -74,8 +76,10 @@ │ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ │ ├── arguments: ∅ │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ ├── equal_loc: ∅ │ │ │ │ │ └── block: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ ├── call_operator_loc: ∅ │ │ │ ├── name: :+ @@ -92,6 +96,7 @@ │ │ │ │ ├── closing_loc: (1,16)-(1,17) = "\"" │ │ │ │ └── unescaped: "" │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── subsequent: │ │ │ @ ElseNode (location: (1,17)-(1,21)) diff --git a/snapshots/seattlerb/str_pct_Q_nested.txt b/snapshots/seattlerb/str_pct_Q_nested.txt index 76a0f5a5cf..00c3239b59 100644 --- a/snapshots/seattlerb/str_pct_Q_nested.txt +++ b/snapshots/seattlerb/str_pct_Q_nested.txt @@ -31,6 +31,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── closing_loc: (1,17)-(1,18) = "}" │ └── @ StringNode (location: (1,18)-(1,25)) diff --git a/snapshots/seattlerb/str_single_double_escaped_newline.txt b/snapshots/seattlerb/str_single_double_escaped_newline.txt index 2187edc92d..8ac56ccc00 100644 --- a/snapshots/seattlerb/str_single_double_escaped_newline.txt +++ b/snapshots/seattlerb/str_single_double_escaped_newline.txt @@ -23,6 +23,7 @@ │ │ ├── closing_loc: (1,6)-(1,7) = "'" │ │ └── unescaped: "\\n" │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ └── @ CallNode (location: (1,8)-(1,9)) ├── flags: newline, variable_call, ignore_visibility @@ -33,4 +34,5 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/seattlerb/str_single_escaped_newline.txt b/snapshots/seattlerb/str_single_escaped_newline.txt index 36028e09d0..a0f1bd6649 100644 --- a/snapshots/seattlerb/str_single_escaped_newline.txt +++ b/snapshots/seattlerb/str_single_escaped_newline.txt @@ -23,6 +23,7 @@ │ │ ├── closing_loc: (1,5)-(1,6) = "'" │ │ └── unescaped: "\\n" │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ └── @ CallNode (location: (1,7)-(1,8)) ├── flags: newline, variable_call, ignore_visibility @@ -33,4 +34,5 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/seattlerb/str_single_newline.txt b/snapshots/seattlerb/str_single_newline.txt index b53d1ed81a..7c0f8b02f0 100644 --- a/snapshots/seattlerb/str_single_newline.txt +++ b/snapshots/seattlerb/str_single_newline.txt @@ -23,6 +23,7 @@ │ │ ├── closing_loc: (2,0)-(2,1) = "'" │ │ └── unescaped: "\n" │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ └── @ CallNode (location: (2,2)-(2,3)) ├── flags: newline, variable_call, ignore_visibility @@ -33,4 +34,5 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/seattlerb/symbol_list.txt b/snapshots/seattlerb/symbol_list.txt index 6ee21564bb..aa4f3663b5 100644 --- a/snapshots/seattlerb/symbol_list.txt +++ b/snapshots/seattlerb/symbol_list.txt @@ -28,6 +28,7 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ └── closing_loc: (1,6)-(1,7) = "}" │ │ └── closing_loc: ∅ @@ -51,6 +52,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── closing_loc: (1,11)-(1,12) = "}" │ └── closing_loc: ∅ diff --git a/snapshots/seattlerb/thingy.txt b/snapshots/seattlerb/thingy.txt index edbcd8e25b..abe6266076 100644 --- a/snapshots/seattlerb/thingy.txt +++ b/snapshots/seattlerb/thingy.txt @@ -17,6 +17,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: (1,1)-(1,2) = "." │ ├── name: :call @@ -30,6 +31,7 @@ │ │ ├── flags: static_literal, decimal │ │ └── value: 42 │ ├── closing_loc: (1,5)-(1,6) = ")" + │ ├── equal_loc: ∅ │ └── block: ∅ └── @ CallNode (location: (3,0)-(3,7)) ├── flags: newline @@ -43,6 +45,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── call_operator_loc: (3,1)-(3,3) = "::" ├── name: :call @@ -56,4 +59,5 @@ │ ├── flags: static_literal, decimal │ └── value: 42 ├── closing_loc: (3,6)-(3,7) = ")" + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/seattlerb/unary_minus.txt b/snapshots/seattlerb/unary_minus.txt index d10ff3a89e..9e05d56c76 100644 --- a/snapshots/seattlerb/unary_minus.txt +++ b/snapshots/seattlerb/unary_minus.txt @@ -17,6 +17,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── call_operator_loc: ∅ ├── name: :-@ @@ -24,4 +25,5 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/seattlerb/unary_plus.txt b/snapshots/seattlerb/unary_plus.txt index 11cb2ebabd..5305fe5d4e 100644 --- a/snapshots/seattlerb/unary_plus.txt +++ b/snapshots/seattlerb/unary_plus.txt @@ -17,6 +17,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── call_operator_loc: ∅ ├── name: :+@ @@ -24,4 +25,5 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/seattlerb/unary_plus_on_literal.txt b/snapshots/seattlerb/unary_plus_on_literal.txt index 3431fd6cfe..d7c1e1d6d9 100644 --- a/snapshots/seattlerb/unary_plus_on_literal.txt +++ b/snapshots/seattlerb/unary_plus_on_literal.txt @@ -20,4 +20,5 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/seattlerb/unary_tilde.txt b/snapshots/seattlerb/unary_tilde.txt index 52a4fa8630..a039b5dc30 100644 --- a/snapshots/seattlerb/unary_tilde.txt +++ b/snapshots/seattlerb/unary_tilde.txt @@ -17,6 +17,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── call_operator_loc: ∅ ├── name: :~ @@ -24,4 +25,5 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/seattlerb/utf8_bom.txt b/snapshots/seattlerb/utf8_bom.txt index c26bb1741b..2977bbb5cb 100644 --- a/snapshots/seattlerb/utf8_bom.txt +++ b/snapshots/seattlerb/utf8_bom.txt @@ -20,4 +20,5 @@ │ ├── flags: static_literal, decimal │ └── value: 0 ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/seattlerb/when_splat.txt b/snapshots/seattlerb/when_splat.txt index 6df6e77397..eab233c4fc 100644 --- a/snapshots/seattlerb/when_splat.txt +++ b/snapshots/seattlerb/when_splat.txt @@ -17,6 +17,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── conditions: (length: 1) │ └── @ WhenNode (location: (1,8)-(1,20)) @@ -36,6 +37,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── then_keyword_loc: (1,16)-(1,20) = "then" │ └── statements: ∅ diff --git a/snapshots/single_method_call_with_bang.txt b/snapshots/single_method_call_with_bang.txt index 8baca8888d..946e4a3b6b 100644 --- a/snapshots/single_method_call_with_bang.txt +++ b/snapshots/single_method_call_with_bang.txt @@ -14,4 +14,5 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/spanning_heredoc.txt b/snapshots/spanning_heredoc.txt index 06fda1bda4..57bbe9fc77 100644 --- a/snapshots/spanning_heredoc.txt +++ b/snapshots/spanning_heredoc.txt @@ -57,8 +57,10 @@ │ │ │ ├── closing_loc: (7,5)-(7,6) = "\"" │ │ │ └── unescaped: "" │ │ ├── closing_loc: (7,6)-(7,7) = ")" + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (10,0)-(13,2)) │ ├── flags: newline, ignore_visibility @@ -95,6 +97,7 @@ │ │ │ └── unescaped: "d" │ │ └── closing_loc: (13,1)-(13,2) = "\"" │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (16,0)-(19,2)) │ ├── flags: newline, ignore_visibility @@ -131,6 +134,7 @@ │ │ │ └── unescaped: "f" │ │ └── closing_loc: (19,1)-(19,2) = "]" │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (22,0)-(25,2)) │ ├── flags: newline, ignore_visibility @@ -167,6 +171,7 @@ │ │ │ └── unescaped: "h" │ │ └── closing_loc: (25,1)-(25,2) = "]" │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (28,0)-(31,2)) │ ├── flags: newline, ignore_visibility @@ -203,6 +208,7 @@ │ │ ├── opening_loc: (28,9)-(28,12) = "%w[" │ │ └── closing_loc: (31,1)-(31,2) = "]" │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (35,0)-(38,2)) │ ├── flags: newline, ignore_visibility @@ -244,6 +250,7 @@ │ │ ├── opening_loc: (35,9)-(35,12) = "%W[" │ │ └── closing_loc: (38,1)-(38,2) = "]" │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (41,0)-(44,2)) │ ├── flags: newline, ignore_visibility @@ -280,6 +287,7 @@ │ │ ├── opening_loc: (41,9)-(41,12) = "%i[" │ │ └── closing_loc: (44,1)-(44,2) = "]" │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (48,0)-(51,2)) │ ├── flags: newline, ignore_visibility @@ -321,6 +329,7 @@ │ │ ├── opening_loc: (48,9)-(48,12) = "%I[" │ │ └── closing_loc: (51,1)-(51,2) = "]" │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ StringNode (location: (53,0)-(53,3)) │ ├── flags: newline @@ -366,6 +375,7 @@ │ │ │ ├── closing_loc: (55,12)-(55,13) = "'" │ │ │ └── unescaped: "" │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ └── targets: (length: 1) │ └── @ LocalVariableTargetNode (location: (53,5)-(55,7)) diff --git a/snapshots/spanning_heredoc_newlines.txt b/snapshots/spanning_heredoc_newlines.txt index ce57ca9662..976d5d28dc 100644 --- a/snapshots/spanning_heredoc_newlines.txt +++ b/snapshots/spanning_heredoc_newlines.txt @@ -29,6 +29,7 @@ │ │ ├── closing_loc: (3,0)-(4,0) = "\n" │ │ └── unescaped: "" │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (5,0)-(8,0)) │ ├── flags: newline @@ -54,6 +55,7 @@ │ │ ├── closing_loc: (7,0)-(8,0) = "\n" │ │ └── unescaped: "" │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (9,0)-(12,0)) │ ├── flags: newline @@ -79,6 +81,7 @@ │ │ ├── closing_loc: (11,0)-(12,0) = "\n" │ │ └── unescaped: "" │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (13,0)-(16,0)) │ ├── flags: newline @@ -104,6 +107,7 @@ │ │ ├── closing_loc: (15,0)-(16,0) = "\n" │ │ └── unescaped: "" │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (17,0)-(20,0)) │ ├── flags: newline @@ -129,6 +133,7 @@ │ │ ├── closing_loc: (19,0)-(20,0) = "\n" │ │ └── unescaped: "" │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ └── @ CallNode (location: (21,0)-(24,0)) ├── flags: newline @@ -154,4 +159,5 @@ │ ├── closing_loc: (23,0)-(24,0) = "\n" │ └── unescaped: "" ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/string_concatination_frozen_false.txt b/snapshots/string_concatination_frozen_false.txt index 7346f8266e..f1361edbce 100644 --- a/snapshots/string_concatination_frozen_false.txt +++ b/snapshots/string_concatination_frozen_false.txt @@ -64,6 +64,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── closing_loc: (5,21)-(5,22) = "}" │ └── closing_loc: (5,22)-(5,23) = "\"" diff --git a/snapshots/string_concatination_frozen_true.txt b/snapshots/string_concatination_frozen_true.txt index e5263e8906..9d1f44666f 100644 --- a/snapshots/string_concatination_frozen_true.txt +++ b/snapshots/string_concatination_frozen_true.txt @@ -64,6 +64,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── closing_loc: (5,21)-(5,22) = "}" │ └── closing_loc: (5,22)-(5,23) = "\"" diff --git a/snapshots/strings.txt b/snapshots/strings.txt index 315c98e94f..f2727f22fa 100644 --- a/snapshots/strings.txt +++ b/snapshots/strings.txt @@ -138,6 +138,7 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ └── closing_loc: (35,11)-(35,12) = "}" │ │ └── @ StringNode (location: (35,12)-(35,16)) @@ -177,6 +178,7 @@ │ │ ├── closing_loc: (41,4)-(41,5) = "\"" │ │ └── unescaped: "bar" │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ StringNode (location: (43,0)-(46,1)) │ ├── flags: newline @@ -252,6 +254,7 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ └── closing_loc: (64,10)-(64,11) = "}" │ │ └── @ StringNode (location: (64,11)-(64,15)) @@ -393,6 +396,7 @@ │ │ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ │ │ ├── arguments: ∅ │ │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ │ ├── equal_loc: ∅ │ │ │ │ │ │ └── block: ∅ │ │ │ │ │ └── closing_loc: (79,8)-(79,9) = "}" │ │ │ │ └── @ StringNode (location: (79,9)-(80,3)) @@ -428,6 +432,7 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ └── closing_loc: (81,9)-(81,10) = "}" │ │ └── closing_loc: ∅ @@ -715,6 +720,7 @@ │ │ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ │ │ ├── arguments: ∅ │ │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ │ ├── equal_loc: ∅ │ │ │ │ │ │ └── block: ∅ │ │ │ │ │ └── closing_loc: (132,9)-(132,10) = "}" │ │ │ │ └── @ StringNode (location: (132,10)-(132,11)) diff --git a/snapshots/symbols.txt b/snapshots/symbols.txt index 5d988e7313..05b960b1a0 100644 --- a/snapshots/symbols.txt +++ b/snapshots/symbols.txt @@ -31,6 +31,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── closing_loc: (3,7)-(3,8) = "}" │ └── closing_loc: (3,8)-(3,9) = "\"" diff --git a/snapshots/ternary_operator.txt b/snapshots/ternary_operator.txt index 4d6a7423f9..c7a38ffd83 100644 --- a/snapshots/ternary_operator.txt +++ b/snapshots/ternary_operator.txt @@ -18,6 +18,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── then_keyword_loc: (1,2)-(1,3) = "?" │ ├── statements: @@ -33,6 +34,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── subsequent: │ │ @ ElseNode (location: (1,6)-(1,9)) @@ -51,6 +53,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── end_keyword_loc: ∅ │ └── end_keyword_loc: ∅ @@ -67,6 +70,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── then_keyword_loc: (3,2)-(3,3) = "?" │ ├── statements: @@ -86,6 +90,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── rparen_loc: ∅ │ │ └── keyword_loc: (3,4)-(3,12) = "defined?" @@ -110,6 +115,7 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ ├── rparen_loc: ∅ │ │ │ └── keyword_loc: (3,17)-(3,25) = "defined?" @@ -128,6 +134,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── then_keyword_loc: (5,6)-(5,7) = "?" │ ├── statements: @@ -161,6 +168,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── then_keyword_loc: (7,6)-(7,7) = "?" │ ├── statements: @@ -194,6 +202,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── then_keyword_loc: (9,6)-(9,7) = "?" │ ├── statements: @@ -227,6 +236,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── then_keyword_loc: (11,2)-(11,3) = "?" │ ├── statements: @@ -260,6 +270,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── then_keyword_loc: (13,2)-(13,3) = "?" │ ├── statements: @@ -275,6 +286,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── subsequent: │ │ @ ElseNode (location: (13,8)-(13,14)) @@ -293,6 +305,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── end_keyword_loc: ∅ │ └── end_keyword_loc: ∅ @@ -309,6 +322,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── then_keyword_loc: (15,4)-(15,5) = "?" ├── statements: diff --git a/snapshots/unless.txt b/snapshots/unless.txt index 9e62b0c0a9..62b659193d 100644 --- a/snapshots/unless.txt +++ b/snapshots/unless.txt @@ -73,6 +73,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (8,4)-(8,25)) │ ├── flags: ∅ @@ -110,6 +111,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (10,4)-(10,24)) │ ├── flags: ∅ @@ -168,6 +170,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── then_keyword_loc: ∅ ├── statements: @@ -198,6 +201,7 @@ │ │ ├── closing_loc: ∅ │ │ └── unescaped: "b" │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── else_clause: ∅ └── end_keyword_loc: ∅ diff --git a/snapshots/unparser/corpus/literal/assignment.txt b/snapshots/unparser/corpus/literal/assignment.txt index 4e4ed86e7b..501492a43d 100644 --- a/snapshots/unparser/corpus/literal/assignment.txt +++ b/snapshots/unparser/corpus/literal/assignment.txt @@ -652,6 +652,7 @@ │ │ ├── opening_loc: (25,9)-(25,10) = "(" │ │ ├── arguments: ∅ │ │ ├── closing_loc: (25,10)-(25,11) = ")" + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ └── operator_loc: (25,4)-(25,5) = "=" ├── @ CallNode (location: (26,0)-(26,9)) @@ -667,6 +668,7 @@ │ ├── opening_loc: (26,7)-(26,8) = "(" │ ├── arguments: ∅ │ ├── closing_loc: (26,8)-(26,9) = ")" + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (27,0)-(27,13)) │ ├── flags: newline @@ -690,6 +692,7 @@ │ │ ├── flags: static_literal, decimal │ │ └── value: 2 │ ├── closing_loc: (27,12)-(27,13) = ")" + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (28,0)-(28,11)) │ ├── flags: newline @@ -709,6 +712,7 @@ │ │ └── @ TrueNode (location: (28,7)-(28,11)) │ │ └── flags: static_literal │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (29,0)-(29,19)) │ ├── flags: newline, attribute_write @@ -738,6 +742,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── @ CallNode (location: (29,14)-(29,19)) │ │ ├── flags: variable_call, ignore_visibility @@ -748,8 +753,10 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── closing_loc: (29,10)-(29,11) = "]" + │ ├── equal_loc: (29,12)-(29,13) = "=" │ └── block: ∅ ├── @ CallNode (location: (30,0)-(30,17)) │ ├── flags: newline, attribute_write @@ -786,8 +793,10 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── closing_loc: (30,8)-(30,9) = "]" + │ ├── equal_loc: (30,10)-(30,11) = "=" │ └── block: ∅ ├── @ CallNode (location: (31,0)-(31,9)) │ ├── flags: newline, attribute_write @@ -808,6 +817,7 @@ │ │ ├── flags: static_literal, decimal │ │ └── value: 1 │ ├── closing_loc: (31,4)-(31,5) = "]" + │ ├── equal_loc: (31,6)-(31,7) = "=" │ └── block: ∅ ├── @ CallNode (location: (32,0)-(32,17)) │ ├── flags: newline, attribute_write @@ -841,8 +851,10 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── closing_loc: (32,8)-(32,9) = "]" + │ ├── equal_loc: (32,10)-(32,11) = "=" │ └── block: ∅ ├── @ CallNode (location: (33,0)-(33,18)) │ ├── flags: newline, attribute_write @@ -868,6 +880,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── @ CallNode (location: (33,13)-(33,18)) │ │ ├── flags: variable_call, ignore_visibility @@ -878,8 +891,10 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── closing_loc: (33,9)-(33,10) = "]" + │ ├── equal_loc: (33,11)-(33,12) = "=" │ └── block: ∅ ├── @ LocalVariableWriteNode (location: (34,0)-(34,7)) │ ├── flags: newline @@ -916,6 +931,7 @@ │ │ ├── closing_loc: (35,6)-(35,7) = ")" │ │ └── unescaped: "" │ ├── closing_loc: ∅ + │ ├── equal_loc: (35,3)-(35,4) = "=" │ └── block: ∅ ├── @ CallNode (location: (36,0)-(36,12)) │ ├── flags: newline, attribute_write @@ -947,8 +963,10 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── closing_loc: (36,5)-(36,6) = "]" + │ ├── equal_loc: (36,7)-(36,8) = "=" │ └── block: ∅ ├── @ IndexOrWriteNode (location: (37,0)-(37,14)) │ ├── flags: newline @@ -982,6 +1000,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ InstanceVariableOrWriteNode (location: (38,0)-(38,10)) │ ├── flags: newline @@ -1062,6 +1081,7 @@ │ │ │ └── unescaped: "\n" │ │ └── closing_loc: (44,0)-(45,0) = "HEREDOC\n" │ ├── closing_loc: ∅ + │ ├── equal_loc: (42,3)-(42,4) = "=" │ └── block: ∅ ├── @ CallNode (location: (45,0)-(45,16)) │ ├── flags: newline, attribute_write @@ -1101,6 +1121,7 @@ │ │ │ └── unescaped: "\n" │ │ └── closing_loc: (47,0)-(48,0) = "HEREDOC\n" │ ├── closing_loc: (45,2)-(45,3) = "]" + │ ├── equal_loc: (45,4)-(45,5) = "=" │ └── block: ∅ ├── @ IndexOrWriteNode (location: (48,0)-(48,21)) │ ├── flags: newline @@ -1150,6 +1171,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ └── @ InstanceVariableOrWriteNode (location: (51,0)-(51,17)) ├── flags: newline diff --git a/snapshots/unparser/corpus/literal/block.txt b/snapshots/unparser/corpus/literal/block.txt index 38fc6f48d9..8eb3db2db6 100644 --- a/snapshots/unparser/corpus/literal/block.txt +++ b/snapshots/unparser/corpus/literal/block.txt @@ -14,6 +14,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (1,4)-(2,1)) │ ├── flags: ∅ @@ -31,6 +32,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (3,4)-(4,1)) │ ├── flags: ∅ @@ -66,6 +68,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (5,4)-(6,1)) │ ├── flags: ∅ @@ -103,6 +106,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (7,4)-(8,1)) │ ├── flags: ∅ @@ -143,6 +147,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (9,4)-(10,1)) │ ├── flags: ∅ @@ -187,6 +192,7 @@ │ │ ├── flags: static_literal, decimal │ │ └── value: 1 │ ├── closing_loc: (11,5)-(11,6) = ")" + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (11,7)-(13,1)) │ ├── flags: ∅ @@ -209,6 +215,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (14,4)-(16,1)) │ ├── flags: ∅ @@ -254,6 +261,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (17,4)-(19,1)) │ ├── flags: ∅ @@ -299,6 +307,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (20,4)-(22,1)) │ ├── flags: ∅ @@ -317,6 +326,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── opening_loc: (20,4)-(20,5) = "{" │ └── closing_loc: (22,0)-(22,1) = "}" @@ -332,6 +342,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: (23,3)-(23,4) = "." │ ├── name: :bar @@ -339,6 +350,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (23,8)-(25,1)) │ ├── flags: ∅ @@ -388,6 +400,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── opening_loc: (23,8)-(23,9) = "{" │ └── closing_loc: (25,0)-(25,1) = "}" @@ -403,6 +416,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: (26,3)-(26,4) = "." │ ├── name: :bar @@ -410,6 +424,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (26,8)-(27,1)) │ ├── flags: ∅ @@ -453,6 +468,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: (28,3)-(28,4) = "." │ ├── name: :bar @@ -460,6 +476,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (28,8)-(29,1)) │ ├── flags: ∅ @@ -501,6 +518,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: (30,3)-(30,4) = "." │ ├── name: :bar @@ -508,6 +526,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (30,8)-(31,1)) │ ├── flags: ∅ @@ -540,6 +559,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: (32,3)-(32,4) = "." │ ├── name: :bar @@ -547,6 +567,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (32,8)-(34,1)) │ ├── flags: ∅ @@ -585,6 +606,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── opening_loc: (32,8)-(32,9) = "{" │ └── closing_loc: (34,0)-(34,1) = "}" @@ -600,6 +622,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: (35,3)-(35,4) = "." │ ├── name: :bar @@ -607,6 +630,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (35,8)-(37,1)) │ ├── flags: ∅ @@ -651,6 +675,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── opening_loc: (35,8)-(35,9) = "{" │ └── closing_loc: (37,0)-(37,1) = "}" @@ -666,6 +691,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: (38,3)-(38,4) = "." │ ├── name: :bar @@ -673,6 +699,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (38,8)-(40,1)) │ ├── flags: ∅ @@ -724,6 +751,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── opening_loc: (38,8)-(38,9) = "{" │ └── closing_loc: (40,0)-(40,1) = "}" @@ -739,6 +767,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: (41,3)-(41,4) = "." │ ├── name: :bar @@ -746,6 +775,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (41,8)-(43,1)) │ ├── flags: ∅ @@ -800,6 +830,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── opening_loc: (41,8)-(41,9) = "{" │ └── closing_loc: (43,0)-(43,1) = "}" @@ -815,6 +846,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: (44,3)-(44,4) = "." │ ├── name: :bar @@ -822,6 +854,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (44,8)-(46,1)) │ ├── flags: ∅ @@ -868,6 +901,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── opening_loc: (44,8)-(44,9) = "{" │ └── closing_loc: (46,0)-(46,1) = "}" @@ -886,6 +920,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── call_operator_loc: (47,3)-(47,4) = "." │ │ ├── name: :bar @@ -893,6 +928,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: │ │ @ BlockNode (location: (47,8)-(48,1)) │ │ ├── flags: ∅ @@ -907,6 +943,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (49,0)-(51,3)) │ ├── flags: newline, ignore_visibility @@ -917,6 +954,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (49,2)-(51,3)) │ ├── flags: ∅ @@ -958,6 +996,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (52,2)-(56,3)) │ ├── flags: ∅ @@ -980,6 +1019,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── rescue_clause: │ │ │ @ RescueNode (location: (54,0)-(55,5)) @@ -1019,6 +1059,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (57,2)-(61,3)) │ ├── flags: ∅ @@ -1041,6 +1082,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── rescue_clause: │ │ │ @ RescueNode (location: (59,0)-(60,5)) @@ -1063,6 +1105,7 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ ├── operator_loc: ∅ │ │ │ ├── reference: ∅ @@ -1080,6 +1123,7 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ └── subsequent: ∅ │ │ ├── else_clause: ∅ @@ -1096,6 +1140,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (62,2)-(66,3)) │ ├── flags: ∅ @@ -1118,6 +1163,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── rescue_clause: │ │ │ @ RescueNode (location: (64,0)-(65,5)) @@ -1140,6 +1186,7 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ ├── operator_loc: (64,23)-(64,25) = "=>" │ │ │ ├── reference: @@ -1161,6 +1208,7 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ └── subsequent: ∅ │ │ ├── else_clause: ∅ @@ -1177,6 +1225,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (67,2)-(71,3)) │ ├── flags: ∅ @@ -1199,6 +1248,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── rescue_clause: │ │ │ @ RescueNode (location: (69,0)-(70,5)) @@ -1218,6 +1268,7 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ ├── operator_loc: ∅ │ │ │ ├── reference: ∅ @@ -1235,6 +1286,7 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ └── subsequent: ∅ │ │ ├── else_clause: ∅ @@ -1251,6 +1303,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (72,2)-(75,3)) │ ├── flags: ∅ @@ -1273,6 +1326,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── rescue_clause: │ │ │ @ RescueNode (location: (74,0)-(74,16)) @@ -1301,6 +1355,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (76,2)-(81,3)) │ ├── flags: ∅ @@ -1323,6 +1378,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── rescue_clause: │ │ │ @ RescueNode (location: (78,0)-(78,6)) @@ -1351,6 +1407,7 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ └── end_keyword_loc: (81,0)-(81,3) = "end" │ │ ├── ensure_clause: ∅ @@ -1366,6 +1423,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (82,2)-(86,3)) │ ├── flags: ∅ @@ -1388,6 +1446,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── rescue_clause: │ │ │ @ RescueNode (location: (84,0)-(85,5)) @@ -1407,6 +1466,7 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ ├── operator_loc: (84,12)-(84,14) = "=>" │ │ │ ├── reference: @@ -1428,6 +1488,7 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ └── subsequent: ∅ │ │ ├── else_clause: ∅ @@ -1444,6 +1505,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (87,2)-(89,3)) │ ├── flags: ∅ @@ -1474,6 +1536,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (90,2)-(93,3)) │ ├── flags: ∅ @@ -1513,6 +1576,7 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: @ BlockNode (location: (94,4)-(96,1)) ├── flags: ∅ @@ -1545,6 +1609,7 @@ │ │ ├── name: :_2 │ │ └── depth: 0 │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── opening_loc: (94,4)-(94,5) = "{" └── closing_loc: (96,0)-(96,1) = "}" diff --git a/snapshots/unparser/corpus/literal/case.txt b/snapshots/unparser/corpus/literal/case.txt index 5e831cc6c3..f78a03a72e 100644 --- a/snapshots/unparser/corpus/literal/case.txt +++ b/snapshots/unparser/corpus/literal/case.txt @@ -22,6 +22,7 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ ├── then_keyword_loc: ∅ │ │ │ └── statements: @@ -37,6 +38,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── @ WhenNode (location: (4,0)-(5,5)) │ │ ├── flags: ∅ @@ -51,6 +53,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── then_keyword_loc: ∅ │ │ └── statements: @@ -66,6 +69,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── else_clause: ∅ │ ├── case_keyword_loc: (1,0)-(1,4) = "case" @@ -82,6 +86,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── conditions: (length: 2) │ │ ├── @ WhenNode (location: (8,0)-(8,8)) @@ -97,6 +102,7 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ ├── then_keyword_loc: ∅ │ │ │ └── statements: ∅ @@ -113,6 +119,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── then_keyword_loc: ∅ │ │ └── statements: @@ -128,6 +135,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── else_clause: ∅ │ ├── case_keyword_loc: (7,0)-(7,4) = "case" @@ -144,6 +152,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── conditions: (length: 2) │ │ ├── @ WhenNode (location: (13,0)-(14,5)) @@ -159,6 +168,7 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ ├── then_keyword_loc: ∅ │ │ │ └── statements: @@ -174,6 +184,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── @ WhenNode (location: (15,0)-(16,5)) │ │ ├── flags: ∅ @@ -188,6 +199,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── then_keyword_loc: ∅ │ │ └── statements: @@ -203,6 +215,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── else_clause: ∅ │ ├── case_keyword_loc: (12,0)-(12,4) = "case" @@ -219,6 +232,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── conditions: (length: 1) │ │ └── @ WhenNode (location: (19,0)-(20,8)) @@ -234,6 +248,7 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ └── @ CallNode (location: (19,10)-(19,13)) │ │ │ ├── flags: variable_call, ignore_visibility @@ -244,6 +259,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── then_keyword_loc: ∅ │ │ └── statements: @@ -271,6 +287,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── conditions: (length: 1) │ │ └── @ WhenNode (location: (23,0)-(24,8)) @@ -290,6 +307,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── then_keyword_loc: ∅ │ │ └── statements: @@ -317,6 +335,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── conditions: (length: 1) │ │ └── @ WhenNode (location: (27,0)-(28,5)) @@ -332,6 +351,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── then_keyword_loc: ∅ │ │ └── statements: @@ -347,6 +367,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── else_clause: │ │ @ ElseNode (location: (29,0)-(31,3)) @@ -377,6 +398,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── conditions: (length: 1) │ │ └── @ WhenNode (location: (33,0)-(33,15)) @@ -399,6 +421,7 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ ├── call_operator_loc: ∅ │ │ │ ├── name: :| @@ -417,8 +440,10 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── then_keyword_loc: ∅ │ │ └── statements: ∅ @@ -437,6 +462,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── conditions: (length: 1) │ └── @ WhenNode (location: (36,0)-(36,15)) @@ -459,6 +485,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── call_operator_loc: (36,9)-(36,10) = "." │ │ ├── name: :baz= @@ -472,6 +499,7 @@ │ │ │ ├── flags: static_literal, decimal │ │ │ └── value: 1 │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: (36,13)-(36,14) = "=" │ │ └── block: ∅ │ ├── then_keyword_loc: ∅ │ └── statements: ∅ diff --git a/snapshots/unparser/corpus/literal/class.txt b/snapshots/unparser/corpus/literal/class.txt index add60ce305..1a52256221 100644 --- a/snapshots/unparser/corpus/literal/class.txt +++ b/snapshots/unparser/corpus/literal/class.txt @@ -33,6 +33,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── body: ∅ │ └── end_keyword_loc: (5,0)-(5,3) = "end" @@ -51,6 +52,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── body: │ │ @ StatementsNode (location: (8,2)-(8,3)) @@ -65,6 +67,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ └── end_keyword_loc: (9,0)-(9,3) = "end" ├── @ ClassNode (location: (11,0)-(12,3)) @@ -214,8 +217,10 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ ├── closing_loc: (27,15)-(27,16) = ")" + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── @ DefNode (location: (29,2)-(31,5)) │ │ ├── flags: newline diff --git a/snapshots/unparser/corpus/literal/def.txt b/snapshots/unparser/corpus/literal/def.txt index 9a6fa40050..5fc7a7af23 100644 --- a/snapshots/unparser/corpus/literal/def.txt +++ b/snapshots/unparser/corpus/literal/def.txt @@ -28,6 +28,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── rescue_clause: │ │ │ @ RescueNode (location: (3,0)-(4,3)) @@ -50,6 +51,7 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ └── subsequent: ∅ │ │ ├── else_clause: @@ -69,6 +71,7 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ └── end_keyword_loc: (7,0)-(7,6) = "ensure" │ │ ├── ensure_clause: @@ -88,6 +91,7 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ └── end_keyword_loc: (9,0)-(9,3) = "end" │ │ └── end_keyword_loc: (9,0)-(9,3) = "end" @@ -124,6 +128,7 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ ├── keyword_loc: (12,4)-(12,10) = "rescue" │ │ │ └── rescue_expression: @@ -136,6 +141,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── rescue_clause: │ │ │ @ RescueNode (location: (13,0)-(14,3)) @@ -158,6 +164,7 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ └── subsequent: ∅ │ │ ├── else_clause: @@ -177,6 +184,7 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ └── end_keyword_loc: (17,0)-(17,6) = "ensure" │ │ ├── ensure_clause: @@ -196,6 +204,7 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ └── end_keyword_loc: (19,0)-(19,3) = "end" │ │ └── end_keyword_loc: (19,0)-(19,3) = "end" @@ -270,6 +279,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── locals: [] │ ├── def_keyword_loc: (27,0)-(27,3) = "def" @@ -301,6 +311,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── rescue_clause: │ │ │ @ RescueNode (location: (33,0)-(34,5)) @@ -323,6 +334,7 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ └── subsequent: ∅ │ │ ├── else_clause: ∅ @@ -343,6 +355,7 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ └── end_keyword_loc: (37,0)-(37,3) = "end" │ │ └── end_keyword_loc: (37,0)-(37,3) = "end" @@ -376,6 +389,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── rescue_clause: ∅ │ │ ├── else_clause: ∅ @@ -396,6 +410,7 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ └── end_keyword_loc: (43,0)-(43,3) = "end" │ │ └── end_keyword_loc: (43,0)-(43,3) = "end" @@ -429,6 +444,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── rescue_clause: │ │ │ @ RescueNode (location: (47,0)-(48,5)) @@ -451,6 +467,7 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ └── subsequent: ∅ │ │ ├── else_clause: ∅ @@ -604,6 +621,7 @@ │ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ │ ├── arguments: ∅ │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ ├── equal_loc: ∅ │ │ │ │ │ └── block: ∅ │ │ │ │ └── @ NilNode (location: (63,20)-(63,23)) │ │ │ │ └── flags: newline, static_literal @@ -759,6 +777,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── keyword_rest: ∅ │ │ └── block: ∅ @@ -797,6 +816,7 @@ │ │ │ ├── opening_loc: (80,16)-(80,17) = "(" │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: (80,17)-(80,18) = ")" + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── keyword_rest: ∅ │ │ └── block: ∅ @@ -841,6 +861,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── locals: [] │ ├── def_keyword_loc: (83,0)-(83,3) = "def" @@ -963,6 +984,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── locals: [:baz, :bor] │ ├── def_keyword_loc: (95,0)-(95,3) = "def" @@ -1017,6 +1039,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── locals: [:baz, :bor, :block] │ ├── def_keyword_loc: (99,0)-(99,3) = "def" @@ -1104,6 +1127,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── locals: [:block] │ ├── def_keyword_loc: (107,0)-(107,3) = "def" @@ -1169,6 +1193,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── @ CallNode (location: (117,2)-(117,5)) │ │ ├── flags: newline, variable_call, ignore_visibility @@ -1179,6 +1204,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── locals: [] │ ├── def_keyword_loc: (115,0)-(115,3) = "def" diff --git a/snapshots/unparser/corpus/literal/defs.txt b/snapshots/unparser/corpus/literal/defs.txt index 33c24f3b24..79c5ccc158 100644 --- a/snapshots/unparser/corpus/literal/defs.txt +++ b/snapshots/unparser/corpus/literal/defs.txt @@ -42,6 +42,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── locals: [] │ ├── def_keyword_loc: (4,0)-(4,3) = "def" @@ -71,6 +72,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── @ CallNode (location: (10,2)-(10,5)) │ │ ├── flags: newline, variable_call, ignore_visibility @@ -81,6 +83,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── locals: [] │ ├── def_keyword_loc: (8,0)-(8,3) = "def" @@ -111,6 +114,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── locals: [] │ ├── def_keyword_loc: (13,0)-(13,3) = "def" @@ -136,6 +140,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: │ │ │ @ BlockNode (location: (17,9)-(18,1)) │ │ │ ├── flags: ∅ @@ -178,6 +183,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── locals: [] │ ├── def_keyword_loc: (17,0)-(17,3) = "def" @@ -209,6 +215,7 @@ │ │ │ │ ├── flags: static_literal, decimal │ │ │ │ └── value: 1 │ │ │ ├── closing_loc: (22,10)-(22,11) = ")" + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── opening_loc: (22,4)-(22,5) = "(" │ │ └── closing_loc: (22,11)-(22,12) = ")" @@ -226,6 +233,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── locals: [] │ ├── def_keyword_loc: (22,0)-(22,3) = "def" @@ -260,6 +268,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── opening_loc: (26,4)-(26,5) = "(" │ │ └── closing_loc: (26,17)-(26,18) = ")" @@ -277,6 +286,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── locals: [] │ ├── def_keyword_loc: (26,0)-(26,3) = "def" @@ -318,6 +328,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── locals: [] │ ├── def_keyword_loc: (30,0)-(30,3) = "def" @@ -348,6 +359,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── locals: [] │ ├── def_keyword_loc: (34,0)-(34,3) = "def" @@ -370,6 +382,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── parameters: ∅ ├── body: @@ -385,6 +398,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── locals: [] ├── def_keyword_loc: (38,0)-(38,3) = "def" diff --git a/snapshots/unparser/corpus/literal/dstr.txt b/snapshots/unparser/corpus/literal/dstr.txt index 64cb3ff1b2..9b76f1594b 100644 --- a/snapshots/unparser/corpus/literal/dstr.txt +++ b/snapshots/unparser/corpus/literal/dstr.txt @@ -76,6 +76,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── subsequent: ∅ │ └── end_keyword_loc: (11,0)-(11,3) = "end" @@ -303,6 +304,7 @@ │ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ │ ├── arguments: ∅ │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ ├── equal_loc: ∅ │ │ │ │ │ └── block: ∅ │ │ │ │ └── closing_loc: (32,7)-(32,8) = "}" │ │ │ └── @ StringNode (location: (32,8)-(33,0)) @@ -313,6 +315,7 @@ │ │ │ └── unescaped: "\n" │ │ └── closing_loc: (33,0)-(34,0) = "HEREDOC\n" │ ├── closing_loc: (31,14)-(31,15) = ")" + │ ├── equal_loc: ∅ │ └── block: ∅ └── @ CallNode (location: (34,0)-(37,1)) ├── flags: newline, ignore_visibility @@ -351,6 +354,7 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ └── closing_loc: (35,7)-(35,8) = "}" │ │ └── @ StringNode (location: (35,8)-(36,0)) @@ -361,6 +365,7 @@ │ │ └── unescaped: "\n" │ └── closing_loc: (36,0)-(37,0) = "HEREDOC\n" ├── closing_loc: (34,14)-(34,15) = ")" + ├── equal_loc: ∅ └── block: @ BlockNode (location: (34,16)-(37,1)) ├── flags: ∅ diff --git a/snapshots/unparser/corpus/literal/flipflop.txt b/snapshots/unparser/corpus/literal/flipflop.txt index 418aa242cb..520646ed25 100644 --- a/snapshots/unparser/corpus/literal/flipflop.txt +++ b/snapshots/unparser/corpus/literal/flipflop.txt @@ -36,6 +36,7 @@ │ │ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ │ │ ├── arguments: ∅ │ │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ │ ├── equal_loc: ∅ │ │ │ │ │ │ └── block: ∅ │ │ │ │ │ ├── call_operator_loc: ∅ │ │ │ │ │ ├── name: :== @@ -49,6 +50,7 @@ │ │ │ │ │ │ ├── flags: static_literal, decimal │ │ │ │ │ │ └── value: 4 │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ ├── equal_loc: ∅ │ │ │ │ │ └── block: ∅ │ │ │ │ ├── opening_loc: (1,4)-(1,5) = "(" │ │ │ │ └── closing_loc: (1,11)-(1,12) = ")" @@ -71,6 +73,7 @@ │ │ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ │ │ ├── arguments: ∅ │ │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ │ ├── equal_loc: ∅ │ │ │ │ │ │ └── block: ∅ │ │ │ │ │ ├── call_operator_loc: ∅ │ │ │ │ │ ├── name: :== @@ -84,6 +87,7 @@ │ │ │ │ │ │ ├── flags: static_literal, decimal │ │ │ │ │ │ └── value: 4 │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ ├── equal_loc: ∅ │ │ │ │ │ └── block: ∅ │ │ │ │ ├── opening_loc: (1,14)-(1,15) = "(" │ │ │ │ └── closing_loc: (1,21)-(1,22) = ")" @@ -104,6 +108,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── subsequent: ∅ │ └── end_keyword_loc: (3,0)-(3,3) = "end" @@ -138,6 +143,7 @@ │ │ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ │ │ ├── arguments: ∅ │ │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ │ ├── equal_loc: ∅ │ │ │ │ │ │ └── block: ∅ │ │ │ │ │ ├── call_operator_loc: ∅ │ │ │ │ │ ├── name: :== @@ -151,6 +157,7 @@ │ │ │ │ │ │ ├── flags: static_literal, decimal │ │ │ │ │ │ └── value: 4 │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ ├── equal_loc: ∅ │ │ │ │ │ └── block: ∅ │ │ │ │ ├── opening_loc: (4,4)-(4,5) = "(" │ │ │ │ └── closing_loc: (4,11)-(4,12) = ")" @@ -173,6 +180,7 @@ │ │ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ │ │ ├── arguments: ∅ │ │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ │ ├── equal_loc: ∅ │ │ │ │ │ │ └── block: ∅ │ │ │ │ │ ├── call_operator_loc: ∅ │ │ │ │ │ ├── name: :== @@ -186,6 +194,7 @@ │ │ │ │ │ │ ├── flags: static_literal, decimal │ │ │ │ │ │ └── value: 4 │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ ├── equal_loc: ∅ │ │ │ │ │ └── block: ∅ │ │ │ │ ├── opening_loc: (4,15)-(4,16) = "(" │ │ │ │ └── closing_loc: (4,22)-(4,23) = ")" @@ -206,6 +215,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── subsequent: ∅ │ └── end_keyword_loc: (6,0)-(6,3) = "end" @@ -226,6 +236,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── operator_loc: (7,3)-(7,5) = ".." │ ├── then_keyword_loc: ∅ @@ -248,6 +259,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── right: ∅ │ └── operator_loc: (9,6)-(9,8) = ".." diff --git a/snapshots/unparser/corpus/literal/for.txt b/snapshots/unparser/corpus/literal/for.txt index a1722a8a09..4be6cbad2d 100644 --- a/snapshots/unparser/corpus/literal/for.txt +++ b/snapshots/unparser/corpus/literal/for.txt @@ -33,6 +33,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── statements: │ │ │ @ StatementsNode (location: (2,2)-(2,5)) @@ -47,12 +48,14 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── for_keyword_loc: (1,4)-(1,7) = "for" │ │ ├── in_keyword_loc: (1,10)-(1,12) = "in" │ │ ├── do_keyword_loc: (1,17)-(1,19) = "do" │ │ └── end_keyword_loc: (3,0)-(3,3) = "end" │ ├── closing_loc: (3,3)-(3,4) = ")" + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ ForNode (location: (4,0)-(6,3)) │ ├── flags: newline @@ -71,6 +74,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── statements: │ │ @ StatementsNode (location: (5,2)-(5,5)) @@ -85,6 +89,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── for_keyword_loc: (4,0)-(4,3) = "for" │ ├── in_keyword_loc: (4,6)-(4,8) = "in" @@ -122,6 +127,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── statements: │ │ @ StatementsNode (location: (8,2)-(8,5)) @@ -136,6 +142,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── for_keyword_loc: (7,0)-(7,3) = "for" │ ├── in_keyword_loc: (7,12)-(7,14) = "in" @@ -169,6 +176,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── statements: │ @ StatementsNode (location: (11,2)-(11,5)) @@ -183,6 +191,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── for_keyword_loc: (10,0)-(10,3) = "for" ├── in_keyword_loc: (10,11)-(10,13) = "in" diff --git a/snapshots/unparser/corpus/literal/hookexe.txt b/snapshots/unparser/corpus/literal/hookexe.txt index bbcb8fee1b..95f55b8cfe 100644 --- a/snapshots/unparser/corpus/literal/hookexe.txt +++ b/snapshots/unparser/corpus/literal/hookexe.txt @@ -20,6 +20,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── keyword_loc: (1,0)-(1,5) = "BEGIN" │ ├── opening_loc: (1,6)-(1,7) = "{" @@ -33,6 +34,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ └── @ PostExecutionNode (location: (5,0)-(7,1)) ├── flags: newline @@ -49,6 +51,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── keyword_loc: (5,0)-(5,3) = "END" ├── opening_loc: (5,4)-(5,5) = "{" diff --git a/snapshots/unparser/corpus/literal/if.txt b/snapshots/unparser/corpus/literal/if.txt index 10240962c5..a1603c48e4 100644 --- a/snapshots/unparser/corpus/literal/if.txt +++ b/snapshots/unparser/corpus/literal/if.txt @@ -29,6 +29,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── subsequent: ∅ │ └── end_keyword_loc: (3,0)-(3,3) = "end" @@ -123,6 +124,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── then_keyword_loc: ∅ │ ├── statements: ∅ @@ -168,6 +170,7 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ └── operator_loc: (22,6)-(22,7) = "=" │ │ ├── subsequent: ∅ @@ -214,6 +217,7 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ └── operator_loc: (26,6)-(26,7) = "=" │ │ ├── else_clause: ∅ @@ -233,6 +237,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── then_keyword_loc: ∅ │ ├── statements: @@ -254,6 +259,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── operator_loc: (29,6)-(29,7) = "=" │ ├── else_clause: ∅ @@ -271,6 +277,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (31,7)-(33,1)) │ ├── flags: ∅ diff --git a/snapshots/unparser/corpus/literal/kwbegin.txt b/snapshots/unparser/corpus/literal/kwbegin.txt index 44028c93b7..2fc436e836 100644 --- a/snapshots/unparser/corpus/literal/kwbegin.txt +++ b/snapshots/unparser/corpus/literal/kwbegin.txt @@ -51,6 +51,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── rescue_clause: ∅ │ ├── else_clause: ∅ @@ -72,6 +73,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── rescue_clause: │ │ @ RescueNode (location: (15,0)-(16,3)) @@ -94,6 +96,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── subsequent: ∅ │ ├── else_clause: ∅ @@ -115,6 +118,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── @ CallNode (location: (21,2)-(21,3)) │ │ ├── flags: newline, variable_call, ignore_visibility @@ -125,6 +129,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── rescue_clause: │ │ @ RescueNode (location: (22,0)-(23,3)) @@ -147,6 +152,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── subsequent: ∅ │ ├── else_clause: ∅ @@ -212,6 +218,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── rescue_clause: │ │ @ RescueNode (location: (36,0)-(39,3)) @@ -237,6 +244,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── subsequent: │ │ @ RescueNode (location: (38,0)-(39,3)) @@ -262,6 +270,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── subsequent: ∅ │ ├── else_clause: ∅ @@ -282,6 +291,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── end_keyword_loc: (42,0)-(42,3) = "end" │ └── end_keyword_loc: (42,0)-(42,3) = "end" @@ -312,6 +322,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── rescue_clause: │ │ │ @ RescueNode (location: (48,2)-(48,8)) @@ -347,6 +358,7 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ └── @ CallNode (location: (52,2)-(52,5)) │ │ │ ├── flags: newline, variable_call, ignore_visibility @@ -357,6 +369,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── subsequent: ∅ │ ├── else_clause: ∅ @@ -387,6 +400,7 @@ │ │ │ │ ├── flags: ∅ │ │ │ │ └── name: :Exception │ │ │ ├── closing_loc: (56,17)-(56,18) = ")" + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── keyword_loc: (56,19)-(56,25) = "rescue" │ │ └── rescue_expression: @@ -405,6 +419,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── operator_loc: (56,30)-(56,31) = "=" │ ├── rescue_clause: @@ -546,6 +561,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── subsequent: ∅ │ ├── else_clause: ∅ diff --git a/snapshots/unparser/corpus/literal/lambda.txt b/snapshots/unparser/corpus/literal/lambda.txt index 863678f17b..4df90087bc 100644 --- a/snapshots/unparser/corpus/literal/lambda.txt +++ b/snapshots/unparser/corpus/literal/lambda.txt @@ -14,6 +14,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (1,7)-(2,1)) │ ├── flags: ∅ @@ -31,6 +32,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (3,7)-(5,1)) │ ├── flags: ∅ diff --git a/snapshots/unparser/corpus/literal/literal.txt b/snapshots/unparser/corpus/literal/literal.txt index ec42edcbf4..386002b557 100644 --- a/snapshots/unparser/corpus/literal/literal.txt +++ b/snapshots/unparser/corpus/literal/literal.txt @@ -153,6 +153,7 @@ │ │ │ │ └── unescaped: "\n" │ │ │ └── closing_loc: (8,0)-(9,0) = "HEREDOC\n" │ │ ├── closing_loc: (6,12)-(6,13) = ")" + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: (6,13)-(6,14) = "." │ ├── name: :a @@ -160,6 +161,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (9,0)-(9,8)) │ ├── flags: newline @@ -182,6 +184,7 @@ │ │ │ ├── closing_loc: (9,4)-(9,5) = ")" │ │ │ └── unescaped: "" │ │ ├── closing_loc: (9,5)-(9,6) = ")" + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: (9,6)-(9,7) = "." │ ├── name: :a @@ -189,6 +192,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ HashNode (location: (10,0)-(10,30)) │ ├── flags: newline @@ -239,6 +243,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── operator_loc: (10,23)-(10,25) = "**" │ └── closing_loc: (10,29)-(10,30) = "}" @@ -275,6 +280,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── operator_loc: (13,16)-(13,18) = "**" │ └── closing_loc: (13,22)-(13,23) = "}" @@ -331,6 +337,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ IntegerNode (location: (17,0)-(17,1)) │ ├── flags: newline, static_literal, decimal @@ -430,6 +437,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── closing_loc: (29,13)-(29,14) = "}" │ └── closing_loc: (29,14)-(29,15) = "\"" @@ -740,6 +748,7 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ └── closing_loc: (58,10)-(58,11) = "}" │ │ └── @ StringNode (location: (58,11)-(58,14)) @@ -795,6 +804,7 @@ │ │ │ │ ├── flags: static_literal │ │ │ │ └── value: 0.0 │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── opening_loc: (60,0)-(60,1) = "(" │ │ └── closing_loc: (60,10)-(60,11) = ")" @@ -834,6 +844,7 @@ │ │ │ │ ├── flags: static_literal │ │ │ │ └── value: 0.0 │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── opening_loc: (61,3)-(61,4) = "(" │ │ └── closing_loc: (61,13)-(61,14) = ")" @@ -865,6 +876,7 @@ │ │ │ │ ├── flags: static_literal │ │ │ │ └── value: 0.0 │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── opening_loc: (62,0)-(62,1) = "(" │ │ └── closing_loc: (62,10)-(62,11) = ")" @@ -910,6 +922,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── opening_loc: (66,0)-(66,1) = "[" │ └── closing_loc: (66,10)-(66,11) = "]" @@ -1080,6 +1093,7 @@ │ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ │ ├── arguments: ∅ │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ ├── equal_loc: ∅ │ │ │ │ │ └── block: ∅ │ │ │ │ ├── opening_loc: (76,5)-(76,6) = "(" │ │ │ │ └── closing_loc: (76,18)-(76,19) = ")" @@ -1228,6 +1242,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (83,4)-(86,1)) │ ├── flags: ∅ @@ -1298,6 +1313,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── closing_loc: (90,5)-(90,6) = "}" │ └── @ StringNode (location: (90,6)-(91,1)) diff --git a/snapshots/unparser/corpus/literal/module.txt b/snapshots/unparser/corpus/literal/module.txt index 9ad15d2dcd..cd68b2708c 100644 --- a/snapshots/unparser/corpus/literal/module.txt +++ b/snapshots/unparser/corpus/literal/module.txt @@ -91,8 +91,10 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── closing_loc: (11,15)-(11,16) = ")" + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ └── @ DefNode (location: (13,2)-(15,5)) │ ├── flags: newline diff --git a/snapshots/unparser/corpus/literal/opasgn.txt b/snapshots/unparser/corpus/literal/opasgn.txt index 3df6248d4b..38eca36c28 100644 --- a/snapshots/unparser/corpus/literal/opasgn.txt +++ b/snapshots/unparser/corpus/literal/opasgn.txt @@ -74,6 +74,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── name: :a │ └── depth: 0 @@ -114,6 +115,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (9,0)-(9,17)) │ ├── flags: newline, attribute_write @@ -155,6 +157,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── @ CallNode (location: (9,16)-(9,17)) │ │ ├── flags: variable_call, ignore_visibility @@ -165,8 +168,10 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── closing_loc: (9,12)-(9,13) = "]" + │ ├── equal_loc: (9,14)-(9,15) = "=" │ └── block: ∅ ├── @ CallOperatorWriteNode (location: (10,0)-(10,8)) │ ├── flags: newline @@ -275,6 +280,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallOrWriteNode (location: (16,0)-(16,9)) │ ├── flags: newline @@ -314,6 +320,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── closing_loc: (17,3)-(17,4) = "]" │ ├── block: ∅ @@ -345,6 +352,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── closing_loc: (18,3)-(18,4) = "]" │ ├── block: ∅ @@ -376,6 +384,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── closing_loc: (19,3)-(19,4) = "]" │ ├── block: ∅ @@ -407,6 +416,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── closing_loc: (20,3)-(20,4) = "]" │ ├── block: ∅ @@ -438,6 +448,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── closing_loc: (21,3)-(21,4) = "]" │ ├── block: ∅ @@ -469,6 +480,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── closing_loc: (22,3)-(22,4) = "]" │ ├── block: ∅ @@ -483,6 +495,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ IndexOrWriteNode (location: (23,0)-(23,10)) │ ├── flags: newline @@ -506,6 +519,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── closing_loc: (23,3)-(23,4) = "]" │ ├── block: ∅ @@ -526,6 +540,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── call_operator_loc: (24,3)-(24,4) = "." ├── message_loc: (24,4)-(24,5) = "A" diff --git a/snapshots/unparser/corpus/literal/pattern.txt b/snapshots/unparser/corpus/literal/pattern.txt index 200837c450..57506dbd0d 100644 --- a/snapshots/unparser/corpus/literal/pattern.txt +++ b/snapshots/unparser/corpus/literal/pattern.txt @@ -17,6 +17,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── conditions: (length: 15) │ │ ├── @ InNode (location: (2,0)-(3,6)) @@ -90,6 +91,7 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ ├── in_loc: (4,0)-(4,2) = "in" │ │ │ └── then_loc: (4,12)-(4,16) = "then" @@ -450,6 +452,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── conditions: (length: 1) │ │ └── @ InNode (location: (35,0)-(35,17)) @@ -501,6 +504,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── conditions: (length: 1) │ │ └── @ InNode (location: (38,0)-(38,4)) diff --git a/snapshots/unparser/corpus/literal/pragma.txt b/snapshots/unparser/corpus/literal/pragma.txt index 2a82f0c860..2ee0f17d0c 100644 --- a/snapshots/unparser/corpus/literal/pragma.txt +++ b/snapshots/unparser/corpus/literal/pragma.txt @@ -21,4 +21,5 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/unparser/corpus/literal/rescue.txt b/snapshots/unparser/corpus/literal/rescue.txt index 78801c1d90..1d73e02a5d 100644 --- a/snapshots/unparser/corpus/literal/rescue.txt +++ b/snapshots/unparser/corpus/literal/rescue.txt @@ -17,6 +17,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── keyword_loc: (1,4)-(1,10) = "rescue" │ └── rescue_expression: @@ -29,6 +30,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ RescueModifierNode (location: (2,0)-(2,21)) │ ├── flags: newline @@ -42,6 +44,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── keyword_loc: (2,4)-(2,10) = "rescue" │ └── rescue_expression: @@ -61,6 +64,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ └── @ LocalVariableWriteNode (location: (3,0)-(3,27)) ├── flags: newline @@ -86,6 +90,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── keyword_loc: (3,9)-(3,15) = "rescue" │ │ └── rescue_expression: @@ -105,6 +110,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── opening_loc: (3,4)-(3,5) = "(" │ └── closing_loc: (3,26)-(3,27) = ")" diff --git a/snapshots/unparser/corpus/literal/send.txt b/snapshots/unparser/corpus/literal/send.txt index a0dd09f7d5..82dc2cc7f7 100644 --- a/snapshots/unparser/corpus/literal/send.txt +++ b/snapshots/unparser/corpus/literal/send.txt @@ -54,6 +54,7 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ ├── opening_loc: (2,10)-(2,11) = "(" │ │ │ └── closing_loc: (2,21)-(2,22) = ")" @@ -96,6 +97,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── end_keyword_loc: (8,0)-(8,3) = "end" │ └── name: :A @@ -121,6 +123,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (11,0)-(12,7)) │ ├── flags: newline @@ -142,6 +145,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (13,0)-(15,7)) │ ├── flags: newline @@ -169,6 +173,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (16,0)-(19,7)) │ ├── flags: newline @@ -218,6 +223,7 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ ├── then_keyword_loc: ∅ │ │ │ └── statements: ∅ @@ -230,6 +236,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (20,0)-(22,7)) │ ├── flags: newline @@ -246,6 +253,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── conditions: (length: 1) │ │ │ └── @ WhenNode (location: (21,0)-(21,8)) @@ -261,6 +269,7 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ ├── then_keyword_loc: ∅ │ │ │ └── statements: ∅ @@ -273,6 +282,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (23,0)-(24,7)) │ ├── flags: newline @@ -293,6 +303,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (25,0)-(26,7)) │ ├── flags: newline @@ -319,6 +330,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (27,0)-(28,7)) │ ├── flags: newline @@ -343,6 +355,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (29,0)-(30,7)) │ ├── flags: newline @@ -362,6 +375,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── statements: ∅ │ ├── call_operator_loc: (30,3)-(30,4) = "." @@ -370,6 +384,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (31,0)-(32,7)) │ ├── flags: newline @@ -389,6 +404,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── statements: ∅ │ ├── call_operator_loc: (32,3)-(32,4) = "." @@ -397,6 +413,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (33,0)-(34,5)) │ ├── flags: newline @@ -410,6 +427,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: │ │ @ BlockNode (location: (33,5)-(34,1)) │ │ ├── flags: ∅ @@ -424,6 +442,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (35,0)-(36,7)) │ ├── flags: newline @@ -441,6 +460,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── then_keyword_loc: ∅ │ │ ├── statements: ∅ @@ -452,6 +472,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (37,0)-(37,19)) │ ├── flags: newline @@ -486,6 +507,7 @@ │ │ │ │ ├── closing_loc: ∅ │ │ │ │ └── unescaped: "foo" │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── opening_loc: (37,0)-(37,1) = "(" │ │ └── closing_loc: (37,14)-(37,15) = ")" @@ -495,6 +517,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (38,0)-(38,10)) │ ├── flags: newline @@ -524,6 +547,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (39,0)-(39,18)) │ ├── flags: newline @@ -546,6 +570,7 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ ├── call_operator_loc: ∅ │ │ │ ├── name: :=~ @@ -562,6 +587,7 @@ │ │ │ │ ├── closing_loc: (39,12)-(39,13) = "/" │ │ │ │ └── unescaped: "bar" │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── opening_loc: (39,0)-(39,1) = "(" │ │ └── closing_loc: (39,13)-(39,14) = ")" @@ -571,6 +597,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (40,0)-(40,13)) │ ├── flags: newline @@ -596,6 +623,7 @@ │ │ ├── closing_loc: ∅ │ │ └── unescaped: "foo" │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (41,0)-(41,12)) │ ├── flags: newline @@ -623,8 +651,10 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ RangeNode (location: (42,0)-(42,8)) │ ├── flags: newline @@ -645,6 +675,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ └── operator_loc: (42,1)-(42,3) = ".." ├── @ CallNode (location: (43,0)-(43,5)) @@ -659,6 +690,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (44,0)-(44,5)) │ ├── flags: newline, ignore_visibility @@ -669,6 +701,7 @@ │ ├── opening_loc: (44,3)-(44,4) = "(" │ ├── arguments: ∅ │ ├── closing_loc: (44,4)-(44,5) = ")" + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (45,0)-(45,4)) │ ├── flags: newline, safe_navigation @@ -682,6 +715,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: (45,1)-(45,3) = "&." │ ├── name: :b @@ -689,6 +723,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (46,0)-(46,5)) │ ├── flags: newline @@ -702,6 +737,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: (46,1)-(46,2) = "." │ ├── name: :foo @@ -709,6 +745,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (47,0)-(47,3)) │ ├── flags: newline, variable_call, ignore_visibility @@ -719,6 +756,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (48,0)-(48,18)) │ ├── flags: newline @@ -732,6 +770,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: ∅ │ ├── name: :<< @@ -759,6 +798,7 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ ├── call_operator_loc: ∅ │ │ │ ├── name: :* @@ -777,12 +817,15 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── opening_loc: (48,7)-(48,8) = "(" │ │ └── closing_loc: (48,17)-(48,18) = ")" │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (49,0)-(49,12)) │ ├── flags: newline @@ -796,6 +839,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: ∅ │ ├── name: :=~ @@ -812,6 +856,7 @@ │ │ ├── closing_loc: (49,11)-(49,12) = "/" │ │ └── unescaped: "bar" │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (50,0)-(50,18)) │ ├── flags: newline, ignore_visibility @@ -822,6 +867,7 @@ │ ├── opening_loc: (50,3)-(50,4) = "(" │ ├── arguments: ∅ │ ├── closing_loc: (50,17)-(50,18) = ")" + │ ├── equal_loc: ∅ │ └── block: │ @ BlockArgumentNode (location: (50,4)-(50,17)) │ ├── flags: ∅ @@ -844,6 +890,7 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ ├── right: │ │ │ │ @ CallNode (location: (50,13)-(50,16)) @@ -855,6 +902,7 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ └── operator_loc: (50,10)-(50,12) = "||" │ │ ├── opening_loc: (50,5)-(50,6) = "(" @@ -869,6 +917,7 @@ │ ├── opening_loc: (51,3)-(51,4) = "(" │ ├── arguments: ∅ │ ├── closing_loc: (51,10)-(51,11) = ")" + │ ├── equal_loc: ∅ │ └── block: │ @ BlockArgumentNode (location: (51,4)-(51,10)) │ ├── flags: ∅ @@ -882,6 +931,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ └── operator_loc: (51,4)-(51,5) = "&" ├── @ CallNode (location: (52,0)-(52,18)) @@ -908,8 +958,10 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── closing_loc: (52,17)-(52,18) = ")" + │ ├── equal_loc: ∅ │ └── block: │ @ BlockArgumentNode (location: (52,11)-(52,17)) │ ├── flags: ∅ @@ -923,6 +975,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ └── operator_loc: (52,11)-(52,12) = "&" ├── @ CallNode (location: (53,0)-(53,15)) @@ -949,8 +1002,10 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── closing_loc: (53,14)-(53,15) = ")" + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (54,0)-(54,9)) │ ├── flags: newline, ignore_visibility @@ -970,6 +1025,7 @@ │ │ ├── flags: static_literal, decimal │ │ └── value: 2 │ ├── closing_loc: (54,8)-(54,9) = ")" + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (55,0)-(55,8)) │ ├── flags: newline, ignore_visibility @@ -991,8 +1047,10 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── closing_loc: (55,7)-(55,8) = ")" + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (56,0)-(56,15)) │ ├── flags: newline, ignore_visibility @@ -1014,6 +1072,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── @ SplatNode (location: (56,9)-(56,14)) │ │ ├── flags: ∅ @@ -1028,8 +1087,10 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── closing_loc: (56,14)-(56,15) = ")" + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (57,0)-(57,17)) │ ├── flags: newline, ignore_visibility @@ -1054,6 +1115,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── call_operator_loc: ∅ │ │ ├── name: :=~ @@ -1070,8 +1132,10 @@ │ │ │ ├── closing_loc: (57,15)-(57,16) = "/" │ │ │ └── unescaped: "bar" │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── closing_loc: (57,16)-(57,17) = ")" + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (58,0)-(58,13)) │ ├── flags: newline @@ -1085,6 +1149,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: (58,3)-(58,4) = "." │ ├── name: :bar @@ -1092,6 +1157,7 @@ │ ├── opening_loc: (58,7)-(58,8) = "(" │ ├── arguments: ∅ │ ├── closing_loc: (58,12)-(58,13) = ")" + │ ├── equal_loc: ∅ │ └── block: │ @ BlockArgumentNode (location: (58,8)-(58,12)) │ ├── flags: ∅ @@ -1105,6 +1171,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ └── operator_loc: (58,8)-(58,9) = "&" ├── @ CallNode (location: (59,0)-(59,26)) @@ -1119,6 +1186,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: (59,3)-(59,4) = "." │ ├── name: :bar @@ -1141,6 +1209,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── @ CallNode (location: (59,15)-(59,18)) │ │ │ ├── flags: variable_call, ignore_visibility @@ -1151,6 +1220,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── @ SplatNode (location: (59,20)-(59,25)) │ │ ├── flags: ∅ @@ -1165,8 +1235,10 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── closing_loc: (59,25)-(59,26) = ")" + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (60,0)-(60,14)) │ ├── flags: newline @@ -1180,6 +1252,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: (60,3)-(60,4) = "." │ ├── name: :bar @@ -1202,8 +1275,10 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── closing_loc: (60,13)-(60,14) = ")" + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (61,0)-(61,19)) │ ├── flags: newline @@ -1217,6 +1292,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: (61,3)-(61,4) = "." │ ├── name: :bar @@ -1239,6 +1315,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── @ CallNode (location: (61,15)-(61,18)) │ │ ├── flags: variable_call, ignore_visibility @@ -1249,8 +1326,10 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── closing_loc: (61,18)-(61,19) = ")" + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (62,0)-(62,19)) │ ├── flags: newline @@ -1264,6 +1343,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: (62,3)-(62,4) = "." │ ├── name: :bar @@ -1280,6 +1360,7 @@ │ │ ├── closing_loc: ∅ │ │ └── unescaped: "baz" │ ├── closing_loc: (62,18)-(62,19) = ")" + │ ├── equal_loc: ∅ │ └── block: │ @ BlockArgumentNode (location: (62,14)-(62,18)) │ ├── flags: ∅ @@ -1293,6 +1374,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ └── operator_loc: (62,14)-(62,15) = "&" ├── @ CallNode (location: (63,0)-(63,17)) @@ -1307,6 +1389,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: (63,3)-(63,4) = "." │ ├── name: :bar @@ -1338,9 +1421,11 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── operator_loc: ∅ │ ├── closing_loc: (63,16)-(63,17) = ")" + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (64,0)-(64,26)) │ ├── flags: newline @@ -1354,6 +1439,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: (64,3)-(64,4) = "." │ ├── name: :bar @@ -1372,6 +1458,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── @ KeywordHashNode (location: (64,13)-(64,25)) │ │ ├── flags: ∅ @@ -1395,9 +1482,11 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── operator_loc: (64,19)-(64,21) = "=>" │ ├── closing_loc: (64,25)-(64,26) = ")" + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (65,0)-(65,19)) │ ├── flags: newline @@ -1411,6 +1500,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: (65,3)-(65,4) = "." │ ├── name: :bar @@ -1429,6 +1519,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── @ SplatNode (location: (65,13)-(65,18)) │ │ ├── flags: ∅ @@ -1443,8 +1534,10 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── closing_loc: (65,18)-(65,19) = ")" + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (66,0)-(66,27)) │ ├── flags: newline @@ -1458,6 +1551,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: (66,3)-(66,4) = "." │ ├── name: :bar @@ -1476,6 +1570,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── @ SplatNode (location: (66,13)-(66,18)) │ │ ├── flags: ∅ @@ -1490,8 +1585,10 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── closing_loc: (66,26)-(66,27) = ")" + │ ├── equal_loc: ∅ │ └── block: │ @ BlockArgumentNode (location: (66,20)-(66,26)) │ ├── flags: ∅ @@ -1505,6 +1602,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ └── operator_loc: (66,20)-(66,21) = "&" ├── @ CallNode (location: (67,0)-(67,16)) @@ -1519,6 +1617,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: (67,3)-(67,4) = "." │ ├── name: :bar @@ -1537,6 +1636,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── @ HashNode (location: (67,13)-(67,15)) │ │ ├── flags: static_literal @@ -1544,6 +1644,7 @@ │ │ ├── elements: (length: 0) │ │ └── closing_loc: (67,14)-(67,15) = "}" │ ├── closing_loc: (67,15)-(67,16) = ")" + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (68,0)-(68,26)) │ ├── flags: newline @@ -1557,6 +1658,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: (68,3)-(68,4) = "." │ ├── name: :bar @@ -1589,6 +1691,7 @@ │ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ │ ├── arguments: ∅ │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ ├── equal_loc: ∅ │ │ │ │ │ └── block: ∅ │ │ │ │ └── operator_loc: ∅ │ │ │ └── closing_loc: (68,19)-(68,20) = "}" @@ -1601,8 +1704,10 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── closing_loc: (68,25)-(68,26) = ")" + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (69,0)-(69,12)) │ ├── flags: newline, attribute_write @@ -1616,6 +1721,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: (69,3)-(69,4) = "." │ ├── name: :bar= @@ -1632,6 +1738,7 @@ │ │ ├── closing_loc: ∅ │ │ └── unescaped: "baz" │ ├── closing_loc: ∅ + │ ├── equal_loc: (69,7)-(69,8) = "=" │ └── block: ∅ ├── @ CallNode (location: (70,0)-(70,9)) │ ├── flags: newline, ignore_visibility @@ -1666,9 +1773,11 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── operator_loc: ∅ │ ├── closing_loc: (70,8)-(70,9) = ")" + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (71,0)-(71,11)) │ ├── flags: newline @@ -1682,6 +1791,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: (71,3)-(71,4) = "." │ ├── name: :& @@ -1713,9 +1823,11 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── operator_loc: ∅ │ ├── closing_loc: (71,10)-(71,11) = ")" + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (72,0)-(72,10)) │ ├── flags: newline @@ -1729,6 +1841,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: (72,3)-(72,4) = "." │ ├── name: :& @@ -1753,9 +1866,11 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── operator_loc: (72,6)-(72,8) = "**" │ ├── closing_loc: (72,9)-(72,10) = ")" + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (73,0)-(73,9)) │ ├── flags: newline @@ -1769,6 +1884,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: ∅ │ ├── name: :[] @@ -1791,8 +1907,10 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── closing_loc: (73,8)-(73,9) = "]" + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (74,0)-(74,9)) │ ├── flags: newline @@ -1806,6 +1924,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: ∅ │ ├── name: :[] @@ -1822,6 +1941,7 @@ │ │ ├── flags: static_literal, decimal │ │ └── value: 2 │ ├── closing_loc: (74,8)-(74,9) = "]" + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (75,0)-(75,5)) │ ├── flags: newline @@ -1835,6 +1955,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: ∅ │ ├── name: :[] @@ -1842,6 +1963,7 @@ │ ├── opening_loc: (75,3)-(75,4) = "[" │ ├── arguments: ∅ │ ├── closing_loc: (75,4)-(75,5) = "]" + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (76,0)-(76,8)) │ ├── flags: newline, ignore_visibility @@ -1854,6 +1976,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (77,0)-(77,13)) │ ├── flags: newline, attribute_write, ignore_visibility @@ -1875,6 +1998,7 @@ │ │ ├── closing_loc: ∅ │ │ └── unescaped: "bar" │ ├── closing_loc: ∅ + │ ├── equal_loc: (77,8)-(77,9) = "=" │ └── block: ∅ ├── @ CallNode (location: (78,0)-(78,17)) │ ├── flags: newline @@ -1897,6 +2021,7 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ ├── call_operator_loc: ∅ │ │ │ ├── name: :+ @@ -1915,8 +2040,10 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── opening_loc: (78,0)-(78,1) = "(" │ │ └── closing_loc: (78,6)-(78,7) = ")" @@ -1946,6 +2073,7 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ ├── call_operator_loc: ∅ │ │ │ ├── name: :- @@ -1964,12 +2092,15 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── opening_loc: (78,10)-(78,11) = "(" │ │ └── closing_loc: (78,16)-(78,17) = ")" │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (79,0)-(79,19)) │ ├── flags: newline @@ -1992,6 +2123,7 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ ├── call_operator_loc: ∅ │ │ │ ├── name: :+ @@ -2010,8 +2142,10 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── opening_loc: (79,0)-(79,1) = "(" │ │ └── closing_loc: (79,6)-(79,7) = ")" @@ -2035,6 +2169,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── call_operator_loc: (79,11)-(79,12) = "." │ │ ├── name: :- @@ -2053,6 +2188,7 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ └── @ CallNode (location: (79,17)-(79,18)) │ │ │ ├── flags: variable_call, ignore_visibility @@ -2063,10 +2199,13 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── closing_loc: (79,18)-(79,19) = ")" + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (80,0)-(80,17)) │ ├── flags: newline @@ -2089,6 +2228,7 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ ├── call_operator_loc: ∅ │ │ │ ├── name: :+ @@ -2107,8 +2247,10 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── opening_loc: (80,0)-(80,1) = "(" │ │ └── closing_loc: (80,6)-(80,7) = ")" @@ -2132,6 +2274,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── call_operator_loc: (80,11)-(80,12) = "." │ │ ├── name: :- @@ -2154,10 +2297,13 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── closing_loc: (80,16)-(80,17) = ")" + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (81,0)-(81,8)) │ ├── flags: newline, ignore_visibility @@ -2185,9 +2331,11 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── operator_loc: (81,2)-(81,4) = "**" │ ├── closing_loc: (81,7)-(81,8) = ")" + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (82,0)-(82,6)) │ ├── flags: newline, safe_navigation @@ -2201,6 +2349,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: (82,3)-(82,5) = "&." │ ├── name: :! @@ -2208,6 +2357,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (83,0)-(83,8)) │ ├── flags: newline @@ -2221,6 +2371,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: (83,3)-(83,4) = "." │ ├── name: :~ @@ -2239,8 +2390,10 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── closing_loc: (83,7)-(83,8) = ")" + │ ├── equal_loc: ∅ │ └── block: ∅ └── @ CallNode (location: (84,0)-(84,7)) ├── flags: newline, safe_navigation @@ -2254,6 +2407,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── call_operator_loc: (84,1)-(84,3) = "&." ├── name: :+ @@ -2272,6 +2426,8 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── closing_loc: (84,6)-(84,7) = ")" + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/unparser/corpus/literal/since/27.txt b/snapshots/unparser/corpus/literal/since/27.txt index e4cda312f8..3edae724eb 100644 --- a/snapshots/unparser/corpus/literal/since/27.txt +++ b/snapshots/unparser/corpus/literal/since/27.txt @@ -39,6 +39,7 @@ │ │ ├── name: :_2 │ │ └── depth: 0 │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ └── @ ParenthesesNode (location: (4,0)-(4,5)) ├── flags: newline diff --git a/snapshots/unparser/corpus/literal/since/31.txt b/snapshots/unparser/corpus/literal/since/31.txt index 7890475124..639c52d603 100644 --- a/snapshots/unparser/corpus/literal/since/31.txt +++ b/snapshots/unparser/corpus/literal/since/31.txt @@ -38,6 +38,7 @@ │ │ ├── opening_loc: (2,5)-(2,6) = "(" │ │ ├── arguments: ∅ │ │ ├── closing_loc: (2,7)-(2,8) = ")" + │ │ ├── equal_loc: ∅ │ │ └── block: │ │ @ BlockArgumentNode (location: (2,6)-(2,7)) │ │ ├── flags: ∅ @@ -86,6 +87,7 @@ │ ├── opening_loc: (6,5)-(6,6) = "(" │ ├── arguments: ∅ │ ├── closing_loc: (6,7)-(6,8) = ")" + │ ├── equal_loc: ∅ │ └── block: │ @ BlockArgumentNode (location: (6,6)-(6,7)) │ ├── flags: ∅ diff --git a/snapshots/unparser/corpus/literal/since/32.txt b/snapshots/unparser/corpus/literal/since/32.txt index 2b126a0cc5..335ae12c1e 100644 --- a/snapshots/unparser/corpus/literal/since/32.txt +++ b/snapshots/unparser/corpus/literal/since/32.txt @@ -55,6 +55,7 @@ │ │ │ ├── value: ∅ │ │ │ └── operator_loc: (2,16)-(2,18) = "**" │ │ ├── closing_loc: (2,18)-(2,19) = ")" + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── locals: [:argument] │ ├── def_keyword_loc: (1,0)-(1,3) = "def" @@ -110,6 +111,7 @@ │ │ │ ├── operator_loc: (6,16)-(6,17) = "*" │ │ │ └── expression: ∅ │ │ ├── closing_loc: (6,17)-(6,18) = ")" + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── locals: [:argument] │ ├── def_keyword_loc: (5,0)-(5,3) = "def" diff --git a/snapshots/unparser/corpus/literal/super.txt b/snapshots/unparser/corpus/literal/super.txt index a6311116ca..a3855c140e 100644 --- a/snapshots/unparser/corpus/literal/super.txt +++ b/snapshots/unparser/corpus/literal/super.txt @@ -32,6 +32,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── rparen_loc: (3,7)-(3,8) = ")" │ └── block: ∅ @@ -52,6 +53,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── @ CallNode (location: (4,9)-(4,10)) │ │ ├── flags: variable_call, ignore_visibility @@ -62,6 +64,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── rparen_loc: (4,10)-(4,11) = ")" │ └── block: ∅ @@ -84,6 +87,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ └── operator_loc: (5,6)-(5,7) = "&" ├── @ SuperNode (location: (6,0)-(6,16)) @@ -103,6 +107,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── rparen_loc: (6,15)-(6,16) = ")" │ └── block: @@ -118,6 +123,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ └── operator_loc: (6,9)-(6,10) = "&" ├── @ SuperNode (location: (7,0)-(9,2)) @@ -137,6 +143,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: │ │ @ BlockNode (location: (7,8)-(9,1)) │ │ ├── flags: ∅ @@ -155,6 +162,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── opening_loc: (7,8)-(7,9) = "{" │ │ └── closing_loc: (9,0)-(9,1) = "}" @@ -180,6 +188,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── opening_loc: (10,6)-(10,7) = "{" │ └── closing_loc: (12,0)-(12,1) = "}" @@ -200,6 +209,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── rparen_loc: (13,7)-(13,8) = ")" │ └── block: @@ -220,6 +230,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── opening_loc: (13,9)-(13,10) = "{" │ └── closing_loc: (15,0)-(15,1) = "}" @@ -247,6 +258,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── opening_loc: (16,8)-(16,9) = "{" │ └── closing_loc: (18,0)-(18,1) = "}" @@ -267,6 +279,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ └── @ CallNode (location: (19,9)-(19,10)) │ ├── flags: variable_call, ignore_visibility @@ -277,6 +290,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── rparen_loc: (19,10)-(19,11) = ")" └── block: @@ -297,6 +311,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── opening_loc: (19,12)-(19,13) = "{" └── closing_loc: (21,0)-(21,1) = "}" diff --git a/snapshots/unparser/corpus/literal/unary.txt b/snapshots/unparser/corpus/literal/unary.txt index ec2115e411..d64e24adad 100644 --- a/snapshots/unparser/corpus/literal/unary.txt +++ b/snapshots/unparser/corpus/literal/unary.txt @@ -17,6 +17,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (2,0)-(2,5)) │ ├── flags: newline @@ -39,6 +40,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── opening_loc: (2,1)-(2,2) = "(" │ │ └── closing_loc: (2,4)-(2,5) = ")" @@ -48,6 +50,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (3,0)-(3,16)) │ ├── flags: newline @@ -79,6 +82,7 @@ │ │ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ │ │ ├── arguments: ∅ │ │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ │ ├── equal_loc: ∅ │ │ │ │ │ │ └── block: ∅ │ │ │ │ │ ├── right: │ │ │ │ │ │ @ CallNode (location: (3,11)-(3,14)) @@ -90,6 +94,7 @@ │ │ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ │ │ ├── arguments: ∅ │ │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ │ ├── equal_loc: ∅ │ │ │ │ │ │ └── block: ∅ │ │ │ │ │ └── operator_loc: (3,8)-(3,10) = "||" │ │ │ │ ├── opening_loc: (3,3)-(3,4) = "(" @@ -100,6 +105,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── opening_loc: (3,1)-(3,2) = "(" │ │ └── closing_loc: (3,15)-(3,16) = ")" @@ -109,6 +115,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (4,0)-(4,9)) │ ├── flags: newline @@ -134,6 +141,7 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ ├── opening_loc: (4,1)-(4,2) = "(" │ │ │ └── closing_loc: (4,4)-(4,5) = ")" @@ -143,6 +151,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: ∅ │ ├── name: :! @@ -150,6 +159,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (5,0)-(5,2)) │ ├── flags: newline @@ -163,6 +173,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: ∅ │ ├── name: :~ @@ -170,6 +181,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (6,0)-(6,2)) │ ├── flags: newline @@ -183,6 +195,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: ∅ │ ├── name: :-@ @@ -190,6 +203,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (7,0)-(7,2)) │ ├── flags: newline @@ -203,6 +217,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: ∅ │ ├── name: :+@ @@ -210,6 +225,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (8,0)-(8,9)) │ ├── flags: newline @@ -235,6 +251,7 @@ │ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ │ ├── arguments: ∅ │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ ├── equal_loc: ∅ │ │ │ │ │ └── block: ∅ │ │ │ │ ├── call_operator_loc: ∅ │ │ │ │ ├── name: :-@ @@ -242,6 +259,7 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ ├── opening_loc: (8,1)-(8,2) = "(" │ │ │ └── closing_loc: (8,4)-(8,5) = ")" @@ -251,6 +269,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: ∅ │ ├── name: :-@ @@ -258,6 +277,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ └── @ CallNode (location: (9,0)-(9,9)) ├── flags: newline @@ -283,6 +303,7 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ ├── call_operator_loc: ∅ │ │ │ ├── name: :+@ @@ -290,6 +311,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── opening_loc: (9,1)-(9,2) = "(" │ │ └── closing_loc: (9,4)-(9,5) = ")" @@ -299,6 +321,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── call_operator_loc: ∅ ├── name: :+@ @@ -306,4 +329,5 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/unparser/corpus/literal/variables.txt b/snapshots/unparser/corpus/literal/variables.txt index 3861af1a46..f2c2e32ebd 100644 --- a/snapshots/unparser/corpus/literal/variables.txt +++ b/snapshots/unparser/corpus/literal/variables.txt @@ -14,6 +14,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ InstanceVariableReadNode (location: (2,0)-(2,2)) │ ├── flags: newline diff --git a/snapshots/unparser/corpus/literal/while.txt b/snapshots/unparser/corpus/literal/while.txt index 642a5c182e..f11ba958a6 100644 --- a/snapshots/unparser/corpus/literal/while.txt +++ b/snapshots/unparser/corpus/literal/while.txt @@ -26,6 +26,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: │ │ @ BlockNode (location: (2,6)-(6,3)) │ │ ├── flags: ∅ @@ -68,6 +69,7 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ └── statements: │ │ │ @ StatementsNode (location: (4,6)-(4,15)) @@ -128,8 +130,10 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── statements: │ │ @ StatementsNode (location: (10,2)-(10,11)) @@ -150,6 +154,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── operator_loc: (10,6)-(10,7) = "=" │ ├── locals: [:foo] @@ -200,6 +205,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── operator_loc: (14,6)-(14,7) = "=" │ ├── end_keyword_loc: (15,0)-(15,3) = "end" @@ -245,6 +251,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── operator_loc: (18,6)-(18,7) = "=" │ ├── end_keyword_loc: (19,0)-(19,3) = "end" @@ -276,6 +283,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── statements: │ │ @ StatementsNode (location: (23,4)-(23,13)) @@ -296,6 +304,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── operator_loc: (23,8)-(23,9) = "=" │ ├── end_keyword_loc: (25,0)-(25,3) = "end" @@ -321,6 +330,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: │ │ @ BlockNode (location: (28,7)-(32,3)) │ │ ├── flags: ∅ @@ -363,6 +373,7 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ └── statements: │ │ │ @ StatementsNode (location: (30,6)-(30,15)) @@ -383,6 +394,7 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ └── operator_loc: (30,10)-(30,11) = "=" │ │ ├── opening_loc: (28,7)-(28,8) = "{" @@ -410,6 +422,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: │ │ @ BlockNode (location: (36,7)-(40,3)) │ │ ├── flags: ∅ @@ -466,6 +479,7 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ └── operator_loc: (38,10)-(38,11) = "=" │ │ ├── opening_loc: (36,7)-(36,8) = "{" @@ -499,6 +513,7 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ └── statements: │ │ │ @ StatementsNode (location: (42,5)-(44,3)) @@ -520,6 +535,7 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ ├── rescue_clause: ∅ │ │ │ ├── else_clause: ∅ @@ -543,6 +559,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ └── statements: │ @ StatementsNode (location: (45,0)-(47,3)) @@ -564,6 +581,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── rescue_clause: ∅ │ ├── else_clause: ∅ @@ -584,6 +602,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ └── statements: │ @ StatementsNode (location: (48,0)-(51,3)) @@ -605,6 +624,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── @ CallNode (location: (50,2)-(50,5)) │ │ ├── flags: newline, variable_call, ignore_visibility @@ -615,6 +635,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── rescue_clause: ∅ │ ├── else_clause: ∅ @@ -635,6 +656,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ └── statements: │ @ StatementsNode (location: (52,0)-(55,3)) @@ -656,6 +678,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── @ CallNode (location: (54,2)-(54,5)) │ │ ├── flags: newline, variable_call, ignore_visibility @@ -666,6 +689,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── rescue_clause: ∅ │ ├── else_clause: ∅ @@ -716,6 +740,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: │ │ │ @ BlockNode (location: (61,11)-(62,1)) │ │ │ ├── flags: ∅ @@ -781,6 +806,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: │ │ @ BlockNode (location: (70,11)-(71,1)) │ │ ├── flags: ∅ diff --git a/snapshots/unparser/corpus/semantic/and.txt b/snapshots/unparser/corpus/semantic/and.txt index ad2b639777..9206b1bf33 100644 --- a/snapshots/unparser/corpus/semantic/and.txt +++ b/snapshots/unparser/corpus/semantic/and.txt @@ -20,6 +20,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── right: │ │ │ @ CallNode (location: (1,4)-(1,5)) @@ -31,6 +32,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── operator_loc: (1,1)-(1,4) = "..." │ ├── right: @@ -46,6 +48,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── right: │ │ │ @ CallNode (location: (1,13)-(1,14)) @@ -57,6 +60,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── operator_loc: (1,10)-(1,13) = "..." │ └── operator_loc: (1,6)-(1,8) = "or" @@ -75,6 +79,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── right: │ │ │ @ CallNode (location: (2,4)-(2,5)) @@ -86,6 +91,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── operator_loc: (2,1)-(2,4) = "..." │ ├── right: @@ -101,6 +107,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── right: │ │ │ @ CallNode (location: (2,14)-(2,15)) @@ -112,6 +119,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── operator_loc: (2,11)-(2,14) = "..." │ └── operator_loc: (2,6)-(2,9) = "and" @@ -134,6 +142,7 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ ├── right: │ │ │ │ @ CallNode (location: (4,7)-(4,8)) @@ -145,6 +154,7 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ └── operator_loc: (4,4)-(4,7) = "..." │ │ ├── right: @@ -160,6 +170,7 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ ├── right: │ │ │ │ @ CallNode (location: (4,16)-(4,17)) @@ -171,6 +182,7 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ └── operator_loc: (4,13)-(4,16) = "..." │ │ └── operator_loc: (4,9)-(4,11) = "or" @@ -197,6 +209,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── right: │ │ │ @ CallNode (location: (7,7)-(7,8)) @@ -208,6 +221,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── operator_loc: (7,4)-(7,7) = "..." │ ├── right: @@ -223,6 +237,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── right: │ │ │ @ CallNode (location: (7,17)-(7,18)) @@ -234,6 +249,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── operator_loc: (7,14)-(7,17) = "..." │ └── operator_loc: (7,9)-(7,12) = "and" diff --git a/snapshots/unparser/corpus/semantic/block.txt b/snapshots/unparser/corpus/semantic/block.txt index b6ea10f25f..5de8246b64 100644 --- a/snapshots/unparser/corpus/semantic/block.txt +++ b/snapshots/unparser/corpus/semantic/block.txt @@ -14,6 +14,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (1,4)-(2,3)) │ ├── flags: ∅ @@ -31,6 +32,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (4,4)-(6,3)) │ ├── flags: ∅ @@ -65,6 +67,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (8,4)-(11,3)) │ ├── flags: ∅ @@ -96,6 +99,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (13,4)-(14,3)) │ ├── flags: ∅ @@ -140,6 +144,7 @@ │ │ ├── closing_loc: (18,0)-(19,0) = "DOC\n" │ │ └── unescaped: " b\n" │ ├── closing_loc: (16,10)-(16,11) = ")" + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (16,12)-(20,3)) │ ├── flags: ∅ @@ -191,6 +196,7 @@ │ ├── closing_loc: (24,0)-(25,0) = "DOC\n" │ └── unescaped: " b\n" ├── closing_loc: (22,10)-(22,11) = ")" + ├── equal_loc: ∅ └── block: @ BlockNode (location: (22,12)-(26,3)) ├── flags: ∅ @@ -209,6 +215,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── opening_loc: (22,12)-(22,14) = "do" └── closing_loc: (26,0)-(26,3) = "end" diff --git a/snapshots/unparser/corpus/semantic/def.txt b/snapshots/unparser/corpus/semantic/def.txt index f05ce02bca..f1e0a913f1 100644 --- a/snapshots/unparser/corpus/semantic/def.txt +++ b/snapshots/unparser/corpus/semantic/def.txt @@ -33,6 +33,7 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ ├── call_operator_loc: ∅ │ │ │ ├── name: :- @@ -51,8 +52,10 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── opening_loc: (2,2)-(2,3) = "(" │ │ └── closing_loc: (2,8)-(2,9) = ")" @@ -85,6 +88,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── keyword_loc: (6,4)-(6,10) = "rescue" │ └── rescue_expression: diff --git a/snapshots/unparser/corpus/semantic/kwbegin.txt b/snapshots/unparser/corpus/semantic/kwbegin.txt index dc5f529efb..432531b577 100644 --- a/snapshots/unparser/corpus/semantic/kwbegin.txt +++ b/snapshots/unparser/corpus/semantic/kwbegin.txt @@ -60,6 +60,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── rescue_clause: ∅ │ ├── else_clause: ∅ @@ -81,6 +82,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── rescue_clause: │ │ @ RescueNode (location: (16,0)-(17,3)) @@ -103,6 +105,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── subsequent: ∅ │ ├── else_clause: ∅ @@ -124,6 +127,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── @ CallNode (location: (22,2)-(22,3)) │ │ ├── flags: newline, variable_call, ignore_visibility @@ -134,6 +138,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── rescue_clause: │ │ @ RescueNode (location: (23,0)-(24,3)) @@ -156,6 +161,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── subsequent: ∅ │ ├── else_clause: ∅ @@ -227,6 +233,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── rescue_clause: │ @ RescueNode (location: (36,0)-(39,3)) @@ -252,6 +259,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ └── subsequent: │ @ RescueNode (location: (38,0)-(39,3)) @@ -277,6 +285,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ └── subsequent: ∅ ├── else_clause: ∅ @@ -297,6 +306,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ └── end_keyword_loc: (42,0)-(42,3) = "end" └── end_keyword_loc: (42,0)-(42,3) = "end" diff --git a/snapshots/unparser/corpus/semantic/literal.txt b/snapshots/unparser/corpus/semantic/literal.txt index 0d21b59d49..b296cee92d 100644 --- a/snapshots/unparser/corpus/semantic/literal.txt +++ b/snapshots/unparser/corpus/semantic/literal.txt @@ -105,8 +105,11 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── closing_loc: (14,9)-(14,10) = ")" + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/unparser/corpus/semantic/opasgn.txt b/snapshots/unparser/corpus/semantic/opasgn.txt index 870942f97e..a14bef38b5 100644 --- a/snapshots/unparser/corpus/semantic/opasgn.txt +++ b/snapshots/unparser/corpus/semantic/opasgn.txt @@ -17,6 +17,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── call_operator_loc: ∅ ├── opening_loc: (1,1)-(1,2) = "[" diff --git a/snapshots/unparser/corpus/semantic/send.txt b/snapshots/unparser/corpus/semantic/send.txt index f403d3d2b6..fd54e0e9c3 100644 --- a/snapshots/unparser/corpus/semantic/send.txt +++ b/snapshots/unparser/corpus/semantic/send.txt @@ -14,6 +14,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (2,0)-(2,6)) │ ├── flags: newline, ignore_visibility @@ -30,6 +31,7 @@ │ │ ├── flags: static_literal, decimal │ │ └── value: 1 │ ├── closing_loc: (2,5)-(2,6) = ")" + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (4,0)-(4,15)) │ ├── flags: newline @@ -49,6 +51,7 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ ├── call_operator_loc: (4,1)-(4,2) = "." │ │ │ ├── name: :=== @@ -67,8 +70,10 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ ├── closing_loc: (4,7)-(4,8) = ")" + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── call_operator_loc: (4,8)-(4,9) = "." │ │ ├── name: :c @@ -76,6 +81,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: ∅ │ ├── name: :== @@ -94,8 +100,10 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ └── @ CallNode (location: (6,0)-(6,15)) ├── flags: newline @@ -109,6 +117,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── call_operator_loc: ∅ ├── name: :== @@ -133,6 +142,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── call_operator_loc: (6,6)-(6,7) = "." │ │ ├── name: :c @@ -140,6 +150,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: (6,8)-(6,9) = "." │ ├── name: :=== @@ -158,8 +169,11 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── closing_loc: (6,14)-(6,15) = ")" + │ ├── equal_loc: ∅ │ └── block: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/unparser/corpus/semantic/while.txt b/snapshots/unparser/corpus/semantic/while.txt index de3a3335db..36f7b07c8d 100644 --- a/snapshots/unparser/corpus/semantic/while.txt +++ b/snapshots/unparser/corpus/semantic/while.txt @@ -20,6 +20,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: │ │ @ BlockNode (location: (1,11)-(1,13)) │ │ ├── flags: ∅ @@ -41,6 +42,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ UntilNode (location: (3,0)-(5,3)) │ ├── flags: newline @@ -57,6 +59,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: │ │ @ BlockNode (location: (3,9)-(3,11)) │ │ ├── flags: ∅ @@ -78,6 +81,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ WhileNode (location: (7,0)-(7,19)) │ ├── flags: newline @@ -108,6 +112,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ └── operator_loc: (7,4)-(7,5) = "=" ├── @ UntilNode (location: (9,0)-(9,18)) @@ -128,6 +133,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── right: │ │ │ @ CallNode (location: (9,13)-(9,18)) @@ -139,6 +145,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: │ │ │ @ BlockNode (location: (9,15)-(9,18)) │ │ │ ├── flags: ∅ @@ -161,6 +168,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ WhileNode (location: (11,0)-(13,3)) │ ├── flags: newline @@ -183,6 +191,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── operator_loc: (11,8)-(11,9) = "=" │ └── statements: @@ -217,6 +226,7 @@ │ │ │ ├── closing_loc: (16,0)-(17,0) = "FOO\n" │ │ │ └── unescaped: "" │ │ ├── closing_loc: (15,16)-(15,17) = ")" + │ │ ├── equal_loc: ∅ │ │ └── block: │ │ @ BlockNode (location: (15,18)-(18,3)) │ │ ├── flags: ∅ @@ -235,6 +245,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── opening_loc: (15,18)-(15,20) = "do" │ │ └── closing_loc: (18,0)-(18,3) = "end" @@ -273,6 +284,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── operator_loc: (21,6)-(21,7) = "=" │ └── @ WhileNode (location: (22,2)-(24,5)) @@ -304,6 +316,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ └── operator_loc: (23,8)-(23,9) = "=" ├── end_keyword_loc: (25,0)-(25,3) = "end" diff --git a/snapshots/until.txt b/snapshots/until.txt index e89a17450a..55b3beafa8 100644 --- a/snapshots/until.txt +++ b/snapshots/until.txt @@ -44,6 +44,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (5,4)-(5,24)) │ ├── flags: ∅ @@ -80,6 +81,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (7,4)-(7,23)) │ ├── flags: ∅ @@ -138,6 +140,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ └── statements: │ @ StatementsNode (location: (11,0)-(11,10)) @@ -167,6 +170,7 @@ │ │ ├── closing_loc: ∅ │ │ └── unescaped: "b" │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ └── @ WhileNode (location: (13,0)-(13,20)) ├── flags: newline @@ -186,6 +190,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── pattern: │ │ @ LocalVariableTargetNode (location: (13,17)-(13,20)) @@ -206,4 +211,5 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/variables.txt b/snapshots/variables.txt index f36ef08075..d25338e88d 100644 --- a/snapshots/variables.txt +++ b/snapshots/variables.txt @@ -85,6 +85,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ LocalVariableWriteNode (location: (19,0)-(19,7)) │ ├── flags: newline @@ -397,6 +398,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── @ CallNode (location: (45,4)-(45,5)) │ │ │ ├── flags: newline, variable_call, ignore_visibility @@ -407,6 +409,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── @ CallNode (location: (45,7)-(45,8)) │ │ ├── flags: newline, variable_call, ignore_visibility @@ -417,6 +420,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── opening_loc: (45,0)-(45,1) = "(" │ └── closing_loc: (45,8)-(45,9) = ")" diff --git a/snapshots/while.txt b/snapshots/while.txt index 7d6d53c520..67d45e4d66 100644 --- a/snapshots/while.txt +++ b/snapshots/while.txt @@ -44,6 +44,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (5,4)-(5,24)) │ ├── flags: ∅ @@ -80,6 +81,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (7,4)-(7,23)) │ ├── flags: ∅ @@ -138,6 +140,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ └── statements: │ @ StatementsNode (location: (11,0)-(11,10)) @@ -167,6 +170,7 @@ │ │ ├── closing_loc: ∅ │ │ └── unescaped: "b" │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (13,0)-(13,58)) │ ├── flags: newline, ignore_visibility @@ -177,6 +181,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (13,4)-(13,58)) │ ├── flags: ∅ @@ -219,6 +224,7 @@ │ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ │ ├── arguments: ∅ │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ ├── equal_loc: ∅ │ │ │ │ │ └── block: │ │ │ │ │ @ BlockNode (location: (13,33)-(13,39)) │ │ │ │ │ ├── flags: ∅ @@ -259,6 +265,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (15,4)-(15,55)) │ ├── flags: ∅ @@ -303,6 +310,7 @@ │ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ │ ├── arguments: ∅ │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ ├── equal_loc: ∅ │ │ │ │ │ └── block: │ │ │ │ │ @ BlockNode (location: (15,30)-(15,36)) │ │ │ │ │ ├── flags: ∅ @@ -333,6 +341,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (17,4)-(17,56)) │ ├── flags: ∅ @@ -369,6 +378,7 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: │ │ │ │ @ BlockNode (location: (17,31)-(17,37)) │ │ │ │ ├── flags: ∅ @@ -397,6 +407,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (19,4)-(19,60)) │ ├── flags: ∅ @@ -439,6 +450,7 @@ │ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ │ ├── arguments: ∅ │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ ├── equal_loc: ∅ │ │ │ │ │ └── block: │ │ │ │ │ @ BlockNode (location: (19,35)-(19,41)) │ │ │ │ │ ├── flags: ∅ @@ -484,6 +496,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: │ │ │ @ BlockNode (location: (21,20)-(21,26)) │ │ │ ├── flags: ∅ @@ -518,6 +531,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── pattern: │ │ @ LocalVariableTargetNode (location: (23,17)-(23,20)) @@ -538,4 +552,5 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/whitequark/ambiuous_quoted_label_in_ternary_operator.txt b/snapshots/whitequark/ambiuous_quoted_label_in_ternary_operator.txt index 7c2f8a2d96..1bfcb0b3b5 100644 --- a/snapshots/whitequark/ambiuous_quoted_label_in_ternary_operator.txt +++ b/snapshots/whitequark/ambiuous_quoted_label_in_ternary_operator.txt @@ -18,6 +18,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── then_keyword_loc: (1,2)-(1,3) = "?" ├── statements: @@ -36,6 +37,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: ∅ │ ├── name: :& @@ -52,6 +54,7 @@ │ │ ├── closing_loc: (1,9)-(1,10) = "'" │ │ └── unescaped: "" │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── subsequent: │ @ ElseNode (location: (1,10)-(1,15)) diff --git a/snapshots/whitequark/and.txt b/snapshots/whitequark/and.txt index 3f548d55eb..e528ac9bc3 100644 --- a/snapshots/whitequark/and.txt +++ b/snapshots/whitequark/and.txt @@ -17,6 +17,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── right: │ │ @ CallNode (location: (1,7)-(1,10)) @@ -28,6 +29,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ └── operator_loc: (1,4)-(1,6) = "&&" └── @ AndNode (location: (3,0)-(3,11)) @@ -42,6 +44,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── right: │ @ CallNode (location: (3,8)-(3,11)) @@ -53,5 +56,6 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ └── operator_loc: (3,4)-(3,7) = "and" diff --git a/snapshots/whitequark/and_asgn.txt b/snapshots/whitequark/and_asgn.txt index f07cfd749d..a268cafb87 100644 --- a/snapshots/whitequark/and_asgn.txt +++ b/snapshots/whitequark/and_asgn.txt @@ -17,6 +17,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: (1,3)-(1,4) = "." │ ├── message_loc: (1,4)-(1,5) = "a" @@ -39,6 +40,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── call_operator_loc: ∅ ├── opening_loc: (3,3)-(3,4) = "[" diff --git a/snapshots/whitequark/and_or_masgn.txt b/snapshots/whitequark/and_or_masgn.txt index 208120c02e..9357fb4a87 100644 --- a/snapshots/whitequark/and_or_masgn.txt +++ b/snapshots/whitequark/and_or_masgn.txt @@ -17,6 +17,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── right: │ │ @ ParenthesesNode (location: (1,7)-(1,19)) @@ -51,6 +52,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── opening_loc: (1,7)-(1,8) = "(" │ │ └── closing_loc: (1,18)-(1,19) = ")" @@ -67,6 +69,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── right: │ @ ParenthesesNode (location: (3,7)-(3,19)) @@ -101,6 +104,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── opening_loc: (3,7)-(3,8) = "(" │ └── closing_loc: (3,18)-(3,19) = ")" diff --git a/snapshots/whitequark/anonymous_blockarg.txt b/snapshots/whitequark/anonymous_blockarg.txt index af4654ab82..3d180d6910 100644 --- a/snapshots/whitequark/anonymous_blockarg.txt +++ b/snapshots/whitequark/anonymous_blockarg.txt @@ -38,6 +38,7 @@ │ ├── opening_loc: (1,15)-(1,16) = "(" │ ├── arguments: ∅ │ ├── closing_loc: (1,17)-(1,18) = ")" + │ ├── equal_loc: ∅ │ └── block: │ @ BlockArgumentNode (location: (1,16)-(1,17)) │ ├── flags: ∅ diff --git a/snapshots/whitequark/arg_label.txt b/snapshots/whitequark/arg_label.txt index 97c1b45671..42c10dafa2 100644 --- a/snapshots/whitequark/arg_label.txt +++ b/snapshots/whitequark/arg_label.txt @@ -33,6 +33,7 @@ │ │ │ ├── closing_loc: ∅ │ │ │ └── unescaped: "b" │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── locals: [] │ ├── def_keyword_loc: (1,0)-(1,3) = "def" @@ -69,6 +70,7 @@ │ │ │ ├── closing_loc: ∅ │ │ │ └── unescaped: "b" │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── locals: [] │ ├── def_keyword_loc: (4,0)-(4,3) = "def" @@ -86,6 +88,7 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: @ BlockNode (location: (6,2)-(6,12)) ├── flags: ∅ @@ -119,6 +122,7 @@ │ │ ├── closing_loc: ∅ │ │ └── unescaped: "b" │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── opening_loc: (6,2)-(6,3) = "{" └── closing_loc: (6,11)-(6,12) = "}" diff --git a/snapshots/whitequark/arg_scope.txt b/snapshots/whitequark/arg_scope.txt index 7838aad5fd..c5f0371b89 100644 --- a/snapshots/whitequark/arg_scope.txt +++ b/snapshots/whitequark/arg_scope.txt @@ -14,6 +14,7 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: @ BlockNode (location: (1,6)-(1,13)) ├── flags: ∅ diff --git a/snapshots/whitequark/args_args_assocs.txt b/snapshots/whitequark/args_args_assocs.txt index 67b53cc514..241dc55763 100644 --- a/snapshots/whitequark/args_args_assocs.txt +++ b/snapshots/whitequark/args_args_assocs.txt @@ -25,6 +25,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── @ KeywordHashNode (location: (1,9)-(1,18)) │ │ ├── flags: symbol_keys @@ -44,6 +45,7 @@ │ │ │ └── value: 1 │ │ └── operator_loc: (1,14)-(1,16) = "=>" │ ├── closing_loc: (1,18)-(1,19) = ")" + │ ├── equal_loc: ∅ │ └── block: ∅ └── @ CallNode (location: (3,0)-(3,25)) ├── flags: newline, ignore_visibility @@ -65,6 +67,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ └── @ KeywordHashNode (location: (3,9)-(3,18)) │ ├── flags: symbol_keys @@ -84,6 +87,7 @@ │ │ └── value: 1 │ └── operator_loc: (3,14)-(3,16) = "=>" ├── closing_loc: (3,24)-(3,25) = ")" + ├── equal_loc: ∅ └── block: @ BlockArgumentNode (location: (3,20)-(3,24)) ├── flags: ∅ @@ -97,5 +101,6 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ └── operator_loc: (3,20)-(3,21) = "&" diff --git a/snapshots/whitequark/args_args_assocs_comma.txt b/snapshots/whitequark/args_args_assocs_comma.txt index cb98bdd1a0..ddf24a00b8 100644 --- a/snapshots/whitequark/args_args_assocs_comma.txt +++ b/snapshots/whitequark/args_args_assocs_comma.txt @@ -17,6 +17,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── call_operator_loc: ∅ ├── name: :[] @@ -35,6 +36,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ └── @ KeywordHashNode (location: (1,9)-(1,18)) │ ├── flags: symbol_keys @@ -54,4 +56,5 @@ │ │ └── value: 1 │ └── operator_loc: (1,14)-(1,16) = "=>" ├── closing_loc: (1,19)-(1,20) = "]" + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/whitequark/args_args_comma.txt b/snapshots/whitequark/args_args_comma.txt index 1452565827..1afdbf6bb3 100644 --- a/snapshots/whitequark/args_args_comma.txt +++ b/snapshots/whitequark/args_args_comma.txt @@ -17,6 +17,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── call_operator_loc: ∅ ├── name: :[] @@ -35,6 +36,8 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── closing_loc: (1,8)-(1,9) = "]" + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/whitequark/args_args_star.txt b/snapshots/whitequark/args_args_star.txt index ffa19daba9..5845b84b6b 100644 --- a/snapshots/whitequark/args_args_star.txt +++ b/snapshots/whitequark/args_args_star.txt @@ -25,6 +25,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── @ SplatNode (location: (1,9)-(1,13)) │ │ ├── flags: ∅ @@ -39,8 +40,10 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── closing_loc: (1,13)-(1,14) = ")" + │ ├── equal_loc: ∅ │ └── block: ∅ └── @ CallNode (location: (3,0)-(3,20)) ├── flags: newline, ignore_visibility @@ -62,6 +65,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ └── @ SplatNode (location: (3,9)-(3,13)) │ ├── flags: ∅ @@ -76,8 +80,10 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── closing_loc: (3,19)-(3,20) = ")" + ├── equal_loc: ∅ └── block: @ BlockArgumentNode (location: (3,15)-(3,19)) ├── flags: ∅ @@ -91,5 +97,6 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ └── operator_loc: (3,15)-(3,16) = "&" diff --git a/snapshots/whitequark/args_assocs_comma.txt b/snapshots/whitequark/args_assocs_comma.txt index 2d00798a37..86ab339f0e 100644 --- a/snapshots/whitequark/args_assocs_comma.txt +++ b/snapshots/whitequark/args_assocs_comma.txt @@ -17,6 +17,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── call_operator_loc: ∅ ├── name: :[] @@ -44,4 +45,5 @@ │ │ └── value: 1 │ └── operator_loc: (1,9)-(1,11) = "=>" ├── closing_loc: (1,14)-(1,15) = "]" + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/whitequark/args_block_pass.txt b/snapshots/whitequark/args_block_pass.txt index 22460638ce..f1765fb79c 100644 --- a/snapshots/whitequark/args_block_pass.txt +++ b/snapshots/whitequark/args_block_pass.txt @@ -14,6 +14,7 @@ ├── opening_loc: (1,3)-(1,4) = "(" ├── arguments: ∅ ├── closing_loc: (1,8)-(1,9) = ")" + ├── equal_loc: ∅ └── block: @ BlockArgumentNode (location: (1,4)-(1,8)) ├── flags: ∅ @@ -27,5 +28,6 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ └── operator_loc: (1,4)-(1,5) = "&" diff --git a/snapshots/whitequark/args_cmd.txt b/snapshots/whitequark/args_cmd.txt index 1cfdf1bb10..9bc295c30b 100644 --- a/snapshots/whitequark/args_cmd.txt +++ b/snapshots/whitequark/args_cmd.txt @@ -36,8 +36,11 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── closing_loc: (1,9)-(1,10) = ")" + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/whitequark/args_star.txt b/snapshots/whitequark/args_star.txt index d28e53af19..45eb557816 100644 --- a/snapshots/whitequark/args_star.txt +++ b/snapshots/whitequark/args_star.txt @@ -29,8 +29,10 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── closing_loc: (1,8)-(1,9) = ")" + │ ├── equal_loc: ∅ │ └── block: ∅ └── @ CallNode (location: (3,0)-(3,15)) ├── flags: newline, ignore_visibility @@ -56,8 +58,10 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── closing_loc: (3,14)-(3,15) = ")" + ├── equal_loc: ∅ └── block: @ BlockArgumentNode (location: (3,10)-(3,14)) ├── flags: ∅ @@ -71,5 +75,6 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ └── operator_loc: (3,10)-(3,11) = "&" diff --git a/snapshots/whitequark/array_splat.txt b/snapshots/whitequark/array_splat.txt index bfd74572ca..ae94a8eda3 100644 --- a/snapshots/whitequark/array_splat.txt +++ b/snapshots/whitequark/array_splat.txt @@ -21,6 +21,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── opening_loc: (1,0)-(1,1) = "[" │ └── closing_loc: (1,5)-(1,6) = "]" @@ -43,6 +44,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── @ IntegerNode (location: (3,10)-(3,11)) │ │ ├── flags: static_literal, decimal @@ -68,6 +70,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── opening_loc: (5,0)-(5,1) = "[" └── closing_loc: (5,8)-(5,9) = "]" diff --git a/snapshots/whitequark/array_symbols_interp.txt b/snapshots/whitequark/array_symbols_interp.txt index f250ef041f..0fa0416870 100644 --- a/snapshots/whitequark/array_symbols_interp.txt +++ b/snapshots/whitequark/array_symbols_interp.txt @@ -34,6 +34,7 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ └── closing_loc: (1,12)-(1,13) = "}" │ │ └── closing_loc: ∅ @@ -68,6 +69,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── closing_loc: (3,11)-(3,12) = "}" │ └── closing_loc: ∅ diff --git a/snapshots/whitequark/array_words_interp.txt b/snapshots/whitequark/array_words_interp.txt index dd104a1921..2acf9d2943 100644 --- a/snapshots/whitequark/array_words_interp.txt +++ b/snapshots/whitequark/array_words_interp.txt @@ -34,6 +34,7 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ └── closing_loc: (1,12)-(1,13) = "}" │ │ └── closing_loc: ∅ @@ -68,6 +69,7 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ └── closing_loc: (3,12)-(3,13) = "}" │ │ ├── @ StringNode (location: (3,13)-(3,16)) diff --git a/snapshots/whitequark/asgn_cmd.txt b/snapshots/whitequark/asgn_cmd.txt index c212864ded..f2b2cfd767 100644 --- a/snapshots/whitequark/asgn_cmd.txt +++ b/snapshots/whitequark/asgn_cmd.txt @@ -33,6 +33,7 @@ │ │ │ │ ├── name: :foo │ │ │ │ └── depth: 0 │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── operator_loc: (1,10)-(1,11) = "=" │ └── operator_loc: (1,4)-(1,5) = "=" @@ -58,5 +59,6 @@ │ │ ├── name: :foo │ │ └── depth: 0 │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ └── operator_loc: (3,4)-(3,5) = "=" diff --git a/snapshots/whitequark/asgn_mrhs.txt b/snapshots/whitequark/asgn_mrhs.txt index 972eaf7fa5..b8395d1b2d 100644 --- a/snapshots/whitequark/asgn_mrhs.txt +++ b/snapshots/whitequark/asgn_mrhs.txt @@ -27,6 +27,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── opening_loc: ∅ │ │ └── closing_loc: ∅ @@ -49,6 +50,7 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ └── @ IntegerNode (location: (3,11)-(3,12)) │ │ │ ├── flags: static_literal, decimal @@ -74,6 +76,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── @ SplatNode (location: (5,11)-(5,15)) │ │ ├── flags: ∅ @@ -88,6 +91,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── opening_loc: ∅ │ └── closing_loc: ∅ diff --git a/snapshots/whitequark/bang.txt b/snapshots/whitequark/bang.txt index 165a5d3149..f9ad821fb3 100644 --- a/snapshots/whitequark/bang.txt +++ b/snapshots/whitequark/bang.txt @@ -17,6 +17,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── call_operator_loc: ∅ ├── name: :! @@ -24,4 +25,5 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/whitequark/bang_cmd.txt b/snapshots/whitequark/bang_cmd.txt index d4487ad6ca..f78e47f5e4 100644 --- a/snapshots/whitequark/bang_cmd.txt +++ b/snapshots/whitequark/bang_cmd.txt @@ -28,8 +28,10 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── call_operator_loc: ∅ ├── name: :! @@ -37,4 +39,5 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/whitequark/begin_cmdarg.txt b/snapshots/whitequark/begin_cmdarg.txt index 8287191fab..964f7955f9 100644 --- a/snapshots/whitequark/begin_cmdarg.txt +++ b/snapshots/whitequark/begin_cmdarg.txt @@ -35,6 +35,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: │ │ @ BlockNode (location: (1,16)-(1,24)) │ │ ├── flags: ∅ @@ -54,4 +55,5 @@ │ ├── ensure_clause: ∅ │ └── end_keyword_loc: (1,25)-(1,28) = "end" ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/whitequark/beginless_erange_after_newline.txt b/snapshots/whitequark/beginless_erange_after_newline.txt index fe05701982..d88aadd4a6 100644 --- a/snapshots/whitequark/beginless_erange_after_newline.txt +++ b/snapshots/whitequark/beginless_erange_after_newline.txt @@ -14,6 +14,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ └── @ RangeNode (location: (2,0)-(2,6)) ├── flags: newline, static_literal, exclude_end diff --git a/snapshots/whitequark/beginless_irange_after_newline.txt b/snapshots/whitequark/beginless_irange_after_newline.txt index ae5c09808a..b067a7b369 100644 --- a/snapshots/whitequark/beginless_irange_after_newline.txt +++ b/snapshots/whitequark/beginless_irange_after_newline.txt @@ -14,6 +14,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ └── @ RangeNode (location: (2,0)-(2,5)) ├── flags: newline, static_literal diff --git a/snapshots/whitequark/block_arg_combinations.txt b/snapshots/whitequark/block_arg_combinations.txt index 733f1ad6b5..224e33dd01 100644 --- a/snapshots/whitequark/block_arg_combinations.txt +++ b/snapshots/whitequark/block_arg_combinations.txt @@ -14,6 +14,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (1,1)-(1,5)) │ ├── flags: ∅ @@ -31,6 +32,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (3,1)-(3,8)) │ ├── flags: ∅ @@ -54,6 +56,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (5,1)-(5,9)) │ ├── flags: ∅ @@ -91,6 +94,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (7,1)-(7,12)) │ ├── flags: ∅ @@ -133,6 +137,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (9,1)-(9,16)) │ ├── flags: ∅ @@ -178,6 +183,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (11,1)-(11,13)) │ ├── flags: ∅ @@ -220,6 +226,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (13,1)-(13,9)) │ ├── flags: ∅ @@ -257,6 +264,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (15,1)-(15,8)) │ ├── flags: ∅ @@ -294,6 +302,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (17,1)-(19,3)) │ ├── flags: ∅ @@ -320,6 +329,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (21,1)-(21,9)) │ ├── flags: ∅ @@ -346,6 +356,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (23,1)-(23,12)) │ ├── flags: ∅ @@ -386,6 +397,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (25,1)-(25,15)) │ ├── flags: ∅ @@ -431,6 +443,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (27,1)-(27,19)) │ ├── flags: ∅ @@ -479,6 +492,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (29,1)-(29,16)) │ ├── flags: ∅ @@ -524,6 +538,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (31,1)-(31,12)) │ ├── flags: ∅ @@ -564,6 +579,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (33,1)-(33,11)) │ ├── flags: ∅ @@ -604,6 +620,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (35,1)-(35,11)) │ ├── flags: ∅ @@ -642,6 +659,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (37,1)-(37,17)) │ ├── flags: ∅ @@ -691,6 +709,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (39,1)-(39,24)) │ ├── flags: ∅ @@ -748,6 +767,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (41,1)-(41,27)) │ ├── flags: ∅ @@ -811,6 +831,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (43,1)-(43,20)) │ ├── flags: ∅ @@ -863,6 +884,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (45,1)-(45,9)) │ ├── flags: ∅ @@ -900,6 +922,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (47,1)-(47,8)) │ ├── flags: ∅ @@ -935,6 +958,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (49,1)-(49,14)) │ ├── flags: ∅ @@ -981,6 +1005,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (51,1)-(51,18)) │ ├── flags: ∅ @@ -1032,6 +1057,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (53,1)-(53,21)) │ ├── flags: ∅ @@ -1086,6 +1112,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (55,1)-(55,17)) │ ├── flags: ∅ @@ -1135,6 +1162,7 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: @ BlockNode (location: (57,1)-(57,7)) ├── flags: ∅ diff --git a/snapshots/whitequark/block_kwarg.txt b/snapshots/whitequark/block_kwarg.txt index 65e827fb5b..8ab737f4b6 100644 --- a/snapshots/whitequark/block_kwarg.txt +++ b/snapshots/whitequark/block_kwarg.txt @@ -14,6 +14,7 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: @ BlockNode (location: (1,1)-(1,11)) ├── flags: ∅ diff --git a/snapshots/whitequark/block_kwarg_combinations.txt b/snapshots/whitequark/block_kwarg_combinations.txt index ec1659a941..6af2600515 100644 --- a/snapshots/whitequark/block_kwarg_combinations.txt +++ b/snapshots/whitequark/block_kwarg_combinations.txt @@ -14,6 +14,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (1,1)-(1,16)) │ ├── flags: ∅ @@ -56,6 +57,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (3,1)-(3,17)) │ ├── flags: ∅ @@ -101,6 +103,7 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: @ BlockNode (location: (5,1)-(5,32)) ├── flags: ∅ diff --git a/snapshots/whitequark/blockargs.txt b/snapshots/whitequark/blockargs.txt index 53ef39ac0f..6cd5c6590b 100644 --- a/snapshots/whitequark/blockargs.txt +++ b/snapshots/whitequark/blockargs.txt @@ -14,6 +14,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (1,1)-(1,5)) │ ├── flags: ∅ @@ -31,6 +32,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (3,1)-(3,8)) │ ├── flags: ∅ @@ -54,6 +56,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (5,1)-(5,9)) │ ├── flags: ∅ @@ -91,6 +94,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (7,1)-(7,16)) │ ├── flags: ∅ @@ -133,6 +137,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (9,1)-(9,12)) │ ├── flags: ∅ @@ -175,6 +180,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (11,1)-(11,16)) │ ├── flags: ∅ @@ -220,6 +226,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (13,1)-(13,13)) │ ├── flags: ∅ @@ -262,6 +269,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (15,1)-(15,9)) │ ├── flags: ∅ @@ -299,6 +307,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (17,1)-(17,8)) │ ├── flags: ∅ @@ -336,6 +345,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (19,1)-(21,3)) │ ├── flags: ∅ @@ -362,6 +372,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (23,1)-(23,9)) │ ├── flags: ∅ @@ -388,6 +399,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (25,1)-(25,12)) │ ├── flags: ∅ @@ -428,6 +440,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (27,1)-(27,15)) │ ├── flags: ∅ @@ -473,6 +486,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (29,1)-(29,19)) │ ├── flags: ∅ @@ -521,6 +535,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (31,1)-(31,16)) │ ├── flags: ∅ @@ -566,6 +581,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (33,1)-(33,12)) │ ├── flags: ∅ @@ -606,6 +622,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (35,1)-(35,11)) │ ├── flags: ∅ @@ -646,6 +663,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (37,1)-(37,12)) │ ├── flags: ∅ @@ -686,6 +704,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (39,1)-(39,11)) │ ├── flags: ∅ @@ -724,6 +743,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (41,1)-(41,17)) │ ├── flags: ∅ @@ -773,6 +793,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (43,1)-(43,24)) │ ├── flags: ∅ @@ -830,6 +851,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (45,1)-(45,27)) │ ├── flags: ∅ @@ -893,6 +915,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (47,1)-(47,20)) │ ├── flags: ∅ @@ -945,6 +968,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (49,1)-(49,9)) │ ├── flags: ∅ @@ -982,6 +1006,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (51,1)-(51,8)) │ ├── flags: ∅ @@ -1017,6 +1042,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (53,1)-(53,8)) │ ├── flags: ∅ @@ -1052,6 +1078,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (55,1)-(55,8)) │ ├── flags: ∅ @@ -1087,6 +1114,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (57,1)-(57,17)) │ ├── flags: ∅ @@ -1132,6 +1160,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (59,1)-(59,32)) │ ├── flags: ∅ @@ -1190,6 +1219,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (61,1)-(61,11)) │ ├── flags: ∅ @@ -1226,6 +1256,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (63,1)-(63,14)) │ ├── flags: ∅ @@ -1272,6 +1303,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (65,1)-(65,18)) │ ├── flags: ∅ @@ -1323,6 +1355,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (67,1)-(67,21)) │ ├── flags: ∅ @@ -1377,6 +1410,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (69,1)-(69,17)) │ ├── flags: ∅ @@ -1426,6 +1460,7 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: @ BlockNode (location: (71,1)-(71,7)) ├── flags: ∅ diff --git a/snapshots/whitequark/bug_447.txt b/snapshots/whitequark/bug_447.txt index 6c8644d462..99353f85a0 100644 --- a/snapshots/whitequark/bug_447.txt +++ b/snapshots/whitequark/bug_447.txt @@ -22,6 +22,7 @@ │ │ ├── opening_loc: (1,2)-(1,3) = "[" │ │ └── closing_loc: (1,3)-(1,4) = "]" │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (1,5)-(1,11)) │ ├── flags: ∅ @@ -50,6 +51,7 @@ │ ├── flags: static_literal, decimal │ └── value: 1 ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: @ BlockNode (location: (3,8)-(3,14)) ├── flags: ∅ diff --git a/snapshots/whitequark/bug_452.txt b/snapshots/whitequark/bug_452.txt index f55b54b89a..e1f59ea2a4 100644 --- a/snapshots/whitequark/bug_452.txt +++ b/snapshots/whitequark/bug_452.txt @@ -36,8 +36,10 @@ │ │ ├── opening_loc: (1,19)-(1,20) = "(" │ │ ├── arguments: ∅ │ │ ├── closing_loc: (1,20)-(1,21) = ")" + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ └── @ CallNode (location: (1,23)-(1,37)) ├── flags: newline @@ -51,6 +53,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── call_operator_loc: (1,25)-(1,26) = "." ├── name: :num @@ -58,6 +61,7 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: @ BlockNode (location: (1,30)-(1,37)) ├── flags: ∅ diff --git a/snapshots/whitequark/bug_466.txt b/snapshots/whitequark/bug_466.txt index 8556ff6d24..fe67e320d4 100644 --- a/snapshots/whitequark/bug_466.txt +++ b/snapshots/whitequark/bug_466.txt @@ -54,6 +54,7 @@ │ │ │ │ │ │ ├── flags: static_literal, decimal │ │ │ │ │ │ └── value: 1 │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ ├── equal_loc: ∅ │ │ │ │ │ └── block: ∅ │ │ │ │ ├── opening_loc: (1,7)-(1,8) = "(" │ │ │ │ └── closing_loc: (1,11)-(1,12) = ")" @@ -63,10 +64,12 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── closing_loc: (1,17)-(1,18) = "}" │ └── closing_loc: (1,18)-(1,19) = "\"" ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: @ BlockNode (location: (1,20)-(1,27)) ├── flags: ∅ diff --git a/snapshots/whitequark/bug_473.txt b/snapshots/whitequark/bug_473.txt index fa4c23b8a5..904c5d5456 100644 --- a/snapshots/whitequark/bug_473.txt +++ b/snapshots/whitequark/bug_473.txt @@ -35,4 +35,5 @@ │ │ └── closing_loc: (1,7)-(1,8) = "}" │ └── closing_loc: (1,8)-(1,9) = "\"" ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/whitequark/bug_480.txt b/snapshots/whitequark/bug_480.txt index 0ddcbae41a..426b5fc89e 100644 --- a/snapshots/whitequark/bug_480.txt +++ b/snapshots/whitequark/bug_480.txt @@ -40,4 +40,5 @@ │ │ └── closing_loc: (1,10)-(1,11) = "}" │ └── closing_loc: (1,11)-(1,12) = "\"" ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/whitequark/bug_481.txt b/snapshots/whitequark/bug_481.txt index 32879a82b0..02604082aa 100644 --- a/snapshots/whitequark/bug_481.txt +++ b/snapshots/whitequark/bug_481.txt @@ -31,6 +31,7 @@ │ │ ├── equal_loc: ∅ │ │ └── end_keyword_loc: (1,11)-(1,14) = "end" │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ └── @ CallNode (location: (1,16)-(1,28)) ├── flags: newline @@ -44,6 +45,7 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: @ BlockNode (location: (1,22)-(1,28)) ├── flags: ∅ diff --git a/snapshots/whitequark/bug_cmd_string_lookahead.txt b/snapshots/whitequark/bug_cmd_string_lookahead.txt index 6a581ca6cc..8788e0b5ff 100644 --- a/snapshots/whitequark/bug_cmd_string_lookahead.txt +++ b/snapshots/whitequark/bug_cmd_string_lookahead.txt @@ -23,6 +23,7 @@ │ ├── closing_loc: (1,9)-(1,10) = "\"" │ └── unescaped: "foo" ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: @ BlockNode (location: (1,11)-(1,17)) ├── flags: ∅ diff --git a/snapshots/whitequark/bug_cmdarg.txt b/snapshots/whitequark/bug_cmdarg.txt index efdb375dc8..4ebd76086b 100644 --- a/snapshots/whitequark/bug_cmdarg.txt +++ b/snapshots/whitequark/bug_cmdarg.txt @@ -33,6 +33,7 @@ │ │ │ └── flags: static_literal │ │ └── operator_loc: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (3,0)-(3,11)) │ ├── flags: newline, ignore_visibility @@ -54,8 +55,10 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ └── @ CallNode (location: (5,0)-(5,26)) ├── flags: newline, ignore_visibility @@ -101,6 +104,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: │ │ @ BlockNode (location: (5,16)-(5,22)) │ │ ├── flags: ∅ @@ -111,4 +115,5 @@ │ │ └── closing_loc: (5,19)-(5,22) = "end" │ └── operator_loc: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/whitequark/bug_do_block_in_call_args.txt b/snapshots/whitequark/bug_do_block_in_call_args.txt index 770a175c2e..c0594ad36b 100644 --- a/snapshots/whitequark/bug_do_block_in_call_args.txt +++ b/snapshots/whitequark/bug_do_block_in_call_args.txt @@ -37,6 +37,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: │ │ @ BlockNode (location: (1,23)-(1,29)) │ │ ├── flags: ∅ @@ -53,4 +54,5 @@ │ ├── equal_loc: ∅ │ └── end_keyword_loc: (1,30)-(1,33) = "end" ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/whitequark/bug_do_block_in_cmdarg.txt b/snapshots/whitequark/bug_do_block_in_cmdarg.txt index ff5af609e2..1e61315fc6 100644 --- a/snapshots/whitequark/bug_do_block_in_cmdarg.txt +++ b/snapshots/whitequark/bug_do_block_in_cmdarg.txt @@ -31,6 +31,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: │ │ @ BlockNode (location: (1,10)-(1,16)) │ │ ├── flags: ∅ @@ -42,4 +43,5 @@ │ ├── opening_loc: (1,4)-(1,5) = "(" │ └── closing_loc: (1,16)-(1,17) = ")" ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/whitequark/bug_do_block_in_hash_brace.txt b/snapshots/whitequark/bug_do_block_in_hash_brace.txt index 0242d5e661..0aa4ce1f91 100644 --- a/snapshots/whitequark/bug_do_block_in_hash_brace.txt +++ b/snapshots/whitequark/bug_do_block_in_hash_brace.txt @@ -45,6 +45,7 @@ │ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ │ ├── arguments: ∅ │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ ├── equal_loc: ∅ │ │ │ │ │ └── block: │ │ │ │ │ @ BlockNode (location: (1,19)-(1,25)) │ │ │ │ │ ├── flags: ∅ @@ -73,6 +74,7 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: │ │ │ │ @ BlockNode (location: (1,35)-(1,41)) │ │ │ │ ├── flags: ∅ @@ -84,6 +86,7 @@ │ │ │ └── operator_loc: ∅ │ │ └── closing_loc: (1,41)-(1,42) = "}" │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (3,0)-(3,40)) │ ├── flags: newline, ignore_visibility @@ -118,6 +121,7 @@ │ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ │ ├── arguments: ∅ │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ ├── equal_loc: ∅ │ │ │ │ │ └── block: │ │ │ │ │ @ BlockNode (location: (3,17)-(3,23)) │ │ │ │ │ ├── flags: ∅ @@ -146,6 +150,7 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: │ │ │ │ @ BlockNode (location: (3,33)-(3,39)) │ │ │ │ ├── flags: ∅ @@ -157,6 +162,7 @@ │ │ │ └── operator_loc: ∅ │ │ └── closing_loc: (3,39)-(3,40) = "}" │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (5,0)-(5,43)) │ ├── flags: newline, ignore_visibility @@ -198,6 +204,7 @@ │ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ │ ├── arguments: ∅ │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ ├── equal_loc: ∅ │ │ │ │ │ └── block: │ │ │ │ │ @ BlockNode (location: (5,20)-(5,26)) │ │ │ │ │ ├── flags: ∅ @@ -226,6 +233,7 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: │ │ │ │ @ BlockNode (location: (5,36)-(5,42)) │ │ │ │ ├── flags: ∅ @@ -237,6 +245,7 @@ │ │ │ └── operator_loc: ∅ │ │ └── closing_loc: (5,42)-(5,43) = "}" │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (7,0)-(7,40)) │ ├── flags: newline, ignore_visibility @@ -278,6 +287,7 @@ │ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ │ ├── arguments: ∅ │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ ├── equal_loc: ∅ │ │ │ │ │ └── block: │ │ │ │ │ @ BlockNode (location: (7,17)-(7,23)) │ │ │ │ │ ├── flags: ∅ @@ -306,6 +316,7 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: │ │ │ │ @ BlockNode (location: (7,33)-(7,39)) │ │ │ │ ├── flags: ∅ @@ -317,6 +328,7 @@ │ │ │ └── operator_loc: ∅ │ │ └── closing_loc: (7,39)-(7,40) = "}" │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ └── @ CallNode (location: (9,0)-(9,52)) ├── flags: newline, ignore_visibility @@ -351,6 +363,7 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: │ │ │ │ @ BlockNode (location: (9,14)-(9,20)) │ │ │ │ ├── flags: ∅ @@ -369,6 +382,7 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: │ │ │ │ @ BlockNode (location: (9,29)-(9,35)) │ │ │ │ ├── flags: ∅ @@ -397,6 +411,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: │ │ │ @ BlockNode (location: (9,45)-(9,51)) │ │ │ ├── flags: ∅ @@ -408,4 +423,5 @@ │ │ └── operator_loc: ∅ │ └── closing_loc: (9,51)-(9,52) = "}" ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/whitequark/bug_heredoc_do.txt b/snapshots/whitequark/bug_heredoc_do.txt index 46e721c46f..8f3c1a52a8 100644 --- a/snapshots/whitequark/bug_heredoc_do.txt +++ b/snapshots/whitequark/bug_heredoc_do.txt @@ -23,6 +23,7 @@ │ ├── closing_loc: (2,0)-(3,0) = "TABLE\n" │ └── unescaped: "" ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: @ BlockNode (location: (1,11)-(3,3)) ├── flags: ∅ diff --git a/snapshots/whitequark/bug_lambda_leakage.txt b/snapshots/whitequark/bug_lambda_leakage.txt index 66e3ebac76..fd0a7fd626 100644 --- a/snapshots/whitequark/bug_lambda_leakage.txt +++ b/snapshots/whitequark/bug_lambda_leakage.txt @@ -40,4 +40,5 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/whitequark/bug_while_not_parens_do.txt b/snapshots/whitequark/bug_while_not_parens_do.txt index eadf0fe6e4..c52f62db3f 100644 --- a/snapshots/whitequark/bug_while_not_parens_do.txt +++ b/snapshots/whitequark/bug_while_not_parens_do.txt @@ -30,5 +30,6 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ └── statements: ∅ diff --git a/snapshots/whitequark/case_cond.txt b/snapshots/whitequark/case_cond.txt index 2d9572b88b..ed6f62071c 100644 --- a/snapshots/whitequark/case_cond.txt +++ b/snapshots/whitequark/case_cond.txt @@ -22,6 +22,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── then_keyword_loc: ∅ │ └── statements: diff --git a/snapshots/whitequark/case_cond_else.txt b/snapshots/whitequark/case_cond_else.txt index c2ed1fe4b7..5826ddc83b 100644 --- a/snapshots/whitequark/case_cond_else.txt +++ b/snapshots/whitequark/case_cond_else.txt @@ -22,6 +22,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── then_keyword_loc: ∅ │ └── statements: diff --git a/snapshots/whitequark/case_expr.txt b/snapshots/whitequark/case_expr.txt index 60ab69444f..cff0639836 100644 --- a/snapshots/whitequark/case_expr.txt +++ b/snapshots/whitequark/case_expr.txt @@ -17,6 +17,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── conditions: (length: 1) │ └── @ WhenNode (location: (1,10)-(1,25)) @@ -43,6 +44,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── else_clause: ∅ ├── case_keyword_loc: (1,0)-(1,4) = "case" diff --git a/snapshots/whitequark/case_expr_else.txt b/snapshots/whitequark/case_expr_else.txt index fe687a1031..6d8c71e54c 100644 --- a/snapshots/whitequark/case_expr_else.txt +++ b/snapshots/whitequark/case_expr_else.txt @@ -17,6 +17,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── conditions: (length: 1) │ └── @ WhenNode (location: (1,10)-(1,25)) @@ -43,6 +44,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── else_clause: │ @ ElseNode (location: (1,27)-(1,40)) @@ -61,6 +63,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ └── end_keyword_loc: (1,37)-(1,40) = "end" ├── case_keyword_loc: (1,0)-(1,4) = "case" diff --git a/snapshots/whitequark/class_super_label.txt b/snapshots/whitequark/class_super_label.txt index 590f971930..f851528563 100644 --- a/snapshots/whitequark/class_super_label.txt +++ b/snapshots/whitequark/class_super_label.txt @@ -33,6 +33,7 @@ │ │ ├── closing_loc: ∅ │ │ └── unescaped: "b" │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── body: ∅ ├── end_keyword_loc: (1,17)-(1,20) = "end" diff --git a/snapshots/whitequark/comments_before_leading_dot__27.txt b/snapshots/whitequark/comments_before_leading_dot__27.txt index 0f3e727cb0..5fef160b43 100644 --- a/snapshots/whitequark/comments_before_leading_dot__27.txt +++ b/snapshots/whitequark/comments_before_leading_dot__27.txt @@ -17,6 +17,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: (3,0)-(3,2) = "&." │ ├── name: :foo @@ -24,6 +25,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (6,0)-(8,4)) │ ├── flags: newline @@ -37,6 +39,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: (8,0)-(8,1) = "." │ ├── name: :foo @@ -44,6 +47,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (11,0)-(13,5)) │ ├── flags: newline, safe_navigation @@ -57,6 +61,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: (13,0)-(13,2) = "&." │ ├── name: :foo @@ -64,6 +69,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ └── @ CallNode (location: (16,0)-(18,4)) ├── flags: newline @@ -77,6 +83,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── call_operator_loc: (18,0)-(18,1) = "." ├── name: :foo @@ -84,4 +91,5 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/whitequark/cond_begin.txt b/snapshots/whitequark/cond_begin.txt index a25e62a1dc..6ed2010a48 100644 --- a/snapshots/whitequark/cond_begin.txt +++ b/snapshots/whitequark/cond_begin.txt @@ -24,6 +24,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── opening_loc: (1,3)-(1,4) = "(" │ └── closing_loc: (1,7)-(1,8) = ")" @@ -41,6 +42,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── subsequent: ∅ └── end_keyword_loc: (1,15)-(1,18) = "end" diff --git a/snapshots/whitequark/cond_begin_masgn.txt b/snapshots/whitequark/cond_begin_masgn.txt index 77211a717c..be8c624e70 100644 --- a/snapshots/whitequark/cond_begin_masgn.txt +++ b/snapshots/whitequark/cond_begin_masgn.txt @@ -24,6 +24,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── @ MultiWriteNode (location: (1,9)-(1,19)) │ │ ├── flags: newline @@ -51,6 +52,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── opening_loc: (1,3)-(1,4) = "(" │ └── closing_loc: (1,19)-(1,20) = ")" diff --git a/snapshots/whitequark/cond_eflipflop.txt b/snapshots/whitequark/cond_eflipflop.txt index 7474993f0b..23205bed88 100644 --- a/snapshots/whitequark/cond_eflipflop.txt +++ b/snapshots/whitequark/cond_eflipflop.txt @@ -26,6 +26,7 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ ├── right: │ │ │ │ @ CallNode (location: (1,8)-(1,11)) @@ -37,6 +38,7 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ └── operator_loc: (1,5)-(1,8) = "..." │ │ ├── opening_loc: (1,1)-(1,2) = "(" @@ -47,6 +49,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ └── @ IfNode (location: (3,0)-(3,17)) ├── flags: newline @@ -64,6 +67,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── right: │ │ @ CallNode (location: (3,9)-(3,12)) @@ -75,6 +79,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ └── operator_loc: (3,6)-(3,9) = "..." ├── then_keyword_loc: ∅ diff --git a/snapshots/whitequark/cond_eflipflop_with_beginless_range.txt b/snapshots/whitequark/cond_eflipflop_with_beginless_range.txt index f7ecd1aa6a..139407dbb9 100644 --- a/snapshots/whitequark/cond_eflipflop_with_beginless_range.txt +++ b/snapshots/whitequark/cond_eflipflop_with_beginless_range.txt @@ -22,6 +22,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ └── operator_loc: (1,3)-(1,6) = "..." ├── then_keyword_loc: ∅ diff --git a/snapshots/whitequark/cond_eflipflop_with_endless_range.txt b/snapshots/whitequark/cond_eflipflop_with_endless_range.txt index f94785895e..11bae91bf0 100644 --- a/snapshots/whitequark/cond_eflipflop_with_endless_range.txt +++ b/snapshots/whitequark/cond_eflipflop_with_endless_range.txt @@ -21,6 +21,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── right: ∅ │ └── operator_loc: (1,6)-(1,9) = "..." diff --git a/snapshots/whitequark/cond_iflipflop.txt b/snapshots/whitequark/cond_iflipflop.txt index 7f11d52d77..a63db28534 100644 --- a/snapshots/whitequark/cond_iflipflop.txt +++ b/snapshots/whitequark/cond_iflipflop.txt @@ -26,6 +26,7 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ ├── right: │ │ │ │ @ CallNode (location: (1,7)-(1,10)) @@ -37,6 +38,7 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ └── operator_loc: (1,5)-(1,7) = ".." │ │ ├── opening_loc: (1,1)-(1,2) = "(" @@ -47,6 +49,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ └── @ IfNode (location: (3,0)-(3,16)) ├── flags: newline @@ -64,6 +67,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── right: │ │ @ CallNode (location: (3,8)-(3,11)) @@ -75,6 +79,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ └── operator_loc: (3,6)-(3,8) = ".." ├── then_keyword_loc: ∅ diff --git a/snapshots/whitequark/cond_iflipflop_with_beginless_range.txt b/snapshots/whitequark/cond_iflipflop_with_beginless_range.txt index f0c949755a..55619f83a4 100644 --- a/snapshots/whitequark/cond_iflipflop_with_beginless_range.txt +++ b/snapshots/whitequark/cond_iflipflop_with_beginless_range.txt @@ -22,6 +22,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ └── operator_loc: (1,3)-(1,5) = ".." ├── then_keyword_loc: ∅ diff --git a/snapshots/whitequark/cond_iflipflop_with_endless_range.txt b/snapshots/whitequark/cond_iflipflop_with_endless_range.txt index 11b0f89083..af470eee5a 100644 --- a/snapshots/whitequark/cond_iflipflop_with_endless_range.txt +++ b/snapshots/whitequark/cond_iflipflop_with_endless_range.txt @@ -21,6 +21,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── right: ∅ │ └── operator_loc: (1,6)-(1,8) = ".." diff --git a/snapshots/whitequark/cond_match_current_line.txt b/snapshots/whitequark/cond_match_current_line.txt index 6694d733ce..a410794b6a 100644 --- a/snapshots/whitequark/cond_match_current_line.txt +++ b/snapshots/whitequark/cond_match_current_line.txt @@ -20,6 +20,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ └── @ IfNode (location: (3,0)-(3,13)) ├── flags: newline diff --git a/snapshots/whitequark/dedenting_heredoc.txt b/snapshots/whitequark/dedenting_heredoc.txt index e321e839ac..07b97aba3a 100644 --- a/snapshots/whitequark/dedenting_heredoc.txt +++ b/snapshots/whitequark/dedenting_heredoc.txt @@ -48,6 +48,7 @@ │ │ │ └── unescaped: "\n" │ │ └── closing_loc: (4,0)-(5,0) = "E\n" │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (6,0)-(6,8)) │ ├── flags: newline, ignore_visibility @@ -86,6 +87,7 @@ │ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ │ ├── arguments: ∅ │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ ├── equal_loc: ∅ │ │ │ │ │ └── block: ∅ │ │ │ │ └── closing_loc: (8,7)-(8,8) = "}" │ │ │ └── @ StringNode (location: (8,8)-(9,0)) @@ -96,6 +98,7 @@ │ │ │ └── unescaped: "\n" │ │ └── closing_loc: (9,0)-(10,0) = "E\n" │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (11,0)-(11,6)) │ ├── flags: newline, ignore_visibility @@ -126,6 +129,7 @@ │ │ │ └── unescaped: "y\n" │ │ └── closing_loc: (14,0)-(15,0) = "E\n" │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (16,0)-(16,6)) │ ├── flags: newline, ignore_visibility @@ -156,6 +160,7 @@ │ │ │ └── unescaped: "y\n" │ │ └── closing_loc: (19,0)-(20,0) = "E\n" │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (21,0)-(21,6)) │ ├── flags: newline, ignore_visibility @@ -186,6 +191,7 @@ │ │ │ └── unescaped: "y\n" │ │ └── closing_loc: (24,0)-(25,0) = "E\n" │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (26,0)-(26,6)) │ ├── flags: newline, ignore_visibility @@ -216,6 +222,7 @@ │ │ │ └── unescaped: "y\n" │ │ └── closing_loc: (29,0)-(30,0) = "E\n" │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (31,0)-(31,6)) │ ├── flags: newline, ignore_visibility @@ -246,6 +253,7 @@ │ │ │ └── unescaped: "\ty\n" │ │ └── closing_loc: (34,0)-(35,0) = "E\n" │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (36,0)-(36,6)) │ ├── flags: newline, ignore_visibility @@ -276,6 +284,7 @@ │ │ │ └── unescaped: " y\n" │ │ └── closing_loc: (39,0)-(40,0) = "E\n" │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (41,0)-(41,6)) │ ├── flags: newline, ignore_visibility @@ -295,6 +304,7 @@ │ │ ├── closing_loc: (42,0)-(43,0) = " E\n" │ │ └── unescaped: "" │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (44,0)-(44,6)) │ ├── flags: newline, ignore_visibility @@ -331,6 +341,7 @@ │ │ │ └── unescaped: "y\n" │ │ └── closing_loc: (48,0)-(49,0) = "E\n" │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (50,0)-(50,6)) │ ├── flags: newline, ignore_visibility @@ -367,6 +378,7 @@ │ │ │ └── unescaped: "y\n" │ │ └── closing_loc: (54,0)-(55,0) = "E\n" │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (56,0)-(56,6)) │ ├── flags: newline, ignore_visibility @@ -397,6 +409,7 @@ │ │ │ └── unescaped: " y\n" │ │ └── closing_loc: (59,0)-(60,0) = "E\n" │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (61,0)-(61,6)) │ ├── flags: newline, ignore_visibility @@ -416,6 +429,7 @@ │ │ ├── closing_loc: (63,0)-(64,0) = "E\n" │ │ └── unescaped: "x\n" │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (65,0)-(65,6)) │ ├── flags: newline, ignore_visibility @@ -435,6 +449,7 @@ │ │ ├── closing_loc: (67,0)-(68,0) = "E\n" │ │ └── unescaped: "ð\n" │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (69,0)-(69,6)) │ ├── flags: newline, ignore_visibility @@ -454,6 +469,7 @@ │ │ ├── closing_loc: (70,0)-(71,0) = "E\n" │ │ └── unescaped: "" │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ └── @ CallNode (location: (72,0)-(72,8)) ├── flags: newline, ignore_visibility @@ -492,6 +508,7 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ └── closing_loc: (74,7)-(74,8) = "}" │ │ └── @ StringNode (location: (74,8)-(75,0)) @@ -502,4 +519,5 @@ │ │ └── unescaped: "\n" │ └── closing_loc: (75,0)-(76,0) = "E\n" ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/whitequark/defined.txt b/snapshots/whitequark/defined.txt index 77e102e539..ac3338b801 100644 --- a/snapshots/whitequark/defined.txt +++ b/snapshots/whitequark/defined.txt @@ -27,6 +27,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── rparen_loc: ∅ │ └── keyword_loc: (3,0)-(3,8) = "defined?" @@ -43,6 +44,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── rparen_loc: (5,12)-(5,13) = ")" └── keyword_loc: (5,0)-(5,8) = "defined?" diff --git a/snapshots/whitequark/defs.txt b/snapshots/whitequark/defs.txt index 92b9e38b62..43863d0d32 100644 --- a/snapshots/whitequark/defs.txt +++ b/snapshots/whitequark/defs.txt @@ -22,6 +22,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── opening_loc: (1,4)-(1,5) = "(" │ │ └── closing_loc: (1,8)-(1,9) = ")" diff --git a/snapshots/whitequark/emit_arg_inside_procarg0_legacy.txt b/snapshots/whitequark/emit_arg_inside_procarg0_legacy.txt index aebe56988e..2215d24424 100644 --- a/snapshots/whitequark/emit_arg_inside_procarg0_legacy.txt +++ b/snapshots/whitequark/emit_arg_inside_procarg0_legacy.txt @@ -14,6 +14,7 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: @ BlockNode (location: (1,1)-(1,8)) ├── flags: ∅ diff --git a/snapshots/whitequark/endless_comparison_method.txt b/snapshots/whitequark/endless_comparison_method.txt index 81fd4a07c5..a0f5bbc7c1 100644 --- a/snapshots/whitequark/endless_comparison_method.txt +++ b/snapshots/whitequark/endless_comparison_method.txt @@ -36,6 +36,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── locals: [:other] │ ├── def_keyword_loc: (1,0)-(1,3) = "def" @@ -75,6 +76,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── locals: [:other] │ ├── def_keyword_loc: (3,0)-(3,3) = "def" @@ -114,6 +116,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── locals: [:other] │ ├── def_keyword_loc: (5,0)-(5,3) = "def" @@ -153,6 +156,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── locals: [:other] │ ├── def_keyword_loc: (7,0)-(7,3) = "def" @@ -192,6 +196,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── locals: [:other] │ ├── def_keyword_loc: (9,0)-(9,3) = "def" @@ -231,6 +236,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── locals: [:other] ├── def_keyword_loc: (11,0)-(11,3) = "def" diff --git a/snapshots/whitequark/endless_method.txt b/snapshots/whitequark/endless_method.txt index 3c24ab2a7d..23aa5e8db5 100644 --- a/snapshots/whitequark/endless_method.txt +++ b/snapshots/whitequark/endless_method.txt @@ -66,6 +66,7 @@ │ │ │ ├── flags: static_literal, decimal │ │ │ └── value: 1 │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── locals: [:x] │ ├── def_keyword_loc: (3,0)-(3,3) = "def" @@ -88,6 +89,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── parameters: ∅ │ ├── body: @@ -118,6 +120,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── parameters: │ @ ParametersNode (location: (7,12)-(7,13)) @@ -155,6 +158,7 @@ │ │ ├── flags: static_literal, decimal │ │ └── value: 1 │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── locals: [:x] ├── def_keyword_loc: (7,0)-(7,3) = "def" diff --git a/snapshots/whitequark/endless_method_command_syntax.txt b/snapshots/whitequark/endless_method_command_syntax.txt index db2c0cec6f..7ba7e00674 100644 --- a/snapshots/whitequark/endless_method_command_syntax.txt +++ b/snapshots/whitequark/endless_method_command_syntax.txt @@ -33,6 +33,7 @@ │ │ │ ├── closing_loc: (1,21)-(1,22) = "\"" │ │ │ └── unescaped: "Hello" │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── locals: [] │ ├── def_keyword_loc: (1,0)-(1,3) = "def" @@ -69,6 +70,7 @@ │ │ │ ├── closing_loc: (3,23)-(3,24) = "\"" │ │ │ └── unescaped: "Hello" │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── locals: [] │ ├── def_keyword_loc: (3,0)-(3,3) = "def" @@ -115,6 +117,7 @@ │ │ │ ├── name: :x │ │ │ └── depth: 0 │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── locals: [:x] │ ├── def_keyword_loc: (5,0)-(5,3) = "def" @@ -137,6 +140,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── parameters: ∅ │ ├── body: @@ -161,6 +165,7 @@ │ │ │ ├── closing_loc: (7,25)-(7,26) = "\"" │ │ │ └── unescaped: "Hello" │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── locals: [] │ ├── def_keyword_loc: (7,0)-(7,3) = "def" @@ -183,6 +188,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── parameters: ∅ │ ├── body: @@ -207,6 +213,7 @@ │ │ │ ├── closing_loc: (9,27)-(9,28) = "\"" │ │ │ └── unescaped: "Hello" │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── locals: [] │ ├── def_keyword_loc: (9,0)-(9,3) = "def" @@ -229,6 +236,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── parameters: │ │ @ ParametersNode (location: (11,12)-(11,13)) @@ -263,6 +271,7 @@ │ │ │ ├── name: :x │ │ │ └── depth: 0 │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── locals: [:x] │ ├── def_keyword_loc: (11,0)-(11,3) = "def" @@ -314,6 +323,7 @@ │ │ │ │ ├── closing_loc: (13,36)-(13,37) = "\"" │ │ │ │ └── unescaped: "to be caught" │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── keyword_loc: (13,38)-(13,44) = "rescue" │ │ └── rescue_expression: @@ -392,6 +402,7 @@ │ │ │ ├── closing_loc: (15,41)-(15,42) = "\"" │ │ │ └── unescaped: "to be caught" │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── keyword_loc: (15,43)-(15,49) = "rescue" │ └── rescue_expression: diff --git a/snapshots/whitequark/endless_method_forwarded_args_legacy.txt b/snapshots/whitequark/endless_method_forwarded_args_legacy.txt index eaa1061007..345bcafa39 100644 --- a/snapshots/whitequark/endless_method_forwarded_args_legacy.txt +++ b/snapshots/whitequark/endless_method_forwarded_args_legacy.txt @@ -40,6 +40,7 @@ │ │ └── @ ForwardingArgumentsNode (location: (1,19)-(1,22)) │ │ └── flags: ∅ │ ├── closing_loc: (1,22)-(1,23) = ")" + │ ├── equal_loc: ∅ │ └── block: ∅ ├── locals: [] ├── def_keyword_loc: (1,0)-(1,3) = "def" diff --git a/snapshots/whitequark/ensure.txt b/snapshots/whitequark/ensure.txt index 63d4a3b05d..30791fb254 100644 --- a/snapshots/whitequark/ensure.txt +++ b/snapshots/whitequark/ensure.txt @@ -21,6 +21,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── rescue_clause: ∅ ├── else_clause: ∅ @@ -41,6 +42,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ └── end_keyword_loc: (1,26)-(1,29) = "end" └── end_keyword_loc: (1,26)-(1,29) = "end" diff --git a/snapshots/whitequark/find_pattern.txt b/snapshots/whitequark/find_pattern.txt index 8a58386c4e..2c4d67507c 100644 --- a/snapshots/whitequark/find_pattern.txt +++ b/snapshots/whitequark/find_pattern.txt @@ -17,6 +17,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── conditions: (length: 1) │ │ └── @ InNode (location: (1,10)-(1,31)) @@ -64,6 +65,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── conditions: (length: 1) │ │ └── @ InNode (location: (3,10)-(3,37)) @@ -114,6 +116,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── conditions: (length: 1) │ │ └── @ InNode (location: (5,10)-(5,38)) @@ -164,6 +167,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── conditions: (length: 1) │ └── @ InNode (location: (7,10)-(7,39)) diff --git a/snapshots/whitequark/for.txt b/snapshots/whitequark/for.txt index 8dca927c90..0d3ecffda1 100644 --- a/snapshots/whitequark/for.txt +++ b/snapshots/whitequark/for.txt @@ -22,6 +22,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── statements: │ │ @ StatementsNode (location: (1,16)-(1,19)) @@ -43,6 +44,7 @@ │ │ │ ├── name: :a │ │ │ └── depth: 0 │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── for_keyword_loc: (1,0)-(1,3) = "for" │ ├── in_keyword_loc: (1,6)-(1,8) = "in" @@ -65,6 +67,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── statements: │ @ StatementsNode (location: (3,14)-(3,17)) @@ -86,6 +89,7 @@ │ │ ├── name: :a │ │ └── depth: 0 │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── for_keyword_loc: (3,0)-(3,3) = "for" ├── in_keyword_loc: (3,6)-(3,8) = "in" diff --git a/snapshots/whitequark/for_mlhs.txt b/snapshots/whitequark/for_mlhs.txt index 0f70dd8a7d..02f3d0fd12 100644 --- a/snapshots/whitequark/for_mlhs.txt +++ b/snapshots/whitequark/for_mlhs.txt @@ -33,6 +33,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── statements: │ @ StatementsNode (location: (1,17)-(1,23)) @@ -58,6 +59,7 @@ │ │ ├── name: :b │ │ └── depth: 0 │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── for_keyword_loc: (1,0)-(1,3) = "for" ├── in_keyword_loc: (1,9)-(1,11) = "in" diff --git a/snapshots/whitequark/forward_arg.txt b/snapshots/whitequark/forward_arg.txt index 3879314fa8..e24ae1f3a8 100644 --- a/snapshots/whitequark/forward_arg.txt +++ b/snapshots/whitequark/forward_arg.txt @@ -40,6 +40,7 @@ │ │ └── @ ForwardingArgumentsNode (location: (1,18)-(1,21)) │ │ └── flags: ∅ │ ├── closing_loc: (1,21)-(1,22) = ")" + │ ├── equal_loc: ∅ │ └── block: ∅ ├── locals: [] ├── def_keyword_loc: (1,0)-(1,3) = "def" diff --git a/snapshots/whitequark/forward_arg_with_open_args.txt b/snapshots/whitequark/forward_arg_with_open_args.txt index ea36abae7e..78a359adf8 100644 --- a/snapshots/whitequark/forward_arg_with_open_args.txt +++ b/snapshots/whitequark/forward_arg_with_open_args.txt @@ -46,6 +46,7 @@ │ │ │ │ └── @ ForwardingArgumentsNode (location: (2,6)-(2,9)) │ │ │ │ └── flags: ∅ │ │ │ ├── closing_loc: (2,9)-(2,10) = ")" + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── locals: [] │ │ ├── def_keyword_loc: (1,1)-(1,4) = "def" @@ -97,6 +98,7 @@ │ │ │ │ └── @ ForwardingArgumentsNode (location: (5,18)-(5,21)) │ │ │ │ └── flags: ∅ │ │ │ ├── closing_loc: (5,21)-(5,22) = ")" + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── locals: [] │ │ ├── def_keyword_loc: (5,1)-(5,4) = "def" @@ -167,6 +169,7 @@ │ │ │ └── @ ForwardingArgumentsNode (location: (10,17)-(10,20)) │ │ │ └── flags: ∅ │ │ ├── closing_loc: (10,20)-(10,21) = ")" + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── locals: [] │ ├── def_keyword_loc: (10,0)-(10,3) = "def" @@ -213,6 +216,7 @@ │ │ │ └── @ ForwardingArgumentsNode (location: (13,6)-(13,9)) │ │ │ └── flags: ∅ │ │ ├── closing_loc: (13,9)-(13,10) = ")" + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── locals: [:a] │ ├── def_keyword_loc: (12,0)-(12,3) = "def" @@ -259,6 +263,7 @@ │ │ │ └── @ ForwardingArgumentsNode (location: (16,20)-(16,23)) │ │ │ └── flags: ∅ │ │ ├── closing_loc: (16,23)-(16,24) = ")" + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── locals: [:a] │ ├── def_keyword_loc: (16,0)-(16,3) = "def" @@ -348,6 +353,7 @@ │ │ │ └── @ ForwardingArgumentsNode (location: (22,6)-(22,9)) │ │ │ └── flags: ∅ │ │ ├── closing_loc: (22,9)-(22,10) = ")" + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── locals: [:b] │ ├── def_keyword_loc: (21,0)-(21,3) = "def" @@ -400,6 +406,7 @@ │ │ │ └── @ ForwardingArgumentsNode (location: (25,24)-(25,27)) │ │ │ └── flags: ∅ │ │ ├── closing_loc: (25,27)-(25,28) = ")" + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── locals: [:b] │ ├── def_keyword_loc: (25,0)-(25,3) = "def" @@ -446,6 +453,7 @@ │ │ └── @ ForwardingArgumentsNode (location: (27,20)-(27,23)) │ │ └── flags: ∅ │ ├── closing_loc: (27,23)-(27,24) = ")" + │ ├── equal_loc: ∅ │ └── block: ∅ ├── locals: [:a] ├── def_keyword_loc: (27,0)-(27,3) = "def" diff --git a/snapshots/whitequark/forward_args_legacy.txt b/snapshots/whitequark/forward_args_legacy.txt index 2fda9338f3..a719c84924 100644 --- a/snapshots/whitequark/forward_args_legacy.txt +++ b/snapshots/whitequark/forward_args_legacy.txt @@ -40,6 +40,7 @@ │ │ │ └── @ ForwardingArgumentsNode (location: (1,18)-(1,21)) │ │ │ └── flags: ∅ │ │ ├── closing_loc: (1,21)-(1,22) = ")" + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── locals: [] │ ├── def_keyword_loc: (1,0)-(1,3) = "def" diff --git a/snapshots/whitequark/forwarded_argument_with_kwrestarg.txt b/snapshots/whitequark/forwarded_argument_with_kwrestarg.txt index d80ace6fba..329920e876 100644 --- a/snapshots/whitequark/forwarded_argument_with_kwrestarg.txt +++ b/snapshots/whitequark/forwarded_argument_with_kwrestarg.txt @@ -55,6 +55,7 @@ │ │ ├── value: ∅ │ │ └── operator_loc: (1,37)-(1,39) = "**" │ ├── closing_loc: (1,39)-(1,40) = ")" + │ ├── equal_loc: ∅ │ └── block: ∅ ├── locals: [:argument] ├── def_keyword_loc: (1,0)-(1,3) = "def" diff --git a/snapshots/whitequark/forwarded_argument_with_restarg.txt b/snapshots/whitequark/forwarded_argument_with_restarg.txt index 2dd95c6cae..f71e0dcc59 100644 --- a/snapshots/whitequark/forwarded_argument_with_restarg.txt +++ b/snapshots/whitequark/forwarded_argument_with_restarg.txt @@ -52,6 +52,7 @@ │ │ ├── operator_loc: (1,36)-(1,37) = "*" │ │ └── expression: ∅ │ ├── closing_loc: (1,37)-(1,38) = ")" + │ ├── equal_loc: ∅ │ └── block: ∅ ├── locals: [:argument] ├── def_keyword_loc: (1,0)-(1,3) = "def" diff --git a/snapshots/whitequark/forwarded_kwrestarg.txt b/snapshots/whitequark/forwarded_kwrestarg.txt index 50cc9ca38b..2ad0bf5c34 100644 --- a/snapshots/whitequark/forwarded_kwrestarg.txt +++ b/snapshots/whitequark/forwarded_kwrestarg.txt @@ -48,6 +48,7 @@ │ │ ├── value: ∅ │ │ └── operator_loc: (1,17)-(1,19) = "**" │ ├── closing_loc: (1,19)-(1,20) = ")" + │ ├── equal_loc: ∅ │ └── block: ∅ ├── locals: [] ├── def_keyword_loc: (1,0)-(1,3) = "def" diff --git a/snapshots/whitequark/forwarded_kwrestarg_with_additional_kwarg.txt b/snapshots/whitequark/forwarded_kwrestarg_with_additional_kwarg.txt index 32ace5cb3d..60716b1c7e 100644 --- a/snapshots/whitequark/forwarded_kwrestarg_with_additional_kwarg.txt +++ b/snapshots/whitequark/forwarded_kwrestarg_with_additional_kwarg.txt @@ -61,6 +61,7 @@ │ │ │ └── flags: static_literal │ │ └── operator_loc: ∅ │ ├── closing_loc: (1,35)-(1,36) = ")" + │ ├── equal_loc: ∅ │ └── block: ∅ ├── locals: [] ├── def_keyword_loc: (1,0)-(1,3) = "def" diff --git a/snapshots/whitequark/forwarded_restarg.txt b/snapshots/whitequark/forwarded_restarg.txt index 3e26b2b60e..86db7c5cf1 100644 --- a/snapshots/whitequark/forwarded_restarg.txt +++ b/snapshots/whitequark/forwarded_restarg.txt @@ -45,6 +45,7 @@ │ │ ├── operator_loc: (1,16)-(1,17) = "*" │ │ └── expression: ∅ │ ├── closing_loc: (1,17)-(1,18) = ")" + │ ├── equal_loc: ∅ │ └── block: ∅ ├── locals: [] ├── def_keyword_loc: (1,0)-(1,3) = "def" diff --git a/snapshots/whitequark/hash_kwsplat.txt b/snapshots/whitequark/hash_kwsplat.txt index acccc48b3d..6a08a94635 100644 --- a/snapshots/whitequark/hash_kwsplat.txt +++ b/snapshots/whitequark/hash_kwsplat.txt @@ -35,6 +35,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ └── operator_loc: (1,10)-(1,12) = "**" └── closing_loc: (1,16)-(1,17) = "}" diff --git a/snapshots/whitequark/hash_label_end.txt b/snapshots/whitequark/hash_label_end.txt index 9e4accee00..bff14365e0 100644 --- a/snapshots/whitequark/hash_label_end.txt +++ b/snapshots/whitequark/hash_label_end.txt @@ -29,6 +29,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── then_keyword_loc: (1,4)-(1,5) = "?" │ │ ├── statements: @@ -55,6 +56,7 @@ │ │ │ └── end_keyword_loc: ∅ │ │ └── end_keyword_loc: ∅ │ ├── closing_loc: (1,11)-(1,12) = ")" + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ HashNode (location: (3,0)-(3,12)) │ ├── flags: newline, static_literal diff --git a/snapshots/whitequark/hash_pair_value_omission.txt b/snapshots/whitequark/hash_pair_value_omission.txt index d87b1ef0f9..7dd9b5a370 100644 --- a/snapshots/whitequark/hash_pair_value_omission.txt +++ b/snapshots/whitequark/hash_pair_value_omission.txt @@ -53,6 +53,7 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ └── operator_loc: ∅ │ │ └── @ AssocNode (location: (3,5)-(3,7)) @@ -77,6 +78,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── operator_loc: ∅ │ └── closing_loc: (3,7)-(3,8) = "}" @@ -106,6 +108,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ └── operator_loc: ∅ └── closing_loc: (5,6)-(5,7) = "}" diff --git a/snapshots/whitequark/if.txt b/snapshots/whitequark/if.txt index e381b29fb4..e5572e7bcf 100644 --- a/snapshots/whitequark/if.txt +++ b/snapshots/whitequark/if.txt @@ -18,6 +18,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── then_keyword_loc: (1,7)-(1,11) = "then" │ ├── statements: @@ -33,6 +34,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── subsequent: ∅ │ └── end_keyword_loc: (1,17)-(1,20) = "end" @@ -49,6 +51,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── then_keyword_loc: ∅ ├── statements: @@ -64,6 +67,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── subsequent: ∅ └── end_keyword_loc: (3,13)-(3,16) = "end" diff --git a/snapshots/whitequark/if_else.txt b/snapshots/whitequark/if_else.txt index efabd768ae..74b9943ecb 100644 --- a/snapshots/whitequark/if_else.txt +++ b/snapshots/whitequark/if_else.txt @@ -18,6 +18,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── then_keyword_loc: (1,7)-(1,11) = "then" │ ├── statements: @@ -33,6 +34,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── subsequent: │ │ @ ElseNode (location: (1,17)-(1,30)) @@ -51,6 +53,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── end_keyword_loc: (1,27)-(1,30) = "end" │ └── end_keyword_loc: (1,27)-(1,30) = "end" @@ -67,6 +70,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── then_keyword_loc: ∅ ├── statements: @@ -82,6 +86,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── subsequent: │ @ ElseNode (location: (3,13)-(3,26)) @@ -100,6 +105,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ └── end_keyword_loc: (3,23)-(3,26) = "end" └── end_keyword_loc: (3,23)-(3,26) = "end" diff --git a/snapshots/whitequark/if_elsif.txt b/snapshots/whitequark/if_elsif.txt index 6edd4e920f..8c5c28e0d5 100644 --- a/snapshots/whitequark/if_elsif.txt +++ b/snapshots/whitequark/if_elsif.txt @@ -18,6 +18,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── then_keyword_loc: ∅ ├── statements: @@ -33,6 +34,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── subsequent: │ @ IfNode (location: (1,13)-(1,38)) @@ -48,6 +50,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── then_keyword_loc: ∅ │ ├── statements: diff --git a/snapshots/whitequark/if_masgn__24.txt b/snapshots/whitequark/if_masgn__24.txt index 5d8ed5808d..71f68de58e 100644 --- a/snapshots/whitequark/if_masgn__24.txt +++ b/snapshots/whitequark/if_masgn__24.txt @@ -41,6 +41,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── opening_loc: (1,3)-(1,4) = "(" │ └── closing_loc: (1,14)-(1,15) = ")" diff --git a/snapshots/whitequark/if_mod.txt b/snapshots/whitequark/if_mod.txt index d2597fec66..6dc03f830e 100644 --- a/snapshots/whitequark/if_mod.txt +++ b/snapshots/whitequark/if_mod.txt @@ -18,6 +18,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── then_keyword_loc: ∅ ├── statements: @@ -33,6 +34,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── subsequent: ∅ └── end_keyword_loc: ∅ diff --git a/snapshots/whitequark/if_nl_then.txt b/snapshots/whitequark/if_nl_then.txt index c6a424bbd9..8df4a45ecb 100644 --- a/snapshots/whitequark/if_nl_then.txt +++ b/snapshots/whitequark/if_nl_then.txt @@ -18,6 +18,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── then_keyword_loc: (2,0)-(2,4) = "then" ├── statements: @@ -33,6 +34,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── subsequent: ∅ └── end_keyword_loc: (2,9)-(2,12) = "end" diff --git a/snapshots/whitequark/keyword_argument_omission.txt b/snapshots/whitequark/keyword_argument_omission.txt index ac32216061..0e6954b6f4 100644 --- a/snapshots/whitequark/keyword_argument_omission.txt +++ b/snapshots/whitequark/keyword_argument_omission.txt @@ -41,6 +41,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── operator_loc: ∅ │ └── @ AssocNode (location: (1,8)-(1,10)) @@ -65,7 +66,9 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ └── operator_loc: ∅ ├── closing_loc: (1,10)-(1,11) = ")" + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/whitequark/kwbegin_compstmt.txt b/snapshots/whitequark/kwbegin_compstmt.txt index 690c790966..ab9b5c09ba 100644 --- a/snapshots/whitequark/kwbegin_compstmt.txt +++ b/snapshots/whitequark/kwbegin_compstmt.txt @@ -21,6 +21,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ └── @ CallNode (location: (1,12)-(1,16)) │ ├── flags: newline, ignore_visibility @@ -31,6 +32,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── rescue_clause: ∅ ├── else_clause: ∅ diff --git a/snapshots/whitequark/kwnilarg.txt b/snapshots/whitequark/kwnilarg.txt index 028fe07e74..a73b008308 100644 --- a/snapshots/whitequark/kwnilarg.txt +++ b/snapshots/whitequark/kwnilarg.txt @@ -68,6 +68,7 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: @ BlockNode (location: (5,2)-(5,13)) ├── flags: ∅ diff --git a/snapshots/whitequark/kwoptarg_with_kwrestarg_and_forwarded_args.txt b/snapshots/whitequark/kwoptarg_with_kwrestarg_and_forwarded_args.txt index b233427556..8f8e1a0c8b 100644 --- a/snapshots/whitequark/kwoptarg_with_kwrestarg_and_forwarded_args.txt +++ b/snapshots/whitequark/kwoptarg_with_kwrestarg_and_forwarded_args.txt @@ -55,6 +55,7 @@ │ │ ├── value: ∅ │ │ └── operator_loc: (1,21)-(1,23) = "**" │ ├── closing_loc: (1,23)-(1,24) = ")" + │ ├── equal_loc: ∅ │ └── block: ∅ ├── locals: [:a] ├── def_keyword_loc: (1,0)-(1,3) = "def" diff --git a/snapshots/whitequark/lbrace_arg_after_command_args.txt b/snapshots/whitequark/lbrace_arg_after_command_args.txt index 9132ab64ab..9d22574fe2 100644 --- a/snapshots/whitequark/lbrace_arg_after_command_args.txt +++ b/snapshots/whitequark/lbrace_arg_after_command_args.txt @@ -31,6 +31,7 @@ │ ├── opening_loc: (1,4)-(1,5) = "(" │ └── closing_loc: (1,7)-(1,8) = ")" ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: @ BlockNode (location: (1,9)-(1,22)) ├── flags: ∅ @@ -49,6 +50,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (1,13)-(1,20)) │ ├── flags: ∅ diff --git a/snapshots/whitequark/lparenarg_after_lvar__since_25.txt b/snapshots/whitequark/lparenarg_after_lvar__since_25.txt index 4c11a17f86..7f491e80d3 100644 --- a/snapshots/whitequark/lparenarg_after_lvar__since_25.txt +++ b/snapshots/whitequark/lparenarg_after_lvar__since_25.txt @@ -36,8 +36,10 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ └── @ CallNode (location: (3,0)-(3,15)) ├── flags: newline, ignore_visibility @@ -70,6 +72,8 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/whitequark/lvar.txt b/snapshots/whitequark/lvar.txt index 3de3483075..786532cacb 100644 --- a/snapshots/whitequark/lvar.txt +++ b/snapshots/whitequark/lvar.txt @@ -14,4 +14,5 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/whitequark/lvar_injecting_match.txt b/snapshots/whitequark/lvar_injecting_match.txt index 644f14c01a..0b9806de05 100644 --- a/snapshots/whitequark/lvar_injecting_match.txt +++ b/snapshots/whitequark/lvar_injecting_match.txt @@ -32,6 +32,7 @@ │ │ │ ├── closing_loc: (1,15)-(1,16) = "'" │ │ │ └── unescaped: "a" │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ └── targets: (length: 1) │ └── @ LocalVariableTargetNode (location: (1,4)-(1,5)) @@ -72,6 +73,7 @@ │ │ ├── closing_loc: (1,36)-(1,37) = "'" │ │ └── unescaped: "b" │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ LocalVariableReadNode (location: (1,39)-(1,40)) │ ├── flags: newline @@ -86,6 +88,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ MatchWriteNode (location: (3,0)-(3,24)) │ ├── flags: newline @@ -114,6 +117,7 @@ │ │ │ ├── closing_loc: (3,23)-(3,24) = "'" │ │ │ └── unescaped: "bar" │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ └── targets: (length: 1) │ └── @ LocalVariableTargetNode (location: (3,4)-(3,9)) diff --git a/snapshots/whitequark/masgn_cmd.txt b/snapshots/whitequark/masgn_cmd.txt index 8ca2afbba0..c52c95abec 100644 --- a/snapshots/whitequark/masgn_cmd.txt +++ b/snapshots/whitequark/masgn_cmd.txt @@ -38,4 +38,5 @@ │ ├── name: :foo │ └── depth: 0 ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/whitequark/masgn_nested.txt b/snapshots/whitequark/masgn_nested.txt index db92f24ab5..4177546912 100644 --- a/snapshots/whitequark/masgn_nested.txt +++ b/snapshots/whitequark/masgn_nested.txt @@ -36,6 +36,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ └── @ MultiWriteNode (location: (3,0)-(3,15)) ├── flags: newline @@ -74,4 +75,5 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/whitequark/masgn_splat.txt b/snapshots/whitequark/masgn_splat.txt index e50174d9de..06ba67bd96 100644 --- a/snapshots/whitequark/masgn_splat.txt +++ b/snapshots/whitequark/masgn_splat.txt @@ -27,6 +27,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ MultiWriteNode (location: (3,0)-(3,13)) │ ├── flags: newline @@ -58,6 +59,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ MultiWriteNode (location: (5,0)-(5,8)) │ ├── flags: newline @@ -85,6 +87,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ MultiWriteNode (location: (7,0)-(7,11)) │ ├── flags: newline @@ -116,6 +119,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ MultiWriteNode (location: (9,0)-(9,18)) │ ├── flags: newline @@ -148,6 +152,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── opening_loc: ∅ │ └── closing_loc: ∅ @@ -177,6 +182,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ MultiWriteNode (location: (13,0)-(13,13)) │ ├── flags: newline @@ -208,6 +214,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ MultiWriteNode (location: (15,0)-(15,11)) │ ├── flags: newline @@ -239,6 +246,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ MultiWriteNode (location: (17,0)-(17,14)) │ ├── flags: newline @@ -274,6 +282,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ └── @ MultiWriteNode (location: (19,0)-(19,16)) ├── flags: newline @@ -308,6 +317,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ └── @ CallNode (location: (19,13)-(19,16)) │ ├── flags: variable_call, ignore_visibility @@ -318,6 +328,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── opening_loc: ∅ └── closing_loc: ∅ diff --git a/snapshots/whitequark/method_definition_in_while_cond.txt b/snapshots/whitequark/method_definition_in_while_cond.txt index 62cd4b7470..e1ef297eed 100644 --- a/snapshots/whitequark/method_definition_in_while_cond.txt +++ b/snapshots/whitequark/method_definition_in_while_cond.txt @@ -36,6 +36,7 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: │ │ │ │ @ BlockNode (location: (1,22)-(1,28)) │ │ │ │ ├── flags: ∅ @@ -90,6 +91,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: │ │ │ @ BlockNode (location: (3,19)-(3,25)) │ │ │ ├── flags: ∅ @@ -146,6 +148,7 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: │ │ │ │ @ BlockNode (location: (5,27)-(5,33)) │ │ │ │ ├── flags: ∅ @@ -202,6 +205,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: │ │ @ BlockNode (location: (7,24)-(7,30)) │ │ ├── flags: ∅ diff --git a/snapshots/whitequark/multiple_args_with_trailing_comma.txt b/snapshots/whitequark/multiple_args_with_trailing_comma.txt index 9fd60b2a3c..eda675709d 100644 --- a/snapshots/whitequark/multiple_args_with_trailing_comma.txt +++ b/snapshots/whitequark/multiple_args_with_trailing_comma.txt @@ -14,6 +14,7 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: @ BlockNode (location: (1,1)-(1,12)) ├── flags: ∅ diff --git a/snapshots/whitequark/newline_in_hash_argument.txt b/snapshots/whitequark/newline_in_hash_argument.txt index 2a7d06102d..6aa9a7415d 100644 --- a/snapshots/whitequark/newline_in_hash_argument.txt +++ b/snapshots/whitequark/newline_in_hash_argument.txt @@ -17,6 +17,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── conditions: (length: 2) │ │ ├── @ InNode (location: (2,0)-(4,4)) @@ -112,6 +113,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: (10,3)-(10,4) = "." │ ├── name: :set @@ -139,6 +141,7 @@ │ │ │ └── value: 1 │ │ └── operator_loc: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ └── @ CallNode (location: (13,0)-(14,1)) ├── flags: newline @@ -152,6 +155,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── call_operator_loc: (13,3)-(13,4) = "." ├── name: :set @@ -179,4 +183,5 @@ │ │ └── value: 1 │ └── operator_loc: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/whitequark/non_lvar_injecting_match.txt b/snapshots/whitequark/non_lvar_injecting_match.txt index 0322423e63..0f94c9a99f 100644 --- a/snapshots/whitequark/non_lvar_injecting_match.txt +++ b/snapshots/whitequark/non_lvar_injecting_match.txt @@ -45,4 +45,5 @@ │ ├── closing_loc: (1,27)-(1,28) = "'" │ └── unescaped: "bar" ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/whitequark/not.txt b/snapshots/whitequark/not.txt index 08037eae9a..7643b7da31 100644 --- a/snapshots/whitequark/not.txt +++ b/snapshots/whitequark/not.txt @@ -17,6 +17,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: ∅ │ ├── name: :! @@ -24,6 +25,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (3,0)-(3,5)) │ ├── flags: newline @@ -39,6 +41,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ └── @ CallNode (location: (5,0)-(5,8)) ├── flags: newline @@ -52,6 +55,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── call_operator_loc: ∅ ├── name: :! @@ -59,4 +63,5 @@ ├── opening_loc: (5,3)-(5,4) = "(" ├── arguments: ∅ ├── closing_loc: (5,7)-(5,8) = ")" + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/whitequark/not_cmd.txt b/snapshots/whitequark/not_cmd.txt index 0ecd1cc67e..f2bafa1c6b 100644 --- a/snapshots/whitequark/not_cmd.txt +++ b/snapshots/whitequark/not_cmd.txt @@ -28,8 +28,10 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── call_operator_loc: ∅ ├── name: :! @@ -37,4 +39,5 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/whitequark/not_masgn__24.txt b/snapshots/whitequark/not_masgn__24.txt index d84faadc50..9cecbe1a92 100644 --- a/snapshots/whitequark/not_masgn__24.txt +++ b/snapshots/whitequark/not_masgn__24.txt @@ -40,6 +40,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── opening_loc: (1,1)-(1,2) = "(" │ └── closing_loc: (1,12)-(1,13) = ")" @@ -49,4 +50,5 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/whitequark/numbered_args_after_27.txt b/snapshots/whitequark/numbered_args_after_27.txt index 7bf09f7904..a76ec96d42 100644 --- a/snapshots/whitequark/numbered_args_after_27.txt +++ b/snapshots/whitequark/numbered_args_after_27.txt @@ -39,6 +39,7 @@ │ │ ├── name: :_9 │ │ └── depth: 0 │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ LambdaNode (location: (3,0)-(3,13)) │ ├── flags: newline @@ -74,6 +75,7 @@ │ │ ├── name: :_9 │ │ └── depth: 0 │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (5,0)-(5,16)) │ ├── flags: newline, ignore_visibility @@ -84,6 +86,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (5,2)-(5,16)) │ ├── flags: ∅ @@ -116,6 +119,7 @@ │ │ │ ├── name: :_9 │ │ │ └── depth: 0 │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── opening_loc: (5,2)-(5,4) = "do" │ └── closing_loc: (5,13)-(5,16) = "end" @@ -128,6 +132,7 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: @ BlockNode (location: (7,2)-(7,13)) ├── flags: ∅ @@ -160,6 +165,7 @@ │ │ ├── name: :_9 │ │ └── depth: 0 │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── opening_loc: (7,2)-(7,3) = "{" └── closing_loc: (7,12)-(7,13) = "}" diff --git a/snapshots/whitequark/numparam_outside_block.txt b/snapshots/whitequark/numparam_outside_block.txt index beef05a392..7fd3bf6805 100644 --- a/snapshots/whitequark/numparam_outside_block.txt +++ b/snapshots/whitequark/numparam_outside_block.txt @@ -14,6 +14,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ SingletonClassNode (location: (3,0)-(3,21)) │ ├── flags: newline @@ -30,6 +31,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── body: │ │ @ StatementsNode (location: (3,14)-(3,16)) @@ -44,6 +46,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ └── end_keyword_loc: (3,18)-(3,21) = "end" ├── @ ClassNode (location: (5,0)-(5,16)) @@ -69,6 +72,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── end_keyword_loc: (5,13)-(5,16) = "end" │ └── name: :A @@ -93,6 +97,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── locals: [] │ ├── def_keyword_loc: (7,0)-(7,3) = "def" @@ -122,6 +127,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── end_keyword_loc: (9,14)-(9,17) = "end" └── name: :A diff --git a/snapshots/whitequark/numparam_ruby_bug_19025.txt b/snapshots/whitequark/numparam_ruby_bug_19025.txt index 5043c9be48..4729523512 100644 --- a/snapshots/whitequark/numparam_ruby_bug_19025.txt +++ b/snapshots/whitequark/numparam_ruby_bug_19025.txt @@ -14,6 +14,7 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: @ BlockNode (location: (1,2)-(1,14)) ├── flags: ∅ @@ -48,6 +49,7 @@ │ │ │ ├── flags: static_literal, decimal │ │ │ └── value: 2 │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── opening_loc: (1,4)-(1,5) = "[" │ └── closing_loc: (1,11)-(1,12) = "]" diff --git a/snapshots/whitequark/op_asgn.txt b/snapshots/whitequark/op_asgn.txt index cac3e0e7b1..45d190dbd1 100644 --- a/snapshots/whitequark/op_asgn.txt +++ b/snapshots/whitequark/op_asgn.txt @@ -17,6 +17,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: (1,3)-(1,4) = "." │ ├── message_loc: (1,4)-(1,5) = "A" @@ -40,6 +41,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: (3,3)-(3,4) = "." │ ├── message_loc: (3,4)-(3,5) = "a" @@ -63,6 +65,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── call_operator_loc: (5,3)-(5,5) = "::" ├── message_loc: (5,5)-(5,6) = "a" diff --git a/snapshots/whitequark/op_asgn_cmd.txt b/snapshots/whitequark/op_asgn_cmd.txt index 6ee1650274..3329a06177 100644 --- a/snapshots/whitequark/op_asgn_cmd.txt +++ b/snapshots/whitequark/op_asgn_cmd.txt @@ -17,6 +17,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: (1,3)-(1,4) = "." │ ├── message_loc: (1,4)-(1,5) = "A" @@ -45,8 +46,10 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallOperatorWriteNode (location: (3,0)-(3,14)) │ ├── flags: newline @@ -60,6 +63,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: (3,3)-(3,4) = "." │ ├── message_loc: (3,4)-(3,5) = "a" @@ -88,8 +92,10 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ ConstantPathOperatorWriteNode (location: (5,0)-(5,15)) │ ├── flags: newline @@ -106,6 +112,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── name: :A │ │ ├── delimiter_loc: (5,3)-(5,5) = "::" @@ -132,8 +139,10 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ └── binary_operator: :+ └── @ CallOperatorWriteNode (location: (7,0)-(7,15)) @@ -148,6 +157,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── call_operator_loc: (7,3)-(7,5) = "::" ├── message_loc: (7,5)-(7,6) = "a" @@ -176,6 +186,8 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/whitequark/op_asgn_index.txt b/snapshots/whitequark/op_asgn_index.txt index 0e2927f0fb..0186eb6d91 100644 --- a/snapshots/whitequark/op_asgn_index.txt +++ b/snapshots/whitequark/op_asgn_index.txt @@ -17,6 +17,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── call_operator_loc: ∅ ├── opening_loc: (1,3)-(1,4) = "[" diff --git a/snapshots/whitequark/op_asgn_index_cmd.txt b/snapshots/whitequark/op_asgn_index_cmd.txt index 84cef7867d..076cfd406b 100644 --- a/snapshots/whitequark/op_asgn_index_cmd.txt +++ b/snapshots/whitequark/op_asgn_index_cmd.txt @@ -17,6 +17,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── call_operator_loc: ∅ ├── opening_loc: (1,3)-(1,4) = "[" @@ -55,6 +56,8 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/whitequark/or.txt b/snapshots/whitequark/or.txt index 7a23781399..9ac1920a05 100644 --- a/snapshots/whitequark/or.txt +++ b/snapshots/whitequark/or.txt @@ -17,6 +17,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── right: │ │ @ CallNode (location: (1,7)-(1,10)) @@ -28,6 +29,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ └── operator_loc: (1,4)-(1,6) = "or" └── @ OrNode (location: (3,0)-(3,10)) @@ -42,6 +44,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── right: │ @ CallNode (location: (3,7)-(3,10)) @@ -53,5 +56,6 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ └── operator_loc: (3,4)-(3,6) = "||" diff --git a/snapshots/whitequark/or_asgn.txt b/snapshots/whitequark/or_asgn.txt index 7234587b45..b04ed44e06 100644 --- a/snapshots/whitequark/or_asgn.txt +++ b/snapshots/whitequark/or_asgn.txt @@ -17,6 +17,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: (1,3)-(1,4) = "." │ ├── message_loc: (1,4)-(1,5) = "a" @@ -39,6 +40,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── call_operator_loc: ∅ ├── opening_loc: (3,3)-(3,4) = "[" diff --git a/snapshots/whitequark/parser_bug_272.txt b/snapshots/whitequark/parser_bug_272.txt index 64df1cf46d..a8e0d333b9 100644 --- a/snapshots/whitequark/parser_bug_272.txt +++ b/snapshots/whitequark/parser_bug_272.txt @@ -20,6 +20,7 @@ │ ├── flags: ∅ │ └── name: :@b ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: @ BlockNode (location: (1,5)-(1,15)) ├── flags: ∅ diff --git a/snapshots/whitequark/parser_bug_525.txt b/snapshots/whitequark/parser_bug_525.txt index 46dca6f97d..7612a8fb7d 100644 --- a/snapshots/whitequark/parser_bug_525.txt +++ b/snapshots/whitequark/parser_bug_525.txt @@ -38,9 +38,11 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ └── operator_loc: (1,6)-(1,8) = "=>" ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: @ BlockNode (location: (1,12)-(1,32)) ├── flags: ∅ @@ -59,6 +61,7 @@ │ ├── opening_loc: (1,18)-(1,19) = "(" │ ├── arguments: ∅ │ ├── closing_loc: (1,19)-(1,20) = ")" + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (1,21)-(1,27)) │ ├── flags: ∅ diff --git a/snapshots/whitequark/parser_bug_604.txt b/snapshots/whitequark/parser_bug_604.txt index aa58b2304f..2c1e8986fd 100644 --- a/snapshots/whitequark/parser_bug_604.txt +++ b/snapshots/whitequark/parser_bug_604.txt @@ -28,6 +28,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: ∅ │ ├── name: :+ @@ -46,10 +47,13 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: @ BlockNode (location: (1,8)-(1,14)) ├── flags: ∅ diff --git a/snapshots/whitequark/pattern_matching__FILE__LINE_literals.txt b/snapshots/whitequark/pattern_matching__FILE__LINE_literals.txt index 77b6f0b1ea..a4879bfa51 100644 --- a/snapshots/whitequark/pattern_matching__FILE__LINE_literals.txt +++ b/snapshots/whitequark/pattern_matching__FILE__LINE_literals.txt @@ -31,6 +31,7 @@ │ │ │ │ ├── flags: static_literal, decimal │ │ │ │ └── value: 1 │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── @ SourceEncodingNode (location: (1,38)-(1,50)) │ │ └── flags: static_literal diff --git a/snapshots/whitequark/pattern_matching_const_pattern.txt b/snapshots/whitequark/pattern_matching_const_pattern.txt index 55a851073f..065eefa681 100644 --- a/snapshots/whitequark/pattern_matching_const_pattern.txt +++ b/snapshots/whitequark/pattern_matching_const_pattern.txt @@ -17,6 +17,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── conditions: (length: 1) │ │ └── @ InNode (location: (1,10)-(1,26)) @@ -56,6 +57,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── conditions: (length: 1) │ │ └── @ InNode (location: (3,10)-(3,30)) @@ -101,6 +103,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── conditions: (length: 1) │ │ └── @ InNode (location: (5,10)-(5,28)) @@ -157,6 +160,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── conditions: (length: 1) │ │ └── @ InNode (location: (7,10)-(7,30)) @@ -202,6 +206,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── conditions: (length: 1) │ │ └── @ InNode (location: (9,10)-(9,26)) @@ -241,6 +246,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── conditions: (length: 1) │ └── @ InNode (location: (11,10)-(11,28)) diff --git a/snapshots/whitequark/pattern_matching_constants.txt b/snapshots/whitequark/pattern_matching_constants.txt index 8a05a70f80..78d86f86fa 100644 --- a/snapshots/whitequark/pattern_matching_constants.txt +++ b/snapshots/whitequark/pattern_matching_constants.txt @@ -17,6 +17,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── conditions: (length: 1) │ │ └── @ InNode (location: (1,10)-(1,26)) @@ -51,6 +52,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── conditions: (length: 1) │ │ └── @ InNode (location: (3,10)-(3,24)) @@ -82,6 +84,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── conditions: (length: 1) │ └── @ InNode (location: (5,10)-(5,27)) diff --git a/snapshots/whitequark/pattern_matching_explicit_array_match.txt b/snapshots/whitequark/pattern_matching_explicit_array_match.txt index 3a1eac348a..17aeed9bb3 100644 --- a/snapshots/whitequark/pattern_matching_explicit_array_match.txt +++ b/snapshots/whitequark/pattern_matching_explicit_array_match.txt @@ -17,6 +17,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── conditions: (length: 1) │ │ └── @ InNode (location: (1,10)-(1,29)) @@ -61,6 +62,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── conditions: (length: 1) │ │ └── @ InNode (location: (3,10)-(3,30)) @@ -109,6 +111,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── conditions: (length: 1) │ │ └── @ InNode (location: (5,10)-(5,32)) @@ -157,6 +160,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── conditions: (length: 1) │ │ └── @ InNode (location: (7,10)-(7,33)) @@ -209,6 +213,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── conditions: (length: 1) │ │ └── @ InNode (location: (9,10)-(9,32)) @@ -257,6 +262,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── conditions: (length: 1) │ │ └── @ InNode (location: (11,10)-(11,33)) @@ -309,6 +315,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── conditions: (length: 1) │ │ └── @ InNode (location: (13,10)-(13,30)) @@ -355,6 +362,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── conditions: (length: 1) │ │ └── @ InNode (location: (15,10)-(15,29)) @@ -399,6 +407,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── conditions: (length: 1) │ │ └── @ InNode (location: (17,10)-(17,26)) @@ -441,6 +450,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── conditions: (length: 1) │ └── @ InNode (location: (19,10)-(19,25)) diff --git a/snapshots/whitequark/pattern_matching_expr_in_paren.txt b/snapshots/whitequark/pattern_matching_expr_in_paren.txt index 5be3526649..397bac22c0 100644 --- a/snapshots/whitequark/pattern_matching_expr_in_paren.txt +++ b/snapshots/whitequark/pattern_matching_expr_in_paren.txt @@ -17,6 +17,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── conditions: (length: 1) │ └── @ InNode (location: (1,10)-(1,26)) diff --git a/snapshots/whitequark/pattern_matching_hash.txt b/snapshots/whitequark/pattern_matching_hash.txt index c433b66a7b..ecedb02f0e 100644 --- a/snapshots/whitequark/pattern_matching_hash.txt +++ b/snapshots/whitequark/pattern_matching_hash.txt @@ -17,6 +17,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── conditions: (length: 1) │ │ └── @ InNode (location: (2,8)-(3,13)) @@ -103,6 +104,7 @@ │ │ │ │ ├── name: :c │ │ │ │ └── depth: 0 │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── in_loc: (2,8)-(2,10) = "in" │ │ └── then_loc: ∅ @@ -121,6 +123,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── conditions: (length: 1) │ │ └── @ InNode (location: (7,8)-(9,15)) @@ -170,6 +173,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── conditions: (length: 1) │ │ └── @ InNode (location: (13,8)-(15,15)) @@ -219,6 +223,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── conditions: (length: 1) │ │ └── @ InNode (location: (19,8)-(21,14)) @@ -272,6 +277,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── conditions: (length: 1) │ │ └── @ InNode (location: (25,8)-(27,15)) @@ -321,6 +327,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── conditions: (length: 1) │ │ └── @ InNode (location: (30,10)-(30,25)) @@ -360,6 +367,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── conditions: (length: 1) │ │ └── @ InNode (location: (32,10)-(32,26)) @@ -403,6 +411,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── conditions: (length: 1) │ │ └── @ InNode (location: (34,10)-(34,27)) @@ -452,6 +461,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── conditions: (length: 1) │ │ └── @ InNode (location: (36,10)-(36,36)) @@ -523,6 +533,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── conditions: (length: 1) │ │ └── @ InNode (location: (38,10)-(38,33)) @@ -586,6 +597,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── conditions: (length: 1) │ │ └── @ InNode (location: (40,10)-(40,25)) @@ -639,6 +651,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── conditions: (length: 1) │ │ └── @ InNode (location: (42,10)-(42,29)) @@ -710,6 +723,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── conditions: (length: 1) │ │ └── @ InNode (location: (44,10)-(44,31)) @@ -759,6 +773,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── conditions: (length: 1) │ │ └── @ InNode (location: (46,10)-(46,32)) @@ -808,6 +823,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── conditions: (length: 1) │ └── @ InNode (location: (48,10)-(48,25)) diff --git a/snapshots/whitequark/pattern_matching_if_unless_modifiers.txt b/snapshots/whitequark/pattern_matching_if_unless_modifiers.txt index 690bd54437..90761ce455 100644 --- a/snapshots/whitequark/pattern_matching_if_unless_modifiers.txt +++ b/snapshots/whitequark/pattern_matching_if_unless_modifiers.txt @@ -17,6 +17,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── conditions: (length: 1) │ │ └── @ InNode (location: (1,10)-(1,27)) @@ -62,6 +63,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── conditions: (length: 1) │ └── @ InNode (location: (3,10)-(3,31)) diff --git a/snapshots/whitequark/pattern_matching_implicit_array_match.txt b/snapshots/whitequark/pattern_matching_implicit_array_match.txt index 021ede47ab..cd67a840a0 100644 --- a/snapshots/whitequark/pattern_matching_implicit_array_match.txt +++ b/snapshots/whitequark/pattern_matching_implicit_array_match.txt @@ -17,6 +17,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── conditions: (length: 1) │ │ └── @ InNode (location: (1,10)-(1,23)) @@ -57,6 +58,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── conditions: (length: 1) │ │ └── @ InNode (location: (3,10)-(3,24)) @@ -101,6 +103,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── conditions: (length: 1) │ │ └── @ InNode (location: (5,10)-(5,30)) @@ -153,6 +156,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── conditions: (length: 1) │ │ └── @ InNode (location: (7,10)-(7,36)) @@ -213,6 +217,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── conditions: (length: 1) │ │ └── @ InNode (location: (9,10)-(9,30)) @@ -265,6 +270,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── conditions: (length: 1) │ │ └── @ InNode (location: (11,10)-(11,24)) @@ -307,6 +313,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── conditions: (length: 1) │ │ └── @ InNode (location: (13,10)-(13,26)) @@ -351,6 +358,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── conditions: (length: 1) │ └── @ InNode (location: (15,10)-(15,27)) diff --git a/snapshots/whitequark/pattern_matching_keyword_variable.txt b/snapshots/whitequark/pattern_matching_keyword_variable.txt index 282fd796fd..804f474f9c 100644 --- a/snapshots/whitequark/pattern_matching_keyword_variable.txt +++ b/snapshots/whitequark/pattern_matching_keyword_variable.txt @@ -17,6 +17,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── conditions: (length: 1) │ └── @ InNode (location: (1,10)-(1,27)) diff --git a/snapshots/whitequark/pattern_matching_lambda.txt b/snapshots/whitequark/pattern_matching_lambda.txt index 2b3db96815..4d9951c036 100644 --- a/snapshots/whitequark/pattern_matching_lambda.txt +++ b/snapshots/whitequark/pattern_matching_lambda.txt @@ -17,6 +17,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── conditions: (length: 1) │ └── @ InNode (location: (1,10)-(1,31)) diff --git a/snapshots/whitequark/pattern_matching_match_alt.txt b/snapshots/whitequark/pattern_matching_match_alt.txt index 37c52fcef6..f8e8f0d9c6 100644 --- a/snapshots/whitequark/pattern_matching_match_alt.txt +++ b/snapshots/whitequark/pattern_matching_match_alt.txt @@ -17,6 +17,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── conditions: (length: 1) │ └── @ InNode (location: (1,10)-(1,28)) diff --git a/snapshots/whitequark/pattern_matching_match_as.txt b/snapshots/whitequark/pattern_matching_match_as.txt index 81beffe0ec..5494319007 100644 --- a/snapshots/whitequark/pattern_matching_match_as.txt +++ b/snapshots/whitequark/pattern_matching_match_as.txt @@ -17,6 +17,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── conditions: (length: 1) │ └── @ InNode (location: (1,10)-(1,29)) diff --git a/snapshots/whitequark/pattern_matching_nil_pattern.txt b/snapshots/whitequark/pattern_matching_nil_pattern.txt index 8eed090e49..79a1b16334 100644 --- a/snapshots/whitequark/pattern_matching_nil_pattern.txt +++ b/snapshots/whitequark/pattern_matching_nil_pattern.txt @@ -17,6 +17,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── conditions: (length: 1) │ └── @ InNode (location: (1,10)-(1,28)) diff --git a/snapshots/whitequark/pattern_matching_no_body.txt b/snapshots/whitequark/pattern_matching_no_body.txt index 9b83bd6447..3a656ba5af 100644 --- a/snapshots/whitequark/pattern_matching_no_body.txt +++ b/snapshots/whitequark/pattern_matching_no_body.txt @@ -17,6 +17,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── conditions: (length: 1) │ └── @ InNode (location: (1,10)-(1,14)) diff --git a/snapshots/whitequark/pattern_matching_ranges.txt b/snapshots/whitequark/pattern_matching_ranges.txt index e8cd3afcaa..bd92db0e12 100644 --- a/snapshots/whitequark/pattern_matching_ranges.txt +++ b/snapshots/whitequark/pattern_matching_ranges.txt @@ -17,6 +17,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── conditions: (length: 1) │ │ └── @ InNode (location: (1,10)-(1,27)) @@ -53,6 +54,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── conditions: (length: 1) │ │ └── @ InNode (location: (3,10)-(3,26)) @@ -89,6 +91,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── conditions: (length: 1) │ │ └── @ InNode (location: (5,10)-(5,26)) @@ -125,6 +128,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── conditions: (length: 1) │ │ └── @ InNode (location: (7,10)-(7,27)) @@ -161,6 +165,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── conditions: (length: 1) │ │ └── @ InNode (location: (9,10)-(9,28)) @@ -200,6 +205,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── conditions: (length: 1) │ └── @ InNode (location: (11,10)-(11,27)) diff --git a/snapshots/whitequark/pattern_matching_single_match.txt b/snapshots/whitequark/pattern_matching_single_match.txt index 117730bdb2..bc0bc99575 100644 --- a/snapshots/whitequark/pattern_matching_single_match.txt +++ b/snapshots/whitequark/pattern_matching_single_match.txt @@ -17,6 +17,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── conditions: (length: 1) │ └── @ InNode (location: (1,10)-(1,21)) diff --git a/snapshots/whitequark/pin_expr.txt b/snapshots/whitequark/pin_expr.txt index c9a36e112f..4eb7d44699 100644 --- a/snapshots/whitequark/pin_expr.txt +++ b/snapshots/whitequark/pin_expr.txt @@ -17,6 +17,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── conditions: (length: 1) │ │ └── @ InNode (location: (1,10)-(1,34)) @@ -47,6 +48,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── conditions: (length: 1) │ │ └── @ InNode (location: (3,10)-(3,28)) @@ -73,6 +75,7 @@ │ │ │ │ │ ├── flags: static_literal, decimal │ │ │ │ │ └── value: 0 │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ ├── operator_loc: (3,13)-(3,14) = "^" │ │ │ ├── lparen_loc: (3,14)-(3,15) = "(" @@ -100,6 +103,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── conditions: (length: 1) │ │ └── @ InNode (location: (5,10)-(6,1)) @@ -132,6 +136,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── conditions: (length: 1) │ │ └── @ InNode (location: (8,10)-(8,27)) @@ -169,6 +174,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── conditions: (length: 1) │ │ └── @ InNode (location: (10,10)-(10,35)) @@ -199,6 +205,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── conditions: (length: 1) │ │ └── @ InNode (location: (12,10)-(12,16)) @@ -229,6 +236,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── conditions: (length: 1) │ └── @ InNode (location: (14,10)-(14,36)) diff --git a/snapshots/whitequark/procarg0.txt b/snapshots/whitequark/procarg0.txt index 90e03ce940..fbf8caed46 100644 --- a/snapshots/whitequark/procarg0.txt +++ b/snapshots/whitequark/procarg0.txt @@ -14,6 +14,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (1,2)-(1,18)) │ ├── flags: ∅ @@ -59,6 +60,7 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: @ BlockNode (location: (3,2)-(3,11)) ├── flags: ∅ diff --git a/snapshots/whitequark/procarg0_legacy.txt b/snapshots/whitequark/procarg0_legacy.txt index aebe56988e..2215d24424 100644 --- a/snapshots/whitequark/procarg0_legacy.txt +++ b/snapshots/whitequark/procarg0_legacy.txt @@ -14,6 +14,7 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: @ BlockNode (location: (1,1)-(1,8)) ├── flags: ∅ diff --git a/snapshots/whitequark/regex_interp.txt b/snapshots/whitequark/regex_interp.txt index e440274cc2..ae81b20463 100644 --- a/snapshots/whitequark/regex_interp.txt +++ b/snapshots/whitequark/regex_interp.txt @@ -31,6 +31,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── closing_loc: (1,9)-(1,10) = "}" │ └── @ StringNode (location: (1,10)-(1,13)) diff --git a/snapshots/whitequark/resbody_list.txt b/snapshots/whitequark/resbody_list.txt index 6d74070a6a..70a488d9ae 100644 --- a/snapshots/whitequark/resbody_list.txt +++ b/snapshots/whitequark/resbody_list.txt @@ -21,6 +21,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── rescue_clause: │ @ RescueNode (location: (1,13)-(1,34)) @@ -46,6 +47,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ └── subsequent: ∅ ├── else_clause: ∅ diff --git a/snapshots/whitequark/resbody_list_mrhs.txt b/snapshots/whitequark/resbody_list_mrhs.txt index f9e5e8c108..cf0736fb20 100644 --- a/snapshots/whitequark/resbody_list_mrhs.txt +++ b/snapshots/whitequark/resbody_list_mrhs.txt @@ -21,6 +21,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── rescue_clause: │ @ RescueNode (location: (1,13)-(1,39)) @@ -39,6 +40,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── operator_loc: ∅ │ ├── reference: ∅ @@ -56,6 +58,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ └── subsequent: ∅ ├── else_clause: ∅ diff --git a/snapshots/whitequark/resbody_list_var.txt b/snapshots/whitequark/resbody_list_var.txt index ba7b58ac36..95f81a8d49 100644 --- a/snapshots/whitequark/resbody_list_var.txt +++ b/snapshots/whitequark/resbody_list_var.txt @@ -21,6 +21,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── rescue_clause: │ @ RescueNode (location: (1,13)-(1,34)) @@ -36,6 +37,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── operator_loc: (1,24)-(1,26) = "=>" │ ├── reference: @@ -57,6 +59,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ └── subsequent: ∅ ├── else_clause: ∅ diff --git a/snapshots/whitequark/resbody_var.txt b/snapshots/whitequark/resbody_var.txt index 0f686acd4a..f5f0bb0931 100644 --- a/snapshots/whitequark/resbody_var.txt +++ b/snapshots/whitequark/resbody_var.txt @@ -21,6 +21,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── rescue_clause: │ │ @ RescueNode (location: (1,13)-(1,31)) @@ -46,6 +47,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── subsequent: ∅ │ ├── else_clause: ∅ @@ -67,6 +69,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── rescue_clause: │ @ RescueNode (location: (3,13)-(3,30)) @@ -93,6 +96,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ └── subsequent: ∅ ├── else_clause: ∅ diff --git a/snapshots/whitequark/rescue.txt b/snapshots/whitequark/rescue.txt index f495323544..e16a2d4415 100644 --- a/snapshots/whitequark/rescue.txt +++ b/snapshots/whitequark/rescue.txt @@ -21,6 +21,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── rescue_clause: │ @ RescueNode (location: (1,13)-(1,24)) @@ -43,6 +44,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ └── subsequent: ∅ ├── else_clause: ∅ diff --git a/snapshots/whitequark/rescue_else.txt b/snapshots/whitequark/rescue_else.txt index be0a9787eb..00fdfee598 100644 --- a/snapshots/whitequark/rescue_else.txt +++ b/snapshots/whitequark/rescue_else.txt @@ -21,6 +21,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── rescue_clause: │ @ RescueNode (location: (1,13)-(1,24)) @@ -43,6 +44,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ └── subsequent: ∅ ├── else_clause: @@ -62,6 +64,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ └── end_keyword_loc: (1,37)-(1,40) = "end" ├── ensure_clause: ∅ diff --git a/snapshots/whitequark/rescue_else_ensure.txt b/snapshots/whitequark/rescue_else_ensure.txt index c967ef912e..813e881dc5 100644 --- a/snapshots/whitequark/rescue_else_ensure.txt +++ b/snapshots/whitequark/rescue_else_ensure.txt @@ -21,6 +21,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── rescue_clause: │ @ RescueNode (location: (1,13)-(1,24)) @@ -43,6 +44,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ └── subsequent: ∅ ├── else_clause: @@ -62,6 +64,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ └── end_keyword_loc: (1,36)-(1,42) = "ensure" ├── ensure_clause: @@ -81,6 +84,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ └── end_keyword_loc: (1,48)-(1,51) = "end" └── end_keyword_loc: (1,48)-(1,51) = "end" diff --git a/snapshots/whitequark/rescue_ensure.txt b/snapshots/whitequark/rescue_ensure.txt index 22835ec30d..c519b956ea 100644 --- a/snapshots/whitequark/rescue_ensure.txt +++ b/snapshots/whitequark/rescue_ensure.txt @@ -21,6 +21,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── rescue_clause: │ @ RescueNode (location: (1,13)-(1,24)) @@ -43,6 +44,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ └── subsequent: ∅ ├── else_clause: ∅ @@ -63,6 +65,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ └── end_keyword_loc: (1,39)-(1,42) = "end" └── end_keyword_loc: (1,39)-(1,42) = "end" diff --git a/snapshots/whitequark/rescue_mod.txt b/snapshots/whitequark/rescue_mod.txt index abed85c1b9..28651cce09 100644 --- a/snapshots/whitequark/rescue_mod.txt +++ b/snapshots/whitequark/rescue_mod.txt @@ -17,6 +17,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── keyword_loc: (1,5)-(1,11) = "rescue" └── rescue_expression: @@ -29,4 +30,5 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/whitequark/rescue_mod_asgn.txt b/snapshots/whitequark/rescue_mod_asgn.txt index a2fa161e4e..20a10aa9c6 100644 --- a/snapshots/whitequark/rescue_mod_asgn.txt +++ b/snapshots/whitequark/rescue_mod_asgn.txt @@ -23,6 +23,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── keyword_loc: (1,11)-(1,17) = "rescue" │ └── rescue_expression: @@ -35,5 +36,6 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ └── operator_loc: (1,4)-(1,5) = "=" diff --git a/snapshots/whitequark/rescue_mod_masgn.txt b/snapshots/whitequark/rescue_mod_masgn.txt index b5ca37b129..4fa3247bae 100644 --- a/snapshots/whitequark/rescue_mod_masgn.txt +++ b/snapshots/whitequark/rescue_mod_masgn.txt @@ -34,6 +34,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── keyword_loc: (1,16)-(1,22) = "rescue" └── rescue_expression: diff --git a/snapshots/whitequark/rescue_mod_op_assign.txt b/snapshots/whitequark/rescue_mod_op_assign.txt index 22101d7c98..710d134dae 100644 --- a/snapshots/whitequark/rescue_mod_op_assign.txt +++ b/snapshots/whitequark/rescue_mod_op_assign.txt @@ -22,6 +22,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── keyword_loc: (1,12)-(1,18) = "rescue" │ └── rescue_expression: @@ -34,6 +35,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── name: :foo ├── binary_operator: :+ diff --git a/snapshots/whitequark/rescue_without_begin_end.txt b/snapshots/whitequark/rescue_without_begin_end.txt index bf4fc14446..773cc64bc9 100644 --- a/snapshots/whitequark/rescue_without_begin_end.txt +++ b/snapshots/whitequark/rescue_without_begin_end.txt @@ -14,6 +14,7 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: @ BlockNode (location: (1,5)-(1,30)) ├── flags: ∅ @@ -36,6 +37,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── rescue_clause: │ │ @ RescueNode (location: (1,14)-(1,25)) @@ -58,6 +60,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── subsequent: ∅ │ ├── else_clause: ∅ diff --git a/snapshots/whitequark/return.txt b/snapshots/whitequark/return.txt index 1e059ba63c..8098bbd562 100644 --- a/snapshots/whitequark/return.txt +++ b/snapshots/whitequark/return.txt @@ -25,6 +25,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ ReturnNode (location: (5,0)-(5,8)) │ ├── flags: newline @@ -60,6 +61,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── opening_loc: (7,6)-(7,7) = "(" └── closing_loc: (7,10)-(7,11) = ")" diff --git a/snapshots/whitequark/return_block.txt b/snapshots/whitequark/return_block.txt index 90161b6750..478b875769 100644 --- a/snapshots/whitequark/return_block.txt +++ b/snapshots/whitequark/return_block.txt @@ -32,8 +32,10 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: @ BlockNode (location: (1,15)-(1,21)) ├── flags: ∅ diff --git a/snapshots/whitequark/ruby_bug_10653.txt b/snapshots/whitequark/ruby_bug_10653.txt index 3a562d8b1f..d75ba77ee3 100644 --- a/snapshots/whitequark/ruby_bug_10653.txt +++ b/snapshots/whitequark/ruby_bug_10653.txt @@ -25,6 +25,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: │ │ @ BlockNode (location: (1,14)-(1,20)) │ │ ├── flags: ∅ @@ -50,6 +51,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: │ │ │ @ BlockNode (location: (1,27)-(1,33)) │ │ │ ├── flags: ∅ @@ -80,6 +82,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: │ │ @ BlockNode (location: (3,14)-(3,16)) │ │ ├── flags: ∅ @@ -105,6 +108,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: │ │ │ @ BlockNode (location: (3,23)-(3,25)) │ │ │ ├── flags: ∅ @@ -138,6 +142,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (5,13)-(5,27)) │ ├── flags: ∅ @@ -181,6 +186,7 @@ │ │ │ ├── name: :n │ │ │ └── depth: 0 │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── opening_loc: (5,13)-(5,15) = "do" │ └── closing_loc: (5,24)-(5,27) = "end" diff --git a/snapshots/whitequark/ruby_bug_11107.txt b/snapshots/whitequark/ruby_bug_11107.txt index 4ed332f903..2097cdb63e 100644 --- a/snapshots/whitequark/ruby_bug_11107.txt +++ b/snapshots/whitequark/ruby_bug_11107.txt @@ -42,6 +42,7 @@ │ ├── opening_loc: (1,11)-(1,12) = "(" │ ├── arguments: ∅ │ ├── closing_loc: (1,12)-(1,13) = ")" + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (1,14)-(1,20)) │ ├── flags: ∅ @@ -51,4 +52,5 @@ │ ├── opening_loc: (1,14)-(1,16) = "do" │ └── closing_loc: (1,17)-(1,20) = "end" ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/whitequark/ruby_bug_11380.txt b/snapshots/whitequark/ruby_bug_11380.txt index 5893034b65..6eb9d7b1e1 100644 --- a/snapshots/whitequark/ruby_bug_11380.txt +++ b/snapshots/whitequark/ruby_bug_11380.txt @@ -51,6 +51,7 @@ │ │ └── value: 1 │ └── operator_loc: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: @ BlockNode (location: (1,22)-(1,28)) ├── flags: ∅ diff --git a/snapshots/whitequark/ruby_bug_11873.txt b/snapshots/whitequark/ruby_bug_11873.txt index a92b217482..411f2a2350 100644 --- a/snapshots/whitequark/ruby_bug_11873.txt +++ b/snapshots/whitequark/ruby_bug_11873.txt @@ -47,10 +47,13 @@ │ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ │ ├── arguments: ∅ │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ ├── equal_loc: ∅ │ │ │ │ │ └── block: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ ├── closing_loc: (1,7)-(1,8) = ")" + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── @ StringNode (location: (1,10)-(1,13)) │ │ ├── flags: ∅ @@ -59,6 +62,7 @@ │ │ ├── closing_loc: (1,12)-(1,13) = "\"" │ │ └── unescaped: "x" │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (1,14)-(1,20)) │ ├── flags: ∅ @@ -109,10 +113,13 @@ │ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ │ ├── arguments: ∅ │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ ├── equal_loc: ∅ │ │ │ │ │ └── block: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ ├── closing_loc: (3,7)-(3,8) = ")" + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── @ RegularExpressionNode (location: (3,10)-(3,13)) │ │ ├── flags: static_literal, forced_us_ascii_encoding @@ -121,6 +128,7 @@ │ │ ├── closing_loc: (3,12)-(3,13) = "/" │ │ └── unescaped: "x" │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (3,14)-(3,20)) │ ├── flags: ∅ @@ -171,10 +179,13 @@ │ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ │ ├── arguments: ∅ │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ ├── equal_loc: ∅ │ │ │ │ │ └── block: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ ├── closing_loc: (5,7)-(5,8) = ")" + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── @ RegularExpressionNode (location: (5,10)-(5,14)) │ │ ├── flags: static_literal, multi_line, forced_us_ascii_encoding @@ -183,6 +194,7 @@ │ │ ├── closing_loc: (5,12)-(5,14) = "/m" │ │ └── unescaped: "x" │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (5,15)-(5,21)) │ ├── flags: ∅ @@ -233,10 +245,13 @@ │ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ │ ├── arguments: ∅ │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ ├── equal_loc: ∅ │ │ │ │ │ └── block: ∅ │ │ │ │ ├── closing_loc: (7,7)-(7,8) = ")" + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ ├── closing_loc: (7,8)-(7,9) = ")" + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── @ StringNode (location: (7,11)-(7,14)) │ │ ├── flags: ∅ @@ -245,6 +260,7 @@ │ │ ├── closing_loc: (7,13)-(7,14) = "\"" │ │ └── unescaped: "x" │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (7,15)-(7,21)) │ ├── flags: ∅ @@ -295,10 +311,13 @@ │ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ │ ├── arguments: ∅ │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ ├── equal_loc: ∅ │ │ │ │ │ └── block: ∅ │ │ │ │ ├── closing_loc: (9,7)-(9,8) = ")" + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ ├── closing_loc: (9,8)-(9,9) = ")" + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── @ RegularExpressionNode (location: (9,11)-(9,14)) │ │ ├── flags: static_literal, forced_us_ascii_encoding @@ -307,6 +326,7 @@ │ │ ├── closing_loc: (9,13)-(9,14) = "/" │ │ └── unescaped: "x" │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (9,15)-(9,21)) │ ├── flags: ∅ @@ -357,10 +377,13 @@ │ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ │ ├── arguments: ∅ │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ ├── equal_loc: ∅ │ │ │ │ │ └── block: ∅ │ │ │ │ ├── closing_loc: (11,7)-(11,8) = ")" + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ ├── closing_loc: (11,8)-(11,9) = ")" + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── @ RegularExpressionNode (location: (11,11)-(11,15)) │ │ ├── flags: static_literal, multi_line, forced_us_ascii_encoding @@ -369,6 +392,7 @@ │ │ ├── closing_loc: (11,13)-(11,15) = "/m" │ │ └── unescaped: "x" │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (11,16)-(11,22)) │ ├── flags: ∅ @@ -397,6 +421,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: │ │ │ @ BlockNode (location: (13,3)-(13,8)) │ │ │ ├── flags: ∅ @@ -426,8 +451,10 @@ │ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ │ ├── arguments: ∅ │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ ├── equal_loc: ∅ │ │ │ │ │ └── block: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ ├── opening_loc: (13,3)-(13,4) = "{" │ │ │ └── closing_loc: (13,7)-(13,8) = "}" @@ -438,6 +465,7 @@ │ │ ├── closing_loc: (13,12)-(13,13) = "\"" │ │ └── unescaped: "x" │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (13,14)-(13,20)) │ ├── flags: ∅ @@ -466,6 +494,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: │ │ │ @ BlockNode (location: (15,3)-(15,8)) │ │ │ ├── flags: ∅ @@ -495,8 +524,10 @@ │ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ │ ├── arguments: ∅ │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ ├── equal_loc: ∅ │ │ │ │ │ └── block: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ ├── opening_loc: (15,3)-(15,4) = "{" │ │ │ └── closing_loc: (15,7)-(15,8) = "}" @@ -507,6 +538,7 @@ │ │ ├── closing_loc: (15,12)-(15,13) = "/" │ │ └── unescaped: "x" │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (15,14)-(15,20)) │ ├── flags: ∅ @@ -535,6 +567,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: │ │ │ @ BlockNode (location: (17,3)-(17,8)) │ │ │ ├── flags: ∅ @@ -564,8 +597,10 @@ │ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ │ ├── arguments: ∅ │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ ├── equal_loc: ∅ │ │ │ │ │ └── block: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ ├── opening_loc: (17,3)-(17,4) = "{" │ │ │ └── closing_loc: (17,7)-(17,8) = "}" @@ -576,6 +611,7 @@ │ │ ├── closing_loc: (17,12)-(17,14) = "/m" │ │ └── unescaped: "x" │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (17,15)-(17,21)) │ ├── flags: ∅ @@ -604,6 +640,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: │ │ │ @ BlockNode (location: (19,3)-(19,9)) │ │ │ ├── flags: ∅ @@ -633,8 +670,10 @@ │ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ │ ├── arguments: ∅ │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ ├── equal_loc: ∅ │ │ │ │ │ └── block: ∅ │ │ │ │ ├── closing_loc: (19,7)-(19,8) = ")" + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ ├── opening_loc: (19,3)-(19,4) = "{" │ │ │ └── closing_loc: (19,8)-(19,9) = "}" @@ -645,6 +684,7 @@ │ │ ├── closing_loc: (19,13)-(19,14) = "\"" │ │ └── unescaped: "x" │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (19,15)-(19,21)) │ ├── flags: ∅ @@ -673,6 +713,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: │ │ │ @ BlockNode (location: (21,3)-(21,9)) │ │ │ ├── flags: ∅ @@ -702,8 +743,10 @@ │ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ │ ├── arguments: ∅ │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ ├── equal_loc: ∅ │ │ │ │ │ └── block: ∅ │ │ │ │ ├── closing_loc: (21,7)-(21,8) = ")" + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ ├── opening_loc: (21,3)-(21,4) = "{" │ │ │ └── closing_loc: (21,8)-(21,9) = "}" @@ -714,6 +757,7 @@ │ │ ├── closing_loc: (21,13)-(21,14) = "/" │ │ └── unescaped: "x" │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (21,15)-(21,21)) │ ├── flags: ∅ @@ -742,6 +786,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: │ │ @ BlockNode (location: (23,3)-(23,9)) │ │ ├── flags: ∅ @@ -771,8 +816,10 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ ├── closing_loc: (23,7)-(23,8) = ")" + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── opening_loc: (23,3)-(23,4) = "{" │ │ └── closing_loc: (23,8)-(23,9) = "}" @@ -783,6 +830,7 @@ │ ├── closing_loc: (23,13)-(23,15) = "/m" │ └── unescaped: "x" ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: @ BlockNode (location: (23,16)-(23,22)) ├── flags: ∅ diff --git a/snapshots/whitequark/ruby_bug_11873_a.txt b/snapshots/whitequark/ruby_bug_11873_a.txt index 6897357de8..e9ff71af83 100644 --- a/snapshots/whitequark/ruby_bug_11873_a.txt +++ b/snapshots/whitequark/ruby_bug_11873_a.txt @@ -47,15 +47,19 @@ │ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ │ ├── arguments: ∅ │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ ├── equal_loc: ∅ │ │ │ │ │ └── block: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ ├── closing_loc: (1,7)-(1,8) = ")" + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── @ IntegerNode (location: (1,10)-(1,11)) │ │ ├── flags: static_literal, decimal │ │ └── value: 1 │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (1,12)-(1,18)) │ ├── flags: ∅ @@ -106,15 +110,19 @@ │ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ │ ├── arguments: ∅ │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ ├── equal_loc: ∅ │ │ │ │ │ └── block: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ ├── closing_loc: (3,7)-(3,8) = ")" + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── @ FloatNode (location: (3,10)-(3,13)) │ │ ├── flags: static_literal │ │ └── value: 1.0 │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (3,14)-(3,20)) │ ├── flags: ∅ @@ -165,10 +173,13 @@ │ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ │ ├── arguments: ∅ │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ ├── equal_loc: ∅ │ │ │ │ │ └── block: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ ├── closing_loc: (5,7)-(5,8) = ")" + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── @ ImaginaryNode (location: (5,10)-(5,14)) │ │ ├── flags: static_literal @@ -177,6 +188,7 @@ │ │ ├── flags: static_literal │ │ └── value: 1.0 │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (5,15)-(5,21)) │ ├── flags: ∅ @@ -227,16 +239,20 @@ │ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ │ ├── arguments: ∅ │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ ├── equal_loc: ∅ │ │ │ │ │ └── block: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ ├── closing_loc: (7,7)-(7,8) = ")" + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── @ RationalNode (location: (7,10)-(7,14)) │ │ ├── flags: static_literal, decimal │ │ ├── numerator: 1 │ │ └── denominator: 1 │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (7,15)-(7,21)) │ ├── flags: ∅ @@ -287,10 +303,13 @@ │ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ │ ├── arguments: ∅ │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ ├── equal_loc: ∅ │ │ │ │ │ └── block: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ ├── closing_loc: (9,7)-(9,8) = ")" + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── @ SymbolNode (location: (9,10)-(9,12)) │ │ ├── flags: static_literal, forced_us_ascii_encoding @@ -299,6 +318,7 @@ │ │ ├── closing_loc: ∅ │ │ └── unescaped: "e" │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (9,13)-(9,19)) │ ├── flags: ∅ @@ -349,15 +369,19 @@ │ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ │ ├── arguments: ∅ │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ ├── equal_loc: ∅ │ │ │ │ │ └── block: ∅ │ │ │ │ ├── closing_loc: (11,7)-(11,8) = ")" + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ ├── closing_loc: (11,8)-(11,9) = ")" + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── @ IntegerNode (location: (11,11)-(11,12)) │ │ ├── flags: static_literal, decimal │ │ └── value: 1 │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (11,13)-(11,19)) │ ├── flags: ∅ @@ -408,15 +432,19 @@ │ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ │ ├── arguments: ∅ │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ ├── equal_loc: ∅ │ │ │ │ │ └── block: ∅ │ │ │ │ ├── closing_loc: (13,7)-(13,8) = ")" + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ ├── closing_loc: (13,8)-(13,9) = ")" + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── @ FloatNode (location: (13,11)-(13,14)) │ │ ├── flags: static_literal │ │ └── value: 1.0 │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (13,15)-(13,21)) │ ├── flags: ∅ @@ -467,10 +495,13 @@ │ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ │ ├── arguments: ∅ │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ ├── equal_loc: ∅ │ │ │ │ │ └── block: ∅ │ │ │ │ ├── closing_loc: (15,7)-(15,8) = ")" + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ ├── closing_loc: (15,8)-(15,9) = ")" + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── @ ImaginaryNode (location: (15,11)-(15,15)) │ │ ├── flags: static_literal @@ -479,6 +510,7 @@ │ │ ├── flags: static_literal │ │ └── value: 1.0 │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (15,16)-(15,22)) │ ├── flags: ∅ @@ -529,16 +561,20 @@ │ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ │ ├── arguments: ∅ │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ ├── equal_loc: ∅ │ │ │ │ │ └── block: ∅ │ │ │ │ ├── closing_loc: (17,7)-(17,8) = ")" + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ ├── closing_loc: (17,8)-(17,9) = ")" + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── @ RationalNode (location: (17,11)-(17,15)) │ │ ├── flags: static_literal, decimal │ │ ├── numerator: 1 │ │ └── denominator: 1 │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (17,16)-(17,22)) │ ├── flags: ∅ @@ -589,10 +625,13 @@ │ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ │ ├── arguments: ∅ │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ ├── equal_loc: ∅ │ │ │ │ │ └── block: ∅ │ │ │ │ ├── closing_loc: (19,7)-(19,8) = ")" + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ ├── closing_loc: (19,8)-(19,9) = ")" + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── @ SymbolNode (location: (19,11)-(19,13)) │ │ ├── flags: static_literal, forced_us_ascii_encoding @@ -601,6 +640,7 @@ │ │ ├── closing_loc: ∅ │ │ └── unescaped: "e" │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (19,14)-(19,20)) │ ├── flags: ∅ @@ -629,6 +669,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: │ │ │ @ BlockNode (location: (21,3)-(21,8)) │ │ │ ├── flags: ∅ @@ -658,8 +699,10 @@ │ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ │ ├── arguments: ∅ │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ ├── equal_loc: ∅ │ │ │ │ │ └── block: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ ├── opening_loc: (21,3)-(21,4) = "{" │ │ │ └── closing_loc: (21,7)-(21,8) = "}" @@ -667,6 +710,7 @@ │ │ ├── flags: static_literal, decimal │ │ └── value: 1 │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (21,12)-(21,18)) │ ├── flags: ∅ @@ -695,6 +739,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: │ │ │ @ BlockNode (location: (23,3)-(23,8)) │ │ │ ├── flags: ∅ @@ -724,8 +769,10 @@ │ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ │ ├── arguments: ∅ │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ ├── equal_loc: ∅ │ │ │ │ │ └── block: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ ├── opening_loc: (23,3)-(23,4) = "{" │ │ │ └── closing_loc: (23,7)-(23,8) = "}" @@ -733,6 +780,7 @@ │ │ ├── flags: static_literal │ │ └── value: 1.0 │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (23,14)-(23,20)) │ ├── flags: ∅ @@ -761,6 +809,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: │ │ │ @ BlockNode (location: (25,3)-(25,8)) │ │ │ ├── flags: ∅ @@ -790,8 +839,10 @@ │ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ │ ├── arguments: ∅ │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ ├── equal_loc: ∅ │ │ │ │ │ └── block: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ ├── opening_loc: (25,3)-(25,4) = "{" │ │ │ └── closing_loc: (25,7)-(25,8) = "}" @@ -802,6 +853,7 @@ │ │ ├── flags: static_literal │ │ └── value: 1.0 │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (25,15)-(25,21)) │ ├── flags: ∅ @@ -830,6 +882,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: │ │ │ @ BlockNode (location: (27,3)-(27,8)) │ │ │ ├── flags: ∅ @@ -859,8 +912,10 @@ │ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ │ ├── arguments: ∅ │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ ├── equal_loc: ∅ │ │ │ │ │ └── block: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ ├── opening_loc: (27,3)-(27,4) = "{" │ │ │ └── closing_loc: (27,7)-(27,8) = "}" @@ -869,6 +924,7 @@ │ │ ├── numerator: 1 │ │ └── denominator: 1 │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (27,15)-(27,21)) │ ├── flags: ∅ @@ -897,6 +953,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: │ │ │ @ BlockNode (location: (29,3)-(29,8)) │ │ │ ├── flags: ∅ @@ -926,8 +983,10 @@ │ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ │ ├── arguments: ∅ │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ ├── equal_loc: ∅ │ │ │ │ │ └── block: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ ├── opening_loc: (29,3)-(29,4) = "{" │ │ │ └── closing_loc: (29,7)-(29,8) = "}" @@ -938,6 +997,7 @@ │ │ ├── closing_loc: ∅ │ │ └── unescaped: "e" │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (29,13)-(29,19)) │ ├── flags: ∅ @@ -966,6 +1026,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: │ │ │ @ BlockNode (location: (31,3)-(31,9)) │ │ │ ├── flags: ∅ @@ -995,8 +1056,10 @@ │ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ │ ├── arguments: ∅ │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ ├── equal_loc: ∅ │ │ │ │ │ └── block: ∅ │ │ │ │ ├── closing_loc: (31,7)-(31,8) = ")" + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ ├── opening_loc: (31,3)-(31,4) = "{" │ │ │ └── closing_loc: (31,8)-(31,9) = "}" @@ -1004,6 +1067,7 @@ │ │ ├── flags: static_literal, decimal │ │ └── value: 1 │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (31,13)-(31,19)) │ ├── flags: ∅ @@ -1032,6 +1096,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: │ │ │ @ BlockNode (location: (33,3)-(33,9)) │ │ │ ├── flags: ∅ @@ -1061,8 +1126,10 @@ │ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ │ ├── arguments: ∅ │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ ├── equal_loc: ∅ │ │ │ │ │ └── block: ∅ │ │ │ │ ├── closing_loc: (33,7)-(33,8) = ")" + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ ├── opening_loc: (33,3)-(33,4) = "{" │ │ │ └── closing_loc: (33,8)-(33,9) = "}" @@ -1070,6 +1137,7 @@ │ │ ├── flags: static_literal │ │ └── value: 1.0 │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (33,15)-(33,21)) │ ├── flags: ∅ @@ -1098,6 +1166,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: │ │ │ @ BlockNode (location: (35,3)-(35,9)) │ │ │ ├── flags: ∅ @@ -1127,8 +1196,10 @@ │ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ │ ├── arguments: ∅ │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ ├── equal_loc: ∅ │ │ │ │ │ └── block: ∅ │ │ │ │ ├── closing_loc: (35,7)-(35,8) = ")" + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ ├── opening_loc: (35,3)-(35,4) = "{" │ │ │ └── closing_loc: (35,8)-(35,9) = "}" @@ -1139,6 +1210,7 @@ │ │ ├── flags: static_literal │ │ └── value: 1.0 │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (35,16)-(35,22)) │ ├── flags: ∅ @@ -1167,6 +1239,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: │ │ │ @ BlockNode (location: (37,3)-(37,9)) │ │ │ ├── flags: ∅ @@ -1196,8 +1269,10 @@ │ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ │ ├── arguments: ∅ │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ ├── equal_loc: ∅ │ │ │ │ │ └── block: ∅ │ │ │ │ ├── closing_loc: (37,7)-(37,8) = ")" + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ ├── opening_loc: (37,3)-(37,4) = "{" │ │ │ └── closing_loc: (37,8)-(37,9) = "}" @@ -1206,6 +1281,7 @@ │ │ ├── numerator: 1 │ │ └── denominator: 1 │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (37,16)-(37,22)) │ ├── flags: ∅ @@ -1234,6 +1310,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: │ │ @ BlockNode (location: (39,3)-(39,9)) │ │ ├── flags: ∅ @@ -1263,8 +1340,10 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ ├── closing_loc: (39,7)-(39,8) = ")" + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── opening_loc: (39,3)-(39,4) = "{" │ │ └── closing_loc: (39,8)-(39,9) = "}" @@ -1275,6 +1354,7 @@ │ ├── closing_loc: ∅ │ └── unescaped: "e" ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: @ BlockNode (location: (39,14)-(39,20)) ├── flags: ∅ diff --git a/snapshots/whitequark/ruby_bug_11873_b.txt b/snapshots/whitequark/ruby_bug_11873_b.txt index 263f4f8dd3..6b0d983076 100644 --- a/snapshots/whitequark/ruby_bug_11873_b.txt +++ b/snapshots/whitequark/ruby_bug_11873_b.txt @@ -25,6 +25,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: │ │ @ BlockNode (location: (1,3)-(1,13)) │ │ ├── flags: ∅ @@ -54,8 +55,10 @@ │ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ │ ├── arguments: ∅ │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ ├── equal_loc: ∅ │ │ │ │ │ └── block: ∅ │ │ │ │ ├── closing_loc: (1,7)-(1,8) = ")" + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ └── @ CallNode (location: (1,9)-(1,12)) │ │ │ ├── flags: newline, ignore_visibility @@ -77,8 +80,10 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── opening_loc: (1,3)-(1,4) = "{" │ │ └── closing_loc: (1,12)-(1,13) = "}" @@ -91,8 +96,10 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: @ BlockNode (location: (1,19)-(1,25)) ├── flags: ∅ diff --git a/snapshots/whitequark/ruby_bug_11989.txt b/snapshots/whitequark/ruby_bug_11989.txt index 96bafab7e9..6c0be687fc 100644 --- a/snapshots/whitequark/ruby_bug_11989.txt +++ b/snapshots/whitequark/ruby_bug_11989.txt @@ -23,4 +23,5 @@ │ ├── closing_loc: (3,0)-(4,0) = "E\n" │ └── unescaped: "x\n y\n" ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/whitequark/ruby_bug_11990.txt b/snapshots/whitequark/ruby_bug_11990.txt index 7c0b29e19b..e95f4b498f 100644 --- a/snapshots/whitequark/ruby_bug_11990.txt +++ b/snapshots/whitequark/ruby_bug_11990.txt @@ -34,4 +34,5 @@ │ │ └── unescaped: " y" │ └── closing_loc: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/whitequark/ruby_bug_12073.txt b/snapshots/whitequark/ruby_bug_12073.txt index 0b20229de9..13a48456b8 100644 --- a/snapshots/whitequark/ruby_bug_12073.txt +++ b/snapshots/whitequark/ruby_bug_12073.txt @@ -44,6 +44,7 @@ │ │ │ └── value: 1 │ │ └── operator_loc: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ └── @ DefNode (location: (3,0)-(3,34)) ├── flags: newline @@ -94,6 +95,7 @@ │ │ ├── closing_loc: (3,28)-(3,29) = "'" │ │ └── unescaped: "" │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── locals: [:raise] ├── def_keyword_loc: (3,0)-(3,3) = "def" diff --git a/snapshots/whitequark/ruby_bug_12402.txt b/snapshots/whitequark/ruby_bug_12402.txt index 6f915342c0..6c2155ab14 100644 --- a/snapshots/whitequark/ruby_bug_12402.txt +++ b/snapshots/whitequark/ruby_bug_12402.txt @@ -33,8 +33,10 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── keyword_loc: (1,17)-(1,23) = "rescue" │ │ └── rescue_expression: @@ -71,8 +73,10 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ ├── closing_loc: (3,16)-(3,17) = ")" + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── keyword_loc: (3,18)-(3,24) = "rescue" │ │ └── rescue_expression: @@ -110,8 +114,10 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── keyword_loc: (5,16)-(5,22) = "rescue" │ │ └── rescue_expression: @@ -147,8 +153,10 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ ├── closing_loc: (7,15)-(7,16) = ")" + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── keyword_loc: (7,17)-(7,23) = "rescue" │ │ └── rescue_expression: @@ -192,8 +200,10 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── keyword_loc: (9,19)-(9,25) = "rescue" │ └── rescue_expression: @@ -236,8 +246,10 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── closing_loc: (11,18)-(11,19) = ")" + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── keyword_loc: (11,20)-(11,26) = "rescue" │ └── rescue_expression: @@ -280,8 +292,10 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── keyword_loc: (13,19)-(13,25) = "rescue" │ └── rescue_expression: @@ -324,8 +338,10 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── closing_loc: (15,18)-(15,19) = ")" + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── keyword_loc: (15,20)-(15,26) = "rescue" │ └── rescue_expression: @@ -369,8 +385,10 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── keyword_loc: (17,21)-(17,27) = "rescue" │ └── rescue_expression: @@ -414,8 +432,10 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── closing_loc: (19,20)-(19,21) = ")" + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── keyword_loc: (19,22)-(19,28) = "rescue" │ └── rescue_expression: @@ -458,8 +478,10 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── keyword_loc: (21,20)-(21,26) = "rescue" │ └── rescue_expression: @@ -502,8 +524,10 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── closing_loc: (23,19)-(23,20) = ")" + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── keyword_loc: (23,21)-(23,27) = "rescue" │ └── rescue_expression: @@ -553,8 +577,10 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── keyword_loc: (25,20)-(25,26) = "rescue" │ └── rescue_expression: @@ -604,8 +630,10 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── closing_loc: (27,19)-(27,20) = ")" + │ ├── equal_loc: ∅ │ └── block: ∅ ├── keyword_loc: (27,21)-(27,27) = "rescue" └── rescue_expression: diff --git a/snapshots/whitequark/ruby_bug_12669.txt b/snapshots/whitequark/ruby_bug_12669.txt index 9d1a924b79..2024462f81 100644 --- a/snapshots/whitequark/ruby_bug_12669.txt +++ b/snapshots/whitequark/ruby_bug_12669.txt @@ -33,6 +33,7 @@ │ │ │ │ ├── closing_loc: ∅ │ │ │ │ └── unescaped: "x" │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── name: :b │ │ ├── binary_operator: :+ @@ -69,6 +70,7 @@ │ │ │ │ ├── closing_loc: ∅ │ │ │ │ └── unescaped: "x" │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── operator_loc: (3,7)-(3,8) = "=" │ ├── name: :a @@ -103,6 +105,7 @@ │ │ │ │ ├── closing_loc: ∅ │ │ │ │ └── unescaped: "x" │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── name: :b │ │ ├── binary_operator: :+ @@ -138,6 +141,7 @@ │ │ │ ├── closing_loc: ∅ │ │ │ └── unescaped: "x" │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ └── operator_loc: (7,6)-(7,7) = "=" └── operator_loc: (7,2)-(7,3) = "=" diff --git a/snapshots/whitequark/ruby_bug_12686.txt b/snapshots/whitequark/ruby_bug_12686.txt index 515ee75674..f2a9d6c924 100644 --- a/snapshots/whitequark/ruby_bug_12686.txt +++ b/snapshots/whitequark/ruby_bug_12686.txt @@ -34,6 +34,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── keyword_loc: (1,5)-(1,11) = "rescue" │ │ └── rescue_expression: @@ -42,4 +43,5 @@ │ ├── opening_loc: (1,2)-(1,3) = "(" │ └── closing_loc: (1,15)-(1,16) = ")" ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/whitequark/ruby_bug_13547.txt b/snapshots/whitequark/ruby_bug_13547.txt index d0ac79d7ff..9cf44215b3 100644 --- a/snapshots/whitequark/ruby_bug_13547.txt +++ b/snapshots/whitequark/ruby_bug_13547.txt @@ -17,6 +17,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── call_operator_loc: ∅ ├── name: :[] @@ -24,6 +25,7 @@ ├── opening_loc: (1,4)-(1,5) = "[" ├── arguments: ∅ ├── closing_loc: (1,5)-(1,6) = "]" + ├── equal_loc: ∅ └── block: @ BlockNode (location: (1,7)-(1,9)) ├── flags: ∅ diff --git a/snapshots/whitequark/ruby_bug_14690.txt b/snapshots/whitequark/ruby_bug_14690.txt index 377c0e0a0e..0b6c9adccb 100644 --- a/snapshots/whitequark/ruby_bug_14690.txt +++ b/snapshots/whitequark/ruby_bug_14690.txt @@ -22,6 +22,7 @@ │ ├── opening_loc: (1,4)-(1,5) = "(" │ └── closing_loc: (1,5)-(1,6) = ")" ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: @ BlockNode (location: (1,7)-(1,23)) ├── flags: ∅ @@ -51,8 +52,10 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── closing_loc: (1,12)-(1,13) = ")" + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (1,14)-(1,21)) │ ├── flags: ∅ diff --git a/snapshots/whitequark/ruby_bug_15789.txt b/snapshots/whitequark/ruby_bug_15789.txt index c6ac7447a8..53392fde70 100644 --- a/snapshots/whitequark/ruby_bug_15789.txt +++ b/snapshots/whitequark/ruby_bug_15789.txt @@ -71,6 +71,7 @@ │ │ ├── name: :a │ │ └── depth: 0 │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ └── @ CallNode (location: (3,0)-(3,19)) ├── flags: newline, ignore_visibility @@ -137,4 +138,5 @@ │ ├── name: :a │ └── depth: 0 ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/whitequark/ruby_bug_18878.txt b/snapshots/whitequark/ruby_bug_18878.txt index feff9defb3..52aa416339 100644 --- a/snapshots/whitequark/ruby_bug_18878.txt +++ b/snapshots/whitequark/ruby_bug_18878.txt @@ -17,6 +17,7 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: @ BlockNode (location: (1,9)-(1,19)) ├── flags: ∅ diff --git a/snapshots/whitequark/ruby_bug_19281.txt b/snapshots/whitequark/ruby_bug_19281.txt index 1af146e214..f024ab19e9 100644 --- a/snapshots/whitequark/ruby_bug_19281.txt +++ b/snapshots/whitequark/ruby_bug_19281.txt @@ -17,6 +17,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: (1,1)-(1,2) = "." │ ├── name: :b @@ -63,6 +64,7 @@ │ │ ├── opening_loc: (1,14)-(1,15) = "(" │ │ └── closing_loc: (1,16)-(1,17) = ")" │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (3,0)-(3,13)) │ ├── flags: newline @@ -76,6 +78,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: (3,1)-(3,2) = "." │ ├── name: :b @@ -101,6 +104,7 @@ │ │ ├── opening_loc: (3,11)-(3,12) = "(" │ │ └── closing_loc: (3,12)-(3,13) = ")" │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (5,0)-(5,15)) │ ├── flags: newline, ignore_visibility @@ -150,6 +154,7 @@ │ │ ├── opening_loc: (5,12)-(5,13) = "(" │ │ └── closing_loc: (5,14)-(5,15) = ")" │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ └── @ CallNode (location: (7,0)-(7,11)) ├── flags: newline, ignore_visibility @@ -178,4 +183,5 @@ │ ├── opening_loc: (7,9)-(7,10) = "(" │ └── closing_loc: (7,10)-(7,11) = ")" ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/whitequark/sclass.txt b/snapshots/whitequark/sclass.txt index 346d1a4149..5c31e4c0b5 100644 --- a/snapshots/whitequark/sclass.txt +++ b/snapshots/whitequark/sclass.txt @@ -20,6 +20,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── body: │ @ StatementsNode (location: (1,14)-(1,17)) diff --git a/snapshots/whitequark/send_attr_asgn.txt b/snapshots/whitequark/send_attr_asgn.txt index faeb5a7c7c..2002d67315 100644 --- a/snapshots/whitequark/send_attr_asgn.txt +++ b/snapshots/whitequark/send_attr_asgn.txt @@ -17,6 +17,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: (1,3)-(1,4) = "." │ ├── name: :A= @@ -30,6 +31,7 @@ │ │ ├── flags: static_literal, decimal │ │ └── value: 1 │ ├── closing_loc: ∅ + │ ├── equal_loc: (1,6)-(1,7) = "=" │ └── block: ∅ ├── @ CallNode (location: (3,0)-(3,9)) │ ├── flags: newline, attribute_write @@ -43,6 +45,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: (3,3)-(3,4) = "." │ ├── name: :a= @@ -56,6 +59,7 @@ │ │ ├── flags: static_literal, decimal │ │ └── value: 1 │ ├── closing_loc: ∅ + │ ├── equal_loc: (3,6)-(3,7) = "=" │ └── block: ∅ ├── @ ConstantPathWriteNode (location: (5,0)-(5,10)) │ ├── flags: newline @@ -72,6 +76,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── name: :A │ │ ├── delimiter_loc: (5,3)-(5,5) = "::" @@ -93,6 +98,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── call_operator_loc: (7,3)-(7,5) = "::" ├── name: :a= @@ -106,4 +112,5 @@ │ ├── flags: static_literal, decimal │ └── value: 1 ├── closing_loc: ∅ + ├── equal_loc: (7,7)-(7,8) = "=" └── block: ∅ diff --git a/snapshots/whitequark/send_attr_asgn_conditional.txt b/snapshots/whitequark/send_attr_asgn_conditional.txt index cb849e3f05..db552e4a92 100644 --- a/snapshots/whitequark/send_attr_asgn_conditional.txt +++ b/snapshots/whitequark/send_attr_asgn_conditional.txt @@ -17,6 +17,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── call_operator_loc: (1,1)-(1,3) = "&." ├── name: :b= @@ -30,4 +31,5 @@ │ ├── flags: static_literal, decimal │ └── value: 1 ├── closing_loc: ∅ + ├── equal_loc: (1,5)-(1,6) = "=" └── block: ∅ diff --git a/snapshots/whitequark/send_binary_op.txt b/snapshots/whitequark/send_binary_op.txt index 49a2cffa65..e9c98b9687 100644 --- a/snapshots/whitequark/send_binary_op.txt +++ b/snapshots/whitequark/send_binary_op.txt @@ -17,6 +17,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: ∅ │ ├── name: :!= @@ -30,6 +31,7 @@ │ │ ├── flags: static_literal, decimal │ │ └── value: 1 │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (3,0)-(3,8)) │ ├── flags: newline @@ -43,6 +45,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: ∅ │ ├── name: :!~ @@ -56,6 +59,7 @@ │ │ ├── flags: static_literal, decimal │ │ └── value: 1 │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (5,0)-(5,7)) │ ├── flags: newline @@ -69,6 +73,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: ∅ │ ├── name: :% @@ -82,6 +87,7 @@ │ │ ├── flags: static_literal, decimal │ │ └── value: 1 │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (7,0)-(7,7)) │ ├── flags: newline @@ -95,6 +101,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: ∅ │ ├── name: :& @@ -108,6 +115,7 @@ │ │ ├── flags: static_literal, decimal │ │ └── value: 1 │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (9,0)-(9,7)) │ ├── flags: newline @@ -121,6 +129,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: ∅ │ ├── name: :* @@ -134,6 +143,7 @@ │ │ ├── flags: static_literal, decimal │ │ └── value: 1 │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (11,0)-(11,8)) │ ├── flags: newline @@ -147,6 +157,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: ∅ │ ├── name: :** @@ -160,6 +171,7 @@ │ │ ├── flags: static_literal, decimal │ │ └── value: 1 │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (13,0)-(13,7)) │ ├── flags: newline @@ -173,6 +185,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: ∅ │ ├── name: :+ @@ -186,6 +199,7 @@ │ │ ├── flags: static_literal, decimal │ │ └── value: 1 │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (15,0)-(15,7)) │ ├── flags: newline @@ -199,6 +213,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: ∅ │ ├── name: :- @@ -212,6 +227,7 @@ │ │ ├── flags: static_literal, decimal │ │ └── value: 1 │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (17,0)-(17,7)) │ ├── flags: newline @@ -225,6 +241,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: ∅ │ ├── name: :/ @@ -238,6 +255,7 @@ │ │ ├── flags: static_literal, decimal │ │ └── value: 1 │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (19,0)-(19,7)) │ ├── flags: newline @@ -251,6 +269,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: ∅ │ ├── name: :< @@ -264,6 +283,7 @@ │ │ ├── flags: static_literal, decimal │ │ └── value: 1 │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (21,0)-(21,8)) │ ├── flags: newline @@ -277,6 +297,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: ∅ │ ├── name: :<< @@ -290,6 +311,7 @@ │ │ ├── flags: static_literal, decimal │ │ └── value: 1 │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (23,0)-(23,8)) │ ├── flags: newline @@ -303,6 +325,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: ∅ │ ├── name: :<= @@ -316,6 +339,7 @@ │ │ ├── flags: static_literal, decimal │ │ └── value: 1 │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (25,0)-(25,9)) │ ├── flags: newline @@ -329,6 +353,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: ∅ │ ├── name: :<=> @@ -342,6 +367,7 @@ │ │ ├── flags: static_literal, decimal │ │ └── value: 1 │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (27,0)-(27,8)) │ ├── flags: newline @@ -355,6 +381,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: ∅ │ ├── name: :== @@ -368,6 +395,7 @@ │ │ ├── flags: static_literal, decimal │ │ └── value: 1 │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (29,0)-(29,9)) │ ├── flags: newline @@ -381,6 +409,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: ∅ │ ├── name: :=== @@ -394,6 +423,7 @@ │ │ ├── flags: static_literal, decimal │ │ └── value: 1 │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (31,0)-(31,8)) │ ├── flags: newline @@ -407,6 +437,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: ∅ │ ├── name: :=~ @@ -420,6 +451,7 @@ │ │ ├── flags: static_literal, decimal │ │ └── value: 1 │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (33,0)-(33,7)) │ ├── flags: newline @@ -433,6 +465,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: ∅ │ ├── name: :> @@ -446,6 +479,7 @@ │ │ ├── flags: static_literal, decimal │ │ └── value: 1 │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (35,0)-(35,8)) │ ├── flags: newline @@ -459,6 +493,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: ∅ │ ├── name: :>= @@ -472,6 +507,7 @@ │ │ ├── flags: static_literal, decimal │ │ └── value: 1 │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (37,0)-(37,8)) │ ├── flags: newline @@ -485,6 +521,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: ∅ │ ├── name: :>> @@ -498,6 +535,7 @@ │ │ ├── flags: static_literal, decimal │ │ └── value: 1 │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (39,0)-(39,7)) │ ├── flags: newline @@ -511,6 +549,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: ∅ │ ├── name: :^ @@ -524,6 +563,7 @@ │ │ ├── flags: static_literal, decimal │ │ └── value: 1 │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ └── @ CallNode (location: (41,0)-(41,7)) ├── flags: newline @@ -537,6 +577,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── call_operator_loc: ∅ ├── name: :| @@ -550,4 +591,5 @@ │ ├── flags: static_literal, decimal │ └── value: 1 ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/whitequark/send_block_chain_cmd.txt b/snapshots/whitequark/send_block_chain_cmd.txt index bce45c38ee..7656a08771 100644 --- a/snapshots/whitequark/send_block_chain_cmd.txt +++ b/snapshots/whitequark/send_block_chain_cmd.txt @@ -23,6 +23,7 @@ │ │ │ ├── flags: static_literal, decimal │ │ │ └── value: 1 │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: │ │ @ BlockNode (location: (1,7)-(1,13)) │ │ ├── flags: ∅ @@ -48,8 +49,10 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (3,0)-(3,28)) │ ├── flags: newline @@ -69,6 +72,7 @@ │ │ │ ├── flags: static_literal, decimal │ │ │ └── value: 1 │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: │ │ @ BlockNode (location: (3,7)-(3,13)) │ │ ├── flags: ∅ @@ -94,8 +98,10 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (3,22)-(3,28)) │ ├── flags: ∅ @@ -122,6 +128,7 @@ │ │ │ ├── flags: static_literal, decimal │ │ │ └── value: 1 │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: │ │ @ BlockNode (location: (5,7)-(5,13)) │ │ ├── flags: ∅ @@ -136,6 +143,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (5,18)-(5,20)) │ ├── flags: ∅ @@ -162,6 +170,7 @@ │ │ │ ├── flags: static_literal, decimal │ │ │ └── value: 1 │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: │ │ @ BlockNode (location: (7,7)-(7,13)) │ │ ├── flags: ∅ @@ -187,8 +196,10 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── closing_loc: (7,21)-(7,22) = ")" + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (9,0)-(9,25)) │ ├── flags: newline @@ -208,6 +219,7 @@ │ │ │ ├── flags: static_literal, decimal │ │ │ └── value: 1 │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: │ │ @ BlockNode (location: (9,7)-(9,13)) │ │ ├── flags: ∅ @@ -233,8 +245,10 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── closing_loc: (9,21)-(9,22) = ")" + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (9,23)-(9,25)) │ ├── flags: ∅ @@ -261,6 +275,7 @@ │ │ │ ├── flags: static_literal, decimal │ │ │ └── value: 1 │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: │ │ @ BlockNode (location: (11,7)-(11,13)) │ │ ├── flags: ∅ @@ -286,8 +301,10 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ └── @ CallNode (location: (13,0)-(13,23)) ├── flags: newline @@ -307,6 +324,7 @@ │ │ ├── flags: static_literal, decimal │ │ └── value: 1 │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (13,7)-(13,13)) │ ├── flags: ∅ @@ -332,6 +350,8 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── closing_loc: (13,22)-(13,23) = ")" + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/whitequark/send_block_conditional.txt b/snapshots/whitequark/send_block_conditional.txt index 86ef0dbf36..4fb4ce99f8 100644 --- a/snapshots/whitequark/send_block_conditional.txt +++ b/snapshots/whitequark/send_block_conditional.txt @@ -17,6 +17,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── call_operator_loc: (1,3)-(1,5) = "&." ├── name: :bar @@ -24,6 +25,7 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: @ BlockNode (location: (1,9)-(1,11)) ├── flags: ∅ diff --git a/snapshots/whitequark/send_call.txt b/snapshots/whitequark/send_call.txt index 4ed17fbaee..c025248b0d 100644 --- a/snapshots/whitequark/send_call.txt +++ b/snapshots/whitequark/send_call.txt @@ -17,6 +17,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: (1,3)-(1,4) = "." │ ├── name: :call @@ -30,6 +31,7 @@ │ │ ├── flags: static_literal, decimal │ │ └── value: 1 │ ├── closing_loc: (1,6)-(1,7) = ")" + │ ├── equal_loc: ∅ │ └── block: ∅ └── @ CallNode (location: (3,0)-(3,8)) ├── flags: newline @@ -43,6 +45,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── call_operator_loc: (3,3)-(3,5) = "::" ├── name: :call @@ -56,4 +59,5 @@ │ ├── flags: static_literal, decimal │ └── value: 1 ├── closing_loc: (3,7)-(3,8) = ")" + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/whitequark/send_conditional.txt b/snapshots/whitequark/send_conditional.txt index 7faa6ac04e..54d8f588d7 100644 --- a/snapshots/whitequark/send_conditional.txt +++ b/snapshots/whitequark/send_conditional.txt @@ -17,6 +17,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── call_operator_loc: (1,1)-(1,3) = "&." ├── name: :b @@ -24,4 +25,5 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/whitequark/send_index.txt b/snapshots/whitequark/send_index.txt index 5aec47c484..02bef8bb3c 100644 --- a/snapshots/whitequark/send_index.txt +++ b/snapshots/whitequark/send_index.txt @@ -17,6 +17,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── call_operator_loc: ∅ ├── name: :[] @@ -33,4 +34,5 @@ │ ├── flags: static_literal, decimal │ └── value: 2 ├── closing_loc: (1,8)-(1,9) = "]" + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/whitequark/send_index_asgn.txt b/snapshots/whitequark/send_index_asgn.txt index fe0f71956a..962a5d3da9 100644 --- a/snapshots/whitequark/send_index_asgn.txt +++ b/snapshots/whitequark/send_index_asgn.txt @@ -17,6 +17,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── call_operator_loc: ∅ ├── name: :[]= @@ -36,4 +37,5 @@ │ ├── flags: static_literal, decimal │ └── value: 3 ├── closing_loc: (1,8)-(1,9) = "]" + ├── equal_loc: (1,10)-(1,11) = "=" └── block: ∅ diff --git a/snapshots/whitequark/send_index_asgn_legacy.txt b/snapshots/whitequark/send_index_asgn_legacy.txt index fe0f71956a..962a5d3da9 100644 --- a/snapshots/whitequark/send_index_asgn_legacy.txt +++ b/snapshots/whitequark/send_index_asgn_legacy.txt @@ -17,6 +17,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── call_operator_loc: ∅ ├── name: :[]= @@ -36,4 +37,5 @@ │ ├── flags: static_literal, decimal │ └── value: 3 ├── closing_loc: (1,8)-(1,9) = "]" + ├── equal_loc: (1,10)-(1,11) = "=" └── block: ∅ diff --git a/snapshots/whitequark/send_index_cmd.txt b/snapshots/whitequark/send_index_cmd.txt index 89a5c41fc3..69128863f1 100644 --- a/snapshots/whitequark/send_index_cmd.txt +++ b/snapshots/whitequark/send_index_cmd.txt @@ -17,6 +17,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── call_operator_loc: ∅ ├── name: :[] @@ -46,8 +47,11 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── closing_loc: (1,9)-(1,10) = "]" + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/whitequark/send_index_legacy.txt b/snapshots/whitequark/send_index_legacy.txt index 5aec47c484..02bef8bb3c 100644 --- a/snapshots/whitequark/send_index_legacy.txt +++ b/snapshots/whitequark/send_index_legacy.txt @@ -17,6 +17,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── call_operator_loc: ∅ ├── name: :[] @@ -33,4 +34,5 @@ │ ├── flags: static_literal, decimal │ └── value: 2 ├── closing_loc: (1,8)-(1,9) = "]" + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/whitequark/send_op_asgn_conditional.txt b/snapshots/whitequark/send_op_asgn_conditional.txt index 68e09171f8..436029dca8 100644 --- a/snapshots/whitequark/send_op_asgn_conditional.txt +++ b/snapshots/whitequark/send_op_asgn_conditional.txt @@ -17,6 +17,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── call_operator_loc: (1,1)-(1,3) = "&." ├── message_loc: (1,3)-(1,4) = "b" diff --git a/snapshots/whitequark/send_plain.txt b/snapshots/whitequark/send_plain.txt index 96643ddcab..dfdfc6873c 100644 --- a/snapshots/whitequark/send_plain.txt +++ b/snapshots/whitequark/send_plain.txt @@ -17,6 +17,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: (1,3)-(1,4) = "." │ ├── name: :fun @@ -24,6 +25,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (3,0)-(3,10)) │ ├── flags: newline @@ -37,6 +39,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: (3,3)-(3,5) = "::" │ ├── name: :Fun @@ -44,6 +47,7 @@ │ ├── opening_loc: (3,8)-(3,9) = "(" │ ├── arguments: ∅ │ ├── closing_loc: (3,9)-(3,10) = ")" + │ ├── equal_loc: ∅ │ └── block: ∅ └── @ CallNode (location: (5,0)-(5,8)) ├── flags: newline @@ -57,6 +61,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── call_operator_loc: (5,3)-(5,5) = "::" ├── name: :fun @@ -64,4 +69,5 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/whitequark/send_plain_cmd.txt b/snapshots/whitequark/send_plain_cmd.txt index 2785712baa..ba9a593134 100644 --- a/snapshots/whitequark/send_plain_cmd.txt +++ b/snapshots/whitequark/send_plain_cmd.txt @@ -17,6 +17,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: (1,3)-(1,4) = "." │ ├── name: :fun @@ -35,8 +36,10 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (3,0)-(3,12)) │ ├── flags: newline @@ -50,6 +53,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: (3,3)-(3,5) = "::" │ ├── name: :Fun @@ -68,8 +72,10 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ └── @ CallNode (location: (5,0)-(5,12)) ├── flags: newline @@ -83,6 +89,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── call_operator_loc: (5,3)-(5,5) = "::" ├── name: :fun @@ -101,6 +108,8 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/whitequark/send_self.txt b/snapshots/whitequark/send_self.txt index f3c56f5413..88b2bdb896 100644 --- a/snapshots/whitequark/send_self.txt +++ b/snapshots/whitequark/send_self.txt @@ -14,6 +14,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (3,0)-(3,4)) │ ├── flags: newline, ignore_visibility @@ -24,6 +25,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ └── @ CallNode (location: (5,0)-(5,6)) ├── flags: newline, ignore_visibility @@ -40,4 +42,5 @@ │ ├── flags: static_literal, decimal │ └── value: 1 ├── closing_loc: (5,5)-(5,6) = ")" + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/whitequark/send_self_block.txt b/snapshots/whitequark/send_self_block.txt index 2d526d5d48..82269ea716 100644 --- a/snapshots/whitequark/send_self_block.txt +++ b/snapshots/whitequark/send_self_block.txt @@ -14,6 +14,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (1,4)-(1,10)) │ ├── flags: ∅ @@ -31,6 +32,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (3,4)-(3,7)) │ ├── flags: ∅ @@ -48,6 +50,7 @@ │ ├── opening_loc: (5,3)-(5,4) = "(" │ ├── arguments: ∅ │ ├── closing_loc: (5,4)-(5,5) = ")" + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (5,6)-(5,9)) │ ├── flags: ∅ @@ -71,6 +74,7 @@ │ ├── flags: static_literal, decimal │ └── value: 1 ├── closing_loc: (7,5)-(7,6) = ")" + ├── equal_loc: ∅ └── block: @ BlockNode (location: (7,7)-(7,10)) ├── flags: ∅ diff --git a/snapshots/whitequark/send_unary_op.txt b/snapshots/whitequark/send_unary_op.txt index 970b78417f..114ebfa86d 100644 --- a/snapshots/whitequark/send_unary_op.txt +++ b/snapshots/whitequark/send_unary_op.txt @@ -17,6 +17,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: ∅ │ ├── name: :+@ @@ -24,6 +25,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (3,0)-(3,4)) │ ├── flags: newline @@ -37,6 +39,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: ∅ │ ├── name: :-@ @@ -44,6 +47,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ └── @ CallNode (location: (5,0)-(5,4)) ├── flags: newline @@ -57,6 +61,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── call_operator_loc: ∅ ├── name: :~ @@ -64,4 +69,5 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/whitequark/space_args_arg.txt b/snapshots/whitequark/space_args_arg.txt index a0149c5f32..40c0474bad 100644 --- a/snapshots/whitequark/space_args_arg.txt +++ b/snapshots/whitequark/space_args_arg.txt @@ -28,4 +28,5 @@ │ ├── opening_loc: (1,4)-(1,5) = "(" │ └── closing_loc: (1,6)-(1,7) = ")" ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/whitequark/space_args_arg_block.txt b/snapshots/whitequark/space_args_arg_block.txt index c3289c1448..fbe64d62bc 100644 --- a/snapshots/whitequark/space_args_arg_block.txt +++ b/snapshots/whitequark/space_args_arg_block.txt @@ -17,6 +17,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: (1,3)-(1,4) = "." │ ├── name: :fun @@ -38,6 +39,7 @@ │ │ ├── opening_loc: (1,8)-(1,9) = "(" │ │ └── closing_loc: (1,10)-(1,11) = ")" │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (1,12)-(1,14)) │ ├── flags: ∅ @@ -58,6 +60,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: (3,3)-(3,5) = "::" │ ├── name: :fun @@ -79,6 +82,7 @@ │ │ ├── opening_loc: (3,9)-(3,10) = "(" │ │ └── closing_loc: (3,11)-(3,12) = ")" │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: │ @ BlockNode (location: (3,13)-(3,15)) │ ├── flags: ∅ @@ -110,6 +114,7 @@ │ ├── opening_loc: (5,4)-(5,5) = "(" │ └── closing_loc: (5,6)-(5,7) = ")" ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: @ BlockNode (location: (5,8)-(5,10)) ├── flags: ∅ diff --git a/snapshots/whitequark/space_args_arg_call.txt b/snapshots/whitequark/space_args_arg_call.txt index 538a865e2a..e8cfe45136 100644 --- a/snapshots/whitequark/space_args_arg_call.txt +++ b/snapshots/whitequark/space_args_arg_call.txt @@ -36,6 +36,8 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/whitequark/space_args_arg_newline.txt b/snapshots/whitequark/space_args_arg_newline.txt index d3fbe23299..be99e96def 100644 --- a/snapshots/whitequark/space_args_arg_newline.txt +++ b/snapshots/whitequark/space_args_arg_newline.txt @@ -28,4 +28,5 @@ │ ├── opening_loc: (1,4)-(1,5) = "(" │ └── closing_loc: (2,0)-(2,1) = ")" ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/whitequark/space_args_block.txt b/snapshots/whitequark/space_args_block.txt index 19b5064886..2cf75fca9f 100644 --- a/snapshots/whitequark/space_args_block.txt +++ b/snapshots/whitequark/space_args_block.txt @@ -22,6 +22,7 @@ │ ├── opening_loc: (1,4)-(1,5) = "(" │ └── closing_loc: (1,5)-(1,6) = ")" ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: @ BlockNode (location: (1,7)-(1,9)) ├── flags: ∅ diff --git a/snapshots/whitequark/space_args_cmd.txt b/snapshots/whitequark/space_args_cmd.txt index f91b7edbbe..44f30d76b9 100644 --- a/snapshots/whitequark/space_args_cmd.txt +++ b/snapshots/whitequark/space_args_cmd.txt @@ -42,10 +42,13 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── opening_loc: (1,4)-(1,5) = "(" │ └── closing_loc: (1,10)-(1,11) = ")" ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/whitequark/string_interp.txt b/snapshots/whitequark/string_interp.txt index 22ddaed0cd..2debd17ba2 100644 --- a/snapshots/whitequark/string_interp.txt +++ b/snapshots/whitequark/string_interp.txt @@ -31,6 +31,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── closing_loc: (1,9)-(1,10) = "}" │ └── @ StringNode (location: (1,10)-(1,13)) diff --git a/snapshots/whitequark/super.txt b/snapshots/whitequark/super.txt index da89dbda28..0f83f6f294 100644 --- a/snapshots/whitequark/super.txt +++ b/snapshots/whitequark/super.txt @@ -22,6 +22,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── rparen_loc: ∅ │ └── block: ∅ @@ -49,6 +50,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── rparen_loc: (5,9)-(5,10) = ")" └── block: ∅ diff --git a/snapshots/whitequark/super_block.txt b/snapshots/whitequark/super_block.txt index 095856ef40..794210b67d 100644 --- a/snapshots/whitequark/super_block.txt +++ b/snapshots/whitequark/super_block.txt @@ -32,6 +32,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ └── @ CallNode (location: (3,11)-(3,14)) │ ├── flags: variable_call, ignore_visibility @@ -42,6 +43,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── rparen_loc: ∅ └── block: diff --git a/snapshots/whitequark/symbol_interp.txt b/snapshots/whitequark/symbol_interp.txt index 46a24b6c7e..567dfa4145 100644 --- a/snapshots/whitequark/symbol_interp.txt +++ b/snapshots/whitequark/symbol_interp.txt @@ -31,6 +31,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── closing_loc: (1,10)-(1,11) = "}" │ └── @ StringNode (location: (1,11)-(1,14)) diff --git a/snapshots/whitequark/ternary.txt b/snapshots/whitequark/ternary.txt index 4aa7991675..add8f9e347 100644 --- a/snapshots/whitequark/ternary.txt +++ b/snapshots/whitequark/ternary.txt @@ -18,6 +18,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── then_keyword_loc: (1,4)-(1,5) = "?" ├── statements: diff --git a/snapshots/whitequark/ternary_ambiguous_symbol.txt b/snapshots/whitequark/ternary_ambiguous_symbol.txt index 4d1900fc5f..db6fa66292 100644 --- a/snapshots/whitequark/ternary_ambiguous_symbol.txt +++ b/snapshots/whitequark/ternary_ambiguous_symbol.txt @@ -34,6 +34,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── opening_loc: (1,4)-(1,5) = "(" │ └── closing_loc: (1,8)-(1,9) = ")" diff --git a/snapshots/whitequark/trailing_forward_arg.txt b/snapshots/whitequark/trailing_forward_arg.txt index 75fce37a34..7c4a04c73e 100644 --- a/snapshots/whitequark/trailing_forward_arg.txt +++ b/snapshots/whitequark/trailing_forward_arg.txt @@ -53,6 +53,7 @@ │ │ └── @ ForwardingArgumentsNode (location: (1,31)-(1,34)) │ │ └── flags: ∅ │ ├── closing_loc: (1,34)-(1,35) = ")" + │ ├── equal_loc: ∅ │ └── block: ∅ ├── locals: [:a, :b] ├── def_keyword_loc: (1,0)-(1,3) = "def" diff --git a/snapshots/whitequark/unary_num_pow_precedence.txt b/snapshots/whitequark/unary_num_pow_precedence.txt index 0f2fb776b4..dfb2ca10ea 100644 --- a/snapshots/whitequark/unary_num_pow_precedence.txt +++ b/snapshots/whitequark/unary_num_pow_precedence.txt @@ -23,6 +23,7 @@ │ │ ├── flags: static_literal, decimal │ │ └── value: 10 │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── @ CallNode (location: (3,0)-(3,8)) │ ├── flags: newline @@ -45,6 +46,7 @@ │ │ │ ├── flags: static_literal, decimal │ │ │ └── value: 10 │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── call_operator_loc: ∅ │ ├── name: :-@ @@ -52,6 +54,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ └── @ CallNode (location: (5,0)-(5,10)) ├── flags: newline @@ -74,6 +77,7 @@ │ │ ├── flags: static_literal, decimal │ │ └── value: 10 │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── call_operator_loc: ∅ ├── name: :-@ @@ -81,4 +85,5 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/whitequark/unless.txt b/snapshots/whitequark/unless.txt index 3d417e355d..7c81d72e27 100644 --- a/snapshots/whitequark/unless.txt +++ b/snapshots/whitequark/unless.txt @@ -18,6 +18,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── then_keyword_loc: (1,11)-(1,15) = "then" │ ├── statements: @@ -33,6 +34,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── else_clause: ∅ │ └── end_keyword_loc: (1,21)-(1,24) = "end" @@ -49,6 +51,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── then_keyword_loc: ∅ ├── statements: @@ -64,6 +67,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── else_clause: ∅ └── end_keyword_loc: (3,17)-(3,20) = "end" diff --git a/snapshots/whitequark/unless_else.txt b/snapshots/whitequark/unless_else.txt index ffdb215692..77807c7d24 100644 --- a/snapshots/whitequark/unless_else.txt +++ b/snapshots/whitequark/unless_else.txt @@ -18,6 +18,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── then_keyword_loc: (1,11)-(1,15) = "then" │ ├── statements: @@ -33,6 +34,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── else_clause: │ │ @ ElseNode (location: (1,21)-(1,34)) @@ -51,6 +53,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── end_keyword_loc: (1,31)-(1,34) = "end" │ └── end_keyword_loc: (1,31)-(1,34) = "end" @@ -67,6 +70,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── then_keyword_loc: ∅ ├── statements: @@ -82,6 +86,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── else_clause: │ @ ElseNode (location: (3,17)-(3,30)) @@ -100,6 +105,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ └── end_keyword_loc: (3,27)-(3,30) = "end" └── end_keyword_loc: (3,27)-(3,30) = "end" diff --git a/snapshots/whitequark/unless_mod.txt b/snapshots/whitequark/unless_mod.txt index 5dd1c2d25d..0a0e2f4917 100644 --- a/snapshots/whitequark/unless_mod.txt +++ b/snapshots/whitequark/unless_mod.txt @@ -18,6 +18,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── then_keyword_loc: ∅ ├── statements: @@ -33,6 +34,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── else_clause: ∅ └── end_keyword_loc: ∅ diff --git a/snapshots/whitequark/until.txt b/snapshots/whitequark/until.txt index 9737c86bd2..2b31c70613 100644 --- a/snapshots/whitequark/until.txt +++ b/snapshots/whitequark/until.txt @@ -20,6 +20,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ └── statements: │ @ StatementsNode (location: (1,13)-(1,17)) @@ -34,6 +35,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ └── @ UntilNode (location: (3,0)-(3,19)) ├── flags: newline @@ -50,6 +52,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ └── statements: @ StatementsNode (location: (3,11)-(3,15)) @@ -64,4 +67,5 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/whitequark/until_mod.txt b/snapshots/whitequark/until_mod.txt index c7751ca5a4..dab63f0247 100644 --- a/snapshots/whitequark/until_mod.txt +++ b/snapshots/whitequark/until_mod.txt @@ -20,6 +20,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ └── statements: @ StatementsNode (location: (1,0)-(1,4)) @@ -34,4 +35,5 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/whitequark/until_post.txt b/snapshots/whitequark/until_post.txt index 3e3ab838b9..2b65a3125a 100644 --- a/snapshots/whitequark/until_post.txt +++ b/snapshots/whitequark/until_post.txt @@ -20,6 +20,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ └── statements: @ StatementsNode (location: (1,0)-(1,14)) @@ -41,6 +42,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── rescue_clause: ∅ ├── else_clause: ∅ diff --git a/snapshots/whitequark/var_op_asgn_cmd.txt b/snapshots/whitequark/var_op_asgn_cmd.txt index 381c98a95a..7900953558 100644 --- a/snapshots/whitequark/var_op_asgn_cmd.txt +++ b/snapshots/whitequark/var_op_asgn_cmd.txt @@ -26,6 +26,7 @@ │ │ ├── name: :foo │ │ └── depth: 0 │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── name: :foo ├── binary_operator: :+ diff --git a/snapshots/whitequark/when_multi.txt b/snapshots/whitequark/when_multi.txt index b4038b74a8..2aab67f1e3 100644 --- a/snapshots/whitequark/when_multi.txt +++ b/snapshots/whitequark/when_multi.txt @@ -17,6 +17,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── conditions: (length: 1) │ └── @ WhenNode (location: (1,10)-(1,32)) @@ -49,6 +50,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── else_clause: ∅ ├── case_keyword_loc: (1,0)-(1,4) = "case" diff --git a/snapshots/whitequark/when_splat.txt b/snapshots/whitequark/when_splat.txt index f5d9080539..34c8032f77 100644 --- a/snapshots/whitequark/when_splat.txt +++ b/snapshots/whitequark/when_splat.txt @@ -17,6 +17,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── conditions: (length: 2) │ ├── @ WhenNode (location: (1,10)-(1,27)) @@ -39,6 +40,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ ├── then_keyword_loc: ∅ │ │ └── statements: @@ -54,6 +56,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ └── @ WhenNode (location: (1,29)-(1,38)) │ ├── flags: ∅ @@ -72,6 +75,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ ├── then_keyword_loc: ∅ │ └── statements: ∅ diff --git a/snapshots/whitequark/when_then.txt b/snapshots/whitequark/when_then.txt index cb964cfb53..cf9e0c23ae 100644 --- a/snapshots/whitequark/when_then.txt +++ b/snapshots/whitequark/when_then.txt @@ -17,6 +17,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── conditions: (length: 1) │ └── @ WhenNode (location: (1,10)-(1,29)) @@ -43,6 +44,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── else_clause: ∅ ├── case_keyword_loc: (1,0)-(1,4) = "case" diff --git a/snapshots/whitequark/while.txt b/snapshots/whitequark/while.txt index 3d2469e8d1..41b104bd6d 100644 --- a/snapshots/whitequark/while.txt +++ b/snapshots/whitequark/while.txt @@ -20,6 +20,7 @@ │ │ ├── opening_loc: ∅ │ │ ├── arguments: ∅ │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ └── statements: │ @ StatementsNode (location: (1,13)-(1,17)) @@ -34,6 +35,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ └── @ WhileNode (location: (3,0)-(3,19)) ├── flags: newline @@ -50,6 +52,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ └── statements: @ StatementsNode (location: (3,11)-(3,15)) @@ -64,4 +67,5 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/whitequark/while_mod.txt b/snapshots/whitequark/while_mod.txt index 584bdf61f1..41782c4b64 100644 --- a/snapshots/whitequark/while_mod.txt +++ b/snapshots/whitequark/while_mod.txt @@ -20,6 +20,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ └── statements: @ StatementsNode (location: (1,0)-(1,4)) @@ -34,4 +35,5 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ diff --git a/snapshots/whitequark/while_post.txt b/snapshots/whitequark/while_post.txt index 303068d4be..4a16f63a7c 100644 --- a/snapshots/whitequark/while_post.txt +++ b/snapshots/whitequark/while_post.txt @@ -20,6 +20,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ └── statements: @ StatementsNode (location: (1,0)-(1,14)) @@ -41,6 +42,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ ├── rescue_clause: ∅ ├── else_clause: ∅ diff --git a/snapshots/whitequark/xstring_interp.txt b/snapshots/whitequark/xstring_interp.txt index 7808b93250..500b2d9875 100644 --- a/snapshots/whitequark/xstring_interp.txt +++ b/snapshots/whitequark/xstring_interp.txt @@ -31,6 +31,7 @@ │ │ │ ├── opening_loc: ∅ │ │ │ ├── arguments: ∅ │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ │ │ │ └── block: ∅ │ │ └── closing_loc: (1,9)-(1,10) = "}" │ └── @ StringNode (location: (1,10)-(1,13)) diff --git a/snapshots/xstring.txt b/snapshots/xstring.txt index 530066fd45..f5d49a71d0 100644 --- a/snapshots/xstring.txt +++ b/snapshots/xstring.txt @@ -37,6 +37,7 @@ │ │ │ │ ├── opening_loc: ∅ │ │ │ │ ├── arguments: ∅ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ │ │ │ │ └── block: ∅ │ │ │ └── closing_loc: (3,10)-(3,11) = "}" │ │ └── @ StringNode (location: (3,11)-(3,15)) diff --git a/src/prism.c b/src/prism.c index 95e7d09050..029026cef4 100644 --- a/src/prism.c +++ b/src/prism.c @@ -2650,6 +2650,7 @@ pm_call_node_create(pm_parser_t *parser, pm_node_flags_t flags) { .opening_loc = PM_OPTIONAL_LOCATION_NOT_PROVIDED_VALUE, .arguments = NULL, .closing_loc = PM_OPTIONAL_LOCATION_NOT_PROVIDED_VALUE, + .equal_loc = PM_OPTIONAL_LOCATION_NOT_PROVIDED_VALUE, .block = NULL, .name = 0 }; @@ -13804,6 +13805,7 @@ parse_write(pm_parser_t *parser, pm_node_t *target, pm_token_t *operator, pm_nod pm_arguments_node_arguments_append(arguments, value); call->base.location.end = arguments->base.location.end; + call->equal_loc = PM_LOCATION_TOKEN_VALUE(operator); parse_write_name(parser, &call->name); pm_node_flag_set((pm_node_t *) call, PM_CALL_NODE_FLAGS_ATTRIBUTE_WRITE | pm_implicit_array_write_flags(value, PM_CALL_NODE_FLAGS_IMPLICIT_ARRAY)); @@ -13825,6 +13827,7 @@ parse_write(pm_parser_t *parser, pm_node_t *target, pm_token_t *operator, pm_nod // Replace the name with "[]=". call->name = pm_parser_constant_id_constant(parser, "[]=", 3); + call->equal_loc = PM_LOCATION_TOKEN_VALUE(operator); // Ensure that the arguments for []= don't contain keywords pm_index_arguments_check(parser, call->arguments, call->block); From a755bf228f77e724a315c4055a4b95bf47d443a1 Mon Sep 17 00:00:00 2001 From: Earlopain <14981592+Earlopain@users.noreply.github.com> Date: Mon, 27 Oct 2025 11:24:45 +0100 Subject: [PATCH 189/333] Unescape unary method calls Followup to https://github.com/ruby/prism/pull/2213 Before: ```sh $ ruby -ve "puts 42.~@" ruby 3.4.6 (2025-09-16 revision dbd83256b1) +PRISM [x86_64-linux] -e:1:in '
': undefined method '~@' for an instance of Integer (NoMethodError) Did you mean? ~ ``` After (matches parse.y): ```sh $ ./miniruby -ve "puts 42.~@" ruby 3.5.0dev (2025-10-16T03:40:45Z master 1d95d75c3f) +PRISM [x86_64-linux] -43 ``` --- snapshots/unary_method_calls.txt | 33 ++++++++++++++++++++++ src/prism.c | 10 +++++-- test/prism/fixtures/unary_method_calls.txt | 2 ++ test/prism/ruby/parser_test.rb | 3 ++ test/prism/ruby/ruby_parser_test.rb | 1 + 5 files changed, 47 insertions(+), 2 deletions(-) create mode 100644 snapshots/unary_method_calls.txt create mode 100644 test/prism/fixtures/unary_method_calls.txt diff --git a/snapshots/unary_method_calls.txt b/snapshots/unary_method_calls.txt new file mode 100644 index 0000000000..7a3032ba0d --- /dev/null +++ b/snapshots/unary_method_calls.txt @@ -0,0 +1,33 @@ +@ ProgramNode (location: (1,0)-(2,5)) +├── flags: ∅ +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(2,5)) + ├── flags: ∅ + └── body: (length: 2) + ├── @ CallNode (location: (1,0)-(1,5)) + │ ├── flags: newline + │ ├── receiver: + │ │ @ IntegerNode (location: (1,0)-(1,2)) + │ │ ├── flags: static_literal, decimal + │ │ └── value: 42 + │ ├── call_operator_loc: (1,2)-(1,3) = "." + │ ├── name: :~ + │ ├── message_loc: (1,3)-(1,5) = "~@" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ └── block: ∅ + └── @ CallNode (location: (2,0)-(2,5)) + ├── flags: newline + ├── receiver: + │ @ IntegerNode (location: (2,0)-(2,2)) + │ ├── flags: static_literal, decimal + │ └── value: 42 + ├── call_operator_loc: (2,2)-(2,3) = "." + ├── name: :! + ├── message_loc: (2,3)-(2,5) = "!@" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + └── block: ∅ diff --git a/src/prism.c b/src/prism.c index 95e7d09050..a92de163f5 100644 --- a/src/prism.c +++ b/src/prism.c @@ -2721,6 +2721,8 @@ pm_call_node_binary_create(pm_parser_t *parser, pm_node_t *receiver, pm_token_t return node; } +static const uint8_t * parse_operator_symbol_name(const pm_token_t *); + /** * Allocate and initialize a new CallNode node from a call expression. */ @@ -2749,7 +2751,11 @@ pm_call_node_call_create(pm_parser_t *parser, pm_node_t *receiver, pm_token_t *o pm_node_flag_set((pm_node_t *)node, PM_CALL_NODE_FLAGS_SAFE_NAVIGATION); } - node->name = pm_parser_constant_id_token(parser, message); + /** + * If the final character is `@` as is the case for `foo.~@`, + * we should ignore the @ in the same way we do for symbols. + */ + node->name = pm_parser_constant_id_location(parser, message->start, parse_operator_symbol_name(message)); return node; } @@ -19702,7 +19708,7 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b pm_parser_scope_pop(parser); /** - * If the final character is @. As is the case when defining + * If the final character is `@` as is the case when defining * methods to override the unary operators, we should ignore * the @ in the same way we do for symbols. */ diff --git a/test/prism/fixtures/unary_method_calls.txt b/test/prism/fixtures/unary_method_calls.txt new file mode 100644 index 0000000000..dda85e4bdb --- /dev/null +++ b/test/prism/fixtures/unary_method_calls.txt @@ -0,0 +1,2 @@ +42.~@ +42.!@ diff --git a/test/prism/ruby/parser_test.rb b/test/prism/ruby/parser_test.rb index 016fda91f0..3104369d3e 100644 --- a/test/prism/ruby/parser_test.rb +++ b/test/prism/ruby/parser_test.rb @@ -109,6 +109,9 @@ class ParserTest < TestCase # Regex with \c escape "unescaping.txt", "seattlerb/regexp_esc_C_slash.txt", + + # https://github.com/whitequark/parser/issues/1084 + "unary_method_calls.txt", ] # These files are failing to translate their lexer output into the lexer diff --git a/test/prism/ruby/ruby_parser_test.rb b/test/prism/ruby/ruby_parser_test.rb index 7640ddaf1c..42a888be82 100644 --- a/test/prism/ruby/ruby_parser_test.rb +++ b/test/prism/ruby/ruby_parser_test.rb @@ -57,6 +57,7 @@ class RubyParserTest < TestCase "spanning_heredoc.txt", "symbols.txt", "tilde_heredocs.txt", + "unary_method_calls.txt", "unparser/corpus/literal/literal.txt", "while.txt", "whitequark/cond_eflipflop.txt", From 51855ce8a05a356ac1f2a7c94563952e5e87e93c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 27 Oct 2025 16:28:53 +0000 Subject: [PATCH 190/333] Bump the action-deps group with 2 updates Bumps the action-deps group with 2 updates: [actions/upload-artifact](https://github.com/actions/upload-artifact) and [actions/download-artifact](https://github.com/actions/download-artifact). Updates `actions/upload-artifact` from 4 to 5 - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](https://github.com/actions/upload-artifact/compare/v4...v5) Updates `actions/download-artifact` from 5 to 6 - [Release notes](https://github.com/actions/download-artifact/releases) - [Commits](https://github.com/actions/download-artifact/compare/v5...v6) --- updated-dependencies: - dependency-name: actions/upload-artifact dependency-version: '5' dependency-type: direct:production update-type: version-update:semver-major dependency-group: action-deps - dependency-name: actions/download-artifact dependency-version: '6' dependency-type: direct:production update-type: version-update:semver-major dependency-group: action-deps ... Signed-off-by: dependabot[bot] --- .github/workflows/java-wasm-bindings.yml | 2 +- .github/workflows/javascript-bindings.yml | 2 +- .github/workflows/main.yml | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/java-wasm-bindings.yml b/.github/workflows/java-wasm-bindings.yml index 4b863702eb..983f4cd916 100644 --- a/.github/workflows/java-wasm-bindings.yml +++ b/.github/workflows/java-wasm-bindings.yml @@ -45,7 +45,7 @@ jobs: run: mvn -B install working-directory: java-wasm - - uses: actions/upload-artifact@v4 + - uses: actions/upload-artifact@v5 with: name: prism.wasm path: java-wasm/src/test/resources/prism.wasm diff --git a/.github/workflows/javascript-bindings.yml b/.github/workflows/javascript-bindings.yml index c8d68e6550..2828fcf0f1 100644 --- a/.github/workflows/javascript-bindings.yml +++ b/.github/workflows/javascript-bindings.yml @@ -34,7 +34,7 @@ jobs: - name: Build the project run: make wasm WASI_SDK_PATH=$(pwd)/wasi-sdk-25.0-x86_64-linux - - uses: actions/upload-artifact@v4 + - uses: actions/upload-artifact@v5 with: name: prism.wasm path: javascript/src/prism.wasm diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ec5e14564d..dd92070b10 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -257,7 +257,7 @@ jobs: bundler-cache: true - run: bundle config --local frozen false - run: bundle exec rake build:dev - - uses: actions/upload-artifact@v4 + - uses: actions/upload-artifact@v5 with: name: gem-package path: pkg @@ -305,7 +305,7 @@ jobs: - uses: ruby/setup-ruby@v1 with: ruby-version: ${{ matrix.target.ruby }} - - uses: actions/download-artifact@v5 + - uses: actions/download-artifact@v6 with: name: gem-package path: pkg From f2131c14df2ae2d8595afa233212419ed49a6dd3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 27 Oct 2025 16:30:01 +0000 Subject: [PATCH 191/333] Bump the ruby-deps group across 10 directories with 2 updates Bumps the ruby-deps group with 1 update in the /gemfiles/2.7 directory: [parser](https://github.com/whitequark/parser). Bumps the ruby-deps group with 1 update in the /gemfiles/3.0 directory: [parser](https://github.com/whitequark/parser). Bumps the ruby-deps group with 1 update in the /gemfiles/3.1 directory: [parser](https://github.com/whitequark/parser). Bumps the ruby-deps group with 1 update in the /gemfiles/3.2 directory: [parser](https://github.com/whitequark/parser). Bumps the ruby-deps group with 1 update in the /gemfiles/3.3 directory: [parser](https://github.com/whitequark/parser). Bumps the ruby-deps group with 1 update in the /gemfiles/3.4 directory: [parser](https://github.com/whitequark/parser). Bumps the ruby-deps group with 1 update in the /gemfiles/3.5 directory: [parser](https://github.com/whitequark/parser). Bumps the ruby-deps group with 1 update in the /gemfiles/jruby directory: [parser](https://github.com/whitequark/parser). Bumps the ruby-deps group with 1 update in the /gemfiles/truffleruby directory: [parser](https://github.com/whitequark/parser). Bumps the ruby-deps group with 2 updates in the /gemfiles/typecheck directory: [parser](https://github.com/whitequark/parser) and [sorbet](https://github.com/sorbet/sorbet). Updates `parser` from 3.3.9.0 to 3.3.10.0 - [Changelog](https://github.com/whitequark/parser/blob/master/CHANGELOG.md) - [Commits](https://github.com/whitequark/parser/compare/v3.3.9.0...v3.3.10.0) Updates `parser` from 3.3.9.0 to 3.3.10.0 - [Changelog](https://github.com/whitequark/parser/blob/master/CHANGELOG.md) - [Commits](https://github.com/whitequark/parser/compare/v3.3.9.0...v3.3.10.0) Updates `parser` from 3.3.9.0 to 3.3.10.0 - [Changelog](https://github.com/whitequark/parser/blob/master/CHANGELOG.md) - [Commits](https://github.com/whitequark/parser/compare/v3.3.9.0...v3.3.10.0) Updates `parser` from 3.3.9.0 to 3.3.10.0 - [Changelog](https://github.com/whitequark/parser/blob/master/CHANGELOG.md) - [Commits](https://github.com/whitequark/parser/compare/v3.3.9.0...v3.3.10.0) Updates `parser` from 3.3.9.0 to 3.3.10.0 - [Changelog](https://github.com/whitequark/parser/blob/master/CHANGELOG.md) - [Commits](https://github.com/whitequark/parser/compare/v3.3.9.0...v3.3.10.0) Updates `parser` from 3.3.9.0 to 3.3.10.0 - [Changelog](https://github.com/whitequark/parser/blob/master/CHANGELOG.md) - [Commits](https://github.com/whitequark/parser/compare/v3.3.9.0...v3.3.10.0) Updates `parser` from 3.3.9.0 to 3.3.10.0 - [Changelog](https://github.com/whitequark/parser/blob/master/CHANGELOG.md) - [Commits](https://github.com/whitequark/parser/compare/v3.3.9.0...v3.3.10.0) Updates `parser` from 3.3.9.0 to 3.3.10.0 - [Changelog](https://github.com/whitequark/parser/blob/master/CHANGELOG.md) - [Commits](https://github.com/whitequark/parser/compare/v3.3.9.0...v3.3.10.0) Updates `parser` from 3.3.9.0 to 3.3.10.0 - [Changelog](https://github.com/whitequark/parser/blob/master/CHANGELOG.md) - [Commits](https://github.com/whitequark/parser/compare/v3.3.9.0...v3.3.10.0) Updates `parser` from 3.3.9.0 to 3.3.10.0 - [Changelog](https://github.com/whitequark/parser/blob/master/CHANGELOG.md) - [Commits](https://github.com/whitequark/parser/compare/v3.3.9.0...v3.3.10.0) Updates `sorbet` from 0.6.12650 to 0.6.12666 - [Release notes](https://github.com/sorbet/sorbet/releases) - [Commits](https://github.com/sorbet/sorbet/commits) --- updated-dependencies: - dependency-name: parser dependency-version: 3.3.10.0 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps - dependency-name: parser dependency-version: 3.3.10.0 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps - dependency-name: parser dependency-version: 3.3.10.0 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps - dependency-name: parser dependency-version: 3.3.10.0 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps - dependency-name: parser dependency-version: 3.3.10.0 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps - dependency-name: parser dependency-version: 3.3.10.0 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps - dependency-name: parser dependency-version: 3.3.10.0 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps - dependency-name: parser dependency-version: 3.3.10.0 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps - dependency-name: parser dependency-version: 3.3.10.0 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps - dependency-name: parser dependency-version: 3.3.10.0 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps - dependency-name: sorbet dependency-version: 0.6.12666 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps ... Signed-off-by: dependabot[bot] --- 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/3.5/Gemfile.lock | 2 +- gemfiles/jruby/Gemfile.lock | 2 +- gemfiles/truffleruby/Gemfile.lock | 2 +- gemfiles/typecheck/Gemfile.lock | 18 +++++++++--------- 10 files changed, 18 insertions(+), 18 deletions(-) diff --git a/gemfiles/2.7/Gemfile.lock b/gemfiles/2.7/Gemfile.lock index 1b21359158..3f3721a02e 100644 --- a/gemfiles/2.7/Gemfile.lock +++ b/gemfiles/2.7/Gemfile.lock @@ -8,7 +8,7 @@ GEM specs: ast (2.4.3) onigmo (0.1.0) - parser (3.3.9.0) + parser (3.3.10.0) ast (~> 2.4.1) racc power_assert (2.0.5) diff --git a/gemfiles/3.0/Gemfile.lock b/gemfiles/3.0/Gemfile.lock index 20fb203a12..b7ba30c5d5 100644 --- a/gemfiles/3.0/Gemfile.lock +++ b/gemfiles/3.0/Gemfile.lock @@ -13,7 +13,7 @@ GEM mini_portile2 (~> 2.8.2) racc (~> 1.4) onigmo (0.1.0) - parser (3.3.9.0) + parser (3.3.10.0) ast (~> 2.4.1) racc power_assert (2.0.5) diff --git a/gemfiles/3.1/Gemfile.lock b/gemfiles/3.1/Gemfile.lock index f38e75df4d..59a4a85d4c 100644 --- a/gemfiles/3.1/Gemfile.lock +++ b/gemfiles/3.1/Gemfile.lock @@ -13,7 +13,7 @@ GEM mini_portile2 (~> 2.8.2) racc (~> 1.4) onigmo (0.1.0) - parser (3.3.9.0) + parser (3.3.10.0) ast (~> 2.4.1) racc power_assert (2.0.5) diff --git a/gemfiles/3.2/Gemfile.lock b/gemfiles/3.2/Gemfile.lock index 0215cd8eff..e7623d1283 100644 --- a/gemfiles/3.2/Gemfile.lock +++ b/gemfiles/3.2/Gemfile.lock @@ -13,7 +13,7 @@ GEM mini_portile2 (~> 2.8.2) racc (~> 1.4) onigmo (0.1.0) - parser (3.3.9.0) + parser (3.3.10.0) ast (~> 2.4.1) racc power_assert (2.0.5) diff --git a/gemfiles/3.3/Gemfile.lock b/gemfiles/3.3/Gemfile.lock index d2e2ea06ef..2122476dc0 100644 --- a/gemfiles/3.3/Gemfile.lock +++ b/gemfiles/3.3/Gemfile.lock @@ -13,7 +13,7 @@ GEM mini_portile2 (~> 2.8.2) racc (~> 1.4) onigmo (0.1.0) - parser (3.3.9.0) + parser (3.3.10.0) ast (~> 2.4.1) racc power_assert (2.0.5) diff --git a/gemfiles/3.4/Gemfile.lock b/gemfiles/3.4/Gemfile.lock index 0d67386419..65dcf86947 100644 --- a/gemfiles/3.4/Gemfile.lock +++ b/gemfiles/3.4/Gemfile.lock @@ -13,7 +13,7 @@ GEM mini_portile2 (~> 2.8.2) racc (~> 1.4) onigmo (0.1.0) - parser (3.3.9.0) + parser (3.3.10.0) ast (~> 2.4.1) racc power_assert (2.0.5) diff --git a/gemfiles/3.5/Gemfile.lock b/gemfiles/3.5/Gemfile.lock index 953068d2d5..e85a81fd5b 100644 --- a/gemfiles/3.5/Gemfile.lock +++ b/gemfiles/3.5/Gemfile.lock @@ -14,7 +14,7 @@ GEM mini_portile2 (~> 2.8.2) racc (~> 1.4) onigmo (0.1.0) - parser (3.3.9.0) + parser (3.3.10.0) ast (~> 2.4.1) racc power_assert (2.0.5) diff --git a/gemfiles/jruby/Gemfile.lock b/gemfiles/jruby/Gemfile.lock index 77fe3e8fc8..773b93930a 100644 --- a/gemfiles/jruby/Gemfile.lock +++ b/gemfiles/jruby/Gemfile.lock @@ -7,7 +7,7 @@ GEM remote: https://rubygems.org/ specs: ast (2.4.3) - parser (3.3.9.0) + parser (3.3.10.0) ast (~> 2.4.1) racc power_assert (2.0.5) diff --git a/gemfiles/truffleruby/Gemfile.lock b/gemfiles/truffleruby/Gemfile.lock index 9a34d6570a..766300f4cd 100644 --- a/gemfiles/truffleruby/Gemfile.lock +++ b/gemfiles/truffleruby/Gemfile.lock @@ -7,7 +7,7 @@ GEM remote: https://rubygems.org/ specs: ast (2.4.3) - parser (3.3.9.0) + parser (3.3.10.0) ast (~> 2.4.1) racc power_assert (2.0.5) diff --git a/gemfiles/typecheck/Gemfile.lock b/gemfiles/typecheck/Gemfile.lock index c8f1405218..5eea68d70d 100644 --- a/gemfiles/typecheck/Gemfile.lock +++ b/gemfiles/typecheck/Gemfile.lock @@ -38,7 +38,7 @@ GEM mutex_m (0.3.0) netrc (0.11.0) parallel (1.27.0) - parser (3.3.9.0) + parser (3.3.10.0) ast (~> 2.4.1) racc power_assert (2.0.5) @@ -62,14 +62,14 @@ GEM sexp_processor (~> 4.16) securerandom (0.4.1) sexp_processor (4.17.4) - sorbet (0.6.12650) - sorbet-static (= 0.6.12650) - sorbet-runtime (0.6.12650) - sorbet-static (0.6.12650-universal-darwin) - sorbet-static (0.6.12650-x86_64-linux) - sorbet-static-and-runtime (0.6.12650) - sorbet (= 0.6.12650) - sorbet-runtime (= 0.6.12650) + sorbet (0.6.12666) + sorbet-static (= 0.6.12666) + sorbet-runtime (0.6.12666) + sorbet-static (0.6.12666-universal-darwin) + sorbet-static (0.6.12666-x86_64-linux) + sorbet-static-and-runtime (0.6.12666) + sorbet (= 0.6.12666) + sorbet-runtime (= 0.6.12666) spoom (1.6.3) erubi (>= 1.10.0) prism (>= 0.28.0) From ac0d4235fca8cf333da5dce50924ba18f3ffcfd4 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Thu, 30 Oct 2025 09:19:07 -0400 Subject: [PATCH 192/333] Fix up merge issue with snapshots --- snapshots/unary_method_calls.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/snapshots/unary_method_calls.txt b/snapshots/unary_method_calls.txt index 7a3032ba0d..4f793866c5 100644 --- a/snapshots/unary_method_calls.txt +++ b/snapshots/unary_method_calls.txt @@ -17,6 +17,7 @@ │ ├── opening_loc: ∅ │ ├── arguments: ∅ │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ │ └── block: ∅ └── @ CallNode (location: (2,0)-(2,5)) ├── flags: newline @@ -30,4 +31,5 @@ ├── opening_loc: ∅ ├── arguments: ∅ ├── closing_loc: ∅ + ├── equal_loc: ∅ └── block: ∅ From 85c7def10c48d9dc8986fca9e8c99b4fcc78a608 Mon Sep 17 00:00:00 2001 From: Earlopain <14981592+Earlopain@users.noreply.github.com> Date: Fri, 31 Oct 2025 08:41:51 +0100 Subject: [PATCH 193/333] Fix clippy lint on rust 1.91 ``` Compiling ruby-prism v1.6.0 (/home/runner/work/prism/prism/rust/ruby-prism) error: implicitly cloning a `String` by calling `to_string` on its dereferenced type --> ruby-prism/build.rs:148:14 | 148 | _ => kind.to_string(), | ^^^^^^^^^^^^^^^^ help: consider using: `kind.clone()` | = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.91.0/index.html#implicit_clone = note: `-D clippy::implicit-clone` implied by `-D warnings` = help: to override `-D warnings` add `#[allow(clippy::implicit_clone)]` ``` --- rust/ruby-prism/build.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rust/ruby-prism/build.rs b/rust/ruby-prism/build.rs index e1dd0b4271..f8b8f94b96 100644 --- a/rust/ruby-prism/build.rs +++ b/rust/ruby-prism/build.rs @@ -142,10 +142,10 @@ fn struct_name(name: &str) -> String { result } -fn kind_to_type(kind: &String) -> String { - match kind.as_str() { +fn kind_to_type(kind: &str) -> String { + match kind { "non-void expression" | "pattern expression" | "Node" => String::new(), - _ => kind.to_string(), + _ => kind.to_owned(), } } From 0f19155af1731b3936effdf30379e975d2c45feb Mon Sep 17 00:00:00 2001 From: Earlopain <14981592+Earlopain@users.noreply.github.com> Date: Sat, 1 Nov 2025 16:36:00 +0100 Subject: [PATCH 194/333] Replace `serde_yaml` with `serde_json` `serde_yaml` was deprecated more than a year ago. See https://github.com/dtolnay/serde-yaml Didn't find a nice replacement that is also typed. So why not just convert it to json? --- rakelib/cargo.rake | 9 ++++++++- rust/Cargo.lock | 38 ++++---------------------------------- rust/ruby-prism/Cargo.toml | 2 +- rust/ruby-prism/build.rs | 4 ++-- 4 files changed, 15 insertions(+), 38 deletions(-) diff --git a/rakelib/cargo.rake b/rakelib/cargo.rake index c52cebba2b..cb6099582d 100644 --- a/rakelib/cargo.rake +++ b/rakelib/cargo.rake @@ -3,6 +3,9 @@ namespace :cargo do desc "Build and test the Rust packages" task build: [:templates] do + require "json" + require "yaml" + gemspec = Gem::Specification.load("prism.gemspec") prism_sys_dir = Pathname(File.expand_path(File.join(__dir__, "../rust", "ruby-prism-sys"))) @@ -18,7 +21,11 @@ namespace :cargo do rm_rf(prism_dir.join("vendor")) mkdir_p(prism_vendor_dir) - cp(File.expand_path("../config.yml", __dir__), prism_vendor_dir.join("config.yml")) + + # This used `serde_yaml` previously, which is now deprecated. Convert it to json + # so that `serde_json` can be used instead, keeping it strongly typed. + config_yaml = YAML.load_file(File.expand_path("../config.yml", __dir__)) + File.write(prism_vendor_dir.join("config.json"), JSON.dump(config_yaml)) # Align the Cargo.toml version with the gemspec version CRATES.each do |crate| diff --git a/rust/Cargo.lock b/rust/Cargo.lock index ee9187661a..e884dd43e2 100644 --- a/rust/Cargo.lock +++ b/rust/Cargo.lock @@ -78,34 +78,12 @@ version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" -[[package]] -name = "equivalent" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" - [[package]] name = "glob" version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" -[[package]] -name = "hashbrown" -version = "0.14.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" - -[[package]] -name = "indexmap" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d530e1a18b1cb4c484e6e34556a0d948706958449fca0cab753d649f2bce3d1f" -dependencies = [ - "equivalent", - "hashbrown", -] - [[package]] name = "itertools" version = "0.13.0" @@ -228,7 +206,7 @@ version = "1.6.0" dependencies = [ "ruby-prism-sys", "serde", - "serde_yaml", + "serde_json", ] [[package]] @@ -272,16 +250,14 @@ dependencies = [ ] [[package]] -name = "serde_yaml" -version = "0.9.27" +name = "serde_json" +version = "1.0.109" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3cc7a1570e38322cfe4154732e5110f887ea57e22b76f4bfd32b5bdd3368666c" +checksum = "cb0652c533506ad7a2e353cce269330d6afd8bdfb6d75e0ace5b35aacbd7b9e9" dependencies = [ - "indexmap", "itoa", "ryu", "serde", - "unsafe-libyaml", ] [[package]] @@ -307,12 +283,6 @@ version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" -[[package]] -name = "unsafe-libyaml" -version = "0.2.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab4c90930b95a82d00dc9e9ac071b4991924390d46cbd0dfe566148667605e4b" - [[package]] name = "winapi" version = "0.3.9" diff --git a/rust/ruby-prism/Cargo.toml b/rust/ruby-prism/Cargo.toml index b7c4a8ecda..2f14c62d6a 100644 --- a/rust/ruby-prism/Cargo.toml +++ b/rust/ruby-prism/Cargo.toml @@ -23,7 +23,7 @@ include = ["src/", "build.rs", "Cargo.toml", "Cargo.lock", "vendor"] [build-dependencies] serde = { version = "1.0", features = ["derive"] } -serde_yaml = "0.9" +serde_json = "1.0" [dependencies] ruby-prism-sys = { version = "1.6.0", path = "../ruby-prism-sys" } diff --git a/rust/ruby-prism/build.rs b/rust/ruby-prism/build.rs index f8b8f94b96..05cbee87d0 100644 --- a/rust/ruby-prism/build.rs +++ b/rust/ruby-prism/build.rs @@ -117,12 +117,12 @@ struct Config { /// fn main() -> Result<(), Box> { let prism_dir = format!("prism-{}", env!("CARGO_PKG_VERSION")); - let config_path = Path::new(env!("CARGO_MANIFEST_DIR")).join("vendor").join(prism_dir).join("config.yml"); + let config_path = Path::new(env!("CARGO_MANIFEST_DIR")).join("vendor").join(prism_dir).join("config.json"); let config_file = std::fs::File::open(&config_path)?; println!("cargo:rerun-if-changed={}", config_path.to_str().unwrap()); - let config: Config = serde_yaml::from_reader(config_file)?; + let config: Config = serde_json::from_reader(config_file)?; write_bindings(&config)?; Ok(()) From 9493267c1031144c7e81262918d32743ec323818 Mon Sep 17 00:00:00 2001 From: Nathan Froyd Date: Sat, 1 Nov 2025 14:36:39 -0400 Subject: [PATCH 195/333] [rust] add `size` function for `NodeList` --- rust/ruby-prism/src/lib.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/rust/ruby-prism/src/lib.rs b/rust/ruby-prism/src/lib.rs index b46121f602..684a8b6aca 100644 --- a/rust/ruby-prism/src/lib.rs +++ b/rust/ruby-prism/src/lib.rs @@ -149,6 +149,12 @@ impl<'pr> NodeList<'pr> { marker: PhantomData, } } + + /// Returns the size of the list. + #[must_use] + pub const fn size(&self) -> usize { + unsafe { self.pointer.as_ref().size } + } } impl<'pr> IntoIterator for &NodeList<'pr> { @@ -795,6 +801,7 @@ mod tests { let result = parse(source.as_ref()); let node = result.node(); + assert_eq!(node.as_program_node().unwrap().statements().body().size(), 1); let module = node.as_program_node().unwrap().statements().body().iter().next().unwrap(); let module = module.as_module_node().unwrap(); let locals = module.locals().iter().collect::>(); From fb445a49e5fe99925f57c100124ba6839044929a Mon Sep 17 00:00:00 2001 From: Earlopain <14981592+Earlopain@users.noreply.github.com> Date: Sat, 1 Nov 2025 21:45:03 +0100 Subject: [PATCH 196/333] Reject `def f a, (b) = 1` Fixes [#Bug 21660], followup to https://github.com/ruby/prism/pull/3674 Co-Authored-By: tomoya ishida --- src/prism.c | 40 ++++--------------- ...endless_method_command_call_parameters.txt | 19 +++++---- 2 files changed, 19 insertions(+), 40 deletions(-) diff --git a/src/prism.c b/src/prism.c index 6a77dd0feb..03b12e9db8 100644 --- a/src/prism.c +++ b/src/prism.c @@ -14621,18 +14621,6 @@ update_parameter_state(pm_parser_t *parser, pm_token_t *token, pm_parameters_ord return true; } -/** - * Ensures that after parsing a parameter, the next token is not `=`. - * Some parameters like `def(* = 1)` cannot become optional. When no parens - * are present like in `def * = 1`, this creates ambiguity with endless method definitions. - */ -static inline void -refute_optional_parameter(pm_parser_t *parser) { - if (match1(parser, PM_TOKEN_EQUAL)) { - pm_parser_err_previous(parser, PM_ERR_DEF_ENDLESS_PARAMETERS); - } -} - /** * Parse a list of parameters on a method definition. */ @@ -14685,10 +14673,6 @@ parse_parameters( parser->current_scope->parameters |= PM_SCOPE_PARAMETERS_FORWARDING_BLOCK; } - if (!uses_parentheses) { - refute_optional_parameter(parser); - } - pm_block_parameter_node_t *param = pm_block_parameter_node_create(parser, &name, &operator); if (repeated) { pm_node_flag_set_repeated_parameter((pm_node_t *)param); @@ -14710,10 +14694,6 @@ parse_parameters( bool succeeded = update_parameter_state(parser, &parser->current, &order); parser_lex(parser); - if (!uses_parentheses) { - refute_optional_parameter(parser); - } - parser->current_scope->parameters |= PM_SCOPE_PARAMETERS_FORWARDING_ALL; pm_forwarding_parameter_node_t *param = pm_forwarding_parameter_node_create(parser, &parser->previous); @@ -14895,10 +14875,6 @@ parse_parameters( context_pop(parser); pm_parameters_node_keywords_append(params, param); - if (!uses_parentheses) { - refute_optional_parameter(parser); - } - // If parsing the value of the parameter resulted in error recovery, // then we can put a missing node in its place and stop parsing the // parameters entirely now. @@ -14930,10 +14906,6 @@ parse_parameters( parser->current_scope->parameters |= PM_SCOPE_PARAMETERS_FORWARDING_POSITIONALS; } - if (!uses_parentheses) { - refute_optional_parameter(parser); - } - pm_node_t *param = (pm_node_t *) pm_rest_parameter_node_create(parser, &operator, &name); if (repeated) { pm_node_flag_set_repeated_parameter(param); @@ -14982,10 +14954,6 @@ parse_parameters( } } - if (!uses_parentheses) { - refute_optional_parameter(parser); - } - if (params->keyword_rest == NULL) { pm_parameters_node_keyword_rest_set(params, param); } else { @@ -19586,6 +19554,7 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b pm_token_t rparen; pm_parameters_node_t *params; + bool accept_endless_def = true; switch (parser->current.type) { case PM_TOKEN_PARENTHESIS_LEFT: { parser_lex(parser); @@ -19621,6 +19590,10 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b rparen = not_provided(parser); params = parse_parameters(parser, PM_BINDING_POWER_DEFINED, false, false, true, true, false, (uint16_t) (depth + 1)); + // Reject `def * = 1` and similar. We have to specifically check + // for them because they create ambiguity with optional arguments. + accept_endless_def = false; + context_pop(parser); break; } @@ -19642,6 +19615,9 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b if (token_is_setter_name(&name)) { pm_parser_err_token(parser, &name, PM_ERR_DEF_ENDLESS_SETTER); } + if (!accept_endless_def) { + pm_parser_err_previous(parser, PM_ERR_DEF_ENDLESS_PARAMETERS); + } equal = parser->previous; context_push(parser, PM_CONTEXT_DEF); diff --git a/test/prism/errors/endless_method_command_call_parameters.txt b/test/prism/errors/endless_method_command_call_parameters.txt index 94c4f88fc8..5dc92ce7f9 100644 --- a/test/prism/errors/endless_method_command_call_parameters.txt +++ b/test/prism/errors/endless_method_command_call_parameters.txt @@ -1,24 +1,27 @@ def f x: = 1 - ^~ could not parse the endless method parameters + ^ could not parse the endless method parameters def f ... = 1 - ^~~ could not parse the endless method parameters + ^ could not parse the endless method parameters def f * = 1 - ^ could not parse the endless method parameters + ^ could not parse the endless method parameters def f ** = 1 - ^~ could not parse the endless method parameters + ^ could not parse the endless method parameters def f & = 1 - ^ could not parse the endless method parameters + ^ could not parse the endless method parameters def f *a = 1 - ^ could not parse the endless method parameters + ^ could not parse the endless method parameters def f **a = 1 - ^ could not parse the endless method parameters + ^ could not parse the endless method parameters def f &a = 1 - ^ could not parse the endless method parameters + ^ could not parse the endless method parameters + +def f a, (b) = 1 + ^ could not parse the endless method parameters From a7f76cf546ebda1e9b4984176e5a7da04c9b032e Mon Sep 17 00:00:00 2001 From: Nathan Froyd Date: Sat, 1 Nov 2025 20:49:08 -0400 Subject: [PATCH 197/333] oops, we should call it `len` --- rust/ruby-prism/src/lib.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rust/ruby-prism/src/lib.rs b/rust/ruby-prism/src/lib.rs index 684a8b6aca..dd3dce1c4b 100644 --- a/rust/ruby-prism/src/lib.rs +++ b/rust/ruby-prism/src/lib.rs @@ -150,9 +150,9 @@ impl<'pr> NodeList<'pr> { } } - /// Returns the size of the list. + /// Returns the length of the list. #[must_use] - pub const fn size(&self) -> usize { + pub const fn len(&self) -> usize { unsafe { self.pointer.as_ref().size } } } @@ -801,7 +801,7 @@ mod tests { let result = parse(source.as_ref()); let node = result.node(); - assert_eq!(node.as_program_node().unwrap().statements().body().size(), 1); + assert_eq!(node.as_program_node().unwrap().statements().body().len(), 1); let module = node.as_program_node().unwrap().statements().body().iter().next().unwrap(); let module = module.as_module_node().unwrap(); let locals = module.locals().iter().collect::>(); From 32d4ab0ee8d6aa66af2ec7904c015634c6a9d5c9 Mon Sep 17 00:00:00 2001 From: Nathan Froyd Date: Sat, 1 Nov 2025 20:55:06 -0400 Subject: [PATCH 198/333] clippy wants `is_empty` to exist as well --- rust/ruby-prism/src/lib.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/rust/ruby-prism/src/lib.rs b/rust/ruby-prism/src/lib.rs index dd3dce1c4b..34e1517be2 100644 --- a/rust/ruby-prism/src/lib.rs +++ b/rust/ruby-prism/src/lib.rs @@ -155,6 +155,12 @@ impl<'pr> NodeList<'pr> { pub const fn len(&self) -> usize { unsafe { self.pointer.as_ref().size } } + + /// Returns whether the list is empty. + #[must_use] + pub const fn is_empty(&self) -> bool { + self.len() == 0 + } } impl<'pr> IntoIterator for &NodeList<'pr> { @@ -802,6 +808,7 @@ mod tests { let node = result.node(); assert_eq!(node.as_program_node().unwrap().statements().body().len(), 1); + assert!(!node.as_program_node().unwrap().statements().body().is_empty()); let module = node.as_program_node().unwrap().statements().body().iter().next().unwrap(); let module = module.as_module_node().unwrap(); let locals = module.locals().iter().collect::>(); From cbd34de3fc321745d482e53bc5d817e4845fdb65 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 3 Nov 2025 16:35:50 +0000 Subject: [PATCH 199/333] Bump org.junit.jupiter:junit-jupiter-engine Bumps the java-deps group in /java-wasm with 1 update: [org.junit.jupiter:junit-jupiter-engine](https://github.com/junit-team/junit-framework). Updates `org.junit.jupiter:junit-jupiter-engine` from 6.0.0 to 6.0.1 - [Release notes](https://github.com/junit-team/junit-framework/releases) - [Commits](https://github.com/junit-team/junit-framework/compare/r6.0.0...r6.0.1) --- updated-dependencies: - dependency-name: org.junit.jupiter:junit-jupiter-engine dependency-version: 6.0.1 dependency-type: direct:development update-type: version-update:semver-patch dependency-group: java-deps ... Signed-off-by: dependabot[bot] --- java-wasm/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java-wasm/pom.xml b/java-wasm/pom.xml index d09b0d9fd1..aa93898c03 100644 --- a/java-wasm/pom.xml +++ b/java-wasm/pom.xml @@ -16,7 +16,7 @@ 11 1.5.3 - 6.0.0 + 6.0.1 From 05deec695df55bb72bae8aace673dd2926729d39 Mon Sep 17 00:00:00 2001 From: Earlopain <14981592+Earlopain@users.noreply.github.com> Date: Wed, 5 Nov 2025 14:39:11 +0100 Subject: [PATCH 200/333] Change `bin/prism lex`, add `bin/prism lex_compat` * Current `bin/prism lex` becomes `bin/prism lex_compat` * Change `bin/prism lex` to only output prism tokens I sometimes find myself wanting to look at tokens but on the cli it only compares against other sources. Then I check the code and see that that `VERBOSE=1` does something but the output isn't very readable and doesn't fit on my terminal screen. The new output looks like this: ``` $ bin/prism lex -e "foo(1, BAR, baz, 'bat')" IDENTIFIER (1,0)-(1,3) "foo" PARENTHESIS_LEFT (1,3)-(1,4) "(" INTEGER (1,4)-(1,5) "1" COMMA (1,5)-(1,6) "," CONSTANT (1,7)-(1,10) "BAR" COMMA (1,10)-(1,11) "," IDENTIFIER (1,12)-(1,15) "baz" COMMA (1,15)-(1,16) "," STRING_BEGIN (1,17)-(1,18) "'" STRING_CONTENT (1,18)-(1,21) "bat" STRING_END (1,21)-(1,22) "'" PARENTHESIS_RIGHT (1,22)-(1,23) ")" EOF (1,23)-(1,23) "" ``` --- bin/prism | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/bin/prism b/bin/prism index 1817f453cb..5dfc1f4331 100755 --- a/bin/prism +++ b/bin/prism @@ -15,6 +15,7 @@ module Prism when "encoding" then encoding(argv) when "error" then error(argv) when "lex" then lex(argv) + when "lex_compat" then lex_compat(argv) when "locals" then locals(argv) when "parse" then parse(argv) when "parser" then parser(argv) @@ -31,6 +32,7 @@ module Prism bin/prism encoding [encoding] bin/prism error [name] [source] bin/prism lex [source] + bin/prism lex_compat [source] bin/prism locals [source] bin/prism parse [source] bin/prism parser [source] @@ -195,6 +197,21 @@ module Prism # bin/prism lex [source] def lex(argv) source, filepath = read_source(argv) + prism = Prism.lex(source, filepath: filepath) + max_token_type_length = prism.value.max_by { |token,| token.type.length }[0].type.length + + prism.value.each do |token,| + loc = token.location + puts(format( + "%-#{max_token_type_length + 1}s(%s,%s)-(%s,%s) %s", + token.type, loc.start_line, loc.start_column, loc.end_line, loc.end_column, token.value.inspect + )) + end + end + + # bin/prism lex_compat [source] + def lex_compat(argv) + source, filepath = read_source(argv) ripper_value = begin From 54606b8f72af116fb10c834b5ade620173c9f1b5 Mon Sep 17 00:00:00 2001 From: Earlopain <14981592+Earlopain@users.noreply.github.com> Date: Fri, 7 Nov 2025 12:55:05 +0100 Subject: [PATCH 201/333] Reverse-sync https://github.com/ruby/ruby/commit/f4e01783d3412b10f9978b5297142979cb067ce8 --- include/prism/options.h | 5 ++++- lib/prism/ffi.rb | 2 ++ src/options.c | 10 ++++++++++ test/prism/test_helper.rb | 2 +- 4 files changed, 17 insertions(+), 2 deletions(-) diff --git a/include/prism/options.h b/include/prism/options.h index 1a92c470f1..44cd745e15 100644 --- a/include/prism/options.h +++ b/include/prism/options.h @@ -94,8 +94,11 @@ typedef enum { /** The vendored version of prism in CRuby 3.5.x. */ PM_OPTIONS_VERSION_CRUBY_3_5 = 3, + /** The vendored version of prism in CRuby 4.0.x. */ + PM_OPTIONS_VERSION_CRUBY_4_0 = 4, + /** The current version of prism. */ - PM_OPTIONS_VERSION_LATEST = PM_OPTIONS_VERSION_CRUBY_3_5 + PM_OPTIONS_VERSION_LATEST = PM_OPTIONS_VERSION_CRUBY_4_0 } pm_options_version_t; /** diff --git a/lib/prism/ffi.rb b/lib/prism/ffi.rb index a3bf5786bd..f6ad6f98b1 100644 --- a/lib/prism/ffi.rb +++ b/lib/prism/ffi.rb @@ -434,6 +434,8 @@ def dump_options_version(version) 2 when /\A3\.5(\.\d+)?\z/ 3 + when /\A4\.0(\.\d+)?\z/ + 4 else if current raise CurrentVersionError, RUBY_VERSION diff --git a/src/options.c b/src/options.c index 1b5c022cf5..373d76a21f 100644 --- a/src/options.c +++ b/src/options.c @@ -93,6 +93,11 @@ pm_options_version_set(pm_options_t *options, const char *version, size_t length return true; } + if (strncmp(version, "4.0", 3) == 0) { + options->version = PM_OPTIONS_VERSION_CRUBY_4_0; + return true; + } + return false; } @@ -111,6 +116,11 @@ pm_options_version_set(pm_options_t *options, const char *version, size_t length options->version = PM_OPTIONS_VERSION_CRUBY_3_5; return true; } + + if (strncmp(version, "4.0.", 4) == 0 && is_number(version + 4, length - 4)) { + options->version = PM_OPTIONS_VERSION_CRUBY_4_0; + return true; + } } if (length >= 6) { diff --git a/test/prism/test_helper.rb b/test/prism/test_helper.rb index 84871722c9..faf6117668 100644 --- a/test/prism/test_helper.rb +++ b/test/prism/test_helper.rb @@ -230,7 +230,7 @@ def self.windows? end # All versions that prism can parse - SYNTAX_VERSIONS = %w[3.3 3.4 3.5] + SYNTAX_VERSIONS = %w[3.3 3.4 3.5 4.0] # Returns an array of ruby versions that a given filepath should test against: # test.txt # => all available versions From d0a823f0455b7e0ef18f0beea9bfece91732db8b Mon Sep 17 00:00:00 2001 From: Earlopain <14981592+Earlopain@users.noreply.github.com> Date: Fri, 7 Nov 2025 13:14:07 +0100 Subject: [PATCH 202/333] Rename Ruby 3.5 to Ruby 4.0 See https://github.com/ruby/ruby/commit/6d81969b475262aba251e99b518181bdf7c5a523 It leaves the old variant around. RuboCop for examples accesses `Prism::Translation::Parser35` to test against ruby-head. For now I left these simply as an alias --- include/prism/options.h | 4 ++-- java/org/prism/ParsingOptions.java | 3 ++- javascript/src/parsePrism.js | 2 +- lib/prism/ffi.rb | 4 +--- lib/prism/translation.rb | 1 + lib/prism/translation/parser.rb | 6 +++--- lib/prism/translation/parser35.rb | 7 +------ lib/prism/translation/parser40.rb | 13 ++++++++++++ lib/prism/translation/parser_current.rb | 4 ++-- prism.gemspec | 2 ++ rbi/prism/translation/parser35.rbi | 2 -- rbi/prism/translation/parser40.rbi | 6 ++++++ .../endless_methods_command_call.txt | 0 snapshots/{3.5 => 4.0}/leading_logical.txt | 0 src/options.c | 20 +++++-------------- src/prism.c | 8 ++++---- test/prism/api/parse_test.rb | 3 +++ .../endless_methods_command_call.txt | 0 .../fixtures/{3.5 => 4.0}/leading_logical.txt | 0 test/prism/fixtures_test.rb | 4 ++-- test/prism/lex_test.rb | 4 ++-- test/prism/locals_test.rb | 4 ++-- test/prism/ractor_test.rb | 2 +- test/prism/ruby/parser_test.rb | 7 ++++--- test/prism/ruby/ripper_test.rb | 4 ++-- test/prism/ruby/ruby_parser_test.rb | 4 ++-- test/prism/test_helper.rb | 3 ++- 27 files changed, 63 insertions(+), 54 deletions(-) create mode 100644 lib/prism/translation/parser40.rb create mode 100644 rbi/prism/translation/parser40.rbi rename snapshots/{3.5 => 4.0}/endless_methods_command_call.txt (100%) rename snapshots/{3.5 => 4.0}/leading_logical.txt (100%) rename test/prism/fixtures/{3.5 => 4.0}/endless_methods_command_call.txt (100%) rename test/prism/fixtures/{3.5 => 4.0}/leading_logical.txt (100%) diff --git a/include/prism/options.h b/include/prism/options.h index 44cd745e15..a663c9767e 100644 --- a/include/prism/options.h +++ b/include/prism/options.h @@ -91,11 +91,11 @@ typedef enum { /** The vendored version of prism in CRuby 3.4.x. */ PM_OPTIONS_VERSION_CRUBY_3_4 = 2, - /** The vendored version of prism in CRuby 3.5.x. */ + /** The vendored version of prism in CRuby 4.0.x. */ PM_OPTIONS_VERSION_CRUBY_3_5 = 3, /** The vendored version of prism in CRuby 4.0.x. */ - PM_OPTIONS_VERSION_CRUBY_4_0 = 4, + PM_OPTIONS_VERSION_CRUBY_4_0 = 3, /** The current version of prism. */ PM_OPTIONS_VERSION_LATEST = PM_OPTIONS_VERSION_CRUBY_4_0 diff --git a/java/org/prism/ParsingOptions.java b/java/org/prism/ParsingOptions.java index 4aff7dbe35..6f7a342818 100644 --- a/java/org/prism/ParsingOptions.java +++ b/java/org/prism/ParsingOptions.java @@ -15,7 +15,8 @@ public enum SyntaxVersion { LATEST(0), // Handled in pm_parser_init V3_3(1), V3_4(2), - V3_5(3); + V3_5(3), + V4_0(3); private final int value; diff --git a/javascript/src/parsePrism.js b/javascript/src/parsePrism.js index d021c63a9b..a2f0370993 100644 --- a/javascript/src/parsePrism.js +++ b/javascript/src/parsePrism.js @@ -146,7 +146,7 @@ function dumpOptions(options) { values.push(1); } else if (options.version.match(/^3\.4(\.\d+)?$/)) { values.push(2); - } else if (options.version.match(/^3\.5(\.\d+)?$/)) { + } else if (options.version.match(/^3\.5(\.\d+)?$/) || options.version.match(/^4\.0(\.\d+)?$/)) { values.push(3); } else { throw new Error(`Unsupported version '${options.version}' in compiler options`); diff --git a/lib/prism/ffi.rb b/lib/prism/ffi.rb index f6ad6f98b1..7e6103fde7 100644 --- a/lib/prism/ffi.rb +++ b/lib/prism/ffi.rb @@ -432,10 +432,8 @@ def dump_options_version(version) 1 when /\A3\.4(\.\d+)?\z/ 2 - when /\A3\.5(\.\d+)?\z/ + when /\A3\.5(\.\d+)?\z/, /\A4\.0(\.\d+)?\z/ 3 - when /\A4\.0(\.\d+)?\z/ - 4 else if current raise CurrentVersionError, RUBY_VERSION diff --git a/lib/prism/translation.rb b/lib/prism/translation.rb index d127f2006c..7933b4a722 100644 --- a/lib/prism/translation.rb +++ b/lib/prism/translation.rb @@ -10,6 +10,7 @@ module Translation # steep:ignore autoload :Parser33, "prism/translation/parser33" autoload :Parser34, "prism/translation/parser34" autoload :Parser35, "prism/translation/parser35" + autoload :Parser40, "prism/translation/parser40" autoload :Ripper, "prism/translation/ripper" autoload :RubyParser, "prism/translation/ruby_parser" end diff --git a/lib/prism/translation/parser.rb b/lib/prism/translation/parser.rb index 1ad7a193c4..23245dc383 100644 --- a/lib/prism/translation/parser.rb +++ b/lib/prism/translation/parser.rb @@ -84,7 +84,7 @@ def initialize(builder = Prism::Translation::Parser::Builder.new, parser: Prism) end def version # :nodoc: - 35 + 40 end # The default encoding for Ruby files is UTF-8. @@ -356,8 +356,8 @@ def convert_for_prism(version) "3.3.1" when 34 "3.4.0" - when 35 - "3.5.0" + when 35, 40 + "4.0.0" else "latest" end diff --git a/lib/prism/translation/parser35.rb b/lib/prism/translation/parser35.rb index 79cd59cbd9..52eeeb6c8c 100644 --- a/lib/prism/translation/parser35.rb +++ b/lib/prism/translation/parser35.rb @@ -3,11 +3,6 @@ module Prism module Translation - # This class is the entry-point for Ruby 3.5 of `Prism::Translation::Parser`. - class Parser35 < Parser - def version # :nodoc: - 35 - end - end + Parser35 = Parser40 # :nodoc: end end diff --git a/lib/prism/translation/parser40.rb b/lib/prism/translation/parser40.rb new file mode 100644 index 0000000000..2ec7445882 --- /dev/null +++ b/lib/prism/translation/parser40.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true +# :markup: markdown + +module Prism + module Translation + # This class is the entry-point for Ruby 4.0 of `Prism::Translation::Parser`. + class Parser40 < Parser + def version # :nodoc: + 40 + end + end + end +end diff --git a/lib/prism/translation/parser_current.rb b/lib/prism/translation/parser_current.rb index 1b1794abbe..76d71e9409 100644 --- a/lib/prism/translation/parser_current.rb +++ b/lib/prism/translation/parser_current.rb @@ -10,8 +10,8 @@ module Translation ParserCurrent = Parser33 when /^3\.4\./ ParserCurrent = Parser34 - when /^3\.5\./ - ParserCurrent = Parser35 + when /^3\.5\./, /^4\.0\./ + ParserCurrent = Parser40 else # Keep this in sync with released Ruby. parser = Parser34 diff --git a/prism.gemspec b/prism.gemspec index 168f8211ff..10c2eaad20 100644 --- a/prism.gemspec +++ b/prism.gemspec @@ -101,6 +101,7 @@ Gem::Specification.new do |spec| "lib/prism/translation/parser33.rb", "lib/prism/translation/parser34.rb", "lib/prism/translation/parser35.rb", + "lib/prism/translation/parser40.rb", "lib/prism/translation/parser/builder.rb", "lib/prism/translation/parser/compiler.rb", "lib/prism/translation/parser/lexer.rb", @@ -123,6 +124,7 @@ Gem::Specification.new do |spec| "rbi/prism/translation/parser33.rbi", "rbi/prism/translation/parser34.rbi", "rbi/prism/translation/parser35.rbi", + "rbi/prism/translation/parser40.rbi", "rbi/prism/translation/ripper.rbi", "rbi/prism/visitor.rbi", "sig/prism.rbs", diff --git a/rbi/prism/translation/parser35.rbi b/rbi/prism/translation/parser35.rbi index 0239fc82ad..68d44e70c6 100644 --- a/rbi/prism/translation/parser35.rbi +++ b/rbi/prism/translation/parser35.rbi @@ -1,6 +1,4 @@ # typed: strict class Prism::Translation::Parser35 < Prism::Translation::Parser - sig { override.returns(Integer) } - def version; end end diff --git a/rbi/prism/translation/parser40.rbi b/rbi/prism/translation/parser40.rbi new file mode 100644 index 0000000000..218682365b --- /dev/null +++ b/rbi/prism/translation/parser40.rbi @@ -0,0 +1,6 @@ +# typed: strict + +class Prism::Translation::Parser40 < Prism::Translation::Parser + sig { override.returns(Integer) } + def version; end +end diff --git a/snapshots/3.5/endless_methods_command_call.txt b/snapshots/4.0/endless_methods_command_call.txt similarity index 100% rename from snapshots/3.5/endless_methods_command_call.txt rename to snapshots/4.0/endless_methods_command_call.txt diff --git a/snapshots/3.5/leading_logical.txt b/snapshots/4.0/leading_logical.txt similarity index 100% rename from snapshots/3.5/leading_logical.txt rename to snapshots/4.0/leading_logical.txt diff --git a/src/options.c b/src/options.c index 373d76a21f..4a8953da7d 100644 --- a/src/options.c +++ b/src/options.c @@ -88,12 +88,7 @@ pm_options_version_set(pm_options_t *options, const char *version, size_t length return true; } - if (strncmp(version, "3.5", 3) == 0) { - options->version = PM_OPTIONS_VERSION_CRUBY_3_5; - return true; - } - - if (strncmp(version, "4.0", 3) == 0) { + if (strncmp(version, "3.5", 3) == 0 || strncmp(version, "4.0", 3) == 0) { options->version = PM_OPTIONS_VERSION_CRUBY_4_0; return true; } @@ -101,23 +96,18 @@ pm_options_version_set(pm_options_t *options, const char *version, size_t length return false; } - if (length >= 4) { - if (strncmp(version, "3.3.", 4) == 0 && is_number(version + 4, length - 4)) { + if (length >= 4 && is_number(version + 4, length - 4)) { + if (strncmp(version, "3.3.", 4) == 0) { options->version = PM_OPTIONS_VERSION_CRUBY_3_3; return true; } - if (strncmp(version, "3.4.", 4) == 0 && is_number(version + 4, length - 4)) { + if (strncmp(version, "3.4.", 4) == 0) { options->version = PM_OPTIONS_VERSION_CRUBY_3_4; return true; } - if (strncmp(version, "3.5.", 4) == 0 && is_number(version + 4, length - 4)) { - options->version = PM_OPTIONS_VERSION_CRUBY_3_5; - return true; - } - - if (strncmp(version, "4.0.", 4) == 0 && is_number(version + 4, length - 4)) { + if (strncmp(version, "3.5.", 4) == 0 || strncmp(version, "4.0.", 4) == 0) { options->version = PM_OPTIONS_VERSION_CRUBY_4_0; return true; } diff --git a/src/prism.c b/src/prism.c index 03b12e9db8..02dd2f1175 100644 --- a/src/prism.c +++ b/src/prism.c @@ -10864,11 +10864,11 @@ parser_lex(pm_parser_t *parser) { } - // If we are parsing as CRuby 3.5 or later and we + // If we are parsing as CRuby 4.0 or later and we // hit a '&&' or a '||' then we will lex the ignored // newline. if ( - (parser->version >= PM_OPTIONS_VERSION_CRUBY_3_5) && + (parser->version >= PM_OPTIONS_VERSION_CRUBY_4_0) && following && ( (peek_at(parser, following) == '&' && peek_at(parser, following + 1) == '&') || (peek_at(parser, following) == '|' && peek_at(parser, following + 1) == '|') || @@ -10915,7 +10915,7 @@ parser_lex(pm_parser_t *parser) { LEX(PM_TOKEN_AMPERSAND_DOT); } - if (parser->version >= PM_OPTIONS_VERSION_CRUBY_3_5) { + if (parser->version >= PM_OPTIONS_VERSION_CRUBY_4_0) { // If we hit an && then we are in a logical chain // and we need to return the logical operator. if (peek_at(parser, next_content) == '&' && peek_at(parser, next_content + 1) == '&') { @@ -19625,7 +19625,7 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b statements = (pm_node_t *) pm_statements_node_create(parser); bool allow_command_call; - if (parser->version >= PM_OPTIONS_VERSION_CRUBY_3_5) { + if (parser->version >= PM_OPTIONS_VERSION_CRUBY_4_0) { allow_command_call = accepts_command_call; } else { // Allow `def foo = puts "Hello"` but not `private def foo = puts "Hello"` diff --git a/test/prism/api/parse_test.rb b/test/prism/api/parse_test.rb index 1f885fa493..bb1761109f 100644 --- a/test/prism/api/parse_test.rb +++ b/test/prism/api/parse_test.rb @@ -119,6 +119,9 @@ def test_version assert Prism.parse_success?("1 + 1", version: "3.5") assert Prism.parse_success?("1 + 1", version: "3.5.0") + assert Prism.parse_success?("1 + 1", version: "4.0") + assert Prism.parse_success?("1 + 1", version: "4.0.0") + assert Prism.parse_success?("1 + 1", version: "latest") # Test edge case diff --git a/test/prism/fixtures/3.5/endless_methods_command_call.txt b/test/prism/fixtures/4.0/endless_methods_command_call.txt similarity index 100% rename from test/prism/fixtures/3.5/endless_methods_command_call.txt rename to test/prism/fixtures/4.0/endless_methods_command_call.txt diff --git a/test/prism/fixtures/3.5/leading_logical.txt b/test/prism/fixtures/4.0/leading_logical.txt similarity index 100% rename from test/prism/fixtures/3.5/leading_logical.txt rename to test/prism/fixtures/4.0/leading_logical.txt diff --git a/test/prism/fixtures_test.rb b/test/prism/fixtures_test.rb index 0f0577c10d..2aebb18477 100644 --- a/test/prism/fixtures_test.rb +++ b/test/prism/fixtures_test.rb @@ -35,8 +35,8 @@ class FixturesTest < TestCase except << "3.3-3.3/return_in_sclass.txt" # Leaving these out until they are supported by parse.y. - except << "3.5/leading_logical.txt" - except << "3.5/endless_methods_command_call.txt" + except << "4.0/leading_logical.txt" + except << "4.0/endless_methods_command_call.txt" # https://bugs.ruby-lang.org/issues/21168#note-5 except << "command_method_call_2.txt" diff --git a/test/prism/lex_test.rb b/test/prism/lex_test.rb index 9682bf8a32..19dd845d75 100644 --- a/test/prism/lex_test.rb +++ b/test/prism/lex_test.rb @@ -43,10 +43,10 @@ class LexTest < TestCase end # https://bugs.ruby-lang.org/issues/20925 - except << "3.5/leading_logical.txt" + except << "4.0/leading_logical.txt" # https://bugs.ruby-lang.org/issues/17398#note-12 - except << "3.5/endless_methods_command_call.txt" + except << "4.0/endless_methods_command_call.txt" # https://bugs.ruby-lang.org/issues/21168#note-5 except << "command_method_call_2.txt" diff --git a/test/prism/locals_test.rb b/test/prism/locals_test.rb index 439625b750..814c9a9978 100644 --- a/test/prism/locals_test.rb +++ b/test/prism/locals_test.rb @@ -38,8 +38,8 @@ class LocalsTest < TestCase "3.3-3.3/return_in_sclass.txt", # Leaving these out until they are supported by parse.y. - "3.5/leading_logical.txt", - "3.5/endless_methods_command_call.txt", + "4.0/leading_logical.txt", + "4.0/endless_methods_command_call.txt", "command_method_call_2.txt" ] diff --git a/test/prism/ractor_test.rb b/test/prism/ractor_test.rb index 6169940beb..0e008ffb08 100644 --- a/test/prism/ractor_test.rb +++ b/test/prism/ractor_test.rb @@ -64,7 +64,7 @@ def with_ractor(*arguments, &block) else ractor = ignore_warnings { Ractor.new(*arguments, &block) } - # Somewhere in the Ruby 3.5.* series, Ractor#take was removed and + # Somewhere in the Ruby 4.0.* series, Ractor#take was removed and # Ractor#value was added. puts(ractor.respond_to?(:value) ? ractor.value : ractor.take) end diff --git a/test/prism/ruby/parser_test.rb b/test/prism/ruby/parser_test.rb index 3104369d3e..1629c36b38 100644 --- a/test/prism/ruby/parser_test.rb +++ b/test/prism/ruby/parser_test.rb @@ -69,10 +69,10 @@ class ParserTest < TestCase "3.4/circular_parameters.txt", # Cannot yet handling leading logical operators. - "3.5/leading_logical.txt", + "4.0/leading_logical.txt", - # Ruby >= 3.5 specific syntax - "3.5/endless_methods_command_call.txt", + # Ruby >= 4.0 specific syntax + "4.0/endless_methods_command_call.txt", # https://bugs.ruby-lang.org/issues/21168#note-5 "command_method_call_2.txt", @@ -172,6 +172,7 @@ def test_non_prism_builder_class_deprecated if RUBY_VERSION >= "3.3" def test_current_parser_for_current_ruby major, minor = current_major_minor.split(".") + return if major == "3" && minor == "5" # TODO: Remove once ruby-dev becomes 4.0 # Let's just hope there never is a Ruby 3.10 or similar expected = major.to_i * 10 + minor.to_i assert_equal(expected, Translation::ParserCurrent.new.version) diff --git a/test/prism/ruby/ripper_test.rb b/test/prism/ruby/ripper_test.rb index 12c854aea6..400139acc0 100644 --- a/test/prism/ruby/ripper_test.rb +++ b/test/prism/ruby/ripper_test.rb @@ -9,7 +9,7 @@ class RipperTest < TestCase # Skip these tests that Ripper is reporting the wrong results for. incorrect = [ # Not yet supported. - "3.5/leading_logical.txt", + "4.0/leading_logical.txt", # Ripper incorrectly attributes the block to the keyword. "seattlerb/block_break.txt", @@ -40,7 +40,7 @@ class RipperTest < TestCase "3.4/circular_parameters.txt", # https://bugs.ruby-lang.org/issues/17398#note-12 - "3.5/endless_methods_command_call.txt", + "4.0/endless_methods_command_call.txt", # https://bugs.ruby-lang.org/issues/21168#note-5 "command_method_call_2.txt", diff --git a/test/prism/ruby/ruby_parser_test.rb b/test/prism/ruby/ruby_parser_test.rb index 42a888be82..fae5077e20 100644 --- a/test/prism/ruby/ruby_parser_test.rb +++ b/test/prism/ruby/ruby_parser_test.rb @@ -84,8 +84,8 @@ class RubyParserTest < TestCase "3.4/circular_parameters.txt", - "3.5/endless_methods_command_call.txt", - "3.5/leading_logical.txt", + "4.0/endless_methods_command_call.txt", + "4.0/leading_logical.txt", # https://bugs.ruby-lang.org/issues/21168#note-5 "command_method_call_2.txt", diff --git a/test/prism/test_helper.rb b/test/prism/test_helper.rb index faf6117668..c03f70b2cd 100644 --- a/test/prism/test_helper.rb +++ b/test/prism/test_helper.rb @@ -230,7 +230,7 @@ def self.windows? end # All versions that prism can parse - SYNTAX_VERSIONS = %w[3.3 3.4 3.5 4.0] + SYNTAX_VERSIONS = %w[3.3 3.4 4.0] # Returns an array of ruby versions that a given filepath should test against: # test.txt # => all available versions @@ -256,6 +256,7 @@ def current_major_minor if RUBY_VERSION >= "3.3.0" def test_all_syntax_versions_present + return if RUBY_VERSION.start_with?("3.5") # TODO: Remove once ruby-dev becomes 4.0 assert_include(SYNTAX_VERSIONS, current_major_minor) end end From 6da384dd0ec505c426dd53d506cd32cb8fb976e3 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Fri, 14 Nov 2025 10:51:20 +0900 Subject: [PATCH 203/333] Use `method_defined?` instead of `instance_methods.include?` While the latter creates an intermediate array of all method names including all ancestors, the former just traverse the inheritance chain and can stop if found once. --- lib/prism/polyfill/scan_byte.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/prism/polyfill/scan_byte.rb b/lib/prism/polyfill/scan_byte.rb index 2def4572c4..9276e509fc 100644 --- a/lib/prism/polyfill/scan_byte.rb +++ b/lib/prism/polyfill/scan_byte.rb @@ -3,7 +3,7 @@ require "strscan" # Polyfill for StringScanner#scan_byte, which didn't exist until Ruby 3.4. -if !(StringScanner.instance_methods.include?(:scan_byte)) +if !(StringScanner.method_defined?(:scan_byte)) StringScanner.include( Module.new { def scan_byte # :nodoc: From 9480e55be0bd1f8b2ecc41418fac4f36b00b5606 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Fri, 14 Nov 2025 08:35:12 -0500 Subject: [PATCH 204/333] Update the 3.5 Gemfile --- gemfiles/3.5/Gemfile | 2 +- gemfiles/3.5/Gemfile.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/gemfiles/3.5/Gemfile b/gemfiles/3.5/Gemfile index af835826a1..85fde92128 100644 --- a/gemfiles/3.5/Gemfile +++ b/gemfiles/3.5/Gemfile @@ -2,7 +2,7 @@ source "https://rubygems.org" -ruby "~> 3.5.0.dev" +ruby ">= 3.5.0.dev" gemspec path: "../.." diff --git a/gemfiles/3.5/Gemfile.lock b/gemfiles/3.5/Gemfile.lock index e85a81fd5b..183684b182 100644 --- a/gemfiles/3.5/Gemfile.lock +++ b/gemfiles/3.5/Gemfile.lock @@ -17,9 +17,9 @@ GEM parser (3.3.10.0) ast (~> 2.4.1) racc - power_assert (2.0.5) + power_assert (3.0.1) racc (1.8.1) - rake (13.3.0) + rake (13.3.1) rake-compiler (1.3.0) rake rbs (3.9.5) @@ -30,7 +30,7 @@ GEM racc (~> 1.5) sexp_processor (~> 4.16) sexp_processor (4.17.4) - test-unit (3.7.0) + test-unit (3.7.1) power_assert PLATFORMS @@ -52,4 +52,4 @@ RUBY VERSION ruby 3.5.0.dev BUNDLED WITH - 2.7.0.dev + 4.0.0.dev From 21b94bc6b7f833970231d1542a317e2104b2ad0f Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Fri, 14 Nov 2025 12:49:06 +0900 Subject: [PATCH 205/333] Move gemfiles for 3.5 to 4.0 --- .github/dependabot.yml | 2 +- .github/workflows/main.yml | 8 ++++---- docs/releasing.md | 4 ++-- gemfiles/{3.5 => 4.0}/Gemfile | 0 gemfiles/{3.5 => 4.0}/Gemfile.lock | 0 5 files changed, 7 insertions(+), 7 deletions(-) rename gemfiles/{3.5 => 4.0}/Gemfile (100%) rename gemfiles/{3.5 => 4.0}/Gemfile.lock (100%) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index b754ef0a8d..2bf235c924 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -24,7 +24,7 @@ updates: - '/gemfiles/3.2' - '/gemfiles/3.3' - '/gemfiles/3.4' - - '/gemfiles/3.5' + - '/gemfiles/4.0' - '/gemfiles/jruby' - '/gemfiles/truffleruby' - '/gemfiles/typecheck' diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index dd92070b10..041f6c2dab 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -104,7 +104,7 @@ jobs: fail-fast: false matrix: target: - - { ruby: "head", gemfile: "3.5" } + - { ruby: "head", gemfile: "4.0" } - { ruby: "jruby-10.0.0.0", gemfile: "jruby" } # https://github.com/jruby/jruby/issues/8923 - { ruby: "truffleruby", gemfile: "truffleruby" } runs-on: ubuntu-latest @@ -275,7 +275,7 @@ jobs: - { ruby: "3.2", os: "ubuntu-latest", gemfile: "3.2" } - { ruby: "3.3", os: "ubuntu-latest", gemfile: "3.3" } - { ruby: "3.4", os: "ubuntu-latest", gemfile: "3.4" } - - { ruby: "head", os: "ubuntu-latest", gemfile: "3.5" } + - { ruby: "head", os: "ubuntu-latest", gemfile: "4.0" } - { ruby: "jruby-10.0.0.0", os: "ubuntu-latest", gemfile: "jruby" } # https://github.com/jruby/jruby/issues/8923 - { ruby: "truffleruby", os: "ubuntu-latest", gemfile: "truffleruby" } @@ -285,7 +285,7 @@ jobs: - { ruby: "3.2", os: "macos-latest", gemfile: "3.2" } - { ruby: "3.3", os: "macos-latest", gemfile: "3.3" } - { ruby: "3.4", os: "macos-latest", gemfile: "3.4" } - - { ruby: "head", os: "macos-latest", gemfile: "3.5" } + - { ruby: "head", os: "macos-latest", gemfile: "4.0" } - { ruby: "jruby-10.0.0.0", os: "macos-latest", gemfile: "jruby" } # https://github.com/jruby/jruby/issues/8923 - { ruby: "truffleruby", os: "macos-latest", gemfile: "truffleruby" } @@ -295,7 +295,7 @@ jobs: - { ruby: "3.2", os: "windows-latest", gemfile: "3.2" } - { ruby: "3.3", os: "windows-latest", gemfile: "3.3" } - { ruby: "3.4", os: "windows-latest", gemfile: "3.4" } - - { ruby: "head", os: "windows-latest", gemfile: "3.5" } + - { ruby: "head", os: "windows-latest", gemfile: "4.0" } - { ruby: "jruby-10.0.0.0", os: "windows-latest", gemfile: "jruby" } # https://github.com/jruby/jruby/issues/8923 env: BUNDLE_GEMFILE: gemfiles/${{ matrix.target.gemfile }}/Gemfile diff --git a/docs/releasing.md b/docs/releasing.md index 426f5f1132..4af8ea847c 100644 --- a/docs/releasing.md +++ b/docs/releasing.md @@ -40,7 +40,7 @@ ruby -pi -e 'gsub(/^ruby-prism-sys = \{ version = ".+?"/, %Q{ruby-prism-sys = \{ * Update the `Gemfile.lock` file: ```sh -chruby ruby-3.5.0-dev +chruby ruby-4.0.0-dev bundle install ``` @@ -48,7 +48,7 @@ bundle install ```sh for VERSION in "2.7" "3.0" "3.1" "3.2" "3.3" "3.4"; do docker run -it --rm -v "$PWD":/usr/src/app -w /usr/src/app -e BUNDLE_GEMFILE="gemfiles/$VERSION/Gemfile" "ruby:$VERSION" bundle update; done -docker run -it --rm -v "$PWD":/usr/src/app -w /usr/src/app -e BUNDLE_GEMFILE="gemfiles/3.5/Gemfile" ruby:3.5.0-preview1 bundle update +docker run -it --rm -v "$PWD":/usr/src/app -w /usr/src/app -e BUNDLE_GEMFILE="gemfiles/4.0/Gemfile" ruby:4.0.0-preview2 bundle update docker run -it --rm -v "$PWD":/usr/src/app -w /usr/src/app -e BUNDLE_GEMFILE="gemfiles/jruby/Gemfile" jruby:latest bundle update BUNDLE_GEMFILE=gemfiles/truffleruby/Gemfile chruby-exec truffleruby -- bundle update ``` diff --git a/gemfiles/3.5/Gemfile b/gemfiles/4.0/Gemfile similarity index 100% rename from gemfiles/3.5/Gemfile rename to gemfiles/4.0/Gemfile diff --git a/gemfiles/3.5/Gemfile.lock b/gemfiles/4.0/Gemfile.lock similarity index 100% rename from gemfiles/3.5/Gemfile.lock rename to gemfiles/4.0/Gemfile.lock From 03beb718afbd716cbe2fe7c7d3328a4f2ce5ec4a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 14 Nov 2025 14:01:35 +0000 Subject: [PATCH 206/333] Bump the java-deps group in /java-wasm with 3 updates Bumps the java-deps group in /java-wasm with 3 updates: [com.dylibso.chicory:bom](https://github.com/dylibso/chicory), com.dylibso.chicory:annotations-processor and [com.dylibso.chicory:chicory-compiler-maven-plugin](https://github.com/dylibso/chicory). Updates `com.dylibso.chicory:bom` from 1.5.3 to 1.6.0 - [Release notes](https://github.com/dylibso/chicory/releases) - [Commits](https://github.com/dylibso/chicory/compare/1.5.3...1.6.0) Updates `com.dylibso.chicory:annotations-processor` from 1.5.3 to 1.6.0 Updates `com.dylibso.chicory:chicory-compiler-maven-plugin` from 1.5.3 to 1.6.0 - [Release notes](https://github.com/dylibso/chicory/releases) - [Commits](https://github.com/dylibso/chicory/compare/1.5.3...1.6.0) Updates `com.dylibso.chicory:annotations-processor` from 1.5.3 to 1.6.0 Updates `com.dylibso.chicory:chicory-compiler-maven-plugin` from 1.5.3 to 1.6.0 - [Release notes](https://github.com/dylibso/chicory/releases) - [Commits](https://github.com/dylibso/chicory/compare/1.5.3...1.6.0) --- updated-dependencies: - dependency-name: com.dylibso.chicory:bom dependency-version: 1.6.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: java-deps - dependency-name: com.dylibso.chicory:annotations-processor dependency-version: 1.6.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: java-deps - dependency-name: com.dylibso.chicory:chicory-compiler-maven-plugin dependency-version: 1.6.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: java-deps - dependency-name: com.dylibso.chicory:annotations-processor dependency-version: 1.6.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: java-deps - dependency-name: com.dylibso.chicory:chicory-compiler-maven-plugin dependency-version: 1.6.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: java-deps ... Signed-off-by: dependabot[bot] --- java-wasm/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java-wasm/pom.xml b/java-wasm/pom.xml index aa93898c03..2fb549844c 100644 --- a/java-wasm/pom.xml +++ b/java-wasm/pom.xml @@ -15,7 +15,7 @@ 11 11 - 1.5.3 + 1.6.0 6.0.1 From 74ab72bf56b784a305a5927316d60cb3cac09463 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Fri, 14 Nov 2025 09:13:13 -0500 Subject: [PATCH 207/333] Bump Ruby deps --- gemfiles/2.7/Gemfile.lock | 6 +++--- gemfiles/3.0/Gemfile.lock | 6 +++--- gemfiles/3.1/Gemfile.lock | 6 +++--- gemfiles/3.2/Gemfile.lock | 6 +++--- gemfiles/3.3/Gemfile.lock | 6 +++--- gemfiles/3.4/Gemfile.lock | 6 +++--- gemfiles/jruby/Gemfile.lock | 6 +++--- gemfiles/truffleruby/Gemfile.lock | 6 +++--- 8 files changed, 24 insertions(+), 24 deletions(-) diff --git a/gemfiles/2.7/Gemfile.lock b/gemfiles/2.7/Gemfile.lock index 3f3721a02e..e7d6f3475a 100644 --- a/gemfiles/2.7/Gemfile.lock +++ b/gemfiles/2.7/Gemfile.lock @@ -11,9 +11,9 @@ GEM parser (3.3.10.0) ast (~> 2.4.1) racc - power_assert (2.0.5) + power_assert (3.0.1) racc (1.8.1) - rake (13.3.0) + rake (13.3.1) rake-compiler (1.3.0) rake rbs (3.1.3) @@ -21,7 +21,7 @@ GEM racc (~> 1.5) sexp_processor (~> 4.16) sexp_processor (4.17.4) - test-unit (3.7.0) + test-unit (3.7.1) power_assert PLATFORMS diff --git a/gemfiles/3.0/Gemfile.lock b/gemfiles/3.0/Gemfile.lock index b7ba30c5d5..a597b0563d 100644 --- a/gemfiles/3.0/Gemfile.lock +++ b/gemfiles/3.0/Gemfile.lock @@ -16,9 +16,9 @@ GEM parser (3.3.10.0) ast (~> 2.4.1) racc - power_assert (2.0.5) + power_assert (3.0.1) racc (1.8.1) - rake (13.3.0) + rake (13.3.1) rake-compiler (1.3.0) rake rbs (3.6.1) @@ -29,7 +29,7 @@ GEM racc (~> 1.5) sexp_processor (~> 4.16) sexp_processor (4.17.4) - test-unit (3.7.0) + test-unit (3.7.1) power_assert PLATFORMS diff --git a/gemfiles/3.1/Gemfile.lock b/gemfiles/3.1/Gemfile.lock index 59a4a85d4c..a8f2eeebe3 100644 --- a/gemfiles/3.1/Gemfile.lock +++ b/gemfiles/3.1/Gemfile.lock @@ -16,9 +16,9 @@ GEM parser (3.3.10.0) ast (~> 2.4.1) racc - power_assert (2.0.5) + power_assert (3.0.1) racc (1.8.1) - rake (13.3.0) + rake (13.3.1) rake-compiler (1.3.0) rake rbs (3.9.5) @@ -29,7 +29,7 @@ GEM racc (~> 1.5) sexp_processor (~> 4.16) sexp_processor (4.17.4) - test-unit (3.7.0) + test-unit (3.7.1) power_assert PLATFORMS diff --git a/gemfiles/3.2/Gemfile.lock b/gemfiles/3.2/Gemfile.lock index e7623d1283..2b7ce78276 100644 --- a/gemfiles/3.2/Gemfile.lock +++ b/gemfiles/3.2/Gemfile.lock @@ -16,9 +16,9 @@ GEM parser (3.3.10.0) ast (~> 2.4.1) racc - power_assert (2.0.5) + power_assert (3.0.1) racc (1.8.1) - rake (13.3.0) + rake (13.3.1) rake-compiler (1.3.0) rake rbs (3.9.5) @@ -29,7 +29,7 @@ GEM racc (~> 1.5) sexp_processor (~> 4.16) sexp_processor (4.17.4) - test-unit (3.7.0) + test-unit (3.7.1) power_assert PLATFORMS diff --git a/gemfiles/3.3/Gemfile.lock b/gemfiles/3.3/Gemfile.lock index 2122476dc0..e6e8b7a016 100644 --- a/gemfiles/3.3/Gemfile.lock +++ b/gemfiles/3.3/Gemfile.lock @@ -16,9 +16,9 @@ GEM parser (3.3.10.0) ast (~> 2.4.1) racc - power_assert (2.0.5) + power_assert (3.0.1) racc (1.8.1) - rake (13.3.0) + rake (13.3.1) rake-compiler (1.3.0) rake rbs (3.9.5) @@ -29,7 +29,7 @@ GEM racc (~> 1.5) sexp_processor (~> 4.16) sexp_processor (4.17.4) - test-unit (3.7.0) + test-unit (3.7.1) power_assert PLATFORMS diff --git a/gemfiles/3.4/Gemfile.lock b/gemfiles/3.4/Gemfile.lock index 65dcf86947..c60a0edfd8 100644 --- a/gemfiles/3.4/Gemfile.lock +++ b/gemfiles/3.4/Gemfile.lock @@ -16,9 +16,9 @@ GEM parser (3.3.10.0) ast (~> 2.4.1) racc - power_assert (2.0.5) + power_assert (3.0.1) racc (1.8.1) - rake (13.3.0) + rake (13.3.1) rake-compiler (1.3.0) rake rbs (3.9.5) @@ -29,7 +29,7 @@ GEM racc (~> 1.5) sexp_processor (~> 4.16) sexp_processor (4.17.4) - test-unit (3.7.0) + test-unit (3.7.1) power_assert PLATFORMS diff --git a/gemfiles/jruby/Gemfile.lock b/gemfiles/jruby/Gemfile.lock index 773b93930a..728272f817 100644 --- a/gemfiles/jruby/Gemfile.lock +++ b/gemfiles/jruby/Gemfile.lock @@ -10,17 +10,17 @@ GEM parser (3.3.10.0) ast (~> 2.4.1) racc - power_assert (2.0.5) + power_assert (3.0.1) racc (1.8.1) racc (1.8.1-java) - rake (13.3.0) + rake (13.3.1) rake-compiler (1.3.0) rake ruby_parser (3.21.1) racc (~> 1.5) sexp_processor (~> 4.16) sexp_processor (4.17.4) - test-unit (3.7.0) + test-unit (3.7.1) power_assert PLATFORMS diff --git a/gemfiles/truffleruby/Gemfile.lock b/gemfiles/truffleruby/Gemfile.lock index 766300f4cd..5cdcd67fc6 100644 --- a/gemfiles/truffleruby/Gemfile.lock +++ b/gemfiles/truffleruby/Gemfile.lock @@ -10,16 +10,16 @@ GEM parser (3.3.10.0) ast (~> 2.4.1) racc - power_assert (2.0.5) + power_assert (3.0.1) racc (1.8.1) - rake (13.3.0) + rake (13.3.1) rake-compiler (1.3.0) rake ruby_parser (3.21.1) racc (~> 1.5) sexp_processor (~> 4.16) sexp_processor (4.17.4) - test-unit (3.7.0) + test-unit (3.7.1) power_assert PLATFORMS From 74d9b6bcf997b28963e03b36498725b2cbbeb8a9 Mon Sep 17 00:00:00 2001 From: Earlopain <14981592+Earlopain@users.noreply.github.com> Date: Tue, 11 Nov 2025 10:27:50 +0100 Subject: [PATCH 208/333] Reenable windows CI that were disabled because of fiddle https://bugs.ruby-lang.org/issues/21645 --- .github/workflows/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 041f6c2dab..cf5bd28f94 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -65,7 +65,7 @@ jobs: - ubuntu-latest - ubuntu-24.04-arm - macos-latest - # - windows-latest <-- failing with fiddle error, temporarily disabled + - windows-latest runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v5 @@ -145,7 +145,7 @@ jobs: - ubuntu-latest - ubuntu-24.04-arm - macos-latest - # - windows-latest <-- failing with fiddle error, temporarily disabled + - windows-latest runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v5 From 878cd2916ed2a43d1733f1ba42cf40076a3a19e3 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Fri, 14 Nov 2025 09:17:14 -0500 Subject: [PATCH 209/333] Bump ruby deps for typecheck --- gemfiles/typecheck/Gemfile | 2 +- gemfiles/typecheck/Gemfile.lock | 28 ++++++++++++++-------------- rakelib/typecheck.rake | 14 -------------- 3 files changed, 15 insertions(+), 29 deletions(-) diff --git a/gemfiles/typecheck/Gemfile b/gemfiles/typecheck/Gemfile index 906239ced5..b535d28729 100644 --- a/gemfiles/typecheck/Gemfile +++ b/gemfiles/typecheck/Gemfile @@ -8,7 +8,7 @@ gem "rake-compiler" gem "rake" gem "rbs" gem "ruby_parser" -gem "sorbet" +gem "sorbet", "<= 0.6.12666" # until tapioca is bumped gem "steep", ">= 1.7.0.dev.1" gem "tapioca" gem "test-unit" diff --git a/gemfiles/typecheck/Gemfile.lock b/gemfiles/typecheck/Gemfile.lock index 5eea68d70d..7968ff0b2b 100644 --- a/gemfiles/typecheck/Gemfile.lock +++ b/gemfiles/typecheck/Gemfile.lock @@ -1,14 +1,14 @@ GEM remote: https://rubygems.org/ specs: - activesupport (8.0.3) + activesupport (8.1.1) base64 - benchmark (>= 0.3) bigdecimal concurrent-ruby (~> 1.0, >= 1.3.1) connection_pool (>= 2.2.5) drb i18n (>= 1.6, < 2) + json logger (>= 1.4.2) minitest (>= 5.1) securerandom (>= 0.3) @@ -16,8 +16,8 @@ GEM uri (>= 0.13.1) ast (2.4.3) base64 (0.3.0) - benchmark (0.4.1) - bigdecimal (3.3.0) + benchmark (0.5.0) + bigdecimal (3.3.1) concurrent-ruby (1.3.5) connection_pool (2.5.4) csv (3.3.5) @@ -25,33 +25,33 @@ GEM erubi (1.13.1) ffi (1.17.2-arm64-darwin) ffi (1.17.2-x86_64-linux-gnu) - fileutils (1.7.3) + fileutils (1.8.0) i18n (1.14.7) concurrent-ruby (~> 1.0) - json (2.15.1) + json (2.16.0) language_server-protocol (3.17.0.5) listen (3.9.0) rb-fsevent (~> 0.10, >= 0.10.3) rb-inotify (~> 0.9, >= 0.9.10) logger (1.7.0) - minitest (5.26.0) + minitest (5.26.1) mutex_m (0.3.0) netrc (0.11.0) parallel (1.27.0) parser (3.3.10.0) ast (~> 2.4.1) racc - power_assert (2.0.5) - prism (1.5.1) + power_assert (3.0.1) + prism (1.6.0) racc (1.8.1) rainbow (3.1.1) - rake (13.3.0) + rake (13.3.1) rake-compiler (1.3.0) rake rb-fsevent (0.11.2) rb-inotify (0.11.1) ffi (~> 1.0) - rbi (0.3.6) + rbi (0.3.7) prism (~> 1.0) rbs (>= 3.4.4) rbs (3.9.5) @@ -107,7 +107,7 @@ GEM yard-sorbet terminal-table (4.0.0) unicode-display_width (>= 1.1.1, < 4) - test-unit (3.7.0) + test-unit (3.7.1) power_assert thor (1.4.0) tzinfo (2.0.6) @@ -115,7 +115,7 @@ GEM unicode-display_width (3.2.0) unicode-emoji (~> 4.1) unicode-emoji (4.1.0) - uri (1.0.4) + uri (1.1.1) yard (0.9.37) yard-sorbet (0.9.0) sorbet-runtime @@ -132,7 +132,7 @@ DEPENDENCIES rake-compiler rbs ruby_parser - sorbet + sorbet (<= 0.6.12666) steep (>= 1.7.0.dev.1) tapioca test-unit diff --git a/rakelib/typecheck.rake b/rakelib/typecheck.rake index 497282d6f0..4f3fb1684e 100644 --- a/rakelib/typecheck.rake +++ b/rakelib/typecheck.rake @@ -4,20 +4,6 @@ namespace :typecheck do task tapioca: :templates do Rake::Task["compile:prism"].invoke - # Yard crashes parsing steep, which is all run because of tapioca. So to - # avoid this, we're going to monkey patch yard to ignore these kinds of - # crashes so tapioca can keep running. - require "yard" - YARD.singleton_class.prepend( - Module.new do - def parse(*args, **kwargs) - super - rescue RangeError - [] - end - end - ) - require "tapioca/internal" Tapioca::Cli.start(["configure"]) Tapioca::Cli.start(["gems", "--exclude", "prism"]) From 86120ae1fc7ed084dca40d4ba5ec5f77ff329b86 Mon Sep 17 00:00:00 2001 From: Koichi ITO Date: Fri, 14 Nov 2025 23:26:36 +0900 Subject: [PATCH 210/333] Bump `bin/prism bundle` to Ruby 4.0 `gemfiles/3.5/Gemfile` has been updated to `gemfiles/4.0/Gemfile` by #3715. --- bin/prism | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/prism b/bin/prism index 5dfc1f4331..b6301b3dd9 100755 --- a/bin/prism +++ b/bin/prism @@ -99,7 +99,7 @@ module Prism ["3.2", ["3.2"]], ["3.3", ["3.3"]], ["3.4", ["3.4", "typecheck"]], - ["3.5", ["3.5"]], + ["4.0", ["4.0"]], ["jruby", ["jruby"]], ["truffleruby", ["truffleruby"]] ].each do |ruby_version, gemfiles| From 475fa46a82f4747e94e0f506a846dd690d92c6a9 Mon Sep 17 00:00:00 2001 From: Earlopain <14981592+Earlopain@users.noreply.github.com> Date: Mon, 3 Nov 2025 12:24:38 +0100 Subject: [PATCH 211/333] Reject endless method as a block parameter default Fixes [Bug #21661] --- config.yml | 5 +- include/prism/parser.h | 3 + snapshots/endless_method_as_default_arg.txt | 323 ++++++++++++++++++ src/prism.c | 18 + templates/src/diagnostic.c.erb | 1 + .../errors/block_args_with_endless_def.txt | 5 + .../endless_method_as_default_arg.txt | 11 + 7 files changed, 364 insertions(+), 2 deletions(-) create mode 100644 snapshots/endless_method_as_default_arg.txt create mode 100644 test/prism/errors/block_args_with_endless_def.txt create mode 100644 test/prism/fixtures/endless_method_as_default_arg.txt diff --git a/config.yml b/config.yml index 7d71d52de4..4a160aa9cd 100644 --- a/config.yml +++ b/config.yml @@ -280,6 +280,7 @@ errors: - UNEXPECTED_INDEX_KEYWORDS - UNEXPECTED_LABEL - UNEXPECTED_MULTI_WRITE + - UNEXPECTED_PARAMETER_DEFAULT_VALUE - UNEXPECTED_RANGE_OPERATOR - UNEXPECTED_SAFE_NAVIGATION - UNEXPECTED_TOKEN_CLOSE_CONTEXT @@ -356,6 +357,8 @@ tokens: comment: "a newline character outside of other tokens" - name: PARENTHESIS_RIGHT comment: ")" + - name: PIPE + comment: "|" - name: SEMICOLON comment: ";" # Tokens from here on are not used for lookup, and can be in any order. @@ -589,8 +592,6 @@ tokens: comment: "%I" - name: PERCENT_UPPER_W comment: "%W" - - name: PIPE - comment: "|" - name: PIPE_EQUAL comment: "|=" - name: PIPE_PIPE diff --git a/include/prism/parser.h b/include/prism/parser.h index 992729d655..95d7aac710 100644 --- a/include/prism/parser.h +++ b/include/prism/parser.h @@ -299,6 +299,9 @@ typedef enum { /** a rescue else statement within a do..end block */ PM_CONTEXT_BLOCK_ELSE, + /** expressions in block parameters `foo do |...| end ` */ + PM_CONTEXT_BLOCK_PARAMETERS, + /** a rescue statement within a do..end block */ PM_CONTEXT_BLOCK_RESCUE, diff --git a/snapshots/endless_method_as_default_arg.txt b/snapshots/endless_method_as_default_arg.txt new file mode 100644 index 0000000000..ad7d09b396 --- /dev/null +++ b/snapshots/endless_method_as_default_arg.txt @@ -0,0 +1,323 @@ +@ ProgramNode (location: (1,0)-(11,20)) +├── flags: ∅ +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(11,20)) + ├── flags: ∅ + └── body: (length: 6) + ├── @ DefNode (location: (1,0)-(1,27)) + │ ├── flags: newline + │ ├── name: :foo + │ ├── name_loc: (1,4)-(1,7) = "foo" + │ ├── receiver: ∅ + │ ├── parameters: + │ │ @ ParametersNode (location: (1,8)-(1,21)) + │ │ ├── flags: ∅ + │ │ ├── requireds: (length: 0) + │ │ ├── optionals: (length: 1) + │ │ │ └── @ OptionalParameterNode (location: (1,8)-(1,21)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :a + │ │ │ ├── name_loc: (1,8)-(1,9) = "a" + │ │ │ ├── operator_loc: (1,10)-(1,11) = "=" + │ │ │ └── value: + │ │ │ @ DefNode (location: (1,12)-(1,21)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :f + │ │ │ ├── name_loc: (1,16)-(1,17) = "f" + │ │ │ ├── receiver: ∅ + │ │ │ ├── parameters: ∅ + │ │ │ ├── body: + │ │ │ │ @ StatementsNode (location: (1,20)-(1,21)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ IntegerNode (location: (1,20)-(1,21)) + │ │ │ │ ├── flags: static_literal, decimal + │ │ │ │ └── value: 1 + │ │ │ ├── locals: [] + │ │ │ ├── def_keyword_loc: (1,12)-(1,15) = "def" + │ │ │ ├── operator_loc: ∅ + │ │ │ ├── lparen_loc: ∅ + │ │ │ ├── rparen_loc: ∅ + │ │ │ ├── equal_loc: (1,18)-(1,19) = "=" + │ │ │ └── end_keyword_loc: ∅ + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── body: ∅ + │ ├── locals: [:a] + │ ├── def_keyword_loc: (1,0)-(1,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: (1,7)-(1,8) = "(" + │ ├── rparen_loc: (1,21)-(1,22) = ")" + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (1,24)-(1,27) = "end" + ├── @ DefNode (location: (3,0)-(3,30)) + │ ├── flags: newline + │ ├── name: :foo + │ ├── name_loc: (3,4)-(3,7) = "foo" + │ ├── receiver: ∅ + │ ├── parameters: + │ │ @ ParametersNode (location: (3,8)-(3,24)) + │ │ ├── flags: ∅ + │ │ ├── requireds: (length: 0) + │ │ ├── optionals: (length: 1) + │ │ │ └── @ OptionalParameterNode (location: (3,8)-(3,21)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :a + │ │ │ ├── name_loc: (3,8)-(3,9) = "a" + │ │ │ ├── operator_loc: (3,10)-(3,11) = "=" + │ │ │ └── value: + │ │ │ @ DefNode (location: (3,12)-(3,21)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :f + │ │ │ ├── name_loc: (3,16)-(3,17) = "f" + │ │ │ ├── receiver: ∅ + │ │ │ ├── parameters: ∅ + │ │ │ ├── body: + │ │ │ │ @ StatementsNode (location: (3,20)-(3,21)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ IntegerNode (location: (3,20)-(3,21)) + │ │ │ │ ├── flags: static_literal, decimal + │ │ │ │ └── value: 1 + │ │ │ ├── locals: [] + │ │ │ ├── def_keyword_loc: (3,12)-(3,15) = "def" + │ │ │ ├── operator_loc: ∅ + │ │ │ ├── lparen_loc: ∅ + │ │ │ ├── rparen_loc: ∅ + │ │ │ ├── equal_loc: (3,18)-(3,19) = "=" + │ │ │ └── end_keyword_loc: ∅ + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 1) + │ │ │ └── @ RequiredParameterNode (location: (3,23)-(3,24)) + │ │ │ ├── flags: ∅ + │ │ │ └── name: :b + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── body: ∅ + │ ├── locals: [:a, :b] + │ ├── def_keyword_loc: (3,0)-(3,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: (3,7)-(3,8) = "(" + │ ├── rparen_loc: (3,24)-(3,25) = ")" + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (3,27)-(3,30) = "end" + ├── @ DefNode (location: (5,0)-(5,30)) + │ ├── flags: newline + │ ├── name: :foo + │ ├── name_loc: (5,4)-(5,7) = "foo" + │ ├── receiver: ∅ + │ ├── parameters: + │ │ @ ParametersNode (location: (5,8)-(5,24)) + │ │ ├── flags: ∅ + │ │ ├── requireds: (length: 1) + │ │ │ └── @ RequiredParameterNode (location: (5,8)-(5,9)) + │ │ │ ├── flags: ∅ + │ │ │ └── name: :b + │ │ ├── optionals: (length: 1) + │ │ │ └── @ OptionalParameterNode (location: (5,11)-(5,24)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :a + │ │ │ ├── name_loc: (5,11)-(5,12) = "a" + │ │ │ ├── operator_loc: (5,13)-(5,14) = "=" + │ │ │ └── value: + │ │ │ @ DefNode (location: (5,15)-(5,24)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :f + │ │ │ ├── name_loc: (5,19)-(5,20) = "f" + │ │ │ ├── receiver: ∅ + │ │ │ ├── parameters: ∅ + │ │ │ ├── body: + │ │ │ │ @ StatementsNode (location: (5,23)-(5,24)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ IntegerNode (location: (5,23)-(5,24)) + │ │ │ │ ├── flags: static_literal, decimal + │ │ │ │ └── value: 1 + │ │ │ ├── locals: [] + │ │ │ ├── def_keyword_loc: (5,15)-(5,18) = "def" + │ │ │ ├── operator_loc: ∅ + │ │ │ ├── lparen_loc: ∅ + │ │ │ ├── rparen_loc: ∅ + │ │ │ ├── equal_loc: (5,21)-(5,22) = "=" + │ │ │ └── end_keyword_loc: ∅ + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── body: ∅ + │ ├── locals: [:b, :a] + │ ├── def_keyword_loc: (5,0)-(5,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: (5,7)-(5,8) = "(" + │ ├── rparen_loc: (5,24)-(5,25) = ")" + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (5,27)-(5,30) = "end" + ├── @ DefNode (location: (7,0)-(7,26)) + │ ├── flags: newline + │ ├── name: :foo + │ ├── name_loc: (7,4)-(7,7) = "foo" + │ ├── receiver: ∅ + │ ├── parameters: + │ │ @ ParametersNode (location: (7,8)-(7,20)) + │ │ ├── flags: ∅ + │ │ ├── requireds: (length: 0) + │ │ ├── optionals: (length: 0) + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 1) + │ │ │ └── @ OptionalKeywordParameterNode (location: (7,8)-(7,20)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :a + │ │ │ ├── name_loc: (7,8)-(7,10) = "a:" + │ │ │ └── value: + │ │ │ @ DefNode (location: (7,11)-(7,20)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :f + │ │ │ ├── name_loc: (7,15)-(7,16) = "f" + │ │ │ ├── receiver: ∅ + │ │ │ ├── parameters: ∅ + │ │ │ ├── body: + │ │ │ │ @ StatementsNode (location: (7,19)-(7,20)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ IntegerNode (location: (7,19)-(7,20)) + │ │ │ │ ├── flags: static_literal, decimal + │ │ │ │ └── value: 1 + │ │ │ ├── locals: [] + │ │ │ ├── def_keyword_loc: (7,11)-(7,14) = "def" + │ │ │ ├── operator_loc: ∅ + │ │ │ ├── lparen_loc: ∅ + │ │ │ ├── rparen_loc: ∅ + │ │ │ ├── equal_loc: (7,17)-(7,18) = "=" + │ │ │ └── end_keyword_loc: ∅ + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── body: ∅ + │ ├── locals: [:a] + │ ├── def_keyword_loc: (7,0)-(7,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: (7,7)-(7,8) = "(" + │ ├── rparen_loc: (7,20)-(7,21) = ")" + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (7,23)-(7,26) = "end" + ├── @ DefNode (location: (9,0)-(9,29)) + │ ├── flags: newline + │ ├── name: :foo + │ ├── name_loc: (9,4)-(9,7) = "foo" + │ ├── receiver: ∅ + │ ├── parameters: + │ │ @ ParametersNode (location: (9,8)-(9,23)) + │ │ ├── flags: ∅ + │ │ ├── requireds: (length: 0) + │ │ ├── optionals: (length: 1) + │ │ │ └── @ OptionalParameterNode (location: (9,8)-(9,23)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :a + │ │ │ ├── name_loc: (9,8)-(9,9) = "a" + │ │ │ ├── operator_loc: (9,10)-(9,11) = "=" + │ │ │ └── value: + │ │ │ @ DefNode (location: (9,12)-(9,23)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :f + │ │ │ ├── name_loc: (9,16)-(9,17) = "f" + │ │ │ ├── receiver: ∅ + │ │ │ ├── parameters: ∅ + │ │ │ ├── body: + │ │ │ │ @ StatementsNode (location: (9,20)-(9,23)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ CallNode (location: (9,20)-(9,23)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── receiver: + │ │ │ │ │ @ IntegerNode (location: (9,20)-(9,21)) + │ │ │ │ │ ├── flags: static_literal, decimal + │ │ │ │ │ └── value: 1 + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :+ + │ │ │ │ ├── message_loc: (9,21)-(9,22) = "+" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: + │ │ │ │ │ @ ArgumentsNode (location: (9,22)-(9,23)) + │ │ │ │ │ ├── flags: ∅ + │ │ │ │ │ └── arguments: (length: 1) + │ │ │ │ │ └── @ IntegerNode (location: (9,22)-(9,23)) + │ │ │ │ │ ├── flags: static_literal, decimal + │ │ │ │ │ └── value: 2 + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ ├── locals: [] + │ │ │ ├── def_keyword_loc: (9,12)-(9,15) = "def" + │ │ │ ├── operator_loc: ∅ + │ │ │ ├── lparen_loc: ∅ + │ │ │ ├── rparen_loc: ∅ + │ │ │ ├── equal_loc: (9,18)-(9,19) = "=" + │ │ │ └── end_keyword_loc: ∅ + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── body: ∅ + │ ├── locals: [:a] + │ ├── def_keyword_loc: (9,0)-(9,3) = "def" + │ ├── operator_loc: ∅ + │ ├── lparen_loc: (9,7)-(9,8) = "(" + │ ├── rparen_loc: (9,23)-(9,24) = ")" + │ ├── equal_loc: ∅ + │ └── end_keyword_loc: (9,26)-(9,29) = "end" + └── @ LambdaNode (location: (11,0)-(11,20)) + ├── flags: newline + ├── locals: [:a] + ├── operator_loc: (11,0)-(11,2) = "->" + ├── opening_loc: (11,18)-(11,19) = "{" + ├── closing_loc: (11,19)-(11,20) = "}" + ├── parameters: + │ @ BlockParametersNode (location: (11,2)-(11,17)) + │ ├── flags: ∅ + │ ├── parameters: + │ │ @ ParametersNode (location: (11,3)-(11,16)) + │ │ ├── flags: ∅ + │ │ ├── requireds: (length: 0) + │ │ ├── optionals: (length: 1) + │ │ │ └── @ OptionalParameterNode (location: (11,3)-(11,16)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :a + │ │ │ ├── name_loc: (11,3)-(11,4) = "a" + │ │ │ ├── operator_loc: (11,5)-(11,6) = "=" + │ │ │ └── value: + │ │ │ @ DefNode (location: (11,7)-(11,16)) + │ │ │ ├── flags: ∅ + │ │ │ ├── name: :f + │ │ │ ├── name_loc: (11,11)-(11,12) = "f" + │ │ │ ├── receiver: ∅ + │ │ │ ├── parameters: ∅ + │ │ │ ├── body: + │ │ │ │ @ StatementsNode (location: (11,15)-(11,16)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── body: (length: 1) + │ │ │ │ └── @ IntegerNode (location: (11,15)-(11,16)) + │ │ │ │ ├── flags: static_literal, decimal + │ │ │ │ └── value: 1 + │ │ │ ├── locals: [] + │ │ │ ├── def_keyword_loc: (11,7)-(11,10) = "def" + │ │ │ ├── operator_loc: ∅ + │ │ │ ├── lparen_loc: ∅ + │ │ │ ├── rparen_loc: ∅ + │ │ │ ├── equal_loc: (11,13)-(11,14) = "=" + │ │ │ └── end_keyword_loc: ∅ + │ │ ├── rest: ∅ + │ │ ├── posts: (length: 0) + │ │ ├── keywords: (length: 0) + │ │ ├── keyword_rest: ∅ + │ │ └── block: ∅ + │ ├── locals: (length: 0) + │ ├── opening_loc: (11,2)-(11,3) = "(" + │ └── closing_loc: (11,16)-(11,17) = ")" + └── body: ∅ diff --git a/src/prism.c b/src/prism.c index 02dd2f1175..ca94819c76 100644 --- a/src/prism.c +++ b/src/prism.c @@ -8606,6 +8606,7 @@ static const uint32_t context_terminators[] = { [PM_CONTEXT_BLOCK_KEYWORDS] = (1U << PM_TOKEN_KEYWORD_END) | (1U << PM_TOKEN_KEYWORD_RESCUE) | (1U << PM_TOKEN_KEYWORD_ENSURE), [PM_CONTEXT_BLOCK_ENSURE] = (1U << PM_TOKEN_KEYWORD_END), [PM_CONTEXT_BLOCK_ELSE] = (1U << PM_TOKEN_KEYWORD_ENSURE) | (1U << PM_TOKEN_KEYWORD_END), + [PM_CONTEXT_BLOCK_PARAMETERS] = (1U << PM_TOKEN_PIPE), [PM_CONTEXT_BLOCK_RESCUE] = (1U << PM_TOKEN_KEYWORD_ENSURE) | (1U << PM_TOKEN_KEYWORD_RESCUE) | (1U << PM_TOKEN_KEYWORD_ELSE) | (1U << PM_TOKEN_KEYWORD_END), [PM_CONTEXT_CASE_WHEN] = (1U << PM_TOKEN_KEYWORD_WHEN) | (1U << PM_TOKEN_KEYWORD_END) | (1U << PM_TOKEN_KEYWORD_ELSE), [PM_CONTEXT_CASE_IN] = (1U << PM_TOKEN_KEYWORD_IN) | (1U << PM_TOKEN_KEYWORD_END) | (1U << PM_TOKEN_KEYWORD_ELSE), @@ -8756,6 +8757,7 @@ context_human(pm_context_t context) { case PM_CONTEXT_BEGIN: return "begin statement"; case PM_CONTEXT_BLOCK_BRACES: return "'{'..'}' block"; case PM_CONTEXT_BLOCK_KEYWORDS: return "'do'..'end' block"; + case PM_CONTEXT_BLOCK_PARAMETERS: return "'|'..'|' block parameter"; case PM_CONTEXT_CASE_WHEN: return "'when' clause"; case PM_CONTEXT_CASE_IN: return "'in' clause"; case PM_CONTEXT_CLASS: return "class definition"; @@ -15357,6 +15359,9 @@ parse_block_parameters( ) { pm_parameters_node_t *parameters = NULL; if (!match1(parser, PM_TOKEN_SEMICOLON)) { + if (!is_lambda_literal) { + context_push(parser, PM_CONTEXT_BLOCK_PARAMETERS); + } parameters = parse_parameters( parser, is_lambda_literal ? PM_BINDING_POWER_DEFINED : PM_BINDING_POWER_INDEX, @@ -15367,6 +15372,9 @@ parse_block_parameters( true, (uint16_t) (depth + 1) ); + if (!is_lambda_literal) { + context_pop(parser); + } } pm_block_parameters_node_t *block_parameters = pm_block_parameters_node_create(parser, parameters, opening); @@ -15722,6 +15730,7 @@ parse_return(pm_parser_t *parser, pm_node_t *node) { case PM_CONTEXT_BLOCK_ENSURE: case PM_CONTEXT_BLOCK_KEYWORDS: case PM_CONTEXT_BLOCK_RESCUE: + case PM_CONTEXT_BLOCK_PARAMETERS: case PM_CONTEXT_DEF_ELSE: case PM_CONTEXT_DEF_ENSURE: case PM_CONTEXT_DEF_PARAMS: @@ -15758,6 +15767,7 @@ parse_block_exit(pm_parser_t *parser, pm_node_t *node) { case PM_CONTEXT_BLOCK_KEYWORDS: case PM_CONTEXT_BLOCK_ELSE: case PM_CONTEXT_BLOCK_ENSURE: + case PM_CONTEXT_BLOCK_PARAMETERS: case PM_CONTEXT_BLOCK_RESCUE: case PM_CONTEXT_DEFINED: case PM_CONTEXT_FOR: @@ -17975,6 +17985,7 @@ parse_retry(pm_parser_t *parser, const pm_node_t *node) { case PM_CONTEXT_BEGIN: case PM_CONTEXT_BLOCK_BRACES: case PM_CONTEXT_BLOCK_KEYWORDS: + case PM_CONTEXT_BLOCK_PARAMETERS: case PM_CONTEXT_CASE_IN: case PM_CONTEXT_CASE_WHEN: case PM_CONTEXT_DEFAULT_PARAMS: @@ -18055,6 +18066,7 @@ parse_yield(pm_parser_t *parser, const pm_node_t *node) { case PM_CONTEXT_BLOCK_KEYWORDS: case PM_CONTEXT_BLOCK_ELSE: case PM_CONTEXT_BLOCK_ENSURE: + case PM_CONTEXT_BLOCK_PARAMETERS: case PM_CONTEXT_BLOCK_RESCUE: case PM_CONTEXT_CASE_IN: case PM_CONTEXT_CASE_WHEN: @@ -19618,6 +19630,12 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b if (!accept_endless_def) { pm_parser_err_previous(parser, PM_ERR_DEF_ENDLESS_PARAMETERS); } + if ( + parser->current_context->context == PM_CONTEXT_DEFAULT_PARAMS && + parser->current_context->prev->context == PM_CONTEXT_BLOCK_PARAMETERS + ) { + PM_PARSER_ERR_FORMAT(parser, def_keyword.start, parser->previous.end, PM_ERR_UNEXPECTED_PARAMETER_DEFAULT_VALUE, "endless method definition"); + } equal = parser->previous; context_push(parser, PM_CONTEXT_DEF); diff --git a/templates/src/diagnostic.c.erb b/templates/src/diagnostic.c.erb index 2373253085..7c9e2e8886 100644 --- a/templates/src/diagnostic.c.erb +++ b/templates/src/diagnostic.c.erb @@ -361,6 +361,7 @@ static const pm_diagnostic_data_t diagnostic_messages[PM_DIAGNOSTIC_ID_MAX] = { [PM_ERR_UNEXPECTED_INDEX_KEYWORDS] = { "unexpected keyword arg given in index assignment; keywords are not allowed in index assignment expressions", PM_ERROR_LEVEL_SYNTAX }, [PM_ERR_UNEXPECTED_LABEL] = { "unexpected label", PM_ERROR_LEVEL_SYNTAX }, [PM_ERR_UNEXPECTED_MULTI_WRITE] = { "unexpected multiple assignment; multiple assignment is not allowed in this context", PM_ERROR_LEVEL_SYNTAX }, + [PM_ERR_UNEXPECTED_PARAMETER_DEFAULT_VALUE] = { "unexpected %s; expected a default value for a parameter", PM_ERROR_LEVEL_SYNTAX }, [PM_ERR_UNEXPECTED_RANGE_OPERATOR] = { "unexpected range operator; .. and ... are non-associative and cannot be chained", PM_ERROR_LEVEL_SYNTAX }, [PM_ERR_UNEXPECTED_SAFE_NAVIGATION] = { "&. inside multiple assignment destination", PM_ERROR_LEVEL_SYNTAX }, [PM_ERR_UNEXPECTED_TOKEN_CLOSE_CONTEXT] = { "unexpected %s, assuming it is closing the parent %s", PM_ERROR_LEVEL_SYNTAX }, diff --git a/test/prism/errors/block_args_with_endless_def.txt b/test/prism/errors/block_args_with_endless_def.txt new file mode 100644 index 0000000000..a7242160d2 --- /dev/null +++ b/test/prism/errors/block_args_with_endless_def.txt @@ -0,0 +1,5 @@ +p do |a = def f = 1; b| end + ^~~~~~~ unexpected endless method definition; expected a default value for a parameter +p do |a = def f = 1| 2; b|c end + ^~~~~~~ unexpected endless method definition; expected a default value for a parameter + diff --git a/test/prism/fixtures/endless_method_as_default_arg.txt b/test/prism/fixtures/endless_method_as_default_arg.txt new file mode 100644 index 0000000000..0063d9a8fa --- /dev/null +++ b/test/prism/fixtures/endless_method_as_default_arg.txt @@ -0,0 +1,11 @@ +def foo(a = def f = 1); end + +def foo(a = def f = 1, b); end + +def foo(b, a = def f = 1); end + +def foo(a: def f = 1); end + +def foo(a = def f = 1+2); end + +->(a = def f = 1) {} From 87dffcf14ae6785b260217ce3da2a8c61e77664c Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Fri, 14 Nov 2025 22:20:25 -0500 Subject: [PATCH 212/333] Reverse sync from upstream --- config.yml | 2 + src/prism.c | 74 +++++++++++++++-------- templates/src/diagnostic.c.erb | 2 + test/prism/result/source_location_test.rb | 2 +- 4 files changed, 53 insertions(+), 27 deletions(-) diff --git a/config.yml b/config.yml index 4a160aa9cd..b5d0e9d0b9 100644 --- a/config.yml +++ b/config.yml @@ -217,8 +217,10 @@ errors: - PARAMETER_UNEXPECTED_FWD - PARAMETER_UNEXPECTED_NO_KW - PARAMETER_WILD_LOOSE_COMMA + - PATTERN_ALTERNATIVE_AFTER_CAPTURE - PATTERN_ARRAY_MULTIPLE_RESTS - PATTERN_CAPTURE_DUPLICATE + - PATTERN_CAPTURE_IN_ALTERNATIVE - PATTERN_EXPRESSION_AFTER_BRACKET - PATTERN_EXPRESSION_AFTER_COMMA - PATTERN_EXPRESSION_AFTER_HROCKET diff --git a/src/prism.c b/src/prism.c index ca94819c76..59d602dadb 100644 --- a/src/prism.c +++ b/src/prism.c @@ -16947,6 +16947,16 @@ parse_strings(pm_parser_t *parser, pm_node_t *current, bool accepts_label, uint1 #define PM_PARSE_PATTERN_TOP 1 #define PM_PARSE_PATTERN_MULTI 2 +/** Information used to track the state of captures in patterns. */ +typedef struct { + /** Whether we're currently parsing an alternative pattern. This is used to + * disallow captures in alternative patterns. */ + bool in_alternative_pattern; + /** Whether we've seen a capture in this pattern. This is used to disallow + * captures in alternative patterns. */ + bool capture_in_pattern; +} pm_pattern_capturing_t; + static pm_node_t * parse_pattern(pm_parser_t *parser, pm_constant_id_list_t *captures, uint8_t flags, pm_diagnostic_id_t diag_id, uint16_t depth); @@ -16956,13 +16966,16 @@ parse_pattern(pm_parser_t *parser, pm_constant_id_list_t *captures, uint8_t flag * an error to the parser. */ static void -parse_pattern_capture(pm_parser_t *parser, pm_constant_id_list_t *captures, pm_constant_id_t capture, const pm_location_t *location) { +parse_pattern_capture(pm_parser_t *parser, pm_constant_id_list_t *captures, pm_constant_id_t capture, const pm_location_t *location, pm_pattern_capturing_t *capturing) { // Skip this capture if it starts with an underscore. if (*location->start == '_') return; if (pm_constant_id_list_includes(captures, capture)) { pm_parser_err(parser, location->start, location->end, PM_ERR_PATTERN_CAPTURE_DUPLICATE); + } else if (capturing->in_alternative_pattern && parser->version >= PM_OPTIONS_VERSION_CRUBY_3_5) { + pm_parser_err(parser, location->start, location->end, PM_ERR_PATTERN_CAPTURE_IN_ALTERNATIVE); } else { + capturing->capture_in_pattern = true; pm_constant_id_list_append(captures, capture); } } @@ -17091,7 +17104,7 @@ parse_pattern_constant_path(pm_parser_t *parser, pm_constant_id_list_t *captures * Parse a rest pattern. */ static pm_splat_node_t * -parse_pattern_rest(pm_parser_t *parser, pm_constant_id_list_t *captures) { +parse_pattern_rest(pm_parser_t *parser, pm_constant_id_list_t *captures, pm_pattern_capturing_t *capturing) { assert(parser->previous.type == PM_TOKEN_USTAR); pm_token_t operator = parser->previous; pm_node_t *name = NULL; @@ -17108,7 +17121,7 @@ parse_pattern_rest(pm_parser_t *parser, pm_constant_id_list_t *captures) { pm_parser_local_add(parser, constant_id, identifier.start, identifier.end, 0); } - parse_pattern_capture(parser, captures, constant_id, &PM_LOCATION_TOKEN_VALUE(&identifier)); + parse_pattern_capture(parser, captures, constant_id, &PM_LOCATION_TOKEN_VALUE(&identifier), capturing); name = (pm_node_t *) pm_local_variable_target_node_create( parser, &PM_LOCATION_TOKEN_VALUE(&identifier), @@ -17125,7 +17138,7 @@ parse_pattern_rest(pm_parser_t *parser, pm_constant_id_list_t *captures) { * Parse a keyword rest node. */ static pm_node_t * -parse_pattern_keyword_rest(pm_parser_t *parser, pm_constant_id_list_t *captures) { +parse_pattern_keyword_rest(pm_parser_t *parser, pm_constant_id_list_t *captures, pm_pattern_capturing_t *capturing) { assert(parser->current.type == PM_TOKEN_USTAR_STAR); parser_lex(parser); @@ -17144,7 +17157,7 @@ parse_pattern_keyword_rest(pm_parser_t *parser, pm_constant_id_list_t *captures) pm_parser_local_add(parser, constant_id, parser->previous.start, parser->previous.end, 0); } - parse_pattern_capture(parser, captures, constant_id, &PM_LOCATION_TOKEN_VALUE(&parser->previous)); + parse_pattern_capture(parser, captures, constant_id, &PM_LOCATION_TOKEN_VALUE(&parser->previous), capturing); value = (pm_node_t *) pm_local_variable_target_node_create( parser, &PM_LOCATION_TOKEN_VALUE(&parser->previous), @@ -17188,7 +17201,7 @@ pm_slice_is_valid_local(const pm_parser_t *parser, const uint8_t *start, const u * value. This will use an implicit local variable target. */ static pm_node_t * -parse_pattern_hash_implicit_value(pm_parser_t *parser, pm_constant_id_list_t *captures, pm_symbol_node_t *key) { +parse_pattern_hash_implicit_value(pm_parser_t *parser, pm_constant_id_list_t *captures, pm_symbol_node_t *key, pm_pattern_capturing_t *capturing) { const pm_location_t *value_loc = &((pm_symbol_node_t *) key)->value_loc; pm_constant_id_t constant_id = pm_parser_constant_id_location(parser, value_loc->start, value_loc->end); @@ -17208,7 +17221,7 @@ parse_pattern_hash_implicit_value(pm_parser_t *parser, pm_constant_id_list_t *ca pm_parser_local_add(parser, constant_id, value_loc->start, value_loc->end, 0); } - parse_pattern_capture(parser, captures, constant_id, value_loc); + parse_pattern_capture(parser, captures, constant_id, value_loc, capturing); pm_local_variable_target_node_t *target = pm_local_variable_target_node_create( parser, value_loc, @@ -17234,7 +17247,7 @@ parse_pattern_hash_key(pm_parser_t *parser, pm_static_literals_t *keys, pm_node_ * Parse a hash pattern. */ static pm_hash_pattern_node_t * -parse_pattern_hash(pm_parser_t *parser, pm_constant_id_list_t *captures, pm_node_t *first_node, uint16_t depth) { +parse_pattern_hash(pm_parser_t *parser, pm_constant_id_list_t *captures, pm_node_t *first_node, pm_pattern_capturing_t *capturing, uint16_t depth) { pm_node_list_t assocs = { 0 }; pm_static_literals_t keys = { 0 }; pm_node_t *rest = NULL; @@ -17252,7 +17265,7 @@ parse_pattern_hash(pm_parser_t *parser, pm_constant_id_list_t *captures, pm_node if (match8(parser, PM_TOKEN_COMMA, PM_TOKEN_KEYWORD_THEN, PM_TOKEN_BRACE_RIGHT, PM_TOKEN_BRACKET_RIGHT, PM_TOKEN_PARENTHESIS_RIGHT, PM_TOKEN_NEWLINE, PM_TOKEN_SEMICOLON, PM_TOKEN_EOF)) { // Otherwise, we will create an implicit local variable // target for the value. - value = parse_pattern_hash_implicit_value(parser, captures, (pm_symbol_node_t *) first_node); + value = parse_pattern_hash_implicit_value(parser, captures, (pm_symbol_node_t *) first_node, capturing); } else { // Here we have a value for the first assoc in the list, so // we will parse it now. @@ -17296,7 +17309,7 @@ parse_pattern_hash(pm_parser_t *parser, pm_constant_id_list_t *captures, pm_node } if (match1(parser, PM_TOKEN_USTAR_STAR)) { - pm_node_t *assoc = parse_pattern_keyword_rest(parser, captures); + pm_node_t *assoc = parse_pattern_keyword_rest(parser, captures, capturing); if (rest == NULL) { rest = assoc; @@ -17324,7 +17337,7 @@ parse_pattern_hash(pm_parser_t *parser, pm_constant_id_list_t *captures, pm_node pm_node_t *value = NULL; if (match7(parser, PM_TOKEN_COMMA, PM_TOKEN_KEYWORD_THEN, PM_TOKEN_BRACE_RIGHT, PM_TOKEN_BRACKET_RIGHT, PM_TOKEN_PARENTHESIS_RIGHT, PM_TOKEN_NEWLINE, PM_TOKEN_SEMICOLON)) { - value = parse_pattern_hash_implicit_value(parser, captures, (pm_symbol_node_t *) key); + value = parse_pattern_hash_implicit_value(parser, captures, (pm_symbol_node_t *) key, capturing); } else { value = parse_pattern(parser, captures, PM_PARSE_PATTERN_SINGLE, PM_ERR_PATTERN_EXPRESSION_AFTER_KEY, (uint16_t) (depth + 1)); } @@ -17351,7 +17364,7 @@ parse_pattern_hash(pm_parser_t *parser, pm_constant_id_list_t *captures, pm_node * Parse a pattern expression primitive. */ static pm_node_t * -parse_pattern_primitive(pm_parser_t *parser, pm_constant_id_list_t *captures, pm_diagnostic_id_t diag_id, uint16_t depth) { +parse_pattern_primitive(pm_parser_t *parser, pm_constant_id_list_t *captures, pm_pattern_capturing_t *capturing, pm_diagnostic_id_t diag_id, uint16_t depth) { switch (parser->current.type) { case PM_TOKEN_IDENTIFIER: case PM_TOKEN_METHOD_NAME: { @@ -17363,7 +17376,7 @@ parse_pattern_primitive(pm_parser_t *parser, pm_constant_id_list_t *captures, pm pm_parser_local_add(parser, constant_id, parser->previous.start, parser->previous.end, 0); } - parse_pattern_capture(parser, captures, constant_id, &PM_LOCATION_TOKEN_VALUE(&parser->previous)); + parse_pattern_capture(parser, captures, constant_id, &PM_LOCATION_TOKEN_VALUE(&parser->previous), capturing); return (pm_node_t *) pm_local_variable_target_node_create( parser, &PM_LOCATION_TOKEN_VALUE(&parser->previous), @@ -17447,7 +17460,7 @@ parse_pattern_primitive(pm_parser_t *parser, pm_constant_id_list_t *captures, pm first_node = (pm_node_t *) pm_symbol_node_label_create(parser, &parser->previous); break; case PM_TOKEN_USTAR_STAR: - first_node = parse_pattern_keyword_rest(parser, captures); + first_node = parse_pattern_keyword_rest(parser, captures, capturing); break; case PM_TOKEN_STRING_BEGIN: first_node = parse_expression(parser, PM_BINDING_POWER_MAX, false, true, PM_ERR_PATTERN_HASH_KEY_LABEL, (uint16_t) (depth + 1)); @@ -17461,7 +17474,7 @@ parse_pattern_primitive(pm_parser_t *parser, pm_constant_id_list_t *captures, pm } } - node = parse_pattern_hash(parser, captures, first_node, (uint16_t) (depth + 1)); + node = parse_pattern_hash(parser, captures, first_node, capturing, (uint16_t) (depth + 1)); accept1(parser, PM_TOKEN_NEWLINE); expect1(parser, PM_TOKEN_BRACE_RIGHT, PM_ERR_PATTERN_TERM_BRACE); @@ -17629,10 +17642,18 @@ parse_pattern_primitive(pm_parser_t *parser, pm_constant_id_list_t *captures, pm static pm_node_t * parse_pattern_primitives(pm_parser_t *parser, pm_constant_id_list_t *captures, pm_node_t *first_node, pm_diagnostic_id_t diag_id, uint16_t depth) { pm_node_t *node = first_node; + pm_pattern_capturing_t capturing = { false, false }; while ((node == NULL) || accept1(parser, PM_TOKEN_PIPE)) { pm_token_t operator = parser->previous; + if (node) { + if (capturing.capture_in_pattern) { + pm_parser_err(parser, operator.start, operator.end, PM_ERR_PATTERN_ALTERNATIVE_AFTER_CAPTURE); + } + capturing.in_alternative_pattern = true; + } + switch (parser->current.type) { case PM_TOKEN_IDENTIFIER: case PM_TOKEN_BRACKET_LEFT_ARRAY: @@ -17644,9 +17665,9 @@ parse_pattern_primitives(pm_parser_t *parser, pm_constant_id_list_t *captures, p case PM_TOKEN_UDOT_DOT_DOT: case PM_CASE_PRIMITIVE: { if (node == NULL) { - node = parse_pattern_primitive(parser, captures, diag_id, (uint16_t) (depth + 1)); + node = parse_pattern_primitive(parser, captures, &capturing, diag_id, (uint16_t) (depth + 1)); } else { - pm_node_t *right = parse_pattern_primitive(parser, captures, PM_ERR_PATTERN_EXPRESSION_AFTER_PIPE, (uint16_t) (depth + 1)); + pm_node_t *right = parse_pattern_primitive(parser, captures, &capturing, PM_ERR_PATTERN_EXPRESSION_AFTER_PIPE, (uint16_t) (depth + 1)); node = (pm_node_t *) pm_alternation_pattern_node_create(parser, node, right, &operator); } @@ -17698,7 +17719,7 @@ parse_pattern_primitives(pm_parser_t *parser, pm_constant_id_list_t *captures, p pm_parser_local_add(parser, constant_id, parser->previous.start, parser->previous.end, 0); } - parse_pattern_capture(parser, captures, constant_id, &PM_LOCATION_TOKEN_VALUE(&parser->previous)); + parse_pattern_capture(parser, captures, constant_id, &PM_LOCATION_TOKEN_VALUE(&parser->previous), &capturing); pm_local_variable_target_node_t *target = pm_local_variable_target_node_create( parser, &PM_LOCATION_TOKEN_VALUE(&parser->previous), @@ -17721,12 +17742,13 @@ parse_pattern(pm_parser_t *parser, pm_constant_id_list_t *captures, uint8_t flag bool leading_rest = false; bool trailing_rest = false; + pm_pattern_capturing_t capturing = { false, false }; switch (parser->current.type) { case PM_TOKEN_LABEL: { parser_lex(parser); pm_node_t *key = (pm_node_t *) pm_symbol_node_label_create(parser, &parser->previous); - node = (pm_node_t *) parse_pattern_hash(parser, captures, key, (uint16_t) (depth + 1)); + node = (pm_node_t *) parse_pattern_hash(parser, captures, key, &capturing, (uint16_t) (depth + 1)); if (!(flags & PM_PARSE_PATTERN_TOP)) { pm_parser_err_node(parser, node, PM_ERR_PATTERN_HASH_IMPLICIT); @@ -17735,8 +17757,8 @@ parse_pattern(pm_parser_t *parser, pm_constant_id_list_t *captures, uint8_t flag return node; } case PM_TOKEN_USTAR_STAR: { - node = parse_pattern_keyword_rest(parser, captures); - node = (pm_node_t *) parse_pattern_hash(parser, captures, node, (uint16_t) (depth + 1)); + node = parse_pattern_keyword_rest(parser, captures, &capturing); + node = (pm_node_t *) parse_pattern_hash(parser, captures, node, &capturing, (uint16_t) (depth + 1)); if (!(flags & PM_PARSE_PATTERN_TOP)) { pm_parser_err_node(parser, node, PM_ERR_PATTERN_HASH_IMPLICIT); @@ -17747,10 +17769,10 @@ parse_pattern(pm_parser_t *parser, pm_constant_id_list_t *captures, uint8_t flag case PM_TOKEN_STRING_BEGIN: { // We need special handling for string beginnings because they could // be dynamic symbols leading to hash patterns. - node = parse_pattern_primitive(parser, captures, diag_id, (uint16_t) (depth + 1)); + node = parse_pattern_primitive(parser, captures, &capturing, diag_id, (uint16_t) (depth + 1)); if (pm_symbol_node_label_p(node)) { - node = (pm_node_t *) parse_pattern_hash(parser, captures, node, (uint16_t) (depth + 1)); + node = (pm_node_t *) parse_pattern_hash(parser, captures, node, &capturing, (uint16_t) (depth + 1)); if (!(flags & PM_PARSE_PATTERN_TOP)) { pm_parser_err_node(parser, node, PM_ERR_PATTERN_HASH_IMPLICIT); @@ -17765,7 +17787,7 @@ parse_pattern(pm_parser_t *parser, pm_constant_id_list_t *captures, uint8_t flag case PM_TOKEN_USTAR: { if (flags & (PM_PARSE_PATTERN_TOP | PM_PARSE_PATTERN_MULTI)) { parser_lex(parser); - node = (pm_node_t *) parse_pattern_rest(parser, captures); + node = (pm_node_t *) parse_pattern_rest(parser, captures, &capturing); leading_rest = true; break; } @@ -17779,7 +17801,7 @@ parse_pattern(pm_parser_t *parser, pm_constant_id_list_t *captures, uint8_t flag // If we got a dynamic label symbol, then we need to treat it like the // beginning of a hash pattern. if (pm_symbol_node_label_p(node)) { - return (pm_node_t *) parse_pattern_hash(parser, captures, node, (uint16_t) (depth + 1)); + return (pm_node_t *) parse_pattern_hash(parser, captures, node, &capturing, (uint16_t) (depth + 1)); } if ((flags & PM_PARSE_PATTERN_MULTI) && match1(parser, PM_TOKEN_COMMA)) { @@ -17800,7 +17822,7 @@ parse_pattern(pm_parser_t *parser, pm_constant_id_list_t *captures, uint8_t flag } if (accept1(parser, PM_TOKEN_USTAR)) { - node = (pm_node_t *) parse_pattern_rest(parser, captures); + node = (pm_node_t *) parse_pattern_rest(parser, captures, &capturing); // If we have already parsed a splat pattern, then this is an // error. We will continue to parse the rest of the patterns, diff --git a/templates/src/diagnostic.c.erb b/templates/src/diagnostic.c.erb index 7c9e2e8886..87e1f341f6 100644 --- a/templates/src/diagnostic.c.erb +++ b/templates/src/diagnostic.c.erb @@ -299,8 +299,10 @@ static const pm_diagnostic_data_t diagnostic_messages[PM_DIAGNOSTIC_ID_MAX] = { [PM_ERR_PARAMETER_UNEXPECTED_FWD] = { "unexpected `...` in parameters", PM_ERROR_LEVEL_SYNTAX }, [PM_ERR_PARAMETER_WILD_LOOSE_COMMA] = { "unexpected `,` in parameters", PM_ERROR_LEVEL_SYNTAX }, [PM_ERR_PARAMETER_UNEXPECTED_NO_KW] = { "unexpected **nil; no keywords marker disallowed after keywords", PM_ERROR_LEVEL_SYNTAX }, + [PM_ERR_PATTERN_ALTERNATIVE_AFTER_CAPTURE] = { "alternative pattern after variable capture", PM_ERROR_LEVEL_SYNTAX }, [PM_ERR_PATTERN_ARRAY_MULTIPLE_RESTS] = { "unexpected multiple '*' rest patterns in an array pattern", PM_ERROR_LEVEL_SYNTAX }, [PM_ERR_PATTERN_CAPTURE_DUPLICATE] = { "duplicated variable name", PM_ERROR_LEVEL_SYNTAX }, + [PM_ERR_PATTERN_CAPTURE_IN_ALTERNATIVE] = { "variable capture in alternative pattern", PM_ERROR_LEVEL_SYNTAX }, [PM_ERR_PATTERN_EXPRESSION_AFTER_BRACKET] = { "expected a pattern expression after the `[` operator", PM_ERROR_LEVEL_SYNTAX }, [PM_ERR_PATTERN_EXPRESSION_AFTER_COMMA] = { "expected a pattern expression after `,`", PM_ERROR_LEVEL_SYNTAX }, [PM_ERR_PATTERN_EXPRESSION_AFTER_HROCKET] = { "expected a pattern expression after `=>`", PM_ERROR_LEVEL_SYNTAX }, diff --git a/test/prism/result/source_location_test.rb b/test/prism/result/source_location_test.rb index 7bdc707658..38b971d02b 100644 --- a/test/prism/result/source_location_test.rb +++ b/test/prism/result/source_location_test.rb @@ -13,7 +13,7 @@ def test_AliasMethodNode end def test_AlternationPatternNode - assert_location(AlternationPatternNode, "foo => bar | baz", 7...16, &:pattern) + assert_location(AlternationPatternNode, "foo => 0 | 1", 7...12, &:pattern) end def test_AndNode From c03e113ed423ba3e3eeb68a12dc6689597a9b8bd Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Sun, 16 Nov 2025 16:42:08 -0500 Subject: [PATCH 213/333] Revisit variable capture syntax error When we know we are in an alternation, and we know we have captured variables, add a syntax error by visiting the pattern subtree and finding the local variable target nodes and adding an error. --- config.yml | 1 - src/prism.c | 113 ++++++++++-------- templates/src/diagnostic.c.erb | 1 - .../errors/pattern-capture-in-alt-array.txt | 4 + .../errors/pattern-capture-in-alt-hash.txt | 3 + .../errors/pattern-capture-in-alt-name.txt | 3 + .../errors/pattern-capture-in-alt-top.txt | 4 + 7 files changed, 74 insertions(+), 55 deletions(-) create mode 100644 test/prism/errors/pattern-capture-in-alt-array.txt create mode 100644 test/prism/errors/pattern-capture-in-alt-hash.txt create mode 100644 test/prism/errors/pattern-capture-in-alt-name.txt create mode 100644 test/prism/errors/pattern-capture-in-alt-top.txt diff --git a/config.yml b/config.yml index b5d0e9d0b9..e57aa85044 100644 --- a/config.yml +++ b/config.yml @@ -217,7 +217,6 @@ errors: - PARAMETER_UNEXPECTED_FWD - PARAMETER_UNEXPECTED_NO_KW - PARAMETER_WILD_LOOSE_COMMA - - PATTERN_ALTERNATIVE_AFTER_CAPTURE - PATTERN_ARRAY_MULTIPLE_RESTS - PATTERN_CAPTURE_DUPLICATE - PATTERN_CAPTURE_IN_ALTERNATIVE diff --git a/src/prism.c b/src/prism.c index 59d602dadb..a87932f1b7 100644 --- a/src/prism.c +++ b/src/prism.c @@ -16947,16 +16947,6 @@ parse_strings(pm_parser_t *parser, pm_node_t *current, bool accepts_label, uint1 #define PM_PARSE_PATTERN_TOP 1 #define PM_PARSE_PATTERN_MULTI 2 -/** Information used to track the state of captures in patterns. */ -typedef struct { - /** Whether we're currently parsing an alternative pattern. This is used to - * disallow captures in alternative patterns. */ - bool in_alternative_pattern; - /** Whether we've seen a capture in this pattern. This is used to disallow - * captures in alternative patterns. */ - bool capture_in_pattern; -} pm_pattern_capturing_t; - static pm_node_t * parse_pattern(pm_parser_t *parser, pm_constant_id_list_t *captures, uint8_t flags, pm_diagnostic_id_t diag_id, uint16_t depth); @@ -16966,16 +16956,13 @@ parse_pattern(pm_parser_t *parser, pm_constant_id_list_t *captures, uint8_t flag * an error to the parser. */ static void -parse_pattern_capture(pm_parser_t *parser, pm_constant_id_list_t *captures, pm_constant_id_t capture, const pm_location_t *location, pm_pattern_capturing_t *capturing) { +parse_pattern_capture(pm_parser_t *parser, pm_constant_id_list_t *captures, pm_constant_id_t capture, const pm_location_t *location) { // Skip this capture if it starts with an underscore. if (*location->start == '_') return; if (pm_constant_id_list_includes(captures, capture)) { pm_parser_err(parser, location->start, location->end, PM_ERR_PATTERN_CAPTURE_DUPLICATE); - } else if (capturing->in_alternative_pattern && parser->version >= PM_OPTIONS_VERSION_CRUBY_3_5) { - pm_parser_err(parser, location->start, location->end, PM_ERR_PATTERN_CAPTURE_IN_ALTERNATIVE); } else { - capturing->capture_in_pattern = true; pm_constant_id_list_append(captures, capture); } } @@ -17104,7 +17091,7 @@ parse_pattern_constant_path(pm_parser_t *parser, pm_constant_id_list_t *captures * Parse a rest pattern. */ static pm_splat_node_t * -parse_pattern_rest(pm_parser_t *parser, pm_constant_id_list_t *captures, pm_pattern_capturing_t *capturing) { +parse_pattern_rest(pm_parser_t *parser, pm_constant_id_list_t *captures) { assert(parser->previous.type == PM_TOKEN_USTAR); pm_token_t operator = parser->previous; pm_node_t *name = NULL; @@ -17121,7 +17108,7 @@ parse_pattern_rest(pm_parser_t *parser, pm_constant_id_list_t *captures, pm_patt pm_parser_local_add(parser, constant_id, identifier.start, identifier.end, 0); } - parse_pattern_capture(parser, captures, constant_id, &PM_LOCATION_TOKEN_VALUE(&identifier), capturing); + parse_pattern_capture(parser, captures, constant_id, &PM_LOCATION_TOKEN_VALUE(&identifier)); name = (pm_node_t *) pm_local_variable_target_node_create( parser, &PM_LOCATION_TOKEN_VALUE(&identifier), @@ -17138,7 +17125,7 @@ parse_pattern_rest(pm_parser_t *parser, pm_constant_id_list_t *captures, pm_patt * Parse a keyword rest node. */ static pm_node_t * -parse_pattern_keyword_rest(pm_parser_t *parser, pm_constant_id_list_t *captures, pm_pattern_capturing_t *capturing) { +parse_pattern_keyword_rest(pm_parser_t *parser, pm_constant_id_list_t *captures) { assert(parser->current.type == PM_TOKEN_USTAR_STAR); parser_lex(parser); @@ -17157,7 +17144,7 @@ parse_pattern_keyword_rest(pm_parser_t *parser, pm_constant_id_list_t *captures, pm_parser_local_add(parser, constant_id, parser->previous.start, parser->previous.end, 0); } - parse_pattern_capture(parser, captures, constant_id, &PM_LOCATION_TOKEN_VALUE(&parser->previous), capturing); + parse_pattern_capture(parser, captures, constant_id, &PM_LOCATION_TOKEN_VALUE(&parser->previous)); value = (pm_node_t *) pm_local_variable_target_node_create( parser, &PM_LOCATION_TOKEN_VALUE(&parser->previous), @@ -17201,7 +17188,7 @@ pm_slice_is_valid_local(const pm_parser_t *parser, const uint8_t *start, const u * value. This will use an implicit local variable target. */ static pm_node_t * -parse_pattern_hash_implicit_value(pm_parser_t *parser, pm_constant_id_list_t *captures, pm_symbol_node_t *key, pm_pattern_capturing_t *capturing) { +parse_pattern_hash_implicit_value(pm_parser_t *parser, pm_constant_id_list_t *captures, pm_symbol_node_t *key) { const pm_location_t *value_loc = &((pm_symbol_node_t *) key)->value_loc; pm_constant_id_t constant_id = pm_parser_constant_id_location(parser, value_loc->start, value_loc->end); @@ -17221,7 +17208,7 @@ parse_pattern_hash_implicit_value(pm_parser_t *parser, pm_constant_id_list_t *ca pm_parser_local_add(parser, constant_id, value_loc->start, value_loc->end, 0); } - parse_pattern_capture(parser, captures, constant_id, value_loc, capturing); + parse_pattern_capture(parser, captures, constant_id, value_loc); pm_local_variable_target_node_t *target = pm_local_variable_target_node_create( parser, value_loc, @@ -17247,7 +17234,7 @@ parse_pattern_hash_key(pm_parser_t *parser, pm_static_literals_t *keys, pm_node_ * Parse a hash pattern. */ static pm_hash_pattern_node_t * -parse_pattern_hash(pm_parser_t *parser, pm_constant_id_list_t *captures, pm_node_t *first_node, pm_pattern_capturing_t *capturing, uint16_t depth) { +parse_pattern_hash(pm_parser_t *parser, pm_constant_id_list_t *captures, pm_node_t *first_node, uint16_t depth) { pm_node_list_t assocs = { 0 }; pm_static_literals_t keys = { 0 }; pm_node_t *rest = NULL; @@ -17265,7 +17252,7 @@ parse_pattern_hash(pm_parser_t *parser, pm_constant_id_list_t *captures, pm_node if (match8(parser, PM_TOKEN_COMMA, PM_TOKEN_KEYWORD_THEN, PM_TOKEN_BRACE_RIGHT, PM_TOKEN_BRACKET_RIGHT, PM_TOKEN_PARENTHESIS_RIGHT, PM_TOKEN_NEWLINE, PM_TOKEN_SEMICOLON, PM_TOKEN_EOF)) { // Otherwise, we will create an implicit local variable // target for the value. - value = parse_pattern_hash_implicit_value(parser, captures, (pm_symbol_node_t *) first_node, capturing); + value = parse_pattern_hash_implicit_value(parser, captures, (pm_symbol_node_t *) first_node); } else { // Here we have a value for the first assoc in the list, so // we will parse it now. @@ -17309,7 +17296,7 @@ parse_pattern_hash(pm_parser_t *parser, pm_constant_id_list_t *captures, pm_node } if (match1(parser, PM_TOKEN_USTAR_STAR)) { - pm_node_t *assoc = parse_pattern_keyword_rest(parser, captures, capturing); + pm_node_t *assoc = parse_pattern_keyword_rest(parser, captures); if (rest == NULL) { rest = assoc; @@ -17337,7 +17324,7 @@ parse_pattern_hash(pm_parser_t *parser, pm_constant_id_list_t *captures, pm_node pm_node_t *value = NULL; if (match7(parser, PM_TOKEN_COMMA, PM_TOKEN_KEYWORD_THEN, PM_TOKEN_BRACE_RIGHT, PM_TOKEN_BRACKET_RIGHT, PM_TOKEN_PARENTHESIS_RIGHT, PM_TOKEN_NEWLINE, PM_TOKEN_SEMICOLON)) { - value = parse_pattern_hash_implicit_value(parser, captures, (pm_symbol_node_t *) key, capturing); + value = parse_pattern_hash_implicit_value(parser, captures, (pm_symbol_node_t *) key); } else { value = parse_pattern(parser, captures, PM_PARSE_PATTERN_SINGLE, PM_ERR_PATTERN_EXPRESSION_AFTER_KEY, (uint16_t) (depth + 1)); } @@ -17364,7 +17351,7 @@ parse_pattern_hash(pm_parser_t *parser, pm_constant_id_list_t *captures, pm_node * Parse a pattern expression primitive. */ static pm_node_t * -parse_pattern_primitive(pm_parser_t *parser, pm_constant_id_list_t *captures, pm_pattern_capturing_t *capturing, pm_diagnostic_id_t diag_id, uint16_t depth) { +parse_pattern_primitive(pm_parser_t *parser, pm_constant_id_list_t *captures, pm_diagnostic_id_t diag_id, uint16_t depth) { switch (parser->current.type) { case PM_TOKEN_IDENTIFIER: case PM_TOKEN_METHOD_NAME: { @@ -17376,7 +17363,7 @@ parse_pattern_primitive(pm_parser_t *parser, pm_constant_id_list_t *captures, pm pm_parser_local_add(parser, constant_id, parser->previous.start, parser->previous.end, 0); } - parse_pattern_capture(parser, captures, constant_id, &PM_LOCATION_TOKEN_VALUE(&parser->previous), capturing); + parse_pattern_capture(parser, captures, constant_id, &PM_LOCATION_TOKEN_VALUE(&parser->previous)); return (pm_node_t *) pm_local_variable_target_node_create( parser, &PM_LOCATION_TOKEN_VALUE(&parser->previous), @@ -17460,7 +17447,7 @@ parse_pattern_primitive(pm_parser_t *parser, pm_constant_id_list_t *captures, pm first_node = (pm_node_t *) pm_symbol_node_label_create(parser, &parser->previous); break; case PM_TOKEN_USTAR_STAR: - first_node = parse_pattern_keyword_rest(parser, captures, capturing); + first_node = parse_pattern_keyword_rest(parser, captures); break; case PM_TOKEN_STRING_BEGIN: first_node = parse_expression(parser, PM_BINDING_POWER_MAX, false, true, PM_ERR_PATTERN_HASH_KEY_LABEL, (uint16_t) (depth + 1)); @@ -17474,7 +17461,7 @@ parse_pattern_primitive(pm_parser_t *parser, pm_constant_id_list_t *captures, pm } } - node = parse_pattern_hash(parser, captures, first_node, capturing, (uint16_t) (depth + 1)); + node = parse_pattern_hash(parser, captures, first_node, (uint16_t) (depth + 1)); accept1(parser, PM_TOKEN_NEWLINE); expect1(parser, PM_TOKEN_BRACE_RIGHT, PM_ERR_PATTERN_TERM_BRACE); @@ -17635,6 +17622,26 @@ parse_pattern_primitive(pm_parser_t *parser, pm_constant_id_list_t *captures, pm } } +static bool +parse_pattern_alternation_error_each(const pm_node_t *node, void *data) { + switch (PM_NODE_TYPE(node)) { + case PM_LOCAL_VARIABLE_TARGET_NODE: + pm_parser_err((pm_parser_t *) data, node->location.start, node->location.end, PM_ERR_PATTERN_CAPTURE_IN_ALTERNATIVE); + return false; + default: + return true; + } +} + +/** + * When we get here, we know that we already have a syntax error, because we + * know we have captured a variable and that we are in an alternation. + */ +static void +parse_pattern_alternation_error(pm_parser_t *parser, const pm_node_t *node) { + pm_visit_node(node, parse_pattern_alternation_error_each, parser); +} + /** * Parse any number of primitives joined by alternation and ended optionally by * assignment. @@ -17642,16 +17649,11 @@ parse_pattern_primitive(pm_parser_t *parser, pm_constant_id_list_t *captures, pm static pm_node_t * parse_pattern_primitives(pm_parser_t *parser, pm_constant_id_list_t *captures, pm_node_t *first_node, pm_diagnostic_id_t diag_id, uint16_t depth) { pm_node_t *node = first_node; - pm_pattern_capturing_t capturing = { false, false }; - - while ((node == NULL) || accept1(parser, PM_TOKEN_PIPE)) { - pm_token_t operator = parser->previous; + bool alternation = false; - if (node) { - if (capturing.capture_in_pattern) { - pm_parser_err(parser, operator.start, operator.end, PM_ERR_PATTERN_ALTERNATIVE_AFTER_CAPTURE); - } - capturing.in_alternative_pattern = true; + while ((node == NULL) || (alternation = accept1(parser, PM_TOKEN_PIPE))) { + if (alternation && !PM_NODE_TYPE_P(node, PM_ALTERNATION_PATTERN_NODE) && captures->size) { + parse_pattern_alternation_error(parser, node); } switch (parser->current.type) { @@ -17664,10 +17666,13 @@ parse_pattern_primitives(pm_parser_t *parser, pm_constant_id_list_t *captures, p case PM_TOKEN_UDOT_DOT: case PM_TOKEN_UDOT_DOT_DOT: case PM_CASE_PRIMITIVE: { - if (node == NULL) { - node = parse_pattern_primitive(parser, captures, &capturing, diag_id, (uint16_t) (depth + 1)); + if (!alternation) { + node = parse_pattern_primitive(parser, captures, diag_id, (uint16_t) (depth + 1)); } else { - pm_node_t *right = parse_pattern_primitive(parser, captures, &capturing, PM_ERR_PATTERN_EXPRESSION_AFTER_PIPE, (uint16_t) (depth + 1)); + pm_token_t operator = parser->previous; + pm_node_t *right = parse_pattern_primitive(parser, captures, PM_ERR_PATTERN_EXPRESSION_AFTER_PIPE, (uint16_t) (depth + 1)); + + if (captures->size) parse_pattern_alternation_error(parser, right); node = (pm_node_t *) pm_alternation_pattern_node_create(parser, node, right, &operator); } @@ -17675,6 +17680,7 @@ parse_pattern_primitives(pm_parser_t *parser, pm_constant_id_list_t *captures, p } case PM_TOKEN_PARENTHESIS_LEFT: case PM_TOKEN_PARENTHESIS_LEFT_PARENTHESES: { + pm_token_t operator = parser->previous; pm_token_t opening = parser->current; parser_lex(parser); @@ -17683,9 +17689,10 @@ parse_pattern_primitives(pm_parser_t *parser, pm_constant_id_list_t *captures, p expect1(parser, PM_TOKEN_PARENTHESIS_RIGHT, PM_ERR_PATTERN_TERM_PAREN); pm_node_t *right = (pm_node_t *) pm_parentheses_node_create(parser, &opening, body, &parser->previous, 0); - if (node == NULL) { + if (!alternation) { node = right; } else { + if (captures->size) parse_pattern_alternation_error(parser, right); node = (pm_node_t *) pm_alternation_pattern_node_create(parser, node, right, &operator); } @@ -17695,10 +17702,11 @@ parse_pattern_primitives(pm_parser_t *parser, pm_constant_id_list_t *captures, p pm_parser_err_current(parser, diag_id); pm_node_t *right = (pm_node_t *) pm_missing_node_create(parser, parser->current.start, parser->current.end); - if (node == NULL) { + if (!alternation) { node = right; } else { - node = (pm_node_t *) pm_alternation_pattern_node_create(parser, node, right, &operator); + if (captures->size) parse_pattern_alternation_error(parser, right); + node = (pm_node_t *) pm_alternation_pattern_node_create(parser, node, right, &parser->previous); } break; @@ -17719,7 +17727,7 @@ parse_pattern_primitives(pm_parser_t *parser, pm_constant_id_list_t *captures, p pm_parser_local_add(parser, constant_id, parser->previous.start, parser->previous.end, 0); } - parse_pattern_capture(parser, captures, constant_id, &PM_LOCATION_TOKEN_VALUE(&parser->previous), &capturing); + parse_pattern_capture(parser, captures, constant_id, &PM_LOCATION_TOKEN_VALUE(&parser->previous)); pm_local_variable_target_node_t *target = pm_local_variable_target_node_create( parser, &PM_LOCATION_TOKEN_VALUE(&parser->previous), @@ -17742,13 +17750,12 @@ parse_pattern(pm_parser_t *parser, pm_constant_id_list_t *captures, uint8_t flag bool leading_rest = false; bool trailing_rest = false; - pm_pattern_capturing_t capturing = { false, false }; switch (parser->current.type) { case PM_TOKEN_LABEL: { parser_lex(parser); pm_node_t *key = (pm_node_t *) pm_symbol_node_label_create(parser, &parser->previous); - node = (pm_node_t *) parse_pattern_hash(parser, captures, key, &capturing, (uint16_t) (depth + 1)); + node = (pm_node_t *) parse_pattern_hash(parser, captures, key, (uint16_t) (depth + 1)); if (!(flags & PM_PARSE_PATTERN_TOP)) { pm_parser_err_node(parser, node, PM_ERR_PATTERN_HASH_IMPLICIT); @@ -17757,8 +17764,8 @@ parse_pattern(pm_parser_t *parser, pm_constant_id_list_t *captures, uint8_t flag return node; } case PM_TOKEN_USTAR_STAR: { - node = parse_pattern_keyword_rest(parser, captures, &capturing); - node = (pm_node_t *) parse_pattern_hash(parser, captures, node, &capturing, (uint16_t) (depth + 1)); + node = parse_pattern_keyword_rest(parser, captures); + node = (pm_node_t *) parse_pattern_hash(parser, captures, node, (uint16_t) (depth + 1)); if (!(flags & PM_PARSE_PATTERN_TOP)) { pm_parser_err_node(parser, node, PM_ERR_PATTERN_HASH_IMPLICIT); @@ -17769,10 +17776,10 @@ parse_pattern(pm_parser_t *parser, pm_constant_id_list_t *captures, uint8_t flag case PM_TOKEN_STRING_BEGIN: { // We need special handling for string beginnings because they could // be dynamic symbols leading to hash patterns. - node = parse_pattern_primitive(parser, captures, &capturing, diag_id, (uint16_t) (depth + 1)); + node = parse_pattern_primitive(parser, captures, diag_id, (uint16_t) (depth + 1)); if (pm_symbol_node_label_p(node)) { - node = (pm_node_t *) parse_pattern_hash(parser, captures, node, &capturing, (uint16_t) (depth + 1)); + node = (pm_node_t *) parse_pattern_hash(parser, captures, node, (uint16_t) (depth + 1)); if (!(flags & PM_PARSE_PATTERN_TOP)) { pm_parser_err_node(parser, node, PM_ERR_PATTERN_HASH_IMPLICIT); @@ -17787,7 +17794,7 @@ parse_pattern(pm_parser_t *parser, pm_constant_id_list_t *captures, uint8_t flag case PM_TOKEN_USTAR: { if (flags & (PM_PARSE_PATTERN_TOP | PM_PARSE_PATTERN_MULTI)) { parser_lex(parser); - node = (pm_node_t *) parse_pattern_rest(parser, captures, &capturing); + node = (pm_node_t *) parse_pattern_rest(parser, captures); leading_rest = true; break; } @@ -17801,7 +17808,7 @@ parse_pattern(pm_parser_t *parser, pm_constant_id_list_t *captures, uint8_t flag // If we got a dynamic label symbol, then we need to treat it like the // beginning of a hash pattern. if (pm_symbol_node_label_p(node)) { - return (pm_node_t *) parse_pattern_hash(parser, captures, node, &capturing, (uint16_t) (depth + 1)); + return (pm_node_t *) parse_pattern_hash(parser, captures, node, (uint16_t) (depth + 1)); } if ((flags & PM_PARSE_PATTERN_MULTI) && match1(parser, PM_TOKEN_COMMA)) { @@ -17822,7 +17829,7 @@ parse_pattern(pm_parser_t *parser, pm_constant_id_list_t *captures, uint8_t flag } if (accept1(parser, PM_TOKEN_USTAR)) { - node = (pm_node_t *) parse_pattern_rest(parser, captures, &capturing); + node = (pm_node_t *) parse_pattern_rest(parser, captures); // If we have already parsed a splat pattern, then this is an // error. We will continue to parse the rest of the patterns, diff --git a/templates/src/diagnostic.c.erb b/templates/src/diagnostic.c.erb index 87e1f341f6..121dd4b2b6 100644 --- a/templates/src/diagnostic.c.erb +++ b/templates/src/diagnostic.c.erb @@ -299,7 +299,6 @@ static const pm_diagnostic_data_t diagnostic_messages[PM_DIAGNOSTIC_ID_MAX] = { [PM_ERR_PARAMETER_UNEXPECTED_FWD] = { "unexpected `...` in parameters", PM_ERROR_LEVEL_SYNTAX }, [PM_ERR_PARAMETER_WILD_LOOSE_COMMA] = { "unexpected `,` in parameters", PM_ERROR_LEVEL_SYNTAX }, [PM_ERR_PARAMETER_UNEXPECTED_NO_KW] = { "unexpected **nil; no keywords marker disallowed after keywords", PM_ERROR_LEVEL_SYNTAX }, - [PM_ERR_PATTERN_ALTERNATIVE_AFTER_CAPTURE] = { "alternative pattern after variable capture", PM_ERROR_LEVEL_SYNTAX }, [PM_ERR_PATTERN_ARRAY_MULTIPLE_RESTS] = { "unexpected multiple '*' rest patterns in an array pattern", PM_ERROR_LEVEL_SYNTAX }, [PM_ERR_PATTERN_CAPTURE_DUPLICATE] = { "duplicated variable name", PM_ERROR_LEVEL_SYNTAX }, [PM_ERR_PATTERN_CAPTURE_IN_ALTERNATIVE] = { "variable capture in alternative pattern", PM_ERROR_LEVEL_SYNTAX }, diff --git a/test/prism/errors/pattern-capture-in-alt-array.txt b/test/prism/errors/pattern-capture-in-alt-array.txt new file mode 100644 index 0000000000..5cb59fa328 --- /dev/null +++ b/test/prism/errors/pattern-capture-in-alt-array.txt @@ -0,0 +1,4 @@ +1 => [a, b] | 2 + ^ variable capture in alternative pattern + ^ variable capture in alternative pattern + diff --git a/test/prism/errors/pattern-capture-in-alt-hash.txt b/test/prism/errors/pattern-capture-in-alt-hash.txt new file mode 100644 index 0000000000..150b3baecc --- /dev/null +++ b/test/prism/errors/pattern-capture-in-alt-hash.txt @@ -0,0 +1,3 @@ +1 => { a: b } | 2 + ^ variable capture in alternative pattern + diff --git a/test/prism/errors/pattern-capture-in-alt-name.txt b/test/prism/errors/pattern-capture-in-alt-name.txt new file mode 100644 index 0000000000..cbf2bae85f --- /dev/null +++ b/test/prism/errors/pattern-capture-in-alt-name.txt @@ -0,0 +1,3 @@ +1 => (2 => b) | 2 + ^ variable capture in alternative pattern + diff --git a/test/prism/errors/pattern-capture-in-alt-top.txt b/test/prism/errors/pattern-capture-in-alt-top.txt new file mode 100644 index 0000000000..bdf3a7f637 --- /dev/null +++ b/test/prism/errors/pattern-capture-in-alt-top.txt @@ -0,0 +1,4 @@ +1 => a | b + ^ variable capture in alternative pattern + ^ variable capture in alternative pattern + From 7ef5b42802364a7e8893cd0e2f09d5623912ab63 Mon Sep 17 00:00:00 2001 From: Earlopain <14981592+Earlopain@users.noreply.github.com> Date: Mon, 17 Nov 2025 12:46:10 +0100 Subject: [PATCH 214/333] Respect parse.y excludes in CI --- .github/workflows/cruby-bindings.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/cruby-bindings.yml b/.github/workflows/cruby-bindings.yml index 918e87b333..ab10104810 100644 --- a/.github/workflows/cruby-bindings.yml +++ b/.github/workflows/cruby-bindings.yml @@ -53,5 +53,6 @@ jobs: - name: make test-all env: RUN_OPTS: --parser=${{ matrix.parser }} + EXCLUDES: ${{ matrix.parser == 'parse.y' && './test/.excludes-parsey' }} run: make -j$(nproc) -s test-all working-directory: ruby/ruby From b00d098f9a05388579fcb125e33927d612873f88 Mon Sep 17 00:00:00 2001 From: Earlopain <14981592+Earlopain@users.noreply.github.com> Date: Mon, 17 Nov 2025 13:43:20 +0100 Subject: [PATCH 215/333] Remove now obsolete todos --- test/prism/ruby/parser_test.rb | 1 - test/prism/test_helper.rb | 1 - 2 files changed, 2 deletions(-) diff --git a/test/prism/ruby/parser_test.rb b/test/prism/ruby/parser_test.rb index 1629c36b38..648c44e77a 100644 --- a/test/prism/ruby/parser_test.rb +++ b/test/prism/ruby/parser_test.rb @@ -172,7 +172,6 @@ def test_non_prism_builder_class_deprecated if RUBY_VERSION >= "3.3" def test_current_parser_for_current_ruby major, minor = current_major_minor.split(".") - return if major == "3" && minor == "5" # TODO: Remove once ruby-dev becomes 4.0 # Let's just hope there never is a Ruby 3.10 or similar expected = major.to_i * 10 + minor.to_i assert_equal(expected, Translation::ParserCurrent.new.version) diff --git a/test/prism/test_helper.rb b/test/prism/test_helper.rb index c03f70b2cd..42555738cf 100644 --- a/test/prism/test_helper.rb +++ b/test/prism/test_helper.rb @@ -256,7 +256,6 @@ def current_major_minor if RUBY_VERSION >= "3.3.0" def test_all_syntax_versions_present - return if RUBY_VERSION.start_with?("3.5") # TODO: Remove once ruby-dev becomes 4.0 assert_include(SYNTAX_VERSIONS, current_major_minor) end end From 796ab0edf41f8d4e2a08c283d5c76e248006a158 Mon Sep 17 00:00:00 2001 From: Earlopain <14981592+Earlopain@users.noreply.github.com> Date: Tue, 18 Nov 2025 09:33:55 +0100 Subject: [PATCH 216/333] Reject `p(p a, &block => value)` and similar They were being parsed as `p((p a, &block) => value)`. When we get to this point, we must not just have parsed a command call, always consuming the `=>` is not correct. Closes [Bug #21622] --- snapshots/command_method_call.txt | 272 +++++++++++++++++--- src/prism.c | 21 +- test/prism/errors/command_calls_35.txt | 41 +++ test/prism/fixtures/command_method_call.txt | 6 + 4 files changed, 300 insertions(+), 40 deletions(-) create mode 100644 test/prism/errors/command_calls_35.txt diff --git a/snapshots/command_method_call.txt b/snapshots/command_method_call.txt index 772484a117..ef7de429d2 100644 --- a/snapshots/command_method_call.txt +++ b/snapshots/command_method_call.txt @@ -1,10 +1,10 @@ -@ ProgramNode (location: (1,0)-(41,10)) +@ ProgramNode (location: (1,0)-(47,27)) ├── flags: ∅ ├── locals: [:foo, :bar] └── statements: - @ StatementsNode (location: (1,0)-(41,10)) + @ StatementsNode (location: (1,0)-(47,27)) ├── flags: ∅ - └── body: (length: 21) + └── body: (length: 24) ├── @ CallNode (location: (1,0)-(1,5)) │ ├── flags: newline, ignore_visibility │ ├── receiver: ∅ @@ -779,42 +779,236 @@ │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ └── operator_loc: (39,7)-(39,9) = "or" - └── @ CallNode (location: (41,0)-(41,10)) - ├── flags: newline - ├── receiver: - │ @ CallNode (location: (41,4)-(41,10)) - │ ├── flags: ∅ - │ ├── receiver: - │ │ @ CallNode (location: (41,5)-(41,10)) - │ │ ├── flags: ignore_visibility - │ │ ├── receiver: ∅ - │ │ ├── call_operator_loc: ∅ - │ │ ├── name: :foo - │ │ ├── message_loc: (41,5)-(41,8) = "foo" - │ │ ├── opening_loc: ∅ - │ │ ├── arguments: - │ │ │ @ ArgumentsNode (location: (41,9)-(41,10)) - │ │ │ ├── flags: ∅ - │ │ │ └── arguments: (length: 1) - │ │ │ └── @ IntegerNode (location: (41,9)-(41,10)) - │ │ │ ├── flags: static_literal, decimal - │ │ │ └── value: 1 - │ │ ├── closing_loc: ∅ - │ │ ├── equal_loc: ∅ - │ │ └── block: ∅ - │ ├── call_operator_loc: ∅ - │ ├── name: :! - │ ├── message_loc: (41,4)-(41,5) = "!" - │ ├── opening_loc: ∅ - │ ├── arguments: ∅ - │ ├── closing_loc: ∅ - │ ├── equal_loc: ∅ - │ └── block: ∅ + ├── @ CallNode (location: (41,0)-(41,10)) + │ ├── flags: newline + │ ├── receiver: + │ │ @ CallNode (location: (41,4)-(41,10)) + │ │ ├── flags: ∅ + │ │ ├── receiver: + │ │ │ @ CallNode (location: (41,5)-(41,10)) + │ │ │ ├── flags: ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :foo + │ │ │ ├── message_loc: (41,5)-(41,8) = "foo" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: + │ │ │ │ @ ArgumentsNode (location: (41,9)-(41,10)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── arguments: (length: 1) + │ │ │ │ └── @ IntegerNode (location: (41,9)-(41,10)) + │ │ │ │ ├── flags: static_literal, decimal + │ │ │ │ └── value: 1 + │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :! + │ │ ├── message_loc: (41,4)-(41,5) = "!" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :! + │ ├── message_loc: (41,0)-(41,3) = "not" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (43,0)-(43,26)) + │ ├── flags: newline, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :foo + │ ├── message_loc: (43,0)-(43,3) = "foo" + │ ├── opening_loc: (43,3)-(43,4) = "(" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (43,4)-(43,25)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ CallNode (location: (43,4)-(43,25)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :bar + │ │ ├── message_loc: (43,4)-(43,7) = "bar" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (43,8)-(43,25)) + │ │ │ ├── flags: contains_keywords + │ │ │ └── arguments: (length: 2) + │ │ │ ├── @ CallNode (location: (43,8)-(43,11)) + │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :baz + │ │ │ │ ├── message_loc: (43,8)-(43,11) = "baz" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ └── @ KeywordHashNode (location: (43,13)-(43,25)) + │ │ │ ├── flags: ∅ + │ │ │ └── elements: (length: 1) + │ │ │ └── @ AssocNode (location: (43,13)-(43,25)) + │ │ │ ├── flags: ∅ + │ │ │ ├── key: + │ │ │ │ @ CallNode (location: (43,13)-(43,16)) + │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :key + │ │ │ │ ├── message_loc: (43,13)-(43,16) = "key" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ ├── value: + │ │ │ │ @ CallNode (location: (43,20)-(43,25)) + │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :value + │ │ │ │ ├── message_loc: (43,20)-(43,25) = "value" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ └── operator_loc: (43,17)-(43,19) = "=>" + │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ + │ │ └── block: ∅ + │ ├── closing_loc: (43,25)-(43,26) = ")" + │ ├── equal_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (45,0)-(45,26)) + │ ├── flags: newline, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :foo + │ ├── message_loc: (45,0)-(45,3) = "foo" + │ ├── opening_loc: (45,3)-(45,4) = "(" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (45,4)-(45,25)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ CallNode (location: (45,4)-(45,25)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :bar + │ │ ├── message_loc: (45,4)-(45,7) = "bar" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (45,8)-(45,25)) + │ │ │ ├── flags: contains_keywords + │ │ │ └── arguments: (length: 2) + │ │ │ ├── @ CallNode (location: (45,8)-(45,11)) + │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :baz + │ │ │ │ ├── message_loc: (45,8)-(45,11) = "baz" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ └── @ KeywordHashNode (location: (45,13)-(45,25)) + │ │ │ ├── flags: ∅ + │ │ │ └── elements: (length: 1) + │ │ │ └── @ AssocNode (location: (45,13)-(45,25)) + │ │ │ ├── flags: ∅ + │ │ │ ├── key: + │ │ │ │ @ ConstantReadNode (location: (45,13)-(45,16)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :KEY + │ │ │ ├── value: + │ │ │ │ @ CallNode (location: (45,20)-(45,25)) + │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :value + │ │ │ │ ├── message_loc: (45,20)-(45,25) = "value" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ └── operator_loc: (45,17)-(45,19) = "=>" + │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ + │ │ └── block: ∅ + │ ├── closing_loc: (45,25)-(45,26) = ")" + │ ├── equal_loc: ∅ + │ └── block: ∅ + └── @ CallNode (location: (47,0)-(47,27)) + ├── flags: newline, ignore_visibility + ├── receiver: ∅ ├── call_operator_loc: ∅ - ├── name: :! - ├── message_loc: (41,0)-(41,3) = "not" - ├── opening_loc: ∅ - ├── arguments: ∅ - ├── closing_loc: ∅ + ├── name: :foo + ├── message_loc: (47,0)-(47,3) = "foo" + ├── opening_loc: (47,3)-(47,4) = "(" + ├── arguments: + │ @ ArgumentsNode (location: (47,4)-(47,26)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ CallNode (location: (47,4)-(47,26)) + │ ├── flags: ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :bar + │ ├── message_loc: (47,4)-(47,7) = "bar" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (47,8)-(47,26)) + │ │ ├── flags: contains_keywords + │ │ └── arguments: (length: 2) + │ │ ├── @ CallNode (location: (47,8)-(47,11)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :baz + │ │ │ ├── message_loc: (47,8)-(47,11) = "baz" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── @ KeywordHashNode (location: (47,13)-(47,26)) + │ │ ├── flags: symbol_keys + │ │ └── elements: (length: 1) + │ │ └── @ AssocNode (location: (47,13)-(47,26)) + │ │ ├── flags: ∅ + │ │ ├── key: + │ │ │ @ SymbolNode (location: (47,13)-(47,17)) + │ │ │ ├── flags: static_literal, forced_us_ascii_encoding + │ │ │ ├── opening_loc: (47,13)-(47,14) = ":" + │ │ │ ├── value_loc: (47,14)-(47,17) = "key" + │ │ │ ├── closing_loc: ∅ + │ │ │ └── unescaped: "key" + │ │ ├── value: + │ │ │ @ CallNode (location: (47,21)-(47,26)) + │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :value + │ │ │ ├── message_loc: (47,21)-(47,26) = "value" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ + │ │ │ └── block: ∅ + │ │ └── operator_loc: (47,18)-(47,20) = "=>" + │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ + │ └── block: ∅ + ├── closing_loc: (47,26)-(47,27) = ")" ├── equal_loc: ∅ └── block: ∅ diff --git a/src/prism.c b/src/prism.c index a87932f1b7..cf7217b5bb 100644 --- a/src/prism.c +++ b/src/prism.c @@ -14232,6 +14232,25 @@ parse_assocs(pm_parser_t *parser, pm_static_literals_t *literals, pm_node_t *nod return contains_keyword_splat; } +static inline bool +argument_allowed_for_bare_hash(pm_parser_t *parser, pm_node_t *argument) { + if (pm_symbol_node_label_p(argument)) { + return true; + } + + switch (PM_NODE_TYPE(argument)) { + case PM_CALL_NODE: { + pm_call_node_t *cast = (pm_call_node_t *) argument; + if (cast->opening_loc.start == NULL && cast->arguments != NULL) { + return false; + } + break; + } + default: break; + } + return accept1(parser, PM_TOKEN_EQUAL_GREATER); +} + /** * Append an argument to a list of arguments. */ @@ -14389,7 +14408,7 @@ parse_arguments(pm_parser_t *parser, pm_arguments_t *arguments, bool accepts_for bool contains_keywords = false; bool contains_keyword_splat = false; - if (pm_symbol_node_label_p(argument) || accept1(parser, PM_TOKEN_EQUAL_GREATER)) { + if (argument_allowed_for_bare_hash(parser, argument)){ if (parsed_bare_hash) { pm_parser_err_previous(parser, PM_ERR_ARGUMENT_BARE_HASH); } diff --git a/test/prism/errors/command_calls_35.txt b/test/prism/errors/command_calls_35.txt new file mode 100644 index 0000000000..9eb011cd86 --- /dev/null +++ b/test/prism/errors/command_calls_35.txt @@ -0,0 +1,41 @@ +p(p a, x: b => value) + ^~ unexpected '=>'; expected a `)` to close the arguments + ^ unexpected ')', expecting end-of-input + ^ unexpected ')', ignoring it + +p(p a, x: => value) + ^~ unexpected '=>'; expected a `)` to close the arguments + ^ unexpected ')', expecting end-of-input + ^ unexpected ')', ignoring it + +p(p a, &block => value) + ^~ unexpected '=>'; expected a `)` to close the arguments + ^ unexpected ')', expecting end-of-input + ^ unexpected ')', ignoring it + +p(p a, *args => value) + ^~ unexpected '=>'; expected a `)` to close the arguments + ^ unexpected ')', expecting end-of-input + ^ unexpected ')', ignoring it + +p(p a, **kwargs => value) + ^~ unexpected '=>'; expected a `)` to close the arguments + ^ unexpected ')', expecting end-of-input + ^ unexpected ')', ignoring it + +p p 1, &block => 2, &block + ^~ unexpected '=>', expecting end-of-input + ^~ unexpected '=>', ignoring it + ^ unexpected ',', expecting end-of-input + ^ unexpected ',', ignoring it + ^ unexpected '&', ignoring it + +p p p 1 => 2 => 3 => 4 + ^~ unexpected '=>', expecting end-of-input + ^~ unexpected '=>', ignoring it + +p[p a, x: b => value] + ^ expected a matching `]` + ^ unexpected ']', expecting end-of-input + ^ unexpected ']', ignoring it + diff --git a/test/prism/fixtures/command_method_call.txt b/test/prism/fixtures/command_method_call.txt index 182b87948b..3f510efa69 100644 --- a/test/prism/fixtures/command_method_call.txt +++ b/test/prism/fixtures/command_method_call.txt @@ -39,3 +39,9 @@ def foo = bar 1 !foo 1 or !bar 2 not !foo 1 + +foo(bar baz, key => value) + +foo(bar baz, KEY => value) + +foo(bar baz, :key => value) From 69abcdbb18f34908dd379429353c341f9477aef7 Mon Sep 17 00:00:00 2001 From: Alexander Momchilov Date: Fri, 14 Nov 2025 10:14:44 -0500 Subject: [PATCH 217/333] Add docs for super nodes --- config.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/config.yml b/config.yml index 7d71d52de4..eea29afe25 100644 --- a/config.yml +++ b/config.yml @@ -2626,11 +2626,18 @@ nodes: - name: block type: node? kind: BlockNode + comment: | + All other arguments are forwarded as normal, except the original block is replaced with the new block. comment: | - Represents the use of the `super` keyword without parentheses or arguments. + Represents the use of the `super` keyword without parentheses or arguments, but which might have a block. super ^^^^^ + + super { 123 } + ^^^^^^^^^^^^^ + + If it has any other arguments, it would be a `SuperNode` instead. - name: GlobalVariableAndWriteNode fields: - name: name @@ -4506,6 +4513,7 @@ nodes: - name: arguments type: node? kind: ArgumentsNode + comment: "Can be only `nil` when there are empty parentheses, like `super()`." - name: rparen_loc type: location? - name: block @@ -4521,6 +4529,8 @@ nodes: super foo, bar ^^^^^^^^^^^^^^ + + If no arguments are provided (except for a block), it would be a `ForwardingSuperNode` instead. - name: SymbolNode flags: SymbolFlags fields: From 545e7f2fe00b11617d88e3550e70fd96923f2330 Mon Sep 17 00:00:00 2001 From: Steven Johnstone Date: Fri, 7 Nov 2025 11:39:52 +0000 Subject: [PATCH 218/333] Fix fuzzing builds * pin to a specific version of AFL++ container image * update Ruby version * remove AFL_HARDEN Fixes #3730. --- Makefile | 6 +++--- fuzz/docker/Dockerfile | 9 +++++---- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index 1c5d33ada0..e71ba98fe9 100644 --- a/Makefile +++ b/Makefile @@ -63,12 +63,12 @@ build/fuzz.%: $(SOURCES) fuzz/%.c fuzz/fuzz.c $(ECHO) "building $* fuzzer" $(Q) $(MAKEDIRS) $(@D) $(ECHO) "building main fuzz binary" - $(Q) AFL_HARDEN=1 afl-clang-lto $(DEBUG_FLAGS) $(CPPFLAGS) $(CFLAGS) $(FUZZ_FLAGS) -O0 -fsanitize-ignorelist=fuzz/asan.ignore -fsanitize=fuzzer,address -ggdb3 -std=c99 -Iinclude -o $@ $^ + $(Q) afl-clang-lto $(DEBUG_FLAGS) $(CPPFLAGS) $(CFLAGS) $(FUZZ_FLAGS) -O0 -fsanitize-ignorelist=fuzz/asan.ignore -fsanitize=fuzzer,address -ggdb3 -std=c99 -Iinclude -o $@ $^ $(ECHO) "building cmplog binary" - $(Q) AFL_HARDEN=1 AFL_LLVM_CMPLOG=1 afl-clang-lto $(DEBUG_FLAGS) $(CPPFLAGS) $(CFLAGS) $(FUZZ_FLAGS) -O0 -fsanitize-ignorelist=fuzz/asan.ignore -fsanitize=fuzzer,address -ggdb3 -std=c99 -Iinclude -o $@.cmplog $^ + $(Q) AFL_LLVM_CMPLOG=1 afl-clang-lto $(DEBUG_FLAGS) $(CPPFLAGS) $(CFLAGS) $(FUZZ_FLAGS) -O0 -fsanitize-ignorelist=fuzz/asan.ignore -fsanitize=fuzzer,address -ggdb3 -std=c99 -Iinclude -o $@.cmplog $^ build/fuzz.heisenbug.%: $(SOURCES) fuzz/%.c fuzz/heisenbug.c - $(Q) AFL_HARDEN=1 afl-clang-lto $(DEBUG_FLAGS) $(CPPFLAGS) $(CFLAGS) $(FUZZ_FLAGS) -O0 -fsanitize-ignorelist=fuzz/asan.ignore -fsanitize=fuzzer,address -ggdb3 -std=c99 -Iinclude -o $@ $^ + $(Q) afl-clang-lto $(DEBUG_FLAGS) $(CPPFLAGS) $(CFLAGS) $(FUZZ_FLAGS) -O0 -fsanitize-ignorelist=fuzz/asan.ignore -fsanitize=fuzzer,address -ggdb3 -std=c99 -Iinclude -o $@ $^ fuzz-debug: $(ECHO) "entering debug shell" diff --git a/fuzz/docker/Dockerfile b/fuzz/docker/Dockerfile index 56a0e22c04..839732dd7d 100644 --- a/fuzz/docker/Dockerfile +++ b/fuzz/docker/Dockerfile @@ -1,8 +1,9 @@ -FROM aflplusplus/aflplusplus +FROM aflplusplus/aflplusplus:v4.32c ARG USERNAME=prism ARG USER_UID=1000 ARG USER_GID=$USER_UID +ARG RUBY_VERSION=3.3.10 ENV MAKEFLAGS=-j8 RUN groupadd --gid $USER_GID $USERNAME \ @@ -12,10 +13,10 @@ RUN groupadd --gid $USER_GID $USERNAME \ && chmod 0440 /etc/sudoers.d/$USERNAME -RUN wget https://cache.ruby-lang.org/pub/ruby/3.2/ruby-3.2.2.tar.gz -RUN tar -xvf ruby-3.2.2.tar.gz +RUN wget https://cache.ruby-lang.org/pub/ruby/3.3/ruby-${RUBY_VERSION}.tar.gz -O ruby.tar.gz +RUN mkdir ruby-source && tar -xvf ruby.tar.gz -C ruby-source --strip-components=1 RUN apt update && apt -y install libyaml-dev libz-dev libssl-dev -RUN cd ruby-3.2.2 && ./configure --disable-install-doc && make && make install +RUN cd ruby-source && ./configure --disable-install-doc && make && make install RUN gem install rake-compiler ruby_memcheck RUN git clone https://github.com/pwndbg/pwndbg && cd pwndbg && ./setup.sh ENV LC_CTYPE=C.UTF-8 From 44f075bae40a7933d600b47b93442f7695efd2f6 Mon Sep 17 00:00:00 2001 From: Thiago Araujo Date: Wed, 19 Nov 2025 21:05:29 -0700 Subject: [PATCH 219/333] Add tests to `regexp_encoding_option_mismatch` related to #2667 --- test/prism/errors_test.rb | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/test/prism/errors_test.rb b/test/prism/errors_test.rb index 9abed92652..bd7a8a6381 100644 --- a/test/prism/errors_test.rb +++ b/test/prism/errors_test.rb @@ -64,6 +64,24 @@ def test_invalid_message_name assert_equal :"", Prism.parse_statement("+.@foo,+=foo").write_name end + def test_regexp_encoding_option_mismatch_error + # UTF-8 char with ASCII-8BIT modifier + result = Prism.parse('/Ȃ/n') + assert_includes result.errors.map(&:type), :regexp_encoding_option_mismatch + + # UTF-8 char with EUC-JP modifier + result = Prism.parse('/Ȃ/e') + assert_includes result.errors.map(&:type), :regexp_encoding_option_mismatch + + # UTF-8 char with Windows-31J modifier + result = Prism.parse('/Ȃ/s') + assert_includes result.errors.map(&:type), :regexp_encoding_option_mismatch + + # UTF-8 char with UTF-8 modifier + result = Prism.parse('/Ȃ/u') + assert_empty result.errors + end + private def assert_errors(filepath, version) From 1f5f192ab7d68c60bb5d007def4e3ede9e83fedf Mon Sep 17 00:00:00 2001 From: Steven Johnstone Date: Thu, 20 Nov 2025 11:02:33 +0000 Subject: [PATCH 220/333] Use memmove for overlapping memory ranges Fixes #3736. --- src/prism.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/prism.c b/src/prism.c index a87932f1b7..45817cdd8c 100644 --- a/src/prism.c +++ b/src/prism.c @@ -13467,7 +13467,7 @@ parse_target_implicit_parameter(pm_parser_t *parser, pm_node_t *node) { // remaining nodes down to fill the gap. This is extremely unlikely // to happen. if (index != implicit_parameters->size - 1) { - memcpy(&implicit_parameters->nodes[index], &implicit_parameters->nodes[index + 1], (implicit_parameters->size - index - 1) * sizeof(pm_node_t *)); + memmove(&implicit_parameters->nodes[index], &implicit_parameters->nodes[index + 1], (implicit_parameters->size - index - 1) * sizeof(pm_node_t *)); } implicit_parameters->size--; From 37bb46ff5f0bffb746a4649beb087d049beab2b7 Mon Sep 17 00:00:00 2001 From: Steven Johnstone Date: Thu, 20 Nov 2025 11:31:06 +0000 Subject: [PATCH 221/333] Avoid reading out-of-bounds in pm_strnstr Fixes #3738. --- .github/workflows/rust-bindings.yml | 42 +---------------------------- src/prism.c | 2 +- 2 files changed, 2 insertions(+), 42 deletions(-) diff --git a/.github/workflows/rust-bindings.yml b/.github/workflows/rust-bindings.yml index 111fd0773e..830731c88e 100644 --- a/.github/workflows/rust-bindings.yml +++ b/.github/workflows/rust-bindings.yml @@ -41,10 +41,7 @@ jobs: ~/.cargo/registry ~/.cargo/git target - key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - restore-keys: | - ${{ runner.os }}-cargo-${{ hashFiles('Cargo.toml') }} - ${{ runner.os }}-cargo + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml') }} - name: Run tests run: bundle exec rake cargo:test @@ -76,9 +73,6 @@ jobs: ~/.cargo/git target key: ${{ runner.os }}-cargo--${{ hashFiles('**/Cargo.toml') }} - restore-keys: | - ${{ runner.os }}-cargo-${{ hashFiles('Cargo.toml') }} - ${{ runner.os }}-cargo - name: rake cargo:build run: bundle exec rake cargo:build - name: rake cargo:lint @@ -107,37 +101,3 @@ jobs: components: "rust-src" - name: Test with sanitizer run: bundle exec rake cargo:sanitize:${{ matrix.sanitizer }} - - # We need to figure out what to do here. When you run publish it checks - # against the latest version published to crates, which means if we have any - # breaking changes in the bindings then this fails. - # - # publish: - # name: cargo:publish - # strategy: - # fail-fast: false - # runs-on: ubuntu-latest - # steps: - # - uses: actions/checkout@v3 - # - name: Set up Ruby - # uses: ruby/setup-ruby@v1 - # with: - # ruby-version: head - # bundler-cache: true - # - name: Set up Rust - # uses: dtolnay/rust-toolchain@master - # with: - # toolchain: "1.71.1" - # targets: wasm32-wasip1 - # - uses: actions/cache@v4 - # with: - # path: | - # ~/.cargo/registry - # ~/.cargo/git - # target - # key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - # restore-keys: | - # ${{ runner.os }}-cargo-${{ hashFiles('Cargo.toml') }} - # ${{ runner.os }}-cargo - # - name: Publish crates (dry-run) - # run: bundle exec rake cargo:publish:dry diff --git a/src/prism.c b/src/prism.c index 38f3a9c6ef..a5475b1753 100644 --- a/src/prism.c +++ b/src/prism.c @@ -22639,7 +22639,7 @@ static const char * pm_strnstr(const char *big, const char *little, size_t big_length) { size_t little_length = strlen(little); - for (const char *big_end = big + big_length; big < big_end; big++) { + for (const char *max = big + big_length - little_length; big <= max; big++) { if (*big == *little && memcmp(big, little, little_length) == 0) return big; } From 464a849184734db84184254f90f2b83c55bfe3ed Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Sun, 23 Nov 2025 13:58:50 -0500 Subject: [PATCH 222/333] Handle destroying implicit parameter Fixes #3740 --- src/prism.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/prism.c b/src/prism.c index a5475b1753..2e0c941918 100644 --- a/src/prism.c +++ b/src/prism.c @@ -13849,6 +13849,18 @@ parse_write(pm_parser_t *parser, pm_node_t *target, pm_token_t *operator, pm_nod // syntax error. In this case we'll fall through to our default // handling. We need to free the value that we parsed because there // is no way for us to attach it to the tree at this point. + switch (PM_NODE_TYPE(value)) { + case PM_LOCAL_VARIABLE_READ_NODE: + case PM_IT_LOCAL_VARIABLE_READ_NODE: + // Since it is possible for the value to be an implicit + // parameter, we need to remove it from the list of implicit + // parameters. + parse_target_implicit_parameter(parser, value); + break; + default: + break; + } + pm_node_destroy(parser, value); } PRISM_FALLTHROUGH From fef2c207770e59fab2a102f81c8ac338d9f148d2 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Sun, 23 Nov 2025 16:35:17 -0500 Subject: [PATCH 223/333] Revert "Reject `p(p a, &block => value)` and similar" --- snapshots/command_method_call.txt | 272 +++----------------- src/prism.c | 21 +- test/prism/errors/command_calls_35.txt | 41 --- test/prism/fixtures/command_method_call.txt | 6 - 4 files changed, 40 insertions(+), 300 deletions(-) delete mode 100644 test/prism/errors/command_calls_35.txt diff --git a/snapshots/command_method_call.txt b/snapshots/command_method_call.txt index ef7de429d2..772484a117 100644 --- a/snapshots/command_method_call.txt +++ b/snapshots/command_method_call.txt @@ -1,10 +1,10 @@ -@ ProgramNode (location: (1,0)-(47,27)) +@ ProgramNode (location: (1,0)-(41,10)) ├── flags: ∅ ├── locals: [:foo, :bar] └── statements: - @ StatementsNode (location: (1,0)-(47,27)) + @ StatementsNode (location: (1,0)-(41,10)) ├── flags: ∅ - └── body: (length: 24) + └── body: (length: 21) ├── @ CallNode (location: (1,0)-(1,5)) │ ├── flags: newline, ignore_visibility │ ├── receiver: ∅ @@ -779,236 +779,42 @@ │ │ ├── equal_loc: ∅ │ │ └── block: ∅ │ └── operator_loc: (39,7)-(39,9) = "or" - ├── @ CallNode (location: (41,0)-(41,10)) - │ ├── flags: newline - │ ├── receiver: - │ │ @ CallNode (location: (41,4)-(41,10)) - │ │ ├── flags: ∅ - │ │ ├── receiver: - │ │ │ @ CallNode (location: (41,5)-(41,10)) - │ │ │ ├── flags: ignore_visibility - │ │ │ ├── receiver: ∅ - │ │ │ ├── call_operator_loc: ∅ - │ │ │ ├── name: :foo - │ │ │ ├── message_loc: (41,5)-(41,8) = "foo" - │ │ │ ├── opening_loc: ∅ - │ │ │ ├── arguments: - │ │ │ │ @ ArgumentsNode (location: (41,9)-(41,10)) - │ │ │ │ ├── flags: ∅ - │ │ │ │ └── arguments: (length: 1) - │ │ │ │ └── @ IntegerNode (location: (41,9)-(41,10)) - │ │ │ │ ├── flags: static_literal, decimal - │ │ │ │ └── value: 1 - │ │ │ ├── closing_loc: ∅ - │ │ │ ├── equal_loc: ∅ - │ │ │ └── block: ∅ - │ │ ├── call_operator_loc: ∅ - │ │ ├── name: :! - │ │ ├── message_loc: (41,4)-(41,5) = "!" - │ │ ├── opening_loc: ∅ - │ │ ├── arguments: ∅ - │ │ ├── closing_loc: ∅ - │ │ ├── equal_loc: ∅ - │ │ └── block: ∅ - │ ├── call_operator_loc: ∅ - │ ├── name: :! - │ ├── message_loc: (41,0)-(41,3) = "not" - │ ├── opening_loc: ∅ - │ ├── arguments: ∅ - │ ├── closing_loc: ∅ - │ ├── equal_loc: ∅ - │ └── block: ∅ - ├── @ CallNode (location: (43,0)-(43,26)) - │ ├── flags: newline, ignore_visibility - │ ├── receiver: ∅ - │ ├── call_operator_loc: ∅ - │ ├── name: :foo - │ ├── message_loc: (43,0)-(43,3) = "foo" - │ ├── opening_loc: (43,3)-(43,4) = "(" - │ ├── arguments: - │ │ @ ArgumentsNode (location: (43,4)-(43,25)) - │ │ ├── flags: ∅ - │ │ └── arguments: (length: 1) - │ │ └── @ CallNode (location: (43,4)-(43,25)) - │ │ ├── flags: ignore_visibility - │ │ ├── receiver: ∅ - │ │ ├── call_operator_loc: ∅ - │ │ ├── name: :bar - │ │ ├── message_loc: (43,4)-(43,7) = "bar" - │ │ ├── opening_loc: ∅ - │ │ ├── arguments: - │ │ │ @ ArgumentsNode (location: (43,8)-(43,25)) - │ │ │ ├── flags: contains_keywords - │ │ │ └── arguments: (length: 2) - │ │ │ ├── @ CallNode (location: (43,8)-(43,11)) - │ │ │ │ ├── flags: variable_call, ignore_visibility - │ │ │ │ ├── receiver: ∅ - │ │ │ │ ├── call_operator_loc: ∅ - │ │ │ │ ├── name: :baz - │ │ │ │ ├── message_loc: (43,8)-(43,11) = "baz" - │ │ │ │ ├── opening_loc: ∅ - │ │ │ │ ├── arguments: ∅ - │ │ │ │ ├── closing_loc: ∅ - │ │ │ │ ├── equal_loc: ∅ - │ │ │ │ └── block: ∅ - │ │ │ └── @ KeywordHashNode (location: (43,13)-(43,25)) - │ │ │ ├── flags: ∅ - │ │ │ └── elements: (length: 1) - │ │ │ └── @ AssocNode (location: (43,13)-(43,25)) - │ │ │ ├── flags: ∅ - │ │ │ ├── key: - │ │ │ │ @ CallNode (location: (43,13)-(43,16)) - │ │ │ │ ├── flags: variable_call, ignore_visibility - │ │ │ │ ├── receiver: ∅ - │ │ │ │ ├── call_operator_loc: ∅ - │ │ │ │ ├── name: :key - │ │ │ │ ├── message_loc: (43,13)-(43,16) = "key" - │ │ │ │ ├── opening_loc: ∅ - │ │ │ │ ├── arguments: ∅ - │ │ │ │ ├── closing_loc: ∅ - │ │ │ │ ├── equal_loc: ∅ - │ │ │ │ └── block: ∅ - │ │ │ ├── value: - │ │ │ │ @ CallNode (location: (43,20)-(43,25)) - │ │ │ │ ├── flags: variable_call, ignore_visibility - │ │ │ │ ├── receiver: ∅ - │ │ │ │ ├── call_operator_loc: ∅ - │ │ │ │ ├── name: :value - │ │ │ │ ├── message_loc: (43,20)-(43,25) = "value" - │ │ │ │ ├── opening_loc: ∅ - │ │ │ │ ├── arguments: ∅ - │ │ │ │ ├── closing_loc: ∅ - │ │ │ │ ├── equal_loc: ∅ - │ │ │ │ └── block: ∅ - │ │ │ └── operator_loc: (43,17)-(43,19) = "=>" - │ │ ├── closing_loc: ∅ - │ │ ├── equal_loc: ∅ - │ │ └── block: ∅ - │ ├── closing_loc: (43,25)-(43,26) = ")" - │ ├── equal_loc: ∅ - │ └── block: ∅ - ├── @ CallNode (location: (45,0)-(45,26)) - │ ├── flags: newline, ignore_visibility - │ ├── receiver: ∅ - │ ├── call_operator_loc: ∅ - │ ├── name: :foo - │ ├── message_loc: (45,0)-(45,3) = "foo" - │ ├── opening_loc: (45,3)-(45,4) = "(" - │ ├── arguments: - │ │ @ ArgumentsNode (location: (45,4)-(45,25)) - │ │ ├── flags: ∅ - │ │ └── arguments: (length: 1) - │ │ └── @ CallNode (location: (45,4)-(45,25)) - │ │ ├── flags: ignore_visibility - │ │ ├── receiver: ∅ - │ │ ├── call_operator_loc: ∅ - │ │ ├── name: :bar - │ │ ├── message_loc: (45,4)-(45,7) = "bar" - │ │ ├── opening_loc: ∅ - │ │ ├── arguments: - │ │ │ @ ArgumentsNode (location: (45,8)-(45,25)) - │ │ │ ├── flags: contains_keywords - │ │ │ └── arguments: (length: 2) - │ │ │ ├── @ CallNode (location: (45,8)-(45,11)) - │ │ │ │ ├── flags: variable_call, ignore_visibility - │ │ │ │ ├── receiver: ∅ - │ │ │ │ ├── call_operator_loc: ∅ - │ │ │ │ ├── name: :baz - │ │ │ │ ├── message_loc: (45,8)-(45,11) = "baz" - │ │ │ │ ├── opening_loc: ∅ - │ │ │ │ ├── arguments: ∅ - │ │ │ │ ├── closing_loc: ∅ - │ │ │ │ ├── equal_loc: ∅ - │ │ │ │ └── block: ∅ - │ │ │ └── @ KeywordHashNode (location: (45,13)-(45,25)) - │ │ │ ├── flags: ∅ - │ │ │ └── elements: (length: 1) - │ │ │ └── @ AssocNode (location: (45,13)-(45,25)) - │ │ │ ├── flags: ∅ - │ │ │ ├── key: - │ │ │ │ @ ConstantReadNode (location: (45,13)-(45,16)) - │ │ │ │ ├── flags: ∅ - │ │ │ │ └── name: :KEY - │ │ │ ├── value: - │ │ │ │ @ CallNode (location: (45,20)-(45,25)) - │ │ │ │ ├── flags: variable_call, ignore_visibility - │ │ │ │ ├── receiver: ∅ - │ │ │ │ ├── call_operator_loc: ∅ - │ │ │ │ ├── name: :value - │ │ │ │ ├── message_loc: (45,20)-(45,25) = "value" - │ │ │ │ ├── opening_loc: ∅ - │ │ │ │ ├── arguments: ∅ - │ │ │ │ ├── closing_loc: ∅ - │ │ │ │ ├── equal_loc: ∅ - │ │ │ │ └── block: ∅ - │ │ │ └── operator_loc: (45,17)-(45,19) = "=>" - │ │ ├── closing_loc: ∅ - │ │ ├── equal_loc: ∅ - │ │ └── block: ∅ - │ ├── closing_loc: (45,25)-(45,26) = ")" - │ ├── equal_loc: ∅ - │ └── block: ∅ - └── @ CallNode (location: (47,0)-(47,27)) - ├── flags: newline, ignore_visibility - ├── receiver: ∅ - ├── call_operator_loc: ∅ - ├── name: :foo - ├── message_loc: (47,0)-(47,3) = "foo" - ├── opening_loc: (47,3)-(47,4) = "(" - ├── arguments: - │ @ ArgumentsNode (location: (47,4)-(47,26)) + └── @ CallNode (location: (41,0)-(41,10)) + ├── flags: newline + ├── receiver: + │ @ CallNode (location: (41,4)-(41,10)) │ ├── flags: ∅ - │ └── arguments: (length: 1) - │ └── @ CallNode (location: (47,4)-(47,26)) - │ ├── flags: ignore_visibility - │ ├── receiver: ∅ - │ ├── call_operator_loc: ∅ - │ ├── name: :bar - │ ├── message_loc: (47,4)-(47,7) = "bar" - │ ├── opening_loc: ∅ - │ ├── arguments: - │ │ @ ArgumentsNode (location: (47,8)-(47,26)) - │ │ ├── flags: contains_keywords - │ │ └── arguments: (length: 2) - │ │ ├── @ CallNode (location: (47,8)-(47,11)) - │ │ │ ├── flags: variable_call, ignore_visibility - │ │ │ ├── receiver: ∅ - │ │ │ ├── call_operator_loc: ∅ - │ │ │ ├── name: :baz - │ │ │ ├── message_loc: (47,8)-(47,11) = "baz" - │ │ │ ├── opening_loc: ∅ - │ │ │ ├── arguments: ∅ - │ │ │ ├── closing_loc: ∅ - │ │ │ ├── equal_loc: ∅ - │ │ │ └── block: ∅ - │ │ └── @ KeywordHashNode (location: (47,13)-(47,26)) - │ │ ├── flags: symbol_keys - │ │ └── elements: (length: 1) - │ │ └── @ AssocNode (location: (47,13)-(47,26)) - │ │ ├── flags: ∅ - │ │ ├── key: - │ │ │ @ SymbolNode (location: (47,13)-(47,17)) - │ │ │ ├── flags: static_literal, forced_us_ascii_encoding - │ │ │ ├── opening_loc: (47,13)-(47,14) = ":" - │ │ │ ├── value_loc: (47,14)-(47,17) = "key" - │ │ │ ├── closing_loc: ∅ - │ │ │ └── unescaped: "key" - │ │ ├── value: - │ │ │ @ CallNode (location: (47,21)-(47,26)) - │ │ │ ├── flags: variable_call, ignore_visibility - │ │ │ ├── receiver: ∅ - │ │ │ ├── call_operator_loc: ∅ - │ │ │ ├── name: :value - │ │ │ ├── message_loc: (47,21)-(47,26) = "value" - │ │ │ ├── opening_loc: ∅ - │ │ │ ├── arguments: ∅ - │ │ │ ├── closing_loc: ∅ - │ │ │ ├── equal_loc: ∅ - │ │ │ └── block: ∅ - │ │ └── operator_loc: (47,18)-(47,20) = "=>" - │ ├── closing_loc: ∅ - │ ├── equal_loc: ∅ - │ └── block: ∅ - ├── closing_loc: (47,26)-(47,27) = ")" + │ ├── receiver: + │ │ @ CallNode (location: (41,5)-(41,10)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :foo + │ │ ├── message_loc: (41,5)-(41,8) = "foo" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (41,9)-(41,10)) + │ │ │ ├── flags: ∅ + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ IntegerNode (location: (41,9)-(41,10)) + │ │ │ ├── flags: static_literal, decimal + │ │ │ └── value: 1 + │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ + │ │ └── block: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :! + │ ├── message_loc: (41,4)-(41,5) = "!" + │ ├── opening_loc: ∅ + │ ├── arguments: ∅ + │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ + │ └── block: ∅ + ├── call_operator_loc: ∅ + ├── name: :! + ├── message_loc: (41,0)-(41,3) = "not" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ ├── equal_loc: ∅ └── block: ∅ diff --git a/src/prism.c b/src/prism.c index 2e0c941918..186cdd354c 100644 --- a/src/prism.c +++ b/src/prism.c @@ -14244,25 +14244,6 @@ parse_assocs(pm_parser_t *parser, pm_static_literals_t *literals, pm_node_t *nod return contains_keyword_splat; } -static inline bool -argument_allowed_for_bare_hash(pm_parser_t *parser, pm_node_t *argument) { - if (pm_symbol_node_label_p(argument)) { - return true; - } - - switch (PM_NODE_TYPE(argument)) { - case PM_CALL_NODE: { - pm_call_node_t *cast = (pm_call_node_t *) argument; - if (cast->opening_loc.start == NULL && cast->arguments != NULL) { - return false; - } - break; - } - default: break; - } - return accept1(parser, PM_TOKEN_EQUAL_GREATER); -} - /** * Append an argument to a list of arguments. */ @@ -14420,7 +14401,7 @@ parse_arguments(pm_parser_t *parser, pm_arguments_t *arguments, bool accepts_for bool contains_keywords = false; bool contains_keyword_splat = false; - if (argument_allowed_for_bare_hash(parser, argument)){ + if (pm_symbol_node_label_p(argument) || accept1(parser, PM_TOKEN_EQUAL_GREATER)) { if (parsed_bare_hash) { pm_parser_err_previous(parser, PM_ERR_ARGUMENT_BARE_HASH); } diff --git a/test/prism/errors/command_calls_35.txt b/test/prism/errors/command_calls_35.txt deleted file mode 100644 index 9eb011cd86..0000000000 --- a/test/prism/errors/command_calls_35.txt +++ /dev/null @@ -1,41 +0,0 @@ -p(p a, x: b => value) - ^~ unexpected '=>'; expected a `)` to close the arguments - ^ unexpected ')', expecting end-of-input - ^ unexpected ')', ignoring it - -p(p a, x: => value) - ^~ unexpected '=>'; expected a `)` to close the arguments - ^ unexpected ')', expecting end-of-input - ^ unexpected ')', ignoring it - -p(p a, &block => value) - ^~ unexpected '=>'; expected a `)` to close the arguments - ^ unexpected ')', expecting end-of-input - ^ unexpected ')', ignoring it - -p(p a, *args => value) - ^~ unexpected '=>'; expected a `)` to close the arguments - ^ unexpected ')', expecting end-of-input - ^ unexpected ')', ignoring it - -p(p a, **kwargs => value) - ^~ unexpected '=>'; expected a `)` to close the arguments - ^ unexpected ')', expecting end-of-input - ^ unexpected ')', ignoring it - -p p 1, &block => 2, &block - ^~ unexpected '=>', expecting end-of-input - ^~ unexpected '=>', ignoring it - ^ unexpected ',', expecting end-of-input - ^ unexpected ',', ignoring it - ^ unexpected '&', ignoring it - -p p p 1 => 2 => 3 => 4 - ^~ unexpected '=>', expecting end-of-input - ^~ unexpected '=>', ignoring it - -p[p a, x: b => value] - ^ expected a matching `]` - ^ unexpected ']', expecting end-of-input - ^ unexpected ']', ignoring it - diff --git a/test/prism/fixtures/command_method_call.txt b/test/prism/fixtures/command_method_call.txt index 3f510efa69..182b87948b 100644 --- a/test/prism/fixtures/command_method_call.txt +++ b/test/prism/fixtures/command_method_call.txt @@ -39,9 +39,3 @@ def foo = bar 1 !foo 1 or !bar 2 not !foo 1 - -foo(bar baz, key => value) - -foo(bar baz, KEY => value) - -foo(bar baz, :key => value) From 010e3510a8ee610b0147801b5f6686a326cf1f6f Mon Sep 17 00:00:00 2001 From: Earlopain <14981592+Earlopain@users.noreply.github.com> Date: Tue, 25 Nov 2025 13:37:12 +0100 Subject: [PATCH 224/333] Properly ignore sorbet for dependabot Followup to https://github.com/ruby/prism/commit/878cd2916ed2a43d1733f1ba42cf40076a3a19e3 Should be able to fix this once rbs 4.0.0 is released --- .github/dependabot.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 2bf235c924..8ea06081e2 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -34,3 +34,5 @@ updates: ruby-deps: patterns: - "*" + ignore: + - dependency-name: "sorbet" From 8ec1600a748a4599b74d535779af1e6dd580927a Mon Sep 17 00:00:00 2001 From: Earlopain <14981592+Earlopain@users.noreply.github.com> Date: Wed, 26 Nov 2025 11:14:31 +0100 Subject: [PATCH 225/333] Speed up snapshots test Using pp does extra work that doesn't seem to do much of anything. This brings `SnapshotsTest` runtime down to 8 from 10 seconds for me Creating inspect output still dominates the total runtime --- test/prism/snapshots_test.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/prism/snapshots_test.rb b/test/prism/snapshots_test.rb index 20cdf44d90..58627e3668 100644 --- a/test/prism/snapshots_test.rb +++ b/test/prism/snapshots_test.rb @@ -48,7 +48,7 @@ def assert_snapshot(fixture, version) result = Prism.parse(source, filepath: fixture.path, version: version) assert result.success? - printed = PP.pp(result.value, +"", 79) + printed = result.value.inspect snapshot = fixture.snapshot_path if File.exist?(snapshot) From f448e2b9951e1893df9741e21dd9a786d2ca020c Mon Sep 17 00:00:00 2001 From: Earlopain <14981592+Earlopain@users.noreply.github.com> Date: Wed, 26 Nov 2025 16:13:04 +0100 Subject: [PATCH 226/333] Optimize `Prism::Source#find_line` This is more concise and ruby does a better job performance-wise. This used to be `bsearch_index` already but https://github.com/ruby/prism/commit/6d8358c08395438d5924777c1fc3001a5ebf0aa3 changed it. https://github.com/ruby/prism/pull/1733#discussion_r1373702087 said: > Yeah the edge case was that the value matched an element exactly But surely there would be a test to show this behaviour? Gets called as part of pretty-printing nodes. Further reduces the time for `SnapshotsTest` by ~16% for me. --- lib/prism/parse_result.rb | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/lib/prism/parse_result.rb b/lib/prism/parse_result.rb index 05c14e33f5..3570af136a 100644 --- a/lib/prism/parse_result.rb +++ b/lib/prism/parse_result.rb @@ -155,21 +155,8 @@ def deep_freeze # Binary search through the offsets to find the line number for the given # byte offset. def find_line(byte_offset) - left = 0 - right = offsets.length - 1 - - while left <= right - mid = left + (right - left) / 2 - return mid if (offset = offsets[mid]) == byte_offset - - if offset < byte_offset - left = mid + 1 - else - right = mid - 1 - end - end - - left - 1 + index = offsets.bsearch_index { |offset| offset > byte_offset } || offsets.length + index - 1 end end From 7231492fdb7ee70f64544c1380baf97acc4c26d2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 26 Nov 2025 17:34:56 +0000 Subject: [PATCH 227/333] Bump actions/checkout from 5 to 6 in the action-deps group Bumps the action-deps group with 1 update: [actions/checkout](https://github.com/actions/checkout). Updates `actions/checkout` from 5 to 6 - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v5...v6) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: '6' dependency-type: direct:production update-type: version-update:semver-major dependency-group: action-deps ... Signed-off-by: dependabot[bot] --- .github/workflows/build-artifacts.yml | 2 +- .github/workflows/cpp-bindings.yml | 2 +- .github/workflows/cruby-bindings.yml | 4 +-- .github/workflows/documentation.yml | 2 +- .github/workflows/github-pages.yml | 2 +- .github/workflows/java-wasm-bindings.yml | 2 +- .github/workflows/javascript-bindings.yml | 2 +- .github/workflows/main.yml | 36 +++++++++++------------ .github/workflows/publish-crate.yml | 2 +- .github/workflows/publish-gem.yml | 2 +- .github/workflows/publish-npm.yml | 2 +- .github/workflows/rust-bindings.yml | 6 ++-- .github/workflows/sync-ruby.yml | 2 +- 13 files changed, 33 insertions(+), 33 deletions(-) diff --git a/.github/workflows/build-artifacts.yml b/.github/workflows/build-artifacts.yml index d1504b8adc..a2f754b94a 100644 --- a/.github/workflows/build-artifacts.yml +++ b/.github/workflows/build-artifacts.yml @@ -14,7 +14,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 - name: Set up Ruby uses: ruby/setup-ruby@v1 diff --git a/.github/workflows/cpp-bindings.yml b/.github/workflows/cpp-bindings.yml index 7ac2c068dc..54593ff548 100644 --- a/.github/workflows/cpp-bindings.yml +++ b/.github/workflows/cpp-bindings.yml @@ -19,7 +19,7 @@ jobs: fail-fast: false runs-on: ubuntu-latest steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 - name: Set up Ruby uses: ruby/setup-ruby@v1 with: diff --git a/.github/workflows/cruby-bindings.yml b/.github/workflows/cruby-bindings.yml index ab10104810..2c63a76299 100644 --- a/.github/workflows/cruby-bindings.yml +++ b/.github/workflows/cruby-bindings.yml @@ -27,7 +27,7 @@ jobs: with: ruby-version: head bundler: none - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 with: repository: ruby/ruby path: ruby/ruby @@ -37,7 +37,7 @@ jobs: set -x sudo apt-get update -q || : sudo apt-get install --no-install-recommends -q -y build-essential libssl-dev libyaml-dev libreadline6-dev zlib1g-dev libncurses5-dev libffi-dev libgdbm-dev autoconf ruby - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 with: path: ruby/prism fetch-depth: 1 diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index 8f9b6901f7..c5258a2f5e 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -14,7 +14,7 @@ jobs: check: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 - name: Set up Ruby uses: ruby/setup-ruby@v1 with: diff --git a/.github/workflows/github-pages.yml b/.github/workflows/github-pages.yml index 59dea2ce15..217af4a47b 100644 --- a/.github/workflows/github-pages.yml +++ b/.github/workflows/github-pages.yml @@ -27,7 +27,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v5 + uses: actions/checkout@v6 - name: Setup Ruby uses: ruby/setup-ruby@v1 with: diff --git a/.github/workflows/java-wasm-bindings.yml b/.github/workflows/java-wasm-bindings.yml index 983f4cd916..0e87046ae8 100644 --- a/.github/workflows/java-wasm-bindings.yml +++ b/.github/workflows/java-wasm-bindings.yml @@ -15,7 +15,7 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 - name: Set up Ruby uses: ruby/setup-ruby@v1 diff --git a/.github/workflows/javascript-bindings.yml b/.github/workflows/javascript-bindings.yml index 2828fcf0f1..3b1ebe3d9b 100644 --- a/.github/workflows/javascript-bindings.yml +++ b/.github/workflows/javascript-bindings.yml @@ -15,7 +15,7 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 - name: Set up Ruby uses: ruby/setup-ruby@v1 diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index cf5bd28f94..624325d13a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -14,7 +14,7 @@ jobs: lint: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 - name: Set up Ruby uses: ruby/setup-ruby@v1 with: @@ -28,7 +28,7 @@ jobs: env: BUNDLE_GEMFILE: gemfiles/2.7/Gemfile steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 - name: Set up Ruby uses: ruby/setup-ruby@v1 with: @@ -44,7 +44,7 @@ jobs: env: BUNDLE_GEMFILE: gemfiles/typecheck/Gemfile steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 - name: Set up Ruby uses: ruby/setup-ruby@v1 with: @@ -68,7 +68,7 @@ jobs: - windows-latest runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 - name: Set up Ruby uses: ruby/setup-ruby@v1 with: @@ -88,7 +88,7 @@ jobs: - ubuntu-24.04-s390x runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 - name: Set up Ruby run: | sudo apt-get update @@ -112,7 +112,7 @@ jobs: PRISM_FFI_BACKEND: "true" BUNDLE_GEMFILE: gemfiles/${{ matrix.target.gemfile }}/Gemfile steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 - name: Set up Ruby uses: ruby/setup-ruby@v1 with: @@ -128,7 +128,7 @@ jobs: os: [ubuntu-22.04, ubuntu-24.04] runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 - name: Set up Ruby uses: ruby/setup-ruby@v1 with: @@ -148,7 +148,7 @@ jobs: - windows-latest runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 - name: Set up Ruby uses: ruby/setup-ruby@v1 with: @@ -162,7 +162,7 @@ jobs: build-minimal: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 - name: Set up Ruby uses: ruby/setup-ruby@v1 with: @@ -178,7 +178,7 @@ jobs: env: JRUBY_OPTS: "--dev" steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 - name: Set up JRuby uses: ruby/setup-ruby@v1 with: @@ -190,7 +190,7 @@ jobs: lex-ruby: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 - name: Set up Ruby uses: ruby/setup-ruby@v1 with: @@ -202,7 +202,7 @@ jobs: lex-discourse: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 - name: Set up Ruby uses: ruby/setup-ruby@v1 with: @@ -214,7 +214,7 @@ jobs: lex-top-100: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 - name: Set up Ruby uses: ruby/setup-ruby@v1 with: @@ -234,7 +234,7 @@ jobs: memcheck: runs-on: ubuntu-24.04 steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 - name: Install valgrind run: | sudo apt-get update @@ -250,7 +250,7 @@ jobs: gem-package: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 - uses: ruby/setup-ruby@v1 with: ruby-version: head @@ -301,7 +301,7 @@ jobs: BUNDLE_GEMFILE: gemfiles/${{ matrix.target.gemfile }}/Gemfile runs-on: ${{ matrix.target.os }} steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 - uses: ruby/setup-ruby@v1 with: ruby-version: ${{ matrix.target.ruby }} @@ -323,7 +323,7 @@ jobs: gcc-analyzer: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 - name: Set up Ruby uses: ruby/setup-ruby@v1 with: @@ -336,7 +336,7 @@ jobs: clang-analyzer: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 - name: Set up Ruby uses: ruby/setup-ruby@v1 with: diff --git a/.github/workflows/publish-crate.yml b/.github/workflows/publish-crate.yml index 5d8aa2289e..6ad2cb0f1f 100644 --- a/.github/workflows/publish-crate.yml +++ b/.github/workflows/publish-crate.yml @@ -14,7 +14,7 @@ jobs: uses: step-security/harden-runner@v2 with: egress-policy: audit - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 - name: Set up Ruby uses: ruby/setup-ruby@v1 diff --git a/.github/workflows/publish-gem.yml b/.github/workflows/publish-gem.yml index f5da7292b2..87d6cf5657 100644 --- a/.github/workflows/publish-gem.yml +++ b/.github/workflows/publish-gem.yml @@ -27,7 +27,7 @@ jobs: with: egress-policy: audit - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 - name: Set up Ruby uses: ruby/setup-ruby@v1 diff --git a/.github/workflows/publish-npm.yml b/.github/workflows/publish-npm.yml index c93093987f..96e6654295 100644 --- a/.github/workflows/publish-npm.yml +++ b/.github/workflows/publish-npm.yml @@ -14,7 +14,7 @@ jobs: uses: step-security/harden-runner@v2 with: egress-policy: audit - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 - name: Set up Ruby uses: ruby/setup-ruby@v1 diff --git a/.github/workflows/rust-bindings.yml b/.github/workflows/rust-bindings.yml index 830731c88e..2a8a8b5024 100644 --- a/.github/workflows/rust-bindings.yml +++ b/.github/workflows/rust-bindings.yml @@ -24,7 +24,7 @@ jobs: os: [ubuntu-latest, macos-latest, windows-latest] runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 - name: Set up Ruby uses: ruby/setup-ruby@v1 with: @@ -55,7 +55,7 @@ jobs: fail-fast: false runs-on: ubuntu-latest steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 - name: Set up Ruby uses: ruby/setup-ruby@v1 with: @@ -86,7 +86,7 @@ jobs: matrix: sanitizer: [address] steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 - name: Set up Ruby uses: ruby/setup-ruby@v1 with: diff --git a/.github/workflows/sync-ruby.yml b/.github/workflows/sync-ruby.yml index df0eaef010..66a736ed85 100644 --- a/.github/workflows/sync-ruby.yml +++ b/.github/workflows/sync-ruby.yml @@ -8,7 +8,7 @@ jobs: runs-on: ubuntu-latest if: ${{ github.repository_owner == 'ruby' }} steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 - name: Create GitHub App token id: app-token From e2083d27f571433f41a1f42a2d36b66a4f27c1e7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 26 Nov 2025 17:35:40 +0000 Subject: [PATCH 228/333] Bump the ruby-deps group across 10 directories with 2 updates Bumps the ruby-deps group with 1 update in the /gemfiles/2.7 directory: [test-unit](https://github.com/test-unit/test-unit). Bumps the ruby-deps group with 1 update in the /gemfiles/3.0 directory: [test-unit](https://github.com/test-unit/test-unit). Bumps the ruby-deps group with 1 update in the /gemfiles/3.1 directory: [test-unit](https://github.com/test-unit/test-unit). Bumps the ruby-deps group with 1 update in the /gemfiles/3.2 directory: [test-unit](https://github.com/test-unit/test-unit). Bumps the ruby-deps group with 1 update in the /gemfiles/3.3 directory: [test-unit](https://github.com/test-unit/test-unit). Bumps the ruby-deps group with 1 update in the /gemfiles/3.4 directory: [test-unit](https://github.com/test-unit/test-unit). Bumps the ruby-deps group with 1 update in the /gemfiles/4.0 directory: [test-unit](https://github.com/test-unit/test-unit). Bumps the ruby-deps group with 1 update in the /gemfiles/jruby directory: [test-unit](https://github.com/test-unit/test-unit). Bumps the ruby-deps group with 1 update in the /gemfiles/truffleruby directory: [test-unit](https://github.com/test-unit/test-unit). Bumps the ruby-deps group with 2 updates in the /gemfiles/typecheck directory: [test-unit](https://github.com/test-unit/test-unit) and [minitest](https://github.com/minitest/minitest). Updates `test-unit` from 3.7.1 to 3.7.3 - [Release notes](https://github.com/test-unit/test-unit/releases) - [Commits](https://github.com/test-unit/test-unit/compare/3.7.1...3.7.3) Updates `test-unit` from 3.7.1 to 3.7.3 - [Release notes](https://github.com/test-unit/test-unit/releases) - [Commits](https://github.com/test-unit/test-unit/compare/3.7.1...3.7.3) Updates `test-unit` from 3.7.1 to 3.7.3 - [Release notes](https://github.com/test-unit/test-unit/releases) - [Commits](https://github.com/test-unit/test-unit/compare/3.7.1...3.7.3) Updates `test-unit` from 3.7.1 to 3.7.3 - [Release notes](https://github.com/test-unit/test-unit/releases) - [Commits](https://github.com/test-unit/test-unit/compare/3.7.1...3.7.3) Updates `test-unit` from 3.7.1 to 3.7.3 - [Release notes](https://github.com/test-unit/test-unit/releases) - [Commits](https://github.com/test-unit/test-unit/compare/3.7.1...3.7.3) Updates `test-unit` from 3.7.1 to 3.7.3 - [Release notes](https://github.com/test-unit/test-unit/releases) - [Commits](https://github.com/test-unit/test-unit/compare/3.7.1...3.7.3) Updates `test-unit` from 3.7.1 to 3.7.3 - [Release notes](https://github.com/test-unit/test-unit/releases) - [Commits](https://github.com/test-unit/test-unit/compare/3.7.1...3.7.3) Updates `test-unit` from 3.7.1 to 3.7.3 - [Release notes](https://github.com/test-unit/test-unit/releases) - [Commits](https://github.com/test-unit/test-unit/compare/3.7.1...3.7.3) Updates `test-unit` from 3.7.1 to 3.7.3 - [Release notes](https://github.com/test-unit/test-unit/releases) - [Commits](https://github.com/test-unit/test-unit/compare/3.7.1...3.7.3) Updates `test-unit` from 3.7.1 to 3.7.3 - [Release notes](https://github.com/test-unit/test-unit/releases) - [Commits](https://github.com/test-unit/test-unit/compare/3.7.1...3.7.3) Updates `minitest` from 5.26.1 to 5.26.2 - [Changelog](https://github.com/minitest/minitest/blob/master/History.rdoc) - [Commits](https://github.com/minitest/minitest/compare/v5.26.1...v5.26.2) --- updated-dependencies: - dependency-name: test-unit dependency-version: 3.7.3 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps - dependency-name: test-unit dependency-version: 3.7.3 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps - dependency-name: test-unit dependency-version: 3.7.3 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps - dependency-name: test-unit dependency-version: 3.7.3 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps - dependency-name: test-unit dependency-version: 3.7.3 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps - dependency-name: test-unit dependency-version: 3.7.3 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps - dependency-name: test-unit dependency-version: 3.7.3 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps - dependency-name: test-unit dependency-version: 3.7.3 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps - dependency-name: test-unit dependency-version: 3.7.3 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps - dependency-name: test-unit dependency-version: 3.7.3 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps - dependency-name: minitest dependency-version: 5.26.2 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps ... Signed-off-by: dependabot[bot] --- 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/4.0/Gemfile.lock | 2 +- gemfiles/jruby/Gemfile.lock | 2 +- gemfiles/truffleruby/Gemfile.lock | 2 +- gemfiles/typecheck/Gemfile.lock | 4 ++-- 10 files changed, 11 insertions(+), 11 deletions(-) diff --git a/gemfiles/2.7/Gemfile.lock b/gemfiles/2.7/Gemfile.lock index e7d6f3475a..57e505ddbc 100644 --- a/gemfiles/2.7/Gemfile.lock +++ b/gemfiles/2.7/Gemfile.lock @@ -21,7 +21,7 @@ GEM racc (~> 1.5) sexp_processor (~> 4.16) sexp_processor (4.17.4) - test-unit (3.7.1) + test-unit (3.7.3) power_assert PLATFORMS diff --git a/gemfiles/3.0/Gemfile.lock b/gemfiles/3.0/Gemfile.lock index a597b0563d..ea9fcfb4d5 100644 --- a/gemfiles/3.0/Gemfile.lock +++ b/gemfiles/3.0/Gemfile.lock @@ -29,7 +29,7 @@ GEM racc (~> 1.5) sexp_processor (~> 4.16) sexp_processor (4.17.4) - test-unit (3.7.1) + test-unit (3.7.3) power_assert PLATFORMS diff --git a/gemfiles/3.1/Gemfile.lock b/gemfiles/3.1/Gemfile.lock index a8f2eeebe3..f7f72a170f 100644 --- a/gemfiles/3.1/Gemfile.lock +++ b/gemfiles/3.1/Gemfile.lock @@ -29,7 +29,7 @@ GEM racc (~> 1.5) sexp_processor (~> 4.16) sexp_processor (4.17.4) - test-unit (3.7.1) + test-unit (3.7.3) power_assert PLATFORMS diff --git a/gemfiles/3.2/Gemfile.lock b/gemfiles/3.2/Gemfile.lock index 2b7ce78276..1118d93a6e 100644 --- a/gemfiles/3.2/Gemfile.lock +++ b/gemfiles/3.2/Gemfile.lock @@ -29,7 +29,7 @@ GEM racc (~> 1.5) sexp_processor (~> 4.16) sexp_processor (4.17.4) - test-unit (3.7.1) + test-unit (3.7.3) power_assert PLATFORMS diff --git a/gemfiles/3.3/Gemfile.lock b/gemfiles/3.3/Gemfile.lock index e6e8b7a016..99a98aa221 100644 --- a/gemfiles/3.3/Gemfile.lock +++ b/gemfiles/3.3/Gemfile.lock @@ -29,7 +29,7 @@ GEM racc (~> 1.5) sexp_processor (~> 4.16) sexp_processor (4.17.4) - test-unit (3.7.1) + test-unit (3.7.3) power_assert PLATFORMS diff --git a/gemfiles/3.4/Gemfile.lock b/gemfiles/3.4/Gemfile.lock index c60a0edfd8..7dbe76ba47 100644 --- a/gemfiles/3.4/Gemfile.lock +++ b/gemfiles/3.4/Gemfile.lock @@ -29,7 +29,7 @@ GEM racc (~> 1.5) sexp_processor (~> 4.16) sexp_processor (4.17.4) - test-unit (3.7.1) + test-unit (3.7.3) power_assert PLATFORMS diff --git a/gemfiles/4.0/Gemfile.lock b/gemfiles/4.0/Gemfile.lock index 183684b182..3526e754c9 100644 --- a/gemfiles/4.0/Gemfile.lock +++ b/gemfiles/4.0/Gemfile.lock @@ -30,7 +30,7 @@ GEM racc (~> 1.5) sexp_processor (~> 4.16) sexp_processor (4.17.4) - test-unit (3.7.1) + test-unit (3.7.3) power_assert PLATFORMS diff --git a/gemfiles/jruby/Gemfile.lock b/gemfiles/jruby/Gemfile.lock index 728272f817..3792cc697a 100644 --- a/gemfiles/jruby/Gemfile.lock +++ b/gemfiles/jruby/Gemfile.lock @@ -20,7 +20,7 @@ GEM racc (~> 1.5) sexp_processor (~> 4.16) sexp_processor (4.17.4) - test-unit (3.7.1) + test-unit (3.7.3) power_assert PLATFORMS diff --git a/gemfiles/truffleruby/Gemfile.lock b/gemfiles/truffleruby/Gemfile.lock index 5cdcd67fc6..5439692eae 100644 --- a/gemfiles/truffleruby/Gemfile.lock +++ b/gemfiles/truffleruby/Gemfile.lock @@ -19,7 +19,7 @@ GEM racc (~> 1.5) sexp_processor (~> 4.16) sexp_processor (4.17.4) - test-unit (3.7.1) + test-unit (3.7.3) power_assert PLATFORMS diff --git a/gemfiles/typecheck/Gemfile.lock b/gemfiles/typecheck/Gemfile.lock index 7968ff0b2b..6180c3f742 100644 --- a/gemfiles/typecheck/Gemfile.lock +++ b/gemfiles/typecheck/Gemfile.lock @@ -34,7 +34,7 @@ GEM rb-fsevent (~> 0.10, >= 0.10.3) rb-inotify (~> 0.9, >= 0.9.10) logger (1.7.0) - minitest (5.26.1) + minitest (5.26.2) mutex_m (0.3.0) netrc (0.11.0) parallel (1.27.0) @@ -107,7 +107,7 @@ GEM yard-sorbet terminal-table (4.0.0) unicode-display_width (>= 1.1.1, < 4) - test-unit (3.7.1) + test-unit (3.7.3) power_assert thor (1.4.0) tzinfo (2.0.6) From 5b7456c8f69c8dcc3f6c165328019bd04d4d1c68 Mon Sep 17 00:00:00 2001 From: qraqras Date: Fri, 28 Nov 2025 09:58:38 +0900 Subject: [PATCH 229/333] Fix invalid Ruby code example in ClassNode comment --- config.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/config.yml b/config.yml index 69a46de628..3acab9f58d 100644 --- a/config.yml +++ b/config.yml @@ -1860,7 +1860,7 @@ nodes: comment: | Represents the location of the `class` keyword. - class Foo end + class Foo; end ^^^^^ - name: constant_path type: node @@ -1899,19 +1899,19 @@ nodes: comment: | Represents the location of the `end` keyword. - class Foo end - ^^^ + class Foo; end + ^^^ - name: name type: constant comment: | The name of the class. - class Foo end # name `:Foo` + class Foo; end # name `:Foo` comment: | Represents a class declaration involving the `class` keyword. - class Foo end - ^^^^^^^^^^^^^ + class Foo; end + ^^^^^^^^^^^^^^ - name: ClassVariableAndWriteNode fields: - name: name From f0b06d6269081826ab2c81203e364a09a16298b1 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Sat, 29 Nov 2025 14:14:48 -0500 Subject: [PATCH 230/333] Handle invalid string pattern key When a pattern match is using a string as a hash pattern key and is using it incorrectly, we were previously assuming it was a symbol. In the case of an error, that's not the case. So we need to add a missing node in this case. --- src/prism.c | 6 +++++- test/prism/errors/pattern_string_key.txt | 8 ++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 test/prism/errors/pattern_string_key.txt diff --git a/src/prism.c b/src/prism.c index 186cdd354c..3485a58c28 100644 --- a/src/prism.c +++ b/src/prism.c @@ -17336,7 +17336,11 @@ parse_pattern_hash(pm_parser_t *parser, pm_constant_id_list_t *captures, pm_node pm_node_t *value = NULL; if (match7(parser, PM_TOKEN_COMMA, PM_TOKEN_KEYWORD_THEN, PM_TOKEN_BRACE_RIGHT, PM_TOKEN_BRACKET_RIGHT, PM_TOKEN_PARENTHESIS_RIGHT, PM_TOKEN_NEWLINE, PM_TOKEN_SEMICOLON)) { - value = parse_pattern_hash_implicit_value(parser, captures, (pm_symbol_node_t *) key); + if (PM_NODE_TYPE_P(key, PM_SYMBOL_NODE)) { + value = parse_pattern_hash_implicit_value(parser, captures, (pm_symbol_node_t *) key); + } else { + value = (pm_node_t *) pm_missing_node_create(parser, key->location.end, key->location.end); + } } else { value = parse_pattern(parser, captures, PM_PARSE_PATTERN_SINGLE, PM_ERR_PATTERN_EXPRESSION_AFTER_KEY, (uint16_t) (depth + 1)); } diff --git a/test/prism/errors/pattern_string_key.txt b/test/prism/errors/pattern_string_key.txt new file mode 100644 index 0000000000..9f28feddb9 --- /dev/null +++ b/test/prism/errors/pattern_string_key.txt @@ -0,0 +1,8 @@ +case:a +in b:"","#{}" + ^~~~~ expected a label after the `,` in the hash pattern + ^ expected a pattern expression after the key + ^ expected a delimiter after the patterns of an `in` clause + ^ unexpected end-of-input, assuming it is closing the parent top level context + ^ expected an `end` to close the `case` statement + From 198080c106e2d6238791b3ccc0d049a511743d62 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Sat, 29 Nov 2025 14:20:06 -0500 Subject: [PATCH 231/333] Fix out-of-bounds read after utf-8 BOM Co-authored-by: Steven Johnstone --- src/prism.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/prism.c b/src/prism.c index 186cdd354c..4d883a2dd3 100644 --- a/src/prism.c +++ b/src/prism.c @@ -22861,8 +22861,8 @@ pm_parser_init(pm_parser_t *parser, const uint8_t *source, size_t size, const pm // If the shebang does not include "ruby" and this is the main script being // parsed, then we will start searching the file for a shebang that does // contain "ruby" as if -x were passed on the command line. - const uint8_t *newline = next_newline(parser->start, parser->end - parser->start); - size_t length = (size_t) ((newline != NULL ? newline : parser->end) - parser->start); + const uint8_t *newline = next_newline(parser->current.end, parser->end - parser->current.end); + size_t length = (size_t) ((newline != NULL ? newline : parser->end) - parser->current.end); if (length > 2 && parser->current.end[0] == '#' && parser->current.end[1] == '!') { const char *engine; From e3e2b1ed04f2a82f372f97dfe4cc1aa962a75666 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Sat, 29 Nov 2025 14:28:36 -0500 Subject: [PATCH 232/333] Fix label interpolated string --- config.yml | 3 +++ src/prism.c | 6 ++++-- test/prism/errors/label_in_interpolated_string.txt | 14 ++++++++++++++ 3 files changed, 21 insertions(+), 2 deletions(-) create mode 100644 test/prism/errors/label_in_interpolated_string.txt diff --git a/config.yml b/config.yml index 3acab9f58d..36becff28d 100644 --- a/config.yml +++ b/config.yml @@ -3306,6 +3306,9 @@ nodes: - EmbeddedVariableNode - InterpolatedStringNode # `"a" "#{b}"` - on error: XStringNode # `<<`FOO` "bar" + - on error: InterpolatedXStringNode + - on error: SymbolNode + - on error: InterpolatedSymbolNode - name: closing_loc type: location? newline: parts diff --git a/src/prism.c b/src/prism.c index 186cdd354c..7c5426bc5d 100644 --- a/src/prism.c +++ b/src/prism.c @@ -5344,8 +5344,10 @@ pm_interpolated_string_node_append(pm_interpolated_string_node_t *node, pm_node_ break; case PM_X_STRING_NODE: case PM_INTERPOLATED_X_STRING_NODE: - // If this is an x string, then this is a syntax error. But we want - // to handle it here so that we don't fail the assertion. + case PM_SYMBOL_NODE: + case PM_INTERPOLATED_SYMBOL_NODE: + // These will only happen in error cases. But we want to handle it + // here so that we don't fail the assertion. CLEAR_FLAGS(node); break; default: diff --git a/test/prism/errors/label_in_interpolated_string.txt b/test/prism/errors/label_in_interpolated_string.txt new file mode 100644 index 0000000000..e8f40dd2a8 --- /dev/null +++ b/test/prism/errors/label_in_interpolated_string.txt @@ -0,0 +1,14 @@ +case in el""Q +^~~~ expected a predicate for a case matching statement + ^ expected a delimiter after the patterns of an `in` clause + ^ unexpected constant, expecting end-of-input + !"""#{in el"":Q + ^~ unexpected 'in', assuming it is closing the parent 'in' clause + ^ expected a `}` to close the embedded expression + ^~ cannot parse the string part + ^~ cannot parse the string part + ^ cannot parse the string part + ^~~~~~~~~~~ unexpected label + ^~~~~~~~~~~ expected a string for concatenation + ^ expected an `end` to close the `case` statement + From e24e701f3a81b48594207eb5dd8e64ae3bcab2b8 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Sat, 29 Nov 2025 14:31:34 -0500 Subject: [PATCH 233/333] Fix out-of-bounds read in parser_lex_magic_comment Co-authored-by: Steven Johnstone --- src/prism.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/prism.c b/src/prism.c index 186cdd354c..3d6cd3e2cb 100644 --- a/src/prism.c +++ b/src/prism.c @@ -8443,7 +8443,7 @@ parser_lex_magic_comment(pm_parser_t *parser, bool semantic_token_seen) { if (*cursor == '\\' && (cursor + 1 < end)) cursor++; } value_end = cursor; - if (*cursor == '"') cursor++; + if (cursor < end && *cursor == '"') cursor++; } else { value_start = cursor; while (cursor < end && *cursor != '"' && *cursor != ';' && !pm_char_is_whitespace(*cursor)) cursor++; From 1531433e02a1ae1b538c770af407f63caed5dbb1 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Sat, 29 Nov 2025 15:25:35 -0500 Subject: [PATCH 234/333] Ensure implicit parameter nodes are destroyed. When we are about to destroy a node because of a syntax error, we need to check if it is potentially containing an implicit parameter in its subtree. --- src/prism.c | 65 ++++++++++++++++++++++++++++++----------------------- 1 file changed, 37 insertions(+), 28 deletions(-) diff --git a/src/prism.c b/src/prism.c index 3d60e008c4..3f9ce9a1b4 100644 --- a/src/prism.c +++ b/src/prism.c @@ -13454,28 +13454,43 @@ parse_unwriteable_target(pm_parser_t *parser, pm_node_t *target) { return (pm_node_t *) result; } +static bool +parse_target_implicit_parameter_each(const pm_node_t *node, void *data) { + switch (PM_NODE_TYPE(node)) { + case PM_LOCAL_VARIABLE_READ_NODE: + case PM_IT_LOCAL_VARIABLE_READ_NODE: { + pm_parser_t *parser = (pm_parser_t *) data; + pm_node_list_t *implicit_parameters = &parser->current_scope->implicit_parameters; + + for (size_t index = 0; index < implicit_parameters->size; index++) { + if (implicit_parameters->nodes[index] == node) { + // If the node is not the last one in the list, we need to + // shift the remaining nodes down to fill the gap. This is + // extremely unlikely to happen. + if (index != implicit_parameters->size - 1) { + memmove(&implicit_parameters->nodes[index], &implicit_parameters->nodes[index + 1], (implicit_parameters->size - index - 1) * sizeof(pm_node_t *)); + } + + implicit_parameters->size--; + break; + } + } + + return false; + } + default: + return true; + } +} + /** * When an implicit local variable is written to or targeted, it becomes a * regular, named local variable. This function removes it from the list of * implicit parameters when that happens. */ static void -parse_target_implicit_parameter(pm_parser_t *parser, pm_node_t *node) { - pm_node_list_t *implicit_parameters = &parser->current_scope->implicit_parameters; - - for (size_t index = 0; index < implicit_parameters->size; index++) { - if (implicit_parameters->nodes[index] == node) { - // If the node is not the last one in the list, we need to shift the - // remaining nodes down to fill the gap. This is extremely unlikely - // to happen. - if (index != implicit_parameters->size - 1) { - memmove(&implicit_parameters->nodes[index], &implicit_parameters->nodes[index + 1], (implicit_parameters->size - index - 1) * sizeof(pm_node_t *)); - } - - implicit_parameters->size--; - break; - } - } +parse_target_implicit_parameter(pm_parser_t *parser, const pm_node_t *node) { + pm_visit_node(node, parse_target_implicit_parameter_each, parser); } /** @@ -13851,18 +13866,12 @@ parse_write(pm_parser_t *parser, pm_node_t *target, pm_token_t *operator, pm_nod // syntax error. In this case we'll fall through to our default // handling. We need to free the value that we parsed because there // is no way for us to attach it to the tree at this point. - switch (PM_NODE_TYPE(value)) { - case PM_LOCAL_VARIABLE_READ_NODE: - case PM_IT_LOCAL_VARIABLE_READ_NODE: - // Since it is possible for the value to be an implicit - // parameter, we need to remove it from the list of implicit - // parameters. - parse_target_implicit_parameter(parser, value); - break; - default: - break; - } - + // + // Since it is possible for the value to contain an implicit + // parameter somewhere in its subtree, we need to walk it and remove + // any implicit parameters from the list of implicit parameters for + // the current scope. + parse_target_implicit_parameter(parser, value); pm_node_destroy(parser, value); } PRISM_FALLTHROUGH From ebc91c2e39e5eb85a8a72deba6ef52953e97330e Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Sat, 29 Nov 2025 15:36:53 -0500 Subject: [PATCH 235/333] Fully destroy call operator write arguments If we are about to delete a call operator write argument, it needs to be removed from the list of block exits as well. --- src/prism.c | 38 +++++++++++++++++++ .../destroy_call_operator_write_arguments.txt | 11 ++++++ 2 files changed, 49 insertions(+) create mode 100644 test/prism/errors/destroy_call_operator_write_arguments.txt diff --git a/src/prism.c b/src/prism.c index 3d60e008c4..60d45cbcd2 100644 --- a/src/prism.c +++ b/src/prism.c @@ -21062,6 +21062,42 @@ parse_assignment_values(pm_parser_t *parser, pm_binding_power_t previous_binding return value; } +static bool +parse_call_operator_write_block_exits_each(const pm_node_t *node, void *data) { + pm_parser_t *parser = (pm_parser_t *) data; + size_t index = 0; + + while (index < parser->current_block_exits->size) { + pm_node_t *block_exit = parser->current_block_exits->nodes[index]; + + if (block_exit == node) { + if (index + 1 < parser->current_block_exits->size) { + memmove( + &parser->current_block_exits->nodes[index], + &parser->current_block_exits->nodes[index + 1], + (parser->current_block_exits->size - index - 1) * sizeof(pm_node_t *) + ); + } + parser->current_block_exits->size--; + return false; + } + + index++; + } + + return true; +} + +/** + * When we are about to destroy a set of nodes that could potentially contain + * block exits for the current scope, we need to check if they are contained in + * the list of block exits and remove them if they are. + */ +static void +parse_call_operator_write_block_exits(pm_parser_t *parser, const pm_node_t *node) { + pm_visit_node(node, parse_call_operator_write_block_exits_each, parser); +} + /** * Ensure a call node that is about to become a call operator node does not * have arguments or a block attached. If it does, then we'll need to add an @@ -21073,12 +21109,14 @@ static void parse_call_operator_write(pm_parser_t *parser, pm_call_node_t *call_node, const pm_token_t *operator) { if (call_node->arguments != NULL) { pm_parser_err_token(parser, operator, PM_ERR_OPERATOR_WRITE_ARGUMENTS); + parse_call_operator_write_block_exits(parser, (pm_node_t *) call_node->arguments); pm_node_destroy(parser, (pm_node_t *) call_node->arguments); call_node->arguments = NULL; } if (call_node->block != NULL) { pm_parser_err_token(parser, operator, PM_ERR_OPERATOR_WRITE_BLOCK); + parse_call_operator_write_block_exits(parser, (pm_node_t *) call_node->block); pm_node_destroy(parser, (pm_node_t *) call_node->block); call_node->block = NULL; } diff --git a/test/prism/errors/destroy_call_operator_write_arguments.txt b/test/prism/errors/destroy_call_operator_write_arguments.txt new file mode 100644 index 0000000000..c3c72f9226 --- /dev/null +++ b/test/prism/errors/destroy_call_operator_write_arguments.txt @@ -0,0 +1,11 @@ +t next&&do end&= + ^~ unexpected 'do'; expected an expression after the operator + ^~~~ unexpected void value expression + ^~~~ unexpected void value expression +^~~~~~~~~~~~~~ unexpected write target + ^~ unexpected operator after a call with arguments + ^~ unexpected operator after a call with a block +''while= + ^~~~~ expected a predicate expression for the `while` statement + ^ unexpected '='; target cannot be written + From b960079559d2c6008b1f46399fb794970a73013e Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Sat, 29 Nov 2025 15:51:06 -0500 Subject: [PATCH 236/333] Revert "Fix invalid Ruby code example in ClassNode comment" --- config.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/config.yml b/config.yml index 36becff28d..5e29d6fa18 100644 --- a/config.yml +++ b/config.yml @@ -1860,7 +1860,7 @@ nodes: comment: | Represents the location of the `class` keyword. - class Foo; end + class Foo end ^^^^^ - name: constant_path type: node @@ -1899,19 +1899,19 @@ nodes: comment: | Represents the location of the `end` keyword. - class Foo; end - ^^^ + class Foo end + ^^^ - name: name type: constant comment: | The name of the class. - class Foo; end # name `:Foo` + class Foo end # name `:Foo` comment: | Represents a class declaration involving the `class` keyword. - class Foo; end - ^^^^^^^^^^^^^^ + class Foo end + ^^^^^^^^^^^^^ - name: ClassVariableAndWriteNode fields: - name: name From 78925fe5b6420b3106ec0151888b3dfd0374a376 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Sat, 29 Nov 2025 15:58:10 -0500 Subject: [PATCH 237/333] Update unicode tables to match that of CRuby The unicode version has been updated upstream, which means new codepoints mapped to alpha/alnum/isupper flags. We need to update our tables to match. I'm purposefully not adding a version check here, since that is such a large amount of code. It's possible that we could include different tables depending on a macro (like UNICODE_VERSION) or something to that effect, but it's such a minimal impact on the running of the actual parser that I don't think it's necessary. --- src/encoding.c | 155 +++++++++++++++++++------- test/prism/encoding/encodings_test.rb | 18 +-- 2 files changed, 118 insertions(+), 55 deletions(-) diff --git a/src/encoding.c b/src/encoding.c index a4aeed104f..424f149b8f 100644 --- a/src/encoding.c +++ b/src/encoding.c @@ -2,7 +2,7 @@ typedef uint32_t pm_unicode_codepoint_t; -#define UNICODE_ALPHA_CODEPOINTS_LENGTH 1450 +#define UNICODE_ALPHA_CODEPOINTS_LENGTH 1508 static const pm_unicode_codepoint_t unicode_alpha_codepoints[UNICODE_ALPHA_CODEPOINTS_LENGTH] = { 0x100, 0x2C1, 0x2C6, 0x2D1, @@ -10,7 +10,7 @@ static const pm_unicode_codepoint_t unicode_alpha_codepoints[UNICODE_ALPHA_CODEP 0x2EC, 0x2EC, 0x2EE, 0x2EE, 0x345, 0x345, - 0x370, 0x374, + 0x363, 0x374, 0x376, 0x377, 0x37A, 0x37D, 0x37F, 0x37F, @@ -50,7 +50,8 @@ static const pm_unicode_codepoint_t unicode_alpha_codepoints[UNICODE_ALPHA_CODEP 0x840, 0x858, 0x860, 0x86A, 0x870, 0x887, - 0x889, 0x88E, + 0x889, 0x88F, + 0x897, 0x897, 0x8A0, 0x8C9, 0x8D4, 0x8DF, 0x8E3, 0x8E9, @@ -140,7 +141,7 @@ static const pm_unicode_codepoint_t unicode_alpha_codepoints[UNICODE_ALPHA_CODEP 0xC4A, 0xC4C, 0xC55, 0xC56, 0xC58, 0xC5A, - 0xC5D, 0xC5D, + 0xC5C, 0xC5D, 0xC60, 0xC63, 0xC80, 0xC83, 0xC85, 0xC8C, @@ -152,7 +153,7 @@ static const pm_unicode_codepoint_t unicode_alpha_codepoints[UNICODE_ALPHA_CODEP 0xCC6, 0xCC8, 0xCCA, 0xCCC, 0xCD5, 0xCD6, - 0xCDD, 0xCDE, + 0xCDC, 0xCDE, 0xCE0, 0xCE3, 0xCF1, 0xCF3, 0xD00, 0xD0C, @@ -264,7 +265,7 @@ static const pm_unicode_codepoint_t unicode_alpha_codepoints[UNICODE_ALPHA_CODEP 0x1C00, 0x1C36, 0x1C4D, 0x1C4F, 0x1C5A, 0x1C7D, - 0x1C80, 0x1C88, + 0x1C80, 0x1C8A, 0x1C90, 0x1CBA, 0x1CBD, 0x1CBF, 0x1CE9, 0x1CEC, @@ -272,7 +273,7 @@ static const pm_unicode_codepoint_t unicode_alpha_codepoints[UNICODE_ALPHA_CODEP 0x1CF5, 0x1CF6, 0x1CFA, 0x1CFA, 0x1D00, 0x1DBF, - 0x1DE7, 0x1DF4, + 0x1DD3, 0x1DF4, 0x1E00, 0x1F15, 0x1F18, 0x1F1D, 0x1F20, 0x1F45, @@ -352,11 +353,8 @@ static const pm_unicode_codepoint_t unicode_alpha_codepoints[UNICODE_ALPHA_CODEP 0xA67F, 0xA6EF, 0xA717, 0xA71F, 0xA722, 0xA788, - 0xA78B, 0xA7CA, - 0xA7D0, 0xA7D1, - 0xA7D3, 0xA7D3, - 0xA7D5, 0xA7D9, - 0xA7F2, 0xA805, + 0xA78B, 0xA7DC, + 0xA7F1, 0xA805, 0xA807, 0xA827, 0xA840, 0xA873, 0xA880, 0xA8C3, @@ -446,6 +444,7 @@ static const pm_unicode_codepoint_t unicode_alpha_codepoints[UNICODE_ALPHA_CODEP 0x105A3, 0x105B1, 0x105B3, 0x105B9, 0x105BB, 0x105BC, + 0x105C0, 0x105F3, 0x10600, 0x10736, 0x10740, 0x10755, 0x10760, 0x10767, @@ -464,6 +463,7 @@ static const pm_unicode_codepoint_t unicode_alpha_codepoints[UNICODE_ALPHA_CODEP 0x108F4, 0x108F5, 0x10900, 0x10915, 0x10920, 0x10939, + 0x10940, 0x10959, 0x10980, 0x109B7, 0x109BE, 0x109BF, 0x10A00, 0x10A03, @@ -483,9 +483,14 @@ static const pm_unicode_codepoint_t unicode_alpha_codepoints[UNICODE_ALPHA_CODEP 0x10C80, 0x10CB2, 0x10CC0, 0x10CF2, 0x10D00, 0x10D27, + 0x10D4A, 0x10D65, + 0x10D69, 0x10D69, + 0x10D6F, 0x10D85, 0x10E80, 0x10EA9, 0x10EAB, 0x10EAC, 0x10EB0, 0x10EB1, + 0x10EC2, 0x10EC7, + 0x10EFA, 0x10EFC, 0x10F00, 0x10F1C, 0x10F27, 0x10F27, 0x10F30, 0x10F45, @@ -529,6 +534,17 @@ static const pm_unicode_codepoint_t unicode_alpha_codepoints[UNICODE_ALPHA_CODEP 0x11350, 0x11350, 0x11357, 0x11357, 0x1135D, 0x11363, + 0x11380, 0x11389, + 0x1138B, 0x1138B, + 0x1138E, 0x1138E, + 0x11390, 0x113B5, + 0x113B7, 0x113C0, + 0x113C2, 0x113C2, + 0x113C5, 0x113C5, + 0x113C7, 0x113CA, + 0x113CC, 0x113CD, + 0x113D1, 0x113D1, + 0x113D3, 0x113D3, 0x11400, 0x11441, 0x11443, 0x11445, 0x11447, 0x1144A, @@ -567,6 +583,8 @@ static const pm_unicode_codepoint_t unicode_alpha_codepoints[UNICODE_ALPHA_CODEP 0x11A50, 0x11A97, 0x11A9D, 0x11A9D, 0x11AB0, 0x11AF8, + 0x11B60, 0x11B67, + 0x11BC0, 0x11BE0, 0x11C00, 0x11C08, 0x11C0A, 0x11C36, 0x11C38, 0x11C3E, @@ -588,6 +606,7 @@ static const pm_unicode_codepoint_t unicode_alpha_codepoints[UNICODE_ALPHA_CODEP 0x11D90, 0x11D91, 0x11D93, 0x11D96, 0x11D98, 0x11D98, + 0x11DB0, 0x11DDB, 0x11EE0, 0x11EF6, 0x11F00, 0x11F10, 0x11F12, 0x11F3A, @@ -599,7 +618,9 @@ static const pm_unicode_codepoint_t unicode_alpha_codepoints[UNICODE_ALPHA_CODEP 0x12F90, 0x12FF0, 0x13000, 0x1342F, 0x13441, 0x13446, + 0x13460, 0x143FA, 0x14400, 0x14646, + 0x16100, 0x1612E, 0x16800, 0x16A38, 0x16A40, 0x16A5E, 0x16A70, 0x16ABE, @@ -608,16 +629,19 @@ static const pm_unicode_codepoint_t unicode_alpha_codepoints[UNICODE_ALPHA_CODEP 0x16B40, 0x16B43, 0x16B63, 0x16B77, 0x16B7D, 0x16B8F, + 0x16D40, 0x16D6C, 0x16E40, 0x16E7F, + 0x16EA0, 0x16EB8, + 0x16EBB, 0x16ED3, 0x16F00, 0x16F4A, 0x16F4F, 0x16F87, 0x16F8F, 0x16F9F, 0x16FE0, 0x16FE1, 0x16FE3, 0x16FE3, - 0x16FF0, 0x16FF1, - 0x17000, 0x187F7, - 0x18800, 0x18CD5, - 0x18D00, 0x18D08, + 0x16FF0, 0x16FF6, + 0x17000, 0x18CD5, + 0x18CFF, 0x18D1E, + 0x18D80, 0x18DF2, 0x1AFF0, 0x1AFF3, 0x1AFF5, 0x1AFFB, 0x1AFFD, 0x1AFFE, @@ -677,6 +701,11 @@ static const pm_unicode_codepoint_t unicode_alpha_codepoints[UNICODE_ALPHA_CODEP 0x1E290, 0x1E2AD, 0x1E2C0, 0x1E2EB, 0x1E4D0, 0x1E4EB, + 0x1E5D0, 0x1E5ED, + 0x1E5F0, 0x1E5F0, + 0x1E6C0, 0x1E6DE, + 0x1E6E0, 0x1E6F5, + 0x1E6FE, 0x1E6FF, 0x1E7E0, 0x1E7E6, 0x1E7E8, 0x1E7EB, 0x1E7ED, 0x1E7EE, @@ -722,16 +751,16 @@ static const pm_unicode_codepoint_t unicode_alpha_codepoints[UNICODE_ALPHA_CODEP 0x1F150, 0x1F169, 0x1F170, 0x1F189, 0x20000, 0x2A6DF, - 0x2A700, 0x2B739, - 0x2B740, 0x2B81D, - 0x2B820, 0x2CEA1, + 0x2A700, 0x2B81D, + 0x2B820, 0x2CEAD, 0x2CEB0, 0x2EBE0, + 0x2EBF0, 0x2EE5D, 0x2F800, 0x2FA1D, 0x30000, 0x3134A, - 0x31350, 0x323AF, + 0x31350, 0x33479, }; -#define UNICODE_ALNUM_CODEPOINTS_LENGTH 1528 +#define UNICODE_ALNUM_CODEPOINTS_LENGTH 1598 static const pm_unicode_codepoint_t unicode_alnum_codepoints[UNICODE_ALNUM_CODEPOINTS_LENGTH] = { 0x100, 0x2C1, 0x2C6, 0x2D1, @@ -739,7 +768,7 @@ static const pm_unicode_codepoint_t unicode_alnum_codepoints[UNICODE_ALNUM_CODEP 0x2EC, 0x2EC, 0x2EE, 0x2EE, 0x345, 0x345, - 0x370, 0x374, + 0x363, 0x374, 0x376, 0x377, 0x37A, 0x37D, 0x37F, 0x37F, @@ -778,7 +807,8 @@ static const pm_unicode_codepoint_t unicode_alnum_codepoints[UNICODE_ALNUM_CODEP 0x840, 0x858, 0x860, 0x86A, 0x870, 0x887, - 0x889, 0x88E, + 0x889, 0x88F, + 0x897, 0x897, 0x8A0, 0x8C9, 0x8D4, 0x8DF, 0x8E3, 0x8E9, @@ -872,7 +902,7 @@ static const pm_unicode_codepoint_t unicode_alnum_codepoints[UNICODE_ALNUM_CODEP 0xC4A, 0xC4C, 0xC55, 0xC56, 0xC58, 0xC5A, - 0xC5D, 0xC5D, + 0xC5C, 0xC5D, 0xC60, 0xC63, 0xC66, 0xC6F, 0xC80, 0xC83, @@ -885,7 +915,7 @@ static const pm_unicode_codepoint_t unicode_alnum_codepoints[UNICODE_ALNUM_CODEP 0xCC6, 0xCC8, 0xCCA, 0xCCC, 0xCD5, 0xCD6, - 0xCDD, 0xCDE, + 0xCDC, 0xCDE, 0xCE0, 0xCE3, 0xCE6, 0xCEF, 0xCF1, 0xCF3, @@ -1007,7 +1037,7 @@ static const pm_unicode_codepoint_t unicode_alnum_codepoints[UNICODE_ALNUM_CODEP 0x1C00, 0x1C36, 0x1C40, 0x1C49, 0x1C4D, 0x1C7D, - 0x1C80, 0x1C88, + 0x1C80, 0x1C8A, 0x1C90, 0x1CBA, 0x1CBD, 0x1CBF, 0x1CE9, 0x1CEC, @@ -1015,7 +1045,7 @@ static const pm_unicode_codepoint_t unicode_alnum_codepoints[UNICODE_ALNUM_CODEP 0x1CF5, 0x1CF6, 0x1CFA, 0x1CFA, 0x1D00, 0x1DBF, - 0x1DE7, 0x1DF4, + 0x1DD3, 0x1DF4, 0x1E00, 0x1F15, 0x1F18, 0x1F1D, 0x1F20, 0x1F45, @@ -1094,11 +1124,8 @@ static const pm_unicode_codepoint_t unicode_alnum_codepoints[UNICODE_ALNUM_CODEP 0xA67F, 0xA6EF, 0xA717, 0xA71F, 0xA722, 0xA788, - 0xA78B, 0xA7CA, - 0xA7D0, 0xA7D1, - 0xA7D3, 0xA7D3, - 0xA7D5, 0xA7D9, - 0xA7F2, 0xA805, + 0xA78B, 0xA7DC, + 0xA7F1, 0xA805, 0xA807, 0xA827, 0xA840, 0xA873, 0xA880, 0xA8C3, @@ -1191,6 +1218,7 @@ static const pm_unicode_codepoint_t unicode_alnum_codepoints[UNICODE_ALNUM_CODEP 0x105A3, 0x105B1, 0x105B3, 0x105B9, 0x105BB, 0x105BC, + 0x105C0, 0x105F3, 0x10600, 0x10736, 0x10740, 0x10755, 0x10760, 0x10767, @@ -1209,6 +1237,7 @@ static const pm_unicode_codepoint_t unicode_alnum_codepoints[UNICODE_ALNUM_CODEP 0x108F4, 0x108F5, 0x10900, 0x10915, 0x10920, 0x10939, + 0x10940, 0x10959, 0x10980, 0x109B7, 0x109BE, 0x109BF, 0x10A00, 0x10A03, @@ -1229,9 +1258,14 @@ static const pm_unicode_codepoint_t unicode_alnum_codepoints[UNICODE_ALNUM_CODEP 0x10CC0, 0x10CF2, 0x10D00, 0x10D27, 0x10D30, 0x10D39, + 0x10D40, 0x10D65, + 0x10D69, 0x10D69, + 0x10D6F, 0x10D85, 0x10E80, 0x10EA9, 0x10EAB, 0x10EAC, 0x10EB0, 0x10EB1, + 0x10EC2, 0x10EC7, + 0x10EFA, 0x10EFC, 0x10F00, 0x10F1C, 0x10F27, 0x10F27, 0x10F30, 0x10F45, @@ -1278,6 +1312,17 @@ static const pm_unicode_codepoint_t unicode_alnum_codepoints[UNICODE_ALNUM_CODEP 0x11350, 0x11350, 0x11357, 0x11357, 0x1135D, 0x11363, + 0x11380, 0x11389, + 0x1138B, 0x1138B, + 0x1138E, 0x1138E, + 0x11390, 0x113B5, + 0x113B7, 0x113C0, + 0x113C2, 0x113C2, + 0x113C5, 0x113C5, + 0x113C7, 0x113CA, + 0x113CC, 0x113CD, + 0x113D1, 0x113D1, + 0x113D3, 0x113D3, 0x11400, 0x11441, 0x11443, 0x11445, 0x11447, 0x1144A, @@ -1297,6 +1342,7 @@ static const pm_unicode_codepoint_t unicode_alnum_codepoints[UNICODE_ALNUM_CODEP 0x11680, 0x116B5, 0x116B8, 0x116B8, 0x116C0, 0x116C9, + 0x116D0, 0x116E3, 0x11700, 0x1171A, 0x1171D, 0x1172A, 0x11730, 0x11739, @@ -1322,6 +1368,9 @@ static const pm_unicode_codepoint_t unicode_alnum_codepoints[UNICODE_ALNUM_CODEP 0x11A50, 0x11A97, 0x11A9D, 0x11A9D, 0x11AB0, 0x11AF8, + 0x11B60, 0x11B67, + 0x11BC0, 0x11BE0, + 0x11BF0, 0x11BF9, 0x11C00, 0x11C08, 0x11C0A, 0x11C36, 0x11C38, 0x11C3E, @@ -1346,6 +1395,8 @@ static const pm_unicode_codepoint_t unicode_alnum_codepoints[UNICODE_ALNUM_CODEP 0x11D93, 0x11D96, 0x11D98, 0x11D98, 0x11DA0, 0x11DA9, + 0x11DB0, 0x11DDB, + 0x11DE0, 0x11DE9, 0x11EE0, 0x11EF6, 0x11F00, 0x11F10, 0x11F12, 0x11F3A, @@ -1358,7 +1409,10 @@ static const pm_unicode_codepoint_t unicode_alnum_codepoints[UNICODE_ALNUM_CODEP 0x12F90, 0x12FF0, 0x13000, 0x1342F, 0x13441, 0x13446, + 0x13460, 0x143FA, 0x14400, 0x14646, + 0x16100, 0x1612E, + 0x16130, 0x16139, 0x16800, 0x16A38, 0x16A40, 0x16A5E, 0x16A60, 0x16A69, @@ -1370,16 +1424,20 @@ static const pm_unicode_codepoint_t unicode_alnum_codepoints[UNICODE_ALNUM_CODEP 0x16B50, 0x16B59, 0x16B63, 0x16B77, 0x16B7D, 0x16B8F, + 0x16D40, 0x16D6C, + 0x16D70, 0x16D79, 0x16E40, 0x16E7F, + 0x16EA0, 0x16EB8, + 0x16EBB, 0x16ED3, 0x16F00, 0x16F4A, 0x16F4F, 0x16F87, 0x16F8F, 0x16F9F, 0x16FE0, 0x16FE1, 0x16FE3, 0x16FE3, - 0x16FF0, 0x16FF1, - 0x17000, 0x187F7, - 0x18800, 0x18CD5, - 0x18D00, 0x18D08, + 0x16FF0, 0x16FF6, + 0x17000, 0x18CD5, + 0x18CFF, 0x18D1E, + 0x18D80, 0x18DF2, 0x1AFF0, 0x1AFF3, 0x1AFF5, 0x1AFFB, 0x1AFFD, 0x1AFFE, @@ -1394,6 +1452,7 @@ static const pm_unicode_codepoint_t unicode_alnum_codepoints[UNICODE_ALNUM_CODEP 0x1BC80, 0x1BC88, 0x1BC90, 0x1BC99, 0x1BC9E, 0x1BC9E, + 0x1CCF0, 0x1CCF9, 0x1D400, 0x1D454, 0x1D456, 0x1D49C, 0x1D49E, 0x1D49F, @@ -1443,6 +1502,11 @@ static const pm_unicode_codepoint_t unicode_alnum_codepoints[UNICODE_ALNUM_CODEP 0x1E2F0, 0x1E2F9, 0x1E4D0, 0x1E4EB, 0x1E4F0, 0x1E4F9, + 0x1E5D0, 0x1E5ED, + 0x1E5F0, 0x1E5FA, + 0x1E6C0, 0x1E6DE, + 0x1E6E0, 0x1E6F5, + 0x1E6FE, 0x1E6FF, 0x1E7E0, 0x1E7E6, 0x1E7E8, 0x1E7EB, 0x1E7ED, 0x1E7EE, @@ -1490,16 +1554,16 @@ static const pm_unicode_codepoint_t unicode_alnum_codepoints[UNICODE_ALNUM_CODEP 0x1F170, 0x1F189, 0x1FBF0, 0x1FBF9, 0x20000, 0x2A6DF, - 0x2A700, 0x2B739, - 0x2B740, 0x2B81D, - 0x2B820, 0x2CEA1, + 0x2A700, 0x2B81D, + 0x2B820, 0x2CEAD, 0x2CEB0, 0x2EBE0, + 0x2EBF0, 0x2EE5D, 0x2F800, 0x2FA1D, 0x30000, 0x3134A, - 0x31350, 0x323AF, + 0x31350, 0x33479, }; -#define UNICODE_ISUPPER_CODEPOINTS_LENGTH 1302 +#define UNICODE_ISUPPER_CODEPOINTS_LENGTH 1320 static const pm_unicode_codepoint_t unicode_isupper_codepoints[UNICODE_ISUPPER_CODEPOINTS_LENGTH] = { 0x100, 0x100, 0x102, 0x102, @@ -1774,6 +1838,7 @@ static const pm_unicode_codepoint_t unicode_isupper_codepoints[UNICODE_ISUPPER_C 0x10C7, 0x10C7, 0x10CD, 0x10CD, 0x13A0, 0x13F5, + 0x1C89, 0x1C89, 0x1C90, 0x1CBA, 0x1CBD, 0x1CBF, 0x1E00, 0x1E00, @@ -2103,9 +2168,15 @@ static const pm_unicode_codepoint_t unicode_isupper_codepoints[UNICODE_ISUPPER_C 0xA7C2, 0xA7C2, 0xA7C4, 0xA7C7, 0xA7C9, 0xA7C9, + 0xA7CB, 0xA7CC, + 0xA7CE, 0xA7CE, 0xA7D0, 0xA7D0, + 0xA7D2, 0xA7D2, + 0xA7D4, 0xA7D4, 0xA7D6, 0xA7D6, 0xA7D8, 0xA7D8, + 0xA7DA, 0xA7DA, + 0xA7DC, 0xA7DC, 0xA7F5, 0xA7F5, 0xFF21, 0xFF3A, 0x10400, 0x10427, @@ -2115,8 +2186,10 @@ static const pm_unicode_codepoint_t unicode_isupper_codepoints[UNICODE_ISUPPER_C 0x1058C, 0x10592, 0x10594, 0x10595, 0x10C80, 0x10CB2, + 0x10D50, 0x10D65, 0x118A0, 0x118BF, 0x16E40, 0x16E5F, + 0x16EA0, 0x16EB8, 0x1D400, 0x1D419, 0x1D434, 0x1D44D, 0x1D468, 0x1D481, diff --git a/test/prism/encoding/encodings_test.rb b/test/prism/encoding/encodings_test.rb index 4ad2b465cc..b008fc3fa1 100644 --- a/test/prism/encoding/encodings_test.rb +++ b/test/prism/encoding/encodings_test.rb @@ -56,21 +56,11 @@ def assert_encoding_identifier(name, character) # Check that we can properly parse every codepoint in the given encoding. def assert_encoding(encoding, name, range) - # I'm not entirely sure, but I believe these codepoints are incorrect in - # their parsing in CRuby. They all report as matching `[[:lower:]]` but - # then they are parsed as constants. This is because CRuby determines if - # an identifier is a constant or not by case folding it down to lowercase - # and checking if there is a difference. And even though they report - # themselves as lowercase, their case fold is different. I have reported - # this bug upstream. + unicode = false + case encoding when Encoding::UTF_8, Encoding::UTF_8_MAC, Encoding::UTF8_DoCoMo, Encoding::UTF8_KDDI, Encoding::UTF8_SoftBank, Encoding::CESU_8 - range = range.to_a - [ - 0x01c5, 0x01c8, 0x01cb, 0x01f2, 0x1f88, 0x1f89, 0x1f8a, 0x1f8b, - 0x1f8c, 0x1f8d, 0x1f8e, 0x1f8f, 0x1f98, 0x1f99, 0x1f9a, 0x1f9b, - 0x1f9c, 0x1f9d, 0x1f9e, 0x1f9f, 0x1fa8, 0x1fa9, 0x1faa, 0x1fab, - 0x1fac, 0x1fad, 0x1fae, 0x1faf, 0x1fbc, 0x1fcc, 0x1ffc, - ] + unicode = true when Encoding::Windows_1253 range = range.to_a - [0xb5] end @@ -79,7 +69,7 @@ def assert_encoding(encoding, name, range) character = codepoint.chr(encoding) if character.match?(/[[:alpha:]]/) - if character.match?(/[[:upper:]]/) + if character.match?(/[[:upper:]]/) || (unicode && character.match?(Regexp.new("\\p{Lt}".encode(encoding)))) assert_encoding_constant(name, character) else assert_encoding_identifier(name, character) From add4e2eddb4d69cd0fb5dcc274cfb7cca790b647 Mon Sep 17 00:00:00 2001 From: Earlopain <14981592+Earlopain@users.noreply.github.com> Date: Sun, 30 Nov 2025 16:24:04 +0100 Subject: [PATCH 238/333] Add `bin/compare` Allows to compare the output of two different prism versions. It compiles prism twice and forks to allow for different versions in the same script. It then passes over minimal data to see if anything has changed. Most bugfixes should impact little to no real code and the test suite is already very extensive. Running this can give you even more confidence by comparing against real-world-rails or similar. There are some performance gains to be had here. Basically it is already parallelized because of `fork` but it can likely be even better. For simplicity (and because I don't usually write such code) I leave that as an exercise for the future. Just check it manually via the already existing tools. --- bin/compare | 108 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 108 insertions(+) create mode 100755 bin/compare diff --git a/bin/compare b/bin/compare new file mode 100755 index 0000000000..347c28a01a --- /dev/null +++ b/bin/compare @@ -0,0 +1,108 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +# Usage: bin/compare main feature-branch . + +$:.unshift(File.expand_path("../lib", __dir__)) + +require "json" +require "socket" + +def create_prism(ref) + parent_socket, child_socket = UNIXSocket.pair + + system("git checkout #{ref}", exception: true) + system("bundle exec rake compile", exception: true) + + pid = fork do + parent_socket.close + require "prism" + + child_socket.puts("Compiling done for #{ref}") + + while (data = child_socket.gets(chomp: true)) + command, path = data.split("\x00", 2) + case command + when "dump" + begin + child_socket.puts(Prism.dump_file(path).hash) + rescue Errno::EISDIR + # Folder might end with `.rb` and get caught by the glob + child_socket.puts("") + end + when "details" + parse_result = Prism.parse_file(path) + child_socket.puts({ + valid: parse_result.success?, + errors: parse_result.errors_format.hash, + ast: parse_result.value.inspect.hash, + }.to_json) + else + raise "Unknown command #{command}" + end + end + + exit!(0) + end + + child_socket.close + parent_socket.gets + [pid, parent_socket] +end + +base_ref = ARGV.shift +compare_ref = ARGV.shift +path = ARGV.shift + +pid_baseline, socket_baseline = create_prism(base_ref) +pid_compare, socket_compare = create_prism(compare_ref) + +result = +"" +files = Dir.glob(File.join(path, "**/*.rb")) + +start = Process.clock_gettime(Process::CLOCK_MONOTONIC) + +def what_changed(baseline, compare, source_path) + if baseline[:valid] != compare[:valid] + "#{source_path} changed from valid(#{baseline[:valid]}) to valid(#{compare[:valid]})" + elsif baseline[:valid] && compare[:valid] && baseline[:ast] != compare[:ast] + "#{source_path} is syntax valid with changed ast}" + elsif !baseline[:valid] && !compare[:valid] && baseline[:errors] != compare[:errors] + "#{source_path} is syntax invalid with changed errors" + else + raise "Unknown condition for #{source_path}" + end +end + +files.each_with_index do |source_path, i| + puts "#{i}/#{files.size}" if i % 1000 == 0 + + socket_baseline.puts("dump\x00#{source_path}") + socket_compare.puts("dump\x00#{source_path}") + + dump_baseline = socket_baseline.gets(chomp: true) + dump_compare = socket_compare.gets(chomp: true) + + if dump_baseline != dump_compare + socket_baseline.puts("details\x00#{source_path}") + socket_compare.puts("details\x00#{source_path}") + + details_baseline = JSON.parse(socket_baseline.gets(chomp: true), symbolize_names: true) + details_compare = JSON.parse(socket_compare.gets(chomp: true), symbolize_names: true) + result << what_changed(details_baseline, details_compare, source_path) + "\n" + end +end + +if result.empty? + puts "All good!" +else + puts "Oops:" + puts result +end + +puts "Took #{Process.clock_gettime(Process::CLOCK_MONOTONIC) - start} seconds" + +socket_baseline.close +socket_compare.close +Process.wait(pid_baseline) +Process.wait(pid_compare) From 17b246fd6aef357711d70093f34fc6bbd35b54e1 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Sun, 30 Nov 2025 20:25:55 -0500 Subject: [PATCH 239/333] Properly remove references --- src/prism.c | 183 ++++++++++++++++++++++++++-------------------------- 1 file changed, 90 insertions(+), 93 deletions(-) diff --git a/src/prism.c b/src/prism.c index 8c886bb050..58a6a9987d 100644 --- a/src/prism.c +++ b/src/prism.c @@ -13404,6 +13404,78 @@ parse_starred_expression(pm_parser_t *parser, pm_binding_power_t binding_power, return parse_value_expression(parser, binding_power, accepts_command_call, false, diag_id, depth); } +static bool +pm_node_unreference_each(const pm_node_t *node, void *data) { + switch (PM_NODE_TYPE(node)) { + /* When we are about to destroy a set of nodes that could potentially + * contain block exits for the current scope, we need to check if they + * are contained in the list of block exits and remove them if they are. + */ + case PM_BREAK_NODE: + case PM_NEXT_NODE: + case PM_REDO_NODE: { + pm_parser_t *parser = (pm_parser_t *) data; + size_t index = 0; + + while (index < parser->current_block_exits->size) { + pm_node_t *block_exit = parser->current_block_exits->nodes[index]; + + if (block_exit == node) { + if (index + 1 < parser->current_block_exits->size) { + memmove( + &parser->current_block_exits->nodes[index], + &parser->current_block_exits->nodes[index + 1], + (parser->current_block_exits->size - index - 1) * sizeof(pm_node_t *) + ); + } + parser->current_block_exits->size--; + return false; + } + + index++; + } + + return true; + } + /* When an implicit local variable is written to or targeted, it becomes + * a regular, named local variable. This branch removes it from the list + * of implicit parameters when that happens. */ + case PM_LOCAL_VARIABLE_READ_NODE: + case PM_IT_LOCAL_VARIABLE_READ_NODE: { + pm_parser_t *parser = (pm_parser_t *) data; + pm_node_list_t *implicit_parameters = &parser->current_scope->implicit_parameters; + + for (size_t index = 0; index < implicit_parameters->size; index++) { + if (implicit_parameters->nodes[index] == node) { + /* If the node is not the last one in the list, we need to + * shift the remaining nodes down to fill the gap. This is + * extremely unlikely to happen. */ + if (index != implicit_parameters->size - 1) { + memmove(&implicit_parameters->nodes[index], &implicit_parameters->nodes[index + 1], (implicit_parameters->size - index - 1) * sizeof(pm_node_t *)); + } + + implicit_parameters->size--; + break; + } + } + + return false; + } + default: + return true; + } +} + +/** + * When we are about to destroy a set of nodes that could potentially be + * referenced by one or more lists on the parser, then remove them from those + * lists so we don't get a use-after-free. + */ +static void +pm_node_unreference(pm_parser_t *parser, const pm_node_t *node) { + pm_visit_node(node, pm_node_unreference_each, parser); +} + /** * Convert the name of a method into the corresponding write method name. For * example, foo would be turned into foo=. @@ -13454,45 +13526,6 @@ parse_unwriteable_target(pm_parser_t *parser, pm_node_t *target) { return (pm_node_t *) result; } -static bool -parse_target_implicit_parameter_each(const pm_node_t *node, void *data) { - switch (PM_NODE_TYPE(node)) { - case PM_LOCAL_VARIABLE_READ_NODE: - case PM_IT_LOCAL_VARIABLE_READ_NODE: { - pm_parser_t *parser = (pm_parser_t *) data; - pm_node_list_t *implicit_parameters = &parser->current_scope->implicit_parameters; - - for (size_t index = 0; index < implicit_parameters->size; index++) { - if (implicit_parameters->nodes[index] == node) { - // If the node is not the last one in the list, we need to - // shift the remaining nodes down to fill the gap. This is - // extremely unlikely to happen. - if (index != implicit_parameters->size - 1) { - memmove(&implicit_parameters->nodes[index], &implicit_parameters->nodes[index + 1], (implicit_parameters->size - index - 1) * sizeof(pm_node_t *)); - } - - implicit_parameters->size--; - break; - } - } - - return false; - } - default: - return true; - } -} - -/** - * When an implicit local variable is written to or targeted, it becomes a - * regular, named local variable. This function removes it from the list of - * implicit parameters when that happens. - */ -static void -parse_target_implicit_parameter(pm_parser_t *parser, const pm_node_t *node) { - pm_visit_node(node, parse_target_implicit_parameter_each, parser); -} - /** * Convert the given node into a valid target node. * @@ -13550,7 +13583,7 @@ parse_target(pm_parser_t *parser, pm_node_t *target, bool multiple, bool splat_p case PM_LOCAL_VARIABLE_READ_NODE: { if (pm_token_is_numbered_parameter(target->location.start, target->location.end)) { PM_PARSER_ERR_FORMAT(parser, target->location.start, target->location.end, PM_ERR_PARAMETER_NUMBERED_RESERVED, target->location.start); - parse_target_implicit_parameter(parser, target); + pm_node_unreference(parser, target); } const pm_local_variable_read_node_t *cast = (const pm_local_variable_read_node_t *) target; @@ -13567,7 +13600,7 @@ parse_target(pm_parser_t *parser, pm_node_t *target, bool multiple, bool splat_p pm_constant_id_t name = pm_parser_local_add_constant(parser, "it", 2); pm_node_t *node = (pm_node_t *) pm_local_variable_target_node_create(parser, &target->location, name, 0); - parse_target_implicit_parameter(parser, target); + pm_node_unreference(parser, target); pm_node_destroy(parser, target); return node; @@ -13742,7 +13775,7 @@ parse_write(pm_parser_t *parser, pm_node_t *target, pm_token_t *operator, pm_nod if (pm_token_is_numbered_parameter(target->location.start, target->location.end)) { pm_diagnostic_id_t diag_id = (scope->parameters & PM_SCOPE_PARAMETERS_NUMBERED_FOUND) ? PM_ERR_EXPRESSION_NOT_WRITABLE_NUMBERED : PM_ERR_PARAMETER_NUMBERED_RESERVED; PM_PARSER_ERR_FORMAT(parser, target->location.start, target->location.end, diag_id, target->location.start); - parse_target_implicit_parameter(parser, target); + pm_node_unreference(parser, target); } pm_locals_unread(&scope->locals, name); @@ -13754,7 +13787,7 @@ parse_write(pm_parser_t *parser, pm_node_t *target, pm_token_t *operator, pm_nod pm_constant_id_t name = pm_parser_local_add_constant(parser, "it", 2); pm_node_t *node = (pm_node_t *) pm_local_variable_write_node_create(parser, name, 0, value, &target->location, operator); - parse_target_implicit_parameter(parser, target); + pm_node_unreference(parser, target); pm_node_destroy(parser, target); return node; @@ -13861,9 +13894,9 @@ parse_write(pm_parser_t *parser, pm_node_t *target, pm_token_t *operator, pm_nod return target; } - // If there are arguments on the call node, then it can't be a method - // call ending with = or a local variable write, so it must be a - // syntax error. In this case we'll fall through to our default + // If there are arguments on the call node, then it can't be a + // method call ending with = or a local variable write, so it must + // be a syntax error. In this case we'll fall through to our default // handling. We need to free the value that we parsed because there // is no way for us to attach it to the tree at this point. // @@ -13871,7 +13904,7 @@ parse_write(pm_parser_t *parser, pm_node_t *target, pm_token_t *operator, pm_nod // parameter somewhere in its subtree, we need to walk it and remove // any implicit parameters from the list of implicit parameters for // the current scope. - parse_target_implicit_parameter(parser, value); + pm_node_unreference(parser, value); pm_node_destroy(parser, value); } PRISM_FALLTHROUGH @@ -18772,7 +18805,7 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b // If we're about to convert an 'it' implicit local // variable read into a method call, we need to remove // it from the list of implicit local variables. - parse_target_implicit_parameter(parser, node); + pm_node_unreference(parser, node); } else { // Otherwise, we're about to convert a regular local // variable read into a method call, in which case we @@ -18781,7 +18814,7 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b assert(PM_NODE_TYPE_P(node, PM_LOCAL_VARIABLE_READ_NODE)); if (pm_token_is_numbered_parameter(identifier.start, identifier.end)) { - parse_target_implicit_parameter(parser, node); + pm_node_unreference(parser, node); } else { pm_local_variable_read_node_t *cast = (pm_local_variable_read_node_t *) node; pm_locals_unread(&pm_parser_scope_find(parser, cast->depth)->locals, cast->name); @@ -21071,42 +21104,6 @@ parse_assignment_values(pm_parser_t *parser, pm_binding_power_t previous_binding return value; } -static bool -parse_call_operator_write_block_exits_each(const pm_node_t *node, void *data) { - pm_parser_t *parser = (pm_parser_t *) data; - size_t index = 0; - - while (index < parser->current_block_exits->size) { - pm_node_t *block_exit = parser->current_block_exits->nodes[index]; - - if (block_exit == node) { - if (index + 1 < parser->current_block_exits->size) { - memmove( - &parser->current_block_exits->nodes[index], - &parser->current_block_exits->nodes[index + 1], - (parser->current_block_exits->size - index - 1) * sizeof(pm_node_t *) - ); - } - parser->current_block_exits->size--; - return false; - } - - index++; - } - - return true; -} - -/** - * When we are about to destroy a set of nodes that could potentially contain - * block exits for the current scope, we need to check if they are contained in - * the list of block exits and remove them if they are. - */ -static void -parse_call_operator_write_block_exits(pm_parser_t *parser, const pm_node_t *node) { - pm_visit_node(node, parse_call_operator_write_block_exits_each, parser); -} - /** * Ensure a call node that is about to become a call operator node does not * have arguments or a block attached. If it does, then we'll need to add an @@ -21118,14 +21115,14 @@ static void parse_call_operator_write(pm_parser_t *parser, pm_call_node_t *call_node, const pm_token_t *operator) { if (call_node->arguments != NULL) { pm_parser_err_token(parser, operator, PM_ERR_OPERATOR_WRITE_ARGUMENTS); - parse_call_operator_write_block_exits(parser, (pm_node_t *) call_node->arguments); + pm_node_unreference(parser, (pm_node_t *) call_node->arguments); pm_node_destroy(parser, (pm_node_t *) call_node->arguments); call_node->arguments = NULL; } if (call_node->block != NULL) { pm_parser_err_token(parser, operator, PM_ERR_OPERATOR_WRITE_BLOCK); - parse_call_operator_write_block_exits(parser, (pm_node_t *) call_node->block); + pm_node_unreference(parser, (pm_node_t *) call_node->block); pm_node_destroy(parser, (pm_node_t *) call_node->block); call_node->block = NULL; } @@ -21517,14 +21514,14 @@ parse_expression_infix(pm_parser_t *parser, pm_node_t *node, pm_binding_power_t pm_node_t *value = parse_assignment_value(parser, previous_binding_power, binding_power, accepts_command_call, PM_ERR_EXPECT_EXPRESSION_AFTER_AMPAMPEQ, (uint16_t) (depth + 1)); pm_node_t *result = (pm_node_t *) pm_local_variable_and_write_node_create(parser, node, &token, value, name, 0); - parse_target_implicit_parameter(parser, node); + pm_node_unreference(parser, node); pm_node_destroy(parser, node); return result; } case PM_LOCAL_VARIABLE_READ_NODE: { if (pm_token_is_numbered_parameter(node->location.start, node->location.end)) { PM_PARSER_ERR_FORMAT(parser, node->location.start, node->location.end, PM_ERR_PARAMETER_NUMBERED_RESERVED, node->location.start); - parse_target_implicit_parameter(parser, node); + pm_node_unreference(parser, node); } pm_local_variable_read_node_t *cast = (pm_local_variable_read_node_t *) node; @@ -21651,14 +21648,14 @@ parse_expression_infix(pm_parser_t *parser, pm_node_t *node, pm_binding_power_t pm_node_t *value = parse_assignment_value(parser, previous_binding_power, binding_power, accepts_command_call, PM_ERR_EXPECT_EXPRESSION_AFTER_PIPEPIPEEQ, (uint16_t) (depth + 1)); pm_node_t *result = (pm_node_t *) pm_local_variable_or_write_node_create(parser, node, &token, value, name, 0); - parse_target_implicit_parameter(parser, node); + pm_node_unreference(parser, node); pm_node_destroy(parser, node); return result; } case PM_LOCAL_VARIABLE_READ_NODE: { if (pm_token_is_numbered_parameter(node->location.start, node->location.end)) { PM_PARSER_ERR_FORMAT(parser, node->location.start, node->location.end, PM_ERR_PARAMETER_NUMBERED_RESERVED, node->location.start); - parse_target_implicit_parameter(parser, node); + pm_node_unreference(parser, node); } pm_local_variable_read_node_t *cast = (pm_local_variable_read_node_t *) node; @@ -21795,14 +21792,14 @@ parse_expression_infix(pm_parser_t *parser, pm_node_t *node, pm_binding_power_t pm_node_t *value = parse_assignment_value(parser, previous_binding_power, binding_power, accepts_command_call, PM_ERR_EXPECT_EXPRESSION_AFTER_OPERATOR, (uint16_t) (depth + 1)); pm_node_t *result = (pm_node_t *) pm_local_variable_operator_write_node_create(parser, node, &token, value, name, 0); - parse_target_implicit_parameter(parser, node); + pm_node_unreference(parser, node); pm_node_destroy(parser, node); return result; } case PM_LOCAL_VARIABLE_READ_NODE: { if (pm_token_is_numbered_parameter(node->location.start, node->location.end)) { PM_PARSER_ERR_FORMAT(parser, node->location.start, node->location.end, PM_ERR_PARAMETER_NUMBERED_RESERVED, node->location.start); - parse_target_implicit_parameter(parser, node); + pm_node_unreference(parser, node); } pm_local_variable_read_node_t *cast = (pm_local_variable_read_node_t *) node; From c831abb888b42eabd10a09541b4c528b7c6d5405 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Sun, 30 Nov 2025 20:45:44 -0500 Subject: [PATCH 240/333] Fix up newlines in newline-delimited-literals When you have a %-literal that is delimited by newlines, and you are also interpolating a heredoc into that literal, then both concepts will attempt to add the same newline to the newline list. --- src/prism.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/prism.c b/src/prism.c index 58a6a9987d..793346f855 100644 --- a/src/prism.c +++ b/src/prism.c @@ -12249,7 +12249,13 @@ parser_lex(pm_parser_t *parser) { size_t eol_length = match_eol_at(parser, breakpoint); if (eol_length) { parser->current.end = breakpoint + eol_length; - pm_newline_list_append(&parser->newline_list, parser->current.end - 1); + + // Track the newline if we're not in a heredoc that + // would have already have added the newline to the + // list. + if (parser->heredoc_end == NULL) { + pm_newline_list_append(&parser->newline_list, parser->current.end - 1); + } } else { parser->current.end = breakpoint + 1; } @@ -12503,7 +12509,13 @@ parser_lex(pm_parser_t *parser) { size_t eol_length = match_eol_at(parser, breakpoint); if (eol_length) { parser->current.end = breakpoint + eol_length; - pm_newline_list_append(&parser->newline_list, parser->current.end - 1); + + // Track the newline if we're not in a heredoc that + // would have already have added the newline to the + // list. + if (parser->heredoc_end == NULL) { + pm_newline_list_append(&parser->newline_list, parser->current.end - 1); + } } else { parser->current.end = breakpoint + 1; } From c7b3d66d84daef0516128b29ca5d6c10c57acd91 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Mon, 1 Dec 2025 09:22:51 -0500 Subject: [PATCH 241/333] PM_NODE_INIT Hide the initialization of the base node inside the node initializer lists by a macro. As such, consistently enforce flags are set properly. --- src/prism.c | 1404 ++++++++------------------------------------------- 1 file changed, 214 insertions(+), 1190 deletions(-) diff --git a/src/prism.c b/src/prism.c index 793346f855..ac6fbd9f6b 100644 --- a/src/prism.c +++ b/src/prism.c @@ -1928,8 +1928,13 @@ pm_node_alloc(PRISM_ATTRIBUTE_UNUSED pm_parser_t *parser, size_t size) { return memory; } -#define PM_NODE_ALLOC(parser, type) (type *) pm_node_alloc(parser, sizeof(type)) -#define PM_NODE_IDENTIFY(parser) (++parser->node_id) +#define PM_NODE_ALLOC(parser_, type_) (type_ *) pm_node_alloc(parser_, sizeof(type_)) +#define PM_NODE_INIT(parser_, type_, flags_, start_, end_) (pm_node_t) { \ + .type = (type_), \ + .flags = (flags_), \ + .node_id = ++(parser_)->node_id, \ + .location = { .start = (start_), .end = (end_) } \ +} /** * Allocate a new MissingNode node. @@ -1938,11 +1943,9 @@ static pm_missing_node_t * pm_missing_node_create(pm_parser_t *parser, const uint8_t *start, const uint8_t *end) { pm_missing_node_t *node = PM_NODE_ALLOC(parser, pm_missing_node_t); - *node = (pm_missing_node_t) {{ - .type = PM_MISSING_NODE, - .node_id = PM_NODE_IDENTIFY(parser), - .location = { .start = start, .end = end } - }}; + *node = (pm_missing_node_t) { + .base = PM_NODE_INIT(parser, PM_MISSING_NODE, 0, start, end) + }; return node; } @@ -1956,14 +1959,7 @@ pm_alias_global_variable_node_create(pm_parser_t *parser, const pm_token_t *keyw pm_alias_global_variable_node_t *node = PM_NODE_ALLOC(parser, pm_alias_global_variable_node_t); *node = (pm_alias_global_variable_node_t) { - { - .type = PM_ALIAS_GLOBAL_VARIABLE_NODE, - .node_id = PM_NODE_IDENTIFY(parser), - .location = { - .start = keyword->start, - .end = old_name->location.end - }, - }, + .base = PM_NODE_INIT(parser, PM_ALIAS_GLOBAL_VARIABLE_NODE, 0, keyword->start, old_name->location.end), .new_name = new_name, .old_name = old_name, .keyword_loc = PM_LOCATION_TOKEN_VALUE(keyword) @@ -1981,14 +1977,7 @@ pm_alias_method_node_create(pm_parser_t *parser, const pm_token_t *keyword, pm_n pm_alias_method_node_t *node = PM_NODE_ALLOC(parser, pm_alias_method_node_t); *node = (pm_alias_method_node_t) { - { - .type = PM_ALIAS_METHOD_NODE, - .node_id = PM_NODE_IDENTIFY(parser), - .location = { - .start = keyword->start, - .end = old_name->location.end - }, - }, + .base = PM_NODE_INIT(parser, PM_ALIAS_METHOD_NODE, 0, keyword->start, old_name->location.end), .new_name = new_name, .old_name = old_name, .keyword_loc = PM_LOCATION_TOKEN_VALUE(keyword) @@ -2005,14 +1994,7 @@ pm_alternation_pattern_node_create(pm_parser_t *parser, pm_node_t *left, pm_node pm_alternation_pattern_node_t *node = PM_NODE_ALLOC(parser, pm_alternation_pattern_node_t); *node = (pm_alternation_pattern_node_t) { - { - .type = PM_ALTERNATION_PATTERN_NODE, - .node_id = PM_NODE_IDENTIFY(parser), - .location = { - .start = left->location.start, - .end = right->location.end - }, - }, + .base = PM_NODE_INIT(parser, PM_ALTERNATION_PATTERN_NODE, 0, left->location.start, right->location.end), .left = left, .right = right, .operator_loc = PM_LOCATION_TOKEN_VALUE(operator) @@ -2031,14 +2013,7 @@ pm_and_node_create(pm_parser_t *parser, pm_node_t *left, const pm_token_t *opera pm_and_node_t *node = PM_NODE_ALLOC(parser, pm_and_node_t); *node = (pm_and_node_t) { - { - .type = PM_AND_NODE, - .node_id = PM_NODE_IDENTIFY(parser), - .location = { - .start = left->location.start, - .end = right->location.end - }, - }, + .base = PM_NODE_INIT(parser, PM_AND_NODE, 0, left->location.start, right->location.end), .left = left, .operator_loc = PM_LOCATION_TOKEN_VALUE(operator), .right = right @@ -2055,11 +2030,7 @@ pm_arguments_node_create(pm_parser_t *parser) { pm_arguments_node_t *node = PM_NODE_ALLOC(parser, pm_arguments_node_t); *node = (pm_arguments_node_t) { - { - .type = PM_ARGUMENTS_NODE, - .node_id = PM_NODE_IDENTIFY(parser), - .location = PM_LOCATION_NULL_VALUE(parser) - }, + .base = PM_NODE_INIT(parser, PM_ARGUMENTS_NODE, 0, parser->start, parser->start), .arguments = { 0 } }; @@ -2103,12 +2074,7 @@ pm_array_node_create(pm_parser_t *parser, const pm_token_t *opening) { pm_array_node_t *node = PM_NODE_ALLOC(parser, pm_array_node_t); *node = (pm_array_node_t) { - { - .type = PM_ARRAY_NODE, - .flags = PM_NODE_FLAG_STATIC_LITERAL, - .node_id = PM_NODE_IDENTIFY(parser), - .location = PM_LOCATION_TOKEN_VALUE(opening) - }, + .base = PM_NODE_INIT(parser, PM_ARRAY_NODE, PM_NODE_FLAG_STATIC_LITERAL, opening->start, opening->end), .opening_loc = PM_OPTIONAL_LOCATION_TOKEN_VALUE(opening), .closing_loc = PM_OPTIONAL_LOCATION_TOKEN_VALUE(opening), .elements = { 0 } @@ -2159,14 +2125,7 @@ pm_array_pattern_node_node_list_create(pm_parser_t *parser, pm_node_list_t *node pm_array_pattern_node_t *node = PM_NODE_ALLOC(parser, pm_array_pattern_node_t); *node = (pm_array_pattern_node_t) { - { - .type = PM_ARRAY_PATTERN_NODE, - .node_id = PM_NODE_IDENTIFY(parser), - .location = { - .start = nodes->nodes[0]->location.start, - .end = nodes->nodes[nodes->size - 1]->location.end - }, - }, + .base = PM_NODE_INIT(parser, PM_ARRAY_PATTERN_NODE, 0, nodes->nodes[0]->location.start, nodes->nodes[nodes->size - 1]->location.end), .constant = NULL, .rest = NULL, .requireds = { 0 }, @@ -2202,11 +2161,7 @@ pm_array_pattern_node_rest_create(pm_parser_t *parser, pm_node_t *rest) { pm_array_pattern_node_t *node = PM_NODE_ALLOC(parser, pm_array_pattern_node_t); *node = (pm_array_pattern_node_t) { - { - .type = PM_ARRAY_PATTERN_NODE, - .node_id = PM_NODE_IDENTIFY(parser), - .location = rest->location, - }, + .base = PM_NODE_INIT(parser, PM_ARRAY_PATTERN_NODE, 0, rest->location.start, rest->location.end), .constant = NULL, .rest = rest, .requireds = { 0 }, @@ -2227,14 +2182,7 @@ pm_array_pattern_node_constant_create(pm_parser_t *parser, pm_node_t *constant, pm_array_pattern_node_t *node = PM_NODE_ALLOC(parser, pm_array_pattern_node_t); *node = (pm_array_pattern_node_t) { - { - .type = PM_ARRAY_PATTERN_NODE, - .node_id = PM_NODE_IDENTIFY(parser), - .location = { - .start = constant->location.start, - .end = closing->end - }, - }, + .base = PM_NODE_INIT(parser, PM_ARRAY_PATTERN_NODE, 0, constant->location.start, closing->end), .constant = constant, .rest = NULL, .opening_loc = PM_LOCATION_TOKEN_VALUE(opening), @@ -2255,14 +2203,7 @@ pm_array_pattern_node_empty_create(pm_parser_t *parser, const pm_token_t *openin pm_array_pattern_node_t *node = PM_NODE_ALLOC(parser, pm_array_pattern_node_t); *node = (pm_array_pattern_node_t) { - { - .type = PM_ARRAY_PATTERN_NODE, - .node_id = PM_NODE_IDENTIFY(parser), - .location = { - .start = opening->start, - .end = closing->end - }, - }, + .base = PM_NODE_INIT(parser, PM_ARRAY_PATTERN_NODE, 0, opening->start, closing->end), .constant = NULL, .rest = NULL, .opening_loc = PM_LOCATION_TOKEN_VALUE(opening), @@ -2313,15 +2254,7 @@ pm_assoc_node_create(pm_parser_t *parser, pm_node_t *key, const pm_token_t *oper } *node = (pm_assoc_node_t) { - { - .type = PM_ASSOC_NODE, - .flags = flags, - .node_id = PM_NODE_IDENTIFY(parser), - .location = { - .start = key->location.start, - .end = end - }, - }, + .base = PM_NODE_INIT(parser, PM_ASSOC_NODE, flags, key->location.start, end), .key = key, .operator_loc = PM_OPTIONAL_LOCATION_TOKEN_VALUE(operator), .value = value @@ -2339,14 +2272,7 @@ pm_assoc_splat_node_create(pm_parser_t *parser, pm_node_t *value, const pm_token pm_assoc_splat_node_t *node = PM_NODE_ALLOC(parser, pm_assoc_splat_node_t); *node = (pm_assoc_splat_node_t) { - { - .type = PM_ASSOC_SPLAT_NODE, - .node_id = PM_NODE_IDENTIFY(parser), - .location = { - .start = operator->start, - .end = value == NULL ? operator->end : value->location.end - }, - }, + .base = PM_NODE_INIT(parser, PM_ASSOC_SPLAT_NODE, 0, operator->start, value == NULL ? operator->end : value->location.end), .value = value, .operator_loc = PM_LOCATION_TOKEN_VALUE(operator) }; @@ -2363,11 +2289,7 @@ pm_back_reference_read_node_create(pm_parser_t *parser, const pm_token_t *name) pm_back_reference_read_node_t *node = PM_NODE_ALLOC(parser, pm_back_reference_read_node_t); *node = (pm_back_reference_read_node_t) { - { - .type = PM_BACK_REFERENCE_READ_NODE, - .node_id = PM_NODE_IDENTIFY(parser), - .location = PM_LOCATION_TOKEN_VALUE(name), - }, + .base = PM_NODE_INIT(parser, PM_BACK_REFERENCE_READ_NODE, 0, name->start, name->end), .name = pm_parser_constant_id_token(parser, name) }; @@ -2382,14 +2304,7 @@ pm_begin_node_create(pm_parser_t *parser, const pm_token_t *begin_keyword, pm_st pm_begin_node_t *node = PM_NODE_ALLOC(parser, pm_begin_node_t); *node = (pm_begin_node_t) { - { - .type = PM_BEGIN_NODE, - .node_id = PM_NODE_IDENTIFY(parser), - .location = { - .start = begin_keyword->start, - .end = statements == NULL ? begin_keyword->end : statements->base.location.end - }, - }, + .base = PM_NODE_INIT(parser, PM_BEGIN_NODE, 0, begin_keyword->start, statements == NULL ? begin_keyword->end : statements->base.location.end), .begin_keyword_loc = PM_OPTIONAL_LOCATION_TOKEN_VALUE(begin_keyword), .statements = statements, .end_keyword_loc = PM_OPTIONAL_LOCATION_NOT_PROVIDED_VALUE @@ -2448,14 +2363,7 @@ pm_block_argument_node_create(pm_parser_t *parser, const pm_token_t *operator, p pm_block_argument_node_t *node = PM_NODE_ALLOC(parser, pm_block_argument_node_t); *node = (pm_block_argument_node_t) { - { - .type = PM_BLOCK_ARGUMENT_NODE, - .node_id = PM_NODE_IDENTIFY(parser), - .location = { - .start = operator->start, - .end = expression == NULL ? operator->end : expression->location.end - }, - }, + .base = PM_NODE_INIT(parser, PM_BLOCK_ARGUMENT_NODE, 0, operator->start, expression == NULL ? operator->end : expression->location.end), .expression = expression, .operator_loc = PM_LOCATION_TOKEN_VALUE(operator) }; @@ -2471,11 +2379,7 @@ pm_block_node_create(pm_parser_t *parser, pm_constant_id_list_t *locals, const p pm_block_node_t *node = PM_NODE_ALLOC(parser, pm_block_node_t); *node = (pm_block_node_t) { - { - .type = PM_BLOCK_NODE, - .node_id = PM_NODE_IDENTIFY(parser), - .location = { .start = opening->start, .end = closing->end }, - }, + .base = PM_NODE_INIT(parser, PM_BLOCK_NODE, 0, opening->start, closing->end), .locals = *locals, .parameters = parameters, .body = body, @@ -2495,14 +2399,7 @@ pm_block_parameter_node_create(pm_parser_t *parser, const pm_token_t *name, cons pm_block_parameter_node_t *node = PM_NODE_ALLOC(parser, pm_block_parameter_node_t); *node = (pm_block_parameter_node_t) { - { - .type = PM_BLOCK_PARAMETER_NODE, - .node_id = PM_NODE_IDENTIFY(parser), - .location = { - .start = operator->start, - .end = (name->type == PM_TOKEN_NOT_PROVIDED ? operator->end : name->end) - }, - }, + .base = PM_NODE_INIT(parser, PM_BLOCK_PARAMETER_NODE, 0, operator->start, name->type == PM_TOKEN_NOT_PROVIDED ? operator->end : name->end), .name = pm_parser_optional_constant_id_token(parser, name), .name_loc = PM_OPTIONAL_LOCATION_TOKEN_VALUE(name), .operator_loc = PM_LOCATION_TOKEN_VALUE(operator) @@ -2537,14 +2434,7 @@ pm_block_parameters_node_create(pm_parser_t *parser, pm_parameters_node_t *param } *node = (pm_block_parameters_node_t) { - { - .type = PM_BLOCK_PARAMETERS_NODE, - .node_id = PM_NODE_IDENTIFY(parser), - .location = { - .start = start, - .end = end - } - }, + .base = PM_NODE_INIT(parser, PM_BLOCK_PARAMETERS_NODE, 0, start, end), .parameters = parameters, .opening_loc = PM_OPTIONAL_LOCATION_TOKEN_VALUE(opening), .closing_loc = PM_OPTIONAL_LOCATION_NOT_PROVIDED_VALUE, @@ -2573,11 +2463,7 @@ pm_block_local_variable_node_create(pm_parser_t *parser, const pm_token_t *name) pm_block_local_variable_node_t *node = PM_NODE_ALLOC(parser, pm_block_local_variable_node_t); *node = (pm_block_local_variable_node_t) { - { - .type = PM_BLOCK_LOCAL_VARIABLE_NODE, - .node_id = PM_NODE_IDENTIFY(parser), - .location = PM_LOCATION_TOKEN_VALUE(name), - }, + .base = PM_NODE_INIT(parser, PM_BLOCK_LOCAL_VARIABLE_NODE, 0, name->start, name->end), .name = pm_parser_constant_id_token(parser, name) }; @@ -2604,14 +2490,7 @@ pm_break_node_create(pm_parser_t *parser, const pm_token_t *keyword, pm_argument pm_break_node_t *node = PM_NODE_ALLOC(parser, pm_break_node_t); *node = (pm_break_node_t) { - { - .type = PM_BREAK_NODE, - .node_id = PM_NODE_IDENTIFY(parser), - .location = { - .start = keyword->start, - .end = (arguments == NULL ? keyword->end : arguments->base.location.end) - }, - }, + .base = PM_NODE_INIT(parser, PM_BREAK_NODE, 0, keyword->start, arguments == NULL ? keyword->end : arguments->base.location.end), .arguments = arguments, .keyword_loc = PM_LOCATION_TOKEN_VALUE(keyword) }; @@ -2638,12 +2517,7 @@ pm_call_node_create(pm_parser_t *parser, pm_node_flags_t flags) { pm_call_node_t *node = PM_NODE_ALLOC(parser, pm_call_node_t); *node = (pm_call_node_t) { - { - .type = PM_CALL_NODE, - .flags = flags, - .node_id = PM_NODE_IDENTIFY(parser), - .location = PM_LOCATION_NULL_VALUE(parser), - }, + .base = PM_NODE_INIT(parser, PM_CALL_NODE, flags, parser->start, parser->start), .receiver = NULL, .call_operator_loc = PM_OPTIONAL_LOCATION_NOT_PROVIDED_VALUE, .message_loc = PM_OPTIONAL_LOCATION_NOT_PROVIDED_VALUE, @@ -2950,15 +2824,7 @@ pm_call_and_write_node_create(pm_parser_t *parser, pm_call_node_t *target, const pm_call_and_write_node_t *node = PM_NODE_ALLOC(parser, pm_call_and_write_node_t); *node = (pm_call_and_write_node_t) { - { - .type = PM_CALL_AND_WRITE_NODE, - .flags = target->base.flags, - .node_id = PM_NODE_IDENTIFY(parser), - .location = { - .start = target->base.location.start, - .end = value->location.end - } - }, + .base = PM_NODE_INIT(parser, PM_CALL_AND_WRITE_NODE, target->base.flags, target->base.location.start, value->location.end), .receiver = target->receiver, .call_operator_loc = target->call_operator_loc, .message_loc = target->message_loc, @@ -3013,15 +2879,7 @@ pm_index_and_write_node_create(pm_parser_t *parser, pm_call_node_t *target, cons assert(!target->block || PM_NODE_TYPE_P(target->block, PM_BLOCK_ARGUMENT_NODE)); *node = (pm_index_and_write_node_t) { - { - .type = PM_INDEX_AND_WRITE_NODE, - .flags = target->base.flags, - .node_id = PM_NODE_IDENTIFY(parser), - .location = { - .start = target->base.location.start, - .end = value->location.end - } - }, + .base = PM_NODE_INIT(parser, PM_INDEX_AND_WRITE_NODE, target->base.flags, target->base.location.start, value->location.end), .receiver = target->receiver, .call_operator_loc = target->call_operator_loc, .opening_loc = target->opening_loc, @@ -3049,15 +2907,7 @@ pm_call_operator_write_node_create(pm_parser_t *parser, pm_call_node_t *target, pm_call_operator_write_node_t *node = PM_NODE_ALLOC(parser, pm_call_operator_write_node_t); *node = (pm_call_operator_write_node_t) { - { - .type = PM_CALL_OPERATOR_WRITE_NODE, - .flags = target->base.flags, - .node_id = PM_NODE_IDENTIFY(parser), - .location = { - .start = target->base.location.start, - .end = value->location.end - } - }, + .base = PM_NODE_INIT(parser, PM_CALL_OPERATOR_WRITE_NODE, target->base.flags, target->base.location.start, value->location.end), .receiver = target->receiver, .call_operator_loc = target->call_operator_loc, .message_loc = target->message_loc, @@ -3089,15 +2939,7 @@ pm_index_operator_write_node_create(pm_parser_t *parser, pm_call_node_t *target, assert(!target->block || PM_NODE_TYPE_P(target->block, PM_BLOCK_ARGUMENT_NODE)); *node = (pm_index_operator_write_node_t) { - { - .type = PM_INDEX_OPERATOR_WRITE_NODE, - .flags = target->base.flags, - .node_id = PM_NODE_IDENTIFY(parser), - .location = { - .start = target->base.location.start, - .end = value->location.end - } - }, + .base = PM_NODE_INIT(parser, PM_INDEX_OPERATOR_WRITE_NODE, target->base.flags, target->base.location.start, value->location.end), .receiver = target->receiver, .call_operator_loc = target->call_operator_loc, .opening_loc = target->opening_loc, @@ -3127,15 +2969,7 @@ pm_call_or_write_node_create(pm_parser_t *parser, pm_call_node_t *target, const pm_call_or_write_node_t *node = PM_NODE_ALLOC(parser, pm_call_or_write_node_t); *node = (pm_call_or_write_node_t) { - { - .type = PM_CALL_OR_WRITE_NODE, - .flags = target->base.flags, - .node_id = PM_NODE_IDENTIFY(parser), - .location = { - .start = target->base.location.start, - .end = value->location.end - } - }, + .base = PM_NODE_INIT(parser, PM_CALL_OR_WRITE_NODE, target->base.flags, target->base.location.start, value->location.end), .receiver = target->receiver, .call_operator_loc = target->call_operator_loc, .message_loc = target->message_loc, @@ -3167,15 +3001,7 @@ pm_index_or_write_node_create(pm_parser_t *parser, pm_call_node_t *target, const assert(!target->block || PM_NODE_TYPE_P(target->block, PM_BLOCK_ARGUMENT_NODE)); *node = (pm_index_or_write_node_t) { - { - .type = PM_INDEX_OR_WRITE_NODE, - .flags = target->base.flags, - .node_id = PM_NODE_IDENTIFY(parser), - .location = { - .start = target->base.location.start, - .end = value->location.end - } - }, + .base = PM_NODE_INIT(parser, PM_INDEX_OR_WRITE_NODE, target->base.flags, target->base.location.start, value->location.end), .receiver = target->receiver, .call_operator_loc = target->call_operator_loc, .opening_loc = target->opening_loc, @@ -3203,12 +3029,7 @@ pm_call_target_node_create(pm_parser_t *parser, pm_call_node_t *target) { pm_call_target_node_t *node = PM_NODE_ALLOC(parser, pm_call_target_node_t); *node = (pm_call_target_node_t) { - { - .type = PM_CALL_TARGET_NODE, - .flags = target->base.flags, - .node_id = PM_NODE_IDENTIFY(parser), - .location = target->base.location - }, + .base = PM_NODE_INIT(parser, PM_CALL_TARGET_NODE, target->base.flags, target->base.location.start, target->base.location.end), .receiver = target->receiver, .call_operator_loc = target->call_operator_loc, .name = target->name, @@ -3236,12 +3057,7 @@ pm_index_target_node_create(pm_parser_t *parser, pm_call_node_t *target) { assert(!target->block || PM_NODE_TYPE_P(target->block, PM_BLOCK_ARGUMENT_NODE)); *node = (pm_index_target_node_t) { - { - .type = PM_INDEX_TARGET_NODE, - .flags = flags | PM_CALL_NODE_FLAGS_ATTRIBUTE_WRITE, - .node_id = PM_NODE_IDENTIFY(parser), - .location = target->base.location - }, + .base = PM_NODE_INIT(parser, PM_INDEX_TARGET_NODE, flags | PM_CALL_NODE_FLAGS_ATTRIBUTE_WRITE, target->base.location.start, target->base.location.end), .receiver = target->receiver, .opening_loc = target->opening_loc, .arguments = target->arguments, @@ -3265,14 +3081,7 @@ pm_capture_pattern_node_create(pm_parser_t *parser, pm_node_t *value, pm_local_v pm_capture_pattern_node_t *node = PM_NODE_ALLOC(parser, pm_capture_pattern_node_t); *node = (pm_capture_pattern_node_t) { - { - .type = PM_CAPTURE_PATTERN_NODE, - .node_id = PM_NODE_IDENTIFY(parser), - .location = { - .start = value->location.start, - .end = target->base.location.end - }, - }, + .base = PM_NODE_INIT(parser, PM_CAPTURE_PATTERN_NODE, 0, value->location.start, target->base.location.end), .value = value, .target = target, .operator_loc = PM_LOCATION_TOKEN_VALUE(operator) @@ -3289,14 +3098,7 @@ pm_case_node_create(pm_parser_t *parser, const pm_token_t *case_keyword, pm_node pm_case_node_t *node = PM_NODE_ALLOC(parser, pm_case_node_t); *node = (pm_case_node_t) { - { - .type = PM_CASE_NODE, - .node_id = PM_NODE_IDENTIFY(parser), - .location = { - .start = case_keyword->start, - .end = end_keyword->end - }, - }, + .base = PM_NODE_INIT(parser, PM_CASE_NODE, 0, case_keyword->start, end_keyword->end), .predicate = predicate, .else_clause = NULL, .case_keyword_loc = PM_LOCATION_TOKEN_VALUE(case_keyword), @@ -3344,14 +3146,7 @@ pm_case_match_node_create(pm_parser_t *parser, const pm_token_t *case_keyword, p pm_case_match_node_t *node = PM_NODE_ALLOC(parser, pm_case_match_node_t); *node = (pm_case_match_node_t) { - { - .type = PM_CASE_MATCH_NODE, - .node_id = PM_NODE_IDENTIFY(parser), - .location = { - .start = case_keyword->start, - .end = end_keyword->end - }, - }, + .base = PM_NODE_INIT(parser, PM_CASE_MATCH_NODE, 0, case_keyword->start, end_keyword->end), .predicate = predicate, .else_clause = NULL, .case_keyword_loc = PM_LOCATION_TOKEN_VALUE(case_keyword), @@ -3399,11 +3194,7 @@ pm_class_node_create(pm_parser_t *parser, pm_constant_id_list_t *locals, const p pm_class_node_t *node = PM_NODE_ALLOC(parser, pm_class_node_t); *node = (pm_class_node_t) { - { - .type = PM_CLASS_NODE, - .node_id = PM_NODE_IDENTIFY(parser), - .location = { .start = class_keyword->start, .end = end_keyword->end }, - }, + .base = PM_NODE_INIT(parser, PM_CLASS_NODE, 0, class_keyword->start, end_keyword->end), .locals = *locals, .class_keyword_loc = PM_LOCATION_TOKEN_VALUE(class_keyword), .constant_path = constant_path, @@ -3426,14 +3217,7 @@ pm_class_variable_and_write_node_create(pm_parser_t *parser, pm_class_variable_r pm_class_variable_and_write_node_t *node = PM_NODE_ALLOC(parser, pm_class_variable_and_write_node_t); *node = (pm_class_variable_and_write_node_t) { - { - .type = PM_CLASS_VARIABLE_AND_WRITE_NODE, - .node_id = PM_NODE_IDENTIFY(parser), - .location = { - .start = target->base.location.start, - .end = value->location.end - } - }, + .base = PM_NODE_INIT(parser, PM_CLASS_VARIABLE_AND_WRITE_NODE, 0, target->base.location.start, value->location.end), .name = target->name, .name_loc = target->base.location, .operator_loc = PM_LOCATION_TOKEN_VALUE(operator), @@ -3451,14 +3235,7 @@ pm_class_variable_operator_write_node_create(pm_parser_t *parser, pm_class_varia pm_class_variable_operator_write_node_t *node = PM_NODE_ALLOC(parser, pm_class_variable_operator_write_node_t); *node = (pm_class_variable_operator_write_node_t) { - { - .type = PM_CLASS_VARIABLE_OPERATOR_WRITE_NODE, - .node_id = PM_NODE_IDENTIFY(parser), - .location = { - .start = target->base.location.start, - .end = value->location.end - } - }, + .base = PM_NODE_INIT(parser, PM_CLASS_VARIABLE_OPERATOR_WRITE_NODE, 0, target->base.location.start, value->location.end), .name = target->name, .name_loc = target->base.location, .binary_operator_loc = PM_LOCATION_TOKEN_VALUE(operator), @@ -3478,14 +3255,7 @@ pm_class_variable_or_write_node_create(pm_parser_t *parser, pm_class_variable_re pm_class_variable_or_write_node_t *node = PM_NODE_ALLOC(parser, pm_class_variable_or_write_node_t); *node = (pm_class_variable_or_write_node_t) { - { - .type = PM_CLASS_VARIABLE_OR_WRITE_NODE, - .node_id = PM_NODE_IDENTIFY(parser), - .location = { - .start = target->base.location.start, - .end = value->location.end - } - }, + .base = PM_NODE_INIT(parser, PM_CLASS_VARIABLE_OR_WRITE_NODE, 0, target->base.location.start, value->location.end), .name = target->name, .name_loc = target->base.location, .operator_loc = PM_LOCATION_TOKEN_VALUE(operator), @@ -3504,11 +3274,7 @@ pm_class_variable_read_node_create(pm_parser_t *parser, const pm_token_t *token) pm_class_variable_read_node_t *node = PM_NODE_ALLOC(parser, pm_class_variable_read_node_t); *node = (pm_class_variable_read_node_t) { - { - .type = PM_CLASS_VARIABLE_READ_NODE, - .node_id = PM_NODE_IDENTIFY(parser), - .location = PM_LOCATION_TOKEN_VALUE(token) - }, + .base = PM_NODE_INIT(parser, PM_CLASS_VARIABLE_READ_NODE, 0, token->start, token->end), .name = pm_parser_constant_id_token(parser, token) }; @@ -3535,17 +3301,10 @@ pm_implicit_array_write_flags(const pm_node_t *node, pm_node_flags_t flags) { static pm_class_variable_write_node_t * pm_class_variable_write_node_create(pm_parser_t *parser, pm_class_variable_read_node_t *read_node, pm_token_t *operator, pm_node_t *value) { pm_class_variable_write_node_t *node = PM_NODE_ALLOC(parser, pm_class_variable_write_node_t); + pm_node_flags_t flags = pm_implicit_array_write_flags(value, PM_WRITE_NODE_FLAGS_IMPLICIT_ARRAY); *node = (pm_class_variable_write_node_t) { - { - .type = PM_CLASS_VARIABLE_WRITE_NODE, - .flags = pm_implicit_array_write_flags(value, PM_WRITE_NODE_FLAGS_IMPLICIT_ARRAY), - .node_id = PM_NODE_IDENTIFY(parser), - .location = { - .start = read_node->base.location.start, - .end = value->location.end - }, - }, + .base = PM_NODE_INIT(parser, PM_CLASS_VARIABLE_WRITE_NODE, flags, read_node->base.location.start, value->location.end), .name = read_node->name, .name_loc = PM_LOCATION_NODE_VALUE((pm_node_t *) read_node), .operator_loc = PM_LOCATION_TOKEN_VALUE(operator), @@ -3564,14 +3323,7 @@ pm_constant_path_and_write_node_create(pm_parser_t *parser, pm_constant_path_nod pm_constant_path_and_write_node_t *node = PM_NODE_ALLOC(parser, pm_constant_path_and_write_node_t); *node = (pm_constant_path_and_write_node_t) { - { - .type = PM_CONSTANT_PATH_AND_WRITE_NODE, - .node_id = PM_NODE_IDENTIFY(parser), - .location = { - .start = target->base.location.start, - .end = value->location.end - } - }, + .base = PM_NODE_INIT(parser, PM_CONSTANT_PATH_AND_WRITE_NODE, 0, target->base.location.start, value->location.end), .target = target, .operator_loc = PM_LOCATION_TOKEN_VALUE(operator), .value = value @@ -3588,14 +3340,7 @@ pm_constant_path_operator_write_node_create(pm_parser_t *parser, pm_constant_pat pm_constant_path_operator_write_node_t *node = PM_NODE_ALLOC(parser, pm_constant_path_operator_write_node_t); *node = (pm_constant_path_operator_write_node_t) { - { - .type = PM_CONSTANT_PATH_OPERATOR_WRITE_NODE, - .node_id = PM_NODE_IDENTIFY(parser), - .location = { - .start = target->base.location.start, - .end = value->location.end - } - }, + .base = PM_NODE_INIT(parser, PM_CONSTANT_PATH_OPERATOR_WRITE_NODE, 0, target->base.location.start, value->location.end), .target = target, .binary_operator_loc = PM_LOCATION_TOKEN_VALUE(operator), .value = value, @@ -3614,14 +3359,7 @@ pm_constant_path_or_write_node_create(pm_parser_t *parser, pm_constant_path_node pm_constant_path_or_write_node_t *node = PM_NODE_ALLOC(parser, pm_constant_path_or_write_node_t); *node = (pm_constant_path_or_write_node_t) { - { - .type = PM_CONSTANT_PATH_OR_WRITE_NODE, - .node_id = PM_NODE_IDENTIFY(parser), - .location = { - .start = target->base.location.start, - .end = value->location.end - } - }, + .base = PM_NODE_INIT(parser, PM_CONSTANT_PATH_OR_WRITE_NODE, 0, target->base.location.start, value->location.end), .target = target, .operator_loc = PM_LOCATION_TOKEN_VALUE(operator), .value = value @@ -3644,14 +3382,7 @@ pm_constant_path_node_create(pm_parser_t *parser, pm_node_t *parent, const pm_to } *node = (pm_constant_path_node_t) { - { - .type = PM_CONSTANT_PATH_NODE, - .node_id = PM_NODE_IDENTIFY(parser), - .location = { - .start = parent == NULL ? delimiter->start : parent->location.start, - .end = name_token->end - }, - }, + .base = PM_NODE_INIT(parser, PM_CONSTANT_PATH_NODE, 0, parent == NULL ? delimiter->start : parent->location.start, name_token->end), .parent = parent, .name = name, .delimiter_loc = PM_LOCATION_TOKEN_VALUE(delimiter), @@ -3667,17 +3398,10 @@ pm_constant_path_node_create(pm_parser_t *parser, pm_node_t *parent, const pm_to static pm_constant_path_write_node_t * pm_constant_path_write_node_create(pm_parser_t *parser, pm_constant_path_node_t *target, const pm_token_t *operator, pm_node_t *value) { pm_constant_path_write_node_t *node = PM_NODE_ALLOC(parser, pm_constant_path_write_node_t); + pm_node_flags_t flags = pm_implicit_array_write_flags(value, PM_WRITE_NODE_FLAGS_IMPLICIT_ARRAY); *node = (pm_constant_path_write_node_t) { - { - .type = PM_CONSTANT_PATH_WRITE_NODE, - .flags = pm_implicit_array_write_flags(value, PM_WRITE_NODE_FLAGS_IMPLICIT_ARRAY), - .node_id = PM_NODE_IDENTIFY(parser), - .location = { - .start = target->base.location.start, - .end = value->location.end - }, - }, + .base = PM_NODE_INIT(parser, PM_CONSTANT_PATH_WRITE_NODE, flags, target->base.location.start, value->location.end), .target = target, .operator_loc = PM_OPTIONAL_LOCATION_TOKEN_VALUE(operator), .value = value @@ -3695,14 +3419,7 @@ pm_constant_and_write_node_create(pm_parser_t *parser, pm_constant_read_node_t * pm_constant_and_write_node_t *node = PM_NODE_ALLOC(parser, pm_constant_and_write_node_t); *node = (pm_constant_and_write_node_t) { - { - .type = PM_CONSTANT_AND_WRITE_NODE, - .node_id = PM_NODE_IDENTIFY(parser), - .location = { - .start = target->base.location.start, - .end = value->location.end - } - }, + .base = PM_NODE_INIT(parser, PM_CONSTANT_AND_WRITE_NODE, 0, target->base.location.start, value->location.end), .name = target->name, .name_loc = target->base.location, .operator_loc = PM_LOCATION_TOKEN_VALUE(operator), @@ -3720,14 +3437,7 @@ pm_constant_operator_write_node_create(pm_parser_t *parser, pm_constant_read_nod pm_constant_operator_write_node_t *node = PM_NODE_ALLOC(parser, pm_constant_operator_write_node_t); *node = (pm_constant_operator_write_node_t) { - { - .type = PM_CONSTANT_OPERATOR_WRITE_NODE, - .node_id = PM_NODE_IDENTIFY(parser), - .location = { - .start = target->base.location.start, - .end = value->location.end - } - }, + .base = PM_NODE_INIT(parser, PM_CONSTANT_OPERATOR_WRITE_NODE, 0, target->base.location.start, value->location.end), .name = target->name, .name_loc = target->base.location, .binary_operator_loc = PM_LOCATION_TOKEN_VALUE(operator), @@ -3747,14 +3457,7 @@ pm_constant_or_write_node_create(pm_parser_t *parser, pm_constant_read_node_t *t pm_constant_or_write_node_t *node = PM_NODE_ALLOC(parser, pm_constant_or_write_node_t); *node = (pm_constant_or_write_node_t) { - { - .type = PM_CONSTANT_OR_WRITE_NODE, - .node_id = PM_NODE_IDENTIFY(parser), - .location = { - .start = target->base.location.start, - .end = value->location.end - } - }, + .base = PM_NODE_INIT(parser, PM_CONSTANT_OR_WRITE_NODE, 0, target->base.location.start, value->location.end), .name = target->name, .name_loc = target->base.location, .operator_loc = PM_LOCATION_TOKEN_VALUE(operator), @@ -3773,11 +3476,7 @@ pm_constant_read_node_create(pm_parser_t *parser, const pm_token_t *name) { pm_constant_read_node_t *node = PM_NODE_ALLOC(parser, pm_constant_read_node_t); *node = (pm_constant_read_node_t) { - { - .type = PM_CONSTANT_READ_NODE, - .node_id = PM_NODE_IDENTIFY(parser), - .location = PM_LOCATION_TOKEN_VALUE(name) - }, + .base = PM_NODE_INIT(parser, PM_CONSTANT_READ_NODE, 0, name->start, name->end), .name = pm_parser_constant_id_token(parser, name) }; @@ -3790,17 +3489,10 @@ pm_constant_read_node_create(pm_parser_t *parser, const pm_token_t *name) { static pm_constant_write_node_t * pm_constant_write_node_create(pm_parser_t *parser, pm_constant_read_node_t *target, const pm_token_t *operator, pm_node_t *value) { pm_constant_write_node_t *node = PM_NODE_ALLOC(parser, pm_constant_write_node_t); + pm_node_flags_t flags = pm_implicit_array_write_flags(value, PM_WRITE_NODE_FLAGS_IMPLICIT_ARRAY); *node = (pm_constant_write_node_t) { - { - .type = PM_CONSTANT_WRITE_NODE, - .flags = pm_implicit_array_write_flags(value, PM_WRITE_NODE_FLAGS_IMPLICIT_ARRAY), - .node_id = PM_NODE_IDENTIFY(parser), - .location = { - .start = target->base.location.start, - .end = value->location.end - } - }, + .base = PM_NODE_INIT(parser, PM_CONSTANT_WRITE_NODE, flags, target->base.location.start, value->location.end), .name = target->name, .name_loc = target->base.location, .operator_loc = PM_OPTIONAL_LOCATION_TOKEN_VALUE(operator), @@ -3887,11 +3579,7 @@ pm_def_node_create( } *node = (pm_def_node_t) { - { - .type = PM_DEF_NODE, - .node_id = PM_NODE_IDENTIFY(parser), - .location = { .start = def_keyword->start, .end = end }, - }, + .base = PM_NODE_INIT(parser, PM_DEF_NODE, 0, def_keyword->start, end), .name = name, .name_loc = PM_LOCATION_TOKEN_VALUE(name_loc), .receiver = receiver, @@ -3915,16 +3603,10 @@ pm_def_node_create( static pm_defined_node_t * pm_defined_node_create(pm_parser_t *parser, const pm_token_t *lparen, pm_node_t *value, const pm_token_t *rparen, const pm_location_t *keyword_loc) { pm_defined_node_t *node = PM_NODE_ALLOC(parser, pm_defined_node_t); + const uint8_t *end = rparen->type == PM_TOKEN_NOT_PROVIDED ? value->location.end : rparen->end; *node = (pm_defined_node_t) { - { - .type = PM_DEFINED_NODE, - .node_id = PM_NODE_IDENTIFY(parser), - .location = { - .start = keyword_loc->start, - .end = (rparen->type == PM_TOKEN_NOT_PROVIDED ? value->location.end : rparen->end) - }, - }, + .base = PM_NODE_INIT(parser, PM_DEFINED_NODE, 0, keyword_loc->start, end), .lparen_loc = PM_OPTIONAL_LOCATION_TOKEN_VALUE(lparen), .value = value, .rparen_loc = PM_OPTIONAL_LOCATION_TOKEN_VALUE(rparen), @@ -3948,14 +3630,7 @@ pm_else_node_create(pm_parser_t *parser, const pm_token_t *else_keyword, pm_stat } *node = (pm_else_node_t) { - { - .type = PM_ELSE_NODE, - .node_id = PM_NODE_IDENTIFY(parser), - .location = { - .start = else_keyword->start, - .end = end, - }, - }, + .base = PM_NODE_INIT(parser, PM_ELSE_NODE, 0, else_keyword->start, end), .else_keyword_loc = PM_LOCATION_TOKEN_VALUE(else_keyword), .statements = statements, .end_keyword_loc = PM_OPTIONAL_LOCATION_TOKEN_VALUE(end_keyword) @@ -3972,14 +3647,7 @@ pm_embedded_statements_node_create(pm_parser_t *parser, const pm_token_t *openin pm_embedded_statements_node_t *node = PM_NODE_ALLOC(parser, pm_embedded_statements_node_t); *node = (pm_embedded_statements_node_t) { - { - .type = PM_EMBEDDED_STATEMENTS_NODE, - .node_id = PM_NODE_IDENTIFY(parser), - .location = { - .start = opening->start, - .end = closing->end - } - }, + .base = PM_NODE_INIT(parser, PM_EMBEDDED_STATEMENTS_NODE, 0, opening->start, closing->end), .opening_loc = PM_LOCATION_TOKEN_VALUE(opening), .statements = statements, .closing_loc = PM_LOCATION_TOKEN_VALUE(closing) @@ -3996,14 +3664,7 @@ pm_embedded_variable_node_create(pm_parser_t *parser, const pm_token_t *operator pm_embedded_variable_node_t *node = PM_NODE_ALLOC(parser, pm_embedded_variable_node_t); *node = (pm_embedded_variable_node_t) { - { - .type = PM_EMBEDDED_VARIABLE_NODE, - .node_id = PM_NODE_IDENTIFY(parser), - .location = { - .start = operator->start, - .end = variable->location.end - } - }, + .base = PM_NODE_INIT(parser, PM_EMBEDDED_VARIABLE_NODE, 0, operator->start, variable->location.end), .operator_loc = PM_LOCATION_TOKEN_VALUE(operator), .variable = variable }; @@ -4019,14 +3680,7 @@ pm_ensure_node_create(pm_parser_t *parser, const pm_token_t *ensure_keyword, pm_ pm_ensure_node_t *node = PM_NODE_ALLOC(parser, pm_ensure_node_t); *node = (pm_ensure_node_t) { - { - .type = PM_ENSURE_NODE, - .node_id = PM_NODE_IDENTIFY(parser), - .location = { - .start = ensure_keyword->start, - .end = end_keyword->end - }, - }, + .base = PM_NODE_INIT(parser, PM_ENSURE_NODE, 0, ensure_keyword->start, end_keyword->end), .ensure_keyword_loc = PM_LOCATION_TOKEN_VALUE(ensure_keyword), .statements = statements, .end_keyword_loc = PM_LOCATION_TOKEN_VALUE(end_keyword) @@ -4043,12 +3697,9 @@ pm_false_node_create(pm_parser_t *parser, const pm_token_t *token) { assert(token->type == PM_TOKEN_KEYWORD_FALSE); pm_false_node_t *node = PM_NODE_ALLOC(parser, pm_false_node_t); - *node = (pm_false_node_t) {{ - .type = PM_FALSE_NODE, - .flags = PM_NODE_FLAG_STATIC_LITERAL, - .node_id = PM_NODE_IDENTIFY(parser), - .location = PM_LOCATION_TOKEN_VALUE(token) - }}; + *node = (pm_false_node_t) { + .base = PM_NODE_INIT(parser, PM_FALSE_NODE, PM_NODE_FLAG_STATIC_LITERAL, token->start, token->end) + }; return node; } @@ -4082,14 +3733,7 @@ pm_find_pattern_node_create(pm_parser_t *parser, pm_node_list_t *nodes) { pm_node_t *right_splat_node = right; #endif *node = (pm_find_pattern_node_t) { - { - .type = PM_FIND_PATTERN_NODE, - .node_id = PM_NODE_IDENTIFY(parser), - .location = { - .start = left->location.start, - .end = right->location.end, - }, - }, + .base = PM_NODE_INIT(parser, PM_FIND_PATTERN_NODE, 0, left->location.start, right->location.end), .constant = NULL, .left = left_splat_node, .right = right_splat_node, @@ -4190,12 +3834,7 @@ pm_float_node_create(pm_parser_t *parser, const pm_token_t *token) { pm_float_node_t *node = PM_NODE_ALLOC(parser, pm_float_node_t); *node = (pm_float_node_t) { - { - .type = PM_FLOAT_NODE, - .flags = PM_NODE_FLAG_STATIC_LITERAL, - .node_id = PM_NODE_IDENTIFY(parser), - .location = PM_LOCATION_TOKEN_VALUE(token) - }, + .base = PM_NODE_INIT(parser, PM_FLOAT_NODE, PM_NODE_FLAG_STATIC_LITERAL, token->start, token->end), .value = pm_double_parse(parser, token) }; @@ -4211,12 +3850,7 @@ pm_float_node_imaginary_create(pm_parser_t *parser, const pm_token_t *token) { pm_imaginary_node_t *node = PM_NODE_ALLOC(parser, pm_imaginary_node_t); *node = (pm_imaginary_node_t) { - { - .type = PM_IMAGINARY_NODE, - .flags = PM_NODE_FLAG_STATIC_LITERAL, - .node_id = PM_NODE_IDENTIFY(parser), - .location = PM_LOCATION_TOKEN_VALUE(token) - }, + .base = PM_NODE_INIT(parser, PM_IMAGINARY_NODE, PM_NODE_FLAG_STATIC_LITERAL, token->start, token->end), .numeric = (pm_node_t *) pm_float_node_create(parser, &((pm_token_t) { .type = PM_TOKEN_FLOAT, .start = token->start, @@ -4236,12 +3870,7 @@ pm_float_node_rational_create(pm_parser_t *parser, const pm_token_t *token) { pm_rational_node_t *node = PM_NODE_ALLOC(parser, pm_rational_node_t); *node = (pm_rational_node_t) { - { - .type = PM_RATIONAL_NODE, - .flags = PM_INTEGER_BASE_FLAGS_DECIMAL | PM_NODE_FLAG_STATIC_LITERAL, - .node_id = PM_NODE_IDENTIFY(parser), - .location = PM_LOCATION_TOKEN_VALUE(token) - }, + .base = PM_NODE_INIT(parser, PM_RATIONAL_NODE, PM_INTEGER_BASE_FLAGS_DECIMAL | PM_NODE_FLAG_STATIC_LITERAL, token->start, token->end), .numerator = { 0 }, .denominator = { 0 } }; @@ -4290,12 +3919,7 @@ pm_float_node_rational_imaginary_create(pm_parser_t *parser, const pm_token_t *t pm_imaginary_node_t *node = PM_NODE_ALLOC(parser, pm_imaginary_node_t); *node = (pm_imaginary_node_t) { - { - .type = PM_IMAGINARY_NODE, - .flags = PM_NODE_FLAG_STATIC_LITERAL, - .node_id = PM_NODE_IDENTIFY(parser), - .location = PM_LOCATION_TOKEN_VALUE(token) - }, + .base = PM_NODE_INIT(parser, PM_IMAGINARY_NODE, PM_NODE_FLAG_STATIC_LITERAL, token->start, token->end), .numeric = (pm_node_t *) pm_float_node_rational_create(parser, &((pm_token_t) { .type = PM_TOKEN_FLOAT_RATIONAL, .start = token->start, @@ -4323,14 +3947,7 @@ pm_for_node_create( pm_for_node_t *node = PM_NODE_ALLOC(parser, pm_for_node_t); *node = (pm_for_node_t) { - { - .type = PM_FOR_NODE, - .node_id = PM_NODE_IDENTIFY(parser), - .location = { - .start = for_keyword->start, - .end = end_keyword->end - }, - }, + .base = PM_NODE_INIT(parser, PM_FOR_NODE, 0, for_keyword->start, end_keyword->end), .index = index, .collection = collection, .statements = statements, @@ -4351,11 +3968,9 @@ pm_forwarding_arguments_node_create(pm_parser_t *parser, const pm_token_t *token assert(token->type == PM_TOKEN_UDOT_DOT_DOT); pm_forwarding_arguments_node_t *node = PM_NODE_ALLOC(parser, pm_forwarding_arguments_node_t); - *node = (pm_forwarding_arguments_node_t) {{ - .type = PM_FORWARDING_ARGUMENTS_NODE, - .node_id = PM_NODE_IDENTIFY(parser), - .location = PM_LOCATION_TOKEN_VALUE(token) - }}; + *node = (pm_forwarding_arguments_node_t) { + .base = PM_NODE_INIT(parser, PM_FORWARDING_ARGUMENTS_NODE, 0, token->start, token->end) + }; return node; } @@ -4368,11 +3983,9 @@ pm_forwarding_parameter_node_create(pm_parser_t *parser, const pm_token_t *token assert(token->type == PM_TOKEN_UDOT_DOT_DOT); pm_forwarding_parameter_node_t *node = PM_NODE_ALLOC(parser, pm_forwarding_parameter_node_t); - *node = (pm_forwarding_parameter_node_t) {{ - .type = PM_FORWARDING_PARAMETER_NODE, - .node_id = PM_NODE_IDENTIFY(parser), - .location = PM_LOCATION_TOKEN_VALUE(token) - }}; + *node = (pm_forwarding_parameter_node_t) { + .base = PM_NODE_INIT(parser, PM_FORWARDING_PARAMETER_NODE, 0, token->start, token->end) + }; return node; } @@ -4391,15 +4004,9 @@ pm_forwarding_super_node_create(pm_parser_t *parser, const pm_token_t *token, pm block = (pm_block_node_t *) arguments->block; } + const uint8_t *end = block != NULL ? block->base.location.end : token->end; *node = (pm_forwarding_super_node_t) { - { - .type = PM_FORWARDING_SUPER_NODE, - .node_id = PM_NODE_IDENTIFY(parser), - .location = { - .start = token->start, - .end = block != NULL ? block->base.location.end : token->end - }, - }, + .base = PM_NODE_INIT(parser, PM_FORWARDING_SUPER_NODE, 0, token->start, end), .block = block }; @@ -4415,14 +4022,7 @@ pm_hash_pattern_node_empty_create(pm_parser_t *parser, const pm_token_t *opening pm_hash_pattern_node_t *node = PM_NODE_ALLOC(parser, pm_hash_pattern_node_t); *node = (pm_hash_pattern_node_t) { - { - .type = PM_HASH_PATTERN_NODE, - .node_id = PM_NODE_IDENTIFY(parser), - .location = { - .start = opening->start, - .end = closing->end - }, - }, + .base = PM_NODE_INIT(parser, PM_HASH_PATTERN_NODE, 0, opening->start, closing->end), .constant = NULL, .opening_loc = PM_LOCATION_TOKEN_VALUE(opening), .closing_loc = PM_LOCATION_TOKEN_VALUE(closing), @@ -4458,14 +4058,7 @@ pm_hash_pattern_node_node_list_create(pm_parser_t *parser, pm_node_list_t *eleme } *node = (pm_hash_pattern_node_t) { - { - .type = PM_HASH_PATTERN_NODE, - .node_id = PM_NODE_IDENTIFY(parser), - .location = { - .start = start, - .end = end - }, - }, + .base = PM_NODE_INIT(parser, PM_HASH_PATTERN_NODE, 0, start, end), .constant = NULL, .elements = { 0 }, .rest = rest, @@ -4510,14 +4103,7 @@ pm_global_variable_and_write_node_create(pm_parser_t *parser, pm_node_t *target, pm_global_variable_and_write_node_t *node = PM_NODE_ALLOC(parser, pm_global_variable_and_write_node_t); *node = (pm_global_variable_and_write_node_t) { - { - .type = PM_GLOBAL_VARIABLE_AND_WRITE_NODE, - .node_id = PM_NODE_IDENTIFY(parser), - .location = { - .start = target->location.start, - .end = value->location.end - } - }, + .base = PM_NODE_INIT(parser, PM_GLOBAL_VARIABLE_AND_WRITE_NODE, 0, target->location.start, value->location.end), .name = pm_global_variable_write_name(parser, target), .name_loc = target->location, .operator_loc = PM_LOCATION_TOKEN_VALUE(operator), @@ -4535,14 +4121,7 @@ pm_global_variable_operator_write_node_create(pm_parser_t *parser, pm_node_t *ta pm_global_variable_operator_write_node_t *node = PM_NODE_ALLOC(parser, pm_global_variable_operator_write_node_t); *node = (pm_global_variable_operator_write_node_t) { - { - .type = PM_GLOBAL_VARIABLE_OPERATOR_WRITE_NODE, - .node_id = PM_NODE_IDENTIFY(parser), - .location = { - .start = target->location.start, - .end = value->location.end - } - }, + .base = PM_NODE_INIT(parser, PM_GLOBAL_VARIABLE_OPERATOR_WRITE_NODE, 0, target->location.start, value->location.end), .name = pm_global_variable_write_name(parser, target), .name_loc = target->location, .binary_operator_loc = PM_LOCATION_TOKEN_VALUE(operator), @@ -4562,14 +4141,7 @@ pm_global_variable_or_write_node_create(pm_parser_t *parser, pm_node_t *target, pm_global_variable_or_write_node_t *node = PM_NODE_ALLOC(parser, pm_global_variable_or_write_node_t); *node = (pm_global_variable_or_write_node_t) { - { - .type = PM_GLOBAL_VARIABLE_OR_WRITE_NODE, - .node_id = PM_NODE_IDENTIFY(parser), - .location = { - .start = target->location.start, - .end = value->location.end - } - }, + .base = PM_NODE_INIT(parser, PM_GLOBAL_VARIABLE_OR_WRITE_NODE, 0, target->location.start, value->location.end), .name = pm_global_variable_write_name(parser, target), .name_loc = target->location, .operator_loc = PM_LOCATION_TOKEN_VALUE(operator), @@ -4587,11 +4159,7 @@ pm_global_variable_read_node_create(pm_parser_t *parser, const pm_token_t *name) pm_global_variable_read_node_t *node = PM_NODE_ALLOC(parser, pm_global_variable_read_node_t); *node = (pm_global_variable_read_node_t) { - { - .type = PM_GLOBAL_VARIABLE_READ_NODE, - .node_id = PM_NODE_IDENTIFY(parser), - .location = PM_LOCATION_TOKEN_VALUE(name), - }, + .base = PM_NODE_INIT(parser, PM_GLOBAL_VARIABLE_READ_NODE, 0, name->start, name->end), .name = pm_parser_constant_id_token(parser, name) }; @@ -4606,11 +4174,7 @@ pm_global_variable_read_node_synthesized_create(pm_parser_t *parser, pm_constant pm_global_variable_read_node_t *node = PM_NODE_ALLOC(parser, pm_global_variable_read_node_t); *node = (pm_global_variable_read_node_t) { - { - .type = PM_GLOBAL_VARIABLE_READ_NODE, - .node_id = PM_NODE_IDENTIFY(parser), - .location = PM_LOCATION_NULL_VALUE(parser) - }, + .base = PM_NODE_INIT(parser, PM_GLOBAL_VARIABLE_READ_NODE, 0, parser->start, parser->start), .name = name }; @@ -4623,17 +4187,10 @@ pm_global_variable_read_node_synthesized_create(pm_parser_t *parser, pm_constant static pm_global_variable_write_node_t * pm_global_variable_write_node_create(pm_parser_t *parser, pm_node_t *target, const pm_token_t *operator, pm_node_t *value) { pm_global_variable_write_node_t *node = PM_NODE_ALLOC(parser, pm_global_variable_write_node_t); + pm_node_flags_t flags = pm_implicit_array_write_flags(value, PM_WRITE_NODE_FLAGS_IMPLICIT_ARRAY); *node = (pm_global_variable_write_node_t) { - { - .type = PM_GLOBAL_VARIABLE_WRITE_NODE, - .node_id = PM_NODE_IDENTIFY(parser), - .flags = pm_implicit_array_write_flags(value, PM_WRITE_NODE_FLAGS_IMPLICIT_ARRAY), - .location = { - .start = target->location.start, - .end = value->location.end - }, - }, + .base = PM_NODE_INIT(parser, PM_GLOBAL_VARIABLE_WRITE_NODE, flags, target->location.start, value->location.end), .name = pm_global_variable_write_name(parser, target), .name_loc = PM_LOCATION_NODE_VALUE(target), .operator_loc = PM_OPTIONAL_LOCATION_TOKEN_VALUE(operator), @@ -4651,11 +4208,7 @@ pm_global_variable_write_node_synthesized_create(pm_parser_t *parser, pm_constan pm_global_variable_write_node_t *node = PM_NODE_ALLOC(parser, pm_global_variable_write_node_t); *node = (pm_global_variable_write_node_t) { - { - .type = PM_GLOBAL_VARIABLE_WRITE_NODE, - .node_id = PM_NODE_IDENTIFY(parser), - .location = PM_LOCATION_NULL_VALUE(parser) - }, + .base = PM_NODE_INIT(parser, PM_GLOBAL_VARIABLE_WRITE_NODE, 0, parser->start, parser->start), .name = name, .name_loc = PM_LOCATION_NULL_VALUE(parser), .operator_loc = PM_LOCATION_NULL_VALUE(parser), @@ -4674,12 +4227,7 @@ pm_hash_node_create(pm_parser_t *parser, const pm_token_t *opening) { pm_hash_node_t *node = PM_NODE_ALLOC(parser, pm_hash_node_t); *node = (pm_hash_node_t) { - { - .type = PM_HASH_NODE, - .flags = PM_NODE_FLAG_STATIC_LITERAL, - .node_id = PM_NODE_IDENTIFY(parser), - .location = PM_LOCATION_TOKEN_VALUE(opening) - }, + .base = PM_NODE_INIT(parser, PM_HASH_NODE, PM_NODE_FLAG_STATIC_LITERAL, opening->start, opening->end), .opening_loc = PM_LOCATION_TOKEN_VALUE(opening), .closing_loc = PM_LOCATION_NULL_VALUE(parser), .elements = { 0 } @@ -4741,15 +4289,7 @@ pm_if_node_create(pm_parser_t *parser, } *node = (pm_if_node_t) { - { - .type = PM_IF_NODE, - .flags = PM_NODE_FLAG_NEWLINE, - .node_id = PM_NODE_IDENTIFY(parser), - .location = { - .start = if_keyword->start, - .end = end - }, - }, + .base = PM_NODE_INIT(parser, PM_IF_NODE, PM_NODE_FLAG_NEWLINE, if_keyword->start, end), .if_keyword_loc = PM_LOCATION_TOKEN_VALUE(if_keyword), .predicate = predicate, .then_keyword_loc = PM_OPTIONAL_LOCATION_TOKEN_VALUE(then_keyword), @@ -4773,15 +4313,7 @@ pm_if_node_modifier_create(pm_parser_t *parser, pm_node_t *statement, const pm_t pm_statements_node_body_append(parser, statements, statement, true); *node = (pm_if_node_t) { - { - .type = PM_IF_NODE, - .flags = PM_NODE_FLAG_NEWLINE, - .node_id = PM_NODE_IDENTIFY(parser), - .location = { - .start = statement->location.start, - .end = predicate->location.end - }, - }, + .base = PM_NODE_INIT(parser, PM_IF_NODE, PM_NODE_FLAG_NEWLINE, statement->location.start, predicate->location.end), .if_keyword_loc = PM_LOCATION_TOKEN_VALUE(if_keyword), .predicate = predicate, .then_keyword_loc = PM_OPTIONAL_LOCATION_NOT_PROVIDED_VALUE, @@ -4813,15 +4345,7 @@ pm_if_node_ternary_create(pm_parser_t *parser, pm_node_t *predicate, const pm_to pm_if_node_t *node = PM_NODE_ALLOC(parser, pm_if_node_t); *node = (pm_if_node_t) { - { - .type = PM_IF_NODE, - .flags = PM_NODE_FLAG_NEWLINE, - .node_id = PM_NODE_IDENTIFY(parser), - .location = { - .start = predicate->location.start, - .end = false_expression->location.end, - }, - }, + .base = PM_NODE_INIT(parser, PM_IF_NODE, PM_NODE_FLAG_NEWLINE, predicate->location.start, false_expression->location.end), .if_keyword_loc = PM_OPTIONAL_LOCATION_NOT_PROVIDED_VALUE, .predicate = predicate, .then_keyword_loc = PM_LOCATION_TOKEN_VALUE(qmark), @@ -4854,11 +4378,7 @@ pm_implicit_node_create(pm_parser_t *parser, pm_node_t *value) { pm_implicit_node_t *node = PM_NODE_ALLOC(parser, pm_implicit_node_t); *node = (pm_implicit_node_t) { - { - .type = PM_IMPLICIT_NODE, - .node_id = PM_NODE_IDENTIFY(parser), - .location = value->location - }, + .base = PM_NODE_INIT(parser, PM_IMPLICIT_NODE, 0, value->location.start, value->location.end), .value = value }; @@ -4875,11 +4395,7 @@ pm_implicit_rest_node_create(pm_parser_t *parser, const pm_token_t *token) { pm_implicit_rest_node_t *node = PM_NODE_ALLOC(parser, pm_implicit_rest_node_t); *node = (pm_implicit_rest_node_t) { - { - .type = PM_IMPLICIT_REST_NODE, - .node_id = PM_NODE_IDENTIFY(parser), - .location = PM_LOCATION_TOKEN_VALUE(token) - } + .base = PM_NODE_INIT(parser, PM_IMPLICIT_REST_NODE, 0, token->start, token->end) }; return node; @@ -4894,12 +4410,7 @@ pm_integer_node_create(pm_parser_t *parser, pm_node_flags_t base, const pm_token pm_integer_node_t *node = PM_NODE_ALLOC(parser, pm_integer_node_t); *node = (pm_integer_node_t) { - { - .type = PM_INTEGER_NODE, - .flags = base | PM_NODE_FLAG_STATIC_LITERAL, - .node_id = PM_NODE_IDENTIFY(parser), - .location = PM_LOCATION_TOKEN_VALUE(token) - }, + .base = PM_NODE_INIT(parser, PM_INTEGER_NODE, base | PM_NODE_FLAG_STATIC_LITERAL, token->start, token->end), .value = { 0 } }; @@ -4926,12 +4437,7 @@ pm_integer_node_imaginary_create(pm_parser_t *parser, pm_node_flags_t base, cons pm_imaginary_node_t *node = PM_NODE_ALLOC(parser, pm_imaginary_node_t); *node = (pm_imaginary_node_t) { - { - .type = PM_IMAGINARY_NODE, - .flags = PM_NODE_FLAG_STATIC_LITERAL, - .node_id = PM_NODE_IDENTIFY(parser), - .location = PM_LOCATION_TOKEN_VALUE(token) - }, + .base = PM_NODE_INIT(parser, PM_IMAGINARY_NODE, PM_NODE_FLAG_STATIC_LITERAL, token->start, token->end), .numeric = (pm_node_t *) pm_integer_node_create(parser, base, &((pm_token_t) { .type = PM_TOKEN_INTEGER, .start = token->start, @@ -4952,12 +4458,7 @@ pm_integer_node_rational_create(pm_parser_t *parser, pm_node_flags_t base, const pm_rational_node_t *node = PM_NODE_ALLOC(parser, pm_rational_node_t); *node = (pm_rational_node_t) { - { - .type = PM_RATIONAL_NODE, - .flags = base | PM_NODE_FLAG_STATIC_LITERAL, - .node_id = PM_NODE_IDENTIFY(parser), - .location = PM_LOCATION_TOKEN_VALUE(token) - }, + .base = PM_NODE_INIT(parser, PM_RATIONAL_NODE, base | PM_NODE_FLAG_STATIC_LITERAL, token->start, token->end), .numerator = { 0 }, .denominator = { .value = 1, 0 } }; @@ -4986,12 +4487,7 @@ pm_integer_node_rational_imaginary_create(pm_parser_t *parser, pm_node_flags_t b pm_imaginary_node_t *node = PM_NODE_ALLOC(parser, pm_imaginary_node_t); *node = (pm_imaginary_node_t) { - { - .type = PM_IMAGINARY_NODE, - .flags = PM_NODE_FLAG_STATIC_LITERAL, - .node_id = PM_NODE_IDENTIFY(parser), - .location = PM_LOCATION_TOKEN_VALUE(token) - }, + .base = PM_NODE_INIT(parser, PM_IMAGINARY_NODE, PM_NODE_FLAG_STATIC_LITERAL, token->start, token->end), .numeric = (pm_node_t *) pm_integer_node_rational_create(parser, base, &((pm_token_t) { .type = PM_TOKEN_INTEGER_RATIONAL, .start = token->start, @@ -5019,14 +4515,7 @@ pm_in_node_create(pm_parser_t *parser, pm_node_t *pattern, pm_statements_node_t } *node = (pm_in_node_t) { - { - .type = PM_IN_NODE, - .node_id = PM_NODE_IDENTIFY(parser), - .location = { - .start = in_keyword->start, - .end = end - }, - }, + .base = PM_NODE_INIT(parser, PM_IN_NODE, 0, in_keyword->start, end), .pattern = pattern, .statements = statements, .in_loc = PM_LOCATION_TOKEN_VALUE(in_keyword), @@ -5045,14 +4534,7 @@ pm_instance_variable_and_write_node_create(pm_parser_t *parser, pm_instance_vari pm_instance_variable_and_write_node_t *node = PM_NODE_ALLOC(parser, pm_instance_variable_and_write_node_t); *node = (pm_instance_variable_and_write_node_t) { - { - .type = PM_INSTANCE_VARIABLE_AND_WRITE_NODE, - .node_id = PM_NODE_IDENTIFY(parser), - .location = { - .start = target->base.location.start, - .end = value->location.end - } - }, + .base = PM_NODE_INIT(parser, PM_INSTANCE_VARIABLE_AND_WRITE_NODE, 0, target->base.location.start, value->location.end), .name = target->name, .name_loc = target->base.location, .operator_loc = PM_LOCATION_TOKEN_VALUE(operator), @@ -5070,14 +4552,7 @@ pm_instance_variable_operator_write_node_create(pm_parser_t *parser, pm_instance pm_instance_variable_operator_write_node_t *node = PM_NODE_ALLOC(parser, pm_instance_variable_operator_write_node_t); *node = (pm_instance_variable_operator_write_node_t) { - { - .type = PM_INSTANCE_VARIABLE_OPERATOR_WRITE_NODE, - .node_id = PM_NODE_IDENTIFY(parser), - .location = { - .start = target->base.location.start, - .end = value->location.end - } - }, + .base = PM_NODE_INIT(parser, PM_INSTANCE_VARIABLE_OPERATOR_WRITE_NODE, 0, target->base.location.start, value->location.end), .name = target->name, .name_loc = target->base.location, .binary_operator_loc = PM_LOCATION_TOKEN_VALUE(operator), @@ -5097,14 +4572,7 @@ pm_instance_variable_or_write_node_create(pm_parser_t *parser, pm_instance_varia pm_instance_variable_or_write_node_t *node = PM_NODE_ALLOC(parser, pm_instance_variable_or_write_node_t); *node = (pm_instance_variable_or_write_node_t) { - { - .type = PM_INSTANCE_VARIABLE_OR_WRITE_NODE, - .node_id = PM_NODE_IDENTIFY(parser), - .location = { - .start = target->base.location.start, - .end = value->location.end - } - }, + .base = PM_NODE_INIT(parser, PM_INSTANCE_VARIABLE_OR_WRITE_NODE, 0, target->base.location.start, value->location.end), .name = target->name, .name_loc = target->base.location, .operator_loc = PM_LOCATION_TOKEN_VALUE(operator), @@ -5123,11 +4591,7 @@ pm_instance_variable_read_node_create(pm_parser_t *parser, const pm_token_t *tok pm_instance_variable_read_node_t *node = PM_NODE_ALLOC(parser, pm_instance_variable_read_node_t); *node = (pm_instance_variable_read_node_t) { - { - .type = PM_INSTANCE_VARIABLE_READ_NODE, - .node_id = PM_NODE_IDENTIFY(parser), - .location = PM_LOCATION_TOKEN_VALUE(token) - }, + .base = PM_NODE_INIT(parser, PM_INSTANCE_VARIABLE_READ_NODE, 0, token->start, token->end), .name = pm_parser_constant_id_token(parser, token) }; @@ -5141,16 +4605,10 @@ pm_instance_variable_read_node_create(pm_parser_t *parser, const pm_token_t *tok static pm_instance_variable_write_node_t * pm_instance_variable_write_node_create(pm_parser_t *parser, pm_instance_variable_read_node_t *read_node, pm_token_t *operator, pm_node_t *value) { pm_instance_variable_write_node_t *node = PM_NODE_ALLOC(parser, pm_instance_variable_write_node_t); + pm_node_flags_t flags = pm_implicit_array_write_flags(value, PM_WRITE_NODE_FLAGS_IMPLICIT_ARRAY); + *node = (pm_instance_variable_write_node_t) { - { - .type = PM_INSTANCE_VARIABLE_WRITE_NODE, - .flags = pm_implicit_array_write_flags(value, PM_WRITE_NODE_FLAGS_IMPLICIT_ARRAY), - .node_id = PM_NODE_IDENTIFY(parser), - .location = { - .start = read_node->base.location.start, - .end = value->location.end - } - }, + .base = PM_NODE_INIT(parser, PM_INSTANCE_VARIABLE_WRITE_NODE, flags, read_node->base.location.start, value->location.end), .name = read_node->name, .name_loc = PM_LOCATION_NODE_BASE_VALUE(read_node), .operator_loc = PM_OPTIONAL_LOCATION_TOKEN_VALUE(operator), @@ -5212,15 +4670,7 @@ pm_interpolated_regular_expression_node_create(pm_parser_t *parser, const pm_tok pm_interpolated_regular_expression_node_t *node = PM_NODE_ALLOC(parser, pm_interpolated_regular_expression_node_t); *node = (pm_interpolated_regular_expression_node_t) { - { - .type = PM_INTERPOLATED_REGULAR_EXPRESSION_NODE, - .flags = PM_NODE_FLAG_STATIC_LITERAL, - .node_id = PM_NODE_IDENTIFY(parser), - .location = { - .start = opening->start, - .end = NULL, - }, - }, + .base = PM_NODE_INIT(parser, PM_INTERPOLATED_REGULAR_EXPRESSION_NODE, PM_NODE_FLAG_STATIC_LITERAL, opening->start, NULL), .opening_loc = PM_LOCATION_TOKEN_VALUE(opening), .closing_loc = PM_LOCATION_TOKEN_VALUE(opening), .parts = { 0 } @@ -5379,15 +4829,7 @@ pm_interpolated_string_node_create(pm_parser_t *parser, const pm_token_t *openin } *node = (pm_interpolated_string_node_t) { - { - .type = PM_INTERPOLATED_STRING_NODE, - .flags = flags, - .node_id = PM_NODE_IDENTIFY(parser), - .location = { - .start = opening->start, - .end = closing->end, - }, - }, + .base = PM_NODE_INIT(parser, PM_INTERPOLATED_STRING_NODE, flags, opening->start, closing->end), .opening_loc = PM_OPTIONAL_LOCATION_TOKEN_VALUE(opening), .closing_loc = PM_OPTIONAL_LOCATION_TOKEN_VALUE(closing), .parts = { 0 } @@ -5436,15 +4878,7 @@ pm_interpolated_symbol_node_create(pm_parser_t *parser, const pm_token_t *openin pm_interpolated_symbol_node_t *node = PM_NODE_ALLOC(parser, pm_interpolated_symbol_node_t); *node = (pm_interpolated_symbol_node_t) { - { - .type = PM_INTERPOLATED_SYMBOL_NODE, - .flags = PM_NODE_FLAG_STATIC_LITERAL, - .node_id = PM_NODE_IDENTIFY(parser), - .location = { - .start = opening->start, - .end = closing->end, - }, - }, + .base = PM_NODE_INIT(parser, PM_INTERPOLATED_SYMBOL_NODE, PM_NODE_FLAG_STATIC_LITERAL, opening->start, closing->end), .opening_loc = PM_OPTIONAL_LOCATION_TOKEN_VALUE(opening), .closing_loc = PM_OPTIONAL_LOCATION_TOKEN_VALUE(closing), .parts = { 0 } @@ -5468,14 +4902,7 @@ pm_interpolated_xstring_node_create(pm_parser_t *parser, const pm_token_t *openi pm_interpolated_x_string_node_t *node = PM_NODE_ALLOC(parser, pm_interpolated_x_string_node_t); *node = (pm_interpolated_x_string_node_t) { - { - .type = PM_INTERPOLATED_X_STRING_NODE, - .node_id = PM_NODE_IDENTIFY(parser), - .location = { - .start = opening->start, - .end = closing->end - }, - }, + .base = PM_NODE_INIT(parser, PM_INTERPOLATED_X_STRING_NODE, 0, opening->start, closing->end), .opening_loc = PM_OPTIONAL_LOCATION_TOKEN_VALUE(opening), .closing_loc = PM_OPTIONAL_LOCATION_TOKEN_VALUE(closing), .parts = { 0 } @@ -5504,11 +4931,7 @@ pm_it_local_variable_read_node_create(pm_parser_t *parser, const pm_token_t *nam pm_it_local_variable_read_node_t *node = PM_NODE_ALLOC(parser, pm_it_local_variable_read_node_t); *node = (pm_it_local_variable_read_node_t) { - { - .type = PM_IT_LOCAL_VARIABLE_READ_NODE, - .node_id = PM_NODE_IDENTIFY(parser), - .location = PM_LOCATION_TOKEN_VALUE(name) - } + .base = PM_NODE_INIT(parser, PM_IT_LOCAL_VARIABLE_READ_NODE, 0, name->start, name->end), }; return node; @@ -5522,14 +4945,7 @@ pm_it_parameters_node_create(pm_parser_t *parser, const pm_token_t *opening, con pm_it_parameters_node_t *node = PM_NODE_ALLOC(parser, pm_it_parameters_node_t); *node = (pm_it_parameters_node_t) { - { - .type = PM_IT_PARAMETERS_NODE, - .node_id = PM_NODE_IDENTIFY(parser), - .location = { - .start = opening->start, - .end = closing->end - } - } + .base = PM_NODE_INIT(parser, PM_IT_PARAMETERS_NODE, 0, opening->start, closing->end), }; return node; @@ -5543,12 +4959,7 @@ pm_keyword_hash_node_create(pm_parser_t *parser) { pm_keyword_hash_node_t *node = PM_NODE_ALLOC(parser, pm_keyword_hash_node_t); *node = (pm_keyword_hash_node_t) { - .base = { - .type = PM_KEYWORD_HASH_NODE, - .flags = PM_KEYWORD_HASH_NODE_FLAGS_SYMBOL_KEYS, - .node_id = PM_NODE_IDENTIFY(parser), - .location = PM_OPTIONAL_LOCATION_NOT_PROVIDED_VALUE - }, + .base = PM_NODE_INIT(parser, PM_KEYWORD_HASH_NODE, PM_KEYWORD_HASH_NODE_FLAGS_SYMBOL_KEYS, NULL, NULL), .elements = { 0 } }; @@ -5581,14 +4992,7 @@ pm_required_keyword_parameter_node_create(pm_parser_t *parser, const pm_token_t pm_required_keyword_parameter_node_t *node = PM_NODE_ALLOC(parser, pm_required_keyword_parameter_node_t); *node = (pm_required_keyword_parameter_node_t) { - { - .type = PM_REQUIRED_KEYWORD_PARAMETER_NODE, - .node_id = PM_NODE_IDENTIFY(parser), - .location = { - .start = name->start, - .end = name->end - }, - }, + .base = PM_NODE_INIT(parser, PM_REQUIRED_KEYWORD_PARAMETER_NODE, 0, name->start, name->end), .name = pm_parser_constant_id_location(parser, name->start, name->end - 1), .name_loc = PM_LOCATION_TOKEN_VALUE(name), }; @@ -5604,14 +5008,7 @@ pm_optional_keyword_parameter_node_create(pm_parser_t *parser, const pm_token_t pm_optional_keyword_parameter_node_t *node = PM_NODE_ALLOC(parser, pm_optional_keyword_parameter_node_t); *node = (pm_optional_keyword_parameter_node_t) { - { - .type = PM_OPTIONAL_KEYWORD_PARAMETER_NODE, - .node_id = PM_NODE_IDENTIFY(parser), - .location = { - .start = name->start, - .end = value->location.end - }, - }, + .base = PM_NODE_INIT(parser, PM_OPTIONAL_KEYWORD_PARAMETER_NODE, 0, name->start, value->location.end), .name = pm_parser_constant_id_location(parser, name->start, name->end - 1), .name_loc = PM_LOCATION_TOKEN_VALUE(name), .value = value @@ -5628,14 +5025,7 @@ pm_keyword_rest_parameter_node_create(pm_parser_t *parser, const pm_token_t *ope pm_keyword_rest_parameter_node_t *node = PM_NODE_ALLOC(parser, pm_keyword_rest_parameter_node_t); *node = (pm_keyword_rest_parameter_node_t) { - { - .type = PM_KEYWORD_REST_PARAMETER_NODE, - .node_id = PM_NODE_IDENTIFY(parser), - .location = { - .start = operator->start, - .end = (name->type == PM_TOKEN_NOT_PROVIDED ? operator->end : name->end) - }, - }, + .base = PM_NODE_INIT(parser, PM_KEYWORD_REST_PARAMETER_NODE, 0, operator->start, (name->type == PM_TOKEN_NOT_PROVIDED ? operator->end : name->end)), .name = pm_parser_optional_constant_id_token(parser, name), .name_loc = PM_OPTIONAL_LOCATION_TOKEN_VALUE(name), .operator_loc = PM_LOCATION_TOKEN_VALUE(operator) @@ -5660,14 +5050,7 @@ pm_lambda_node_create( pm_lambda_node_t *node = PM_NODE_ALLOC(parser, pm_lambda_node_t); *node = (pm_lambda_node_t) { - { - .type = PM_LAMBDA_NODE, - .node_id = PM_NODE_IDENTIFY(parser), - .location = { - .start = operator->start, - .end = closing->end - }, - }, + .base = PM_NODE_INIT(parser, PM_LAMBDA_NODE, 0, operator->start, closing->end), .locals = *locals, .operator_loc = PM_LOCATION_TOKEN_VALUE(operator), .opening_loc = PM_LOCATION_TOKEN_VALUE(opening), @@ -5689,14 +5072,7 @@ pm_local_variable_and_write_node_create(pm_parser_t *parser, pm_node_t *target, pm_local_variable_and_write_node_t *node = PM_NODE_ALLOC(parser, pm_local_variable_and_write_node_t); *node = (pm_local_variable_and_write_node_t) { - { - .type = PM_LOCAL_VARIABLE_AND_WRITE_NODE, - .node_id = PM_NODE_IDENTIFY(parser), - .location = { - .start = target->location.start, - .end = value->location.end - } - }, + .base = PM_NODE_INIT(parser, PM_LOCAL_VARIABLE_AND_WRITE_NODE, 0, target->location.start, value->location.end), .name_loc = target->location, .operator_loc = PM_LOCATION_TOKEN_VALUE(operator), .value = value, @@ -5715,14 +5091,7 @@ pm_local_variable_operator_write_node_create(pm_parser_t *parser, pm_node_t *tar pm_local_variable_operator_write_node_t *node = PM_NODE_ALLOC(parser, pm_local_variable_operator_write_node_t); *node = (pm_local_variable_operator_write_node_t) { - { - .type = PM_LOCAL_VARIABLE_OPERATOR_WRITE_NODE, - .node_id = PM_NODE_IDENTIFY(parser), - .location = { - .start = target->location.start, - .end = value->location.end - } - }, + .base = PM_NODE_INIT(parser, PM_LOCAL_VARIABLE_OPERATOR_WRITE_NODE, 0, target->location.start, value->location.end), .name_loc = target->location, .binary_operator_loc = PM_LOCATION_TOKEN_VALUE(operator), .value = value, @@ -5744,14 +5113,7 @@ pm_local_variable_or_write_node_create(pm_parser_t *parser, pm_node_t *target, c pm_local_variable_or_write_node_t *node = PM_NODE_ALLOC(parser, pm_local_variable_or_write_node_t); *node = (pm_local_variable_or_write_node_t) { - { - .type = PM_LOCAL_VARIABLE_OR_WRITE_NODE, - .node_id = PM_NODE_IDENTIFY(parser), - .location = { - .start = target->location.start, - .end = value->location.end - } - }, + .base = PM_NODE_INIT(parser, PM_LOCAL_VARIABLE_OR_WRITE_NODE, 0, target->location.start, value->location.end), .name_loc = target->location, .operator_loc = PM_LOCATION_TOKEN_VALUE(operator), .value = value, @@ -5772,11 +5134,7 @@ pm_local_variable_read_node_create_constant_id(pm_parser_t *parser, const pm_tok pm_local_variable_read_node_t *node = PM_NODE_ALLOC(parser, pm_local_variable_read_node_t); *node = (pm_local_variable_read_node_t) { - { - .type = PM_LOCAL_VARIABLE_READ_NODE, - .node_id = PM_NODE_IDENTIFY(parser), - .location = PM_LOCATION_TOKEN_VALUE(name) - }, + .base = PM_NODE_INIT(parser, PM_LOCAL_VARIABLE_READ_NODE, 0, name->start, name->end), .name = name_id, .depth = depth }; @@ -5809,17 +5167,10 @@ pm_local_variable_read_node_missing_create(pm_parser_t *parser, const pm_token_t static pm_local_variable_write_node_t * pm_local_variable_write_node_create(pm_parser_t *parser, pm_constant_id_t name, uint32_t depth, pm_node_t *value, const pm_location_t *name_loc, const pm_token_t *operator) { pm_local_variable_write_node_t *node = PM_NODE_ALLOC(parser, pm_local_variable_write_node_t); + pm_node_flags_t flags = pm_implicit_array_write_flags(value, PM_WRITE_NODE_FLAGS_IMPLICIT_ARRAY); *node = (pm_local_variable_write_node_t) { - { - .type = PM_LOCAL_VARIABLE_WRITE_NODE, - .flags = pm_implicit_array_write_flags(value, PM_WRITE_NODE_FLAGS_IMPLICIT_ARRAY), - .node_id = PM_NODE_IDENTIFY(parser), - .location = { - .start = name_loc->start, - .end = value->location.end - } - }, + .base = PM_NODE_INIT(parser, PM_LOCAL_VARIABLE_WRITE_NODE, flags, name_loc->start, value->location.end), .name = name, .depth = depth, .value = value, @@ -5868,11 +5219,7 @@ pm_local_variable_target_node_create(pm_parser_t *parser, const pm_location_t *l pm_local_variable_target_node_t *node = PM_NODE_ALLOC(parser, pm_local_variable_target_node_t); *node = (pm_local_variable_target_node_t) { - { - .type = PM_LOCAL_VARIABLE_TARGET_NODE, - .node_id = PM_NODE_IDENTIFY(parser), - .location = *location - }, + .base = PM_NODE_INIT(parser, PM_LOCAL_VARIABLE_TARGET_NODE, 0, location->start, location->end), .name = name, .depth = depth }; @@ -5890,14 +5237,7 @@ pm_match_predicate_node_create(pm_parser_t *parser, pm_node_t *value, pm_node_t pm_match_predicate_node_t *node = PM_NODE_ALLOC(parser, pm_match_predicate_node_t); *node = (pm_match_predicate_node_t) { - { - .type = PM_MATCH_PREDICATE_NODE, - .node_id = PM_NODE_IDENTIFY(parser), - .location = { - .start = value->location.start, - .end = pattern->location.end - } - }, + .base = PM_NODE_INIT(parser, PM_MATCH_PREDICATE_NODE, 0, value->location.start, pattern->location.end), .value = value, .pattern = pattern, .operator_loc = PM_LOCATION_TOKEN_VALUE(operator) @@ -5916,14 +5256,7 @@ pm_match_required_node_create(pm_parser_t *parser, pm_node_t *value, pm_node_t * pm_match_required_node_t *node = PM_NODE_ALLOC(parser, pm_match_required_node_t); *node = (pm_match_required_node_t) { - { - .type = PM_MATCH_REQUIRED_NODE, - .node_id = PM_NODE_IDENTIFY(parser), - .location = { - .start = value->location.start, - .end = pattern->location.end - } - }, + .base = PM_NODE_INIT(parser, PM_MATCH_REQUIRED_NODE, 0, value->location.start, pattern->location.end), .value = value, .pattern = pattern, .operator_loc = PM_LOCATION_TOKEN_VALUE(operator) @@ -5940,11 +5273,7 @@ pm_match_write_node_create(pm_parser_t *parser, pm_call_node_t *call) { pm_match_write_node_t *node = PM_NODE_ALLOC(parser, pm_match_write_node_t); *node = (pm_match_write_node_t) { - { - .type = PM_MATCH_WRITE_NODE, - .node_id = PM_NODE_IDENTIFY(parser), - .location = call->base.location - }, + .base = PM_NODE_INIT(parser, PM_MATCH_WRITE_NODE, 0, call->base.location.start, call->base.location.end), .call = call, .targets = { 0 } }; @@ -5960,14 +5289,7 @@ pm_module_node_create(pm_parser_t *parser, pm_constant_id_list_t *locals, const pm_module_node_t *node = PM_NODE_ALLOC(parser, pm_module_node_t); *node = (pm_module_node_t) { - { - .type = PM_MODULE_NODE, - .node_id = PM_NODE_IDENTIFY(parser), - .location = { - .start = module_keyword->start, - .end = end_keyword->end - } - }, + .base = PM_NODE_INIT(parser, PM_MODULE_NODE, 0, module_keyword->start, end_keyword->end), .locals = (locals == NULL ? ((pm_constant_id_list_t) { .ids = NULL, .size = 0, .capacity = 0 }) : *locals), .module_keyword_loc = PM_LOCATION_TOKEN_VALUE(module_keyword), .constant_path = constant_path, @@ -5987,11 +5309,7 @@ pm_multi_target_node_create(pm_parser_t *parser) { pm_multi_target_node_t *node = PM_NODE_ALLOC(parser, pm_multi_target_node_t); *node = (pm_multi_target_node_t) { - { - .type = PM_MULTI_TARGET_NODE, - .node_id = PM_NODE_IDENTIFY(parser), - .location = { .start = NULL, .end = NULL } - }, + .base = PM_NODE_INIT(parser, PM_MULTI_TARGET_NODE, 0, NULL, NULL), .lefts = { 0 }, .rest = NULL, .rights = { 0 }, @@ -6060,17 +5378,10 @@ pm_multi_target_node_closing_set(pm_multi_target_node_t *node, const pm_token_t static pm_multi_write_node_t * pm_multi_write_node_create(pm_parser_t *parser, pm_multi_target_node_t *target, const pm_token_t *operator, pm_node_t *value) { pm_multi_write_node_t *node = PM_NODE_ALLOC(parser, pm_multi_write_node_t); + pm_node_flags_t flags = pm_implicit_array_write_flags(value, PM_WRITE_NODE_FLAGS_IMPLICIT_ARRAY); *node = (pm_multi_write_node_t) { - { - .type = PM_MULTI_WRITE_NODE, - .flags = pm_implicit_array_write_flags(value, PM_WRITE_NODE_FLAGS_IMPLICIT_ARRAY), - .node_id = PM_NODE_IDENTIFY(parser), - .location = { - .start = target->base.location.start, - .end = value->location.end - } - }, + .base = PM_NODE_INIT(parser, PM_MULTI_WRITE_NODE, flags, target->base.location.start, value->location.end), .lefts = target->lefts, .rest = target->rest, .rights = target->rights, @@ -6096,14 +5407,7 @@ pm_next_node_create(pm_parser_t *parser, const pm_token_t *keyword, pm_arguments pm_next_node_t *node = PM_NODE_ALLOC(parser, pm_next_node_t); *node = (pm_next_node_t) { - { - .type = PM_NEXT_NODE, - .node_id = PM_NODE_IDENTIFY(parser), - .location = { - .start = keyword->start, - .end = (arguments == NULL ? keyword->end : arguments->base.location.end) - } - }, + .base = PM_NODE_INIT(parser, PM_NEXT_NODE, 0, keyword->start, (arguments == NULL ? keyword->end : arguments->base.location.end)), .keyword_loc = PM_LOCATION_TOKEN_VALUE(keyword), .arguments = arguments }; @@ -6119,12 +5423,9 @@ pm_nil_node_create(pm_parser_t *parser, const pm_token_t *token) { assert(token->type == PM_TOKEN_KEYWORD_NIL); pm_nil_node_t *node = PM_NODE_ALLOC(parser, pm_nil_node_t); - *node = (pm_nil_node_t) {{ - .type = PM_NIL_NODE, - .flags = PM_NODE_FLAG_STATIC_LITERAL, - .node_id = PM_NODE_IDENTIFY(parser), - .location = PM_LOCATION_TOKEN_VALUE(token) - }}; + *node = (pm_nil_node_t) { + .base = PM_NODE_INIT(parser, PM_NIL_NODE, PM_NODE_FLAG_STATIC_LITERAL, token->start, token->end) + }; return node; } @@ -6139,14 +5440,7 @@ pm_no_keywords_parameter_node_create(pm_parser_t *parser, const pm_token_t *oper pm_no_keywords_parameter_node_t *node = PM_NODE_ALLOC(parser, pm_no_keywords_parameter_node_t); *node = (pm_no_keywords_parameter_node_t) { - { - .type = PM_NO_KEYWORDS_PARAMETER_NODE, - .node_id = PM_NODE_IDENTIFY(parser), - .location = { - .start = operator->start, - .end = keyword->end - } - }, + .base = PM_NODE_INIT(parser, PM_NO_KEYWORDS_PARAMETER_NODE, 0, operator->start, keyword->end), .operator_loc = PM_LOCATION_TOKEN_VALUE(operator), .keyword_loc = PM_LOCATION_TOKEN_VALUE(keyword) }; @@ -6162,11 +5456,7 @@ pm_numbered_parameters_node_create(pm_parser_t *parser, const pm_location_t *loc pm_numbered_parameters_node_t *node = PM_NODE_ALLOC(parser, pm_numbered_parameters_node_t); *node = (pm_numbered_parameters_node_t) { - { - .type = PM_NUMBERED_PARAMETERS_NODE, - .node_id = PM_NODE_IDENTIFY(parser), - .location = *location - }, + .base = PM_NODE_INIT(parser, PM_NUMBERED_PARAMETERS_NODE, 0, location->start, location->end), .maximum = maximum }; @@ -6231,11 +5521,7 @@ pm_numbered_reference_read_node_create(pm_parser_t *parser, const pm_token_t *na pm_numbered_reference_read_node_t *node = PM_NODE_ALLOC(parser, pm_numbered_reference_read_node_t); *node = (pm_numbered_reference_read_node_t) { - { - .type = PM_NUMBERED_REFERENCE_READ_NODE, - .node_id = PM_NODE_IDENTIFY(parser), - .location = PM_LOCATION_TOKEN_VALUE(name), - }, + .base = PM_NODE_INIT(parser, PM_NUMBERED_REFERENCE_READ_NODE, 0, name->start, name->end), .number = pm_numbered_reference_read_node_number(parser, name) }; @@ -6250,14 +5536,7 @@ pm_optional_parameter_node_create(pm_parser_t *parser, const pm_token_t *name, c pm_optional_parameter_node_t *node = PM_NODE_ALLOC(parser, pm_optional_parameter_node_t); *node = (pm_optional_parameter_node_t) { - { - .type = PM_OPTIONAL_PARAMETER_NODE, - .node_id = PM_NODE_IDENTIFY(parser), - .location = { - .start = name->start, - .end = value->location.end - } - }, + .base = PM_NODE_INIT(parser, PM_OPTIONAL_PARAMETER_NODE, 0, name->start, value->location.end), .name = pm_parser_constant_id_token(parser, name), .name_loc = PM_LOCATION_TOKEN_VALUE(name), .operator_loc = PM_LOCATION_TOKEN_VALUE(operator), @@ -6277,14 +5556,7 @@ pm_or_node_create(pm_parser_t *parser, pm_node_t *left, const pm_token_t *operat pm_or_node_t *node = PM_NODE_ALLOC(parser, pm_or_node_t); *node = (pm_or_node_t) { - { - .type = PM_OR_NODE, - .node_id = PM_NODE_IDENTIFY(parser), - .location = { - .start = left->location.start, - .end = right->location.end - } - }, + .base = PM_NODE_INIT(parser, PM_OR_NODE, 0, left->location.start, right->location.end), .left = left, .right = right, .operator_loc = PM_LOCATION_TOKEN_VALUE(operator) @@ -6301,11 +5573,7 @@ pm_parameters_node_create(pm_parser_t *parser) { pm_parameters_node_t *node = PM_NODE_ALLOC(parser, pm_parameters_node_t); *node = (pm_parameters_node_t) { - { - .type = PM_PARAMETERS_NODE, - .node_id = PM_NODE_IDENTIFY(parser), - .location = PM_LOCATION_TOKEN_VALUE(&parser->current) - }, + .base = PM_NODE_INIT(parser, PM_PARAMETERS_NODE, 0, NULL, NULL), .rest = NULL, .keyword_rest = NULL, .block = NULL, @@ -6408,15 +5676,11 @@ static pm_program_node_t * pm_program_node_create(pm_parser_t *parser, pm_constant_id_list_t *locals, pm_statements_node_t *statements) { pm_program_node_t *node = PM_NODE_ALLOC(parser, pm_program_node_t); + const uint8_t *start = statements == NULL ? parser->start : statements->base.location.start; + const uint8_t *end = statements == NULL ? parser->end : statements->base.location.end; + *node = (pm_program_node_t) { - { - .type = PM_PROGRAM_NODE, - .node_id = PM_NODE_IDENTIFY(parser), - .location = { - .start = statements == NULL ? parser->start : statements->base.location.start, - .end = statements == NULL ? parser->end : statements->base.location.end - } - }, + .base = PM_NODE_INIT(parser, PM_PROGRAM_NODE, 0, start, end), .locals = *locals, .statements = statements }; @@ -6432,15 +5696,7 @@ pm_parentheses_node_create(pm_parser_t *parser, const pm_token_t *opening, pm_no pm_parentheses_node_t *node = PM_NODE_ALLOC(parser, pm_parentheses_node_t); *node = (pm_parentheses_node_t) { - { - .type = PM_PARENTHESES_NODE, - .flags = flags, - .node_id = PM_NODE_IDENTIFY(parser), - .location = { - .start = opening->start, - .end = closing->end - } - }, + .base = PM_NODE_INIT(parser, PM_PARENTHESES_NODE, flags, opening->start, closing->end), .body = body, .opening_loc = PM_LOCATION_TOKEN_VALUE(opening), .closing_loc = PM_LOCATION_TOKEN_VALUE(closing) @@ -6457,14 +5713,7 @@ pm_pinned_expression_node_create(pm_parser_t *parser, pm_node_t *expression, con pm_pinned_expression_node_t *node = PM_NODE_ALLOC(parser, pm_pinned_expression_node_t); *node = (pm_pinned_expression_node_t) { - { - .type = PM_PINNED_EXPRESSION_NODE, - .node_id = PM_NODE_IDENTIFY(parser), - .location = { - .start = operator->start, - .end = rparen->end - } - }, + .base = PM_NODE_INIT(parser, PM_PINNED_EXPRESSION_NODE, 0, operator->start, rparen->end), .expression = expression, .operator_loc = PM_LOCATION_TOKEN_VALUE(operator), .lparen_loc = PM_LOCATION_TOKEN_VALUE(lparen), @@ -6482,14 +5731,7 @@ pm_pinned_variable_node_create(pm_parser_t *parser, const pm_token_t *operator, pm_pinned_variable_node_t *node = PM_NODE_ALLOC(parser, pm_pinned_variable_node_t); *node = (pm_pinned_variable_node_t) { - { - .type = PM_PINNED_VARIABLE_NODE, - .node_id = PM_NODE_IDENTIFY(parser), - .location = { - .start = operator->start, - .end = variable->location.end - } - }, + .base = PM_NODE_INIT(parser, PM_PINNED_VARIABLE_NODE, 0, operator->start, variable->location.end), .variable = variable, .operator_loc = PM_LOCATION_TOKEN_VALUE(operator) }; @@ -6505,14 +5747,7 @@ pm_post_execution_node_create(pm_parser_t *parser, const pm_token_t *keyword, co pm_post_execution_node_t *node = PM_NODE_ALLOC(parser, pm_post_execution_node_t); *node = (pm_post_execution_node_t) { - { - .type = PM_POST_EXECUTION_NODE, - .node_id = PM_NODE_IDENTIFY(parser), - .location = { - .start = keyword->start, - .end = closing->end - } - }, + .base = PM_NODE_INIT(parser, PM_POST_EXECUTION_NODE, 0, keyword->start, closing->end), .statements = statements, .keyword_loc = PM_LOCATION_TOKEN_VALUE(keyword), .opening_loc = PM_LOCATION_TOKEN_VALUE(opening), @@ -6530,14 +5765,7 @@ pm_pre_execution_node_create(pm_parser_t *parser, const pm_token_t *keyword, con pm_pre_execution_node_t *node = PM_NODE_ALLOC(parser, pm_pre_execution_node_t); *node = (pm_pre_execution_node_t) { - { - .type = PM_PRE_EXECUTION_NODE, - .node_id = PM_NODE_IDENTIFY(parser), - .location = { - .start = keyword->start, - .end = closing->end - } - }, + .base = PM_NODE_INIT(parser, PM_PRE_EXECUTION_NODE, 0, keyword->start, closing->end), .statements = statements, .keyword_loc = PM_LOCATION_TOKEN_VALUE(keyword), .opening_loc = PM_LOCATION_TOKEN_VALUE(opening), @@ -6574,15 +5802,7 @@ pm_range_node_create(pm_parser_t *parser, pm_node_t *left, const pm_token_t *ope } *node = (pm_range_node_t) { - { - .type = PM_RANGE_NODE, - .flags = flags, - .node_id = PM_NODE_IDENTIFY(parser), - .location = { - .start = (left == NULL ? operator->start : left->location.start), - .end = (right == NULL ? operator->end : right->location.end) - } - }, + .base = PM_NODE_INIT(parser, PM_RANGE_NODE, flags, (left == NULL ? operator->start : left->location.start), (right == NULL ? operator->end : right->location.end)), .left = left, .right = right, .operator_loc = PM_LOCATION_TOKEN_VALUE(operator) @@ -6599,11 +5819,9 @@ pm_redo_node_create(pm_parser_t *parser, const pm_token_t *token) { assert(token->type == PM_TOKEN_KEYWORD_REDO); pm_redo_node_t *node = PM_NODE_ALLOC(parser, pm_redo_node_t); - *node = (pm_redo_node_t) {{ - .type = PM_REDO_NODE, - .node_id = PM_NODE_IDENTIFY(parser), - .location = PM_LOCATION_TOKEN_VALUE(token) - }}; + *node = (pm_redo_node_t) { + .base = PM_NODE_INIT(parser, PM_REDO_NODE, 0, token->start, token->end) + }; return node; } @@ -6615,17 +5833,10 @@ pm_redo_node_create(pm_parser_t *parser, const pm_token_t *token) { static pm_regular_expression_node_t * pm_regular_expression_node_create_unescaped(pm_parser_t *parser, const pm_token_t *opening, const pm_token_t *content, const pm_token_t *closing, const pm_string_t *unescaped) { pm_regular_expression_node_t *node = PM_NODE_ALLOC(parser, pm_regular_expression_node_t); + pm_node_flags_t flags = pm_regular_expression_flags_create(parser, closing) | PM_NODE_FLAG_STATIC_LITERAL; *node = (pm_regular_expression_node_t) { - { - .type = PM_REGULAR_EXPRESSION_NODE, - .flags = pm_regular_expression_flags_create(parser, closing) | PM_NODE_FLAG_STATIC_LITERAL, - .node_id = PM_NODE_IDENTIFY(parser), - .location = { - .start = MIN(opening->start, closing->start), - .end = MAX(opening->end, closing->end) - } - }, + .base = PM_NODE_INIT(parser, PM_REGULAR_EXPRESSION_NODE, flags, MIN(opening->start, closing->start), MAX(opening->end, closing->end)), .opening_loc = PM_LOCATION_TOKEN_VALUE(opening), .content_loc = PM_LOCATION_TOKEN_VALUE(content), .closing_loc = PM_LOCATION_TOKEN_VALUE(closing), @@ -6651,11 +5862,7 @@ pm_required_parameter_node_create(pm_parser_t *parser, const pm_token_t *token) pm_required_parameter_node_t *node = PM_NODE_ALLOC(parser, pm_required_parameter_node_t); *node = (pm_required_parameter_node_t) { - { - .type = PM_REQUIRED_PARAMETER_NODE, - .node_id = PM_NODE_IDENTIFY(parser), - .location = PM_LOCATION_TOKEN_VALUE(token) - }, + .base = PM_NODE_INIT(parser, PM_REQUIRED_PARAMETER_NODE, 0, token->start, token->end), .name = pm_parser_constant_id_token(parser, token) }; @@ -6670,14 +5877,7 @@ pm_rescue_modifier_node_create(pm_parser_t *parser, pm_node_t *expression, const pm_rescue_modifier_node_t *node = PM_NODE_ALLOC(parser, pm_rescue_modifier_node_t); *node = (pm_rescue_modifier_node_t) { - { - .type = PM_RESCUE_MODIFIER_NODE, - .node_id = PM_NODE_IDENTIFY(parser), - .location = { - .start = expression->location.start, - .end = rescue_expression->location.end - } - }, + .base = PM_NODE_INIT(parser, PM_RESCUE_MODIFIER_NODE, 0, expression->location.start, rescue_expression->location.end), .expression = expression, .keyword_loc = PM_LOCATION_TOKEN_VALUE(keyword), .rescue_expression = rescue_expression @@ -6694,11 +5894,7 @@ pm_rescue_node_create(pm_parser_t *parser, const pm_token_t *keyword) { pm_rescue_node_t *node = PM_NODE_ALLOC(parser, pm_rescue_node_t); *node = (pm_rescue_node_t) { - { - .type = PM_RESCUE_NODE, - .node_id = PM_NODE_IDENTIFY(parser), - .location = PM_LOCATION_TOKEN_VALUE(keyword) - }, + .base = PM_NODE_INIT(parser, PM_RESCUE_NODE, 0, keyword->start, keyword->end), .keyword_loc = PM_LOCATION_TOKEN_VALUE(keyword), .operator_loc = PM_OPTIONAL_LOCATION_NOT_PROVIDED_VALUE, .then_keyword_loc = PM_OPTIONAL_LOCATION_NOT_PROVIDED_VALUE, @@ -6762,14 +5958,7 @@ pm_rest_parameter_node_create(pm_parser_t *parser, const pm_token_t *operator, c pm_rest_parameter_node_t *node = PM_NODE_ALLOC(parser, pm_rest_parameter_node_t); *node = (pm_rest_parameter_node_t) { - { - .type = PM_REST_PARAMETER_NODE, - .node_id = PM_NODE_IDENTIFY(parser), - .location = { - .start = operator->start, - .end = (name->type == PM_TOKEN_NOT_PROVIDED ? operator->end : name->end) - } - }, + .base = PM_NODE_INIT(parser, PM_REST_PARAMETER_NODE, 0, operator->start, (name->type == PM_TOKEN_NOT_PROVIDED ? operator->end : name->end)), .name = pm_parser_optional_constant_id_token(parser, name), .name_loc = PM_OPTIONAL_LOCATION_TOKEN_VALUE(name), .operator_loc = PM_LOCATION_TOKEN_VALUE(operator) @@ -6786,11 +5975,9 @@ pm_retry_node_create(pm_parser_t *parser, const pm_token_t *token) { assert(token->type == PM_TOKEN_KEYWORD_RETRY); pm_retry_node_t *node = PM_NODE_ALLOC(parser, pm_retry_node_t); - *node = (pm_retry_node_t) {{ - .type = PM_RETRY_NODE, - .node_id = PM_NODE_IDENTIFY(parser), - .location = PM_LOCATION_TOKEN_VALUE(token) - }}; + *node = (pm_retry_node_t) { + .base = PM_NODE_INIT(parser, PM_RETRY_NODE, 0, token->start, token->end) + }; return node; } @@ -6803,14 +5990,7 @@ pm_return_node_create(pm_parser_t *parser, const pm_token_t *keyword, pm_argumen pm_return_node_t *node = PM_NODE_ALLOC(parser, pm_return_node_t); *node = (pm_return_node_t) { - { - .type = PM_RETURN_NODE, - .node_id = PM_NODE_IDENTIFY(parser), - .location = { - .start = keyword->start, - .end = (arguments == NULL ? keyword->end : arguments->base.location.end) - } - }, + .base = PM_NODE_INIT(parser, PM_RETURN_NODE, 0, keyword->start, (arguments == NULL ? keyword->end : arguments->base.location.end)), .keyword_loc = PM_LOCATION_TOKEN_VALUE(keyword), .arguments = arguments }; @@ -6826,11 +6006,9 @@ pm_self_node_create(pm_parser_t *parser, const pm_token_t *token) { assert(token->type == PM_TOKEN_KEYWORD_SELF); pm_self_node_t *node = PM_NODE_ALLOC(parser, pm_self_node_t); - *node = (pm_self_node_t) {{ - .type = PM_SELF_NODE, - .node_id = PM_NODE_IDENTIFY(parser), - .location = PM_LOCATION_TOKEN_VALUE(token) - }}; + *node = (pm_self_node_t) { + .base = PM_NODE_INIT(parser, PM_SELF_NODE, 0, token->start, token->end) + }; return node; } @@ -6843,12 +6021,7 @@ pm_shareable_constant_node_create(pm_parser_t *parser, pm_node_t *write, pm_shar pm_shareable_constant_node_t *node = PM_NODE_ALLOC(parser, pm_shareable_constant_node_t); *node = (pm_shareable_constant_node_t) { - { - .type = PM_SHAREABLE_CONSTANT_NODE, - .flags = (pm_node_flags_t) value, - .node_id = PM_NODE_IDENTIFY(parser), - .location = PM_LOCATION_NODE_VALUE(write) - }, + .base = PM_NODE_INIT(parser, PM_SHAREABLE_CONSTANT_NODE, (pm_node_flags_t) value, write->location.start, write->location.end), .write = write }; @@ -6863,14 +6036,7 @@ pm_singleton_class_node_create(pm_parser_t *parser, pm_constant_id_list_t *local pm_singleton_class_node_t *node = PM_NODE_ALLOC(parser, pm_singleton_class_node_t); *node = (pm_singleton_class_node_t) { - { - .type = PM_SINGLETON_CLASS_NODE, - .node_id = PM_NODE_IDENTIFY(parser), - .location = { - .start = class_keyword->start, - .end = end_keyword->end - } - }, + .base = PM_NODE_INIT(parser, PM_SINGLETON_CLASS_NODE, 0, class_keyword->start, end_keyword->end), .locals = *locals, .class_keyword_loc = PM_LOCATION_TOKEN_VALUE(class_keyword), .operator_loc = PM_LOCATION_TOKEN_VALUE(operator), @@ -6890,12 +6056,9 @@ pm_source_encoding_node_create(pm_parser_t *parser, const pm_token_t *token) { assert(token->type == PM_TOKEN_KEYWORD___ENCODING__); pm_source_encoding_node_t *node = PM_NODE_ALLOC(parser, pm_source_encoding_node_t); - *node = (pm_source_encoding_node_t) {{ - .type = PM_SOURCE_ENCODING_NODE, - .flags = PM_NODE_FLAG_STATIC_LITERAL, - .node_id = PM_NODE_IDENTIFY(parser), - .location = PM_LOCATION_TOKEN_VALUE(token) - }}; + *node = (pm_source_encoding_node_t) { + .base = PM_NODE_INIT(parser, PM_SOURCE_ENCODING_NODE, PM_NODE_FLAG_STATIC_LITERAL, token->start, token->end) + }; return node; } @@ -6920,12 +6083,7 @@ pm_source_file_node_create(pm_parser_t *parser, const pm_token_t *file_keyword) } *node = (pm_source_file_node_t) { - { - .type = PM_SOURCE_FILE_NODE, - .flags = flags, - .node_id = PM_NODE_IDENTIFY(parser), - .location = PM_LOCATION_TOKEN_VALUE(file_keyword), - }, + .base = PM_NODE_INIT(parser, PM_SOURCE_FILE_NODE, flags, file_keyword->start, file_keyword->end), .filepath = parser->filepath }; @@ -6940,12 +6098,9 @@ pm_source_line_node_create(pm_parser_t *parser, const pm_token_t *token) { assert(token->type == PM_TOKEN_KEYWORD___LINE__); pm_source_line_node_t *node = PM_NODE_ALLOC(parser, pm_source_line_node_t); - *node = (pm_source_line_node_t) {{ - .type = PM_SOURCE_LINE_NODE, - .flags = PM_NODE_FLAG_STATIC_LITERAL, - .node_id = PM_NODE_IDENTIFY(parser), - .location = PM_LOCATION_TOKEN_VALUE(token) - }}; + *node = (pm_source_line_node_t) { + .base = PM_NODE_INIT(parser, PM_SOURCE_LINE_NODE, PM_NODE_FLAG_STATIC_LITERAL, token->start, token->end) + }; return node; } @@ -6958,14 +6113,7 @@ pm_splat_node_create(pm_parser_t *parser, const pm_token_t *operator, pm_node_t pm_splat_node_t *node = PM_NODE_ALLOC(parser, pm_splat_node_t); *node = (pm_splat_node_t) { - { - .type = PM_SPLAT_NODE, - .node_id = PM_NODE_IDENTIFY(parser), - .location = { - .start = operator->start, - .end = (expression == NULL ? operator->end : expression->location.end) - } - }, + .base = PM_NODE_INIT(parser, PM_SPLAT_NODE, 0, operator->start, (expression == NULL ? operator->end : expression->location.end)), .operator_loc = PM_LOCATION_TOKEN_VALUE(operator), .expression = expression }; @@ -6981,11 +6129,7 @@ pm_statements_node_create(pm_parser_t *parser) { pm_statements_node_t *node = PM_NODE_ALLOC(parser, pm_statements_node_t); *node = (pm_statements_node_t) { - { - .type = PM_STATEMENTS_NODE, - .node_id = PM_NODE_IDENTIFY(parser), - .location = PM_LOCATION_NULL_VALUE(parser) - }, + .base = PM_NODE_INIT(parser, PM_STATEMENTS_NODE, 0, parser->start, parser->start), .body = { 0 } }; @@ -7077,16 +6221,11 @@ pm_string_node_create_unescaped(pm_parser_t *parser, const pm_token_t *opening, break; } + const uint8_t *start = (opening->type == PM_TOKEN_NOT_PROVIDED ? content->start : opening->start); + const uint8_t *end = (closing->type == PM_TOKEN_NOT_PROVIDED ? content->end : closing->end); + *node = (pm_string_node_t) { - { - .type = PM_STRING_NODE, - .flags = flags, - .node_id = PM_NODE_IDENTIFY(parser), - .location = { - .start = (opening->type == PM_TOKEN_NOT_PROVIDED ? content->start : opening->start), - .end = (closing->type == PM_TOKEN_NOT_PROVIDED ? content->end : closing->end) - } - }, + .base = PM_NODE_INIT(parser, PM_STRING_NODE, flags, start, end), .opening_loc = PM_OPTIONAL_LOCATION_TOKEN_VALUE(opening), .content_loc = PM_LOCATION_TOKEN_VALUE(content), .closing_loc = PM_OPTIONAL_LOCATION_TOKEN_VALUE(closing), @@ -7129,14 +6268,7 @@ pm_super_node_create(pm_parser_t *parser, const pm_token_t *keyword, pm_argument } *node = (pm_super_node_t) { - { - .type = PM_SUPER_NODE, - .node_id = PM_NODE_IDENTIFY(parser), - .location = { - .start = keyword->start, - .end = end, - } - }, + .base = PM_NODE_INIT(parser, PM_SUPER_NODE, 0, keyword->start, end), .keyword_loc = PM_LOCATION_TOKEN_VALUE(keyword), .lparen_loc = arguments->opening_loc, .arguments = arguments->arguments, @@ -7365,16 +6497,11 @@ static pm_symbol_node_t * pm_symbol_node_create_unescaped(pm_parser_t *parser, const pm_token_t *opening, const pm_token_t *value, const pm_token_t *closing, const pm_string_t *unescaped, pm_node_flags_t flags) { pm_symbol_node_t *node = PM_NODE_ALLOC(parser, pm_symbol_node_t); + const uint8_t *start = (opening->type == PM_TOKEN_NOT_PROVIDED ? value->start : opening->start); + const uint8_t *end = (closing->type == PM_TOKEN_NOT_PROVIDED ? value->end : closing->end); + *node = (pm_symbol_node_t) { - { - .type = PM_SYMBOL_NODE, - .flags = PM_NODE_FLAG_STATIC_LITERAL | flags, - .node_id = PM_NODE_IDENTIFY(parser), - .location = { - .start = (opening->type == PM_TOKEN_NOT_PROVIDED ? value->start : opening->start), - .end = (closing->type == PM_TOKEN_NOT_PROVIDED ? value->end : closing->end) - } - }, + .base = PM_NODE_INIT(parser, PM_SYMBOL_NODE, PM_NODE_FLAG_STATIC_LITERAL | flags, start, end), .opening_loc = PM_OPTIONAL_LOCATION_TOKEN_VALUE(opening), .value_loc = PM_LOCATION_TOKEN_VALUE(value), .closing_loc = PM_OPTIONAL_LOCATION_TOKEN_VALUE(closing), @@ -7448,12 +6575,7 @@ pm_symbol_node_synthesized_create(pm_parser_t *parser, const char *content) { pm_symbol_node_t *node = PM_NODE_ALLOC(parser, pm_symbol_node_t); *node = (pm_symbol_node_t) { - { - .type = PM_SYMBOL_NODE, - .flags = PM_NODE_FLAG_STATIC_LITERAL | PM_SYMBOL_FLAGS_FORCED_US_ASCII_ENCODING, - .node_id = PM_NODE_IDENTIFY(parser), - .location = PM_LOCATION_NULL_VALUE(parser) - }, + .base = PM_NODE_INIT(parser, PM_SYMBOL_NODE, PM_NODE_FLAG_STATIC_LITERAL | PM_SYMBOL_FLAGS_FORCED_US_ASCII_ENCODING, parser->start, parser->start), .value_loc = PM_LOCATION_NULL_VALUE(parser), .unescaped = { 0 } }; @@ -7491,15 +6613,7 @@ pm_string_node_to_symbol_node(pm_parser_t *parser, pm_string_node_t *node, const pm_symbol_node_t *new_node = PM_NODE_ALLOC(parser, pm_symbol_node_t); *new_node = (pm_symbol_node_t) { - { - .type = PM_SYMBOL_NODE, - .flags = PM_NODE_FLAG_STATIC_LITERAL, - .node_id = PM_NODE_IDENTIFY(parser), - .location = { - .start = opening->start, - .end = closing->end - } - }, + .base = PM_NODE_INIT(parser, PM_SYMBOL_NODE, PM_NODE_FLAG_STATIC_LITERAL, opening->start, closing->end), .opening_loc = PM_OPTIONAL_LOCATION_TOKEN_VALUE(opening), .value_loc = node->content_loc, .closing_loc = PM_OPTIONAL_LOCATION_TOKEN_VALUE(closing), @@ -7535,12 +6649,7 @@ pm_symbol_node_to_string_node(pm_parser_t *parser, pm_symbol_node_t *node) { } *new_node = (pm_string_node_t) { - { - .type = PM_STRING_NODE, - .flags = flags, - .node_id = PM_NODE_IDENTIFY(parser), - .location = node->base.location - }, + .base = PM_NODE_INIT(parser, PM_STRING_NODE, flags, node->base.location.start, node->base.location.end), .opening_loc = node->opening_loc, .content_loc = node->value_loc, .closing_loc = node->closing_loc, @@ -7563,12 +6672,9 @@ pm_true_node_create(pm_parser_t *parser, const pm_token_t *token) { assert(token->type == PM_TOKEN_KEYWORD_TRUE); pm_true_node_t *node = PM_NODE_ALLOC(parser, pm_true_node_t); - *node = (pm_true_node_t) {{ - .type = PM_TRUE_NODE, - .flags = PM_NODE_FLAG_STATIC_LITERAL, - .node_id = PM_NODE_IDENTIFY(parser), - .location = PM_LOCATION_TOKEN_VALUE(token) - }}; + *node = (pm_true_node_t) { + .base = PM_NODE_INIT(parser, PM_TRUE_NODE, PM_NODE_FLAG_STATIC_LITERAL, token->start, token->end) + }; return node; } @@ -7580,12 +6686,9 @@ static pm_true_node_t * pm_true_node_synthesized_create(pm_parser_t *parser) { pm_true_node_t *node = PM_NODE_ALLOC(parser, pm_true_node_t); - *node = (pm_true_node_t) {{ - .type = PM_TRUE_NODE, - .flags = PM_NODE_FLAG_STATIC_LITERAL, - .node_id = PM_NODE_IDENTIFY(parser), - .location = { .start = parser->start, .end = parser->end } - }}; + *node = (pm_true_node_t) { + .base = PM_NODE_INIT(parser, PM_TRUE_NODE, PM_NODE_FLAG_STATIC_LITERAL, parser->start, parser->end) + }; return node; } @@ -7599,11 +6702,7 @@ pm_undef_node_create(pm_parser_t *parser, const pm_token_t *token) { pm_undef_node_t *node = PM_NODE_ALLOC(parser, pm_undef_node_t); *node = (pm_undef_node_t) { - { - .type = PM_UNDEF_NODE, - .node_id = PM_NODE_IDENTIFY(parser), - .location = PM_LOCATION_TOKEN_VALUE(token), - }, + .base = PM_NODE_INIT(parser, PM_UNDEF_NODE, 0, token->start, token->end), .keyword_loc = PM_LOCATION_TOKEN_VALUE(token), .names = { 0 } }; @@ -7636,15 +6735,7 @@ pm_unless_node_create(pm_parser_t *parser, const pm_token_t *keyword, pm_node_t } *node = (pm_unless_node_t) { - { - .type = PM_UNLESS_NODE, - .flags = PM_NODE_FLAG_NEWLINE, - .node_id = PM_NODE_IDENTIFY(parser), - .location = { - .start = keyword->start, - .end = end - }, - }, + .base = PM_NODE_INIT(parser, PM_UNLESS_NODE, PM_NODE_FLAG_NEWLINE, keyword->start, end), .keyword_loc = PM_LOCATION_TOKEN_VALUE(keyword), .predicate = predicate, .then_keyword_loc = PM_OPTIONAL_LOCATION_TOKEN_VALUE(then_keyword), @@ -7668,15 +6759,7 @@ pm_unless_node_modifier_create(pm_parser_t *parser, pm_node_t *statement, const pm_statements_node_body_append(parser, statements, statement, true); *node = (pm_unless_node_t) { - { - .type = PM_UNLESS_NODE, - .flags = PM_NODE_FLAG_NEWLINE, - .node_id = PM_NODE_IDENTIFY(parser), - .location = { - .start = statement->location.start, - .end = predicate->location.end - }, - }, + .base = PM_NODE_INIT(parser, PM_UNLESS_NODE, PM_NODE_FLAG_NEWLINE, statement->location.start, predicate->location.end), .keyword_loc = PM_LOCATION_TOKEN_VALUE(unless_keyword), .predicate = predicate, .then_keyword_loc = PM_OPTIONAL_LOCATION_NOT_PROVIDED_VALUE, @@ -7726,15 +6809,7 @@ pm_until_node_create(pm_parser_t *parser, const pm_token_t *keyword, const pm_to pm_conditional_predicate(parser, predicate, PM_CONDITIONAL_PREDICATE_TYPE_CONDITIONAL); *node = (pm_until_node_t) { - { - .type = PM_UNTIL_NODE, - .flags = flags, - .node_id = PM_NODE_IDENTIFY(parser), - .location = { - .start = keyword->start, - .end = closing->end, - }, - }, + .base = PM_NODE_INIT(parser, PM_UNTIL_NODE, flags, keyword->start, closing->end), .keyword_loc = PM_LOCATION_TOKEN_VALUE(keyword), .do_keyword_loc = PM_OPTIONAL_LOCATION_TOKEN_VALUE(do_keyword), .closing_loc = PM_OPTIONAL_LOCATION_TOKEN_VALUE(closing), @@ -7755,15 +6830,7 @@ pm_until_node_modifier_create(pm_parser_t *parser, const pm_token_t *keyword, pm pm_loop_modifier_block_exits(parser, statements); *node = (pm_until_node_t) { - { - .type = PM_UNTIL_NODE, - .flags = flags, - .node_id = PM_NODE_IDENTIFY(parser), - .location = { - .start = statements->base.location.start, - .end = predicate->location.end, - }, - }, + .base = PM_NODE_INIT(parser, PM_UNTIL_NODE, flags, statements->base.location.start, predicate->location.end), .keyword_loc = PM_LOCATION_TOKEN_VALUE(keyword), .do_keyword_loc = PM_OPTIONAL_LOCATION_NOT_PROVIDED_VALUE, .closing_loc = PM_OPTIONAL_LOCATION_NOT_PROVIDED_VALUE, @@ -7782,14 +6849,7 @@ pm_when_node_create(pm_parser_t *parser, const pm_token_t *keyword) { pm_when_node_t *node = PM_NODE_ALLOC(parser, pm_when_node_t); *node = (pm_when_node_t) { - { - .type = PM_WHEN_NODE, - .node_id = PM_NODE_IDENTIFY(parser), - .location = { - .start = keyword->start, - .end = NULL - } - }, + .base = PM_NODE_INIT(parser, PM_WHEN_NODE, 0, keyword->start, NULL), .keyword_loc = PM_LOCATION_TOKEN_VALUE(keyword), .statements = NULL, .then_keyword_loc = PM_OPTIONAL_LOCATION_NOT_PROVIDED_VALUE, @@ -7838,15 +6898,7 @@ pm_while_node_create(pm_parser_t *parser, const pm_token_t *keyword, const pm_to pm_conditional_predicate(parser, predicate, PM_CONDITIONAL_PREDICATE_TYPE_CONDITIONAL); *node = (pm_while_node_t) { - { - .type = PM_WHILE_NODE, - .flags = flags, - .node_id = PM_NODE_IDENTIFY(parser), - .location = { - .start = keyword->start, - .end = closing->end - }, - }, + .base = PM_NODE_INIT(parser, PM_WHILE_NODE, flags, keyword->start, closing->end), .keyword_loc = PM_LOCATION_TOKEN_VALUE(keyword), .do_keyword_loc = PM_OPTIONAL_LOCATION_TOKEN_VALUE(do_keyword), .closing_loc = PM_OPTIONAL_LOCATION_TOKEN_VALUE(closing), @@ -7867,15 +6919,7 @@ pm_while_node_modifier_create(pm_parser_t *parser, const pm_token_t *keyword, pm pm_loop_modifier_block_exits(parser, statements); *node = (pm_while_node_t) { - { - .type = PM_WHILE_NODE, - .flags = flags, - .node_id = PM_NODE_IDENTIFY(parser), - .location = { - .start = statements->base.location.start, - .end = predicate->location.end - }, - }, + .base = PM_NODE_INIT(parser, PM_WHILE_NODE, flags, statements->base.location.start, predicate->location.end), .keyword_loc = PM_LOCATION_TOKEN_VALUE(keyword), .do_keyword_loc = PM_OPTIONAL_LOCATION_NOT_PROVIDED_VALUE, .closing_loc = PM_OPTIONAL_LOCATION_NOT_PROVIDED_VALUE, @@ -7894,11 +6938,7 @@ pm_while_node_synthesized_create(pm_parser_t *parser, pm_node_t *predicate, pm_s pm_while_node_t *node = PM_NODE_ALLOC(parser, pm_while_node_t); *node = (pm_while_node_t) { - { - .type = PM_WHILE_NODE, - .node_id = PM_NODE_IDENTIFY(parser), - .location = PM_LOCATION_NULL_VALUE(parser) - }, + .base = PM_NODE_INIT(parser, PM_WHILE_NODE, 0, parser->start, parser->start), .keyword_loc = PM_LOCATION_NULL_VALUE(parser), .do_keyword_loc = PM_LOCATION_NULL_VALUE(parser), .closing_loc = PM_LOCATION_NULL_VALUE(parser), @@ -7918,15 +6958,7 @@ pm_xstring_node_create_unescaped(pm_parser_t *parser, const pm_token_t *opening, pm_x_string_node_t *node = PM_NODE_ALLOC(parser, pm_x_string_node_t); *node = (pm_x_string_node_t) { - { - .type = PM_X_STRING_NODE, - .flags = PM_STRING_FLAGS_FROZEN, - .node_id = PM_NODE_IDENTIFY(parser), - .location = { - .start = opening->start, - .end = closing->end - }, - }, + .base = PM_NODE_INIT(parser, PM_X_STRING_NODE, PM_STRING_FLAGS_FROZEN, opening->start, closing->end), .opening_loc = PM_LOCATION_TOKEN_VALUE(opening), .content_loc = PM_LOCATION_TOKEN_VALUE(content), .closing_loc = PM_LOCATION_TOKEN_VALUE(closing), @@ -7963,14 +6995,7 @@ pm_yield_node_create(pm_parser_t *parser, const pm_token_t *keyword, const pm_lo } *node = (pm_yield_node_t) { - { - .type = PM_YIELD_NODE, - .node_id = PM_NODE_IDENTIFY(parser), - .location = { - .start = keyword->start, - .end = end - }, - }, + .base = PM_NODE_INIT(parser, PM_YIELD_NODE, 0, keyword->start, end), .keyword_loc = PM_LOCATION_TOKEN_VALUE(keyword), .lparen_loc = *lparen_loc, .arguments = arguments, @@ -7981,7 +7006,6 @@ pm_yield_node_create(pm_parser_t *parser, const pm_token_t *keyword, const pm_lo } #undef PM_NODE_ALLOC -#undef PM_NODE_IDENTIFY /** * Check if any of the currently visible scopes contain a local variable From 86406f63aadfaaaffcd0a00d336a2a94639d3c3e Mon Sep 17 00:00:00 2001 From: Earlopain <14981592+Earlopain@users.noreply.github.com> Date: Tue, 2 Dec 2025 10:54:10 +0100 Subject: [PATCH 242/333] Fix the ripper translator to parse as the current ruby Otherwise, it uses the latest prism version --- lib/prism/translation/ripper.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/prism/translation/ripper.rb b/lib/prism/translation/ripper.rb index 6ea98fc1ea..e488b7c5cf 100644 --- a/lib/prism/translation/ripper.rb +++ b/lib/prism/translation/ripper.rb @@ -71,7 +71,7 @@ def self.parse(src, filename = "(ripper)", lineno = 1) # [[1, 13], :on_kw, "end", END ]] # def self.lex(src, filename = "-", lineno = 1, raise_errors: false) - result = Prism.lex_compat(src, filepath: filename, line: lineno) + result = Prism.lex_compat(src, filepath: filename, line: lineno, version: "current") if result.failure? && raise_errors raise SyntaxError, result.errors.first.message @@ -3295,7 +3295,7 @@ def visit_yield_node(node) # Lazily initialize the parse result. def result - @result ||= Prism.parse(source, partial_script: true) + @result ||= Prism.parse(source, partial_script: true, version: "current") end ########################################################################## From e5a0221c37929f8c1972a1d93dca920119d7cadc Mon Sep 17 00:00:00 2001 From: Earlopain <14981592+Earlopain@users.noreply.github.com> Date: Tue, 2 Dec 2025 14:41:44 +0100 Subject: [PATCH 243/333] Clean up test excludes Mostly not having to list version-specific excludes when testing against ripper/parse.y Also don't test new syntax additions against the parser gems. The version support for them may (or may not) be expanded but we shouldn't bother while the ruby version hasn't even released yet. (ruby_parser translation is not versioned, so let as is for now) I also removed excludes that have since been implemented by parse.y --- test/prism/errors_test.rb | 2 +- test/prism/fixtures_test.rb | 16 +--------------- test/prism/lex_test.rb | 32 +++++++++----------------------- test/prism/locals_test.rb | 19 +++---------------- test/prism/ruby/parser_test.rb | 13 ++----------- test/prism/ruby/ripper_test.rb | 32 +++++++++++--------------------- test/prism/snapshots_test.rb | 2 +- test/prism/snippets_test.rb | 2 +- test/prism/test_helper.rb | 22 ++++++++++++++++------ 9 files changed, 45 insertions(+), 95 deletions(-) diff --git a/test/prism/errors_test.rb b/test/prism/errors_test.rb index bd7a8a6381..706b739557 100644 --- a/test/prism/errors_test.rb +++ b/test/prism/errors_test.rb @@ -88,7 +88,7 @@ def assert_errors(filepath, version) expected = File.read(filepath, binmode: true, external_encoding: Encoding::UTF_8) source = expected.lines.grep_v(/^\s*\^/).join.gsub(/\n*\z/, "") - refute_valid_syntax(source) if current_major_minor == version + refute_valid_syntax(source) if CURRENT_MAJOR_MINOR == version result = Prism.parse(source, version: version) errors = result.errors diff --git a/test/prism/fixtures_test.rb b/test/prism/fixtures_test.rb index 2aebb18477..7df97029d3 100644 --- a/test/prism/fixtures_test.rb +++ b/test/prism/fixtures_test.rb @@ -24,23 +24,9 @@ class FixturesTest < TestCase except << "whitequark/ruby_bug_19281.txt" end - if RUBY_VERSION < "3.4.0" - except << "3.4/circular_parameters.txt" - end - - # Valid only on Ruby 3.3 - except << "3.3-3.3/block_args_in_array_assignment.txt" - except << "3.3-3.3/it_with_ordinary_parameter.txt" - except << "3.3-3.3/keyword_args_in_array_assignment.txt" - except << "3.3-3.3/return_in_sclass.txt" - - # Leaving these out until they are supported by parse.y. - except << "4.0/leading_logical.txt" - except << "4.0/endless_methods_command_call.txt" - # https://bugs.ruby-lang.org/issues/21168#note-5 except << "command_method_call_2.txt" - Fixture.each(except: except) do |fixture| + Fixture.each_for_current_ruby(except: except) do |fixture| define_method(fixture.test_name) { assert_valid_syntax(fixture.read) } end end diff --git a/test/prism/lex_test.rb b/test/prism/lex_test.rb index 19dd845d75..68e47a0964 100644 --- a/test/prism/lex_test.rb +++ b/test/prism/lex_test.rb @@ -7,19 +7,13 @@ module Prism class LexTest < TestCase except = [ - # It seems like there are some oddities with nested heredocs and ripper. - # Waiting for feedback on https://bugs.ruby-lang.org/issues/19838. - "seattlerb/heredoc_nested.txt", - "whitequark/dedenting_heredoc.txt", - # Ripper seems to have a bug that the regex portions before and after - # the heredoc are combined into a single token. See - # https://bugs.ruby-lang.org/issues/19838. + # https://bugs.ruby-lang.org/issues/21756 "spanning_heredoc.txt", - "spanning_heredoc_newlines.txt", - # Prism emits a single :on_tstring_content in <<- style heredocs when there - # is a line continuation preceded by escaped backslashes. It should emit two, same - # as if the backslashes are not present. + # Prism emits a single string in some cases when ripper splits them up + "whitequark/dedenting_heredoc.txt", "heredocs_with_fake_newlines.txt", + # Prism emits BEG for `on_regexp_end` + "spanning_heredoc_newlines.txt", ] if RUBY_VERSION < "3.3.0" @@ -42,17 +36,11 @@ class LexTest < TestCase except << "whitequark/ruby_bug_19281.txt" end - # https://bugs.ruby-lang.org/issues/20925 - except << "4.0/leading_logical.txt" - - # https://bugs.ruby-lang.org/issues/17398#note-12 - except << "4.0/endless_methods_command_call.txt" - # https://bugs.ruby-lang.org/issues/21168#note-5 except << "command_method_call_2.txt" - Fixture.each_with_version(except: except) do |fixture, version| - define_method(fixture.test_name(version)) { assert_lex(fixture, version) } + Fixture.each_for_current_ruby(except: except) do |fixture| + define_method(fixture.test_name) { assert_lex(fixture) } end def test_lex_file @@ -97,12 +85,10 @@ def test_parse_lex_file private - def assert_lex(fixture, version) - return unless current_major_minor == version - + def assert_lex(fixture) source = fixture.read - result = Prism.lex_compat(source, version: version) + result = Prism.lex_compat(source, version: "current") assert_equal [], result.errors Prism.lex_ripper(source).zip(result.value).each do |(ripper, prism)| diff --git a/test/prism/locals_test.rb b/test/prism/locals_test.rb index 814c9a9978..4f8d6080e8 100644 --- a/test/prism/locals_test.rb +++ b/test/prism/locals_test.rb @@ -13,11 +13,6 @@ # in comparing the locals because they will be the same. return if RubyVM::InstructionSequence.compile("").to_a[4][:parser] == :prism -# In Ruby 3.4.0, the local table for method forwarding changed. But 3.4.0 can -# refer to the dev version, so while 3.4.0 still isn't released, we need to -# check if we have a high enough revision. -return if RubyVM::InstructionSequence.compile("def foo(...); end").to_a[13][2][2][10].length != 1 - # Omit tests if running on a 32-bit machine because there is a bug with how # Ruby is handling large ISeqs on 32-bit machines return if RUBY_PLATFORM =~ /i686/ @@ -31,19 +26,11 @@ class LocalsTest < TestCase # CRuby is eliminating dead code. "whitequark/ruby_bug_10653.txt", - # Valid only on Ruby 3.3 - "3.3-3.3/block_args_in_array_assignment.txt", - "3.3-3.3/it_with_ordinary_parameter.txt", - "3.3-3.3/keyword_args_in_array_assignment.txt", - "3.3-3.3/return_in_sclass.txt", - - # Leaving these out until they are supported by parse.y. - "4.0/leading_logical.txt", - "4.0/endless_methods_command_call.txt", - "command_method_call_2.txt" + # https://bugs.ruby-lang.org/issues/21168#note-5 + "command_method_call_2.txt", ] - Fixture.each(except: except) do |fixture| + Fixture.each_for_current_ruby(except: except) do |fixture| define_method(fixture.test_name) { assert_locals(fixture) } end diff --git a/test/prism/ruby/parser_test.rb b/test/prism/ruby/parser_test.rb index 648c44e77a..c972f0962b 100644 --- a/test/prism/ruby/parser_test.rb +++ b/test/prism/ruby/parser_test.rb @@ -65,15 +65,6 @@ class ParserTest < TestCase # 1.. && 2 "ranges.txt", - # https://bugs.ruby-lang.org/issues/20478 - "3.4/circular_parameters.txt", - - # Cannot yet handling leading logical operators. - "4.0/leading_logical.txt", - - # Ruby >= 4.0 specific syntax - "4.0/endless_methods_command_call.txt", - # https://bugs.ruby-lang.org/issues/21168#note-5 "command_method_call_2.txt", ] @@ -148,7 +139,7 @@ class ParserTest < TestCase "whitequark/space_args_block.txt" ] - Fixture.each(except: skip_syntax_error) do |fixture| + Fixture.each_for_version(except: skip_syntax_error, version: "3.3") do |fixture| define_method(fixture.test_name) do assert_equal_parses( fixture, @@ -171,7 +162,7 @@ def test_non_prism_builder_class_deprecated if RUBY_VERSION >= "3.3" def test_current_parser_for_current_ruby - major, minor = current_major_minor.split(".") + major, minor = CURRENT_MAJOR_MINOR.split(".") # Let's just hope there never is a Ruby 3.10 or similar expected = major.to_i * 10 + minor.to_i assert_equal(expected, Translation::ParserCurrent.new.version) diff --git a/test/prism/ruby/ripper_test.rb b/test/prism/ruby/ripper_test.rb index 400139acc0..bd63302efc 100644 --- a/test/prism/ruby/ripper_test.rb +++ b/test/prism/ruby/ripper_test.rb @@ -8,44 +8,34 @@ module Prism class RipperTest < TestCase # Skip these tests that Ripper is reporting the wrong results for. incorrect = [ - # Not yet supported. - "4.0/leading_logical.txt", - # Ripper incorrectly attributes the block to the keyword. - "seattlerb/block_break.txt", - "seattlerb/block_next.txt", "seattlerb/block_return.txt", - "whitequark/break_block.txt", - "whitequark/next_block.txt", "whitequark/return_block.txt", - # Ripper is not accounting for locals created by patterns using the ** - # operator within an `in` clause. - "seattlerb/parse_pattern_058.txt", - # Ripper cannot handle named capture groups in regular expressions. "regex.txt", - "regex_char_width.txt", - "whitequark/lvar_injecting_match.txt", # Ripper fails to understand some structures that span across heredocs. "spanning_heredoc.txt", - "3.3-3.3/block_args_in_array_assignment.txt", - "3.3-3.3/it_with_ordinary_parameter.txt", - "3.3-3.3/keyword_args_in_array_assignment.txt", - "3.3-3.3/return_in_sclass.txt", - - # https://bugs.ruby-lang.org/issues/20478 + # Ripper interprets circular keyword arguments as method calls. "3.4/circular_parameters.txt", - # https://bugs.ruby-lang.org/issues/17398#note-12 + # Ripper doesn't emit `args_add_block` when endless method is prefixed by modifier. "4.0/endless_methods_command_call.txt", # https://bugs.ruby-lang.org/issues/21168#note-5 "command_method_call_2.txt", ] + if RUBY_VERSION.start_with?("3.3.") + incorrect += [ + "whitequark/lvar_injecting_match.txt", + "seattlerb/parse_pattern_058.txt", + "regex_char_width.txt", + ] + end + # Skip these tests that we haven't implemented yet. omitted = [ "dos_endings.txt", @@ -68,7 +58,7 @@ class RipperTest < TestCase "whitequark/slash_newline_in_heredocs.txt" ] - Fixture.each(except: incorrect | omitted) do |fixture| + Fixture.each_for_current_ruby(except: incorrect | omitted) do |fixture| define_method(fixture.test_name) { assert_ripper(fixture.read) } end diff --git a/test/prism/snapshots_test.rb b/test/prism/snapshots_test.rb index 58627e3668..23e5c9c087 100644 --- a/test/prism/snapshots_test.rb +++ b/test/prism/snapshots_test.rb @@ -36,7 +36,7 @@ def teardown ) end - Fixture.each_with_version(except: except) do |fixture, version| + Fixture.each_with_all_versions(except: except) do |fixture, version| define_method(fixture.test_name(version)) { assert_snapshot(fixture, version) } end diff --git a/test/prism/snippets_test.rb b/test/prism/snippets_test.rb index 3160442cc0..3c28d27a25 100644 --- a/test/prism/snippets_test.rb +++ b/test/prism/snippets_test.rb @@ -18,7 +18,7 @@ class SnippetsTest < TestCase "whitequark/multiple_pattern_matches.txt" ] - Fixture.each_with_version(except: except) do |fixture, version| + Fixture.each_with_all_versions(except: except) do |fixture, version| define_method(fixture.test_name(version)) { assert_snippets(fixture, version) } end diff --git a/test/prism/test_helper.rb b/test/prism/test_helper.rb index 42555738cf..f78e68e87c 100644 --- a/test/prism/test_helper.rb +++ b/test/prism/test_helper.rb @@ -72,7 +72,18 @@ def self.each(except: [], &block) paths.each { |path| yield Fixture.new(path) } end - def self.each_with_version(except: [], &block) + def self.each_for_version(except: [], version:, &block) + each(except: except) do |fixture| + next unless TestCase.ruby_versions_for(fixture.path).include?(version) + yield fixture + end + end + + def self.each_for_current_ruby(except: [], &block) + each_for_version(except: except, version: CURRENT_MAJOR_MINOR, &block) + end + + def self.each_with_all_versions(except: [], &block) each(except: except) do |fixture| TestCase.ruby_versions_for(fixture.path).each do |version| yield fixture, version @@ -232,6 +243,9 @@ def self.windows? # All versions that prism can parse SYNTAX_VERSIONS = %w[3.3 3.4 4.0] + # `RUBY_VERSION` with the patch version excluded + CURRENT_MAJOR_MINOR = RUBY_VERSION.split(".")[0, 2].join(".") + # Returns an array of ruby versions that a given filepath should test against: # test.txt # => all available versions # 3.4/test.txt # => versions since 3.4 (inclusive) @@ -250,13 +264,9 @@ def self.ruby_versions_for(filepath) end end - def current_major_minor - RUBY_VERSION.split(".")[0, 2].join(".") - end - if RUBY_VERSION >= "3.3.0" def test_all_syntax_versions_present - assert_include(SYNTAX_VERSIONS, current_major_minor) + assert_include(SYNTAX_VERSIONS, CURRENT_MAJOR_MINOR) end end From 7eb169513a408c06ac4605a91e0db733fd0a756f Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Tue, 2 Dec 2025 14:28:36 -0500 Subject: [PATCH 244/333] Introduce PM_NODE_UPCAST macro for readability --- src/prism.c | 1024 +++++++++++++++-------------- templates/include/prism/ast.h.erb | 37 +- 2 files changed, 536 insertions(+), 525 deletions(-) diff --git a/src/prism.c b/src/prism.c index ac6fbd9f6b..044e61a1b1 100644 --- a/src/prism.c +++ b/src/prism.c @@ -18,6 +18,12 @@ pm_version(void) { #define MIN(a,b) (((a)<(b))?(a):(b)) #define MAX(a,b) (((a)>(b))?(a):(b)) +/******************************************************************************/ +/* Helpful node-related macros */ +/******************************************************************************/ + +#define UP PM_NODE_UPCAST + /******************************************************************************/ /* Lex mode manipulations */ /******************************************************************************/ @@ -1049,25 +1055,25 @@ pm_check_value_expression(pm_parser_t *parser, pm_node_t *node) { if (cast->ensure_clause != NULL) { if (cast->rescue_clause != NULL) { - pm_node_t *vn = pm_check_value_expression(parser, (pm_node_t *) cast->rescue_clause); + pm_node_t *vn = pm_check_value_expression(parser, UP(cast->rescue_clause)); if (vn != NULL) return vn; } if (cast->statements != NULL) { - pm_node_t *vn = pm_check_value_expression(parser, (pm_node_t *) cast->statements); + pm_node_t *vn = pm_check_value_expression(parser, UP(cast->statements)); if (vn != NULL) return vn; } - node = (pm_node_t *) cast->ensure_clause; + node = UP(cast->ensure_clause); } else if (cast->rescue_clause != NULL) { if (cast->statements == NULL) return NULL; - pm_node_t *vn = pm_check_value_expression(parser, (pm_node_t *) cast->statements); + pm_node_t *vn = pm_check_value_expression(parser, UP(cast->statements)); if (vn == NULL) return NULL; if (void_node == NULL) void_node = vn; for (pm_rescue_node_t *rescue_clause = cast->rescue_clause; rescue_clause != NULL; rescue_clause = rescue_clause->subsequent) { - pm_node_t *vn = pm_check_value_expression(parser, (pm_node_t *) rescue_clause->statements); + pm_node_t *vn = pm_check_value_expression(parser, UP(rescue_clause->statements)); if (vn == NULL) { void_node = NULL; break; @@ -1078,24 +1084,24 @@ pm_check_value_expression(pm_parser_t *parser, pm_node_t *node) { } if (cast->else_clause != NULL) { - node = (pm_node_t *) cast->else_clause; + node = UP(cast->else_clause); } else { return void_node; } } else { - node = (pm_node_t *) cast->statements; + node = UP(cast->statements); } break; } case PM_ENSURE_NODE: { pm_ensure_node_t *cast = (pm_ensure_node_t *) node; - node = (pm_node_t *) cast->statements; + node = UP(cast->statements); break; } case PM_PARENTHESES_NODE: { pm_parentheses_node_t *cast = (pm_parentheses_node_t *) node; - node = (pm_node_t *) cast->body; + node = UP(cast->body); break; } case PM_STATEMENTS_NODE: { @@ -1108,7 +1114,7 @@ pm_check_value_expression(pm_parser_t *parser, pm_node_t *node) { if (cast->statements == NULL || cast->subsequent == NULL) { return NULL; } - pm_node_t *vn = pm_check_value_expression(parser, (pm_node_t *) cast->statements); + pm_node_t *vn = pm_check_value_expression(parser, UP(cast->statements)); if (vn == NULL) { return NULL; } @@ -1123,19 +1129,19 @@ pm_check_value_expression(pm_parser_t *parser, pm_node_t *node) { if (cast->statements == NULL || cast->else_clause == NULL) { return NULL; } - pm_node_t *vn = pm_check_value_expression(parser, (pm_node_t *) cast->statements); + pm_node_t *vn = pm_check_value_expression(parser, UP(cast->statements)); if (vn == NULL) { return NULL; } if (void_node == NULL) { void_node = vn; } - node = (pm_node_t *) cast->else_clause; + node = UP(cast->else_clause); break; } case PM_ELSE_NODE: { pm_else_node_t *cast = (pm_else_node_t *) node; - node = (pm_node_t *) cast->statements; + node = UP(cast->statements); break; } case PM_AND_NODE: { @@ -1635,7 +1641,7 @@ pm_arguments_validate_block(pm_parser_t *parser, pm_arguments_t *arguments, pm_b // If we didn't hit a case before this check, then at this point we need to // add a syntax error. - pm_parser_err_node(parser, (pm_node_t *) block, PM_ERR_ARGUMENT_UNEXPECTED_BLOCK); + pm_parser_err_node(parser, UP(block), PM_ERR_ARGUMENT_UNEXPECTED_BLOCK); } /******************************************************************************/ @@ -2059,9 +2065,9 @@ pm_arguments_node_arguments_append(pm_arguments_node_t *node, pm_node_t *argumen if (PM_NODE_TYPE_P(argument, PM_SPLAT_NODE)) { if (PM_NODE_FLAG_P(node, PM_ARGUMENTS_NODE_FLAGS_CONTAINS_SPLAT)) { - pm_node_flag_set((pm_node_t *) node, PM_ARGUMENTS_NODE_FLAGS_CONTAINS_MULTIPLE_SPLATS); + pm_node_flag_set(UP(node), PM_ARGUMENTS_NODE_FLAGS_CONTAINS_MULTIPLE_SPLATS); } else { - pm_node_flag_set((pm_node_t *) node, PM_ARGUMENTS_NODE_FLAGS_CONTAINS_SPLAT); + pm_node_flag_set(UP(node), PM_ARGUMENTS_NODE_FLAGS_CONTAINS_SPLAT); } } } @@ -2098,11 +2104,11 @@ pm_array_node_elements_append(pm_array_node_t *node, pm_node_t *element) { // If the element is not a static literal, then the array is not a static // literal. Turn that flag off. if (PM_NODE_TYPE_P(element, PM_ARRAY_NODE) || PM_NODE_TYPE_P(element, PM_HASH_NODE) || PM_NODE_TYPE_P(element, PM_RANGE_NODE) || !PM_NODE_FLAG_P(element, PM_NODE_FLAG_STATIC_LITERAL)) { - pm_node_flag_unset((pm_node_t *)node, PM_NODE_FLAG_STATIC_LITERAL); + pm_node_flag_unset(UP(node), PM_NODE_FLAG_STATIC_LITERAL); } if (PM_NODE_TYPE_P(element, PM_SPLAT_NODE)) { - pm_node_flag_set((pm_node_t *)node, PM_ARRAY_NODE_FLAGS_CONTAINS_SPLAT); + pm_node_flag_set(UP(node), PM_ARRAY_NODE_FLAGS_CONTAINS_SPLAT); } } @@ -2475,7 +2481,7 @@ pm_block_local_variable_node_create(pm_parser_t *parser, const pm_token_t *name) */ static void pm_block_parameters_node_append_local(pm_block_parameters_node_t *node, const pm_block_local_variable_node_t *local) { - pm_node_list_append(&node->locals, (pm_node_t *) local); + pm_node_list_append(&node->locals, UP(local)); if (node->base.location.start == NULL) node->base.location.start = local->base.location.start; node->base.location.end = local->base.location.end; @@ -2623,7 +2629,7 @@ pm_call_node_call_create(pm_parser_t *parser, pm_node_t *receiver, pm_token_t *o node->block = arguments->block; if (operator->type == PM_TOKEN_AMPERSAND_DOT) { - pm_node_flag_set((pm_node_t *)node, PM_CALL_NODE_FLAGS_SAFE_NAVIGATION); + pm_node_flag_set(UP(node), PM_CALL_NODE_FLAGS_SAFE_NAVIGATION); } /** @@ -2736,7 +2742,7 @@ pm_call_node_shorthand_create(pm_parser_t *parser, pm_node_t *receiver, pm_token node->block = arguments->block; if (operator->type == PM_TOKEN_AMPERSAND_DOT) { - pm_node_flag_set((pm_node_t *)node, PM_CALL_NODE_FLAGS_SAFE_NAVIGATION); + pm_node_flag_set(UP(node), PM_CALL_NODE_FLAGS_SAFE_NAVIGATION); } node->name = pm_parser_constant_id_constant(parser, "call", 4); @@ -3306,7 +3312,7 @@ pm_class_variable_write_node_create(pm_parser_t *parser, pm_class_variable_read_ *node = (pm_class_variable_write_node_t) { .base = PM_NODE_INIT(parser, PM_CLASS_VARIABLE_WRITE_NODE, flags, read_node->base.location.start, value->location.end), .name = read_node->name, - .name_loc = PM_LOCATION_NODE_VALUE((pm_node_t *) read_node), + .name_loc = PM_LOCATION_NODE_VALUE(UP(read_node)), .operator_loc = PM_LOCATION_TOKEN_VALUE(operator), .value = value }; @@ -3510,7 +3516,7 @@ pm_def_node_receiver_check(pm_parser_t *parser, const pm_node_t *node) { switch (PM_NODE_TYPE(node)) { case PM_BEGIN_NODE: { const pm_begin_node_t *cast = (pm_begin_node_t *) node; - if (cast->statements != NULL) pm_def_node_receiver_check(parser, (pm_node_t *) cast->statements); + if (cast->statements != NULL) pm_def_node_receiver_check(parser, UP(cast->statements)); break; } case PM_PARENTHESES_NODE: { @@ -3719,7 +3725,7 @@ pm_find_pattern_node_create(pm_parser_t *parser, pm_node_list_t *nodes) { pm_node_t *right; if (nodes->size == 1) { - right = (pm_node_t *) pm_missing_node_create(parser, left->location.end, left->location.end); + right = UP(pm_missing_node_create(parser, left->location.end, left->location.end)); } else { right = nodes->nodes[nodes->size - 1]; assert(PM_NODE_TYPE_P(right, PM_SPLAT_NODE)); @@ -3851,11 +3857,11 @@ pm_float_node_imaginary_create(pm_parser_t *parser, const pm_token_t *token) { pm_imaginary_node_t *node = PM_NODE_ALLOC(parser, pm_imaginary_node_t); *node = (pm_imaginary_node_t) { .base = PM_NODE_INIT(parser, PM_IMAGINARY_NODE, PM_NODE_FLAG_STATIC_LITERAL, token->start, token->end), - .numeric = (pm_node_t *) pm_float_node_create(parser, &((pm_token_t) { + .numeric = UP(pm_float_node_create(parser, &((pm_token_t) { .type = PM_TOKEN_FLOAT, .start = token->start, .end = token->end - 1 - })) + }))) }; return node; @@ -3920,11 +3926,11 @@ pm_float_node_rational_imaginary_create(pm_parser_t *parser, const pm_token_t *t pm_imaginary_node_t *node = PM_NODE_ALLOC(parser, pm_imaginary_node_t); *node = (pm_imaginary_node_t) { .base = PM_NODE_INIT(parser, PM_IMAGINARY_NODE, PM_NODE_FLAG_STATIC_LITERAL, token->start, token->end), - .numeric = (pm_node_t *) pm_float_node_rational_create(parser, &((pm_token_t) { + .numeric = UP(pm_float_node_rational_create(parser, &((pm_token_t) { .type = PM_TOKEN_FLOAT_RATIONAL, .start = token->start, .end = token->end - 1 - })) + }))) }; return node; @@ -4252,7 +4258,7 @@ pm_hash_node_elements_append(pm_hash_node_t *hash, pm_node_t *element) { } if (!static_literal) { - pm_node_flag_unset((pm_node_t *)hash, PM_NODE_FLAG_STATIC_LITERAL); + pm_node_flag_unset(UP(hash), PM_NODE_FLAG_STATIC_LITERAL); } } @@ -4350,7 +4356,7 @@ pm_if_node_ternary_create(pm_parser_t *parser, pm_node_t *predicate, const pm_to .predicate = predicate, .then_keyword_loc = PM_LOCATION_TOKEN_VALUE(qmark), .statements = if_statements, - .subsequent = (pm_node_t *) else_node, + .subsequent = UP(else_node), .end_keyword_loc = PM_OPTIONAL_LOCATION_NOT_PROVIDED_VALUE }; @@ -4438,11 +4444,11 @@ pm_integer_node_imaginary_create(pm_parser_t *parser, pm_node_flags_t base, cons pm_imaginary_node_t *node = PM_NODE_ALLOC(parser, pm_imaginary_node_t); *node = (pm_imaginary_node_t) { .base = PM_NODE_INIT(parser, PM_IMAGINARY_NODE, PM_NODE_FLAG_STATIC_LITERAL, token->start, token->end), - .numeric = (pm_node_t *) pm_integer_node_create(parser, base, &((pm_token_t) { + .numeric = UP(pm_integer_node_create(parser, base, &((pm_token_t) { .type = PM_TOKEN_INTEGER, .start = token->start, .end = token->end - 1 - })) + }))) }; return node; @@ -4488,11 +4494,11 @@ pm_integer_node_rational_imaginary_create(pm_parser_t *parser, pm_node_flags_t b pm_imaginary_node_t *node = PM_NODE_ALLOC(parser, pm_imaginary_node_t); *node = (pm_imaginary_node_t) { .base = PM_NODE_INIT(parser, PM_IMAGINARY_NODE, PM_NODE_FLAG_STATIC_LITERAL, token->start, token->end), - .numeric = (pm_node_t *) pm_integer_node_rational_create(parser, base, &((pm_token_t) { + .numeric = UP(pm_integer_node_rational_create(parser, base, &((pm_token_t) { .type = PM_TOKEN_INTEGER_RATIONAL, .start = token->start, .end = token->end - 1 - })) + }))) }; return node; @@ -4652,7 +4658,7 @@ pm_interpolated_node_append(pm_node_t *node, pm_node_list_t *parts, pm_node_t *p break; } case PM_EMBEDDED_VARIABLE_NODE: - pm_node_flag_unset((pm_node_t *) node, PM_NODE_FLAG_STATIC_LITERAL); + pm_node_flag_unset(UP(node), PM_NODE_FLAG_STATIC_LITERAL); break; default: assert(false && "unexpected node type"); @@ -4688,14 +4694,14 @@ pm_interpolated_regular_expression_node_append(pm_interpolated_regular_expressio node->base.location.end = part->location.end; } - pm_interpolated_node_append((pm_node_t *) node, &node->parts, part); + pm_interpolated_node_append(UP(node), &node->parts, part); } static inline void pm_interpolated_regular_expression_node_closing_set(pm_parser_t *parser, pm_interpolated_regular_expression_node_t *node, const pm_token_t *closing) { node->closing_loc = PM_LOCATION_TOKEN_VALUE(closing); node->base.location.end = closing->end; - pm_node_flag_set((pm_node_t *) node, pm_regular_expression_flags_create(parser, closing)); + pm_node_flag_set(UP(node), pm_regular_expression_flags_create(parser, closing)); } /** @@ -4741,7 +4747,7 @@ pm_interpolated_string_node_append(pm_interpolated_string_node_t *node, pm_node_ // because concatenating two frozen strings (`'foo' 'bar'`) is still frozen. This holds true for // as long as this interpolation only consists of other string literals. if (!PM_NODE_FLAG_P(part, PM_STRING_FLAGS_FROZEN)) { - pm_node_flag_unset((pm_node_t *) node, PM_NODE_FLAG_STATIC_LITERAL); + pm_node_flag_unset(UP(node), PM_NODE_FLAG_STATIC_LITERAL); } part->flags = (pm_node_flags_t) ((part->flags | PM_NODE_FLAG_STATIC_LITERAL | PM_STRING_FLAGS_FROZEN) & ~PM_STRING_FLAGS_MUTABLE); break; @@ -4860,7 +4866,7 @@ pm_interpolated_symbol_node_append(pm_interpolated_symbol_node_t *node, pm_node_ node->base.location.start = part->location.start; } - pm_interpolated_node_append((pm_node_t *) node, &node->parts, part); + pm_interpolated_node_append(UP(node), &node->parts, part); node->base.location.end = MAX(node->base.location.end, part->location.end); } @@ -4913,7 +4919,7 @@ pm_interpolated_xstring_node_create(pm_parser_t *parser, const pm_token_t *openi static inline void pm_interpolated_xstring_node_append(pm_interpolated_x_string_node_t *node, pm_node_t *part) { - pm_interpolated_node_append((pm_node_t *) node, &node->parts, part); + pm_interpolated_node_append(UP(node), &node->parts, part); node->base.location.end = part->location.end; } @@ -4974,7 +4980,7 @@ pm_keyword_hash_node_elements_append(pm_keyword_hash_node_t *hash, pm_node_t *el // If the element being added is not an AssocNode or does not have a symbol // key, then we want to turn the SYMBOL_KEYS flag off. if (!PM_NODE_TYPE_P(element, PM_ASSOC_NODE) || !PM_NODE_TYPE_P(((pm_assoc_node_t *) element)->key, PM_SYMBOL_NODE)) { - pm_node_flag_unset((pm_node_t *)hash, PM_KEYWORD_HASH_NODE_FLAGS_SYMBOL_KEYS); + pm_node_flag_unset(UP(hash), PM_KEYWORD_HASH_NODE_FLAGS_SYMBOL_KEYS); } pm_node_list_append(&hash->elements, element); @@ -5618,8 +5624,8 @@ pm_parameters_node_requireds_append(pm_parameters_node_t *params, pm_node_t *par */ static void pm_parameters_node_optionals_append(pm_parameters_node_t *params, pm_optional_parameter_node_t *param) { - pm_parameters_node_location_set(params, (pm_node_t *) param); - pm_node_list_append(¶ms->optionals, (pm_node_t *) param); + pm_parameters_node_location_set(params, UP(param)); + pm_node_list_append(¶ms->optionals, UP(param)); } /** @@ -5665,7 +5671,7 @@ pm_parameters_node_keyword_rest_set(pm_parameters_node_t *params, pm_node_t *par static void pm_parameters_node_block_set(pm_parameters_node_t *params, pm_block_parameter_node_t *param) { assert(params->block == NULL); - pm_parameters_node_location_set(params, (pm_node_t *) param); + pm_parameters_node_location_set(params, UP(param)); params->block = param; } @@ -6546,7 +6552,7 @@ pm_symbol_node_label_create(pm_parser_t *parser, const pm_token_t *token) { assert((label.end - label.start) >= 0); pm_string_shared_init(&node->unescaped, label.start, label.end); - pm_node_flag_set((pm_node_t *) node, parse_symbol_encoding(parser, &label, &node->unescaped, false)); + pm_node_flag_set(UP(node), parse_symbol_encoding(parser, &label, &node->unescaped, false)); break; } @@ -6621,7 +6627,7 @@ pm_string_node_to_symbol_node(pm_parser_t *parser, pm_string_node_t *node, const }; pm_token_t content = { .type = PM_TOKEN_IDENTIFIER, .start = node->content_loc.start, .end = node->content_loc.end }; - pm_node_flag_set((pm_node_t *) new_node, parse_symbol_encoding(parser, &content, &node->unescaped, true)); + pm_node_flag_set(UP(new_node), parse_symbol_encoding(parser, &content, &node->unescaped, true)); // We are explicitly _not_ using pm_node_destroy here because we don't want // to trash the unescaped string. We could instead copy the string if we @@ -12434,7 +12440,7 @@ parse_starred_expression(pm_parser_t *parser, pm_binding_power_t binding_power, if (accept1(parser, PM_TOKEN_USTAR)) { pm_token_t operator = parser->previous; pm_node_t *expression = parse_value_expression(parser, binding_power, false, false, PM_ERR_EXPECT_EXPRESSION_AFTER_STAR, (uint16_t) (depth + 1)); - return (pm_node_t *) pm_splat_node_create(parser, &operator, expression); + return UP(pm_splat_node_create(parser, &operator, expression)); } return parse_value_expression(parser, binding_power, accepts_command_call, false, diag_id, depth); @@ -12559,7 +12565,7 @@ parse_unwriteable_target(pm_parser_t *parser, pm_node_t *target) { pm_local_variable_target_node_t *result = pm_local_variable_target_node_create(parser, &target->location, name, 0); pm_node_destroy(parser, target); - return (pm_node_t *) result; + return UP(result); } /** @@ -12634,7 +12640,7 @@ parse_target(pm_parser_t *parser, pm_node_t *target, bool multiple, bool splat_p } case PM_IT_LOCAL_VARIABLE_READ_NODE: { pm_constant_id_t name = pm_parser_local_add_constant(parser, "it", 2); - pm_node_t *node = (pm_node_t *) pm_local_variable_target_node_create(parser, &target->location, name, 0); + pm_node_t *node = UP(pm_local_variable_target_node_create(parser, &target->location, name, 0)); pm_node_unreference(parser, target); pm_node_destroy(parser, target); @@ -12660,7 +12666,7 @@ parse_target(pm_parser_t *parser, pm_node_t *target, bool multiple, bool splat_p splat->expression = parse_target(parser, splat->expression, multiple, true); } - return (pm_node_t *) splat; + return UP(splat); } case PM_CALL_NODE: { pm_call_node_t *call = (pm_call_node_t *) target; @@ -12691,7 +12697,7 @@ parse_target(pm_parser_t *parser, pm_node_t *target, bool multiple, bool splat_p pm_constant_id_t name = pm_parser_local_add_location(parser, message_loc.start, message_loc.end, 0); pm_node_destroy(parser, target); - return (pm_node_t *) pm_local_variable_target_node_create(parser, &message_loc, name, 0); + return UP(pm_local_variable_target_node_create(parser, &message_loc, name, 0)); } if (*call->message_loc.start == '_' || parser->encoding->alnum_char(call->message_loc.start, call->message_loc.end - call->message_loc.start)) { @@ -12700,7 +12706,7 @@ parse_target(pm_parser_t *parser, pm_node_t *target, bool multiple, bool splat_p } parse_write_name(parser, &call->name); - return (pm_node_t *) pm_call_target_node_create(parser, call); + return UP(pm_call_target_node_create(parser, call)); } } @@ -12708,7 +12714,7 @@ parse_target(pm_parser_t *parser, pm_node_t *target, bool multiple, bool splat_p // an aref expression, and we can transform it into an aset // expression. if (PM_NODE_FLAG_P(call, PM_CALL_NODE_FLAGS_INDEX)) { - return (pm_node_t *) pm_index_target_node_create(parser, call); + return UP(pm_index_target_node_create(parser, call)); } } PRISM_FALLTHROUGH @@ -12751,7 +12757,7 @@ parse_shareable_constant_write(pm_parser_t *parser, pm_node_t *write) { pm_shareable_constant_value_t shareable_constant = pm_parser_scope_shareable_constant_get(parser); if (shareable_constant != PM_SCOPE_SHAREABLE_CONSTANT_NONE) { - return (pm_node_t *) pm_shareable_constant_node_create(parser, write, shareable_constant); + return UP(pm_shareable_constant_node_create(parser, write, shareable_constant)); } return write; @@ -12769,10 +12775,10 @@ parse_write(pm_parser_t *parser, pm_node_t *target, pm_token_t *operator, pm_nod case PM_CLASS_VARIABLE_READ_NODE: { pm_class_variable_write_node_t *node = pm_class_variable_write_node_create(parser, (pm_class_variable_read_node_t *) target, operator, value); pm_node_destroy(parser, target); - return (pm_node_t *) node; + return UP(node); } case PM_CONSTANT_PATH_NODE: { - pm_node_t *node = (pm_node_t *) pm_constant_path_write_node_create(parser, (pm_constant_path_node_t *) target, operator, value); + pm_node_t *node = UP(pm_constant_path_write_node_create(parser, (pm_constant_path_node_t *) target, operator, value)); if (context_def_p(parser)) { pm_parser_err_node(parser, node, PM_ERR_WRITE_TARGET_IN_METHOD); @@ -12781,7 +12787,7 @@ parse_write(pm_parser_t *parser, pm_node_t *target, pm_token_t *operator, pm_nod return parse_shareable_constant_write(parser, node); } case PM_CONSTANT_READ_NODE: { - pm_node_t *node = (pm_node_t *) pm_constant_write_node_create(parser, (pm_constant_read_node_t *) target, operator, value); + pm_node_t *node = UP(pm_constant_write_node_create(parser, (pm_constant_read_node_t *) target, operator, value)); if (context_def_p(parser)) { pm_parser_err_node(parser, node, PM_ERR_WRITE_TARGET_IN_METHOD); @@ -12797,7 +12803,7 @@ parse_write(pm_parser_t *parser, pm_node_t *target, pm_token_t *operator, pm_nod case PM_GLOBAL_VARIABLE_READ_NODE: { pm_global_variable_write_node_t *node = pm_global_variable_write_node_create(parser, target, operator, value); pm_node_destroy(parser, target); - return (pm_node_t *) node; + return UP(node); } case PM_LOCAL_VARIABLE_READ_NODE: { pm_local_variable_read_node_t *local_read = (pm_local_variable_read_node_t *) target; @@ -12817,11 +12823,11 @@ parse_write(pm_parser_t *parser, pm_node_t *target, pm_token_t *operator, pm_nod pm_locals_unread(&scope->locals, name); pm_node_destroy(parser, target); - return (pm_node_t *) pm_local_variable_write_node_create(parser, name, depth, value, &name_loc, operator); + return UP(pm_local_variable_write_node_create(parser, name, depth, value, &name_loc, operator)); } case PM_IT_LOCAL_VARIABLE_READ_NODE: { pm_constant_id_t name = pm_parser_local_add_constant(parser, "it", 2); - pm_node_t *node = (pm_node_t *) pm_local_variable_write_node_create(parser, name, 0, value, &target->location, operator); + pm_node_t *node = UP(pm_local_variable_write_node_create(parser, name, 0, value, &target->location, operator)); pm_node_unreference(parser, target); pm_node_destroy(parser, target); @@ -12829,12 +12835,12 @@ parse_write(pm_parser_t *parser, pm_node_t *target, pm_token_t *operator, pm_nod return node; } case PM_INSTANCE_VARIABLE_READ_NODE: { - pm_node_t *write_node = (pm_node_t *) pm_instance_variable_write_node_create(parser, (pm_instance_variable_read_node_t *) target, operator, value); + pm_node_t *write_node = UP(pm_instance_variable_write_node_create(parser, (pm_instance_variable_read_node_t *) target, operator, value)); pm_node_destroy(parser, target); return write_node; } case PM_MULTI_TARGET_NODE: - return (pm_node_t *) pm_multi_write_node_create(parser, (pm_multi_target_node_t *) target, operator, value); + return UP(pm_multi_write_node_create(parser, (pm_multi_target_node_t *) target, operator, value)); case PM_SPLAT_NODE: { pm_splat_node_t *splat = (pm_splat_node_t *) target; @@ -12843,9 +12849,9 @@ parse_write(pm_parser_t *parser, pm_node_t *target, pm_token_t *operator, pm_nod } pm_multi_target_node_t *multi_target = pm_multi_target_node_create(parser); - pm_multi_target_node_targets_append(parser, multi_target, (pm_node_t *) splat); + pm_multi_target_node_targets_append(parser, multi_target, UP(splat)); - return (pm_node_t *) pm_multi_write_node_create(parser, multi_target, operator, value); + return UP(pm_multi_write_node_create(parser, multi_target, operator, value)); } case PM_CALL_NODE: { pm_call_node_t *call = (pm_call_node_t *) target; @@ -12877,7 +12883,7 @@ parse_write(pm_parser_t *parser, pm_node_t *target, pm_token_t *operator, pm_nod pm_node_destroy(parser, target); pm_constant_id_t constant_id = pm_parser_constant_id_location(parser, message.start, message.end); - target = (pm_node_t *) pm_local_variable_write_node_create(parser, constant_id, 0, value, &message, operator); + target = UP(pm_local_variable_write_node_create(parser, constant_id, 0, value, &message, operator)); pm_refute_numbered_parameter(parser, message.start, message.end); return target; @@ -12902,9 +12908,9 @@ parse_write(pm_parser_t *parser, pm_node_t *target, pm_token_t *operator, pm_nod call->equal_loc = PM_LOCATION_TOKEN_VALUE(operator); parse_write_name(parser, &call->name); - pm_node_flag_set((pm_node_t *) call, PM_CALL_NODE_FLAGS_ATTRIBUTE_WRITE | pm_implicit_array_write_flags(value, PM_CALL_NODE_FLAGS_IMPLICIT_ARRAY)); + pm_node_flag_set(UP(call), PM_CALL_NODE_FLAGS_ATTRIBUTE_WRITE | pm_implicit_array_write_flags(value, PM_CALL_NODE_FLAGS_IMPLICIT_ARRAY)); - return (pm_node_t *) call; + return UP(call); } } @@ -12925,7 +12931,7 @@ parse_write(pm_parser_t *parser, pm_node_t *target, pm_token_t *operator, pm_nod // Ensure that the arguments for []= don't contain keywords pm_index_arguments_check(parser, call->arguments, call->block); - pm_node_flag_set((pm_node_t *) call, PM_CALL_NODE_FLAGS_ATTRIBUTE_WRITE | pm_implicit_array_write_flags(value, PM_CALL_NODE_FLAGS_IMPLICIT_ARRAY)); + pm_node_flag_set(UP(call), PM_CALL_NODE_FLAGS_ATTRIBUTE_WRITE | pm_implicit_array_write_flags(value, PM_CALL_NODE_FLAGS_IMPLICIT_ARRAY)); return target; } @@ -12976,7 +12982,7 @@ parse_unwriteable_write(pm_parser_t *parser, pm_node_t *target, const pm_token_t pm_local_variable_write_node_t *result = pm_local_variable_write_node_create(parser, name, 0, value, &target->location, equals); pm_node_destroy(parser, target); - return (pm_node_t *) result; + return UP(result); } /** @@ -13013,7 +13019,7 @@ parse_targets(pm_parser_t *parser, pm_node_t *first_target, pm_binding_power_t b name = parse_target(parser, name, true, true); } - pm_node_t *splat = (pm_node_t *) pm_splat_node_create(parser, &star_operator, name); + pm_node_t *splat = UP(pm_splat_node_create(parser, &star_operator, name)); pm_multi_target_node_targets_append(parser, result, splat); has_rest = true; } else if (match1(parser, PM_TOKEN_PARENTHESIS_LEFT)) { @@ -13031,13 +13037,13 @@ parse_targets(pm_parser_t *parser, pm_node_t *first_target, pm_binding_power_t b } else if (!match1(parser, PM_TOKEN_EOF)) { // If we get here, then we have a trailing , in a multi target node. // We'll add an implicit rest node to represent this. - pm_node_t *rest = (pm_node_t *) pm_implicit_rest_node_create(parser, &parser->previous); + pm_node_t *rest = UP(pm_implicit_rest_node_create(parser, &parser->previous)); pm_multi_target_node_targets_append(parser, result, rest); break; } } - return (pm_node_t *) result; + return UP(result); } /** @@ -13231,7 +13237,7 @@ parse_assocs(pm_parser_t *parser, pm_static_literals_t *literals, pm_node_t *nod pm_parser_scope_forwarding_keywords_check(parser, &operator); } - element = (pm_node_t *) pm_assoc_splat_node_create(parser, value, &operator); + element = UP(pm_assoc_splat_node_create(parser, value, &operator)); contains_keyword_splat = true; break; } @@ -13239,7 +13245,7 @@ parse_assocs(pm_parser_t *parser, pm_static_literals_t *literals, pm_node_t *nod pm_token_t label = parser->current; parser_lex(parser); - pm_node_t *key = (pm_node_t *) pm_symbol_node_label_create(parser, &label); + pm_node_t *key = UP(pm_symbol_node_label_create(parser, &label)); pm_hash_key_static_literals_add(parser, literals, key); pm_token_t operator = not_provided(parser); @@ -13250,7 +13256,7 @@ parse_assocs(pm_parser_t *parser, pm_static_literals_t *literals, pm_node_t *nod } else { if (parser->encoding->isupper_char(label.start, (label.end - 1) - label.start)) { pm_token_t constant = { .type = PM_TOKEN_CONSTANT, .start = label.start, .end = label.end - 1 }; - value = (pm_node_t *) pm_constant_read_node_create(parser, &constant); + value = UP(pm_constant_read_node_create(parser, &constant)); } else { int depth = -1; pm_token_t identifier = { .type = PM_TOKEN_IDENTIFIER, .start = label.start, .end = label.end - 1 }; @@ -13262,17 +13268,17 @@ parse_assocs(pm_parser_t *parser, pm_static_literals_t *literals, pm_node_t *nod } if (depth == -1) { - value = (pm_node_t *) pm_call_node_variable_call_create(parser, &identifier); + value = UP(pm_call_node_variable_call_create(parser, &identifier)); } else { - value = (pm_node_t *) pm_local_variable_read_node_create(parser, &identifier, (uint32_t) depth); + value = UP(pm_local_variable_read_node_create(parser, &identifier, (uint32_t) depth)); } } value->location.end++; - value = (pm_node_t *) pm_implicit_node_create(parser, value); + value = UP(pm_implicit_node_create(parser, value)); } - element = (pm_node_t *) pm_assoc_node_create(parser, key, &operator, value); + element = UP(pm_assoc_node_create(parser, key, &operator, value)); break; } default: { @@ -13295,7 +13301,7 @@ parse_assocs(pm_parser_t *parser, pm_static_literals_t *literals, pm_node_t *nod } pm_node_t *value = parse_value_expression(parser, PM_BINDING_POWER_DEFINED, false, false, PM_ERR_HASH_VALUE, (uint16_t) (depth + 1)); - element = (pm_node_t *) pm_assoc_node_create(parser, key, &operator, value); + element = UP(pm_assoc_node_create(parser, key, &operator, value)); break; } } @@ -13373,16 +13379,16 @@ parse_arguments(pm_parser_t *parser, pm_arguments_t *arguments, bool accepts_for } pm_keyword_hash_node_t *hash = pm_keyword_hash_node_create(parser); - argument = (pm_node_t *) hash; + argument = UP(hash); pm_static_literals_t hash_keys = { 0 }; - bool contains_keyword_splat = parse_assocs(parser, &hash_keys, (pm_node_t *) hash, (uint16_t) (depth + 1)); + bool contains_keyword_splat = parse_assocs(parser, &hash_keys, UP(hash), (uint16_t) (depth + 1)); parse_arguments_append(parser, arguments, argument); pm_node_flags_t flags = PM_ARGUMENTS_NODE_FLAGS_CONTAINS_KEYWORDS; if (contains_keyword_splat) flags |= PM_ARGUMENTS_NODE_FLAGS_CONTAINS_KEYWORD_SPLAT; - pm_node_flag_set((pm_node_t *) arguments->arguments, flags); + pm_node_flag_set(UP(arguments->arguments), flags); pm_static_literals_free(&hash_keys); parsed_bare_hash = true; @@ -13400,7 +13406,7 @@ parse_arguments(pm_parser_t *parser, pm_arguments_t *arguments, bool accepts_for pm_parser_scope_forwarding_block_check(parser, &operator); } - argument = (pm_node_t *) pm_block_argument_node_create(parser, &operator, expression); + argument = UP(pm_block_argument_node_create(parser, &operator, expression)); if (parsed_block_argument) { parse_arguments_append(parser, arguments, argument); } else { @@ -13420,7 +13426,7 @@ parse_arguments(pm_parser_t *parser, pm_arguments_t *arguments, bool accepts_for if (match4(parser, PM_TOKEN_PARENTHESIS_RIGHT, PM_TOKEN_COMMA, PM_TOKEN_SEMICOLON, PM_TOKEN_BRACKET_RIGHT)) { pm_parser_scope_forwarding_positionals_check(parser, &operator); - argument = (pm_node_t *) pm_splat_node_create(parser, &operator, NULL); + argument = UP(pm_splat_node_create(parser, &operator, NULL)); if (parsed_bare_hash) { pm_parser_err_previous(parser, PM_ERR_ARGUMENT_SPLAT_AFTER_ASSOC_SPLAT); } @@ -13431,7 +13437,7 @@ parse_arguments(pm_parser_t *parser, pm_arguments_t *arguments, bool accepts_for pm_parser_err(parser, operator.start, expression->location.end, PM_ERR_ARGUMENT_SPLAT_AFTER_ASSOC_SPLAT); } - argument = (pm_node_t *) pm_splat_node_create(parser, &operator, expression); + argument = UP(pm_splat_node_create(parser, &operator, expression)); } parse_arguments_append(parser, arguments, argument); @@ -13456,16 +13462,16 @@ parse_arguments(pm_parser_t *parser, pm_arguments_t *arguments, bool accepts_for pm_parser_err(parser, range->operator_loc.start, range->operator_loc.end, PM_ERR_UNEXPECTED_RANGE_OPERATOR); } - argument = (pm_node_t *) pm_range_node_create(parser, NULL, &operator, right); + argument = UP(pm_range_node_create(parser, NULL, &operator, right)); } else { pm_parser_scope_forwarding_all_check(parser, &parser->previous); if (parsed_first_argument && terminator == PM_TOKEN_EOF) { pm_parser_err_previous(parser, PM_ERR_ARGUMENT_FORWARDING_UNBOUND); } - argument = (pm_node_t *) pm_forwarding_arguments_node_create(parser, &parser->previous); + argument = UP(pm_forwarding_arguments_node_create(parser, &parser->previous)); parse_arguments_append(parser, arguments, argument); - pm_node_flag_set((pm_node_t *) arguments->arguments, PM_ARGUMENTS_NODE_FLAGS_CONTAINS_FORWARDING); + pm_node_flag_set(UP(arguments->arguments), PM_ARGUMENTS_NODE_FLAGS_CONTAINS_FORWARDING); arguments->has_forwarding = true; parsed_forwarding_arguments = true; break; @@ -13502,17 +13508,17 @@ parse_arguments(pm_parser_t *parser, pm_arguments_t *arguments, bool accepts_for // Finish parsing the one we are part way through. pm_node_t *value = parse_value_expression(parser, PM_BINDING_POWER_DEFINED, false, false, PM_ERR_HASH_VALUE, (uint16_t) (depth + 1)); - argument = (pm_node_t *) pm_assoc_node_create(parser, argument, &operator, value); + argument = UP(pm_assoc_node_create(parser, argument, &operator, value)); pm_keyword_hash_node_elements_append(bare_hash, argument); - argument = (pm_node_t *) bare_hash; + argument = UP(bare_hash); // Then parse more if we have a comma if (accept1(parser, PM_TOKEN_COMMA) && ( token_begins_expression_p(parser->current.type) || match2(parser, PM_TOKEN_USTAR_STAR, PM_TOKEN_LABEL) )) { - contains_keyword_splat = parse_assocs(parser, &hash_keys, (pm_node_t *) bare_hash, (uint16_t) (depth + 1)); + contains_keyword_splat = parse_assocs(parser, &hash_keys, UP(bare_hash), (uint16_t) (depth + 1)); } pm_static_literals_free(&hash_keys); @@ -13524,7 +13530,7 @@ parse_arguments(pm_parser_t *parser, pm_arguments_t *arguments, bool accepts_for pm_node_flags_t flags = 0; if (contains_keywords) flags |= PM_ARGUMENTS_NODE_FLAGS_CONTAINS_KEYWORDS; if (contains_keyword_splat) flags |= PM_ARGUMENTS_NODE_FLAGS_CONTAINS_KEYWORD_SPLAT; - pm_node_flag_set((pm_node_t *) arguments->arguments, flags); + pm_node_flag_set(UP(arguments->arguments), flags); break; } @@ -13601,33 +13607,33 @@ parse_required_destructured_parameter(pm_parser_t *parser) { // commas, so here we'll assume this is a mistake of the user not // knowing it's not allowed here. if (node->lefts.size > 0 && match1(parser, PM_TOKEN_PARENTHESIS_RIGHT)) { - param = (pm_node_t *) pm_implicit_rest_node_create(parser, &parser->previous); + param = UP(pm_implicit_rest_node_create(parser, &parser->previous)); pm_multi_target_node_targets_append(parser, node, param); pm_parser_err_current(parser, PM_ERR_PARAMETER_WILD_LOOSE_COMMA); break; } if (match1(parser, PM_TOKEN_PARENTHESIS_LEFT)) { - param = (pm_node_t *) parse_required_destructured_parameter(parser); + param = UP(parse_required_destructured_parameter(parser)); } else if (accept1(parser, PM_TOKEN_USTAR)) { pm_token_t star = parser->previous; pm_node_t *value = NULL; if (accept1(parser, PM_TOKEN_IDENTIFIER)) { pm_token_t name = parser->previous; - value = (pm_node_t *) pm_required_parameter_node_create(parser, &name); + value = UP(pm_required_parameter_node_create(parser, &name)); if (pm_parser_parameter_name_check(parser, &name)) { pm_node_flag_set_repeated_parameter(value); } pm_parser_local_add_token(parser, &name, 1); } - param = (pm_node_t *) pm_splat_node_create(parser, &star, value); + param = UP(pm_splat_node_create(parser, &star, value)); } else { expect1(parser, PM_TOKEN_IDENTIFIER, PM_ERR_EXPECT_IDENT_REQ_PARAMETER); pm_token_t name = parser->previous; - param = (pm_node_t *) pm_required_parameter_node_create(parser, &name); + param = UP(pm_required_parameter_node_create(parser, &name)); if (pm_parser_parameter_name_check(parser, &name)) { pm_node_flag_set_repeated_parameter(param); } @@ -13740,7 +13746,7 @@ parse_parameters( switch (parser->current.type) { case PM_TOKEN_PARENTHESIS_LEFT: { update_parameter_state(parser, &parser->current, &order); - pm_node_t *param = (pm_node_t *) parse_required_destructured_parameter(parser); + pm_node_t *param = UP(parse_required_destructured_parameter(parser)); if (order > PM_PARAMETERS_ORDER_AFTER_OPTIONAL) { pm_parameters_node_requireds_append(params, param); @@ -13769,13 +13775,13 @@ parse_parameters( pm_block_parameter_node_t *param = pm_block_parameter_node_create(parser, &name, &operator); if (repeated) { - pm_node_flag_set_repeated_parameter((pm_node_t *)param); + pm_node_flag_set_repeated_parameter(UP(param)); } if (params->block == NULL) { pm_parameters_node_block_set(params, param); } else { - pm_parser_err_node(parser, (pm_node_t *) param, PM_ERR_PARAMETER_BLOCK_MULTI); - pm_parameters_node_posts_append(params, (pm_node_t *) param); + pm_parser_err_node(parser, UP(param), PM_ERR_PARAMETER_BLOCK_MULTI); + pm_parameters_node_posts_append(params, UP(param)); } break; @@ -13800,7 +13806,7 @@ parse_parameters( params->keyword_rest = NULL; } - pm_parameters_node_keyword_rest_set(params, (pm_node_t *) param); + pm_parameters_node_keyword_rest_set(params, UP(param)); break; } case PM_TOKEN_CLASS_VARIABLE: @@ -13854,7 +13860,7 @@ parse_parameters( pm_optional_parameter_node_t *param = pm_optional_parameter_node_create(parser, &name, &operator, value); if (repeated) { - pm_node_flag_set_repeated_parameter((pm_node_t *) param); + pm_node_flag_set_repeated_parameter(UP(param)); } pm_parameters_node_optionals_append(params, param); @@ -13877,15 +13883,15 @@ parse_parameters( } else if (order > PM_PARAMETERS_ORDER_AFTER_OPTIONAL) { pm_required_parameter_node_t *param = pm_required_parameter_node_create(parser, &name); if (repeated) { - pm_node_flag_set_repeated_parameter((pm_node_t *)param); + pm_node_flag_set_repeated_parameter(UP(param)); } - pm_parameters_node_requireds_append(params, (pm_node_t *) param); + pm_parameters_node_requireds_append(params, UP(param)); } else { pm_required_parameter_node_t *param = pm_required_parameter_node_create(parser, &name); if (repeated) { - pm_node_flag_set_repeated_parameter((pm_node_t *)param); + pm_node_flag_set_repeated_parameter(UP(param)); } - pm_parameters_node_posts_append(params, (pm_node_t *) param); + pm_parameters_node_posts_append(params, UP(param)); } break; @@ -13916,7 +13922,7 @@ parse_parameters( case PM_TOKEN_PIPE: { context_pop(parser); - pm_node_t *param = (pm_node_t *) pm_required_keyword_parameter_node_create(parser, &name); + pm_node_t *param = UP(pm_required_keyword_parameter_node_create(parser, &name)); if (repeated) { pm_node_flag_set_repeated_parameter(param); } @@ -13933,7 +13939,7 @@ parse_parameters( break; } - pm_node_t *param = (pm_node_t *) pm_required_keyword_parameter_node_create(parser, &name); + pm_node_t *param = UP(pm_required_keyword_parameter_node_create(parser, &name)); if (repeated) { pm_node_flag_set_repeated_parameter(param); } @@ -13956,10 +13962,10 @@ parse_parameters( PM_PARSER_ERR_TOKEN_FORMAT_CONTENT(parser, local, PM_ERR_PARAMETER_CIRCULAR); } - param = (pm_node_t *) pm_optional_keyword_parameter_node_create(parser, &name, value); + param = UP(pm_optional_keyword_parameter_node_create(parser, &name, value)); } else { - param = (pm_node_t *) pm_required_keyword_parameter_node_create(parser, &name); + param = UP(pm_required_keyword_parameter_node_create(parser, &name)); } if (repeated) { @@ -14000,7 +14006,7 @@ parse_parameters( parser->current_scope->parameters |= PM_SCOPE_PARAMETERS_FORWARDING_POSITIONALS; } - pm_node_t *param = (pm_node_t *) pm_rest_parameter_node_create(parser, &operator, &name); + pm_node_t *param = UP(pm_rest_parameter_node_create(parser, &operator, &name)); if (repeated) { pm_node_flag_set_repeated_parameter(param); } @@ -14028,7 +14034,7 @@ parse_parameters( pm_parser_err_previous(parser, PM_ERR_PARAMETER_UNEXPECTED_NO_KW); } - param = (pm_node_t *) pm_no_keywords_parameter_node_create(parser, &operator, &parser->previous); + param = UP(pm_no_keywords_parameter_node_create(parser, &operator, &parser->previous)); } else { pm_token_t name; @@ -14042,7 +14048,7 @@ parse_parameters( parser->current_scope->parameters |= PM_SCOPE_PARAMETERS_FORWARDING_KEYWORDS; } - param = (pm_node_t *) pm_keyword_rest_parameter_node_create(parser, &operator, &name); + param = UP(pm_keyword_rest_parameter_node_create(parser, &operator, &name)); if (repeated) { pm_node_flag_set_repeated_parameter(param); } @@ -14062,13 +14068,13 @@ parse_parameters( if (allows_trailing_comma && order >= PM_PARAMETERS_ORDER_NAMED) { // If we get here, then we have a trailing comma in a // block parameter list. - pm_node_t *param = (pm_node_t *) pm_implicit_rest_node_create(parser, &parser->previous); + pm_node_t *param = UP(pm_implicit_rest_node_create(parser, &parser->previous)); if (params->rest == NULL) { pm_parameters_node_rest_set(params, param); } else { - pm_parser_err_node(parser, (pm_node_t *) param, PM_ERR_PARAMETER_SPLAT_MULTI); - pm_parameters_node_posts_append(params, (pm_node_t *) param); + pm_parser_err_node(parser, UP(param), PM_ERR_PARAMETER_SPLAT_MULTI); + pm_parameters_node_posts_append(params, UP(param)); } } else { pm_parser_err_previous(parser, PM_ERR_PARAMETER_WILD_LOOSE_COMMA); @@ -14105,7 +14111,7 @@ parse_parameters( // If we don't have any parameters, return `NULL` instead of an empty `ParametersNode`. if (params->base.location.start == params->base.location.end) { - pm_node_destroy(parser, (pm_node_t *) params); + pm_node_destroy(parser, UP(params)); return NULL; } @@ -14377,7 +14383,7 @@ parse_rescues(pm_parser_t *parser, size_t opening_newline_index, const pm_token_ // If we don't have a `current` rescue node, then this is a dangling // else, and it's an error. - if (current == NULL) pm_parser_err_node(parser, (pm_node_t *) else_clause, PM_ERR_BEGIN_LONELY_ELSE); + if (current == NULL) pm_parser_err_node(parser, UP(else_clause), PM_ERR_BEGIN_LONELY_ELSE); } if (match1(parser, PM_TOKEN_KEYWORD_ENSURE)) { @@ -14501,7 +14507,7 @@ parse_block_parameters( pm_parser_local_add_token(parser, &parser->previous, 1); pm_block_local_variable_node_t *local = pm_block_local_variable_node_create(parser, &parser->previous); - if (repeated) pm_node_flag_set_repeated_parameter((pm_node_t *) local); + if (repeated) pm_node_flag_set_repeated_parameter(UP(local)); pm_block_parameters_node_append_local(block_parameters, local); } while (accept1(parser, PM_TOKEN_COMMA)); @@ -14605,11 +14611,11 @@ parse_blocklike_parameters(pm_parser_t *parser, pm_node_t *parameters, const pm_ } const pm_location_t location = { .start = opening->start, .end = closing->end }; - return (pm_node_t *) pm_numbered_parameters_node_create(parser, &location, numbered_parameter); + return UP(pm_numbered_parameters_node_create(parser, &location, numbered_parameter)); } if (it_parameter) { - return (pm_node_t *) pm_it_parameters_node_create(parser, opening, closing); + return UP(pm_it_parameters_node_create(parser, opening, closing)); } return NULL; @@ -14649,7 +14655,7 @@ parse_block(pm_parser_t *parser, uint16_t depth) { if (opening.type == PM_TOKEN_BRACE_LEFT) { if (!match1(parser, PM_TOKEN_BRACE_RIGHT)) { - statements = (pm_node_t *) parse_statements(parser, PM_CONTEXT_BLOCK_BRACES, (uint16_t) (depth + 1)); + statements = UP(parse_statements(parser, PM_CONTEXT_BLOCK_BRACES, (uint16_t) (depth + 1))); } expect1(parser, PM_TOKEN_BRACE_RIGHT, PM_ERR_BLOCK_TERM_BRACE); @@ -14657,13 +14663,13 @@ parse_block(pm_parser_t *parser, uint16_t depth) { if (!match1(parser, PM_TOKEN_KEYWORD_END)) { if (!match3(parser, PM_TOKEN_KEYWORD_RESCUE, PM_TOKEN_KEYWORD_ELSE, PM_TOKEN_KEYWORD_ENSURE)) { pm_accepts_block_stack_push(parser, true); - statements = (pm_node_t *) parse_statements(parser, PM_CONTEXT_BLOCK_KEYWORDS, (uint16_t) (depth + 1)); + statements = UP(parse_statements(parser, PM_CONTEXT_BLOCK_KEYWORDS, (uint16_t) (depth + 1))); pm_accepts_block_stack_pop(parser); } if (match2(parser, PM_TOKEN_KEYWORD_RESCUE, PM_TOKEN_KEYWORD_ENSURE)) { assert(statements == NULL || PM_NODE_TYPE_P(statements, PM_STATEMENTS_NODE)); - statements = (pm_node_t *) parse_rescues_implicit_begin(parser, 0, NULL, opening.start, (pm_statements_node_t *) statements, PM_RESCUES_BLOCK, (uint16_t) (depth + 1)); + statements = UP(parse_rescues_implicit_begin(parser, 0, NULL, opening.start, (pm_statements_node_t *) statements, PM_RESCUES_BLOCK, (uint16_t) (depth + 1))); } } @@ -14672,7 +14678,7 @@ parse_block(pm_parser_t *parser, uint16_t depth) { pm_constant_id_list_t locals; pm_locals_order(parser, &parser->current_scope->locals, &locals, pm_parser_scope_toplevel_p(parser)); - pm_node_t *parameters = parse_blocklike_parameters(parser, (pm_node_t *) block_parameters, &opening, &parser->previous); + pm_node_t *parameters = parse_blocklike_parameters(parser, UP(block_parameters), &opening, &parser->previous); pm_parser_scope_pop(parser); pm_accepts_block_stack_pop(parser); @@ -14744,9 +14750,9 @@ parse_arguments_list(pm_parser_t *parser, pm_arguments_t *arguments, bool accept if (block != NULL) { if (arguments->block == NULL && !arguments->has_forwarding) { - arguments->block = (pm_node_t *) block; + arguments->block = UP(block); } else { - pm_parser_err_node(parser, (pm_node_t *) block, PM_ERR_ARGUMENT_BLOCK_MULTI); + pm_parser_err_node(parser, UP(block), PM_ERR_ARGUMENT_BLOCK_MULTI); if (arguments->block != NULL) { if (arguments->arguments == NULL) { @@ -14754,7 +14760,7 @@ parse_arguments_list(pm_parser_t *parser, pm_arguments_t *arguments, bool accept } pm_arguments_node_arguments_append(arguments->arguments, arguments->block); } - arguments->block = (pm_node_t *) block; + arguments->block = UP(block); } } } @@ -15042,10 +15048,10 @@ parse_conditional(pm_parser_t *parser, pm_context_t context, size_t opening_newl switch (context) { case PM_CONTEXT_IF: - parent = (pm_node_t *) pm_if_node_create(parser, &keyword, predicate, &then_keyword, statements, NULL, &end_keyword); + parent = UP(pm_if_node_create(parser, &keyword, predicate, &then_keyword, statements, NULL, &end_keyword)); break; case PM_CONTEXT_UNLESS: - parent = (pm_node_t *) pm_unless_node_create(parser, &keyword, predicate, &then_keyword, statements); + parent = UP(pm_unless_node_create(parser, &keyword, predicate, &then_keyword, statements)); break; default: assert(false && "unreachable"); @@ -15073,7 +15079,7 @@ parse_conditional(pm_parser_t *parser, pm_context_t context, size_t opening_newl pm_accepts_block_stack_pop(parser); accept2(parser, PM_TOKEN_NEWLINE, PM_TOKEN_SEMICOLON); - pm_node_t *elsif = (pm_node_t *) pm_if_node_create(parser, &elsif_keyword, predicate, &then_keyword, statements, NULL, &end_keyword); + pm_node_t *elsif = UP(pm_if_node_create(parser, &elsif_keyword, predicate, &then_keyword, statements, NULL, &end_keyword)); ((pm_if_node_t *) current)->subsequent = elsif; current = elsif; } @@ -15098,7 +15104,7 @@ parse_conditional(pm_parser_t *parser, pm_context_t context, size_t opening_newl switch (context) { case PM_CONTEXT_IF: - ((pm_if_node_t *) current)->subsequent = (pm_node_t *) else_node; + ((pm_if_node_t *) current)->subsequent = UP(else_node); break; case PM_CONTEXT_UNLESS: ((pm_unless_node_t *) parent)->else_clause = else_node; @@ -15256,7 +15262,7 @@ parse_string_part(pm_parser_t *parser, uint16_t depth) { pm_token_t opening = not_provided(parser); pm_token_t closing = not_provided(parser); - pm_node_t *node = (pm_node_t *) pm_string_node_create_current_string(parser, &opening, &parser->current, &closing); + pm_node_t *node = UP(pm_string_node_create_current_string(parser, &opening, &parser->current, &closing)); pm_node_flag_set(node, parse_unescaped_encoding(parser)); parser_lex(parser); @@ -15302,7 +15308,7 @@ parse_string_part(pm_parser_t *parser, uint16_t depth) { pm_node_flag_unset(statements->body.nodes[0], PM_NODE_FLAG_NEWLINE); } - return (pm_node_t *) pm_embedded_statements_node_create(parser, &opening, statements, &closing); + return UP(pm_embedded_statements_node_create(parser, &opening, statements, &closing)); } // Here the lexer has returned the beginning of an embedded variable. @@ -15327,42 +15333,42 @@ parse_string_part(pm_parser_t *parser, uint16_t depth) { // create a global variable read node. case PM_TOKEN_BACK_REFERENCE: parser_lex(parser); - variable = (pm_node_t *) pm_back_reference_read_node_create(parser, &parser->previous); + variable = UP(pm_back_reference_read_node_create(parser, &parser->previous)); break; // In this case an nth reference is being interpolated. We'll // create a global variable read node. case PM_TOKEN_NUMBERED_REFERENCE: parser_lex(parser); - variable = (pm_node_t *) pm_numbered_reference_read_node_create(parser, &parser->previous); + variable = UP(pm_numbered_reference_read_node_create(parser, &parser->previous)); break; // In this case a global variable is being interpolated. We'll // create a global variable read node. case PM_TOKEN_GLOBAL_VARIABLE: parser_lex(parser); - variable = (pm_node_t *) pm_global_variable_read_node_create(parser, &parser->previous); + variable = UP(pm_global_variable_read_node_create(parser, &parser->previous)); break; // In this case an instance variable is being interpolated. // We'll create an instance variable read node. case PM_TOKEN_INSTANCE_VARIABLE: parser_lex(parser); - variable = (pm_node_t *) pm_instance_variable_read_node_create(parser, &parser->previous); + variable = UP(pm_instance_variable_read_node_create(parser, &parser->previous)); break; // In this case a class variable is being interpolated. We'll // create a class variable read node. case PM_TOKEN_CLASS_VARIABLE: parser_lex(parser); - variable = (pm_node_t *) pm_class_variable_read_node_create(parser, &parser->previous); + variable = UP(pm_class_variable_read_node_create(parser, &parser->previous)); break; // We can hit here if we got an invalid token. In that case // we'll not attempt to lex this token and instead just return a // missing node. default: expect1(parser, PM_TOKEN_IDENTIFIER, PM_ERR_EMBVAR_INVALID); - variable = (pm_node_t *) pm_missing_node_create(parser, parser->current.start, parser->current.end); + variable = UP(pm_missing_node_create(parser, parser->current.start, parser->current.end)); break; } - return (pm_node_t *) pm_embedded_variable_node_create(parser, &operator, variable); + return UP(pm_embedded_variable_node_create(parser, &operator, variable)); } default: parser_lex(parser); @@ -15399,9 +15405,9 @@ parse_operator_symbol(pm_parser_t *parser, const pm_token_t *opening, pm_lex_sta parser_lex(parser); pm_string_shared_init(&symbol->unescaped, parser->previous.start, end); - pm_node_flag_set((pm_node_t *) symbol, PM_SYMBOL_FLAGS_FORCED_US_ASCII_ENCODING); + pm_node_flag_set(UP(symbol), PM_SYMBOL_FLAGS_FORCED_US_ASCII_ENCODING); - return (pm_node_t *) symbol; + return UP(symbol); } /** @@ -15439,9 +15445,9 @@ parse_symbol(pm_parser_t *parser, pm_lex_mode_t *lex_mode, pm_lex_state_t next_s pm_symbol_node_t *symbol = pm_symbol_node_create(parser, &opening, &parser->previous, &closing); pm_string_shared_init(&symbol->unescaped, parser->previous.start, parser->previous.end); - pm_node_flag_set((pm_node_t *) symbol, parse_symbol_encoding(parser, &parser->previous, &symbol->unescaped, false)); + pm_node_flag_set(UP(symbol), parse_symbol_encoding(parser, &parser->previous, &symbol->unescaped, false)); - return (pm_node_t *) symbol; + return UP(symbol); } if (lex_mode->as.string.interpolation) { @@ -15452,7 +15458,7 @@ parse_symbol(pm_parser_t *parser, pm_lex_mode_t *lex_mode, pm_lex_state_t next_s pm_token_t content = not_provided(parser); pm_token_t closing = parser->previous; - return (pm_node_t *) pm_symbol_node_create(parser, &opening, &content, &closing); + return UP(pm_symbol_node_create(parser, &opening, &content, &closing)); } // Now we can parse the first part of the symbol. @@ -15464,7 +15470,7 @@ parse_symbol(pm_parser_t *parser, pm_lex_mode_t *lex_mode, pm_lex_state_t next_s if (next_state != PM_LEX_STATE_NONE) lex_state_set(parser, next_state); expect1(parser, PM_TOKEN_STRING_END, PM_ERR_SYMBOL_TERM_INTERPOLATED); - return (pm_node_t *) pm_string_node_to_symbol_node(parser, (pm_string_node_t *) part, &opening, &parser->previous); + return UP(pm_string_node_to_symbol_node(parser, (pm_string_node_t *) part, &opening, &parser->previous)); } pm_interpolated_symbol_node_t *symbol = pm_interpolated_symbol_node_create(parser, &opening, NULL, &opening); @@ -15484,7 +15490,7 @@ parse_symbol(pm_parser_t *parser, pm_lex_mode_t *lex_mode, pm_lex_state_t next_s } pm_interpolated_symbol_node_closing_loc_set(symbol, &parser->previous); - return (pm_node_t *) symbol; + return UP(symbol); } pm_token_t content; @@ -15508,10 +15514,10 @@ parse_symbol(pm_parser_t *parser, pm_lex_mode_t *lex_mode, pm_lex_state_t next_s pm_interpolated_symbol_node_t *symbol = pm_interpolated_symbol_node_create(parser, &opening, NULL, &opening); pm_token_t bounds = not_provided(parser); - pm_node_t *part = (pm_node_t *) pm_string_node_create_unescaped(parser, &bounds, &content, &bounds, &unescaped); + pm_node_t *part = UP(pm_string_node_create_unescaped(parser, &bounds, &content, &bounds, &unescaped)); pm_interpolated_symbol_node_append(symbol, part); - part = (pm_node_t *) pm_string_node_create_unescaped(parser, &bounds, &parser->current, &bounds, &parser->current_string); + part = UP(pm_string_node_create_unescaped(parser, &bounds, &parser->current, &bounds, &parser->current_string)); pm_interpolated_symbol_node_append(symbol, part); if (next_state != PM_LEX_STATE_NONE) { @@ -15522,7 +15528,7 @@ parse_symbol(pm_parser_t *parser, pm_lex_mode_t *lex_mode, pm_lex_state_t next_s expect1(parser, PM_TOKEN_STRING_END, PM_ERR_SYMBOL_TERM_DYNAMIC); pm_interpolated_symbol_node_closing_loc_set(symbol, &parser->previous); - return (pm_node_t *) symbol; + return UP(symbol); } } else { content = (pm_token_t) { .type = PM_TOKEN_STRING_CONTENT, .start = parser->previous.end, .end = parser->previous.end }; @@ -15539,7 +15545,7 @@ parse_symbol(pm_parser_t *parser, pm_lex_mode_t *lex_mode, pm_lex_state_t next_s expect1(parser, PM_TOKEN_STRING_END, PM_ERR_SYMBOL_TERM_DYNAMIC); } - return (pm_node_t *) pm_symbol_node_create_unescaped(parser, &opening, &content, &parser->previous, &unescaped, parse_symbol_encoding(parser, &content, &unescaped, false)); + return UP(pm_symbol_node_create_unescaped(parser, &opening, &content, &parser->previous, &unescaped, parse_symbol_encoding(parser, &content, &unescaped, false))); } /** @@ -15564,9 +15570,9 @@ parse_undef_argument(pm_parser_t *parser, uint16_t depth) { pm_symbol_node_t *symbol = pm_symbol_node_create(parser, &opening, &parser->previous, &closing); pm_string_shared_init(&symbol->unescaped, parser->previous.start, parser->previous.end); - pm_node_flag_set((pm_node_t *) symbol, parse_symbol_encoding(parser, &parser->previous, &symbol->unescaped, false)); + pm_node_flag_set(UP(symbol), parse_symbol_encoding(parser, &parser->previous, &symbol->unescaped, false)); - return (pm_node_t *) symbol; + return UP(symbol); } case PM_TOKEN_SYMBOL_BEGIN: { pm_lex_mode_t lex_mode = *parser->lex_modes.current; @@ -15576,7 +15582,7 @@ parse_undef_argument(pm_parser_t *parser, uint16_t depth) { } default: pm_parser_err_current(parser, PM_ERR_UNDEF_ARGUMENT); - return (pm_node_t *) pm_missing_node_create(parser, parser->current.start, parser->current.end); + return UP(pm_missing_node_create(parser, parser->current.start, parser->current.end)); } } @@ -15605,9 +15611,9 @@ parse_alias_argument(pm_parser_t *parser, bool first, uint16_t depth) { pm_symbol_node_t *symbol = pm_symbol_node_create(parser, &opening, &parser->previous, &closing); pm_string_shared_init(&symbol->unescaped, parser->previous.start, parser->previous.end); - pm_node_flag_set((pm_node_t *) symbol, parse_symbol_encoding(parser, &parser->previous, &symbol->unescaped, false)); + pm_node_flag_set(UP(symbol), parse_symbol_encoding(parser, &parser->previous, &symbol->unescaped, false)); - return (pm_node_t *) symbol; + return UP(symbol); } case PM_TOKEN_SYMBOL_BEGIN: { pm_lex_mode_t lex_mode = *parser->lex_modes.current; @@ -15617,16 +15623,16 @@ parse_alias_argument(pm_parser_t *parser, bool first, uint16_t depth) { } case PM_TOKEN_BACK_REFERENCE: parser_lex(parser); - return (pm_node_t *) pm_back_reference_read_node_create(parser, &parser->previous); + return UP(pm_back_reference_read_node_create(parser, &parser->previous)); case PM_TOKEN_NUMBERED_REFERENCE: parser_lex(parser); - return (pm_node_t *) pm_numbered_reference_read_node_create(parser, &parser->previous); + return UP(pm_numbered_reference_read_node_create(parser, &parser->previous)); case PM_TOKEN_GLOBAL_VARIABLE: parser_lex(parser); - return (pm_node_t *) pm_global_variable_read_node_create(parser, &parser->previous); + return UP(pm_global_variable_read_node_create(parser, &parser->previous)); default: pm_parser_err_current(parser, PM_ERR_ALIAS_ARGUMENT); - return (pm_node_t *) pm_missing_node_create(parser, parser->current.start, parser->current.end); + return UP(pm_missing_node_create(parser, parser->current.start, parser->current.end)); } } @@ -15641,7 +15647,7 @@ parse_variable(pm_parser_t *parser) { bool is_numbered_param = pm_token_is_numbered_parameter(parser->previous.start, parser->previous.end); if (!is_numbered_param && ((depth = pm_parser_local_depth_constant_id(parser, name_id)) != -1)) { - return (pm_node_t *) pm_local_variable_read_node_create_constant_id(parser, &parser->previous, name_id, (uint32_t) depth, false); + return UP(pm_local_variable_read_node_create_constant_id(parser, &parser->previous, name_id, (uint32_t) depth, false)); } pm_scope_t *current_scope = parser->current_scope; @@ -15660,12 +15666,12 @@ parse_variable(pm_parser_t *parser) { parser->current_scope->parameters |= PM_SCOPE_PARAMETERS_NUMBERED_FOUND; } - pm_node_t *node = (pm_node_t *) pm_local_variable_read_node_create_constant_id(parser, &parser->previous, name_id, 0, false); + pm_node_t *node = UP(pm_local_variable_read_node_create_constant_id(parser, &parser->previous, name_id, 0, false)); pm_node_list_append(¤t_scope->implicit_parameters, node); return node; } else if ((parser->version >= PM_OPTIONS_VERSION_CRUBY_3_4) && pm_token_is_it(parser->previous.start, parser->previous.end)) { - pm_node_t *node = (pm_node_t *) pm_it_local_variable_read_node_create(parser, &parser->previous); + pm_node_t *node = UP(pm_it_local_variable_read_node_create(parser, &parser->previous)); pm_node_list_append(¤t_scope->implicit_parameters, node); return node; @@ -15689,9 +15695,9 @@ parse_variable_call(pm_parser_t *parser) { } pm_call_node_t *node = pm_call_node_variable_call_create(parser, &parser->previous); - pm_node_flag_set((pm_node_t *)node, flags); + pm_node_flag_set(UP(node), flags); - return (pm_node_t *) node; + return UP(node); } /** @@ -15840,7 +15846,7 @@ parse_strings(pm_parser_t *parser, pm_node_t *current, bool accepts_label, uint1 pm_string_node_t *string = pm_string_node_create(parser, &opening, &content, &parser->previous); pm_string_shared_init(&string->unescaped, content.start, content.end); - node = (pm_node_t *) string; + node = UP(string); } else if (accept1(parser, PM_TOKEN_LABEL_END)) { // If we get here, then we have an end of a label immediately // after a start. In that case we'll create an empty symbol @@ -15849,7 +15855,7 @@ parse_strings(pm_parser_t *parser, pm_node_t *current, bool accepts_label, uint1 pm_symbol_node_t *symbol = pm_symbol_node_create(parser, &opening, &content, &parser->previous); pm_string_shared_init(&symbol->unescaped, content.start, content.end); - node = (pm_node_t *) symbol; + node = UP(symbol); if (!label_allowed) pm_parser_err_node(parser, node, PM_ERR_UNEXPECTED_LABEL); } else if (!lex_interpolation) { @@ -15882,32 +15888,32 @@ parse_strings(pm_parser_t *parser, pm_node_t *current, bool accepts_label, uint1 pm_node_list_t parts = { 0 }; pm_token_t delimiters = not_provided(parser); - pm_node_t *part = (pm_node_t *) pm_string_node_create_unescaped(parser, &delimiters, &content, &delimiters, &unescaped); + pm_node_t *part = UP(pm_string_node_create_unescaped(parser, &delimiters, &content, &delimiters, &unescaped)); pm_node_list_append(&parts, part); do { - part = (pm_node_t *) pm_string_node_create_current_string(parser, &delimiters, &parser->current, &delimiters); + part = UP(pm_string_node_create_current_string(parser, &delimiters, &parser->current, &delimiters)); pm_node_list_append(&parts, part); parser_lex(parser); } while (match1(parser, PM_TOKEN_STRING_CONTENT)); expect1(parser, PM_TOKEN_STRING_END, PM_ERR_STRING_LITERAL_EOF); - node = (pm_node_t *) pm_interpolated_string_node_create(parser, &opening, &parts, &parser->previous); + node = UP(pm_interpolated_string_node_create(parser, &opening, &parts, &parser->previous)); pm_node_list_free(&parts); } else if (accept1(parser, PM_TOKEN_LABEL_END)) { - node = (pm_node_t *) pm_symbol_node_create_unescaped(parser, &opening, &content, &parser->previous, &unescaped, parse_symbol_encoding(parser, &content, &unescaped, true)); + node = UP(pm_symbol_node_create_unescaped(parser, &opening, &content, &parser->previous, &unescaped, parse_symbol_encoding(parser, &content, &unescaped, true))); if (!label_allowed) pm_parser_err_node(parser, node, PM_ERR_UNEXPECTED_LABEL); } else if (match1(parser, PM_TOKEN_EOF)) { pm_parser_err_token(parser, &opening, PM_ERR_STRING_LITERAL_EOF); - node = (pm_node_t *) pm_string_node_create_unescaped(parser, &opening, &content, &parser->current, &unescaped); + node = UP(pm_string_node_create_unescaped(parser, &opening, &content, &parser->current, &unescaped)); } else if (accept1(parser, PM_TOKEN_STRING_END)) { - node = (pm_node_t *) pm_string_node_create_unescaped(parser, &opening, &content, &parser->previous, &unescaped); + node = UP(pm_string_node_create_unescaped(parser, &opening, &content, &parser->previous, &unescaped)); } else { PM_PARSER_ERR_TOKEN_FORMAT(parser, parser->previous, PM_ERR_STRING_LITERAL_TERM, pm_token_type_human(parser->previous.type)); parser->previous.start = parser->previous.end; parser->previous.type = PM_TOKEN_MISSING; - node = (pm_node_t *) pm_string_node_create_unescaped(parser, &opening, &content, &parser->previous, &unescaped); + node = UP(pm_string_node_create_unescaped(parser, &opening, &content, &parser->previous, &unescaped)); } } else if (match1(parser, PM_TOKEN_STRING_CONTENT)) { // In this case we've hit string content so we know the string @@ -15919,7 +15925,7 @@ parse_strings(pm_parser_t *parser, pm_node_t *current, bool accepts_label, uint1 parser_lex(parser); if (match2(parser, PM_TOKEN_STRING_END, PM_TOKEN_EOF)) { - node = (pm_node_t *) pm_string_node_create_unescaped(parser, &opening, &content, &parser->current, &unescaped); + node = UP(pm_string_node_create_unescaped(parser, &opening, &content, &parser->current, &unescaped)); pm_node_flag_set(node, parse_unescaped_encoding(parser)); // Kind of odd behavior, but basically if we have an @@ -15935,7 +15941,7 @@ parse_strings(pm_parser_t *parser, pm_node_t *current, bool accepts_label, uint1 parser->previous.type = PM_TOKEN_MISSING; } } else if (accept1(parser, PM_TOKEN_LABEL_END)) { - node = (pm_node_t *) pm_symbol_node_create_unescaped(parser, &opening, &content, &parser->previous, &unescaped, parse_symbol_encoding(parser, &content, &unescaped, true)); + node = UP(pm_symbol_node_create_unescaped(parser, &opening, &content, &parser->previous, &unescaped, parse_symbol_encoding(parser, &content, &unescaped, true))); if (!label_allowed) pm_parser_err_node(parser, node, PM_ERR_UNEXPECTED_LABEL); } else { // If we get here, then we have interpolation so we'll need @@ -15944,7 +15950,7 @@ parse_strings(pm_parser_t *parser, pm_node_t *current, bool accepts_label, uint1 pm_token_t string_opening = not_provided(parser); pm_token_t string_closing = not_provided(parser); - pm_node_t *part = (pm_node_t *) pm_string_node_create_unescaped(parser, &string_opening, &parser->previous, &string_closing, &unescaped); + pm_node_t *part = UP(pm_string_node_create_unescaped(parser, &string_opening, &parser->previous, &string_closing, &unescaped)); pm_node_flag_set(part, parse_unescaped_encoding(parser)); pm_node_list_append(&parts, part); @@ -15955,14 +15961,14 @@ parse_strings(pm_parser_t *parser, pm_node_t *current, bool accepts_label, uint1 } if (accept1(parser, PM_TOKEN_LABEL_END)) { - node = (pm_node_t *) pm_interpolated_symbol_node_create(parser, &opening, &parts, &parser->previous); + node = UP(pm_interpolated_symbol_node_create(parser, &opening, &parts, &parser->previous)); if (!label_allowed) pm_parser_err_node(parser, node, PM_ERR_UNEXPECTED_LABEL); } else if (match1(parser, PM_TOKEN_EOF)) { pm_parser_err_token(parser, &opening, PM_ERR_STRING_INTERPOLATED_TERM); - node = (pm_node_t *) pm_interpolated_string_node_create(parser, &opening, &parts, &parser->current); + node = UP(pm_interpolated_string_node_create(parser, &opening, &parts, &parser->current)); } else { expect1(parser, PM_TOKEN_STRING_END, PM_ERR_STRING_INTERPOLATED_TERM); - node = (pm_node_t *) pm_interpolated_string_node_create(parser, &opening, &parts, &parser->previous); + node = UP(pm_interpolated_string_node_create(parser, &opening, &parts, &parser->previous)); } pm_node_list_free(&parts); @@ -15981,14 +15987,14 @@ parse_strings(pm_parser_t *parser, pm_node_t *current, bool accepts_label, uint1 } if (accept1(parser, PM_TOKEN_LABEL_END)) { - node = (pm_node_t *) pm_interpolated_symbol_node_create(parser, &opening, &parts, &parser->previous); + node = UP(pm_interpolated_symbol_node_create(parser, &opening, &parts, &parser->previous)); if (!label_allowed) pm_parser_err_node(parser, node, PM_ERR_UNEXPECTED_LABEL); } else if (match1(parser, PM_TOKEN_EOF)) { pm_parser_err_token(parser, &opening, PM_ERR_STRING_INTERPOLATED_TERM); - node = (pm_node_t *) pm_interpolated_string_node_create(parser, &opening, &parts, &parser->current); + node = UP(pm_interpolated_string_node_create(parser, &opening, &parts, &parser->current)); } else { expect1(parser, PM_TOKEN_STRING_END, PM_ERR_STRING_INTERPOLATED_TERM); - node = (pm_node_t *) pm_interpolated_string_node_create(parser, &opening, &parts, &parser->previous); + node = UP(pm_interpolated_string_node_create(parser, &opening, &parts, &parser->previous)); } pm_node_list_free(&parts); @@ -16025,7 +16031,7 @@ parse_strings(pm_parser_t *parser, pm_node_t *current, bool accepts_label, uint1 pm_interpolated_string_node_t *container = pm_interpolated_string_node_create(parser, &bounds, NULL, &bounds); pm_interpolated_string_node_append(container, current); - current = (pm_node_t *) container; + current = UP(container); } pm_interpolated_string_node_append((pm_interpolated_string_node_t *) current, node); @@ -16069,7 +16075,7 @@ parse_pattern_constant_path(pm_parser_t *parser, pm_constant_id_list_t *captures while (accept1(parser, PM_TOKEN_COLON_COLON)) { pm_token_t delimiter = parser->previous; expect1(parser, PM_TOKEN_CONSTANT, PM_ERR_CONSTANT_PATH_COLON_COLON_CONSTANT); - node = (pm_node_t *) pm_constant_path_node_create(parser, node, &delimiter, &parser->previous); + node = UP(pm_constant_path_node_create(parser, node, &delimiter, &parser->previous)); } // If there is a [ or ( that follows, then this is part of a larger pattern @@ -16111,7 +16117,7 @@ parse_pattern_constant_path(pm_parser_t *parser, pm_constant_id_list_t *captures if (!inner) { // If there was no inner pattern, then we have something like Foo() or // Foo[]. In that case we'll create an array pattern with no requireds. - return (pm_node_t *) pm_array_pattern_node_constant_create(parser, node, &opening, &closing); + return UP(pm_array_pattern_node_constant_create(parser, node, &opening, &closing)); } // Now that we have the inner pattern, check to see if it's an array, find, @@ -16130,7 +16136,7 @@ parse_pattern_constant_path(pm_parser_t *parser, pm_constant_id_list_t *captures pattern_node->opening_loc = PM_LOCATION_TOKEN_VALUE(&opening); pattern_node->closing_loc = PM_LOCATION_TOKEN_VALUE(&closing); - return (pm_node_t *) pattern_node; + return UP(pattern_node); } break; @@ -16146,7 +16152,7 @@ parse_pattern_constant_path(pm_parser_t *parser, pm_constant_id_list_t *captures pattern_node->opening_loc = PM_LOCATION_TOKEN_VALUE(&opening); pattern_node->closing_loc = PM_LOCATION_TOKEN_VALUE(&closing); - return (pm_node_t *) pattern_node; + return UP(pattern_node); } break; @@ -16162,7 +16168,7 @@ parse_pattern_constant_path(pm_parser_t *parser, pm_constant_id_list_t *captures pattern_node->opening_loc = PM_LOCATION_TOKEN_VALUE(&opening); pattern_node->closing_loc = PM_LOCATION_TOKEN_VALUE(&closing); - return (pm_node_t *) pattern_node; + return UP(pattern_node); } break; @@ -16176,7 +16182,7 @@ parse_pattern_constant_path(pm_parser_t *parser, pm_constant_id_list_t *captures // attach our constant to it. pm_array_pattern_node_t *pattern_node = pm_array_pattern_node_constant_create(parser, node, &opening, &closing); pm_array_pattern_node_requireds_append(pattern_node, inner); - return (pm_node_t *) pattern_node; + return UP(pattern_node); } /** @@ -16201,12 +16207,12 @@ parse_pattern_rest(pm_parser_t *parser, pm_constant_id_list_t *captures) { } parse_pattern_capture(parser, captures, constant_id, &PM_LOCATION_TOKEN_VALUE(&identifier)); - name = (pm_node_t *) pm_local_variable_target_node_create( + name = UP(pm_local_variable_target_node_create( parser, &PM_LOCATION_TOKEN_VALUE(&identifier), constant_id, (uint32_t) (depth == -1 ? 0 : depth) - ); + )); } // Finally we can return the created node. @@ -16225,7 +16231,7 @@ parse_pattern_keyword_rest(pm_parser_t *parser, pm_constant_id_list_t *captures) pm_node_t *value = NULL; if (accept1(parser, PM_TOKEN_KEYWORD_NIL)) { - return (pm_node_t *) pm_no_keywords_parameter_node_create(parser, &operator, &parser->previous); + return UP(pm_no_keywords_parameter_node_create(parser, &operator, &parser->previous)); } if (accept1(parser, PM_TOKEN_IDENTIFIER)) { @@ -16237,15 +16243,15 @@ parse_pattern_keyword_rest(pm_parser_t *parser, pm_constant_id_list_t *captures) } parse_pattern_capture(parser, captures, constant_id, &PM_LOCATION_TOKEN_VALUE(&parser->previous)); - value = (pm_node_t *) pm_local_variable_target_node_create( + value = UP(pm_local_variable_target_node_create( parser, &PM_LOCATION_TOKEN_VALUE(&parser->previous), constant_id, (uint32_t) (depth == -1 ? 0 : depth) - ); + )); } - return (pm_node_t *) pm_assoc_splat_node_create(parser, value, &operator); + return UP(pm_assoc_splat_node_create(parser, value, &operator)); } /** @@ -16308,7 +16314,7 @@ parse_pattern_hash_implicit_value(pm_parser_t *parser, pm_constant_id_list_t *ca (uint32_t) (depth == -1 ? 0 : depth) ); - return (pm_node_t *) pm_implicit_node_create(parser, (pm_node_t *) target); + return UP(pm_implicit_node_create(parser, UP(target))); } /** @@ -16352,7 +16358,7 @@ parse_pattern_hash(pm_parser_t *parser, pm_constant_id_list_t *captures, pm_node } pm_token_t operator = not_provided(parser); - pm_node_t *assoc = (pm_node_t *) pm_assoc_node_create(parser, first_node, &operator, value); + pm_node_t *assoc = UP(pm_assoc_node_create(parser, first_node, &operator, value)); pm_node_list_append(&assocs, assoc); break; @@ -16367,8 +16373,8 @@ parse_pattern_hash(pm_parser_t *parser, pm_constant_id_list_t *captures, pm_node pm_parser_err_node(parser, first_node, diag_id); pm_token_t operator = not_provided(parser); - pm_node_t *value = (pm_node_t *) pm_missing_node_create(parser, first_node->location.start, first_node->location.end); - pm_node_t *assoc = (pm_node_t *) pm_assoc_node_create(parser, first_node, &operator, value); + pm_node_t *value = UP(pm_missing_node_create(parser, first_node->location.start, first_node->location.end)); + pm_node_t *assoc = UP(pm_assoc_node_create(parser, first_node, &operator, value)); pm_node_list_append(&assocs, assoc); break; @@ -16409,7 +16415,7 @@ parse_pattern_hash(pm_parser_t *parser, pm_constant_id_list_t *captures, pm_node } } else { expect1(parser, PM_TOKEN_LABEL, PM_ERR_PATTERN_LABEL_AFTER_COMMA); - key = (pm_node_t *) pm_symbol_node_label_create(parser, &parser->previous); + key = UP(pm_symbol_node_label_create(parser, &parser->previous)); } parse_pattern_hash_key(parser, &keys, key); @@ -16419,14 +16425,14 @@ parse_pattern_hash(pm_parser_t *parser, pm_constant_id_list_t *captures, pm_node if (PM_NODE_TYPE_P(key, PM_SYMBOL_NODE)) { value = parse_pattern_hash_implicit_value(parser, captures, (pm_symbol_node_t *) key); } else { - value = (pm_node_t *) pm_missing_node_create(parser, key->location.end, key->location.end); + value = UP(pm_missing_node_create(parser, key->location.end, key->location.end)); } } else { value = parse_pattern(parser, captures, PM_PARSE_PATTERN_SINGLE, PM_ERR_PATTERN_EXPRESSION_AFTER_KEY, (uint16_t) (depth + 1)); } pm_token_t operator = not_provided(parser); - pm_node_t *assoc = (pm_node_t *) pm_assoc_node_create(parser, key, &operator, value); + pm_node_t *assoc = UP(pm_assoc_node_create(parser, key, &operator, value)); if (rest != NULL) { pm_parser_err_node(parser, assoc, PM_ERR_PATTERN_EXPRESSION_AFTER_REST); @@ -16460,12 +16466,12 @@ parse_pattern_primitive(pm_parser_t *parser, pm_constant_id_list_t *captures, pm } parse_pattern_capture(parser, captures, constant_id, &PM_LOCATION_TOKEN_VALUE(&parser->previous)); - return (pm_node_t *) pm_local_variable_target_node_create( + return UP(pm_local_variable_target_node_create( parser, &PM_LOCATION_TOKEN_VALUE(&parser->previous), constant_id, (uint32_t) (depth == -1 ? 0 : depth) - ); + )); } case PM_TOKEN_BRACKET_LEFT_ARRAY: { pm_token_t opening = parser->current; @@ -16474,7 +16480,7 @@ parse_pattern_primitive(pm_parser_t *parser, pm_constant_id_list_t *captures, pm if (accept1(parser, PM_TOKEN_BRACKET_RIGHT)) { // If we have an empty array pattern, then we'll just return a new // array pattern node. - return (pm_node_t *) pm_array_pattern_node_empty_create(parser, &opening, &parser->previous); + return UP(pm_array_pattern_node_empty_create(parser, &opening, &parser->previous)); } // Otherwise, we'll parse the inner pattern, then deal with it depending @@ -16495,7 +16501,7 @@ parse_pattern_primitive(pm_parser_t *parser, pm_constant_id_list_t *captures, pm pattern_node->opening_loc = PM_LOCATION_TOKEN_VALUE(&opening); pattern_node->closing_loc = PM_LOCATION_TOKEN_VALUE(&closing); - return (pm_node_t *) pattern_node; + return UP(pattern_node); } break; @@ -16509,7 +16515,7 @@ parse_pattern_primitive(pm_parser_t *parser, pm_constant_id_list_t *captures, pm pattern_node->opening_loc = PM_LOCATION_TOKEN_VALUE(&opening); pattern_node->closing_loc = PM_LOCATION_TOKEN_VALUE(&closing); - return (pm_node_t *) pattern_node; + return UP(pattern_node); } break; @@ -16520,7 +16526,7 @@ parse_pattern_primitive(pm_parser_t *parser, pm_constant_id_list_t *captures, pm pm_array_pattern_node_t *node = pm_array_pattern_node_empty_create(parser, &opening, &closing); pm_array_pattern_node_requireds_append(node, inner); - return (pm_node_t *) node; + return UP(node); } case PM_TOKEN_BRACE_LEFT: { bool previous_pattern_matching_newlines = parser->pattern_matching_newlines; @@ -16540,7 +16546,7 @@ parse_pattern_primitive(pm_parser_t *parser, pm_constant_id_list_t *captures, pm switch (parser->current.type) { case PM_TOKEN_LABEL: parser_lex(parser); - first_node = (pm_node_t *) pm_symbol_node_label_create(parser, &parser->previous); + first_node = UP(pm_symbol_node_label_create(parser, &parser->previous)); break; case PM_TOKEN_USTAR_STAR: first_node = parse_pattern_keyword_rest(parser, captures); @@ -16552,7 +16558,7 @@ parse_pattern_primitive(pm_parser_t *parser, pm_constant_id_list_t *captures, pm PM_PARSER_ERR_TOKEN_FORMAT(parser, parser->current, PM_ERR_PATTERN_HASH_KEY, pm_token_type_human(parser->current.type)); parser_lex(parser); - first_node = (pm_node_t *) pm_missing_node_create(parser, parser->previous.start, parser->previous.end); + first_node = UP(pm_missing_node_create(parser, parser->previous.start, parser->previous.end)); break; } } @@ -16571,7 +16577,7 @@ parse_pattern_primitive(pm_parser_t *parser, pm_constant_id_list_t *captures, pm } parser->pattern_matching_newlines = previous_pattern_matching_newlines; - return (pm_node_t *) node; + return UP(node); } case PM_TOKEN_UDOT_DOT: case PM_TOKEN_UDOT_DOT_DOT: { @@ -16583,12 +16589,12 @@ parse_pattern_primitive(pm_parser_t *parser, pm_constant_id_list_t *captures, pm switch (parser->current.type) { case PM_CASE_PRIMITIVE: { pm_node_t *right = parse_expression(parser, PM_BINDING_POWER_MAX, false, false, PM_ERR_PATTERN_EXPRESSION_AFTER_RANGE, (uint16_t) (depth + 1)); - return (pm_node_t *) pm_range_node_create(parser, NULL, &operator, right); + return UP(pm_range_node_create(parser, NULL, &operator, right)); } default: { pm_parser_err_token(parser, &operator, PM_ERR_PATTERN_EXPRESSION_AFTER_RANGE); - pm_node_t *right = (pm_node_t *) pm_missing_node_create(parser, operator.start, operator.end); - return (pm_node_t *) pm_range_node_create(parser, NULL, &operator, right); + pm_node_t *right = UP(pm_missing_node_create(parser, operator.start, operator.end)); + return UP(pm_range_node_create(parser, NULL, &operator, right)); } } } @@ -16603,7 +16609,7 @@ parse_pattern_primitive(pm_parser_t *parser, pm_constant_id_list_t *captures, pm pm_parser_err_node(parser, node, diag_id); pm_missing_node_t *missing_node = pm_missing_node_create(parser, node->location.start, node->location.end); pm_node_destroy(parser, node); - return (pm_node_t *) missing_node; + return UP(missing_node); } // Now that we have a primitive, we need to check if it's part of a range. @@ -16616,10 +16622,10 @@ parse_pattern_primitive(pm_parser_t *parser, pm_constant_id_list_t *captures, pm switch (parser->current.type) { case PM_CASE_PRIMITIVE: { pm_node_t *right = parse_expression(parser, PM_BINDING_POWER_MAX, false, false, PM_ERR_PATTERN_EXPRESSION_AFTER_RANGE, (uint16_t) (depth + 1)); - return (pm_node_t *) pm_range_node_create(parser, node, &operator, right); + return UP(pm_range_node_create(parser, node, &operator, right)); } default: - return (pm_node_t *) pm_range_node_create(parser, node, &operator, NULL); + return UP(pm_range_node_create(parser, node, &operator, NULL)); } } @@ -16634,44 +16640,44 @@ parse_pattern_primitive(pm_parser_t *parser, pm_constant_id_list_t *captures, pm switch (parser->current.type) { case PM_TOKEN_IDENTIFIER: { parser_lex(parser); - pm_node_t *variable = (pm_node_t *) parse_variable(parser); + pm_node_t *variable = UP(parse_variable(parser)); if (variable == NULL) { PM_PARSER_ERR_TOKEN_FORMAT_CONTENT(parser, parser->previous, PM_ERR_NO_LOCAL_VARIABLE); - variable = (pm_node_t *) pm_local_variable_read_node_missing_create(parser, &parser->previous, 0); + variable = UP(pm_local_variable_read_node_missing_create(parser, &parser->previous, 0)); } - return (pm_node_t *) pm_pinned_variable_node_create(parser, &operator, variable); + return UP(pm_pinned_variable_node_create(parser, &operator, variable)); } case PM_TOKEN_INSTANCE_VARIABLE: { parser_lex(parser); - pm_node_t *variable = (pm_node_t *) pm_instance_variable_read_node_create(parser, &parser->previous); + pm_node_t *variable = UP(pm_instance_variable_read_node_create(parser, &parser->previous)); - return (pm_node_t *) pm_pinned_variable_node_create(parser, &operator, variable); + return UP(pm_pinned_variable_node_create(parser, &operator, variable)); } case PM_TOKEN_CLASS_VARIABLE: { parser_lex(parser); - pm_node_t *variable = (pm_node_t *) pm_class_variable_read_node_create(parser, &parser->previous); + pm_node_t *variable = UP(pm_class_variable_read_node_create(parser, &parser->previous)); - return (pm_node_t *) pm_pinned_variable_node_create(parser, &operator, variable); + return UP(pm_pinned_variable_node_create(parser, &operator, variable)); } case PM_TOKEN_GLOBAL_VARIABLE: { parser_lex(parser); - pm_node_t *variable = (pm_node_t *) pm_global_variable_read_node_create(parser, &parser->previous); + pm_node_t *variable = UP(pm_global_variable_read_node_create(parser, &parser->previous)); - return (pm_node_t *) pm_pinned_variable_node_create(parser, &operator, variable); + return UP(pm_pinned_variable_node_create(parser, &operator, variable)); } case PM_TOKEN_NUMBERED_REFERENCE: { parser_lex(parser); - pm_node_t *variable = (pm_node_t *) pm_numbered_reference_read_node_create(parser, &parser->previous); + pm_node_t *variable = UP(pm_numbered_reference_read_node_create(parser, &parser->previous)); - return (pm_node_t *) pm_pinned_variable_node_create(parser, &operator, variable); + return UP(pm_pinned_variable_node_create(parser, &operator, variable)); } case PM_TOKEN_BACK_REFERENCE: { parser_lex(parser); - pm_node_t *variable = (pm_node_t *) pm_back_reference_read_node_create(parser, &parser->previous); + pm_node_t *variable = UP(pm_back_reference_read_node_create(parser, &parser->previous)); - return (pm_node_t *) pm_pinned_variable_node_create(parser, &operator, variable); + return UP(pm_pinned_variable_node_create(parser, &operator, variable)); } case PM_TOKEN_PARENTHESIS_LEFT: { bool previous_pattern_matching_newlines = parser->pattern_matching_newlines; @@ -16685,14 +16691,14 @@ parse_pattern_primitive(pm_parser_t *parser, pm_constant_id_list_t *captures, pm accept1(parser, PM_TOKEN_NEWLINE); expect1(parser, PM_TOKEN_PARENTHESIS_RIGHT, PM_ERR_PATTERN_TERM_PAREN); - return (pm_node_t *) pm_pinned_expression_node_create(parser, expression, &operator, &lparen, &parser->previous); + return UP(pm_pinned_expression_node_create(parser, expression, &operator, &lparen, &parser->previous)); } default: { // If we get here, then we have a pin operator followed by something // not understood. We'll create a missing node and return that. pm_parser_err_token(parser, &operator, PM_ERR_PATTERN_EXPRESSION_AFTER_PIN); - pm_node_t *variable = (pm_node_t *) pm_missing_node_create(parser, operator.start, operator.end); - return (pm_node_t *) pm_pinned_variable_node_create(parser, &operator, variable); + pm_node_t *variable = UP(pm_missing_node_create(parser, operator.start, operator.end)); + return UP(pm_pinned_variable_node_create(parser, &operator, variable)); } } } @@ -16703,18 +16709,18 @@ parse_pattern_primitive(pm_parser_t *parser, pm_constant_id_list_t *captures, pm expect1(parser, PM_TOKEN_CONSTANT, PM_ERR_CONSTANT_PATH_COLON_COLON_CONSTANT); pm_constant_path_node_t *node = pm_constant_path_node_create(parser, NULL, &delimiter, &parser->previous); - return parse_pattern_constant_path(parser, captures, (pm_node_t *) node, (uint16_t) (depth + 1)); + return parse_pattern_constant_path(parser, captures, UP(node), (uint16_t) (depth + 1)); } case PM_TOKEN_CONSTANT: { pm_token_t constant = parser->current; parser_lex(parser); - pm_node_t *node = (pm_node_t *) pm_constant_read_node_create(parser, &constant); + pm_node_t *node = UP(pm_constant_read_node_create(parser, &constant)); return parse_pattern_constant_path(parser, captures, node, (uint16_t) (depth + 1)); } default: pm_parser_err_current(parser, diag_id); - return (pm_node_t *) pm_missing_node_create(parser, parser->current.start, parser->current.end); + return UP(pm_missing_node_create(parser, parser->current.start, parser->current.end)); } } @@ -16769,7 +16775,7 @@ parse_pattern_primitives(pm_parser_t *parser, pm_constant_id_list_t *captures, p pm_node_t *right = parse_pattern_primitive(parser, captures, PM_ERR_PATTERN_EXPRESSION_AFTER_PIPE, (uint16_t) (depth + 1)); if (captures->size) parse_pattern_alternation_error(parser, right); - node = (pm_node_t *) pm_alternation_pattern_node_create(parser, node, right, &operator); + node = UP(pm_alternation_pattern_node_create(parser, node, right, &operator)); } break; @@ -16783,26 +16789,26 @@ parse_pattern_primitives(pm_parser_t *parser, pm_constant_id_list_t *captures, p pm_node_t *body = parse_pattern(parser, captures, PM_PARSE_PATTERN_SINGLE, PM_ERR_PATTERN_EXPRESSION_AFTER_PAREN, (uint16_t) (depth + 1)); accept1(parser, PM_TOKEN_NEWLINE); expect1(parser, PM_TOKEN_PARENTHESIS_RIGHT, PM_ERR_PATTERN_TERM_PAREN); - pm_node_t *right = (pm_node_t *) pm_parentheses_node_create(parser, &opening, body, &parser->previous, 0); + pm_node_t *right = UP(pm_parentheses_node_create(parser, &opening, body, &parser->previous, 0)); if (!alternation) { node = right; } else { if (captures->size) parse_pattern_alternation_error(parser, right); - node = (pm_node_t *) pm_alternation_pattern_node_create(parser, node, right, &operator); + node = UP(pm_alternation_pattern_node_create(parser, node, right, &operator)); } break; } default: { pm_parser_err_current(parser, diag_id); - pm_node_t *right = (pm_node_t *) pm_missing_node_create(parser, parser->current.start, parser->current.end); + pm_node_t *right = UP(pm_missing_node_create(parser, parser->current.start, parser->current.end)); if (!alternation) { node = right; } else { if (captures->size) parse_pattern_alternation_error(parser, right); - node = (pm_node_t *) pm_alternation_pattern_node_create(parser, node, right, &parser->previous); + node = UP(pm_alternation_pattern_node_create(parser, node, right, &parser->previous)); } break; @@ -16831,7 +16837,7 @@ parse_pattern_primitives(pm_parser_t *parser, pm_constant_id_list_t *captures, p (uint32_t) (depth == -1 ? 0 : depth) ); - node = (pm_node_t *) pm_capture_pattern_node_create(parser, node, target, &operator); + node = UP(pm_capture_pattern_node_create(parser, node, target, &operator)); } return node; @@ -16850,8 +16856,8 @@ parse_pattern(pm_parser_t *parser, pm_constant_id_list_t *captures, uint8_t flag switch (parser->current.type) { case PM_TOKEN_LABEL: { parser_lex(parser); - pm_node_t *key = (pm_node_t *) pm_symbol_node_label_create(parser, &parser->previous); - node = (pm_node_t *) parse_pattern_hash(parser, captures, key, (uint16_t) (depth + 1)); + pm_node_t *key = UP(pm_symbol_node_label_create(parser, &parser->previous)); + node = UP(parse_pattern_hash(parser, captures, key, (uint16_t) (depth + 1))); if (!(flags & PM_PARSE_PATTERN_TOP)) { pm_parser_err_node(parser, node, PM_ERR_PATTERN_HASH_IMPLICIT); @@ -16861,7 +16867,7 @@ parse_pattern(pm_parser_t *parser, pm_constant_id_list_t *captures, uint8_t flag } case PM_TOKEN_USTAR_STAR: { node = parse_pattern_keyword_rest(parser, captures); - node = (pm_node_t *) parse_pattern_hash(parser, captures, node, (uint16_t) (depth + 1)); + node = UP(parse_pattern_hash(parser, captures, node, (uint16_t) (depth + 1))); if (!(flags & PM_PARSE_PATTERN_TOP)) { pm_parser_err_node(parser, node, PM_ERR_PATTERN_HASH_IMPLICIT); @@ -16875,7 +16881,7 @@ parse_pattern(pm_parser_t *parser, pm_constant_id_list_t *captures, uint8_t flag node = parse_pattern_primitive(parser, captures, diag_id, (uint16_t) (depth + 1)); if (pm_symbol_node_label_p(node)) { - node = (pm_node_t *) parse_pattern_hash(parser, captures, node, (uint16_t) (depth + 1)); + node = UP(parse_pattern_hash(parser, captures, node, (uint16_t) (depth + 1))); if (!(flags & PM_PARSE_PATTERN_TOP)) { pm_parser_err_node(parser, node, PM_ERR_PATTERN_HASH_IMPLICIT); @@ -16890,7 +16896,7 @@ parse_pattern(pm_parser_t *parser, pm_constant_id_list_t *captures, uint8_t flag case PM_TOKEN_USTAR: { if (flags & (PM_PARSE_PATTERN_TOP | PM_PARSE_PATTERN_MULTI)) { parser_lex(parser); - node = (pm_node_t *) parse_pattern_rest(parser, captures); + node = UP(parse_pattern_rest(parser, captures)); leading_rest = true; break; } @@ -16904,7 +16910,7 @@ parse_pattern(pm_parser_t *parser, pm_constant_id_list_t *captures, uint8_t flag // If we got a dynamic label symbol, then we need to treat it like the // beginning of a hash pattern. if (pm_symbol_node_label_p(node)) { - return (pm_node_t *) parse_pattern_hash(parser, captures, node, (uint16_t) (depth + 1)); + return UP(parse_pattern_hash(parser, captures, node, (uint16_t) (depth + 1))); } if ((flags & PM_PARSE_PATTERN_MULTI) && match1(parser, PM_TOKEN_COMMA)) { @@ -16918,14 +16924,14 @@ parse_pattern(pm_parser_t *parser, pm_constant_id_list_t *captures, uint8_t flag while (accept1(parser, PM_TOKEN_COMMA)) { // Break early here in case we have a trailing comma. if (match7(parser, PM_TOKEN_KEYWORD_THEN, PM_TOKEN_BRACE_RIGHT, PM_TOKEN_BRACKET_RIGHT, PM_TOKEN_PARENTHESIS_RIGHT, PM_TOKEN_SEMICOLON, PM_TOKEN_KEYWORD_AND, PM_TOKEN_KEYWORD_OR)) { - node = (pm_node_t *) pm_implicit_rest_node_create(parser, &parser->previous); + node = UP(pm_implicit_rest_node_create(parser, &parser->previous)); pm_node_list_append(&nodes, node); trailing_rest = true; break; } if (accept1(parser, PM_TOKEN_USTAR)) { - node = (pm_node_t *) parse_pattern_rest(parser, captures); + node = UP(parse_pattern_rest(parser, captures)); // If we have already parsed a splat pattern, then this is an // error. We will continue to parse the rest of the patterns, @@ -16947,13 +16953,13 @@ parse_pattern(pm_parser_t *parser, pm_constant_id_list_t *captures, uint8_t flag // are in between because we know we already added the appropriate // errors. Otherwise we will create an array pattern. if (leading_rest && PM_NODE_TYPE_P(nodes.nodes[nodes.size - 1], PM_SPLAT_NODE)) { - node = (pm_node_t *) pm_find_pattern_node_create(parser, &nodes); + node = UP(pm_find_pattern_node_create(parser, &nodes)); if (nodes.size == 2) { pm_parser_err_node(parser, node, PM_ERR_PATTERN_FIND_MISSING_INNER); } } else { - node = (pm_node_t *) pm_array_pattern_node_node_list_create(parser, &nodes); + node = UP(pm_array_pattern_node_node_list_create(parser, &nodes)); if (leading_rest && trailing_rest) { pm_parser_err_node(parser, node, PM_ERR_PATTERN_ARRAY_MULTIPLE_RESTS); @@ -16964,7 +16970,7 @@ parse_pattern(pm_parser_t *parser, pm_constant_id_list_t *captures, uint8_t flag } else if (leading_rest) { // Otherwise, if we parsed a single splat pattern, then we know we have // an array pattern, so we can go ahead and create that node. - node = (pm_node_t *) pm_array_pattern_node_rest_create(parser, node); + node = UP(pm_array_pattern_node_rest_create(parser, node)); } return node; @@ -17342,13 +17348,13 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b expression = parse_value_expression(parser, PM_BINDING_POWER_DEFINED, false, false, PM_ERR_ARRAY_EXPRESSION_AFTER_STAR, (uint16_t) (depth + 1)); } - element = (pm_node_t *) pm_splat_node_create(parser, &operator, expression); + element = UP(pm_splat_node_create(parser, &operator, expression)); } else if (match2(parser, PM_TOKEN_LABEL, PM_TOKEN_USTAR_STAR)) { if (parsed_bare_hash) { pm_parser_err_current(parser, PM_ERR_EXPRESSION_BARE_HASH); } - element = (pm_node_t *) pm_keyword_hash_node_create(parser); + element = UP(pm_keyword_hash_node_create(parser)); pm_static_literals_t hash_keys = { 0 }; if (!match8(parser, PM_TOKEN_EOF, PM_TOKEN_NEWLINE, PM_TOKEN_SEMICOLON, PM_TOKEN_EOF, PM_TOKEN_BRACE_RIGHT, PM_TOKEN_BRACKET_RIGHT, PM_TOKEN_KEYWORD_DO, PM_TOKEN_PARENTHESIS_RIGHT)) { @@ -17377,10 +17383,10 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b } pm_node_t *value = parse_value_expression(parser, PM_BINDING_POWER_DEFINED, false, false, PM_ERR_HASH_VALUE, (uint16_t) (depth + 1)); - pm_node_t *assoc = (pm_node_t *) pm_assoc_node_create(parser, element, &operator, value); + pm_node_t *assoc = UP(pm_assoc_node_create(parser, element, &operator, value)); pm_keyword_hash_node_elements_append(hash, assoc); - element = (pm_node_t *) hash; + element = UP(hash); if (accept1(parser, PM_TOKEN_COMMA) && !match1(parser, PM_TOKEN_BRACKET_RIGHT)) { parse_assocs(parser, &hash_keys, element, (uint16_t) (depth + 1)); } @@ -17405,7 +17411,7 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b pm_array_node_close_set(array, &parser->previous); pm_accepts_block_stack_pop(parser); - return (pm_node_t *) array; + return UP(array); } case PM_TOKEN_PARENTHESIS_LEFT: case PM_TOKEN_PARENTHESIS_LEFT_PARENTHESES: { @@ -17432,7 +17438,7 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b pop_block_exits(parser, previous_block_exits); pm_node_list_free(¤t_block_exits); - return (pm_node_t *) pm_parentheses_node_create(parser, &opening, NULL, &parser->previous, flags); + return UP(pm_parentheses_node_create(parser, &opening, NULL, &parser->previous, flags)); } // Otherwise, we're going to parse the first statement in the list @@ -17501,10 +17507,10 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b pm_node_t *result; if (match1(parser, PM_TOKEN_COMMA) && (binding_power == PM_BINDING_POWER_STATEMENT)) { - result = parse_targets(parser, (pm_node_t *) multi_target, PM_BINDING_POWER_INDEX, (uint16_t) (depth + 1)); + result = parse_targets(parser, UP(multi_target), PM_BINDING_POWER_INDEX, (uint16_t) (depth + 1)); accept1(parser, PM_TOKEN_NEWLINE); } else { - result = (pm_node_t *) multi_target; + result = UP(multi_target); } if (context_p(parser, PM_CONTEXT_MULTI_TARGET)) { @@ -17533,7 +17539,7 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b pm_statements_node_t *statements = pm_statements_node_create(parser); pm_statements_node_body_append(parser, statements, statement, true); - return (pm_node_t *) pm_parentheses_node_create(parser, &opening, (pm_node_t *) statements, &parser->previous, flags); + return UP(pm_parentheses_node_create(parser, &opening, UP(statements), &parser->previous, flags)); } // If we have more than one statement in the set of parentheses, @@ -17598,16 +17604,16 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b pm_multi_target_node_t *multi_target = pm_multi_target_node_create(parser); pm_multi_target_node_targets_append(parser, multi_target, statement); - statement = (pm_node_t *) multi_target; + statement = UP(multi_target); statements->body.nodes[statements->body.size - 1] = statement; } if (PM_NODE_TYPE_P(statement, PM_MULTI_TARGET_NODE)) { const uint8_t *offset = statement->location.end; pm_token_t operator = { .type = PM_TOKEN_EQUAL, .start = offset, .end = offset }; - pm_node_t *value = (pm_node_t *) pm_missing_node_create(parser, offset, offset); + pm_node_t *value = UP(pm_missing_node_create(parser, offset, offset)); - statement = (pm_node_t *) pm_multi_write_node_create(parser, (pm_multi_target_node_t *) statement, &operator, value); + statement = UP(pm_multi_write_node_create(parser, (pm_multi_target_node_t *) statement, &operator, value)); statements->body.nodes[statements->body.size - 1] = statement; pm_parser_err_node(parser, statement, PM_ERR_WRITE_TARGET_UNEXPECTED); @@ -17618,7 +17624,7 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b pm_node_list_free(¤t_block_exits); pm_void_statements_check(parser, statements, true); - return (pm_node_t *) pm_parentheses_node_create(parser, &opening, (pm_node_t *) statements, &parser->previous, flags); + return UP(pm_parentheses_node_create(parser, &opening, UP(statements), &parser->previous, flags)); } case PM_TOKEN_BRACE_LEFT: { // If we were passed a current_hash_keys via the parser, then that @@ -17638,10 +17644,10 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b if (!match2(parser, PM_TOKEN_BRACE_RIGHT, PM_TOKEN_EOF)) { if (current_hash_keys != NULL) { - parse_assocs(parser, current_hash_keys, (pm_node_t *) node, (uint16_t) (depth + 1)); + parse_assocs(parser, current_hash_keys, UP(node), (uint16_t) (depth + 1)); } else { pm_static_literals_t hash_keys = { 0 }; - parse_assocs(parser, &hash_keys, (pm_node_t *) node, (uint16_t) (depth + 1)); + parse_assocs(parser, &hash_keys, UP(node), (uint16_t) (depth + 1)); pm_static_literals_free(&hash_keys); } @@ -17652,11 +17658,11 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b expect1(parser, PM_TOKEN_BRACE_RIGHT, PM_ERR_HASH_TERM); pm_hash_node_closing_loc_set(node, &parser->previous); - return (pm_node_t *) node; + return UP(node); } case PM_TOKEN_CHARACTER_LITERAL: { pm_token_t closing = not_provided(parser); - pm_node_t *node = (pm_node_t *) pm_string_node_create_current_string( + pm_node_t *node = UP(pm_string_node_create_current_string( parser, &(pm_token_t) { .type = PM_TOKEN_STRING_BEGIN, @@ -17669,7 +17675,7 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b .end = parser->current.end }, &closing - ); + )); pm_node_flag_set(node, parse_unescaped_encoding(parser)); @@ -17687,7 +17693,7 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b } case PM_TOKEN_CLASS_VARIABLE: { parser_lex(parser); - pm_node_t *node = (pm_node_t *) pm_class_variable_read_node_create(parser, &parser->previous); + pm_node_t *node = UP(pm_class_variable_read_node_create(parser, &parser->previous)); if (binding_power == PM_BINDING_POWER_STATEMENT && match1(parser, PM_TOKEN_COMMA)) { node = parse_targets_validate(parser, node, PM_BINDING_POWER_INDEX, (uint16_t) (depth + 1)); @@ -17709,10 +17715,10 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b ) { pm_arguments_t arguments = { 0 }; parse_arguments_list(parser, &arguments, true, accepts_command_call, (uint16_t) (depth + 1)); - return (pm_node_t *) pm_call_node_fcall_create(parser, &constant, &arguments); + return UP(pm_call_node_fcall_create(parser, &constant, &arguments)); } - pm_node_t *node = (pm_node_t *) pm_constant_read_node_create(parser, &parser->previous); + pm_node_t *node = UP(pm_constant_read_node_create(parser, &parser->previous)); if ((binding_power == PM_BINDING_POWER_STATEMENT) && match1(parser, PM_TOKEN_COMMA)) { // If we get here, then we have a comma immediately following a @@ -17727,7 +17733,7 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b pm_token_t delimiter = parser->previous; expect1(parser, PM_TOKEN_CONSTANT, PM_ERR_CONSTANT_PATH_COLON_COLON_CONSTANT); - pm_node_t *node = (pm_node_t *) pm_constant_path_node_create(parser, NULL, &delimiter, &parser->previous); + pm_node_t *node = UP(pm_constant_path_node_create(parser, NULL, &delimiter, &parser->previous)); if ((binding_power == PM_BINDING_POWER_STATEMENT) && match1(parser, PM_TOKEN_COMMA)) { node = parse_targets_validate(parser, node, PM_BINDING_POWER_INDEX, (uint16_t) (depth + 1)); @@ -17750,23 +17756,23 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b pm_parser_err_current(parser, PM_ERR_UNEXPECTED_RANGE_OPERATOR); } - return (pm_node_t *) pm_range_node_create(parser, NULL, &operator, right); + return UP(pm_range_node_create(parser, NULL, &operator, right)); } case PM_TOKEN_FLOAT: parser_lex(parser); - return (pm_node_t *) pm_float_node_create(parser, &parser->previous); + return UP(pm_float_node_create(parser, &parser->previous)); case PM_TOKEN_FLOAT_IMAGINARY: parser_lex(parser); - return (pm_node_t *) pm_float_node_imaginary_create(parser, &parser->previous); + return UP(pm_float_node_imaginary_create(parser, &parser->previous)); case PM_TOKEN_FLOAT_RATIONAL: parser_lex(parser); - return (pm_node_t *) pm_float_node_rational_create(parser, &parser->previous); + return UP(pm_float_node_rational_create(parser, &parser->previous)); case PM_TOKEN_FLOAT_RATIONAL_IMAGINARY: parser_lex(parser); - return (pm_node_t *) pm_float_node_rational_imaginary_create(parser, &parser->previous); + return UP(pm_float_node_rational_imaginary_create(parser, &parser->previous)); case PM_TOKEN_NUMBERED_REFERENCE: { parser_lex(parser); - pm_node_t *node = (pm_node_t *) pm_numbered_reference_read_node_create(parser, &parser->previous); + pm_node_t *node = UP(pm_numbered_reference_read_node_create(parser, &parser->previous)); if (binding_power == PM_BINDING_POWER_STATEMENT && match1(parser, PM_TOKEN_COMMA)) { node = parse_targets_validate(parser, node, PM_BINDING_POWER_INDEX, (uint16_t) (depth + 1)); @@ -17776,7 +17782,7 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b } case PM_TOKEN_GLOBAL_VARIABLE: { parser_lex(parser); - pm_node_t *node = (pm_node_t *) pm_global_variable_read_node_create(parser, &parser->previous); + pm_node_t *node = UP(pm_global_variable_read_node_create(parser, &parser->previous)); if (binding_power == PM_BINDING_POWER_STATEMENT && match1(parser, PM_TOKEN_COMMA)) { node = parse_targets_validate(parser, node, PM_BINDING_POWER_INDEX, (uint16_t) (depth + 1)); @@ -17786,7 +17792,7 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b } case PM_TOKEN_BACK_REFERENCE: { parser_lex(parser); - pm_node_t *node = (pm_node_t *) pm_back_reference_read_node_create(parser, &parser->previous); + pm_node_t *node = UP(pm_back_reference_read_node_create(parser, &parser->previous)); if (binding_power == PM_BINDING_POWER_STATEMENT && match1(parser, PM_TOKEN_COMMA)) { node = parse_targets_validate(parser, node, PM_BINDING_POWER_INDEX, (uint16_t) (depth + 1)); @@ -17811,7 +17817,7 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b if (parse_arguments_list(parser, &arguments, true, accepts_command_call, (uint16_t) (depth + 1))) { // Since we found arguments, we need to turn off the // variable call bit in the flags. - pm_node_flag_unset((pm_node_t *)call, PM_CALL_NODE_FLAGS_VARIABLE_CALL); + pm_node_flag_unset(UP(call), PM_CALL_NODE_FLAGS_VARIABLE_CALL); call->opening_loc = arguments.opening_loc; call->arguments = arguments.arguments; @@ -17858,7 +17864,7 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b } pm_node_destroy(parser, node); - return (pm_node_t *) fcall; + return UP(fcall); } } @@ -17890,9 +17896,9 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b pm_token_t content = parse_strings_empty_content(parser->previous.start); if (lex_mode.quote == PM_HEREDOC_QUOTE_BACKTICK) { - node = (pm_node_t *) pm_xstring_node_create_unescaped(parser, &opening, &content, &parser->previous, &PM_STRING_EMPTY); + node = UP(pm_xstring_node_create_unescaped(parser, &opening, &content, &parser->previous, &PM_STRING_EMPTY)); } else { - node = (pm_node_t *) pm_string_node_create_unescaped(parser, &opening, &content, &parser->previous, &PM_STRING_EMPTY); + node = UP(pm_string_node_create_unescaped(parser, &opening, &content, &parser->previous, &PM_STRING_EMPTY)); } node->location.end = opening.end; @@ -17903,7 +17909,7 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b // // parse_string_part handles its own errors, so there is no need // for us to add one here. - node = (pm_node_t *) pm_missing_node_create(parser, parser->previous.start, parser->previous.end); + node = UP(pm_missing_node_create(parser, parser->previous.start, parser->previous.end)); } else if (PM_NODE_TYPE_P(part, PM_STRING_NODE) && match2(parser, PM_TOKEN_HEREDOC_END, PM_TOKEN_EOF)) { // If we get here, then the part that we parsed was plain string // content and we're at the end of the heredoc, so we can return @@ -17925,7 +17931,7 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b parse_heredoc_dedent_string(&cast->unescaped, common_whitespace); } - node = (pm_node_t *) cast; + node = UP(cast); expect1_heredoc_term(parser, lex_mode.ident_start, lex_mode.ident_length); } else { // If we get here, then we have multiple parts in the heredoc, @@ -17950,7 +17956,7 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b pm_interpolated_xstring_node_closing_set(cast, &parser->previous); cast->base.location = cast->opening_loc; - node = (pm_node_t *) cast; + node = UP(cast); } else { pm_interpolated_string_node_t *cast = pm_interpolated_string_node_create(parser, &opening, &parts, &opening); pm_node_list_free(&parts); @@ -17959,7 +17965,7 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b pm_interpolated_string_node_closing_set(cast, &parser->previous); cast->base.location = cast->opening_loc; - node = (pm_node_t *) cast; + node = UP(cast); } // If this is a heredoc that is indented with a ~, then we need @@ -17984,7 +17990,7 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b } case PM_TOKEN_INSTANCE_VARIABLE: { parser_lex(parser); - pm_node_t *node = (pm_node_t *) pm_instance_variable_read_node_create(parser, &parser->previous); + pm_node_t *node = UP(pm_instance_variable_read_node_create(parser, &parser->previous)); if (binding_power == PM_BINDING_POWER_STATEMENT && match1(parser, PM_TOKEN_COMMA)) { node = parse_targets_validate(parser, node, PM_BINDING_POWER_INDEX, (uint16_t) (depth + 1)); @@ -17995,32 +18001,32 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b case PM_TOKEN_INTEGER: { pm_node_flags_t base = parser->integer_base; parser_lex(parser); - return (pm_node_t *) pm_integer_node_create(parser, base, &parser->previous); + return UP(pm_integer_node_create(parser, base, &parser->previous)); } case PM_TOKEN_INTEGER_IMAGINARY: { pm_node_flags_t base = parser->integer_base; parser_lex(parser); - return (pm_node_t *) pm_integer_node_imaginary_create(parser, base, &parser->previous); + return UP(pm_integer_node_imaginary_create(parser, base, &parser->previous)); } case PM_TOKEN_INTEGER_RATIONAL: { pm_node_flags_t base = parser->integer_base; parser_lex(parser); - return (pm_node_t *) pm_integer_node_rational_create(parser, base, &parser->previous); + return UP(pm_integer_node_rational_create(parser, base, &parser->previous)); } case PM_TOKEN_INTEGER_RATIONAL_IMAGINARY: { pm_node_flags_t base = parser->integer_base; parser_lex(parser); - return (pm_node_t *) pm_integer_node_rational_imaginary_create(parser, base, &parser->previous); + return UP(pm_integer_node_rational_imaginary_create(parser, base, &parser->previous)); } case PM_TOKEN_KEYWORD___ENCODING__: parser_lex(parser); - return (pm_node_t *) pm_source_encoding_node_create(parser, &parser->previous); + return UP(pm_source_encoding_node_create(parser, &parser->previous)); case PM_TOKEN_KEYWORD___FILE__: parser_lex(parser); - return (pm_node_t *) pm_source_file_node_create(parser, &parser->previous); + return UP(pm_source_file_node_create(parser, &parser->previous)); case PM_TOKEN_KEYWORD___LINE__: parser_lex(parser); - return (pm_node_t *) pm_source_line_node_create(parser, &parser->previous); + return UP(pm_source_line_node_create(parser, &parser->previous)); case PM_TOKEN_KEYWORD_ALIAS: { if (binding_power != PM_BINDING_POWER_STATEMENT) { pm_parser_err_current(parser, PM_ERR_STATEMENT_ALIAS); @@ -18044,7 +18050,7 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b pm_parser_err_node(parser, old_name, PM_ERR_ALIAS_ARGUMENT); } - return (pm_node_t *) pm_alias_global_variable_node_create(parser, &keyword, new_name, old_name); + return UP(pm_alias_global_variable_node_create(parser, &keyword, new_name, old_name)); } case PM_SYMBOL_NODE: case PM_INTERPOLATED_SYMBOL_NODE: { @@ -18054,7 +18060,7 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b } PRISM_FALLTHROUGH default: - return (pm_node_t *) pm_alias_method_node_create(parser, &keyword, new_name, old_name); + return UP(pm_alias_method_node_create(parser, &keyword, new_name, old_name)); } } case PM_TOKEN_KEYWORD_CASE: { @@ -18087,7 +18093,7 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b pm_node_list_free(¤t_block_exits); pm_parser_err_token(parser, &case_keyword, PM_ERR_CASE_MISSING_CONDITIONS); - return (pm_node_t *) pm_case_node_create(parser, &case_keyword, predicate, &parser->previous); + return UP(pm_case_node_create(parser, &case_keyword, predicate, &parser->previous)); } // At this point we can create a case node, though we don't yet know @@ -18115,7 +18121,7 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b pm_node_t *expression = parse_value_expression(parser, PM_BINDING_POWER_DEFINED, false, false, PM_ERR_EXPECT_EXPRESSION_AFTER_STAR, (uint16_t) (depth + 1)); pm_splat_node_t *splat_node = pm_splat_node_create(parser, &operator, expression); - pm_when_node_conditions_append(when_node, (pm_node_t *) splat_node); + pm_when_node_conditions_append(when_node, UP(splat_node)); if (PM_NODE_TYPE_P(expression, PM_MISSING_NODE)) break; } else { @@ -18154,7 +18160,7 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b } } - pm_case_node_condition_append(case_node, (pm_node_t *) when_node); + pm_case_node_condition_append(case_node, UP(when_node)); } // If we didn't parse any conditions (in or when) then we need @@ -18164,7 +18170,7 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b } pm_static_literals_free(&literals); - node = (pm_node_t *) case_node; + node = UP(case_node); } else { pm_case_match_node_t *case_node = pm_case_match_node_create(parser, &case_keyword, predicate, &end_keyword); @@ -18201,11 +18207,11 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b if (accept1(parser, PM_TOKEN_KEYWORD_IF_MODIFIER)) { pm_token_t keyword = parser->previous; pm_node_t *predicate = parse_value_expression(parser, PM_BINDING_POWER_COMPOSITION, true, false, PM_ERR_CONDITIONAL_IF_PREDICATE, (uint16_t) (depth + 1)); - pattern = (pm_node_t *) pm_if_node_modifier_create(parser, pattern, &keyword, predicate); + pattern = UP(pm_if_node_modifier_create(parser, pattern, &keyword, predicate)); } else if (accept1(parser, PM_TOKEN_KEYWORD_UNLESS_MODIFIER)) { pm_token_t keyword = parser->previous; pm_node_t *predicate = parse_value_expression(parser, PM_BINDING_POWER_COMPOSITION, true, false, PM_ERR_CONDITIONAL_UNLESS_PREDICATE, (uint16_t) (depth + 1)); - pattern = (pm_node_t *) pm_unless_node_modifier_create(parser, pattern, &keyword, predicate); + pattern = UP(pm_unless_node_modifier_create(parser, pattern, &keyword, predicate)); } // Now we need to check for the terminator of the in node's @@ -18234,7 +18240,7 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b // Now that we have the full pattern and statements, we can // create the node and attach it to the case node. - pm_node_t *condition = (pm_node_t *) pm_in_node_create(parser, pattern, statements, &in_keyword, &then_keyword); + pm_node_t *condition = UP(pm_in_node_create(parser, pattern, statements, &in_keyword, &then_keyword)); pm_case_match_node_condition_append(case_node, condition); } @@ -18244,7 +18250,7 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b pm_parser_err_token(parser, &case_keyword, PM_ERR_CASE_MISSING_CONDITIONS); } - node = (pm_node_t *) case_node; + node = UP(case_node); } accept2(parser, PM_TOKEN_NEWLINE, PM_TOKEN_SEMICOLON); @@ -18307,7 +18313,7 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b pop_block_exits(parser, previous_block_exits); pm_node_list_free(¤t_block_exits); - return (pm_node_t *) begin_node; + return UP(begin_node); } case PM_TOKEN_KEYWORD_BEGIN_UPCASE: { pm_node_list_t current_block_exits = { 0 }; @@ -18333,7 +18339,7 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b flush_block_exits(parser, previous_block_exits); pm_node_list_free(¤t_block_exits); - return (pm_node_t *) pm_pre_execution_node_create(parser, &keyword, &opening, statements, &parser->previous); + return UP(pm_pre_execution_node_create(parser, &keyword, &opening, statements, &parser->previous)); } case PM_TOKEN_KEYWORD_BREAK: case PM_TOKEN_KEYWORD_NEXT: @@ -18362,23 +18368,23 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b switch (keyword.type) { case PM_TOKEN_KEYWORD_BREAK: { - pm_node_t *node = (pm_node_t *) pm_break_node_create(parser, &keyword, arguments.arguments); + pm_node_t *node = UP(pm_break_node_create(parser, &keyword, arguments.arguments)); if (!parser->partial_script) parse_block_exit(parser, node); return node; } case PM_TOKEN_KEYWORD_NEXT: { - pm_node_t *node = (pm_node_t *) pm_next_node_create(parser, &keyword, arguments.arguments); + pm_node_t *node = UP(pm_next_node_create(parser, &keyword, arguments.arguments)); if (!parser->partial_script) parse_block_exit(parser, node); return node; } case PM_TOKEN_KEYWORD_RETURN: { - pm_node_t *node = (pm_node_t *) pm_return_node_create(parser, &keyword, arguments.arguments); + pm_node_t *node = UP(pm_return_node_create(parser, &keyword, arguments.arguments)); parse_return(parser, node); return node; } default: assert(false && "unreachable"); - return (pm_node_t *) pm_missing_node_create(parser, parser->previous.start, parser->previous.end); + return UP(pm_missing_node_create(parser, parser->previous.start, parser->previous.end)); } } case PM_TOKEN_KEYWORD_SUPER: { @@ -18393,10 +18399,10 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b arguments.arguments == NULL && ((arguments.block == NULL) || PM_NODE_TYPE_P(arguments.block, PM_BLOCK_NODE)) ) { - return (pm_node_t *) pm_forwarding_super_node_create(parser, &keyword, &arguments); + return UP(pm_forwarding_super_node_create(parser, &keyword, &arguments)); } - return (pm_node_t *) pm_super_node_create(parser, &keyword, &arguments); + return UP(pm_super_node_create(parser, &keyword, &arguments)); } case PM_TOKEN_KEYWORD_YIELD: { parser_lex(parser); @@ -18415,7 +18421,7 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b arguments.block = NULL; } - pm_node_t *node = (pm_node_t *) pm_yield_node_create(parser, &keyword, &arguments.opening_loc, arguments.arguments, &arguments.closing_loc); + pm_node_t *node = UP(pm_yield_node_create(parser, &keyword, &arguments.opening_loc, arguments.arguments, &arguments.closing_loc)); if (!parser->parsing_eval && !parser->partial_script) parse_yield(parser, node); return node; @@ -18442,13 +18448,13 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b pm_node_t *statements = NULL; if (!match4(parser, PM_TOKEN_KEYWORD_RESCUE, PM_TOKEN_KEYWORD_ENSURE, PM_TOKEN_KEYWORD_ELSE, PM_TOKEN_KEYWORD_END)) { pm_accepts_block_stack_push(parser, true); - statements = (pm_node_t *) parse_statements(parser, PM_CONTEXT_SCLASS, (uint16_t) (depth + 1)); + statements = UP(parse_statements(parser, PM_CONTEXT_SCLASS, (uint16_t) (depth + 1))); pm_accepts_block_stack_pop(parser); } if (match2(parser, PM_TOKEN_KEYWORD_RESCUE, PM_TOKEN_KEYWORD_ENSURE)) { assert(statements == NULL || PM_NODE_TYPE_P(statements, PM_STATEMENTS_NODE)); - statements = (pm_node_t *) parse_rescues_implicit_begin(parser, opening_newline_index, &class_keyword, class_keyword.start, (pm_statements_node_t *) statements, PM_RESCUES_SCLASS, (uint16_t) (depth + 1)); + statements = UP(parse_rescues_implicit_begin(parser, opening_newline_index, &class_keyword, class_keyword.start, (pm_statements_node_t *) statements, PM_RESCUES_SCLASS, (uint16_t) (depth + 1))); } else { parser_warn_indentation_mismatch(parser, opening_newline_index, &class_keyword, false, false); } @@ -18464,7 +18470,7 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b flush_block_exits(parser, previous_block_exits); pm_node_list_free(¤t_block_exits); - return (pm_node_t *) pm_singleton_class_node_create(parser, &locals, &class_keyword, &operator, expression, statements, &parser->previous); + return UP(pm_singleton_class_node_create(parser, &locals, &class_keyword, &operator, expression, statements, &parser->previous)); } pm_node_t *constant_path = parse_expression(parser, PM_BINDING_POWER_INDEX, false, false, PM_ERR_CLASS_NAME, (uint16_t) (depth + 1)); @@ -18500,13 +18506,13 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b if (!match4(parser, PM_TOKEN_KEYWORD_RESCUE, PM_TOKEN_KEYWORD_ENSURE, PM_TOKEN_KEYWORD_ELSE, PM_TOKEN_KEYWORD_END)) { pm_accepts_block_stack_push(parser, true); - statements = (pm_node_t *) parse_statements(parser, PM_CONTEXT_CLASS, (uint16_t) (depth + 1)); + statements = UP(parse_statements(parser, PM_CONTEXT_CLASS, (uint16_t) (depth + 1))); pm_accepts_block_stack_pop(parser); } if (match2(parser, PM_TOKEN_KEYWORD_RESCUE, PM_TOKEN_KEYWORD_ENSURE)) { assert(statements == NULL || PM_NODE_TYPE_P(statements, PM_STATEMENTS_NODE)); - statements = (pm_node_t *) parse_rescues_implicit_begin(parser, opening_newline_index, &class_keyword, class_keyword.start, (pm_statements_node_t *) statements, PM_RESCUES_CLASS, (uint16_t) (depth + 1)); + statements = UP(parse_rescues_implicit_begin(parser, opening_newline_index, &class_keyword, class_keyword.start, (pm_statements_node_t *) statements, PM_RESCUES_CLASS, (uint16_t) (depth + 1))); } else { parser_warn_indentation_mismatch(parser, opening_newline_index, &class_keyword, false, false); } @@ -18530,7 +18536,7 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b pop_block_exits(parser, previous_block_exits); pm_node_list_free(¤t_block_exits); - return (pm_node_t *) pm_class_node_create(parser, &locals, &class_keyword, constant_path, &name, &inheritance_operator, superclass, statements, &parser->previous); + return UP(pm_class_node_create(parser, &locals, &class_keyword, constant_path, &name, &inheritance_operator, superclass, statements, &parser->previous)); } case PM_TOKEN_KEYWORD_DEF: { pm_node_list_t current_block_exits = { 0 }; @@ -18607,37 +18613,37 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b switch (identifier.type) { case PM_TOKEN_CONSTANT: - receiver = (pm_node_t *) pm_constant_read_node_create(parser, &identifier); + receiver = UP(pm_constant_read_node_create(parser, &identifier)); break; case PM_TOKEN_INSTANCE_VARIABLE: - receiver = (pm_node_t *) pm_instance_variable_read_node_create(parser, &identifier); + receiver = UP(pm_instance_variable_read_node_create(parser, &identifier)); break; case PM_TOKEN_CLASS_VARIABLE: - receiver = (pm_node_t *) pm_class_variable_read_node_create(parser, &identifier); + receiver = UP(pm_class_variable_read_node_create(parser, &identifier)); break; case PM_TOKEN_GLOBAL_VARIABLE: - receiver = (pm_node_t *) pm_global_variable_read_node_create(parser, &identifier); + receiver = UP(pm_global_variable_read_node_create(parser, &identifier)); break; case PM_TOKEN_KEYWORD_NIL: - receiver = (pm_node_t *) pm_nil_node_create(parser, &identifier); + receiver = UP(pm_nil_node_create(parser, &identifier)); break; case PM_TOKEN_KEYWORD_SELF: - receiver = (pm_node_t *) pm_self_node_create(parser, &identifier); + receiver = UP(pm_self_node_create(parser, &identifier)); break; case PM_TOKEN_KEYWORD_TRUE: - receiver = (pm_node_t *) pm_true_node_create(parser, &identifier); + receiver = UP(pm_true_node_create(parser, &identifier)); break; case PM_TOKEN_KEYWORD_FALSE: - receiver = (pm_node_t *) pm_false_node_create(parser, &identifier); + receiver = UP(pm_false_node_create(parser, &identifier)); break; case PM_TOKEN_KEYWORD___FILE__: - receiver = (pm_node_t *) pm_source_file_node_create(parser, &identifier); + receiver = UP(pm_source_file_node_create(parser, &identifier)); break; case PM_TOKEN_KEYWORD___LINE__: - receiver = (pm_node_t *) pm_source_line_node_create(parser, &identifier); + receiver = UP(pm_source_line_node_create(parser, &identifier)); break; case PM_TOKEN_KEYWORD___ENCODING__: - receiver = (pm_node_t *) pm_source_encoding_node_create(parser, &identifier); + receiver = UP(pm_source_encoding_node_create(parser, &identifier)); break; default: break; @@ -18672,7 +18678,7 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b expect2(parser, PM_TOKEN_DOT, PM_TOKEN_COLON_COLON, PM_ERR_DEF_RECEIVER_TERM); operator = parser->previous; - receiver = (pm_node_t *) pm_parentheses_node_create(parser, &lparen, expression, &rparen, 0); + receiver = UP(pm_parentheses_node_create(parser, &lparen, expression, &rparen, 0)); // To push `PM_CONTEXT_DEF_PARAMS` again is for the same // reason as described the above. @@ -18765,7 +18771,7 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b context_push(parser, PM_CONTEXT_DEF); pm_do_loop_stack_push(parser, false); - statements = (pm_node_t *) pm_statements_node_create(parser); + statements = UP(pm_statements_node_create(parser)); bool allow_command_call; if (parser->version >= PM_OPTIONS_VERSION_CRUBY_4_0) { @@ -18784,7 +18790,7 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b pm_node_t *value = parse_expression(parser, pm_binding_powers[PM_TOKEN_KEYWORD_RESCUE_MODIFIER].right, false, false, PM_ERR_RESCUE_MODIFIER_VALUE, (uint16_t) (depth + 1)); context_pop(parser); - statement = (pm_node_t *) pm_rescue_modifier_node_create(parser, statement, &rescue_keyword, value); + statement = UP(pm_rescue_modifier_node_create(parser, statement, &rescue_keyword, value)); } pm_statements_node_body_append(parser, (pm_statements_node_t *) statements, statement, false); @@ -18807,13 +18813,13 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b if (!match4(parser, PM_TOKEN_KEYWORD_RESCUE, PM_TOKEN_KEYWORD_ENSURE, PM_TOKEN_KEYWORD_ELSE, PM_TOKEN_KEYWORD_END)) { pm_accepts_block_stack_push(parser, true); - statements = (pm_node_t *) parse_statements(parser, PM_CONTEXT_DEF, (uint16_t) (depth + 1)); + statements = UP(parse_statements(parser, PM_CONTEXT_DEF, (uint16_t) (depth + 1))); pm_accepts_block_stack_pop(parser); } if (match3(parser, PM_TOKEN_KEYWORD_RESCUE, PM_TOKEN_KEYWORD_ENSURE, PM_TOKEN_KEYWORD_ELSE)) { assert(statements == NULL || PM_NODE_TYPE_P(statements, PM_STATEMENTS_NODE)); - statements = (pm_node_t *) parse_rescues_implicit_begin(parser, opening_newline_index, &def_keyword, def_keyword.start, (pm_statements_node_t *) statements, PM_RESCUES_DEF, (uint16_t) (depth + 1)); + statements = UP(parse_rescues_implicit_begin(parser, opening_newline_index, &def_keyword, def_keyword.start, (pm_statements_node_t *) statements, PM_RESCUES_DEF, (uint16_t) (depth + 1))); } else { parser_warn_indentation_mismatch(parser, opening_newline_index, &def_keyword, false, false); } @@ -18839,7 +18845,7 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b flush_block_exits(parser, previous_block_exits); pm_node_list_free(¤t_block_exits); - return (pm_node_t *) pm_def_node_create( + return UP(pm_def_node_create( parser, name_id, &name, @@ -18853,7 +18859,7 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b &rparen, &equal, &end_keyword - ); + )); } case PM_TOKEN_KEYWORD_DEFINED: { parser_lex(parser); @@ -18870,7 +18876,7 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b lparen = parser->previous; if (newline && accept1(parser, PM_TOKEN_PARENTHESIS_RIGHT)) { - expression = (pm_node_t *) pm_parentheses_node_create(parser, &lparen, NULL, &parser->previous, 0); + expression = UP(pm_parentheses_node_create(parser, &lparen, NULL, &parser->previous, 0)); lparen = not_provided(parser); rparen = not_provided(parser); } else { @@ -18891,13 +18897,13 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b } context_pop(parser); - return (pm_node_t *) pm_defined_node_create( + return UP(pm_defined_node_create( parser, &lparen, expression, &rparen, &PM_LOCATION_TOKEN_VALUE(&keyword) - ); + )); } case PM_TOKEN_KEYWORD_END_UPCASE: { if (binding_power != PM_BINDING_POWER_STATEMENT) { @@ -18916,11 +18922,11 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b pm_statements_node_t *statements = parse_statements(parser, PM_CONTEXT_POSTEXE, (uint16_t) (depth + 1)); expect1(parser, PM_TOKEN_BRACE_RIGHT, PM_ERR_END_UPCASE_TERM); - return (pm_node_t *) pm_post_execution_node_create(parser, &keyword, &opening, statements, &parser->previous); + return UP(pm_post_execution_node_create(parser, &keyword, &opening, statements, &parser->previous)); } case PM_TOKEN_KEYWORD_FALSE: parser_lex(parser); - return (pm_node_t *) pm_false_node_create(parser, &parser->previous); + return UP(pm_false_node_create(parser, &parser->previous)); case PM_TOKEN_KEYWORD_FOR: { size_t opening_newline_index = token_newline_index(parser); parser_lex(parser); @@ -18939,12 +18945,12 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b name = parse_expression(parser, PM_BINDING_POWER_INDEX, false, false, PM_ERR_EXPECT_EXPRESSION_AFTER_STAR, (uint16_t) (depth + 1)); } - index = (pm_node_t *) pm_splat_node_create(parser, &star_operator, name); + index = UP(pm_splat_node_create(parser, &star_operator, name)); } else if (token_begins_expression_p(parser->current.type)) { index = parse_expression(parser, PM_BINDING_POWER_INDEX, false, false, PM_ERR_EXPECT_EXPRESSION_AFTER_COMMA, (uint16_t) (depth + 1)); } else { pm_parser_err_token(parser, &for_keyword, PM_ERR_FOR_INDEX); - index = (pm_node_t *) pm_missing_node_create(parser, for_keyword.start, for_keyword.end); + index = UP(pm_missing_node_create(parser, for_keyword.start, for_keyword.end)); } // Now, if there are multiple index expressions, parse them out. @@ -18981,7 +18987,7 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b parser_warn_indentation_mismatch(parser, opening_newline_index, &for_keyword, false, false); expect1(parser, PM_TOKEN_KEYWORD_END, PM_ERR_FOR_TERM); - return (pm_node_t *) pm_for_node_create(parser, index, collection, statements, &for_keyword, &in_keyword, &do_keyword, &parser->previous); + return UP(pm_for_node_create(parser, index, collection, statements, &for_keyword, &in_keyword, &do_keyword, &parser->previous)); } case PM_TOKEN_KEYWORD_IF: if (parser_end_of_line_p(parser)) { @@ -19021,7 +19027,7 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b } } - return (pm_node_t *) undef; + return UP(undef); } case PM_TOKEN_KEYWORD_NOT: { parser_lex(parser); @@ -19041,7 +19047,7 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b pm_parser_err_current(parser, PM_ERR_EXPECT_LPAREN_AFTER_NOT_OTHER); } - return (pm_node_t *) pm_missing_node_create(parser, parser->current.start, parser->current.end); + return UP(pm_missing_node_create(parser, parser->current.start, parser->current.end)); } accept1(parser, PM_TOKEN_NEWLINE); @@ -19050,7 +19056,7 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b pm_token_t lparen = parser->previous; if (accept1(parser, PM_TOKEN_PARENTHESIS_RIGHT)) { - receiver = (pm_node_t *) pm_parentheses_node_create(parser, &lparen, NULL, &parser->previous, 0); + receiver = UP(pm_parentheses_node_create(parser, &lparen, NULL, &parser->previous, 0)); } else { arguments.opening_loc = PM_LOCATION_TOKEN_VALUE(&lparen); receiver = parse_expression(parser, PM_BINDING_POWER_COMPOSITION, true, false, PM_ERR_NOT_EXPRESSION, (uint16_t) (depth + 1)); @@ -19065,7 +19071,7 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b receiver = parse_expression(parser, PM_BINDING_POWER_NOT, true, false, PM_ERR_NOT_EXPRESSION, (uint16_t) (depth + 1)); } - return (pm_node_t *) pm_call_node_not_create(parser, receiver, &message, &arguments); + return UP(pm_call_node_not_create(parser, receiver, &message, &arguments)); } case PM_TOKEN_KEYWORD_UNLESS: { size_t opening_newline_index = token_newline_index(parser); @@ -19091,14 +19097,14 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b pm_node_list_free(¤t_block_exits); pm_token_t missing = (pm_token_t) { .type = PM_TOKEN_MISSING, .start = parser->previous.end, .end = parser->previous.end }; - return (pm_node_t *) pm_module_node_create(parser, NULL, &module_keyword, constant_path, &missing, NULL, &missing); + return UP(pm_module_node_create(parser, NULL, &module_keyword, constant_path, &missing, NULL, &missing)); } while (accept1(parser, PM_TOKEN_COLON_COLON)) { pm_token_t double_colon = parser->previous; expect1(parser, PM_TOKEN_CONSTANT, PM_ERR_CONSTANT_PATH_COLON_COLON_CONSTANT); - constant_path = (pm_node_t *) pm_constant_path_node_create(parser, constant_path, &double_colon, &parser->previous); + constant_path = UP(pm_constant_path_node_create(parser, constant_path, &double_colon, &parser->previous)); } // Here we retrieve the name of the module. If it wasn't a constant, @@ -19115,13 +19121,13 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b if (!match4(parser, PM_TOKEN_KEYWORD_RESCUE, PM_TOKEN_KEYWORD_ENSURE, PM_TOKEN_KEYWORD_ELSE, PM_TOKEN_KEYWORD_END)) { pm_accepts_block_stack_push(parser, true); - statements = (pm_node_t *) parse_statements(parser, PM_CONTEXT_MODULE, (uint16_t) (depth + 1)); + statements = UP(parse_statements(parser, PM_CONTEXT_MODULE, (uint16_t) (depth + 1))); pm_accepts_block_stack_pop(parser); } if (match3(parser, PM_TOKEN_KEYWORD_RESCUE, PM_TOKEN_KEYWORD_ENSURE, PM_TOKEN_KEYWORD_ELSE)) { assert(statements == NULL || PM_NODE_TYPE_P(statements, PM_STATEMENTS_NODE)); - statements = (pm_node_t *) parse_rescues_implicit_begin(parser, opening_newline_index, &module_keyword, module_keyword.start, (pm_statements_node_t *) statements, PM_RESCUES_MODULE, (uint16_t) (depth + 1)); + statements = UP(parse_rescues_implicit_begin(parser, opening_newline_index, &module_keyword, module_keyword.start, (pm_statements_node_t *) statements, PM_RESCUES_MODULE, (uint16_t) (depth + 1))); } else { parser_warn_indentation_mismatch(parser, opening_newline_index, &module_keyword, false, false); } @@ -19139,15 +19145,15 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b pop_block_exits(parser, previous_block_exits); pm_node_list_free(¤t_block_exits); - return (pm_node_t *) pm_module_node_create(parser, &locals, &module_keyword, constant_path, &name, statements, &parser->previous); + return UP(pm_module_node_create(parser, &locals, &module_keyword, constant_path, &name, statements, &parser->previous)); } case PM_TOKEN_KEYWORD_NIL: parser_lex(parser); - return (pm_node_t *) pm_nil_node_create(parser, &parser->previous); + return UP(pm_nil_node_create(parser, &parser->previous)); case PM_TOKEN_KEYWORD_REDO: { parser_lex(parser); - pm_node_t *node = (pm_node_t *) pm_redo_node_create(parser, &parser->previous); + pm_node_t *node = UP(pm_redo_node_create(parser, &parser->previous)); if (!parser->partial_script) parse_block_exit(parser, node); return node; @@ -19155,17 +19161,17 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b case PM_TOKEN_KEYWORD_RETRY: { parser_lex(parser); - pm_node_t *node = (pm_node_t *) pm_retry_node_create(parser, &parser->previous); + pm_node_t *node = UP(pm_retry_node_create(parser, &parser->previous)); parse_retry(parser, node); return node; } case PM_TOKEN_KEYWORD_SELF: parser_lex(parser); - return (pm_node_t *) pm_self_node_create(parser, &parser->previous); + return UP(pm_self_node_create(parser, &parser->previous)); case PM_TOKEN_KEYWORD_TRUE: parser_lex(parser); - return (pm_node_t *) pm_true_node_create(parser, &parser->previous); + return UP(pm_true_node_create(parser, &parser->previous)); case PM_TOKEN_KEYWORD_UNTIL: { size_t opening_newline_index = token_newline_index(parser); @@ -19198,7 +19204,7 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b parser_warn_indentation_mismatch(parser, opening_newline_index, &keyword, false, false); expect1(parser, PM_TOKEN_KEYWORD_END, PM_ERR_UNTIL_TERM); - return (pm_node_t *) pm_until_node_create(parser, &keyword, &do_keyword, &parser->previous, predicate, statements, 0); + return UP(pm_until_node_create(parser, &keyword, &do_keyword, &parser->previous, predicate, statements, 0)); } case PM_TOKEN_KEYWORD_WHILE: { size_t opening_newline_index = token_newline_index(parser); @@ -19232,7 +19238,7 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b parser_warn_indentation_mismatch(parser, opening_newline_index, &keyword, false, false); expect1(parser, PM_TOKEN_KEYWORD_END, PM_ERR_WHILE_TERM); - return (pm_node_t *) pm_while_node_create(parser, &keyword, &do_keyword, &parser->previous, predicate, statements, 0); + return UP(pm_while_node_create(parser, &keyword, &do_keyword, &parser->previous, predicate, statements, 0)); } case PM_TOKEN_PERCENT_LOWER_I: { parser_lex(parser); @@ -19246,7 +19252,7 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b if (match1(parser, PM_TOKEN_STRING_CONTENT)) { pm_token_t opening = not_provided(parser); pm_token_t closing = not_provided(parser); - pm_array_node_elements_append(array, (pm_node_t *) pm_symbol_node_create_current_string(parser, &opening, &parser->current, &closing)); + pm_array_node_elements_append(array, UP(pm_symbol_node_create_current_string(parser, &opening, &parser->current, &closing))); } expect1(parser, PM_TOKEN_STRING_CONTENT, PM_ERR_LIST_I_LOWER_ELEMENT); @@ -19261,7 +19267,7 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b } pm_array_node_close_set(array, &closing); - return (pm_node_t *) array; + return UP(array); } case PM_TOKEN_PERCENT_UPPER_I: { parser_lex(parser); @@ -19296,13 +19302,13 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b // If we hit content and the current node is NULL, then this is // the first string content we've seen. In that case we're going // to create a new string node and set that to the current. - current = (pm_node_t *) pm_symbol_node_create_current_string(parser, &opening, &parser->current, &closing); + current = UP(pm_symbol_node_create_current_string(parser, &opening, &parser->current, &closing)); parser_lex(parser); } else if (PM_NODE_TYPE_P(current, PM_INTERPOLATED_SYMBOL_NODE)) { // If we hit string content and the current node is an // interpolated string, then we need to append the string content // to the list of child nodes. - pm_node_t *string = (pm_node_t *) pm_string_node_create_current_string(parser, &opening, &parser->current, &closing); + pm_node_t *string = UP(pm_string_node_create_current_string(parser, &opening, &parser->current, &closing)); parser_lex(parser); pm_interpolated_symbol_node_append((pm_interpolated_symbol_node_t *) current, string); @@ -19314,8 +19320,8 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b pm_token_t bounds = not_provided(parser); pm_token_t content = { .type = PM_TOKEN_STRING_CONTENT, .start = cast->value_loc.start, .end = cast->value_loc.end }; - pm_node_t *first_string = (pm_node_t *) pm_string_node_create_unescaped(parser, &bounds, &content, &bounds, &cast->unescaped); - pm_node_t *second_string = (pm_node_t *) pm_string_node_create_current_string(parser, &opening, &parser->previous, &closing); + pm_node_t *first_string = UP(pm_string_node_create_unescaped(parser, &bounds, &content, &bounds, &cast->unescaped)); + pm_node_t *second_string = UP(pm_string_node_create_current_string(parser, &opening, &parser->previous, &closing)); parser_lex(parser); pm_interpolated_symbol_node_t *interpolated = pm_interpolated_symbol_node_create(parser, &opening, NULL, &closing); @@ -19323,7 +19329,7 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b pm_interpolated_symbol_node_append(interpolated, second_string); xfree(current); - current = (pm_node_t *) interpolated; + current = UP(interpolated); } else { assert(false && "unreachable"); } @@ -19338,7 +19344,7 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b // node to a new interpolated string. pm_token_t opening = not_provided(parser); pm_token_t closing = not_provided(parser); - current = (pm_node_t *) pm_interpolated_symbol_node_create(parser, &opening, NULL, &closing); + current = UP(pm_interpolated_symbol_node_create(parser, &opening, NULL, &closing)); } else if (PM_NODE_TYPE_P(current, PM_SYMBOL_NODE)) { // If we hit an embedded variable and the current node is a string // node, then we'll convert the current into an interpolated @@ -19347,11 +19353,11 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b pm_token_t closing = not_provided(parser); pm_interpolated_symbol_node_t *interpolated = pm_interpolated_symbol_node_create(parser, &opening, NULL, &closing); - current = (pm_node_t *) pm_symbol_node_to_string_node(parser, (pm_symbol_node_t *) current); + current = UP(pm_symbol_node_to_string_node(parser, (pm_symbol_node_t *) current)); pm_interpolated_symbol_node_append(interpolated, current); interpolated->base.location.start = current->location.start; start_location_set = true; - current = (pm_node_t *) interpolated; + current = UP(interpolated); } else { // If we hit an embedded variable and the current node is an // interpolated string, then we'll just add the embedded variable. @@ -19372,7 +19378,7 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b // node to a new interpolated string. pm_token_t opening = not_provided(parser); pm_token_t closing = not_provided(parser); - current = (pm_node_t *) pm_interpolated_symbol_node_create(parser, &opening, NULL, &closing); + current = UP(pm_interpolated_symbol_node_create(parser, &opening, NULL, &closing)); } else if (PM_NODE_TYPE_P(current, PM_SYMBOL_NODE)) { // If we hit an embedded expression and the current node is a // string node, then we'll convert the current into an @@ -19382,11 +19388,11 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b pm_token_t closing = not_provided(parser); pm_interpolated_symbol_node_t *interpolated = pm_interpolated_symbol_node_create(parser, &opening, NULL, &closing); - current = (pm_node_t *) pm_symbol_node_to_string_node(parser, (pm_symbol_node_t *) current); + current = UP(pm_symbol_node_to_string_node(parser, (pm_symbol_node_t *) current)); pm_interpolated_symbol_node_append(interpolated, current); interpolated->base.location.start = current->location.start; start_location_set = true; - current = (pm_node_t *) interpolated; + current = UP(interpolated); } else if (PM_NODE_TYPE_P(current, PM_INTERPOLATED_SYMBOL_NODE)) { // If we hit an embedded expression and the current node is an // interpolated string, then we'll just continue on. @@ -19422,7 +19428,7 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b } pm_array_node_close_set(array, &closing); - return (pm_node_t *) array; + return UP(array); } case PM_TOKEN_PERCENT_LOWER_W: { parser_lex(parser); @@ -19440,7 +19446,7 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b pm_token_t opening = not_provided(parser); pm_token_t closing = not_provided(parser); - pm_node_t *string = (pm_node_t *) pm_string_node_create_current_string(parser, &opening, &parser->current, &closing); + pm_node_t *string = UP(pm_string_node_create_current_string(parser, &opening, &parser->current, &closing)); pm_array_node_elements_append(array, string); } @@ -19456,7 +19462,7 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b } pm_array_node_close_set(array, &closing); - return (pm_node_t *) array; + return UP(array); } case PM_TOKEN_PERCENT_UPPER_W: { parser_lex(parser); @@ -19492,7 +19498,7 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b pm_token_t opening = not_provided(parser); pm_token_t closing = not_provided(parser); - pm_node_t *string = (pm_node_t *) pm_string_node_create_current_string(parser, &opening, &parser->current, &closing); + pm_node_t *string = UP(pm_string_node_create_current_string(parser, &opening, &parser->current, &closing)); pm_node_flag_set(string, parse_unescaped_encoding(parser)); parser_lex(parser); @@ -19515,7 +19521,7 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b pm_interpolated_string_node_t *interpolated = pm_interpolated_string_node_create(parser, &opening, NULL, &closing); pm_interpolated_string_node_append(interpolated, current); pm_interpolated_string_node_append(interpolated, string); - current = (pm_node_t *) interpolated; + current = UP(interpolated); } else { assert(false && "unreachable"); } @@ -19530,7 +19536,7 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b // interpolated string. pm_token_t opening = not_provided(parser); pm_token_t closing = not_provided(parser); - current = (pm_node_t *) pm_interpolated_string_node_create(parser, &opening, NULL, &closing); + current = UP(pm_interpolated_string_node_create(parser, &opening, NULL, &closing)); } else if (PM_NODE_TYPE_P(current, PM_STRING_NODE)) { // If we hit an embedded variable and the current // node is a string node, then we'll convert the @@ -19540,7 +19546,7 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b pm_token_t closing = not_provided(parser); pm_interpolated_string_node_t *interpolated = pm_interpolated_string_node_create(parser, &opening, NULL, &closing); pm_interpolated_string_node_append(interpolated, current); - current = (pm_node_t *) interpolated; + current = UP(interpolated); } else { // If we hit an embedded variable and the current // node is an interpolated string, then we'll just @@ -19559,7 +19565,7 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b // interpolated string. pm_token_t opening = not_provided(parser); pm_token_t closing = not_provided(parser); - current = (pm_node_t *) pm_interpolated_string_node_create(parser, &opening, NULL, &closing); + current = UP(pm_interpolated_string_node_create(parser, &opening, NULL, &closing)); } else if (PM_NODE_TYPE_P(current, PM_STRING_NODE)) { // If we hit an embedded expression and the current // node is a string node, then we'll convert the @@ -19569,7 +19575,7 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b pm_token_t closing = not_provided(parser); pm_interpolated_string_node_t *interpolated = pm_interpolated_string_node_create(parser, &opening, NULL, &closing); pm_interpolated_string_node_append(interpolated, current); - current = (pm_node_t *) interpolated; + current = UP(interpolated); } else if (PM_NODE_TYPE_P(current, PM_INTERPOLATED_STRING_NODE)) { // If we hit an embedded expression and the current // node is an interpolated string, then we'll just @@ -19603,7 +19609,7 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b } pm_array_node_close_set(array, &closing); - return (pm_node_t *) array; + return UP(array); } case PM_TOKEN_REGEXP_BEGIN: { pm_token_t opening = parser->current; @@ -19621,7 +19627,7 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b parser_lex(parser); - pm_node_t *node = (pm_node_t *) pm_regular_expression_node_create(parser, &opening, &content, &parser->previous); + pm_node_t *node = UP(pm_regular_expression_node_create(parser, &opening, &content, &parser->previous)); pm_node_flag_set(node, PM_REGULAR_EXPRESSION_FLAGS_FORCED_US_ASCII_ENCODING); return node; @@ -19653,8 +19659,8 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b parse_regular_expression_errors(parser, node); } - pm_node_flag_set((pm_node_t *) node, parse_and_validate_regular_expression_encoding(parser, &unescaped, ascii_only, node->base.flags)); - return (pm_node_t *) node; + pm_node_flag_set(UP(node), parse_and_validate_regular_expression_encoding(parser, &unescaped, ascii_only, node->base.flags)); + return UP(node); } // If we get here, then we have interpolation so we'll need to create @@ -19663,7 +19669,7 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b pm_token_t opening = not_provided(parser); pm_token_t closing = not_provided(parser); - pm_node_t *part = (pm_node_t *) pm_string_node_create_unescaped(parser, &opening, &parser->previous, &closing, &unescaped); + pm_node_t *part = UP(pm_string_node_create_unescaped(parser, &opening, &parser->previous, &closing, &unescaped)); if (parser->encoding == PM_ENCODING_US_ASCII_ENTRY) { // This is extremely strange, but the first string part of a @@ -19698,7 +19704,7 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b } pm_interpolated_regular_expression_node_closing_set(parser, interpolated, &closing); - return (pm_node_t *) interpolated; + return UP(interpolated); } case PM_TOKEN_BACKTICK: case PM_TOKEN_PERCENT_LOWER_X: { @@ -19720,7 +19726,7 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b }; parser_lex(parser); - return (pm_node_t *) pm_xstring_node_create(parser, &opening, &content, &parser->previous); + return UP(pm_xstring_node_create(parser, &opening, &content, &parser->previous)); } pm_interpolated_x_string_node_t *node; @@ -19735,7 +19741,7 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b parser_lex(parser); if (match1(parser, PM_TOKEN_STRING_END)) { - pm_node_t *node = (pm_node_t *) pm_xstring_node_create_unescaped(parser, &opening, &content, &parser->current, &unescaped); + pm_node_t *node = UP(pm_xstring_node_create_unescaped(parser, &opening, &content, &parser->current, &unescaped)); pm_node_flag_set(node, parse_unescaped_encoding(parser)); parser_lex(parser); return node; @@ -19748,7 +19754,7 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b pm_token_t opening = not_provided(parser); pm_token_t closing = not_provided(parser); - pm_node_t *part = (pm_node_t *) pm_string_node_create_unescaped(parser, &opening, &parser->previous, &closing, &unescaped); + pm_node_t *part = UP(pm_string_node_create_unescaped(parser, &opening, &parser->previous, &closing, &unescaped)); pm_node_flag_set(part, parse_unescaped_encoding(parser)); pm_interpolated_xstring_node_append(node, part); @@ -19775,7 +19781,7 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b } pm_interpolated_xstring_node_closing_set(node, &closing); - return (pm_node_t *) node; + return UP(node); } case PM_TOKEN_USTAR: { parser_lex(parser); @@ -19785,7 +19791,7 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b // still lex past it though and create a missing node place. if (binding_power != PM_BINDING_POWER_STATEMENT) { pm_parser_err_prefix(parser, diag_id); - return (pm_node_t *) pm_missing_node_create(parser, parser->previous.start, parser->previous.end); + return UP(pm_missing_node_create(parser, parser->previous.start, parser->previous.end)); } pm_token_t operator = parser->previous; @@ -19795,7 +19801,7 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b name = parse_expression(parser, PM_BINDING_POWER_INDEX, false, false, PM_ERR_EXPECT_EXPRESSION_AFTER_STAR, (uint16_t) (depth + 1)); } - pm_node_t *splat = (pm_node_t *) pm_splat_node_create(parser, &operator, name); + pm_node_t *splat = UP(pm_splat_node_create(parser, &operator, name)); if (match1(parser, PM_TOKEN_COMMA)) { return parse_targets_validate(parser, splat, PM_BINDING_POWER_INDEX, (uint16_t) (depth + 1)); @@ -19815,7 +19821,7 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b pm_call_node_t *node = pm_call_node_unary_create(parser, &operator, receiver, "!"); pm_conditional_predicate(parser, receiver, PM_CONDITIONAL_PREDICATE_TYPE_NOT); - return (pm_node_t *) node; + return UP(node); } case PM_TOKEN_TILDE: { if (binding_power > PM_BINDING_POWER_UNARY) { @@ -19827,7 +19833,7 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b pm_node_t *receiver = parse_expression(parser, pm_binding_powers[parser->previous.type].right, false, false, PM_ERR_UNARY_RECEIVER, (uint16_t) (depth + 1)); pm_call_node_t *node = pm_call_node_unary_create(parser, &operator, receiver, "~"); - return (pm_node_t *) node; + return UP(node); } case PM_TOKEN_UMINUS: { if (binding_power > PM_BINDING_POWER_UNARY) { @@ -19839,7 +19845,7 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b pm_node_t *receiver = parse_expression(parser, pm_binding_powers[parser->previous.type].right, false, false, PM_ERR_UNARY_RECEIVER, (uint16_t) (depth + 1)); pm_call_node_t *node = pm_call_node_unary_create(parser, &operator, receiver, "-@"); - return (pm_node_t *) node; + return UP(node); } case PM_TOKEN_UMINUS_NUM: { parser_lex(parser); @@ -19850,8 +19856,8 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b if (accept1(parser, PM_TOKEN_STAR_STAR)) { pm_token_t exponent_operator = parser->previous; pm_node_t *exponent = parse_expression(parser, pm_binding_powers[exponent_operator.type].right, false, false, PM_ERR_EXPECT_ARGUMENT, (uint16_t) (depth + 1)); - node = (pm_node_t *) pm_call_node_binary_create(parser, node, &exponent_operator, exponent, 0); - node = (pm_node_t *) pm_call_node_unary_create(parser, &operator, node, "-@"); + node = UP(pm_call_node_binary_create(parser, node, &exponent_operator, exponent, 0)); + node = UP(pm_call_node_unary_create(parser, &operator, node, "-@")); } else { switch (PM_NODE_TYPE(node)) { case PM_INTEGER_NODE: @@ -19861,7 +19867,7 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b parse_negative_numeric(node); break; default: - node = (pm_node_t *) pm_call_node_unary_create(parser, &operator, node, "-@"); + node = UP(pm_call_node_unary_create(parser, &operator, node, "-@")); break; } } @@ -19919,7 +19925,7 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b opening = parser->previous; if (!match1(parser, PM_TOKEN_BRACE_RIGHT)) { - body = (pm_node_t *) parse_statements(parser, PM_CONTEXT_LAMBDA_BRACES, (uint16_t) (depth + 1)); + body = UP(parse_statements(parser, PM_CONTEXT_LAMBDA_BRACES, (uint16_t) (depth + 1))); } parser_warn_indentation_mismatch(parser, opening_newline_index, &operator, false, false); @@ -19930,13 +19936,13 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b if (!match3(parser, PM_TOKEN_KEYWORD_END, PM_TOKEN_KEYWORD_RESCUE, PM_TOKEN_KEYWORD_ENSURE)) { pm_accepts_block_stack_push(parser, true); - body = (pm_node_t *) parse_statements(parser, PM_CONTEXT_LAMBDA_DO_END, (uint16_t) (depth + 1)); + body = UP(parse_statements(parser, PM_CONTEXT_LAMBDA_DO_END, (uint16_t) (depth + 1))); pm_accepts_block_stack_pop(parser); } if (match2(parser, PM_TOKEN_KEYWORD_RESCUE, PM_TOKEN_KEYWORD_ENSURE)) { assert(body == NULL || PM_NODE_TYPE_P(body, PM_STATEMENTS_NODE)); - body = (pm_node_t *) parse_rescues_implicit_begin(parser, opening_newline_index, &operator, opening.start, (pm_statements_node_t *) body, PM_RESCUES_LAMBDA, (uint16_t) (depth + 1)); + body = UP(parse_rescues_implicit_begin(parser, opening_newline_index, &operator, opening.start, (pm_statements_node_t *) body, PM_RESCUES_LAMBDA, (uint16_t) (depth + 1))); } else { parser_warn_indentation_mismatch(parser, opening_newline_index, &operator, false, false); } @@ -19946,12 +19952,12 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b pm_constant_id_list_t locals; pm_locals_order(parser, &parser->current_scope->locals, &locals, pm_parser_scope_toplevel_p(parser)); - pm_node_t *parameters = parse_blocklike_parameters(parser, (pm_node_t *) block_parameters, &operator, &parser->previous); + pm_node_t *parameters = parse_blocklike_parameters(parser, UP(block_parameters), &operator, &parser->previous); pm_parser_scope_pop(parser); pm_accepts_block_stack_pop(parser); - return (pm_node_t *) pm_lambda_node_create(parser, &locals, &operator, &opening, &parser->previous, parameters, body); + return UP(pm_lambda_node_create(parser, &locals, &operator, &opening, &parser->previous, parameters, body)); } case PM_TOKEN_UPLUS: { if (binding_power > PM_BINDING_POWER_UNARY) { @@ -19963,7 +19969,7 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b pm_node_t *receiver = parse_expression(parser, pm_binding_powers[parser->previous.type].right, false, false, PM_ERR_UNARY_RECEIVER, (uint16_t) (depth + 1)); pm_call_node_t *node = pm_call_node_unary_create(parser, &operator, receiver, "+@"); - return (pm_node_t *) node; + return UP(node); } case PM_TOKEN_STRING_BEGIN: return parse_strings(parser, NULL, accepts_label, (uint16_t) (depth + 1)); @@ -19999,7 +20005,7 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b pm_parser_err_prefix(parser, diag_id); } - return (pm_node_t *) pm_missing_node_create(parser, parser->previous.start, parser->previous.end); + return UP(pm_missing_node_create(parser, parser->previous.start, parser->previous.end)); } } } @@ -20028,7 +20034,7 @@ parse_assignment_value(pm_parser_t *parser, pm_binding_power_t previous_binding_ pm_node_t *right = parse_expression(parser, pm_binding_powers[PM_TOKEN_KEYWORD_RESCUE_MODIFIER].right, false, false, PM_ERR_RESCUE_MODIFIER_VALUE, (uint16_t) (depth + 1)); context_pop(parser); - return (pm_node_t *) pm_rescue_modifier_node_create(parser, value, &rescue, right); + return UP(pm_rescue_modifier_node_create(parser, value, &rescue, right)); } return value; @@ -20100,7 +20106,7 @@ parse_assignment_values(pm_parser_t *parser, pm_binding_power_t previous_binding pm_array_node_t *array = pm_array_node_create(parser, &opening); pm_array_node_elements_append(array, value); - value = (pm_node_t *) array; + value = UP(array); while (accept1(parser, PM_TOKEN_COMMA)) { pm_node_t *element = parse_starred_expression(parser, binding_power, false, PM_ERR_ARRAY_ELEMENT, (uint16_t) (depth + 1)); @@ -20134,7 +20140,7 @@ parse_assignment_values(pm_parser_t *parser, pm_binding_power_t previous_binding pm_node_t *right = parse_expression(parser, pm_binding_powers[PM_TOKEN_KEYWORD_RESCUE_MODIFIER].right, accepts_command_call_inner, false, PM_ERR_RESCUE_MODIFIER_VALUE, (uint16_t) (depth + 1)); context_pop(parser); - return (pm_node_t *) pm_rescue_modifier_node_create(parser, value, &rescue, right); + return UP(pm_rescue_modifier_node_create(parser, value, &rescue, right)); } return value; @@ -20151,15 +20157,15 @@ static void parse_call_operator_write(pm_parser_t *parser, pm_call_node_t *call_node, const pm_token_t *operator) { if (call_node->arguments != NULL) { pm_parser_err_token(parser, operator, PM_ERR_OPERATOR_WRITE_ARGUMENTS); - pm_node_unreference(parser, (pm_node_t *) call_node->arguments); - pm_node_destroy(parser, (pm_node_t *) call_node->arguments); + pm_node_unreference(parser, UP(call_node->arguments)); + pm_node_destroy(parser, UP(call_node->arguments)); call_node->arguments = NULL; } if (call_node->block != NULL) { pm_parser_err_token(parser, operator, PM_ERR_OPERATOR_WRITE_BLOCK); - pm_node_unreference(parser, (pm_node_t *) call_node->block); - pm_node_destroy(parser, (pm_node_t *) call_node->block); + pm_node_unreference(parser, UP(call_node->block)); + pm_node_destroy(parser, UP(call_node->block)); call_node->block = NULL; } } @@ -20391,7 +20397,7 @@ parse_regular_expression_named_capture(const pm_string_t *capture, void *data) { // Next, create the local variable target and add it to the list of // targets for the match. - pm_node_t *target = (pm_node_t *) pm_local_variable_target_node_create(parser, &location, name, depth == -1 ? 0 : (uint32_t) depth); + pm_node_t *target = UP(pm_local_variable_target_node_create(parser, &location, name, depth == -1 ? 0 : (uint32_t) depth)); pm_node_list_append(&callback_data->match->targets, target); } @@ -20422,9 +20428,9 @@ parse_regular_expression_named_captures(pm_parser_t *parser, const pm_string_t * pm_constant_id_list_free(&callback_data.names); if (callback_data.match != NULL) { - return (pm_node_t *) callback_data.match; + return UP(callback_data.match); } else { - return (pm_node_t *) call; + return UP(call); } } @@ -20469,7 +20475,7 @@ parse_expression_infix(pm_parser_t *parser, pm_node_t *node, pm_binding_power_t parser_lex(parser); pm_node_t *value = parse_assignment_values(parser, previous_binding_power, PM_BINDING_POWER_MULTI_ASSIGNMENT + 1, accepts_command_call, PM_ERR_EXPECT_EXPRESSION_AFTER_EQUAL, (uint16_t) (depth + 1)); - return parse_write(parser, (pm_node_t *) multi_target, &token, value); + return parse_write(parser, UP(multi_target), &token, value); } case PM_SOURCE_ENCODING_NODE: case PM_FALSE_NODE: @@ -20503,7 +20509,7 @@ parse_expression_infix(pm_parser_t *parser, pm_node_t *node, pm_binding_power_t parser_lex(parser); pm_node_t *value = parse_assignment_value(parser, previous_binding_power, binding_power, accepts_command_call, PM_ERR_EXPECT_EXPRESSION_AFTER_AMPAMPEQ, (uint16_t) (depth + 1)); - pm_node_t *result = (pm_node_t *) pm_global_variable_and_write_node_create(parser, node, &token, value); + pm_node_t *result = UP(pm_global_variable_and_write_node_create(parser, node, &token, value)); pm_node_destroy(parser, node); return result; @@ -20512,7 +20518,7 @@ parse_expression_infix(pm_parser_t *parser, pm_node_t *node, pm_binding_power_t parser_lex(parser); pm_node_t *value = parse_assignment_value(parser, previous_binding_power, binding_power, accepts_command_call, PM_ERR_EXPECT_EXPRESSION_AFTER_AMPAMPEQ, (uint16_t) (depth + 1)); - pm_node_t *result = (pm_node_t *) pm_class_variable_and_write_node_create(parser, (pm_class_variable_read_node_t *) node, &token, value); + pm_node_t *result = UP(pm_class_variable_and_write_node_create(parser, (pm_class_variable_read_node_t *) node, &token, value)); pm_node_destroy(parser, node); return result; @@ -20521,7 +20527,7 @@ parse_expression_infix(pm_parser_t *parser, pm_node_t *node, pm_binding_power_t parser_lex(parser); pm_node_t *value = parse_assignment_value(parser, previous_binding_power, binding_power, accepts_command_call, PM_ERR_EXPECT_EXPRESSION_AFTER_AMPAMPEQ, (uint16_t) (depth + 1)); - pm_node_t *write = (pm_node_t *) pm_constant_path_and_write_node_create(parser, (pm_constant_path_node_t *) node, &token, value); + pm_node_t *write = UP(pm_constant_path_and_write_node_create(parser, (pm_constant_path_node_t *) node, &token, value)); return parse_shareable_constant_write(parser, write); } @@ -20529,7 +20535,7 @@ parse_expression_infix(pm_parser_t *parser, pm_node_t *node, pm_binding_power_t parser_lex(parser); pm_node_t *value = parse_assignment_value(parser, previous_binding_power, binding_power, accepts_command_call, PM_ERR_EXPECT_EXPRESSION_AFTER_AMPAMPEQ, (uint16_t) (depth + 1)); - pm_node_t *write = (pm_node_t *) pm_constant_and_write_node_create(parser, (pm_constant_read_node_t *) node, &token, value); + pm_node_t *write = UP(pm_constant_and_write_node_create(parser, (pm_constant_read_node_t *) node, &token, value)); pm_node_destroy(parser, node); return parse_shareable_constant_write(parser, write); @@ -20538,7 +20544,7 @@ parse_expression_infix(pm_parser_t *parser, pm_node_t *node, pm_binding_power_t parser_lex(parser); pm_node_t *value = parse_assignment_value(parser, previous_binding_power, binding_power, accepts_command_call, PM_ERR_EXPECT_EXPRESSION_AFTER_AMPAMPEQ, (uint16_t) (depth + 1)); - pm_node_t *result = (pm_node_t *) pm_instance_variable_and_write_node_create(parser, (pm_instance_variable_read_node_t *) node, &token, value); + pm_node_t *result = UP(pm_instance_variable_and_write_node_create(parser, (pm_instance_variable_read_node_t *) node, &token, value)); pm_node_destroy(parser, node); return result; @@ -20548,7 +20554,7 @@ parse_expression_infix(pm_parser_t *parser, pm_node_t *node, pm_binding_power_t parser_lex(parser); pm_node_t *value = parse_assignment_value(parser, previous_binding_power, binding_power, accepts_command_call, PM_ERR_EXPECT_EXPRESSION_AFTER_AMPAMPEQ, (uint16_t) (depth + 1)); - pm_node_t *result = (pm_node_t *) pm_local_variable_and_write_node_create(parser, node, &token, value, name, 0); + pm_node_t *result = UP(pm_local_variable_and_write_node_create(parser, node, &token, value, name, 0)); pm_node_unreference(parser, node); pm_node_destroy(parser, node); @@ -20564,7 +20570,7 @@ parse_expression_infix(pm_parser_t *parser, pm_node_t *node, pm_binding_power_t parser_lex(parser); pm_node_t *value = parse_assignment_value(parser, previous_binding_power, binding_power, accepts_command_call, PM_ERR_EXPECT_EXPRESSION_AFTER_AMPAMPEQ, (uint16_t) (depth + 1)); - pm_node_t *result = (pm_node_t *) pm_local_variable_and_write_node_create(parser, node, &token, value, cast->name, cast->depth); + pm_node_t *result = UP(pm_local_variable_and_write_node_create(parser, node, &token, value, cast->name, cast->depth)); pm_node_destroy(parser, node); return result; @@ -20583,9 +20589,9 @@ parse_expression_infix(pm_parser_t *parser, pm_node_t *node, pm_binding_power_t parser_lex(parser); pm_node_t *value = parse_assignment_value(parser, previous_binding_power, binding_power, accepts_command_call, PM_ERR_EXPECT_EXPRESSION_AFTER_AMPAMPEQ, (uint16_t) (depth + 1)); - pm_node_t *result = (pm_node_t *) pm_local_variable_and_write_node_create(parser, (pm_node_t *) cast, &token, value, constant_id, 0); + pm_node_t *result = UP(pm_local_variable_and_write_node_create(parser, UP(cast), &token, value, constant_id, 0)); - pm_node_destroy(parser, (pm_node_t *) cast); + pm_node_destroy(parser, UP(cast)); return result; } @@ -20598,7 +20604,7 @@ parse_expression_infix(pm_parser_t *parser, pm_node_t *node, pm_binding_power_t // an aset expression. if (PM_NODE_FLAG_P(cast, PM_CALL_NODE_FLAGS_INDEX)) { pm_node_t *value = parse_assignment_value(parser, previous_binding_power, binding_power, accepts_command_call, PM_ERR_EXPECT_EXPRESSION_AFTER_AMPAMPEQ, (uint16_t) (depth + 1)); - return (pm_node_t *) pm_index_and_write_node_create(parser, cast, &token, value); + return UP(pm_index_and_write_node_create(parser, cast, &token, value)); } // If this node cannot be writable, then we have an error. @@ -20610,7 +20616,7 @@ parse_expression_infix(pm_parser_t *parser, pm_node_t *node, pm_binding_power_t parse_call_operator_write(parser, cast, &token); pm_node_t *value = parse_assignment_value(parser, previous_binding_power, binding_power, accepts_command_call, PM_ERR_EXPECT_EXPRESSION_AFTER_AMPAMPEQ, (uint16_t) (depth + 1)); - return (pm_node_t *) pm_call_and_write_node_create(parser, cast, &token, value); + return UP(pm_call_and_write_node_create(parser, cast, &token, value)); } case PM_MULTI_WRITE_NODE: { parser_lex(parser); @@ -20637,7 +20643,7 @@ parse_expression_infix(pm_parser_t *parser, pm_node_t *node, pm_binding_power_t parser_lex(parser); pm_node_t *value = parse_assignment_value(parser, previous_binding_power, binding_power, accepts_command_call, PM_ERR_EXPECT_EXPRESSION_AFTER_PIPEPIPEEQ, (uint16_t) (depth + 1)); - pm_node_t *result = (pm_node_t *) pm_global_variable_or_write_node_create(parser, node, &token, value); + pm_node_t *result = UP(pm_global_variable_or_write_node_create(parser, node, &token, value)); pm_node_destroy(parser, node); return result; @@ -20646,7 +20652,7 @@ parse_expression_infix(pm_parser_t *parser, pm_node_t *node, pm_binding_power_t parser_lex(parser); pm_node_t *value = parse_assignment_value(parser, previous_binding_power, binding_power, accepts_command_call, PM_ERR_EXPECT_EXPRESSION_AFTER_PIPEPIPEEQ, (uint16_t) (depth + 1)); - pm_node_t *result = (pm_node_t *) pm_class_variable_or_write_node_create(parser, (pm_class_variable_read_node_t *) node, &token, value); + pm_node_t *result = UP(pm_class_variable_or_write_node_create(parser, (pm_class_variable_read_node_t *) node, &token, value)); pm_node_destroy(parser, node); return result; @@ -20655,7 +20661,7 @@ parse_expression_infix(pm_parser_t *parser, pm_node_t *node, pm_binding_power_t parser_lex(parser); pm_node_t *value = parse_assignment_value(parser, previous_binding_power, binding_power, accepts_command_call, PM_ERR_EXPECT_EXPRESSION_AFTER_PIPEPIPEEQ, (uint16_t) (depth + 1)); - pm_node_t *write = (pm_node_t *) pm_constant_path_or_write_node_create(parser, (pm_constant_path_node_t *) node, &token, value); + pm_node_t *write = UP(pm_constant_path_or_write_node_create(parser, (pm_constant_path_node_t *) node, &token, value)); return parse_shareable_constant_write(parser, write); } @@ -20663,7 +20669,7 @@ parse_expression_infix(pm_parser_t *parser, pm_node_t *node, pm_binding_power_t parser_lex(parser); pm_node_t *value = parse_assignment_value(parser, previous_binding_power, binding_power, accepts_command_call, PM_ERR_EXPECT_EXPRESSION_AFTER_PIPEPIPEEQ, (uint16_t) (depth + 1)); - pm_node_t *write = (pm_node_t *) pm_constant_or_write_node_create(parser, (pm_constant_read_node_t *) node, &token, value); + pm_node_t *write = UP(pm_constant_or_write_node_create(parser, (pm_constant_read_node_t *) node, &token, value)); pm_node_destroy(parser, node); return parse_shareable_constant_write(parser, write); @@ -20672,7 +20678,7 @@ parse_expression_infix(pm_parser_t *parser, pm_node_t *node, pm_binding_power_t parser_lex(parser); pm_node_t *value = parse_assignment_value(parser, previous_binding_power, binding_power, accepts_command_call, PM_ERR_EXPECT_EXPRESSION_AFTER_PIPEPIPEEQ, (uint16_t) (depth + 1)); - pm_node_t *result = (pm_node_t *) pm_instance_variable_or_write_node_create(parser, (pm_instance_variable_read_node_t *) node, &token, value); + pm_node_t *result = UP(pm_instance_variable_or_write_node_create(parser, (pm_instance_variable_read_node_t *) node, &token, value)); pm_node_destroy(parser, node); return result; @@ -20682,7 +20688,7 @@ parse_expression_infix(pm_parser_t *parser, pm_node_t *node, pm_binding_power_t parser_lex(parser); pm_node_t *value = parse_assignment_value(parser, previous_binding_power, binding_power, accepts_command_call, PM_ERR_EXPECT_EXPRESSION_AFTER_PIPEPIPEEQ, (uint16_t) (depth + 1)); - pm_node_t *result = (pm_node_t *) pm_local_variable_or_write_node_create(parser, node, &token, value, name, 0); + pm_node_t *result = UP(pm_local_variable_or_write_node_create(parser, node, &token, value, name, 0)); pm_node_unreference(parser, node); pm_node_destroy(parser, node); @@ -20698,7 +20704,7 @@ parse_expression_infix(pm_parser_t *parser, pm_node_t *node, pm_binding_power_t parser_lex(parser); pm_node_t *value = parse_assignment_value(parser, previous_binding_power, binding_power, accepts_command_call, PM_ERR_EXPECT_EXPRESSION_AFTER_PIPEPIPEEQ, (uint16_t) (depth + 1)); - pm_node_t *result = (pm_node_t *) pm_local_variable_or_write_node_create(parser, node, &token, value, cast->name, cast->depth); + pm_node_t *result = UP(pm_local_variable_or_write_node_create(parser, node, &token, value, cast->name, cast->depth)); pm_node_destroy(parser, node); return result; @@ -20717,9 +20723,9 @@ parse_expression_infix(pm_parser_t *parser, pm_node_t *node, pm_binding_power_t parser_lex(parser); pm_node_t *value = parse_assignment_value(parser, previous_binding_power, binding_power, accepts_command_call, PM_ERR_EXPECT_EXPRESSION_AFTER_PIPEPIPEEQ, (uint16_t) (depth + 1)); - pm_node_t *result = (pm_node_t *) pm_local_variable_or_write_node_create(parser, (pm_node_t *) cast, &token, value, constant_id, 0); + pm_node_t *result = UP(pm_local_variable_or_write_node_create(parser, UP(cast), &token, value, constant_id, 0)); - pm_node_destroy(parser, (pm_node_t *) cast); + pm_node_destroy(parser, UP(cast)); return result; } @@ -20732,7 +20738,7 @@ parse_expression_infix(pm_parser_t *parser, pm_node_t *node, pm_binding_power_t // an aset expression. if (PM_NODE_FLAG_P(cast, PM_CALL_NODE_FLAGS_INDEX)) { pm_node_t *value = parse_assignment_value(parser, previous_binding_power, binding_power, accepts_command_call, PM_ERR_EXPECT_EXPRESSION_AFTER_PIPEPIPEEQ, (uint16_t) (depth + 1)); - return (pm_node_t *) pm_index_or_write_node_create(parser, cast, &token, value); + return UP(pm_index_or_write_node_create(parser, cast, &token, value)); } // If this node cannot be writable, then we have an error. @@ -20744,7 +20750,7 @@ parse_expression_infix(pm_parser_t *parser, pm_node_t *node, pm_binding_power_t parse_call_operator_write(parser, cast, &token); pm_node_t *value = parse_assignment_value(parser, previous_binding_power, binding_power, accepts_command_call, PM_ERR_EXPECT_EXPRESSION_AFTER_PIPEPIPEEQ, (uint16_t) (depth + 1)); - return (pm_node_t *) pm_call_or_write_node_create(parser, cast, &token, value); + return UP(pm_call_or_write_node_create(parser, cast, &token, value)); } case PM_MULTI_WRITE_NODE: { parser_lex(parser); @@ -20781,7 +20787,7 @@ parse_expression_infix(pm_parser_t *parser, pm_node_t *node, pm_binding_power_t parser_lex(parser); pm_node_t *value = parse_assignment_value(parser, previous_binding_power, binding_power, accepts_command_call, PM_ERR_EXPECT_EXPRESSION_AFTER_OPERATOR, (uint16_t) (depth + 1)); - pm_node_t *result = (pm_node_t *) pm_global_variable_operator_write_node_create(parser, node, &token, value); + pm_node_t *result = UP(pm_global_variable_operator_write_node_create(parser, node, &token, value)); pm_node_destroy(parser, node); return result; @@ -20790,7 +20796,7 @@ parse_expression_infix(pm_parser_t *parser, pm_node_t *node, pm_binding_power_t parser_lex(parser); pm_node_t *value = parse_assignment_value(parser, previous_binding_power, binding_power, accepts_command_call, PM_ERR_EXPECT_EXPRESSION_AFTER_OPERATOR, (uint16_t) (depth + 1)); - pm_node_t *result = (pm_node_t *) pm_class_variable_operator_write_node_create(parser, (pm_class_variable_read_node_t *) node, &token, value); + pm_node_t *result = UP(pm_class_variable_operator_write_node_create(parser, (pm_class_variable_read_node_t *) node, &token, value)); pm_node_destroy(parser, node); return result; @@ -20799,7 +20805,7 @@ parse_expression_infix(pm_parser_t *parser, pm_node_t *node, pm_binding_power_t parser_lex(parser); pm_node_t *value = parse_assignment_value(parser, previous_binding_power, binding_power, accepts_command_call, PM_ERR_EXPECT_EXPRESSION_AFTER_OPERATOR, (uint16_t) (depth + 1)); - pm_node_t *write = (pm_node_t *) pm_constant_path_operator_write_node_create(parser, (pm_constant_path_node_t *) node, &token, value); + pm_node_t *write = UP(pm_constant_path_operator_write_node_create(parser, (pm_constant_path_node_t *) node, &token, value)); return parse_shareable_constant_write(parser, write); } @@ -20807,7 +20813,7 @@ parse_expression_infix(pm_parser_t *parser, pm_node_t *node, pm_binding_power_t parser_lex(parser); pm_node_t *value = parse_assignment_value(parser, previous_binding_power, binding_power, accepts_command_call, PM_ERR_EXPECT_EXPRESSION_AFTER_OPERATOR, (uint16_t) (depth + 1)); - pm_node_t *write = (pm_node_t *) pm_constant_operator_write_node_create(parser, (pm_constant_read_node_t *) node, &token, value); + pm_node_t *write = UP(pm_constant_operator_write_node_create(parser, (pm_constant_read_node_t *) node, &token, value)); pm_node_destroy(parser, node); return parse_shareable_constant_write(parser, write); @@ -20816,7 +20822,7 @@ parse_expression_infix(pm_parser_t *parser, pm_node_t *node, pm_binding_power_t parser_lex(parser); pm_node_t *value = parse_assignment_value(parser, previous_binding_power, binding_power, accepts_command_call, PM_ERR_EXPECT_EXPRESSION_AFTER_OPERATOR, (uint16_t) (depth + 1)); - pm_node_t *result = (pm_node_t *) pm_instance_variable_operator_write_node_create(parser, (pm_instance_variable_read_node_t *) node, &token, value); + pm_node_t *result = UP(pm_instance_variable_operator_write_node_create(parser, (pm_instance_variable_read_node_t *) node, &token, value)); pm_node_destroy(parser, node); return result; @@ -20826,7 +20832,7 @@ parse_expression_infix(pm_parser_t *parser, pm_node_t *node, pm_binding_power_t parser_lex(parser); pm_node_t *value = parse_assignment_value(parser, previous_binding_power, binding_power, accepts_command_call, PM_ERR_EXPECT_EXPRESSION_AFTER_OPERATOR, (uint16_t) (depth + 1)); - pm_node_t *result = (pm_node_t *) pm_local_variable_operator_write_node_create(parser, node, &token, value, name, 0); + pm_node_t *result = UP(pm_local_variable_operator_write_node_create(parser, node, &token, value, name, 0)); pm_node_unreference(parser, node); pm_node_destroy(parser, node); @@ -20842,7 +20848,7 @@ parse_expression_infix(pm_parser_t *parser, pm_node_t *node, pm_binding_power_t parser_lex(parser); pm_node_t *value = parse_assignment_value(parser, previous_binding_power, binding_power, accepts_command_call, PM_ERR_EXPECT_EXPRESSION_AFTER_OPERATOR, (uint16_t) (depth + 1)); - pm_node_t *result = (pm_node_t *) pm_local_variable_operator_write_node_create(parser, node, &token, value, cast->name, cast->depth); + pm_node_t *result = UP(pm_local_variable_operator_write_node_create(parser, node, &token, value, cast->name, cast->depth)); pm_node_destroy(parser, node); return result; @@ -20860,9 +20866,9 @@ parse_expression_infix(pm_parser_t *parser, pm_node_t *node, pm_binding_power_t pm_constant_id_t constant_id = pm_parser_local_add_location(parser, message_loc->start, message_loc->end, 1); pm_node_t *value = parse_assignment_value(parser, previous_binding_power, binding_power, accepts_command_call, PM_ERR_EXPECT_EXPRESSION_AFTER_OPERATOR, (uint16_t) (depth + 1)); - pm_node_t *result = (pm_node_t *) pm_local_variable_operator_write_node_create(parser, (pm_node_t *) cast, &token, value, constant_id, 0); + pm_node_t *result = UP(pm_local_variable_operator_write_node_create(parser, UP(cast), &token, value, constant_id, 0)); - pm_node_destroy(parser, (pm_node_t *) cast); + pm_node_destroy(parser, UP(cast)); return result; } @@ -20871,7 +20877,7 @@ parse_expression_infix(pm_parser_t *parser, pm_node_t *node, pm_binding_power_t // an aset expression. if (PM_NODE_FLAG_P(cast, PM_CALL_NODE_FLAGS_INDEX)) { pm_node_t *value = parse_assignment_value(parser, previous_binding_power, binding_power, accepts_command_call, PM_ERR_EXPECT_EXPRESSION_AFTER_OPERATOR, (uint16_t) (depth + 1)); - return (pm_node_t *) pm_index_operator_write_node_create(parser, cast, &token, value); + return UP(pm_index_operator_write_node_create(parser, cast, &token, value)); } // If this node cannot be writable, then we have an error. @@ -20883,7 +20889,7 @@ parse_expression_infix(pm_parser_t *parser, pm_node_t *node, pm_binding_power_t parse_call_operator_write(parser, cast, &token); pm_node_t *value = parse_assignment_value(parser, previous_binding_power, binding_power, accepts_command_call, PM_ERR_EXPECT_EXPRESSION_AFTER_OPERATOR, (uint16_t) (depth + 1)); - return (pm_node_t *) pm_call_operator_write_node_create(parser, cast, &token, value); + return UP(pm_call_operator_write_node_create(parser, cast, &token, value)); } case PM_MULTI_WRITE_NODE: { parser_lex(parser); @@ -20905,14 +20911,14 @@ parse_expression_infix(pm_parser_t *parser, pm_node_t *node, pm_binding_power_t parser_lex(parser); pm_node_t *right = parse_expression(parser, binding_power, parser->previous.type == PM_TOKEN_KEYWORD_AND, false, PM_ERR_EXPECT_EXPRESSION_AFTER_OPERATOR, (uint16_t) (depth + 1)); - return (pm_node_t *) pm_and_node_create(parser, node, &token, right); + return UP(pm_and_node_create(parser, node, &token, right)); } case PM_TOKEN_KEYWORD_OR: case PM_TOKEN_PIPE_PIPE: { parser_lex(parser); pm_node_t *right = parse_expression(parser, binding_power, parser->previous.type == PM_TOKEN_KEYWORD_OR, false, PM_ERR_EXPECT_EXPRESSION_AFTER_OPERATOR, (uint16_t) (depth + 1)); - return (pm_node_t *) pm_or_node_create(parser, node, &token, right); + return UP(pm_or_node_create(parser, node, &token, right)); } case PM_TOKEN_EQUAL_TILDE: { // Note that we _must_ parse the value before adding the local @@ -20927,7 +20933,7 @@ parse_expression_infix(pm_parser_t *parser, pm_node_t *node, pm_binding_power_t // By default, we're going to create a call node and then return it. pm_call_node_t *call = pm_call_node_binary_create(parser, node, &token, argument, 0); - pm_node_t *result = (pm_node_t *) call; + pm_node_t *result = UP(call); // If the receiver of this =~ is a regular expression node, then we // need to introduce local variables for it based on its named @@ -21030,7 +21036,7 @@ parse_expression_infix(pm_parser_t *parser, pm_node_t *node, pm_binding_power_t } pm_node_t *argument = parse_expression(parser, binding_power, false, false, PM_ERR_EXPECT_EXPRESSION_AFTER_OPERATOR, (uint16_t) (depth + 1)); - return (pm_node_t *) pm_call_node_binary_create(parser, node, &token, argument, 0); + return UP(pm_call_node_binary_create(parser, node, &token, argument, 0)); } case PM_TOKEN_GREATER: case PM_TOKEN_GREATER_EQUAL: @@ -21042,7 +21048,7 @@ parse_expression_infix(pm_parser_t *parser, pm_node_t *node, pm_binding_power_t parser_lex(parser); pm_node_t *argument = parse_expression(parser, binding_power, false, false, PM_ERR_EXPECT_EXPRESSION_AFTER_OPERATOR, (uint16_t) (depth + 1)); - return (pm_node_t *) pm_call_node_binary_create(parser, node, &token, argument, PM_CALL_NODE_FLAGS_COMPARISON); + return UP(pm_call_node_binary_create(parser, node, &token, argument, PM_CALL_NODE_FLAGS_COMPARISON)); } case PM_TOKEN_AMPERSAND_DOT: case PM_TOKEN_DOT: { @@ -21053,7 +21059,7 @@ parse_expression_infix(pm_parser_t *parser, pm_node_t *node, pm_binding_power_t // This if statement handles the foo.() syntax. if (match1(parser, PM_TOKEN_PARENTHESIS_LEFT)) { parse_arguments_list(parser, &arguments, true, false, (uint16_t) (depth + 1)); - return (pm_node_t *) pm_call_node_shorthand_create(parser, node, &operator, &arguments); + return UP(pm_call_node_shorthand_create(parser, node, &operator, &arguments)); } switch (PM_NODE_TYPE(node)) { @@ -21109,9 +21115,9 @@ parse_expression_infix(pm_parser_t *parser, pm_node_t *node, pm_binding_power_t arguments.opening_loc.start == NULL && match1(parser, PM_TOKEN_COMMA) ) { - return parse_targets_validate(parser, (pm_node_t *) call, PM_BINDING_POWER_INDEX, (uint16_t) (depth + 1)); + return parse_targets_validate(parser, UP(call), PM_BINDING_POWER_INDEX, (uint16_t) (depth + 1)); } else { - return (pm_node_t *) call; + return UP(call); } } case PM_TOKEN_DOT_DOT: @@ -21123,21 +21129,21 @@ parse_expression_infix(pm_parser_t *parser, pm_node_t *node, pm_binding_power_t right = parse_expression(parser, binding_power, false, false, PM_ERR_EXPECT_EXPRESSION_AFTER_OPERATOR, (uint16_t) (depth + 1)); } - return (pm_node_t *) pm_range_node_create(parser, node, &token, right); + return UP(pm_range_node_create(parser, node, &token, right)); } case PM_TOKEN_KEYWORD_IF_MODIFIER: { pm_token_t keyword = parser->current; parser_lex(parser); pm_node_t *predicate = parse_value_expression(parser, binding_power, true, false, PM_ERR_CONDITIONAL_IF_PREDICATE, (uint16_t) (depth + 1)); - return (pm_node_t *) pm_if_node_modifier_create(parser, node, &keyword, predicate); + return UP(pm_if_node_modifier_create(parser, node, &keyword, predicate)); } case PM_TOKEN_KEYWORD_UNLESS_MODIFIER: { pm_token_t keyword = parser->current; parser_lex(parser); pm_node_t *predicate = parse_value_expression(parser, binding_power, true, false, PM_ERR_CONDITIONAL_UNLESS_PREDICATE, (uint16_t) (depth + 1)); - return (pm_node_t *) pm_unless_node_modifier_create(parser, node, &keyword, predicate); + return UP(pm_unless_node_modifier_create(parser, node, &keyword, predicate)); } case PM_TOKEN_KEYWORD_UNTIL_MODIFIER: { parser_lex(parser); @@ -21145,7 +21151,7 @@ parse_expression_infix(pm_parser_t *parser, pm_node_t *node, pm_binding_power_t pm_statements_node_body_append(parser, statements, node, true); pm_node_t *predicate = parse_value_expression(parser, binding_power, true, false, PM_ERR_CONDITIONAL_UNTIL_PREDICATE, (uint16_t) (depth + 1)); - return (pm_node_t *) pm_until_node_modifier_create(parser, &token, predicate, statements, PM_NODE_TYPE_P(node, PM_BEGIN_NODE) ? PM_LOOP_FLAGS_BEGIN_MODIFIER : 0); + return UP(pm_until_node_modifier_create(parser, &token, predicate, statements, PM_NODE_TYPE_P(node, PM_BEGIN_NODE) ? PM_LOOP_FLAGS_BEGIN_MODIFIER : 0)); } case PM_TOKEN_KEYWORD_WHILE_MODIFIER: { parser_lex(parser); @@ -21153,7 +21159,7 @@ parse_expression_infix(pm_parser_t *parser, pm_node_t *node, pm_binding_power_t pm_statements_node_body_append(parser, statements, node, true); pm_node_t *predicate = parse_value_expression(parser, binding_power, true, false, PM_ERR_CONDITIONAL_WHILE_PREDICATE, (uint16_t) (depth + 1)); - return (pm_node_t *) pm_while_node_modifier_create(parser, &token, predicate, statements, PM_NODE_TYPE_P(node, PM_BEGIN_NODE) ? PM_LOOP_FLAGS_BEGIN_MODIFIER : 0); + return UP(pm_while_node_modifier_create(parser, &token, predicate, statements, PM_NODE_TYPE_P(node, PM_BEGIN_NODE) ? PM_LOOP_FLAGS_BEGIN_MODIFIER : 0)); } case PM_TOKEN_QUESTION_MARK: { context_push(parser, PM_CONTEXT_TERNARY); @@ -21173,13 +21179,13 @@ parse_expression_infix(pm_parser_t *parser, pm_node_t *node, pm_binding_power_t // accidentally move past a ':' token that occurs after the syntax // error. pm_token_t colon = (pm_token_t) { .type = PM_TOKEN_MISSING, .start = parser->previous.end, .end = parser->previous.end }; - pm_node_t *false_expression = (pm_node_t *) pm_missing_node_create(parser, colon.start, colon.end); + pm_node_t *false_expression = UP(pm_missing_node_create(parser, colon.start, colon.end)); context_pop(parser); pop_block_exits(parser, previous_block_exits); pm_node_list_free(¤t_block_exits); - return (pm_node_t *) pm_if_node_ternary_create(parser, node, &qmark, true_expression, &colon, false_expression); + return UP(pm_if_node_ternary_create(parser, node, &qmark, true_expression, &colon, false_expression)); } accept1(parser, PM_TOKEN_NEWLINE); @@ -21192,7 +21198,7 @@ parse_expression_infix(pm_parser_t *parser, pm_node_t *node, pm_binding_power_t pop_block_exits(parser, previous_block_exits); pm_node_list_free(¤t_block_exits); - return (pm_node_t *) pm_if_node_ternary_create(parser, node, &qmark, true_expression, &colon, false_expression); + return UP(pm_if_node_ternary_create(parser, node, &qmark, true_expression, &colon, false_expression)); } case PM_TOKEN_COLON_COLON: { parser_lex(parser); @@ -21217,10 +21223,10 @@ parse_expression_infix(pm_parser_t *parser, pm_node_t *node, pm_binding_power_t pm_arguments_t arguments = { 0 }; parse_arguments_list(parser, &arguments, true, accepts_command_call, (uint16_t) (depth + 1)); - path = (pm_node_t *) pm_call_node_call_create(parser, node, &delimiter, &message, &arguments); + path = UP(pm_call_node_call_create(parser, node, &delimiter, &message, &arguments)); } else { // Otherwise, this is a constant path. That would look like Foo::Bar. - path = (pm_node_t *) pm_constant_path_node_create(parser, node, &delimiter, &parser->previous); + path = UP(pm_constant_path_node_create(parser, node, &delimiter, &parser->previous)); } // If this is followed by a comma then it is a multiple assignment. @@ -21245,10 +21251,10 @@ parse_expression_infix(pm_parser_t *parser, pm_node_t *node, pm_binding_power_t // If this is followed by a comma then it is a multiple assignment. if (previous_binding_power == PM_BINDING_POWER_STATEMENT && match1(parser, PM_TOKEN_COMMA)) { - return parse_targets_validate(parser, (pm_node_t *) call, PM_BINDING_POWER_INDEX, (uint16_t) (depth + 1)); + return parse_targets_validate(parser, UP(call), PM_BINDING_POWER_INDEX, (uint16_t) (depth + 1)); } - return (pm_node_t *) call; + return UP(call); } case PM_TOKEN_PARENTHESIS_LEFT: { // If we have a parenthesis following a '::' operator, then it is the @@ -21256,11 +21262,11 @@ parse_expression_infix(pm_parser_t *parser, pm_node_t *node, pm_binding_power_t pm_arguments_t arguments = { 0 }; parse_arguments_list(parser, &arguments, true, false, (uint16_t) (depth + 1)); - return (pm_node_t *) pm_call_node_shorthand_create(parser, node, &delimiter, &arguments); + return UP(pm_call_node_shorthand_create(parser, node, &delimiter, &arguments)); } default: { expect1(parser, PM_TOKEN_CONSTANT, PM_ERR_CONSTANT_PATH_COLON_COLON_CONSTANT); - return (pm_node_t *) pm_constant_path_node_create(parser, node, &delimiter, &parser->previous); + return UP(pm_constant_path_node_create(parser, node, &delimiter, &parser->previous)); } } } @@ -21272,7 +21278,7 @@ parse_expression_infix(pm_parser_t *parser, pm_node_t *node, pm_binding_power_t pm_node_t *value = parse_expression(parser, binding_power, true, false, PM_ERR_RESCUE_MODIFIER_VALUE, (uint16_t) (depth + 1)); context_pop(parser); - return (pm_node_t *) pm_rescue_modifier_node_create(parser, node, &token, value); + return UP(pm_rescue_modifier_node_create(parser, node, &token, value)); } case PM_TOKEN_BRACKET_LEFT: { parser_lex(parser); @@ -21293,7 +21299,7 @@ parse_expression_infix(pm_parser_t *parser, pm_node_t *node, pm_binding_power_t // assignment and we should parse the targets. if (previous_binding_power == PM_BINDING_POWER_STATEMENT && match1(parser, PM_TOKEN_COMMA)) { pm_call_node_t *aref = pm_call_node_aref_create(parser, node, &arguments); - return parse_targets_validate(parser, (pm_node_t *) aref, PM_BINDING_POWER_INDEX, (uint16_t) (depth + 1)); + return parse_targets_validate(parser, UP(aref), PM_BINDING_POWER_INDEX, (uint16_t) (depth + 1)); } // If we're at the end of the arguments, we can now check if there is a @@ -21309,17 +21315,17 @@ parse_expression_infix(pm_parser_t *parser, pm_node_t *node, pm_binding_power_t if (block != NULL) { if (arguments.block != NULL) { - pm_parser_err_node(parser, (pm_node_t *) block, PM_ERR_ARGUMENT_AFTER_BLOCK); + pm_parser_err_node(parser, UP(block), PM_ERR_ARGUMENT_AFTER_BLOCK); if (arguments.arguments == NULL) { arguments.arguments = pm_arguments_node_create(parser); } pm_arguments_node_arguments_append(arguments.arguments, arguments.block); } - arguments.block = (pm_node_t *) block; + arguments.block = UP(block); } - return (pm_node_t *) pm_call_node_aref_create(parser, node, &arguments); + return UP(pm_call_node_aref_create(parser, node, &arguments)); } case PM_TOKEN_KEYWORD_IN: { bool previous_pattern_matching_newlines = parser->pattern_matching_newlines; @@ -21336,7 +21342,7 @@ parse_expression_infix(pm_parser_t *parser, pm_node_t *node, pm_binding_power_t parser->pattern_matching_newlines = previous_pattern_matching_newlines; pm_constant_id_list_free(&captures); - return (pm_node_t *) pm_match_predicate_node_create(parser, node, pattern, &operator); + return UP(pm_match_predicate_node_create(parser, node, pattern, &operator)); } case PM_TOKEN_EQUAL_GREATER: { bool previous_pattern_matching_newlines = parser->pattern_matching_newlines; @@ -21353,7 +21359,7 @@ parse_expression_infix(pm_parser_t *parser, pm_node_t *node, pm_binding_power_t parser->pattern_matching_newlines = previous_pattern_matching_newlines; pm_constant_id_list_free(&captures); - return (pm_node_t *) pm_match_required_node_create(parser, node, pattern, &operator); + return UP(pm_match_required_node_create(parser, node, pattern, &operator)); } default: assert(false && "unreachable"); @@ -21390,7 +21396,7 @@ static pm_node_t * parse_expression(pm_parser_t *parser, pm_binding_power_t binding_power, bool accepts_command_call, bool accepts_label, pm_diagnostic_id_t diag_id, uint16_t depth) { if (PRISM_UNLIKELY(depth >= PRISM_DEPTH_MAXIMUM)) { pm_parser_err_current(parser, PM_ERR_NESTING_TOO_DEEP); - return (pm_node_t *) pm_missing_node_create(parser, parser->current.start, parser->current.end); + return UP(pm_missing_node_create(parser, parser->current.start, parser->current.end)); } pm_node_t *node = parse_expression_prefix(parser, binding_power, accepts_command_call, accepts_label, diag_id, depth); @@ -21584,14 +21590,14 @@ wrap_statements(pm_parser_t *parser, pm_statements_node_t *statements) { pm_arguments_node_t *arguments = pm_arguments_node_create(parser); pm_arguments_node_arguments_append( arguments, - (pm_node_t *) pm_global_variable_read_node_synthesized_create(parser, pm_parser_constant_id_constant(parser, "$_", 2)) + UP(pm_global_variable_read_node_synthesized_create(parser, pm_parser_constant_id_constant(parser, "$_", 2))) ); - pm_statements_node_body_append(parser, statements, (pm_node_t *) pm_call_node_fcall_synthesized_create( + pm_statements_node_body_append(parser, statements, UP(pm_call_node_fcall_synthesized_create( parser, arguments, pm_parser_constant_id_constant(parser, "print", 5) - ), true); + )), true); } if (PM_PARSER_COMMAND_LINE_OPTION_N(parser)) { @@ -21603,46 +21609,46 @@ wrap_statements(pm_parser_t *parser, pm_statements_node_t *statements) { pm_arguments_node_t *arguments = pm_arguments_node_create(parser); pm_arguments_node_arguments_append( arguments, - (pm_node_t *) pm_global_variable_read_node_synthesized_create(parser, pm_parser_constant_id_constant(parser, "$;", 2)) + UP(pm_global_variable_read_node_synthesized_create(parser, pm_parser_constant_id_constant(parser, "$;", 2))) ); pm_global_variable_read_node_t *receiver = pm_global_variable_read_node_synthesized_create(parser, pm_parser_constant_id_constant(parser, "$_", 2)); - pm_call_node_t *call = pm_call_node_call_synthesized_create(parser, (pm_node_t *) receiver, "split", arguments); + pm_call_node_t *call = pm_call_node_call_synthesized_create(parser, UP(receiver), "split", arguments); pm_global_variable_write_node_t *write = pm_global_variable_write_node_synthesized_create( parser, pm_parser_constant_id_constant(parser, "$F", 2), - (pm_node_t *) call + UP(call) ); - pm_statements_node_body_prepend(statements, (pm_node_t *) write); + pm_statements_node_body_prepend(statements, UP(write)); } pm_arguments_node_t *arguments = pm_arguments_node_create(parser); pm_arguments_node_arguments_append( arguments, - (pm_node_t *) pm_global_variable_read_node_synthesized_create(parser, pm_parser_constant_id_constant(parser, "$/", 2)) + UP(pm_global_variable_read_node_synthesized_create(parser, pm_parser_constant_id_constant(parser, "$/", 2))) ); if (PM_PARSER_COMMAND_LINE_OPTION_L(parser)) { pm_keyword_hash_node_t *keywords = pm_keyword_hash_node_create(parser); - pm_keyword_hash_node_elements_append(keywords, (pm_node_t *) pm_assoc_node_create( + pm_keyword_hash_node_elements_append(keywords, UP(pm_assoc_node_create( parser, - (pm_node_t *) pm_symbol_node_synthesized_create(parser, "chomp"), + UP(pm_symbol_node_synthesized_create(parser, "chomp")), &(pm_token_t) { .type = PM_TOKEN_NOT_PROVIDED, .start = parser->start, .end = parser->start }, - (pm_node_t *) pm_true_node_synthesized_create(parser) - )); + UP(pm_true_node_synthesized_create(parser)) + ))); - pm_arguments_node_arguments_append(arguments, (pm_node_t *) keywords); - pm_node_flag_set((pm_node_t *) arguments, PM_ARGUMENTS_NODE_FLAGS_CONTAINS_KEYWORDS); + pm_arguments_node_arguments_append(arguments, UP(keywords)); + pm_node_flag_set(UP(arguments), PM_ARGUMENTS_NODE_FLAGS_CONTAINS_KEYWORDS); } pm_statements_node_t *wrapped_statements = pm_statements_node_create(parser); - pm_statements_node_body_append(parser, wrapped_statements, (pm_node_t *) pm_while_node_synthesized_create( + pm_statements_node_body_append(parser, wrapped_statements, UP(pm_while_node_synthesized_create( parser, - (pm_node_t *) pm_call_node_fcall_synthesized_create(parser, arguments, pm_parser_constant_id_constant(parser, "gets", 4)), + UP(pm_call_node_fcall_synthesized_create(parser, arguments, pm_parser_constant_id_constant(parser, "gets", 4))), statements - ), true); + )), true); statements = wrapped_statements; } @@ -21698,7 +21704,7 @@ parse_program(pm_parser_t *parser) { pm_statements_node_location_set(statements, parser->start, parser->start); } - return (pm_node_t *) pm_program_node_create(parser, &locals, statements); + return UP(pm_program_node_create(parser, &locals, statements)); } /******************************************************************************/ diff --git a/templates/include/prism/ast.h.erb b/templates/include/prism/ast.h.erb index e82cb78fe3..d69a0d7456 100644 --- a/templates/include/prism/ast.h.erb +++ b/templates/include/prism/ast.h.erb @@ -105,22 +105,6 @@ typedef uint16_t pm_node_flags_t; static const pm_node_flags_t PM_NODE_FLAG_NEWLINE = 0x1; static const pm_node_flags_t PM_NODE_FLAG_STATIC_LITERAL = 0x2; -/** - * Cast the type to an enum to allow the compiler to provide exhaustiveness - * checking. - */ -#define PM_NODE_TYPE(node) ((enum pm_node_type) (node)->type) - -/** - * Return true if the type of the given node matches the given type. - */ -#define PM_NODE_TYPE_P(node, type) (PM_NODE_TYPE(node) == (type)) - -/** - * Return true if the given flag is set on the given node. - */ -#define PM_NODE_FLAG_P(node, flag) ((((pm_node_t *)(node))->flags & (flag)) != 0) - /** * This is the base structure that represents a node in the syntax tree. It is * embedded into every node type. @@ -150,6 +134,27 @@ typedef struct pm_node { */ pm_location_t location; } pm_node_t; + +/** + * Cast the given node to the base pm_node_t type. + */ +#define PM_NODE_UPCAST(node_) ((pm_node_t *) (node_)) + +/** + * Cast the type to an enum to allow the compiler to provide exhaustiveness + * checking. + */ +#define PM_NODE_TYPE(node_) ((enum pm_node_type) (node_)->type) + +/** + * Return true if the type of the given node matches the given type. + */ +#define PM_NODE_TYPE_P(node_, type_) (PM_NODE_TYPE(node_) == (type_)) + +/** + * Return true if the given flag is set on the given node. + */ +#define PM_NODE_FLAG_P(node_, flag_) ((PM_NODE_UPCAST(node_)->flags & (flag_)) != 0) <%- nodes.each do |node| -%> /** From 3e0b5c9eb77331e1a8fe1bbaa7a1b828c2f915d2 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Tue, 2 Dec 2025 15:05:04 -0500 Subject: [PATCH 245/333] Specialize PM_NODE_INIT to reduce calls to location --- src/prism.c | 269 +++++++++++++++++++++++++++------------------------- 1 file changed, 142 insertions(+), 127 deletions(-) diff --git a/src/prism.c b/src/prism.c index 044e61a1b1..2c930d8deb 100644 --- a/src/prism.c +++ b/src/prism.c @@ -24,6 +24,12 @@ pm_version(void) { #define UP PM_NODE_UPCAST +#define PM_TOKEN_START(token_) ((token_)->start) +#define PM_TOKEN_END(token_) ((token_)->end) + +#define PM_NODE_START(node_) (UP(node_)->location.start) +#define PM_NODE_END(node_) (UP(node_)->location.end) + /******************************************************************************/ /* Lex mode manipulations */ /******************************************************************************/ @@ -1942,6 +1948,15 @@ pm_node_alloc(PRISM_ATTRIBUTE_UNUSED pm_parser_t *parser, size_t size) { .location = { .start = (start_), .end = (end_) } \ } +#define PM_NODE_INIT_UNSET(parser_, type_, flags_) PM_NODE_INIT(parser_, type_, flags_, (parser_)->start, (parser_)->start) +#define PM_NODE_INIT_TOKEN(parser_, type_, flags_, token_) PM_NODE_INIT(parser_, type_, flags_, PM_TOKEN_START(token_), PM_TOKEN_END(token_)) +#define PM_NODE_INIT_NODE(parser_, type_, flags_, node_) PM_NODE_INIT(parser_, type_, flags_, PM_NODE_START(node_), PM_NODE_END(node_)) + +#define PM_NODE_INIT_TOKENS(parser_, type_, flags_, left_, right_) PM_NODE_INIT(parser_, type_, flags_, PM_TOKEN_START(left_), PM_TOKEN_END(right_)) +#define PM_NODE_INIT_NODES(parser_, type_, flags_, left_, right_) PM_NODE_INIT(parser_, type_, flags_, PM_NODE_START(left_), PM_NODE_END(right_)) +#define PM_NODE_INIT_TOKEN_NODE(parser_, type_, flags_, token_, node_) PM_NODE_INIT(parser_, type_, flags_, PM_TOKEN_START(token_), PM_NODE_END(node_)) +#define PM_NODE_INIT_NODE_TOKEN(parser_, type_, flags_, node_, token_) PM_NODE_INIT(parser_, type_, flags_, PM_NODE_START(node_), PM_TOKEN_END(token_)) + /** * Allocate a new MissingNode node. */ @@ -1965,7 +1980,7 @@ pm_alias_global_variable_node_create(pm_parser_t *parser, const pm_token_t *keyw pm_alias_global_variable_node_t *node = PM_NODE_ALLOC(parser, pm_alias_global_variable_node_t); *node = (pm_alias_global_variable_node_t) { - .base = PM_NODE_INIT(parser, PM_ALIAS_GLOBAL_VARIABLE_NODE, 0, keyword->start, old_name->location.end), + .base = PM_NODE_INIT_TOKEN_NODE(parser, PM_ALIAS_GLOBAL_VARIABLE_NODE, 0, keyword, old_name), .new_name = new_name, .old_name = old_name, .keyword_loc = PM_LOCATION_TOKEN_VALUE(keyword) @@ -1983,7 +1998,7 @@ pm_alias_method_node_create(pm_parser_t *parser, const pm_token_t *keyword, pm_n pm_alias_method_node_t *node = PM_NODE_ALLOC(parser, pm_alias_method_node_t); *node = (pm_alias_method_node_t) { - .base = PM_NODE_INIT(parser, PM_ALIAS_METHOD_NODE, 0, keyword->start, old_name->location.end), + .base = PM_NODE_INIT_TOKEN_NODE(parser, PM_ALIAS_METHOD_NODE, 0, keyword, old_name), .new_name = new_name, .old_name = old_name, .keyword_loc = PM_LOCATION_TOKEN_VALUE(keyword) @@ -2000,7 +2015,7 @@ pm_alternation_pattern_node_create(pm_parser_t *parser, pm_node_t *left, pm_node pm_alternation_pattern_node_t *node = PM_NODE_ALLOC(parser, pm_alternation_pattern_node_t); *node = (pm_alternation_pattern_node_t) { - .base = PM_NODE_INIT(parser, PM_ALTERNATION_PATTERN_NODE, 0, left->location.start, right->location.end), + .base = PM_NODE_INIT_NODES(parser, PM_ALTERNATION_PATTERN_NODE, 0, left, right), .left = left, .right = right, .operator_loc = PM_LOCATION_TOKEN_VALUE(operator) @@ -2019,7 +2034,7 @@ pm_and_node_create(pm_parser_t *parser, pm_node_t *left, const pm_token_t *opera pm_and_node_t *node = PM_NODE_ALLOC(parser, pm_and_node_t); *node = (pm_and_node_t) { - .base = PM_NODE_INIT(parser, PM_AND_NODE, 0, left->location.start, right->location.end), + .base = PM_NODE_INIT_NODES(parser, PM_AND_NODE, 0, left, right), .left = left, .operator_loc = PM_LOCATION_TOKEN_VALUE(operator), .right = right @@ -2036,7 +2051,7 @@ pm_arguments_node_create(pm_parser_t *parser) { pm_arguments_node_t *node = PM_NODE_ALLOC(parser, pm_arguments_node_t); *node = (pm_arguments_node_t) { - .base = PM_NODE_INIT(parser, PM_ARGUMENTS_NODE, 0, parser->start, parser->start), + .base = PM_NODE_INIT_UNSET(parser, PM_ARGUMENTS_NODE, 0), .arguments = { 0 } }; @@ -2080,7 +2095,7 @@ pm_array_node_create(pm_parser_t *parser, const pm_token_t *opening) { pm_array_node_t *node = PM_NODE_ALLOC(parser, pm_array_node_t); *node = (pm_array_node_t) { - .base = PM_NODE_INIT(parser, PM_ARRAY_NODE, PM_NODE_FLAG_STATIC_LITERAL, opening->start, opening->end), + .base = PM_NODE_INIT_TOKEN(parser, PM_ARRAY_NODE, PM_NODE_FLAG_STATIC_LITERAL, opening), .opening_loc = PM_OPTIONAL_LOCATION_TOKEN_VALUE(opening), .closing_loc = PM_OPTIONAL_LOCATION_TOKEN_VALUE(opening), .elements = { 0 } @@ -2131,7 +2146,7 @@ pm_array_pattern_node_node_list_create(pm_parser_t *parser, pm_node_list_t *node pm_array_pattern_node_t *node = PM_NODE_ALLOC(parser, pm_array_pattern_node_t); *node = (pm_array_pattern_node_t) { - .base = PM_NODE_INIT(parser, PM_ARRAY_PATTERN_NODE, 0, nodes->nodes[0]->location.start, nodes->nodes[nodes->size - 1]->location.end), + .base = PM_NODE_INIT_NODES(parser, PM_ARRAY_PATTERN_NODE, 0, nodes->nodes[0], nodes->nodes[nodes->size - 1]), .constant = NULL, .rest = NULL, .requireds = { 0 }, @@ -2167,7 +2182,7 @@ pm_array_pattern_node_rest_create(pm_parser_t *parser, pm_node_t *rest) { pm_array_pattern_node_t *node = PM_NODE_ALLOC(parser, pm_array_pattern_node_t); *node = (pm_array_pattern_node_t) { - .base = PM_NODE_INIT(parser, PM_ARRAY_PATTERN_NODE, 0, rest->location.start, rest->location.end), + .base = PM_NODE_INIT_NODE(parser, PM_ARRAY_PATTERN_NODE, 0, rest), .constant = NULL, .rest = rest, .requireds = { 0 }, @@ -2188,7 +2203,7 @@ pm_array_pattern_node_constant_create(pm_parser_t *parser, pm_node_t *constant, pm_array_pattern_node_t *node = PM_NODE_ALLOC(parser, pm_array_pattern_node_t); *node = (pm_array_pattern_node_t) { - .base = PM_NODE_INIT(parser, PM_ARRAY_PATTERN_NODE, 0, constant->location.start, closing->end), + .base = PM_NODE_INIT_NODE_TOKEN(parser, PM_ARRAY_PATTERN_NODE, 0, constant, closing), .constant = constant, .rest = NULL, .opening_loc = PM_LOCATION_TOKEN_VALUE(opening), @@ -2209,7 +2224,7 @@ pm_array_pattern_node_empty_create(pm_parser_t *parser, const pm_token_t *openin pm_array_pattern_node_t *node = PM_NODE_ALLOC(parser, pm_array_pattern_node_t); *node = (pm_array_pattern_node_t) { - .base = PM_NODE_INIT(parser, PM_ARRAY_PATTERN_NODE, 0, opening->start, closing->end), + .base = PM_NODE_INIT_TOKENS(parser, PM_ARRAY_PATTERN_NODE, 0, opening, closing), .constant = NULL, .rest = NULL, .opening_loc = PM_LOCATION_TOKEN_VALUE(opening), @@ -2295,7 +2310,7 @@ pm_back_reference_read_node_create(pm_parser_t *parser, const pm_token_t *name) pm_back_reference_read_node_t *node = PM_NODE_ALLOC(parser, pm_back_reference_read_node_t); *node = (pm_back_reference_read_node_t) { - .base = PM_NODE_INIT(parser, PM_BACK_REFERENCE_READ_NODE, 0, name->start, name->end), + .base = PM_NODE_INIT_TOKEN(parser, PM_BACK_REFERENCE_READ_NODE, 0, name), .name = pm_parser_constant_id_token(parser, name) }; @@ -2385,7 +2400,7 @@ pm_block_node_create(pm_parser_t *parser, pm_constant_id_list_t *locals, const p pm_block_node_t *node = PM_NODE_ALLOC(parser, pm_block_node_t); *node = (pm_block_node_t) { - .base = PM_NODE_INIT(parser, PM_BLOCK_NODE, 0, opening->start, closing->end), + .base = PM_NODE_INIT_TOKENS(parser, PM_BLOCK_NODE, 0, opening, closing), .locals = *locals, .parameters = parameters, .body = body, @@ -2469,7 +2484,7 @@ pm_block_local_variable_node_create(pm_parser_t *parser, const pm_token_t *name) pm_block_local_variable_node_t *node = PM_NODE_ALLOC(parser, pm_block_local_variable_node_t); *node = (pm_block_local_variable_node_t) { - .base = PM_NODE_INIT(parser, PM_BLOCK_LOCAL_VARIABLE_NODE, 0, name->start, name->end), + .base = PM_NODE_INIT_TOKEN(parser, PM_BLOCK_LOCAL_VARIABLE_NODE, 0, name), .name = pm_parser_constant_id_token(parser, name) }; @@ -2523,7 +2538,7 @@ pm_call_node_create(pm_parser_t *parser, pm_node_flags_t flags) { pm_call_node_t *node = PM_NODE_ALLOC(parser, pm_call_node_t); *node = (pm_call_node_t) { - .base = PM_NODE_INIT(parser, PM_CALL_NODE, flags, parser->start, parser->start), + .base = PM_NODE_INIT_UNSET(parser, PM_CALL_NODE, flags), .receiver = NULL, .call_operator_loc = PM_OPTIONAL_LOCATION_NOT_PROVIDED_VALUE, .message_loc = PM_OPTIONAL_LOCATION_NOT_PROVIDED_VALUE, @@ -2830,7 +2845,7 @@ pm_call_and_write_node_create(pm_parser_t *parser, pm_call_node_t *target, const pm_call_and_write_node_t *node = PM_NODE_ALLOC(parser, pm_call_and_write_node_t); *node = (pm_call_and_write_node_t) { - .base = PM_NODE_INIT(parser, PM_CALL_AND_WRITE_NODE, target->base.flags, target->base.location.start, value->location.end), + .base = PM_NODE_INIT_NODES(parser, PM_CALL_AND_WRITE_NODE, target->base.flags, target, value), .receiver = target->receiver, .call_operator_loc = target->call_operator_loc, .message_loc = target->message_loc, @@ -2885,7 +2900,7 @@ pm_index_and_write_node_create(pm_parser_t *parser, pm_call_node_t *target, cons assert(!target->block || PM_NODE_TYPE_P(target->block, PM_BLOCK_ARGUMENT_NODE)); *node = (pm_index_and_write_node_t) { - .base = PM_NODE_INIT(parser, PM_INDEX_AND_WRITE_NODE, target->base.flags, target->base.location.start, value->location.end), + .base = PM_NODE_INIT_NODES(parser, PM_INDEX_AND_WRITE_NODE, target->base.flags, target, value), .receiver = target->receiver, .call_operator_loc = target->call_operator_loc, .opening_loc = target->opening_loc, @@ -2913,7 +2928,7 @@ pm_call_operator_write_node_create(pm_parser_t *parser, pm_call_node_t *target, pm_call_operator_write_node_t *node = PM_NODE_ALLOC(parser, pm_call_operator_write_node_t); *node = (pm_call_operator_write_node_t) { - .base = PM_NODE_INIT(parser, PM_CALL_OPERATOR_WRITE_NODE, target->base.flags, target->base.location.start, value->location.end), + .base = PM_NODE_INIT_NODES(parser, PM_CALL_OPERATOR_WRITE_NODE, target->base.flags, target, value), .receiver = target->receiver, .call_operator_loc = target->call_operator_loc, .message_loc = target->message_loc, @@ -2945,7 +2960,7 @@ pm_index_operator_write_node_create(pm_parser_t *parser, pm_call_node_t *target, assert(!target->block || PM_NODE_TYPE_P(target->block, PM_BLOCK_ARGUMENT_NODE)); *node = (pm_index_operator_write_node_t) { - .base = PM_NODE_INIT(parser, PM_INDEX_OPERATOR_WRITE_NODE, target->base.flags, target->base.location.start, value->location.end), + .base = PM_NODE_INIT_NODES(parser, PM_INDEX_OPERATOR_WRITE_NODE, target->base.flags, target, value), .receiver = target->receiver, .call_operator_loc = target->call_operator_loc, .opening_loc = target->opening_loc, @@ -2975,7 +2990,7 @@ pm_call_or_write_node_create(pm_parser_t *parser, pm_call_node_t *target, const pm_call_or_write_node_t *node = PM_NODE_ALLOC(parser, pm_call_or_write_node_t); *node = (pm_call_or_write_node_t) { - .base = PM_NODE_INIT(parser, PM_CALL_OR_WRITE_NODE, target->base.flags, target->base.location.start, value->location.end), + .base = PM_NODE_INIT_NODES(parser, PM_CALL_OR_WRITE_NODE, target->base.flags, target, value), .receiver = target->receiver, .call_operator_loc = target->call_operator_loc, .message_loc = target->message_loc, @@ -3007,7 +3022,7 @@ pm_index_or_write_node_create(pm_parser_t *parser, pm_call_node_t *target, const assert(!target->block || PM_NODE_TYPE_P(target->block, PM_BLOCK_ARGUMENT_NODE)); *node = (pm_index_or_write_node_t) { - .base = PM_NODE_INIT(parser, PM_INDEX_OR_WRITE_NODE, target->base.flags, target->base.location.start, value->location.end), + .base = PM_NODE_INIT_NODES(parser, PM_INDEX_OR_WRITE_NODE, target->base.flags, target, value), .receiver = target->receiver, .call_operator_loc = target->call_operator_loc, .opening_loc = target->opening_loc, @@ -3035,7 +3050,7 @@ pm_call_target_node_create(pm_parser_t *parser, pm_call_node_t *target) { pm_call_target_node_t *node = PM_NODE_ALLOC(parser, pm_call_target_node_t); *node = (pm_call_target_node_t) { - .base = PM_NODE_INIT(parser, PM_CALL_TARGET_NODE, target->base.flags, target->base.location.start, target->base.location.end), + .base = PM_NODE_INIT_NODE(parser, PM_CALL_TARGET_NODE, target->base.flags, target), .receiver = target->receiver, .call_operator_loc = target->call_operator_loc, .name = target->name, @@ -3063,7 +3078,7 @@ pm_index_target_node_create(pm_parser_t *parser, pm_call_node_t *target) { assert(!target->block || PM_NODE_TYPE_P(target->block, PM_BLOCK_ARGUMENT_NODE)); *node = (pm_index_target_node_t) { - .base = PM_NODE_INIT(parser, PM_INDEX_TARGET_NODE, flags | PM_CALL_NODE_FLAGS_ATTRIBUTE_WRITE, target->base.location.start, target->base.location.end), + .base = PM_NODE_INIT_NODE(parser, PM_INDEX_TARGET_NODE, flags | PM_CALL_NODE_FLAGS_ATTRIBUTE_WRITE, target), .receiver = target->receiver, .opening_loc = target->opening_loc, .arguments = target->arguments, @@ -3087,7 +3102,7 @@ pm_capture_pattern_node_create(pm_parser_t *parser, pm_node_t *value, pm_local_v pm_capture_pattern_node_t *node = PM_NODE_ALLOC(parser, pm_capture_pattern_node_t); *node = (pm_capture_pattern_node_t) { - .base = PM_NODE_INIT(parser, PM_CAPTURE_PATTERN_NODE, 0, value->location.start, target->base.location.end), + .base = PM_NODE_INIT_NODES(parser, PM_CAPTURE_PATTERN_NODE, 0, value, target), .value = value, .target = target, .operator_loc = PM_LOCATION_TOKEN_VALUE(operator) @@ -3104,7 +3119,7 @@ pm_case_node_create(pm_parser_t *parser, const pm_token_t *case_keyword, pm_node pm_case_node_t *node = PM_NODE_ALLOC(parser, pm_case_node_t); *node = (pm_case_node_t) { - .base = PM_NODE_INIT(parser, PM_CASE_NODE, 0, case_keyword->start, end_keyword->end), + .base = PM_NODE_INIT_TOKENS(parser, PM_CASE_NODE, 0, case_keyword, end_keyword), .predicate = predicate, .else_clause = NULL, .case_keyword_loc = PM_LOCATION_TOKEN_VALUE(case_keyword), @@ -3152,7 +3167,7 @@ pm_case_match_node_create(pm_parser_t *parser, const pm_token_t *case_keyword, p pm_case_match_node_t *node = PM_NODE_ALLOC(parser, pm_case_match_node_t); *node = (pm_case_match_node_t) { - .base = PM_NODE_INIT(parser, PM_CASE_MATCH_NODE, 0, case_keyword->start, end_keyword->end), + .base = PM_NODE_INIT_TOKENS(parser, PM_CASE_MATCH_NODE, 0, case_keyword, end_keyword), .predicate = predicate, .else_clause = NULL, .case_keyword_loc = PM_LOCATION_TOKEN_VALUE(case_keyword), @@ -3200,7 +3215,7 @@ pm_class_node_create(pm_parser_t *parser, pm_constant_id_list_t *locals, const p pm_class_node_t *node = PM_NODE_ALLOC(parser, pm_class_node_t); *node = (pm_class_node_t) { - .base = PM_NODE_INIT(parser, PM_CLASS_NODE, 0, class_keyword->start, end_keyword->end), + .base = PM_NODE_INIT_TOKENS(parser, PM_CLASS_NODE, 0, class_keyword, end_keyword), .locals = *locals, .class_keyword_loc = PM_LOCATION_TOKEN_VALUE(class_keyword), .constant_path = constant_path, @@ -3223,7 +3238,7 @@ pm_class_variable_and_write_node_create(pm_parser_t *parser, pm_class_variable_r pm_class_variable_and_write_node_t *node = PM_NODE_ALLOC(parser, pm_class_variable_and_write_node_t); *node = (pm_class_variable_and_write_node_t) { - .base = PM_NODE_INIT(parser, PM_CLASS_VARIABLE_AND_WRITE_NODE, 0, target->base.location.start, value->location.end), + .base = PM_NODE_INIT_NODES(parser, PM_CLASS_VARIABLE_AND_WRITE_NODE, 0, target, value), .name = target->name, .name_loc = target->base.location, .operator_loc = PM_LOCATION_TOKEN_VALUE(operator), @@ -3241,7 +3256,7 @@ pm_class_variable_operator_write_node_create(pm_parser_t *parser, pm_class_varia pm_class_variable_operator_write_node_t *node = PM_NODE_ALLOC(parser, pm_class_variable_operator_write_node_t); *node = (pm_class_variable_operator_write_node_t) { - .base = PM_NODE_INIT(parser, PM_CLASS_VARIABLE_OPERATOR_WRITE_NODE, 0, target->base.location.start, value->location.end), + .base = PM_NODE_INIT_NODES(parser, PM_CLASS_VARIABLE_OPERATOR_WRITE_NODE, 0, target, value), .name = target->name, .name_loc = target->base.location, .binary_operator_loc = PM_LOCATION_TOKEN_VALUE(operator), @@ -3261,7 +3276,7 @@ pm_class_variable_or_write_node_create(pm_parser_t *parser, pm_class_variable_re pm_class_variable_or_write_node_t *node = PM_NODE_ALLOC(parser, pm_class_variable_or_write_node_t); *node = (pm_class_variable_or_write_node_t) { - .base = PM_NODE_INIT(parser, PM_CLASS_VARIABLE_OR_WRITE_NODE, 0, target->base.location.start, value->location.end), + .base = PM_NODE_INIT_NODES(parser, PM_CLASS_VARIABLE_OR_WRITE_NODE, 0, target, value), .name = target->name, .name_loc = target->base.location, .operator_loc = PM_LOCATION_TOKEN_VALUE(operator), @@ -3280,7 +3295,7 @@ pm_class_variable_read_node_create(pm_parser_t *parser, const pm_token_t *token) pm_class_variable_read_node_t *node = PM_NODE_ALLOC(parser, pm_class_variable_read_node_t); *node = (pm_class_variable_read_node_t) { - .base = PM_NODE_INIT(parser, PM_CLASS_VARIABLE_READ_NODE, 0, token->start, token->end), + .base = PM_NODE_INIT_TOKEN(parser, PM_CLASS_VARIABLE_READ_NODE, 0, token), .name = pm_parser_constant_id_token(parser, token) }; @@ -3310,7 +3325,7 @@ pm_class_variable_write_node_create(pm_parser_t *parser, pm_class_variable_read_ pm_node_flags_t flags = pm_implicit_array_write_flags(value, PM_WRITE_NODE_FLAGS_IMPLICIT_ARRAY); *node = (pm_class_variable_write_node_t) { - .base = PM_NODE_INIT(parser, PM_CLASS_VARIABLE_WRITE_NODE, flags, read_node->base.location.start, value->location.end), + .base = PM_NODE_INIT_NODES(parser, PM_CLASS_VARIABLE_WRITE_NODE, flags, read_node, value), .name = read_node->name, .name_loc = PM_LOCATION_NODE_VALUE(UP(read_node)), .operator_loc = PM_LOCATION_TOKEN_VALUE(operator), @@ -3329,7 +3344,7 @@ pm_constant_path_and_write_node_create(pm_parser_t *parser, pm_constant_path_nod pm_constant_path_and_write_node_t *node = PM_NODE_ALLOC(parser, pm_constant_path_and_write_node_t); *node = (pm_constant_path_and_write_node_t) { - .base = PM_NODE_INIT(parser, PM_CONSTANT_PATH_AND_WRITE_NODE, 0, target->base.location.start, value->location.end), + .base = PM_NODE_INIT_NODES(parser, PM_CONSTANT_PATH_AND_WRITE_NODE, 0, target, value), .target = target, .operator_loc = PM_LOCATION_TOKEN_VALUE(operator), .value = value @@ -3346,7 +3361,7 @@ pm_constant_path_operator_write_node_create(pm_parser_t *parser, pm_constant_pat pm_constant_path_operator_write_node_t *node = PM_NODE_ALLOC(parser, pm_constant_path_operator_write_node_t); *node = (pm_constant_path_operator_write_node_t) { - .base = PM_NODE_INIT(parser, PM_CONSTANT_PATH_OPERATOR_WRITE_NODE, 0, target->base.location.start, value->location.end), + .base = PM_NODE_INIT_NODES(parser, PM_CONSTANT_PATH_OPERATOR_WRITE_NODE, 0, target, value), .target = target, .binary_operator_loc = PM_LOCATION_TOKEN_VALUE(operator), .value = value, @@ -3365,7 +3380,7 @@ pm_constant_path_or_write_node_create(pm_parser_t *parser, pm_constant_path_node pm_constant_path_or_write_node_t *node = PM_NODE_ALLOC(parser, pm_constant_path_or_write_node_t); *node = (pm_constant_path_or_write_node_t) { - .base = PM_NODE_INIT(parser, PM_CONSTANT_PATH_OR_WRITE_NODE, 0, target->base.location.start, value->location.end), + .base = PM_NODE_INIT_NODES(parser, PM_CONSTANT_PATH_OR_WRITE_NODE, 0, target, value), .target = target, .operator_loc = PM_LOCATION_TOKEN_VALUE(operator), .value = value @@ -3407,7 +3422,7 @@ pm_constant_path_write_node_create(pm_parser_t *parser, pm_constant_path_node_t pm_node_flags_t flags = pm_implicit_array_write_flags(value, PM_WRITE_NODE_FLAGS_IMPLICIT_ARRAY); *node = (pm_constant_path_write_node_t) { - .base = PM_NODE_INIT(parser, PM_CONSTANT_PATH_WRITE_NODE, flags, target->base.location.start, value->location.end), + .base = PM_NODE_INIT_NODES(parser, PM_CONSTANT_PATH_WRITE_NODE, flags, target, value), .target = target, .operator_loc = PM_OPTIONAL_LOCATION_TOKEN_VALUE(operator), .value = value @@ -3425,7 +3440,7 @@ pm_constant_and_write_node_create(pm_parser_t *parser, pm_constant_read_node_t * pm_constant_and_write_node_t *node = PM_NODE_ALLOC(parser, pm_constant_and_write_node_t); *node = (pm_constant_and_write_node_t) { - .base = PM_NODE_INIT(parser, PM_CONSTANT_AND_WRITE_NODE, 0, target->base.location.start, value->location.end), + .base = PM_NODE_INIT_NODES(parser, PM_CONSTANT_AND_WRITE_NODE, 0, target, value), .name = target->name, .name_loc = target->base.location, .operator_loc = PM_LOCATION_TOKEN_VALUE(operator), @@ -3443,7 +3458,7 @@ pm_constant_operator_write_node_create(pm_parser_t *parser, pm_constant_read_nod pm_constant_operator_write_node_t *node = PM_NODE_ALLOC(parser, pm_constant_operator_write_node_t); *node = (pm_constant_operator_write_node_t) { - .base = PM_NODE_INIT(parser, PM_CONSTANT_OPERATOR_WRITE_NODE, 0, target->base.location.start, value->location.end), + .base = PM_NODE_INIT_NODES(parser, PM_CONSTANT_OPERATOR_WRITE_NODE, 0, target, value), .name = target->name, .name_loc = target->base.location, .binary_operator_loc = PM_LOCATION_TOKEN_VALUE(operator), @@ -3463,7 +3478,7 @@ pm_constant_or_write_node_create(pm_parser_t *parser, pm_constant_read_node_t *t pm_constant_or_write_node_t *node = PM_NODE_ALLOC(parser, pm_constant_or_write_node_t); *node = (pm_constant_or_write_node_t) { - .base = PM_NODE_INIT(parser, PM_CONSTANT_OR_WRITE_NODE, 0, target->base.location.start, value->location.end), + .base = PM_NODE_INIT_NODES(parser, PM_CONSTANT_OR_WRITE_NODE, 0, target, value), .name = target->name, .name_loc = target->base.location, .operator_loc = PM_LOCATION_TOKEN_VALUE(operator), @@ -3482,7 +3497,7 @@ pm_constant_read_node_create(pm_parser_t *parser, const pm_token_t *name) { pm_constant_read_node_t *node = PM_NODE_ALLOC(parser, pm_constant_read_node_t); *node = (pm_constant_read_node_t) { - .base = PM_NODE_INIT(parser, PM_CONSTANT_READ_NODE, 0, name->start, name->end), + .base = PM_NODE_INIT_TOKEN(parser, PM_CONSTANT_READ_NODE, 0, name), .name = pm_parser_constant_id_token(parser, name) }; @@ -3498,7 +3513,7 @@ pm_constant_write_node_create(pm_parser_t *parser, pm_constant_read_node_t *targ pm_node_flags_t flags = pm_implicit_array_write_flags(value, PM_WRITE_NODE_FLAGS_IMPLICIT_ARRAY); *node = (pm_constant_write_node_t) { - .base = PM_NODE_INIT(parser, PM_CONSTANT_WRITE_NODE, flags, target->base.location.start, value->location.end), + .base = PM_NODE_INIT_NODES(parser, PM_CONSTANT_WRITE_NODE, flags, target, value), .name = target->name, .name_loc = target->base.location, .operator_loc = PM_OPTIONAL_LOCATION_TOKEN_VALUE(operator), @@ -3653,7 +3668,7 @@ pm_embedded_statements_node_create(pm_parser_t *parser, const pm_token_t *openin pm_embedded_statements_node_t *node = PM_NODE_ALLOC(parser, pm_embedded_statements_node_t); *node = (pm_embedded_statements_node_t) { - .base = PM_NODE_INIT(parser, PM_EMBEDDED_STATEMENTS_NODE, 0, opening->start, closing->end), + .base = PM_NODE_INIT_TOKENS(parser, PM_EMBEDDED_STATEMENTS_NODE, 0, opening, closing), .opening_loc = PM_LOCATION_TOKEN_VALUE(opening), .statements = statements, .closing_loc = PM_LOCATION_TOKEN_VALUE(closing) @@ -3670,7 +3685,7 @@ pm_embedded_variable_node_create(pm_parser_t *parser, const pm_token_t *operator pm_embedded_variable_node_t *node = PM_NODE_ALLOC(parser, pm_embedded_variable_node_t); *node = (pm_embedded_variable_node_t) { - .base = PM_NODE_INIT(parser, PM_EMBEDDED_VARIABLE_NODE, 0, operator->start, variable->location.end), + .base = PM_NODE_INIT_TOKEN_NODE(parser, PM_EMBEDDED_VARIABLE_NODE, 0, operator, variable), .operator_loc = PM_LOCATION_TOKEN_VALUE(operator), .variable = variable }; @@ -3686,7 +3701,7 @@ pm_ensure_node_create(pm_parser_t *parser, const pm_token_t *ensure_keyword, pm_ pm_ensure_node_t *node = PM_NODE_ALLOC(parser, pm_ensure_node_t); *node = (pm_ensure_node_t) { - .base = PM_NODE_INIT(parser, PM_ENSURE_NODE, 0, ensure_keyword->start, end_keyword->end), + .base = PM_NODE_INIT_TOKENS(parser, PM_ENSURE_NODE, 0, ensure_keyword, end_keyword), .ensure_keyword_loc = PM_LOCATION_TOKEN_VALUE(ensure_keyword), .statements = statements, .end_keyword_loc = PM_LOCATION_TOKEN_VALUE(end_keyword) @@ -3704,7 +3719,7 @@ pm_false_node_create(pm_parser_t *parser, const pm_token_t *token) { pm_false_node_t *node = PM_NODE_ALLOC(parser, pm_false_node_t); *node = (pm_false_node_t) { - .base = PM_NODE_INIT(parser, PM_FALSE_NODE, PM_NODE_FLAG_STATIC_LITERAL, token->start, token->end) + .base = PM_NODE_INIT_TOKEN(parser, PM_FALSE_NODE, PM_NODE_FLAG_STATIC_LITERAL, token) }; return node; @@ -3739,7 +3754,7 @@ pm_find_pattern_node_create(pm_parser_t *parser, pm_node_list_t *nodes) { pm_node_t *right_splat_node = right; #endif *node = (pm_find_pattern_node_t) { - .base = PM_NODE_INIT(parser, PM_FIND_PATTERN_NODE, 0, left->location.start, right->location.end), + .base = PM_NODE_INIT_NODES(parser, PM_FIND_PATTERN_NODE, 0, left, right), .constant = NULL, .left = left_splat_node, .right = right_splat_node, @@ -3840,7 +3855,7 @@ pm_float_node_create(pm_parser_t *parser, const pm_token_t *token) { pm_float_node_t *node = PM_NODE_ALLOC(parser, pm_float_node_t); *node = (pm_float_node_t) { - .base = PM_NODE_INIT(parser, PM_FLOAT_NODE, PM_NODE_FLAG_STATIC_LITERAL, token->start, token->end), + .base = PM_NODE_INIT_TOKEN(parser, PM_FLOAT_NODE, PM_NODE_FLAG_STATIC_LITERAL, token), .value = pm_double_parse(parser, token) }; @@ -3856,7 +3871,7 @@ pm_float_node_imaginary_create(pm_parser_t *parser, const pm_token_t *token) { pm_imaginary_node_t *node = PM_NODE_ALLOC(parser, pm_imaginary_node_t); *node = (pm_imaginary_node_t) { - .base = PM_NODE_INIT(parser, PM_IMAGINARY_NODE, PM_NODE_FLAG_STATIC_LITERAL, token->start, token->end), + .base = PM_NODE_INIT_TOKEN(parser, PM_IMAGINARY_NODE, PM_NODE_FLAG_STATIC_LITERAL, token), .numeric = UP(pm_float_node_create(parser, &((pm_token_t) { .type = PM_TOKEN_FLOAT, .start = token->start, @@ -3876,7 +3891,7 @@ pm_float_node_rational_create(pm_parser_t *parser, const pm_token_t *token) { pm_rational_node_t *node = PM_NODE_ALLOC(parser, pm_rational_node_t); *node = (pm_rational_node_t) { - .base = PM_NODE_INIT(parser, PM_RATIONAL_NODE, PM_INTEGER_BASE_FLAGS_DECIMAL | PM_NODE_FLAG_STATIC_LITERAL, token->start, token->end), + .base = PM_NODE_INIT_TOKEN(parser, PM_RATIONAL_NODE, PM_INTEGER_BASE_FLAGS_DECIMAL | PM_NODE_FLAG_STATIC_LITERAL, token), .numerator = { 0 }, .denominator = { 0 } }; @@ -3925,7 +3940,7 @@ pm_float_node_rational_imaginary_create(pm_parser_t *parser, const pm_token_t *t pm_imaginary_node_t *node = PM_NODE_ALLOC(parser, pm_imaginary_node_t); *node = (pm_imaginary_node_t) { - .base = PM_NODE_INIT(parser, PM_IMAGINARY_NODE, PM_NODE_FLAG_STATIC_LITERAL, token->start, token->end), + .base = PM_NODE_INIT_TOKEN(parser, PM_IMAGINARY_NODE, PM_NODE_FLAG_STATIC_LITERAL, token), .numeric = UP(pm_float_node_rational_create(parser, &((pm_token_t) { .type = PM_TOKEN_FLOAT_RATIONAL, .start = token->start, @@ -3953,7 +3968,7 @@ pm_for_node_create( pm_for_node_t *node = PM_NODE_ALLOC(parser, pm_for_node_t); *node = (pm_for_node_t) { - .base = PM_NODE_INIT(parser, PM_FOR_NODE, 0, for_keyword->start, end_keyword->end), + .base = PM_NODE_INIT_TOKENS(parser, PM_FOR_NODE, 0, for_keyword, end_keyword), .index = index, .collection = collection, .statements = statements, @@ -3975,7 +3990,7 @@ pm_forwarding_arguments_node_create(pm_parser_t *parser, const pm_token_t *token pm_forwarding_arguments_node_t *node = PM_NODE_ALLOC(parser, pm_forwarding_arguments_node_t); *node = (pm_forwarding_arguments_node_t) { - .base = PM_NODE_INIT(parser, PM_FORWARDING_ARGUMENTS_NODE, 0, token->start, token->end) + .base = PM_NODE_INIT_TOKEN(parser, PM_FORWARDING_ARGUMENTS_NODE, 0, token) }; return node; @@ -3990,7 +4005,7 @@ pm_forwarding_parameter_node_create(pm_parser_t *parser, const pm_token_t *token pm_forwarding_parameter_node_t *node = PM_NODE_ALLOC(parser, pm_forwarding_parameter_node_t); *node = (pm_forwarding_parameter_node_t) { - .base = PM_NODE_INIT(parser, PM_FORWARDING_PARAMETER_NODE, 0, token->start, token->end) + .base = PM_NODE_INIT_TOKEN(parser, PM_FORWARDING_PARAMETER_NODE, 0, token) }; return node; @@ -4028,7 +4043,7 @@ pm_hash_pattern_node_empty_create(pm_parser_t *parser, const pm_token_t *opening pm_hash_pattern_node_t *node = PM_NODE_ALLOC(parser, pm_hash_pattern_node_t); *node = (pm_hash_pattern_node_t) { - .base = PM_NODE_INIT(parser, PM_HASH_PATTERN_NODE, 0, opening->start, closing->end), + .base = PM_NODE_INIT_TOKENS(parser, PM_HASH_PATTERN_NODE, 0, opening, closing), .constant = NULL, .opening_loc = PM_LOCATION_TOKEN_VALUE(opening), .closing_loc = PM_LOCATION_TOKEN_VALUE(closing), @@ -4109,7 +4124,7 @@ pm_global_variable_and_write_node_create(pm_parser_t *parser, pm_node_t *target, pm_global_variable_and_write_node_t *node = PM_NODE_ALLOC(parser, pm_global_variable_and_write_node_t); *node = (pm_global_variable_and_write_node_t) { - .base = PM_NODE_INIT(parser, PM_GLOBAL_VARIABLE_AND_WRITE_NODE, 0, target->location.start, value->location.end), + .base = PM_NODE_INIT_NODES(parser, PM_GLOBAL_VARIABLE_AND_WRITE_NODE, 0, target, value), .name = pm_global_variable_write_name(parser, target), .name_loc = target->location, .operator_loc = PM_LOCATION_TOKEN_VALUE(operator), @@ -4127,7 +4142,7 @@ pm_global_variable_operator_write_node_create(pm_parser_t *parser, pm_node_t *ta pm_global_variable_operator_write_node_t *node = PM_NODE_ALLOC(parser, pm_global_variable_operator_write_node_t); *node = (pm_global_variable_operator_write_node_t) { - .base = PM_NODE_INIT(parser, PM_GLOBAL_VARIABLE_OPERATOR_WRITE_NODE, 0, target->location.start, value->location.end), + .base = PM_NODE_INIT_NODES(parser, PM_GLOBAL_VARIABLE_OPERATOR_WRITE_NODE, 0, target, value), .name = pm_global_variable_write_name(parser, target), .name_loc = target->location, .binary_operator_loc = PM_LOCATION_TOKEN_VALUE(operator), @@ -4147,7 +4162,7 @@ pm_global_variable_or_write_node_create(pm_parser_t *parser, pm_node_t *target, pm_global_variable_or_write_node_t *node = PM_NODE_ALLOC(parser, pm_global_variable_or_write_node_t); *node = (pm_global_variable_or_write_node_t) { - .base = PM_NODE_INIT(parser, PM_GLOBAL_VARIABLE_OR_WRITE_NODE, 0, target->location.start, value->location.end), + .base = PM_NODE_INIT_NODES(parser, PM_GLOBAL_VARIABLE_OR_WRITE_NODE, 0, target, value), .name = pm_global_variable_write_name(parser, target), .name_loc = target->location, .operator_loc = PM_LOCATION_TOKEN_VALUE(operator), @@ -4165,7 +4180,7 @@ pm_global_variable_read_node_create(pm_parser_t *parser, const pm_token_t *name) pm_global_variable_read_node_t *node = PM_NODE_ALLOC(parser, pm_global_variable_read_node_t); *node = (pm_global_variable_read_node_t) { - .base = PM_NODE_INIT(parser, PM_GLOBAL_VARIABLE_READ_NODE, 0, name->start, name->end), + .base = PM_NODE_INIT_TOKEN(parser, PM_GLOBAL_VARIABLE_READ_NODE, 0, name), .name = pm_parser_constant_id_token(parser, name) }; @@ -4180,7 +4195,7 @@ pm_global_variable_read_node_synthesized_create(pm_parser_t *parser, pm_constant pm_global_variable_read_node_t *node = PM_NODE_ALLOC(parser, pm_global_variable_read_node_t); *node = (pm_global_variable_read_node_t) { - .base = PM_NODE_INIT(parser, PM_GLOBAL_VARIABLE_READ_NODE, 0, parser->start, parser->start), + .base = PM_NODE_INIT_UNSET(parser, PM_GLOBAL_VARIABLE_READ_NODE, 0), .name = name }; @@ -4196,7 +4211,7 @@ pm_global_variable_write_node_create(pm_parser_t *parser, pm_node_t *target, con pm_node_flags_t flags = pm_implicit_array_write_flags(value, PM_WRITE_NODE_FLAGS_IMPLICIT_ARRAY); *node = (pm_global_variable_write_node_t) { - .base = PM_NODE_INIT(parser, PM_GLOBAL_VARIABLE_WRITE_NODE, flags, target->location.start, value->location.end), + .base = PM_NODE_INIT_NODES(parser, PM_GLOBAL_VARIABLE_WRITE_NODE, flags, target, value), .name = pm_global_variable_write_name(parser, target), .name_loc = PM_LOCATION_NODE_VALUE(target), .operator_loc = PM_OPTIONAL_LOCATION_TOKEN_VALUE(operator), @@ -4214,7 +4229,7 @@ pm_global_variable_write_node_synthesized_create(pm_parser_t *parser, pm_constan pm_global_variable_write_node_t *node = PM_NODE_ALLOC(parser, pm_global_variable_write_node_t); *node = (pm_global_variable_write_node_t) { - .base = PM_NODE_INIT(parser, PM_GLOBAL_VARIABLE_WRITE_NODE, 0, parser->start, parser->start), + .base = PM_NODE_INIT_UNSET(parser, PM_GLOBAL_VARIABLE_WRITE_NODE, 0), .name = name, .name_loc = PM_LOCATION_NULL_VALUE(parser), .operator_loc = PM_LOCATION_NULL_VALUE(parser), @@ -4233,7 +4248,7 @@ pm_hash_node_create(pm_parser_t *parser, const pm_token_t *opening) { pm_hash_node_t *node = PM_NODE_ALLOC(parser, pm_hash_node_t); *node = (pm_hash_node_t) { - .base = PM_NODE_INIT(parser, PM_HASH_NODE, PM_NODE_FLAG_STATIC_LITERAL, opening->start, opening->end), + .base = PM_NODE_INIT_TOKEN(parser, PM_HASH_NODE, PM_NODE_FLAG_STATIC_LITERAL, opening), .opening_loc = PM_LOCATION_TOKEN_VALUE(opening), .closing_loc = PM_LOCATION_NULL_VALUE(parser), .elements = { 0 } @@ -4319,7 +4334,7 @@ pm_if_node_modifier_create(pm_parser_t *parser, pm_node_t *statement, const pm_t pm_statements_node_body_append(parser, statements, statement, true); *node = (pm_if_node_t) { - .base = PM_NODE_INIT(parser, PM_IF_NODE, PM_NODE_FLAG_NEWLINE, statement->location.start, predicate->location.end), + .base = PM_NODE_INIT_NODES(parser, PM_IF_NODE, PM_NODE_FLAG_NEWLINE, statement, predicate), .if_keyword_loc = PM_LOCATION_TOKEN_VALUE(if_keyword), .predicate = predicate, .then_keyword_loc = PM_OPTIONAL_LOCATION_NOT_PROVIDED_VALUE, @@ -4351,7 +4366,7 @@ pm_if_node_ternary_create(pm_parser_t *parser, pm_node_t *predicate, const pm_to pm_if_node_t *node = PM_NODE_ALLOC(parser, pm_if_node_t); *node = (pm_if_node_t) { - .base = PM_NODE_INIT(parser, PM_IF_NODE, PM_NODE_FLAG_NEWLINE, predicate->location.start, false_expression->location.end), + .base = PM_NODE_INIT_NODES(parser, PM_IF_NODE, PM_NODE_FLAG_NEWLINE, predicate, false_expression), .if_keyword_loc = PM_OPTIONAL_LOCATION_NOT_PROVIDED_VALUE, .predicate = predicate, .then_keyword_loc = PM_LOCATION_TOKEN_VALUE(qmark), @@ -4384,7 +4399,7 @@ pm_implicit_node_create(pm_parser_t *parser, pm_node_t *value) { pm_implicit_node_t *node = PM_NODE_ALLOC(parser, pm_implicit_node_t); *node = (pm_implicit_node_t) { - .base = PM_NODE_INIT(parser, PM_IMPLICIT_NODE, 0, value->location.start, value->location.end), + .base = PM_NODE_INIT_NODE(parser, PM_IMPLICIT_NODE, 0, value), .value = value }; @@ -4401,7 +4416,7 @@ pm_implicit_rest_node_create(pm_parser_t *parser, const pm_token_t *token) { pm_implicit_rest_node_t *node = PM_NODE_ALLOC(parser, pm_implicit_rest_node_t); *node = (pm_implicit_rest_node_t) { - .base = PM_NODE_INIT(parser, PM_IMPLICIT_REST_NODE, 0, token->start, token->end) + .base = PM_NODE_INIT_TOKEN(parser, PM_IMPLICIT_REST_NODE, 0, token) }; return node; @@ -4416,7 +4431,7 @@ pm_integer_node_create(pm_parser_t *parser, pm_node_flags_t base, const pm_token pm_integer_node_t *node = PM_NODE_ALLOC(parser, pm_integer_node_t); *node = (pm_integer_node_t) { - .base = PM_NODE_INIT(parser, PM_INTEGER_NODE, base | PM_NODE_FLAG_STATIC_LITERAL, token->start, token->end), + .base = PM_NODE_INIT_TOKEN(parser, PM_INTEGER_NODE, base | PM_NODE_FLAG_STATIC_LITERAL, token), .value = { 0 } }; @@ -4443,7 +4458,7 @@ pm_integer_node_imaginary_create(pm_parser_t *parser, pm_node_flags_t base, cons pm_imaginary_node_t *node = PM_NODE_ALLOC(parser, pm_imaginary_node_t); *node = (pm_imaginary_node_t) { - .base = PM_NODE_INIT(parser, PM_IMAGINARY_NODE, PM_NODE_FLAG_STATIC_LITERAL, token->start, token->end), + .base = PM_NODE_INIT_TOKEN(parser, PM_IMAGINARY_NODE, PM_NODE_FLAG_STATIC_LITERAL, token), .numeric = UP(pm_integer_node_create(parser, base, &((pm_token_t) { .type = PM_TOKEN_INTEGER, .start = token->start, @@ -4464,7 +4479,7 @@ pm_integer_node_rational_create(pm_parser_t *parser, pm_node_flags_t base, const pm_rational_node_t *node = PM_NODE_ALLOC(parser, pm_rational_node_t); *node = (pm_rational_node_t) { - .base = PM_NODE_INIT(parser, PM_RATIONAL_NODE, base | PM_NODE_FLAG_STATIC_LITERAL, token->start, token->end), + .base = PM_NODE_INIT_TOKEN(parser, PM_RATIONAL_NODE, base | PM_NODE_FLAG_STATIC_LITERAL, token), .numerator = { 0 }, .denominator = { .value = 1, 0 } }; @@ -4493,7 +4508,7 @@ pm_integer_node_rational_imaginary_create(pm_parser_t *parser, pm_node_flags_t b pm_imaginary_node_t *node = PM_NODE_ALLOC(parser, pm_imaginary_node_t); *node = (pm_imaginary_node_t) { - .base = PM_NODE_INIT(parser, PM_IMAGINARY_NODE, PM_NODE_FLAG_STATIC_LITERAL, token->start, token->end), + .base = PM_NODE_INIT_TOKEN(parser, PM_IMAGINARY_NODE, PM_NODE_FLAG_STATIC_LITERAL, token), .numeric = UP(pm_integer_node_rational_create(parser, base, &((pm_token_t) { .type = PM_TOKEN_INTEGER_RATIONAL, .start = token->start, @@ -4540,7 +4555,7 @@ pm_instance_variable_and_write_node_create(pm_parser_t *parser, pm_instance_vari pm_instance_variable_and_write_node_t *node = PM_NODE_ALLOC(parser, pm_instance_variable_and_write_node_t); *node = (pm_instance_variable_and_write_node_t) { - .base = PM_NODE_INIT(parser, PM_INSTANCE_VARIABLE_AND_WRITE_NODE, 0, target->base.location.start, value->location.end), + .base = PM_NODE_INIT_NODES(parser, PM_INSTANCE_VARIABLE_AND_WRITE_NODE, 0, target, value), .name = target->name, .name_loc = target->base.location, .operator_loc = PM_LOCATION_TOKEN_VALUE(operator), @@ -4558,7 +4573,7 @@ pm_instance_variable_operator_write_node_create(pm_parser_t *parser, pm_instance pm_instance_variable_operator_write_node_t *node = PM_NODE_ALLOC(parser, pm_instance_variable_operator_write_node_t); *node = (pm_instance_variable_operator_write_node_t) { - .base = PM_NODE_INIT(parser, PM_INSTANCE_VARIABLE_OPERATOR_WRITE_NODE, 0, target->base.location.start, value->location.end), + .base = PM_NODE_INIT_NODES(parser, PM_INSTANCE_VARIABLE_OPERATOR_WRITE_NODE, 0, target, value), .name = target->name, .name_loc = target->base.location, .binary_operator_loc = PM_LOCATION_TOKEN_VALUE(operator), @@ -4578,7 +4593,7 @@ pm_instance_variable_or_write_node_create(pm_parser_t *parser, pm_instance_varia pm_instance_variable_or_write_node_t *node = PM_NODE_ALLOC(parser, pm_instance_variable_or_write_node_t); *node = (pm_instance_variable_or_write_node_t) { - .base = PM_NODE_INIT(parser, PM_INSTANCE_VARIABLE_OR_WRITE_NODE, 0, target->base.location.start, value->location.end), + .base = PM_NODE_INIT_NODES(parser, PM_INSTANCE_VARIABLE_OR_WRITE_NODE, 0, target, value), .name = target->name, .name_loc = target->base.location, .operator_loc = PM_LOCATION_TOKEN_VALUE(operator), @@ -4597,7 +4612,7 @@ pm_instance_variable_read_node_create(pm_parser_t *parser, const pm_token_t *tok pm_instance_variable_read_node_t *node = PM_NODE_ALLOC(parser, pm_instance_variable_read_node_t); *node = (pm_instance_variable_read_node_t) { - .base = PM_NODE_INIT(parser, PM_INSTANCE_VARIABLE_READ_NODE, 0, token->start, token->end), + .base = PM_NODE_INIT_TOKEN(parser, PM_INSTANCE_VARIABLE_READ_NODE, 0, token), .name = pm_parser_constant_id_token(parser, token) }; @@ -4614,7 +4629,7 @@ pm_instance_variable_write_node_create(pm_parser_t *parser, pm_instance_variable pm_node_flags_t flags = pm_implicit_array_write_flags(value, PM_WRITE_NODE_FLAGS_IMPLICIT_ARRAY); *node = (pm_instance_variable_write_node_t) { - .base = PM_NODE_INIT(parser, PM_INSTANCE_VARIABLE_WRITE_NODE, flags, read_node->base.location.start, value->location.end), + .base = PM_NODE_INIT_NODES(parser, PM_INSTANCE_VARIABLE_WRITE_NODE, flags, read_node, value), .name = read_node->name, .name_loc = PM_LOCATION_NODE_BASE_VALUE(read_node), .operator_loc = PM_OPTIONAL_LOCATION_TOKEN_VALUE(operator), @@ -4835,7 +4850,7 @@ pm_interpolated_string_node_create(pm_parser_t *parser, const pm_token_t *openin } *node = (pm_interpolated_string_node_t) { - .base = PM_NODE_INIT(parser, PM_INTERPOLATED_STRING_NODE, flags, opening->start, closing->end), + .base = PM_NODE_INIT_TOKENS(parser, PM_INTERPOLATED_STRING_NODE, flags, opening, closing), .opening_loc = PM_OPTIONAL_LOCATION_TOKEN_VALUE(opening), .closing_loc = PM_OPTIONAL_LOCATION_TOKEN_VALUE(closing), .parts = { 0 } @@ -4884,7 +4899,7 @@ pm_interpolated_symbol_node_create(pm_parser_t *parser, const pm_token_t *openin pm_interpolated_symbol_node_t *node = PM_NODE_ALLOC(parser, pm_interpolated_symbol_node_t); *node = (pm_interpolated_symbol_node_t) { - .base = PM_NODE_INIT(parser, PM_INTERPOLATED_SYMBOL_NODE, PM_NODE_FLAG_STATIC_LITERAL, opening->start, closing->end), + .base = PM_NODE_INIT_TOKENS(parser, PM_INTERPOLATED_SYMBOL_NODE, PM_NODE_FLAG_STATIC_LITERAL, opening, closing), .opening_loc = PM_OPTIONAL_LOCATION_TOKEN_VALUE(opening), .closing_loc = PM_OPTIONAL_LOCATION_TOKEN_VALUE(closing), .parts = { 0 } @@ -4908,7 +4923,7 @@ pm_interpolated_xstring_node_create(pm_parser_t *parser, const pm_token_t *openi pm_interpolated_x_string_node_t *node = PM_NODE_ALLOC(parser, pm_interpolated_x_string_node_t); *node = (pm_interpolated_x_string_node_t) { - .base = PM_NODE_INIT(parser, PM_INTERPOLATED_X_STRING_NODE, 0, opening->start, closing->end), + .base = PM_NODE_INIT_TOKENS(parser, PM_INTERPOLATED_X_STRING_NODE, 0, opening, closing), .opening_loc = PM_OPTIONAL_LOCATION_TOKEN_VALUE(opening), .closing_loc = PM_OPTIONAL_LOCATION_TOKEN_VALUE(closing), .parts = { 0 } @@ -4937,7 +4952,7 @@ pm_it_local_variable_read_node_create(pm_parser_t *parser, const pm_token_t *nam pm_it_local_variable_read_node_t *node = PM_NODE_ALLOC(parser, pm_it_local_variable_read_node_t); *node = (pm_it_local_variable_read_node_t) { - .base = PM_NODE_INIT(parser, PM_IT_LOCAL_VARIABLE_READ_NODE, 0, name->start, name->end), + .base = PM_NODE_INIT_TOKEN(parser, PM_IT_LOCAL_VARIABLE_READ_NODE, 0, name), }; return node; @@ -4951,7 +4966,7 @@ pm_it_parameters_node_create(pm_parser_t *parser, const pm_token_t *opening, con pm_it_parameters_node_t *node = PM_NODE_ALLOC(parser, pm_it_parameters_node_t); *node = (pm_it_parameters_node_t) { - .base = PM_NODE_INIT(parser, PM_IT_PARAMETERS_NODE, 0, opening->start, closing->end), + .base = PM_NODE_INIT_TOKENS(parser, PM_IT_PARAMETERS_NODE, 0, opening, closing), }; return node; @@ -4998,7 +5013,7 @@ pm_required_keyword_parameter_node_create(pm_parser_t *parser, const pm_token_t pm_required_keyword_parameter_node_t *node = PM_NODE_ALLOC(parser, pm_required_keyword_parameter_node_t); *node = (pm_required_keyword_parameter_node_t) { - .base = PM_NODE_INIT(parser, PM_REQUIRED_KEYWORD_PARAMETER_NODE, 0, name->start, name->end), + .base = PM_NODE_INIT_TOKEN(parser, PM_REQUIRED_KEYWORD_PARAMETER_NODE, 0, name), .name = pm_parser_constant_id_location(parser, name->start, name->end - 1), .name_loc = PM_LOCATION_TOKEN_VALUE(name), }; @@ -5014,7 +5029,7 @@ pm_optional_keyword_parameter_node_create(pm_parser_t *parser, const pm_token_t pm_optional_keyword_parameter_node_t *node = PM_NODE_ALLOC(parser, pm_optional_keyword_parameter_node_t); *node = (pm_optional_keyword_parameter_node_t) { - .base = PM_NODE_INIT(parser, PM_OPTIONAL_KEYWORD_PARAMETER_NODE, 0, name->start, value->location.end), + .base = PM_NODE_INIT_TOKEN_NODE(parser, PM_OPTIONAL_KEYWORD_PARAMETER_NODE, 0, name, value), .name = pm_parser_constant_id_location(parser, name->start, name->end - 1), .name_loc = PM_LOCATION_TOKEN_VALUE(name), .value = value @@ -5056,7 +5071,7 @@ pm_lambda_node_create( pm_lambda_node_t *node = PM_NODE_ALLOC(parser, pm_lambda_node_t); *node = (pm_lambda_node_t) { - .base = PM_NODE_INIT(parser, PM_LAMBDA_NODE, 0, operator->start, closing->end), + .base = PM_NODE_INIT_TOKENS(parser, PM_LAMBDA_NODE, 0, operator, closing), .locals = *locals, .operator_loc = PM_LOCATION_TOKEN_VALUE(operator), .opening_loc = PM_LOCATION_TOKEN_VALUE(opening), @@ -5078,7 +5093,7 @@ pm_local_variable_and_write_node_create(pm_parser_t *parser, pm_node_t *target, pm_local_variable_and_write_node_t *node = PM_NODE_ALLOC(parser, pm_local_variable_and_write_node_t); *node = (pm_local_variable_and_write_node_t) { - .base = PM_NODE_INIT(parser, PM_LOCAL_VARIABLE_AND_WRITE_NODE, 0, target->location.start, value->location.end), + .base = PM_NODE_INIT_NODES(parser, PM_LOCAL_VARIABLE_AND_WRITE_NODE, 0, target, value), .name_loc = target->location, .operator_loc = PM_LOCATION_TOKEN_VALUE(operator), .value = value, @@ -5097,7 +5112,7 @@ pm_local_variable_operator_write_node_create(pm_parser_t *parser, pm_node_t *tar pm_local_variable_operator_write_node_t *node = PM_NODE_ALLOC(parser, pm_local_variable_operator_write_node_t); *node = (pm_local_variable_operator_write_node_t) { - .base = PM_NODE_INIT(parser, PM_LOCAL_VARIABLE_OPERATOR_WRITE_NODE, 0, target->location.start, value->location.end), + .base = PM_NODE_INIT_NODES(parser, PM_LOCAL_VARIABLE_OPERATOR_WRITE_NODE, 0, target, value), .name_loc = target->location, .binary_operator_loc = PM_LOCATION_TOKEN_VALUE(operator), .value = value, @@ -5119,7 +5134,7 @@ pm_local_variable_or_write_node_create(pm_parser_t *parser, pm_node_t *target, c pm_local_variable_or_write_node_t *node = PM_NODE_ALLOC(parser, pm_local_variable_or_write_node_t); *node = (pm_local_variable_or_write_node_t) { - .base = PM_NODE_INIT(parser, PM_LOCAL_VARIABLE_OR_WRITE_NODE, 0, target->location.start, value->location.end), + .base = PM_NODE_INIT_NODES(parser, PM_LOCAL_VARIABLE_OR_WRITE_NODE, 0, target, value), .name_loc = target->location, .operator_loc = PM_LOCATION_TOKEN_VALUE(operator), .value = value, @@ -5140,7 +5155,7 @@ pm_local_variable_read_node_create_constant_id(pm_parser_t *parser, const pm_tok pm_local_variable_read_node_t *node = PM_NODE_ALLOC(parser, pm_local_variable_read_node_t); *node = (pm_local_variable_read_node_t) { - .base = PM_NODE_INIT(parser, PM_LOCAL_VARIABLE_READ_NODE, 0, name->start, name->end), + .base = PM_NODE_INIT_TOKEN(parser, PM_LOCAL_VARIABLE_READ_NODE, 0, name), .name = name_id, .depth = depth }; @@ -5243,7 +5258,7 @@ pm_match_predicate_node_create(pm_parser_t *parser, pm_node_t *value, pm_node_t pm_match_predicate_node_t *node = PM_NODE_ALLOC(parser, pm_match_predicate_node_t); *node = (pm_match_predicate_node_t) { - .base = PM_NODE_INIT(parser, PM_MATCH_PREDICATE_NODE, 0, value->location.start, pattern->location.end), + .base = PM_NODE_INIT_NODES(parser, PM_MATCH_PREDICATE_NODE, 0, value, pattern), .value = value, .pattern = pattern, .operator_loc = PM_LOCATION_TOKEN_VALUE(operator) @@ -5262,7 +5277,7 @@ pm_match_required_node_create(pm_parser_t *parser, pm_node_t *value, pm_node_t * pm_match_required_node_t *node = PM_NODE_ALLOC(parser, pm_match_required_node_t); *node = (pm_match_required_node_t) { - .base = PM_NODE_INIT(parser, PM_MATCH_REQUIRED_NODE, 0, value->location.start, pattern->location.end), + .base = PM_NODE_INIT_NODES(parser, PM_MATCH_REQUIRED_NODE, 0, value, pattern), .value = value, .pattern = pattern, .operator_loc = PM_LOCATION_TOKEN_VALUE(operator) @@ -5279,7 +5294,7 @@ pm_match_write_node_create(pm_parser_t *parser, pm_call_node_t *call) { pm_match_write_node_t *node = PM_NODE_ALLOC(parser, pm_match_write_node_t); *node = (pm_match_write_node_t) { - .base = PM_NODE_INIT(parser, PM_MATCH_WRITE_NODE, 0, call->base.location.start, call->base.location.end), + .base = PM_NODE_INIT_NODE(parser, PM_MATCH_WRITE_NODE, 0, call), .call = call, .targets = { 0 } }; @@ -5295,7 +5310,7 @@ pm_module_node_create(pm_parser_t *parser, pm_constant_id_list_t *locals, const pm_module_node_t *node = PM_NODE_ALLOC(parser, pm_module_node_t); *node = (pm_module_node_t) { - .base = PM_NODE_INIT(parser, PM_MODULE_NODE, 0, module_keyword->start, end_keyword->end), + .base = PM_NODE_INIT_TOKENS(parser, PM_MODULE_NODE, 0, module_keyword, end_keyword), .locals = (locals == NULL ? ((pm_constant_id_list_t) { .ids = NULL, .size = 0, .capacity = 0 }) : *locals), .module_keyword_loc = PM_LOCATION_TOKEN_VALUE(module_keyword), .constant_path = constant_path, @@ -5387,7 +5402,7 @@ pm_multi_write_node_create(pm_parser_t *parser, pm_multi_target_node_t *target, pm_node_flags_t flags = pm_implicit_array_write_flags(value, PM_WRITE_NODE_FLAGS_IMPLICIT_ARRAY); *node = (pm_multi_write_node_t) { - .base = PM_NODE_INIT(parser, PM_MULTI_WRITE_NODE, flags, target->base.location.start, value->location.end), + .base = PM_NODE_INIT_NODES(parser, PM_MULTI_WRITE_NODE, flags, target, value), .lefts = target->lefts, .rest = target->rest, .rights = target->rights, @@ -5430,7 +5445,7 @@ pm_nil_node_create(pm_parser_t *parser, const pm_token_t *token) { pm_nil_node_t *node = PM_NODE_ALLOC(parser, pm_nil_node_t); *node = (pm_nil_node_t) { - .base = PM_NODE_INIT(parser, PM_NIL_NODE, PM_NODE_FLAG_STATIC_LITERAL, token->start, token->end) + .base = PM_NODE_INIT_TOKEN(parser, PM_NIL_NODE, PM_NODE_FLAG_STATIC_LITERAL, token) }; return node; @@ -5446,7 +5461,7 @@ pm_no_keywords_parameter_node_create(pm_parser_t *parser, const pm_token_t *oper pm_no_keywords_parameter_node_t *node = PM_NODE_ALLOC(parser, pm_no_keywords_parameter_node_t); *node = (pm_no_keywords_parameter_node_t) { - .base = PM_NODE_INIT(parser, PM_NO_KEYWORDS_PARAMETER_NODE, 0, operator->start, keyword->end), + .base = PM_NODE_INIT_TOKENS(parser, PM_NO_KEYWORDS_PARAMETER_NODE, 0, operator, keyword), .operator_loc = PM_LOCATION_TOKEN_VALUE(operator), .keyword_loc = PM_LOCATION_TOKEN_VALUE(keyword) }; @@ -5527,7 +5542,7 @@ pm_numbered_reference_read_node_create(pm_parser_t *parser, const pm_token_t *na pm_numbered_reference_read_node_t *node = PM_NODE_ALLOC(parser, pm_numbered_reference_read_node_t); *node = (pm_numbered_reference_read_node_t) { - .base = PM_NODE_INIT(parser, PM_NUMBERED_REFERENCE_READ_NODE, 0, name->start, name->end), + .base = PM_NODE_INIT_TOKEN(parser, PM_NUMBERED_REFERENCE_READ_NODE, 0, name), .number = pm_numbered_reference_read_node_number(parser, name) }; @@ -5542,7 +5557,7 @@ pm_optional_parameter_node_create(pm_parser_t *parser, const pm_token_t *name, c pm_optional_parameter_node_t *node = PM_NODE_ALLOC(parser, pm_optional_parameter_node_t); *node = (pm_optional_parameter_node_t) { - .base = PM_NODE_INIT(parser, PM_OPTIONAL_PARAMETER_NODE, 0, name->start, value->location.end), + .base = PM_NODE_INIT_TOKEN_NODE(parser, PM_OPTIONAL_PARAMETER_NODE, 0, name, value), .name = pm_parser_constant_id_token(parser, name), .name_loc = PM_LOCATION_TOKEN_VALUE(name), .operator_loc = PM_LOCATION_TOKEN_VALUE(operator), @@ -5562,7 +5577,7 @@ pm_or_node_create(pm_parser_t *parser, pm_node_t *left, const pm_token_t *operat pm_or_node_t *node = PM_NODE_ALLOC(parser, pm_or_node_t); *node = (pm_or_node_t) { - .base = PM_NODE_INIT(parser, PM_OR_NODE, 0, left->location.start, right->location.end), + .base = PM_NODE_INIT_NODES(parser, PM_OR_NODE, 0, left, right), .left = left, .right = right, .operator_loc = PM_LOCATION_TOKEN_VALUE(operator) @@ -5702,7 +5717,7 @@ pm_parentheses_node_create(pm_parser_t *parser, const pm_token_t *opening, pm_no pm_parentheses_node_t *node = PM_NODE_ALLOC(parser, pm_parentheses_node_t); *node = (pm_parentheses_node_t) { - .base = PM_NODE_INIT(parser, PM_PARENTHESES_NODE, flags, opening->start, closing->end), + .base = PM_NODE_INIT_TOKENS(parser, PM_PARENTHESES_NODE, flags, opening, closing), .body = body, .opening_loc = PM_LOCATION_TOKEN_VALUE(opening), .closing_loc = PM_LOCATION_TOKEN_VALUE(closing) @@ -5719,7 +5734,7 @@ pm_pinned_expression_node_create(pm_parser_t *parser, pm_node_t *expression, con pm_pinned_expression_node_t *node = PM_NODE_ALLOC(parser, pm_pinned_expression_node_t); *node = (pm_pinned_expression_node_t) { - .base = PM_NODE_INIT(parser, PM_PINNED_EXPRESSION_NODE, 0, operator->start, rparen->end), + .base = PM_NODE_INIT_TOKENS(parser, PM_PINNED_EXPRESSION_NODE, 0, operator, rparen), .expression = expression, .operator_loc = PM_LOCATION_TOKEN_VALUE(operator), .lparen_loc = PM_LOCATION_TOKEN_VALUE(lparen), @@ -5737,7 +5752,7 @@ pm_pinned_variable_node_create(pm_parser_t *parser, const pm_token_t *operator, pm_pinned_variable_node_t *node = PM_NODE_ALLOC(parser, pm_pinned_variable_node_t); *node = (pm_pinned_variable_node_t) { - .base = PM_NODE_INIT(parser, PM_PINNED_VARIABLE_NODE, 0, operator->start, variable->location.end), + .base = PM_NODE_INIT_TOKEN_NODE(parser, PM_PINNED_VARIABLE_NODE, 0, operator, variable), .variable = variable, .operator_loc = PM_LOCATION_TOKEN_VALUE(operator) }; @@ -5753,7 +5768,7 @@ pm_post_execution_node_create(pm_parser_t *parser, const pm_token_t *keyword, co pm_post_execution_node_t *node = PM_NODE_ALLOC(parser, pm_post_execution_node_t); *node = (pm_post_execution_node_t) { - .base = PM_NODE_INIT(parser, PM_POST_EXECUTION_NODE, 0, keyword->start, closing->end), + .base = PM_NODE_INIT_TOKENS(parser, PM_POST_EXECUTION_NODE, 0, keyword, closing), .statements = statements, .keyword_loc = PM_LOCATION_TOKEN_VALUE(keyword), .opening_loc = PM_LOCATION_TOKEN_VALUE(opening), @@ -5771,7 +5786,7 @@ pm_pre_execution_node_create(pm_parser_t *parser, const pm_token_t *keyword, con pm_pre_execution_node_t *node = PM_NODE_ALLOC(parser, pm_pre_execution_node_t); *node = (pm_pre_execution_node_t) { - .base = PM_NODE_INIT(parser, PM_PRE_EXECUTION_NODE, 0, keyword->start, closing->end), + .base = PM_NODE_INIT_TOKENS(parser, PM_PRE_EXECUTION_NODE, 0, keyword, closing), .statements = statements, .keyword_loc = PM_LOCATION_TOKEN_VALUE(keyword), .opening_loc = PM_LOCATION_TOKEN_VALUE(opening), @@ -5826,7 +5841,7 @@ pm_redo_node_create(pm_parser_t *parser, const pm_token_t *token) { pm_redo_node_t *node = PM_NODE_ALLOC(parser, pm_redo_node_t); *node = (pm_redo_node_t) { - .base = PM_NODE_INIT(parser, PM_REDO_NODE, 0, token->start, token->end) + .base = PM_NODE_INIT_TOKEN(parser, PM_REDO_NODE, 0, token) }; return node; @@ -5868,7 +5883,7 @@ pm_required_parameter_node_create(pm_parser_t *parser, const pm_token_t *token) pm_required_parameter_node_t *node = PM_NODE_ALLOC(parser, pm_required_parameter_node_t); *node = (pm_required_parameter_node_t) { - .base = PM_NODE_INIT(parser, PM_REQUIRED_PARAMETER_NODE, 0, token->start, token->end), + .base = PM_NODE_INIT_TOKEN(parser, PM_REQUIRED_PARAMETER_NODE, 0, token), .name = pm_parser_constant_id_token(parser, token) }; @@ -5883,7 +5898,7 @@ pm_rescue_modifier_node_create(pm_parser_t *parser, pm_node_t *expression, const pm_rescue_modifier_node_t *node = PM_NODE_ALLOC(parser, pm_rescue_modifier_node_t); *node = (pm_rescue_modifier_node_t) { - .base = PM_NODE_INIT(parser, PM_RESCUE_MODIFIER_NODE, 0, expression->location.start, rescue_expression->location.end), + .base = PM_NODE_INIT_NODES(parser, PM_RESCUE_MODIFIER_NODE, 0, expression, rescue_expression), .expression = expression, .keyword_loc = PM_LOCATION_TOKEN_VALUE(keyword), .rescue_expression = rescue_expression @@ -5900,7 +5915,7 @@ pm_rescue_node_create(pm_parser_t *parser, const pm_token_t *keyword) { pm_rescue_node_t *node = PM_NODE_ALLOC(parser, pm_rescue_node_t); *node = (pm_rescue_node_t) { - .base = PM_NODE_INIT(parser, PM_RESCUE_NODE, 0, keyword->start, keyword->end), + .base = PM_NODE_INIT_TOKEN(parser, PM_RESCUE_NODE, 0, keyword), .keyword_loc = PM_LOCATION_TOKEN_VALUE(keyword), .operator_loc = PM_OPTIONAL_LOCATION_NOT_PROVIDED_VALUE, .then_keyword_loc = PM_OPTIONAL_LOCATION_NOT_PROVIDED_VALUE, @@ -5982,7 +5997,7 @@ pm_retry_node_create(pm_parser_t *parser, const pm_token_t *token) { pm_retry_node_t *node = PM_NODE_ALLOC(parser, pm_retry_node_t); *node = (pm_retry_node_t) { - .base = PM_NODE_INIT(parser, PM_RETRY_NODE, 0, token->start, token->end) + .base = PM_NODE_INIT_TOKEN(parser, PM_RETRY_NODE, 0, token) }; return node; @@ -6013,7 +6028,7 @@ pm_self_node_create(pm_parser_t *parser, const pm_token_t *token) { pm_self_node_t *node = PM_NODE_ALLOC(parser, pm_self_node_t); *node = (pm_self_node_t) { - .base = PM_NODE_INIT(parser, PM_SELF_NODE, 0, token->start, token->end) + .base = PM_NODE_INIT_TOKEN(parser, PM_SELF_NODE, 0, token) }; return node; @@ -6027,7 +6042,7 @@ pm_shareable_constant_node_create(pm_parser_t *parser, pm_node_t *write, pm_shar pm_shareable_constant_node_t *node = PM_NODE_ALLOC(parser, pm_shareable_constant_node_t); *node = (pm_shareable_constant_node_t) { - .base = PM_NODE_INIT(parser, PM_SHAREABLE_CONSTANT_NODE, (pm_node_flags_t) value, write->location.start, write->location.end), + .base = PM_NODE_INIT_NODE(parser, PM_SHAREABLE_CONSTANT_NODE, (pm_node_flags_t) value, write), .write = write }; @@ -6042,7 +6057,7 @@ pm_singleton_class_node_create(pm_parser_t *parser, pm_constant_id_list_t *local pm_singleton_class_node_t *node = PM_NODE_ALLOC(parser, pm_singleton_class_node_t); *node = (pm_singleton_class_node_t) { - .base = PM_NODE_INIT(parser, PM_SINGLETON_CLASS_NODE, 0, class_keyword->start, end_keyword->end), + .base = PM_NODE_INIT_TOKENS(parser, PM_SINGLETON_CLASS_NODE, 0, class_keyword, end_keyword), .locals = *locals, .class_keyword_loc = PM_LOCATION_TOKEN_VALUE(class_keyword), .operator_loc = PM_LOCATION_TOKEN_VALUE(operator), @@ -6063,7 +6078,7 @@ pm_source_encoding_node_create(pm_parser_t *parser, const pm_token_t *token) { pm_source_encoding_node_t *node = PM_NODE_ALLOC(parser, pm_source_encoding_node_t); *node = (pm_source_encoding_node_t) { - .base = PM_NODE_INIT(parser, PM_SOURCE_ENCODING_NODE, PM_NODE_FLAG_STATIC_LITERAL, token->start, token->end) + .base = PM_NODE_INIT_TOKEN(parser, PM_SOURCE_ENCODING_NODE, PM_NODE_FLAG_STATIC_LITERAL, token) }; return node; @@ -6089,7 +6104,7 @@ pm_source_file_node_create(pm_parser_t *parser, const pm_token_t *file_keyword) } *node = (pm_source_file_node_t) { - .base = PM_NODE_INIT(parser, PM_SOURCE_FILE_NODE, flags, file_keyword->start, file_keyword->end), + .base = PM_NODE_INIT_TOKEN(parser, PM_SOURCE_FILE_NODE, flags, file_keyword), .filepath = parser->filepath }; @@ -6105,7 +6120,7 @@ pm_source_line_node_create(pm_parser_t *parser, const pm_token_t *token) { pm_source_line_node_t *node = PM_NODE_ALLOC(parser, pm_source_line_node_t); *node = (pm_source_line_node_t) { - .base = PM_NODE_INIT(parser, PM_SOURCE_LINE_NODE, PM_NODE_FLAG_STATIC_LITERAL, token->start, token->end) + .base = PM_NODE_INIT_TOKEN(parser, PM_SOURCE_LINE_NODE, PM_NODE_FLAG_STATIC_LITERAL, token) }; return node; @@ -6135,7 +6150,7 @@ pm_statements_node_create(pm_parser_t *parser) { pm_statements_node_t *node = PM_NODE_ALLOC(parser, pm_statements_node_t); *node = (pm_statements_node_t) { - .base = PM_NODE_INIT(parser, PM_STATEMENTS_NODE, 0, parser->start, parser->start), + .base = PM_NODE_INIT_UNSET(parser, PM_STATEMENTS_NODE, 0), .body = { 0 } }; @@ -6581,7 +6596,7 @@ pm_symbol_node_synthesized_create(pm_parser_t *parser, const char *content) { pm_symbol_node_t *node = PM_NODE_ALLOC(parser, pm_symbol_node_t); *node = (pm_symbol_node_t) { - .base = PM_NODE_INIT(parser, PM_SYMBOL_NODE, PM_NODE_FLAG_STATIC_LITERAL | PM_SYMBOL_FLAGS_FORCED_US_ASCII_ENCODING, parser->start, parser->start), + .base = PM_NODE_INIT_UNSET(parser, PM_SYMBOL_NODE, PM_NODE_FLAG_STATIC_LITERAL | PM_SYMBOL_FLAGS_FORCED_US_ASCII_ENCODING), .value_loc = PM_LOCATION_NULL_VALUE(parser), .unescaped = { 0 } }; @@ -6619,7 +6634,7 @@ pm_string_node_to_symbol_node(pm_parser_t *parser, pm_string_node_t *node, const pm_symbol_node_t *new_node = PM_NODE_ALLOC(parser, pm_symbol_node_t); *new_node = (pm_symbol_node_t) { - .base = PM_NODE_INIT(parser, PM_SYMBOL_NODE, PM_NODE_FLAG_STATIC_LITERAL, opening->start, closing->end), + .base = PM_NODE_INIT_TOKENS(parser, PM_SYMBOL_NODE, PM_NODE_FLAG_STATIC_LITERAL, opening, closing), .opening_loc = PM_OPTIONAL_LOCATION_TOKEN_VALUE(opening), .value_loc = node->content_loc, .closing_loc = PM_OPTIONAL_LOCATION_TOKEN_VALUE(closing), @@ -6655,7 +6670,7 @@ pm_symbol_node_to_string_node(pm_parser_t *parser, pm_symbol_node_t *node) { } *new_node = (pm_string_node_t) { - .base = PM_NODE_INIT(parser, PM_STRING_NODE, flags, node->base.location.start, node->base.location.end), + .base = PM_NODE_INIT_NODE(parser, PM_STRING_NODE, flags, node), .opening_loc = node->opening_loc, .content_loc = node->value_loc, .closing_loc = node->closing_loc, @@ -6679,7 +6694,7 @@ pm_true_node_create(pm_parser_t *parser, const pm_token_t *token) { pm_true_node_t *node = PM_NODE_ALLOC(parser, pm_true_node_t); *node = (pm_true_node_t) { - .base = PM_NODE_INIT(parser, PM_TRUE_NODE, PM_NODE_FLAG_STATIC_LITERAL, token->start, token->end) + .base = PM_NODE_INIT_TOKEN(parser, PM_TRUE_NODE, PM_NODE_FLAG_STATIC_LITERAL, token) }; return node; @@ -6693,7 +6708,7 @@ pm_true_node_synthesized_create(pm_parser_t *parser) { pm_true_node_t *node = PM_NODE_ALLOC(parser, pm_true_node_t); *node = (pm_true_node_t) { - .base = PM_NODE_INIT(parser, PM_TRUE_NODE, PM_NODE_FLAG_STATIC_LITERAL, parser->start, parser->end) + .base = PM_NODE_INIT_UNSET(parser, PM_TRUE_NODE, PM_NODE_FLAG_STATIC_LITERAL) }; return node; @@ -6708,7 +6723,7 @@ pm_undef_node_create(pm_parser_t *parser, const pm_token_t *token) { pm_undef_node_t *node = PM_NODE_ALLOC(parser, pm_undef_node_t); *node = (pm_undef_node_t) { - .base = PM_NODE_INIT(parser, PM_UNDEF_NODE, 0, token->start, token->end), + .base = PM_NODE_INIT_TOKEN(parser, PM_UNDEF_NODE, 0, token), .keyword_loc = PM_LOCATION_TOKEN_VALUE(token), .names = { 0 } }; @@ -6765,7 +6780,7 @@ pm_unless_node_modifier_create(pm_parser_t *parser, pm_node_t *statement, const pm_statements_node_body_append(parser, statements, statement, true); *node = (pm_unless_node_t) { - .base = PM_NODE_INIT(parser, PM_UNLESS_NODE, PM_NODE_FLAG_NEWLINE, statement->location.start, predicate->location.end), + .base = PM_NODE_INIT_NODES(parser, PM_UNLESS_NODE, PM_NODE_FLAG_NEWLINE, statement, predicate), .keyword_loc = PM_LOCATION_TOKEN_VALUE(unless_keyword), .predicate = predicate, .then_keyword_loc = PM_OPTIONAL_LOCATION_NOT_PROVIDED_VALUE, @@ -6815,7 +6830,7 @@ pm_until_node_create(pm_parser_t *parser, const pm_token_t *keyword, const pm_to pm_conditional_predicate(parser, predicate, PM_CONDITIONAL_PREDICATE_TYPE_CONDITIONAL); *node = (pm_until_node_t) { - .base = PM_NODE_INIT(parser, PM_UNTIL_NODE, flags, keyword->start, closing->end), + .base = PM_NODE_INIT_TOKENS(parser, PM_UNTIL_NODE, flags, keyword, closing), .keyword_loc = PM_LOCATION_TOKEN_VALUE(keyword), .do_keyword_loc = PM_OPTIONAL_LOCATION_TOKEN_VALUE(do_keyword), .closing_loc = PM_OPTIONAL_LOCATION_TOKEN_VALUE(closing), @@ -6836,7 +6851,7 @@ pm_until_node_modifier_create(pm_parser_t *parser, const pm_token_t *keyword, pm pm_loop_modifier_block_exits(parser, statements); *node = (pm_until_node_t) { - .base = PM_NODE_INIT(parser, PM_UNTIL_NODE, flags, statements->base.location.start, predicate->location.end), + .base = PM_NODE_INIT_NODES(parser, PM_UNTIL_NODE, flags, statements, predicate), .keyword_loc = PM_LOCATION_TOKEN_VALUE(keyword), .do_keyword_loc = PM_OPTIONAL_LOCATION_NOT_PROVIDED_VALUE, .closing_loc = PM_OPTIONAL_LOCATION_NOT_PROVIDED_VALUE, @@ -6855,7 +6870,7 @@ pm_when_node_create(pm_parser_t *parser, const pm_token_t *keyword) { pm_when_node_t *node = PM_NODE_ALLOC(parser, pm_when_node_t); *node = (pm_when_node_t) { - .base = PM_NODE_INIT(parser, PM_WHEN_NODE, 0, keyword->start, NULL), + .base = PM_NODE_INIT_TOKEN(parser, PM_WHEN_NODE, 0, keyword), .keyword_loc = PM_LOCATION_TOKEN_VALUE(keyword), .statements = NULL, .then_keyword_loc = PM_OPTIONAL_LOCATION_NOT_PROVIDED_VALUE, @@ -6904,7 +6919,7 @@ pm_while_node_create(pm_parser_t *parser, const pm_token_t *keyword, const pm_to pm_conditional_predicate(parser, predicate, PM_CONDITIONAL_PREDICATE_TYPE_CONDITIONAL); *node = (pm_while_node_t) { - .base = PM_NODE_INIT(parser, PM_WHILE_NODE, flags, keyword->start, closing->end), + .base = PM_NODE_INIT_TOKENS(parser, PM_WHILE_NODE, flags, keyword, closing), .keyword_loc = PM_LOCATION_TOKEN_VALUE(keyword), .do_keyword_loc = PM_OPTIONAL_LOCATION_TOKEN_VALUE(do_keyword), .closing_loc = PM_OPTIONAL_LOCATION_TOKEN_VALUE(closing), @@ -6925,7 +6940,7 @@ pm_while_node_modifier_create(pm_parser_t *parser, const pm_token_t *keyword, pm pm_loop_modifier_block_exits(parser, statements); *node = (pm_while_node_t) { - .base = PM_NODE_INIT(parser, PM_WHILE_NODE, flags, statements->base.location.start, predicate->location.end), + .base = PM_NODE_INIT_NODES(parser, PM_WHILE_NODE, flags, statements, predicate), .keyword_loc = PM_LOCATION_TOKEN_VALUE(keyword), .do_keyword_loc = PM_OPTIONAL_LOCATION_NOT_PROVIDED_VALUE, .closing_loc = PM_OPTIONAL_LOCATION_NOT_PROVIDED_VALUE, @@ -6944,7 +6959,7 @@ pm_while_node_synthesized_create(pm_parser_t *parser, pm_node_t *predicate, pm_s pm_while_node_t *node = PM_NODE_ALLOC(parser, pm_while_node_t); *node = (pm_while_node_t) { - .base = PM_NODE_INIT(parser, PM_WHILE_NODE, 0, parser->start, parser->start), + .base = PM_NODE_INIT_UNSET(parser, PM_WHILE_NODE, 0), .keyword_loc = PM_LOCATION_NULL_VALUE(parser), .do_keyword_loc = PM_LOCATION_NULL_VALUE(parser), .closing_loc = PM_LOCATION_NULL_VALUE(parser), @@ -6964,7 +6979,7 @@ pm_xstring_node_create_unescaped(pm_parser_t *parser, const pm_token_t *opening, pm_x_string_node_t *node = PM_NODE_ALLOC(parser, pm_x_string_node_t); *node = (pm_x_string_node_t) { - .base = PM_NODE_INIT(parser, PM_X_STRING_NODE, PM_STRING_FLAGS_FROZEN, opening->start, closing->end), + .base = PM_NODE_INIT_TOKENS(parser, PM_X_STRING_NODE, PM_STRING_FLAGS_FROZEN, opening, closing), .opening_loc = PM_LOCATION_TOKEN_VALUE(opening), .content_loc = PM_LOCATION_TOKEN_VALUE(content), .closing_loc = PM_LOCATION_TOKEN_VALUE(closing), From a20afe16747ba0cf2650427bf0da7c17944b889c Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Tue, 2 Dec 2025 15:09:59 -0500 Subject: [PATCH 246/333] Introduce PM_NODE_FLAGS macro --- src/prism.c | 26 +++++++++++++------------- templates/include/prism/ast.h.erb | 7 ++++++- 2 files changed, 19 insertions(+), 14 deletions(-) diff --git a/src/prism.c b/src/prism.c index 2c930d8deb..65949190f1 100644 --- a/src/prism.c +++ b/src/prism.c @@ -22,6 +22,7 @@ pm_version(void) { /* Helpful node-related macros */ /******************************************************************************/ +#define FL PM_NODE_FLAGS #define UP PM_NODE_UPCAST #define PM_TOKEN_START(token_) ((token_)->start) @@ -2845,7 +2846,7 @@ pm_call_and_write_node_create(pm_parser_t *parser, pm_call_node_t *target, const pm_call_and_write_node_t *node = PM_NODE_ALLOC(parser, pm_call_and_write_node_t); *node = (pm_call_and_write_node_t) { - .base = PM_NODE_INIT_NODES(parser, PM_CALL_AND_WRITE_NODE, target->base.flags, target, value), + .base = PM_NODE_INIT_NODES(parser, PM_CALL_AND_WRITE_NODE, FL(target), target, value), .receiver = target->receiver, .call_operator_loc = target->call_operator_loc, .message_loc = target->message_loc, @@ -2900,7 +2901,7 @@ pm_index_and_write_node_create(pm_parser_t *parser, pm_call_node_t *target, cons assert(!target->block || PM_NODE_TYPE_P(target->block, PM_BLOCK_ARGUMENT_NODE)); *node = (pm_index_and_write_node_t) { - .base = PM_NODE_INIT_NODES(parser, PM_INDEX_AND_WRITE_NODE, target->base.flags, target, value), + .base = PM_NODE_INIT_NODES(parser, PM_INDEX_AND_WRITE_NODE, FL(target), target, value), .receiver = target->receiver, .call_operator_loc = target->call_operator_loc, .opening_loc = target->opening_loc, @@ -2928,7 +2929,7 @@ pm_call_operator_write_node_create(pm_parser_t *parser, pm_call_node_t *target, pm_call_operator_write_node_t *node = PM_NODE_ALLOC(parser, pm_call_operator_write_node_t); *node = (pm_call_operator_write_node_t) { - .base = PM_NODE_INIT_NODES(parser, PM_CALL_OPERATOR_WRITE_NODE, target->base.flags, target, value), + .base = PM_NODE_INIT_NODES(parser, PM_CALL_OPERATOR_WRITE_NODE, FL(target), target, value), .receiver = target->receiver, .call_operator_loc = target->call_operator_loc, .message_loc = target->message_loc, @@ -2960,7 +2961,7 @@ pm_index_operator_write_node_create(pm_parser_t *parser, pm_call_node_t *target, assert(!target->block || PM_NODE_TYPE_P(target->block, PM_BLOCK_ARGUMENT_NODE)); *node = (pm_index_operator_write_node_t) { - .base = PM_NODE_INIT_NODES(parser, PM_INDEX_OPERATOR_WRITE_NODE, target->base.flags, target, value), + .base = PM_NODE_INIT_NODES(parser, PM_INDEX_OPERATOR_WRITE_NODE, FL(target), target, value), .receiver = target->receiver, .call_operator_loc = target->call_operator_loc, .opening_loc = target->opening_loc, @@ -2990,7 +2991,7 @@ pm_call_or_write_node_create(pm_parser_t *parser, pm_call_node_t *target, const pm_call_or_write_node_t *node = PM_NODE_ALLOC(parser, pm_call_or_write_node_t); *node = (pm_call_or_write_node_t) { - .base = PM_NODE_INIT_NODES(parser, PM_CALL_OR_WRITE_NODE, target->base.flags, target, value), + .base = PM_NODE_INIT_NODES(parser, PM_CALL_OR_WRITE_NODE, FL(target), target, value), .receiver = target->receiver, .call_operator_loc = target->call_operator_loc, .message_loc = target->message_loc, @@ -3022,7 +3023,7 @@ pm_index_or_write_node_create(pm_parser_t *parser, pm_call_node_t *target, const assert(!target->block || PM_NODE_TYPE_P(target->block, PM_BLOCK_ARGUMENT_NODE)); *node = (pm_index_or_write_node_t) { - .base = PM_NODE_INIT_NODES(parser, PM_INDEX_OR_WRITE_NODE, target->base.flags, target, value), + .base = PM_NODE_INIT_NODES(parser, PM_INDEX_OR_WRITE_NODE, FL(target), target, value), .receiver = target->receiver, .call_operator_loc = target->call_operator_loc, .opening_loc = target->opening_loc, @@ -3050,7 +3051,7 @@ pm_call_target_node_create(pm_parser_t *parser, pm_call_node_t *target) { pm_call_target_node_t *node = PM_NODE_ALLOC(parser, pm_call_target_node_t); *node = (pm_call_target_node_t) { - .base = PM_NODE_INIT_NODE(parser, PM_CALL_TARGET_NODE, target->base.flags, target), + .base = PM_NODE_INIT_NODE(parser, PM_CALL_TARGET_NODE, FL(target), target), .receiver = target->receiver, .call_operator_loc = target->call_operator_loc, .name = target->name, @@ -3072,13 +3073,12 @@ pm_call_target_node_create(pm_parser_t *parser, pm_call_node_t *target) { static pm_index_target_node_t * pm_index_target_node_create(pm_parser_t *parser, pm_call_node_t *target) { pm_index_target_node_t *node = PM_NODE_ALLOC(parser, pm_index_target_node_t); - pm_node_flags_t flags = target->base.flags; pm_index_arguments_check(parser, target->arguments, target->block); - assert(!target->block || PM_NODE_TYPE_P(target->block, PM_BLOCK_ARGUMENT_NODE)); + *node = (pm_index_target_node_t) { - .base = PM_NODE_INIT_NODE(parser, PM_INDEX_TARGET_NODE, flags | PM_CALL_NODE_FLAGS_ATTRIBUTE_WRITE, target), + .base = PM_NODE_INIT_NODE(parser, PM_INDEX_TARGET_NODE, FL(target) | PM_CALL_NODE_FLAGS_ATTRIBUTE_WRITE, target), .receiver = target->receiver, .opening_loc = target->opening_loc, .arguments = target->arguments, @@ -4745,10 +4745,10 @@ pm_interpolated_regular_expression_node_closing_set(pm_parser_t *parser, pm_inte static inline void pm_interpolated_string_node_append(pm_interpolated_string_node_t *node, pm_node_t *part) { #define CLEAR_FLAGS(node) \ - node->base.flags = (pm_node_flags_t) (node->base.flags & ~(PM_NODE_FLAG_STATIC_LITERAL | PM_INTERPOLATED_STRING_NODE_FLAGS_FROZEN | PM_INTERPOLATED_STRING_NODE_FLAGS_MUTABLE)) + node->base.flags = (pm_node_flags_t) (FL(node) & ~(PM_NODE_FLAG_STATIC_LITERAL | PM_INTERPOLATED_STRING_NODE_FLAGS_FROZEN | PM_INTERPOLATED_STRING_NODE_FLAGS_MUTABLE)) #define MUTABLE_FLAGS(node) \ - node->base.flags = (pm_node_flags_t) ((node->base.flags | PM_INTERPOLATED_STRING_NODE_FLAGS_MUTABLE) & ~PM_INTERPOLATED_STRING_NODE_FLAGS_FROZEN); + node->base.flags = (pm_node_flags_t) ((FL(node) | PM_INTERPOLATED_STRING_NODE_FLAGS_MUTABLE) & ~PM_INTERPOLATED_STRING_NODE_FLAGS_FROZEN); if (node->parts.size == 0 && node->opening_loc.start == NULL) { node->base.location.start = part->location.start; @@ -19674,7 +19674,7 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b parse_regular_expression_errors(parser, node); } - pm_node_flag_set(UP(node), parse_and_validate_regular_expression_encoding(parser, &unescaped, ascii_only, node->base.flags)); + pm_node_flag_set(UP(node), parse_and_validate_regular_expression_encoding(parser, &unescaped, ascii_only, FL(node))); return UP(node); } diff --git a/templates/include/prism/ast.h.erb b/templates/include/prism/ast.h.erb index d69a0d7456..790cf9ebb8 100644 --- a/templates/include/prism/ast.h.erb +++ b/templates/include/prism/ast.h.erb @@ -151,10 +151,15 @@ typedef struct pm_node { */ #define PM_NODE_TYPE_P(node_, type_) (PM_NODE_TYPE(node_) == (type_)) +/** + * Return the flags associated with the given node. + */ +#define PM_NODE_FLAGS(node_) (PM_NODE_UPCAST(node_)->flags) + /** * Return true if the given flag is set on the given node. */ -#define PM_NODE_FLAG_P(node_, flag_) ((PM_NODE_UPCAST(node_)->flags & (flag_)) != 0) +#define PM_NODE_FLAG_P(node_, flag_) ((PM_NODE_FLAGS(node_) & (flag_)) != 0) <%- nodes.each do |node| -%> /** From 7ab6d9df47326e51b861ad2fdaf60ad3dd13eb66 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Tue, 2 Dec 2025 15:21:40 -0500 Subject: [PATCH 247/333] Further specialize PM_NODE_INIT --- src/prism.c | 180 ++++++++++++++++++++++++++++++++-------------------- 1 file changed, 112 insertions(+), 68 deletions(-) diff --git a/src/prism.c b/src/prism.c index 65949190f1..e17163091a 100644 --- a/src/prism.c +++ b/src/prism.c @@ -1949,7 +1949,8 @@ pm_node_alloc(PRISM_ATTRIBUTE_UNUSED pm_parser_t *parser, size_t size) { .location = { .start = (start_), .end = (end_) } \ } -#define PM_NODE_INIT_UNSET(parser_, type_, flags_) PM_NODE_INIT(parser_, type_, flags_, (parser_)->start, (parser_)->start) +#define PM_NODE_INIT_UNSET(parser_, type_, flags_) PM_NODE_INIT(parser_, type_, flags_, NULL, NULL) +#define PM_NODE_INIT_BASE(parser_, type_, flags_) PM_NODE_INIT(parser_, type_, flags_, (parser_)->start, (parser_)->start) #define PM_NODE_INIT_TOKEN(parser_, type_, flags_, token_) PM_NODE_INIT(parser_, type_, flags_, PM_TOKEN_START(token_), PM_TOKEN_END(token_)) #define PM_NODE_INIT_NODE(parser_, type_, flags_, node_) PM_NODE_INIT(parser_, type_, flags_, PM_NODE_START(node_), PM_NODE_END(node_)) @@ -2052,7 +2053,7 @@ pm_arguments_node_create(pm_parser_t *parser) { pm_arguments_node_t *node = PM_NODE_ALLOC(parser, pm_arguments_node_t); *node = (pm_arguments_node_t) { - .base = PM_NODE_INIT_UNSET(parser, PM_ARGUMENTS_NODE, 0), + .base = PM_NODE_INIT_BASE(parser, PM_ARGUMENTS_NODE, 0), .arguments = { 0 } }; @@ -2294,7 +2295,11 @@ pm_assoc_splat_node_create(pm_parser_t *parser, pm_node_t *value, const pm_token pm_assoc_splat_node_t *node = PM_NODE_ALLOC(parser, pm_assoc_splat_node_t); *node = (pm_assoc_splat_node_t) { - .base = PM_NODE_INIT(parser, PM_ASSOC_SPLAT_NODE, 0, operator->start, value == NULL ? operator->end : value->location.end), + .base = ( + (value == NULL) + ? PM_NODE_INIT_TOKEN(parser, PM_ASSOC_SPLAT_NODE, 0, operator) + : PM_NODE_INIT_TOKEN_NODE(parser, PM_ASSOC_SPLAT_NODE, 0, operator, value) + ), .value = value, .operator_loc = PM_LOCATION_TOKEN_VALUE(operator) }; @@ -2326,7 +2331,11 @@ pm_begin_node_create(pm_parser_t *parser, const pm_token_t *begin_keyword, pm_st pm_begin_node_t *node = PM_NODE_ALLOC(parser, pm_begin_node_t); *node = (pm_begin_node_t) { - .base = PM_NODE_INIT(parser, PM_BEGIN_NODE, 0, begin_keyword->start, statements == NULL ? begin_keyword->end : statements->base.location.end), + .base = ( + (statements == NULL) + ? PM_NODE_INIT_TOKEN(parser, PM_BEGIN_NODE, 0, begin_keyword) + : PM_NODE_INIT_TOKEN_NODE(parser, PM_BEGIN_NODE, 0, begin_keyword, statements) + ), .begin_keyword_loc = PM_OPTIONAL_LOCATION_TOKEN_VALUE(begin_keyword), .statements = statements, .end_keyword_loc = PM_OPTIONAL_LOCATION_NOT_PROVIDED_VALUE @@ -2385,7 +2394,11 @@ pm_block_argument_node_create(pm_parser_t *parser, const pm_token_t *operator, p pm_block_argument_node_t *node = PM_NODE_ALLOC(parser, pm_block_argument_node_t); *node = (pm_block_argument_node_t) { - .base = PM_NODE_INIT(parser, PM_BLOCK_ARGUMENT_NODE, 0, operator->start, expression == NULL ? operator->end : expression->location.end), + .base = ( + (expression == NULL) + ? PM_NODE_INIT_TOKEN(parser, PM_BLOCK_ARGUMENT_NODE, 0, operator) + : PM_NODE_INIT_TOKEN_NODE(parser, PM_BLOCK_ARGUMENT_NODE, 0, operator, expression) + ), .expression = expression, .operator_loc = PM_LOCATION_TOKEN_VALUE(operator) }; @@ -2421,7 +2434,11 @@ pm_block_parameter_node_create(pm_parser_t *parser, const pm_token_t *name, cons pm_block_parameter_node_t *node = PM_NODE_ALLOC(parser, pm_block_parameter_node_t); *node = (pm_block_parameter_node_t) { - .base = PM_NODE_INIT(parser, PM_BLOCK_PARAMETER_NODE, 0, operator->start, name->type == PM_TOKEN_NOT_PROVIDED ? operator->end : name->end), + .base = ( + (name->type == PM_TOKEN_NOT_PROVIDED) + ? PM_NODE_INIT_TOKEN(parser, PM_BLOCK_PARAMETER_NODE, 0, operator) + : PM_NODE_INIT_TOKENS(parser, PM_BLOCK_PARAMETER_NODE, 0, operator, name) + ), .name = pm_parser_optional_constant_id_token(parser, name), .name_loc = PM_OPTIONAL_LOCATION_TOKEN_VALUE(name), .operator_loc = PM_LOCATION_TOKEN_VALUE(operator) @@ -2512,7 +2529,11 @@ pm_break_node_create(pm_parser_t *parser, const pm_token_t *keyword, pm_argument pm_break_node_t *node = PM_NODE_ALLOC(parser, pm_break_node_t); *node = (pm_break_node_t) { - .base = PM_NODE_INIT(parser, PM_BREAK_NODE, 0, keyword->start, arguments == NULL ? keyword->end : arguments->base.location.end), + .base = ( + (arguments == NULL) + ? PM_NODE_INIT_TOKEN(parser, PM_BREAK_NODE, 0, keyword) + : PM_NODE_INIT_TOKEN_NODE(parser, PM_BREAK_NODE, 0, keyword, arguments) + ), .arguments = arguments, .keyword_loc = PM_LOCATION_TOKEN_VALUE(keyword) }; @@ -2539,7 +2560,7 @@ pm_call_node_create(pm_parser_t *parser, pm_node_flags_t flags) { pm_call_node_t *node = PM_NODE_ALLOC(parser, pm_call_node_t); *node = (pm_call_node_t) { - .base = PM_NODE_INIT_UNSET(parser, PM_CALL_NODE, flags), + .base = PM_NODE_INIT_BASE(parser, PM_CALL_NODE, flags), .receiver = NULL, .call_operator_loc = PM_OPTIONAL_LOCATION_NOT_PROVIDED_VALUE, .message_loc = PM_OPTIONAL_LOCATION_NOT_PROVIDED_VALUE, @@ -3402,13 +3423,23 @@ pm_constant_path_node_create(pm_parser_t *parser, pm_node_t *parent, const pm_to name = pm_parser_constant_id_token(parser, name_token); } - *node = (pm_constant_path_node_t) { - .base = PM_NODE_INIT(parser, PM_CONSTANT_PATH_NODE, 0, parent == NULL ? delimiter->start : parent->location.start, name_token->end), - .parent = parent, - .name = name, - .delimiter_loc = PM_LOCATION_TOKEN_VALUE(delimiter), - .name_loc = PM_LOCATION_TOKEN_VALUE(name_token) - }; + if (parent == NULL) { + *node = (pm_constant_path_node_t) { + .base = PM_NODE_INIT_TOKENS(parser, PM_CONSTANT_PATH_NODE, 0, delimiter, name_token), + .parent = parent, + .name = name, + .delimiter_loc = PM_LOCATION_TOKEN_VALUE(delimiter), + .name_loc = PM_LOCATION_TOKEN_VALUE(name_token) + }; + } else { + *node = (pm_constant_path_node_t) { + .base = PM_NODE_INIT_NODE_TOKEN(parser, PM_CONSTANT_PATH_NODE, 0, parent, name_token), + .parent = parent, + .name = name, + .delimiter_loc = PM_LOCATION_TOKEN_VALUE(delimiter), + .name_loc = PM_LOCATION_TOKEN_VALUE(name_token) + }; + } return node; } @@ -3587,20 +3618,17 @@ pm_def_node_create( const pm_token_t *end_keyword ) { pm_def_node_t *node = PM_NODE_ALLOC(parser, pm_def_node_t); - const uint8_t *end; - - if (end_keyword->type == PM_TOKEN_NOT_PROVIDED) { - end = body->location.end; - } else { - end = end_keyword->end; - } if (receiver != NULL) { pm_def_node_receiver_check(parser, receiver); } *node = (pm_def_node_t) { - .base = PM_NODE_INIT(parser, PM_DEF_NODE, 0, def_keyword->start, end), + .base = ( + (end_keyword->type == PM_TOKEN_NOT_PROVIDED) + ? PM_NODE_INIT_TOKEN_NODE(parser, PM_DEF_NODE, 0, def_keyword, body) + : PM_NODE_INIT_TOKENS(parser, PM_DEF_NODE, 0, def_keyword, end_keyword) + ), .name = name, .name_loc = PM_LOCATION_TOKEN_VALUE(name_loc), .receiver = receiver, @@ -3622,16 +3650,19 @@ pm_def_node_create( * Allocate a new DefinedNode node. */ static pm_defined_node_t * -pm_defined_node_create(pm_parser_t *parser, const pm_token_t *lparen, pm_node_t *value, const pm_token_t *rparen, const pm_location_t *keyword_loc) { +pm_defined_node_create(pm_parser_t *parser, const pm_token_t *lparen, pm_node_t *value, const pm_token_t *rparen, const pm_token_t *keyword) { pm_defined_node_t *node = PM_NODE_ALLOC(parser, pm_defined_node_t); - const uint8_t *end = rparen->type == PM_TOKEN_NOT_PROVIDED ? value->location.end : rparen->end; *node = (pm_defined_node_t) { - .base = PM_NODE_INIT(parser, PM_DEFINED_NODE, 0, keyword_loc->start, end), + .base = ( + (rparen->type == PM_TOKEN_NOT_PROVIDED) + ? PM_NODE_INIT_TOKEN_NODE(parser, PM_DEFINED_NODE, 0, keyword, value) + : PM_NODE_INIT_TOKENS(parser, PM_DEFINED_NODE, 0, keyword, rparen) + ), .lparen_loc = PM_OPTIONAL_LOCATION_TOKEN_VALUE(lparen), .value = value, .rparen_loc = PM_OPTIONAL_LOCATION_TOKEN_VALUE(rparen), - .keyword_loc = *keyword_loc + .keyword_loc = PM_LOCATION_TOKEN_VALUE(keyword) }; return node; @@ -3643,15 +3674,13 @@ pm_defined_node_create(pm_parser_t *parser, const pm_token_t *lparen, pm_node_t static pm_else_node_t * pm_else_node_create(pm_parser_t *parser, const pm_token_t *else_keyword, pm_statements_node_t *statements, const pm_token_t *end_keyword) { pm_else_node_t *node = PM_NODE_ALLOC(parser, pm_else_node_t); - const uint8_t *end = NULL; - if ((end_keyword->type == PM_TOKEN_NOT_PROVIDED) && (statements != NULL)) { - end = statements->base.location.end; - } else { - end = end_keyword->end; - } *node = (pm_else_node_t) { - .base = PM_NODE_INIT(parser, PM_ELSE_NODE, 0, else_keyword->start, end), + .base = ( + ((end_keyword->type == PM_TOKEN_NOT_PROVIDED) && (statements != NULL)) + ? PM_NODE_INIT_TOKEN_NODE(parser, PM_ELSE_NODE, 0, else_keyword, statements) + : PM_NODE_INIT_TOKENS(parser, PM_ELSE_NODE, 0, else_keyword, end_keyword) + ), .else_keyword_loc = PM_LOCATION_TOKEN_VALUE(else_keyword), .statements = statements, .end_keyword_loc = PM_OPTIONAL_LOCATION_TOKEN_VALUE(end_keyword) @@ -4025,9 +4054,12 @@ pm_forwarding_super_node_create(pm_parser_t *parser, const pm_token_t *token, pm block = (pm_block_node_t *) arguments->block; } - const uint8_t *end = block != NULL ? block->base.location.end : token->end; *node = (pm_forwarding_super_node_t) { - .base = PM_NODE_INIT(parser, PM_FORWARDING_SUPER_NODE, 0, token->start, end), + .base = ( + (block == NULL) + ? PM_NODE_INIT_TOKEN(parser, PM_FORWARDING_SUPER_NODE, 0, token) + : PM_NODE_INIT_TOKEN_NODE(parser, PM_FORWARDING_SUPER_NODE, 0, token, block) + ), .block = block }; @@ -4195,7 +4227,7 @@ pm_global_variable_read_node_synthesized_create(pm_parser_t *parser, pm_constant pm_global_variable_read_node_t *node = PM_NODE_ALLOC(parser, pm_global_variable_read_node_t); *node = (pm_global_variable_read_node_t) { - .base = PM_NODE_INIT_UNSET(parser, PM_GLOBAL_VARIABLE_READ_NODE, 0), + .base = PM_NODE_INIT_BASE(parser, PM_GLOBAL_VARIABLE_READ_NODE, 0), .name = name }; @@ -4229,7 +4261,7 @@ pm_global_variable_write_node_synthesized_create(pm_parser_t *parser, pm_constan pm_global_variable_write_node_t *node = PM_NODE_ALLOC(parser, pm_global_variable_write_node_t); *node = (pm_global_variable_write_node_t) { - .base = PM_NODE_INIT_UNSET(parser, PM_GLOBAL_VARIABLE_WRITE_NODE, 0), + .base = PM_NODE_INIT_BASE(parser, PM_GLOBAL_VARIABLE_WRITE_NODE, 0), .name = name, .name_loc = PM_LOCATION_NULL_VALUE(parser), .operator_loc = PM_LOCATION_NULL_VALUE(parser), @@ -4691,7 +4723,7 @@ pm_interpolated_regular_expression_node_create(pm_parser_t *parser, const pm_tok pm_interpolated_regular_expression_node_t *node = PM_NODE_ALLOC(parser, pm_interpolated_regular_expression_node_t); *node = (pm_interpolated_regular_expression_node_t) { - .base = PM_NODE_INIT(parser, PM_INTERPOLATED_REGULAR_EXPRESSION_NODE, PM_NODE_FLAG_STATIC_LITERAL, opening->start, NULL), + .base = PM_NODE_INIT_TOKEN(parser, PM_INTERPOLATED_REGULAR_EXPRESSION_NODE, PM_NODE_FLAG_STATIC_LITERAL, opening), .opening_loc = PM_LOCATION_TOKEN_VALUE(opening), .closing_loc = PM_LOCATION_TOKEN_VALUE(opening), .parts = { 0 } @@ -4980,7 +5012,7 @@ pm_keyword_hash_node_create(pm_parser_t *parser) { pm_keyword_hash_node_t *node = PM_NODE_ALLOC(parser, pm_keyword_hash_node_t); *node = (pm_keyword_hash_node_t) { - .base = PM_NODE_INIT(parser, PM_KEYWORD_HASH_NODE, PM_KEYWORD_HASH_NODE_FLAGS_SYMBOL_KEYS, NULL, NULL), + .base = PM_NODE_INIT_UNSET(parser, PM_KEYWORD_HASH_NODE, PM_KEYWORD_HASH_NODE_FLAGS_SYMBOL_KEYS), .elements = { 0 } }; @@ -5046,7 +5078,11 @@ pm_keyword_rest_parameter_node_create(pm_parser_t *parser, const pm_token_t *ope pm_keyword_rest_parameter_node_t *node = PM_NODE_ALLOC(parser, pm_keyword_rest_parameter_node_t); *node = (pm_keyword_rest_parameter_node_t) { - .base = PM_NODE_INIT(parser, PM_KEYWORD_REST_PARAMETER_NODE, 0, operator->start, (name->type == PM_TOKEN_NOT_PROVIDED ? operator->end : name->end)), + .base = ( + (name->type == PM_TOKEN_NOT_PROVIDED) + ? PM_NODE_INIT_TOKEN(parser, PM_KEYWORD_REST_PARAMETER_NODE, 0, operator) + : PM_NODE_INIT_TOKENS(parser, PM_KEYWORD_REST_PARAMETER_NODE, 0, operator, name) + ), .name = pm_parser_optional_constant_id_token(parser, name), .name_loc = PM_OPTIONAL_LOCATION_TOKEN_VALUE(name), .operator_loc = PM_LOCATION_TOKEN_VALUE(operator) @@ -5191,7 +5227,7 @@ pm_local_variable_write_node_create(pm_parser_t *parser, pm_constant_id_t name, pm_node_flags_t flags = pm_implicit_array_write_flags(value, PM_WRITE_NODE_FLAGS_IMPLICIT_ARRAY); *node = (pm_local_variable_write_node_t) { - .base = PM_NODE_INIT(parser, PM_LOCAL_VARIABLE_WRITE_NODE, flags, name_loc->start, value->location.end), + .base = PM_NODE_INIT_TOKEN_NODE(parser, PM_LOCAL_VARIABLE_WRITE_NODE, flags, name_loc, value), .name = name, .depth = depth, .value = value, @@ -5240,7 +5276,7 @@ pm_local_variable_target_node_create(pm_parser_t *parser, const pm_location_t *l pm_local_variable_target_node_t *node = PM_NODE_ALLOC(parser, pm_local_variable_target_node_t); *node = (pm_local_variable_target_node_t) { - .base = PM_NODE_INIT(parser, PM_LOCAL_VARIABLE_TARGET_NODE, 0, location->start, location->end), + .base = PM_NODE_INIT_TOKEN(parser, PM_LOCAL_VARIABLE_TARGET_NODE, 0, location), .name = name, .depth = depth }; @@ -5330,7 +5366,7 @@ pm_multi_target_node_create(pm_parser_t *parser) { pm_multi_target_node_t *node = PM_NODE_ALLOC(parser, pm_multi_target_node_t); *node = (pm_multi_target_node_t) { - .base = PM_NODE_INIT(parser, PM_MULTI_TARGET_NODE, 0, NULL, NULL), + .base = PM_NODE_INIT_UNSET(parser, PM_MULTI_TARGET_NODE, 0), .lefts = { 0 }, .rest = NULL, .rights = { 0 }, @@ -5428,7 +5464,11 @@ pm_next_node_create(pm_parser_t *parser, const pm_token_t *keyword, pm_arguments pm_next_node_t *node = PM_NODE_ALLOC(parser, pm_next_node_t); *node = (pm_next_node_t) { - .base = PM_NODE_INIT(parser, PM_NEXT_NODE, 0, keyword->start, (arguments == NULL ? keyword->end : arguments->base.location.end)), + .base = ( + (arguments == NULL) + ? PM_NODE_INIT_TOKEN(parser, PM_NEXT_NODE, 0, keyword) + : PM_NODE_INIT_TOKEN_NODE(parser, PM_NEXT_NODE, 0, keyword, arguments) + ), .keyword_loc = PM_LOCATION_TOKEN_VALUE(keyword), .arguments = arguments }; @@ -5477,7 +5517,7 @@ pm_numbered_parameters_node_create(pm_parser_t *parser, const pm_location_t *loc pm_numbered_parameters_node_t *node = PM_NODE_ALLOC(parser, pm_numbered_parameters_node_t); *node = (pm_numbered_parameters_node_t) { - .base = PM_NODE_INIT(parser, PM_NUMBERED_PARAMETERS_NODE, 0, location->start, location->end), + .base = PM_NODE_INIT_TOKEN(parser, PM_NUMBERED_PARAMETERS_NODE, 0, location), .maximum = maximum }; @@ -5594,7 +5634,7 @@ pm_parameters_node_create(pm_parser_t *parser) { pm_parameters_node_t *node = PM_NODE_ALLOC(parser, pm_parameters_node_t); *node = (pm_parameters_node_t) { - .base = PM_NODE_INIT(parser, PM_PARAMETERS_NODE, 0, NULL, NULL), + .base = PM_NODE_INIT_UNSET(parser, PM_PARAMETERS_NODE, 0), .rest = NULL, .keyword_rest = NULL, .block = NULL, @@ -5697,11 +5737,8 @@ static pm_program_node_t * pm_program_node_create(pm_parser_t *parser, pm_constant_id_list_t *locals, pm_statements_node_t *statements) { pm_program_node_t *node = PM_NODE_ALLOC(parser, pm_program_node_t); - const uint8_t *start = statements == NULL ? parser->start : statements->base.location.start; - const uint8_t *end = statements == NULL ? parser->end : statements->base.location.end; - *node = (pm_program_node_t) { - .base = PM_NODE_INIT(parser, PM_PROGRAM_NODE, 0, start, end), + .base = PM_NODE_INIT_NODE(parser, PM_PROGRAM_NODE, 0, statements), .locals = *locals, .statements = statements }; @@ -5857,7 +5894,7 @@ pm_regular_expression_node_create_unescaped(pm_parser_t *parser, const pm_token_ pm_node_flags_t flags = pm_regular_expression_flags_create(parser, closing) | PM_NODE_FLAG_STATIC_LITERAL; *node = (pm_regular_expression_node_t) { - .base = PM_NODE_INIT(parser, PM_REGULAR_EXPRESSION_NODE, flags, MIN(opening->start, closing->start), MAX(opening->end, closing->end)), + .base = PM_NODE_INIT_TOKENS(parser, PM_REGULAR_EXPRESSION_NODE, flags, opening, closing), .opening_loc = PM_LOCATION_TOKEN_VALUE(opening), .content_loc = PM_LOCATION_TOKEN_VALUE(content), .closing_loc = PM_LOCATION_TOKEN_VALUE(closing), @@ -5979,7 +6016,11 @@ pm_rest_parameter_node_create(pm_parser_t *parser, const pm_token_t *operator, c pm_rest_parameter_node_t *node = PM_NODE_ALLOC(parser, pm_rest_parameter_node_t); *node = (pm_rest_parameter_node_t) { - .base = PM_NODE_INIT(parser, PM_REST_PARAMETER_NODE, 0, operator->start, (name->type == PM_TOKEN_NOT_PROVIDED ? operator->end : name->end)), + .base = ( + (name->type == PM_TOKEN_NOT_PROVIDED) + ? PM_NODE_INIT_TOKEN(parser, PM_REST_PARAMETER_NODE, 0, operator) + : PM_NODE_INIT_TOKENS(parser, PM_REST_PARAMETER_NODE, 0, operator, name) + ), .name = pm_parser_optional_constant_id_token(parser, name), .name_loc = PM_OPTIONAL_LOCATION_TOKEN_VALUE(name), .operator_loc = PM_LOCATION_TOKEN_VALUE(operator) @@ -6011,7 +6052,11 @@ pm_return_node_create(pm_parser_t *parser, const pm_token_t *keyword, pm_argumen pm_return_node_t *node = PM_NODE_ALLOC(parser, pm_return_node_t); *node = (pm_return_node_t) { - .base = PM_NODE_INIT(parser, PM_RETURN_NODE, 0, keyword->start, (arguments == NULL ? keyword->end : arguments->base.location.end)), + .base = ( + (arguments == NULL) + ? PM_NODE_INIT_TOKEN(parser, PM_RETURN_NODE, 0, keyword) + : PM_NODE_INIT_TOKEN_NODE(parser, PM_RETURN_NODE, 0, keyword, arguments) + ), .keyword_loc = PM_LOCATION_TOKEN_VALUE(keyword), .arguments = arguments }; @@ -6134,7 +6179,11 @@ pm_splat_node_create(pm_parser_t *parser, const pm_token_t *operator, pm_node_t pm_splat_node_t *node = PM_NODE_ALLOC(parser, pm_splat_node_t); *node = (pm_splat_node_t) { - .base = PM_NODE_INIT(parser, PM_SPLAT_NODE, 0, operator->start, (expression == NULL ? operator->end : expression->location.end)), + .base = ( + (expression == NULL) + ? PM_NODE_INIT_TOKEN(parser, PM_SPLAT_NODE, 0, operator) + : PM_NODE_INIT_TOKEN_NODE(parser, PM_SPLAT_NODE, 0, operator, expression) + ), .operator_loc = PM_LOCATION_TOKEN_VALUE(operator), .expression = expression }; @@ -6150,7 +6199,7 @@ pm_statements_node_create(pm_parser_t *parser) { pm_statements_node_t *node = PM_NODE_ALLOC(parser, pm_statements_node_t); *node = (pm_statements_node_t) { - .base = PM_NODE_INIT_UNSET(parser, PM_STATEMENTS_NODE, 0), + .base = PM_NODE_INIT_BASE(parser, PM_STATEMENTS_NODE, 0), .body = { 0 } }; @@ -6596,7 +6645,7 @@ pm_symbol_node_synthesized_create(pm_parser_t *parser, const char *content) { pm_symbol_node_t *node = PM_NODE_ALLOC(parser, pm_symbol_node_t); *node = (pm_symbol_node_t) { - .base = PM_NODE_INIT_UNSET(parser, PM_SYMBOL_NODE, PM_NODE_FLAG_STATIC_LITERAL | PM_SYMBOL_FLAGS_FORCED_US_ASCII_ENCODING), + .base = PM_NODE_INIT_BASE(parser, PM_SYMBOL_NODE, PM_NODE_FLAG_STATIC_LITERAL | PM_SYMBOL_FLAGS_FORCED_US_ASCII_ENCODING), .value_loc = PM_LOCATION_NULL_VALUE(parser), .unescaped = { 0 } }; @@ -6708,7 +6757,7 @@ pm_true_node_synthesized_create(pm_parser_t *parser) { pm_true_node_t *node = PM_NODE_ALLOC(parser, pm_true_node_t); *node = (pm_true_node_t) { - .base = PM_NODE_INIT_UNSET(parser, PM_TRUE_NODE, PM_NODE_FLAG_STATIC_LITERAL) + .base = PM_NODE_INIT_BASE(parser, PM_TRUE_NODE, PM_NODE_FLAG_STATIC_LITERAL) }; return node; @@ -6746,17 +6795,12 @@ pm_undef_node_append(pm_undef_node_t *node, pm_node_t *name) { static pm_unless_node_t * pm_unless_node_create(pm_parser_t *parser, const pm_token_t *keyword, pm_node_t *predicate, const pm_token_t *then_keyword, pm_statements_node_t *statements) { pm_conditional_predicate(parser, predicate, PM_CONDITIONAL_PREDICATE_TYPE_CONDITIONAL); - pm_unless_node_t *node = PM_NODE_ALLOC(parser, pm_unless_node_t); - const uint8_t *end; - if (statements != NULL) { - end = statements->base.location.end; - } else { - end = predicate->location.end; - } + pm_unless_node_t *node = PM_NODE_ALLOC(parser, pm_unless_node_t); + pm_node_t *end = statements == NULL ? predicate : UP(statements); *node = (pm_unless_node_t) { - .base = PM_NODE_INIT(parser, PM_UNLESS_NODE, PM_NODE_FLAG_NEWLINE, keyword->start, end), + .base = PM_NODE_INIT_TOKEN_NODE(parser, PM_UNLESS_NODE, PM_NODE_FLAG_NEWLINE, keyword, end), .keyword_loc = PM_LOCATION_TOKEN_VALUE(keyword), .predicate = predicate, .then_keyword_loc = PM_OPTIONAL_LOCATION_TOKEN_VALUE(then_keyword), @@ -6959,7 +7003,7 @@ pm_while_node_synthesized_create(pm_parser_t *parser, pm_node_t *predicate, pm_s pm_while_node_t *node = PM_NODE_ALLOC(parser, pm_while_node_t); *node = (pm_while_node_t) { - .base = PM_NODE_INIT_UNSET(parser, PM_WHILE_NODE, 0), + .base = PM_NODE_INIT_BASE(parser, PM_WHILE_NODE, 0), .keyword_loc = PM_LOCATION_NULL_VALUE(parser), .do_keyword_loc = PM_LOCATION_NULL_VALUE(parser), .closing_loc = PM_LOCATION_NULL_VALUE(parser), @@ -18917,7 +18961,7 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b &lparen, expression, &rparen, - &PM_LOCATION_TOKEN_VALUE(&keyword) + &keyword )); } case PM_TOKEN_KEYWORD_END_UPCASE: { From 1988615ce1495824149148c7827633cc7ff5d6d6 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Tue, 2 Dec 2025 15:44:33 -0500 Subject: [PATCH 248/333] Remove PM_OPTIONAL_LOCATION_NOT_PROVIDED_VALUE macro --- src/prism.c | 65 ++++++++++++++++++++++++++--------------------------- 1 file changed, 32 insertions(+), 33 deletions(-) diff --git a/src/prism.c b/src/prism.c index e17163091a..f6edce5d6f 100644 --- a/src/prism.c +++ b/src/prism.c @@ -1576,8 +1576,7 @@ not_provided(pm_parser_t *parser) { #define PM_LOCATION_TOKEN_VALUE(token) ((pm_location_t) { .start = (token)->start, .end = (token)->end }) #define PM_LOCATION_NODE_VALUE(node) ((pm_location_t) { .start = (node)->location.start, .end = (node)->location.end }) #define PM_LOCATION_NODE_BASE_VALUE(node) ((pm_location_t) { .start = (node)->base.location.start, .end = (node)->base.location.end }) -#define PM_OPTIONAL_LOCATION_NOT_PROVIDED_VALUE ((pm_location_t) { .start = NULL, .end = NULL }) -#define PM_OPTIONAL_LOCATION_TOKEN_VALUE(token) ((token)->type == PM_TOKEN_NOT_PROVIDED ? PM_OPTIONAL_LOCATION_NOT_PROVIDED_VALUE : PM_LOCATION_TOKEN_VALUE(token)) +#define PM_OPTIONAL_LOCATION_TOKEN_VALUE(token) ((token)->type == PM_TOKEN_NOT_PROVIDED ? ((pm_location_t) { 0 }) : PM_LOCATION_TOKEN_VALUE(token)) /** * This is a special out parameter to the parse_arguments_list function that @@ -2153,8 +2152,8 @@ pm_array_pattern_node_node_list_create(pm_parser_t *parser, pm_node_list_t *node .rest = NULL, .requireds = { 0 }, .posts = { 0 }, - .opening_loc = PM_OPTIONAL_LOCATION_NOT_PROVIDED_VALUE, - .closing_loc = PM_OPTIONAL_LOCATION_NOT_PROVIDED_VALUE + .opening_loc = { 0 }, + .closing_loc = { 0 } }; // For now we're going to just copy over each pointer manually. This could be @@ -2189,8 +2188,8 @@ pm_array_pattern_node_rest_create(pm_parser_t *parser, pm_node_t *rest) { .rest = rest, .requireds = { 0 }, .posts = { 0 }, - .opening_loc = PM_OPTIONAL_LOCATION_NOT_PROVIDED_VALUE, - .closing_loc = PM_OPTIONAL_LOCATION_NOT_PROVIDED_VALUE + .opening_loc = { 0 }, + .closing_loc = { 0 } }; return node; @@ -2338,7 +2337,7 @@ pm_begin_node_create(pm_parser_t *parser, const pm_token_t *begin_keyword, pm_st ), .begin_keyword_loc = PM_OPTIONAL_LOCATION_TOKEN_VALUE(begin_keyword), .statements = statements, - .end_keyword_loc = PM_OPTIONAL_LOCATION_NOT_PROVIDED_VALUE + .end_keyword_loc = { 0 } }; return node; @@ -2476,7 +2475,7 @@ pm_block_parameters_node_create(pm_parser_t *parser, pm_parameters_node_t *param .base = PM_NODE_INIT(parser, PM_BLOCK_PARAMETERS_NODE, 0, start, end), .parameters = parameters, .opening_loc = PM_OPTIONAL_LOCATION_TOKEN_VALUE(opening), - .closing_loc = PM_OPTIONAL_LOCATION_NOT_PROVIDED_VALUE, + .closing_loc = { 0 }, .locals = { 0 } }; @@ -2562,12 +2561,12 @@ pm_call_node_create(pm_parser_t *parser, pm_node_flags_t flags) { *node = (pm_call_node_t) { .base = PM_NODE_INIT_BASE(parser, PM_CALL_NODE, flags), .receiver = NULL, - .call_operator_loc = PM_OPTIONAL_LOCATION_NOT_PROVIDED_VALUE, - .message_loc = PM_OPTIONAL_LOCATION_NOT_PROVIDED_VALUE, - .opening_loc = PM_OPTIONAL_LOCATION_NOT_PROVIDED_VALUE, + .call_operator_loc = { 0 }, + .message_loc = { 0 }, + .opening_loc = { 0 }, .arguments = NULL, - .closing_loc = PM_OPTIONAL_LOCATION_NOT_PROVIDED_VALUE, - .equal_loc = PM_OPTIONAL_LOCATION_NOT_PROVIDED_VALUE, + .closing_loc = { 0 }, + .equal_loc = { 0 }, .block = NULL, .name = 0 }; @@ -3788,8 +3787,8 @@ pm_find_pattern_node_create(pm_parser_t *parser, pm_node_list_t *nodes) { .left = left_splat_node, .right = right_splat_node, .requireds = { 0 }, - .opening_loc = PM_OPTIONAL_LOCATION_NOT_PROVIDED_VALUE, - .closing_loc = PM_OPTIONAL_LOCATION_NOT_PROVIDED_VALUE + .opening_loc = { 0 }, + .closing_loc = { 0 } }; // For now we're going to just copy over each pointer manually. This could be @@ -4115,8 +4114,8 @@ pm_hash_pattern_node_node_list_create(pm_parser_t *parser, pm_node_list_t *eleme .constant = NULL, .elements = { 0 }, .rest = rest, - .opening_loc = PM_OPTIONAL_LOCATION_NOT_PROVIDED_VALUE, - .closing_loc = PM_OPTIONAL_LOCATION_NOT_PROVIDED_VALUE + .opening_loc = { 0 }, + .closing_loc = { 0 } }; pm_node_t *element; @@ -4369,10 +4368,10 @@ pm_if_node_modifier_create(pm_parser_t *parser, pm_node_t *statement, const pm_t .base = PM_NODE_INIT_NODES(parser, PM_IF_NODE, PM_NODE_FLAG_NEWLINE, statement, predicate), .if_keyword_loc = PM_LOCATION_TOKEN_VALUE(if_keyword), .predicate = predicate, - .then_keyword_loc = PM_OPTIONAL_LOCATION_NOT_PROVIDED_VALUE, + .then_keyword_loc = { 0 }, .statements = statements, .subsequent = NULL, - .end_keyword_loc = PM_OPTIONAL_LOCATION_NOT_PROVIDED_VALUE + .end_keyword_loc = { 0 } }; return node; @@ -4399,12 +4398,12 @@ pm_if_node_ternary_create(pm_parser_t *parser, pm_node_t *predicate, const pm_to *node = (pm_if_node_t) { .base = PM_NODE_INIT_NODES(parser, PM_IF_NODE, PM_NODE_FLAG_NEWLINE, predicate, false_expression), - .if_keyword_loc = PM_OPTIONAL_LOCATION_NOT_PROVIDED_VALUE, + .if_keyword_loc = { 0 }, .predicate = predicate, .then_keyword_loc = PM_LOCATION_TOKEN_VALUE(qmark), .statements = if_statements, .subsequent = UP(else_node), - .end_keyword_loc = PM_OPTIONAL_LOCATION_NOT_PROVIDED_VALUE + .end_keyword_loc = { 0 } }; return node; @@ -5370,8 +5369,8 @@ pm_multi_target_node_create(pm_parser_t *parser) { .lefts = { 0 }, .rest = NULL, .rights = { 0 }, - .lparen_loc = PM_OPTIONAL_LOCATION_NOT_PROVIDED_VALUE, - .rparen_loc = PM_OPTIONAL_LOCATION_NOT_PROVIDED_VALUE + .lparen_loc = { 0 }, + .rparen_loc = { 0 } }; return node; @@ -5954,8 +5953,8 @@ pm_rescue_node_create(pm_parser_t *parser, const pm_token_t *keyword) { *node = (pm_rescue_node_t) { .base = PM_NODE_INIT_TOKEN(parser, PM_RESCUE_NODE, 0, keyword), .keyword_loc = PM_LOCATION_TOKEN_VALUE(keyword), - .operator_loc = PM_OPTIONAL_LOCATION_NOT_PROVIDED_VALUE, - .then_keyword_loc = PM_OPTIONAL_LOCATION_NOT_PROVIDED_VALUE, + .operator_loc = { 0 }, + .then_keyword_loc = { 0 }, .reference = NULL, .statements = NULL, .subsequent = NULL, @@ -6806,7 +6805,7 @@ pm_unless_node_create(pm_parser_t *parser, const pm_token_t *keyword, pm_node_t .then_keyword_loc = PM_OPTIONAL_LOCATION_TOKEN_VALUE(then_keyword), .statements = statements, .else_clause = NULL, - .end_keyword_loc = PM_OPTIONAL_LOCATION_NOT_PROVIDED_VALUE + .end_keyword_loc = { 0 } }; return node; @@ -6827,10 +6826,10 @@ pm_unless_node_modifier_create(pm_parser_t *parser, pm_node_t *statement, const .base = PM_NODE_INIT_NODES(parser, PM_UNLESS_NODE, PM_NODE_FLAG_NEWLINE, statement, predicate), .keyword_loc = PM_LOCATION_TOKEN_VALUE(unless_keyword), .predicate = predicate, - .then_keyword_loc = PM_OPTIONAL_LOCATION_NOT_PROVIDED_VALUE, + .then_keyword_loc = { 0 }, .statements = statements, .else_clause = NULL, - .end_keyword_loc = PM_OPTIONAL_LOCATION_NOT_PROVIDED_VALUE + .end_keyword_loc = { 0 } }; return node; @@ -6897,8 +6896,8 @@ pm_until_node_modifier_create(pm_parser_t *parser, const pm_token_t *keyword, pm *node = (pm_until_node_t) { .base = PM_NODE_INIT_NODES(parser, PM_UNTIL_NODE, flags, statements, predicate), .keyword_loc = PM_LOCATION_TOKEN_VALUE(keyword), - .do_keyword_loc = PM_OPTIONAL_LOCATION_NOT_PROVIDED_VALUE, - .closing_loc = PM_OPTIONAL_LOCATION_NOT_PROVIDED_VALUE, + .do_keyword_loc = { 0 }, + .closing_loc = { 0 }, .predicate = predicate, .statements = statements }; @@ -6917,7 +6916,7 @@ pm_when_node_create(pm_parser_t *parser, const pm_token_t *keyword) { .base = PM_NODE_INIT_TOKEN(parser, PM_WHEN_NODE, 0, keyword), .keyword_loc = PM_LOCATION_TOKEN_VALUE(keyword), .statements = NULL, - .then_keyword_loc = PM_OPTIONAL_LOCATION_NOT_PROVIDED_VALUE, + .then_keyword_loc = { 0 }, .conditions = { 0 } }; @@ -6986,8 +6985,8 @@ pm_while_node_modifier_create(pm_parser_t *parser, const pm_token_t *keyword, pm *node = (pm_while_node_t) { .base = PM_NODE_INIT_NODES(parser, PM_WHILE_NODE, flags, statements, predicate), .keyword_loc = PM_LOCATION_TOKEN_VALUE(keyword), - .do_keyword_loc = PM_OPTIONAL_LOCATION_NOT_PROVIDED_VALUE, - .closing_loc = PM_OPTIONAL_LOCATION_NOT_PROVIDED_VALUE, + .do_keyword_loc = { 0 }, + .closing_loc = { 0 }, .predicate = predicate, .statements = statements }; From cc0ca0875767306ea2529c11556e7bf2a5528594 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Tue, 2 Dec 2025 15:51:34 -0500 Subject: [PATCH 249/333] Consolidate macro definitions --- src/prism.c | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/src/prism.c b/src/prism.c index f6edce5d6f..cd4d166a12 100644 --- a/src/prism.c +++ b/src/prism.c @@ -19,17 +19,22 @@ pm_version(void) { #define MAX(a,b) (((a)>(b))?(a):(b)) /******************************************************************************/ -/* Helpful node-related macros */ +/* Helpful AST-related macros */ /******************************************************************************/ #define FL PM_NODE_FLAGS #define UP PM_NODE_UPCAST #define PM_TOKEN_START(token_) ((token_)->start) -#define PM_TOKEN_END(token_) ((token_)->end) +#define PM_TOKEN_END(token_) ((token_)->end) #define PM_NODE_START(node_) (UP(node_)->location.start) -#define PM_NODE_END(node_) (UP(node_)->location.end) +#define PM_NODE_END(node_) (UP(node_)->location.end) + +#define PM_LOCATION_NULL_VALUE(parser_) ((pm_location_t) { .start = (parser_)->start, .end = (parser_)->start }) +#define PM_LOCATION_TOKEN_VALUE(token_) ((pm_location_t) { .start = PM_TOKEN_START(token_), .end = PM_TOKEN_END(token_) }) +#define PM_LOCATION_NODE_VALUE(node_) ((pm_location_t) { .start = PM_NODE_START(node_), .end = PM_NODE_END(node_) }) +#define PM_OPTIONAL_LOCATION_TOKEN_VALUE(token) ((token)->type == PM_TOKEN_NOT_PROVIDED ? ((pm_location_t) { 0 }) : PM_LOCATION_TOKEN_VALUE(token)) /******************************************************************************/ /* Lex mode manipulations */ @@ -1572,12 +1577,6 @@ not_provided(pm_parser_t *parser) { return (pm_token_t) { .type = PM_TOKEN_NOT_PROVIDED, .start = parser->start, .end = parser->start }; } -#define PM_LOCATION_NULL_VALUE(parser) ((pm_location_t) { .start = (parser)->start, .end = (parser)->start }) -#define PM_LOCATION_TOKEN_VALUE(token) ((pm_location_t) { .start = (token)->start, .end = (token)->end }) -#define PM_LOCATION_NODE_VALUE(node) ((pm_location_t) { .start = (node)->location.start, .end = (node)->location.end }) -#define PM_LOCATION_NODE_BASE_VALUE(node) ((pm_location_t) { .start = (node)->base.location.start, .end = (node)->base.location.end }) -#define PM_OPTIONAL_LOCATION_TOKEN_VALUE(token) ((token)->type == PM_TOKEN_NOT_PROVIDED ? ((pm_location_t) { 0 }) : PM_LOCATION_TOKEN_VALUE(token)) - /** * This is a special out parameter to the parse_arguments_list function that * includes opening and closing parentheses in addition to the arguments since @@ -4662,7 +4661,7 @@ pm_instance_variable_write_node_create(pm_parser_t *parser, pm_instance_variable *node = (pm_instance_variable_write_node_t) { .base = PM_NODE_INIT_NODES(parser, PM_INSTANCE_VARIABLE_WRITE_NODE, flags, read_node, value), .name = read_node->name, - .name_loc = PM_LOCATION_NODE_BASE_VALUE(read_node), + .name_loc = PM_LOCATION_NODE_VALUE(read_node), .operator_loc = PM_OPTIONAL_LOCATION_TOKEN_VALUE(operator), .value = value }; @@ -7069,8 +7068,6 @@ pm_yield_node_create(pm_parser_t *parser, const pm_token_t *keyword, const pm_lo return node; } -#undef PM_NODE_ALLOC - /** * Check if any of the currently visible scopes contain a local variable * described by the given constant id. @@ -22293,10 +22290,6 @@ pm_parse_success_p(const uint8_t *source, size_t size, const char *data) { #undef PM_CASE_OPERATOR #undef PM_CASE_WRITABLE #undef PM_STRING_EMPTY -#undef PM_LOCATION_NODE_BASE_VALUE -#undef PM_LOCATION_NODE_VALUE -#undef PM_LOCATION_NULL_VALUE -#undef PM_LOCATION_TOKEN_VALUE // We optionally support serializing to a binary string. For systems that don't // want or need this functionality, it can be turned off with the From 211677000ef383faca258515f344700e61a07d83 Mon Sep 17 00:00:00 2001 From: Earlopain <14981592+Earlopain@users.noreply.github.com> Date: Wed, 3 Dec 2025 09:05:13 +0100 Subject: [PATCH 250/333] Correctly handle line continuations in %w/i% interrupted by heredocs See https://bugs.ruby-lang.org/issues/21756. Ripper fails to parse this, but prism actually also doesn't handle it correctly. When heredocs are used, even in lowercase percent arays there can be multiple `STRING_CONTENT` tokens. We need to concat them. Luckily we don't need to handle as many cases as in uppercase arrays where interpolation is allowed. --- snapshots/spanning_heredoc.txt | 56 ++++++++++++++++----------- src/prism.c | 71 +++++++++++++++++++++++++++++----- 2 files changed, 95 insertions(+), 32 deletions(-) diff --git a/snapshots/spanning_heredoc.txt b/snapshots/spanning_heredoc.txt index 57bbe9fc77..fc11ac7876 100644 --- a/snapshots/spanning_heredoc.txt +++ b/snapshots/spanning_heredoc.txt @@ -192,19 +192,24 @@ │ │ │ └── unescaped: "i\n" │ │ └── @ ArrayNode (location: (28,9)-(31,2)) │ │ ├── flags: ∅ - │ │ ├── elements: (length: 2) - │ │ │ ├── @ StringNode (location: (28,12)-(28,14)) - │ │ │ │ ├── flags: ∅ - │ │ │ │ ├── opening_loc: ∅ - │ │ │ │ ├── content_loc: (28,12)-(28,14) = "j\\" - │ │ │ │ ├── closing_loc: ∅ - │ │ │ │ └── unescaped: "j\n" - │ │ │ └── @ StringNode (location: (31,0)-(31,1)) + │ │ ├── elements: (length: 1) + │ │ │ └── @ InterpolatedStringNode (location: (28,12)-(31,1)) │ │ │ ├── flags: ∅ │ │ │ ├── opening_loc: ∅ - │ │ │ ├── content_loc: (31,0)-(31,1) = "j" - │ │ │ ├── closing_loc: ∅ - │ │ │ └── unescaped: "j" + │ │ │ ├── parts: (length: 2) + │ │ │ │ ├── @ StringNode (location: (28,12)-(28,14)) + │ │ │ │ │ ├── flags: static_literal, frozen + │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ ├── content_loc: (28,12)-(28,14) = "j\\" + │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ └── unescaped: "j\n" + │ │ │ │ └── @ StringNode (location: (31,0)-(31,1)) + │ │ │ │ ├── flags: static_literal, frozen + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── content_loc: (31,0)-(31,1) = "j" + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── unescaped: "j" + │ │ │ └── closing_loc: ∅ │ │ ├── opening_loc: (28,9)-(28,12) = "%w[" │ │ └── closing_loc: (31,1)-(31,2) = "]" │ ├── closing_loc: ∅ @@ -271,19 +276,24 @@ │ │ │ └── unescaped: "m\n" │ │ └── @ ArrayNode (location: (41,9)-(44,2)) │ │ ├── flags: static_literal - │ │ ├── elements: (length: 2) - │ │ │ ├── @ SymbolNode (location: (41,12)-(41,14)) - │ │ │ │ ├── flags: static_literal, forced_us_ascii_encoding - │ │ │ │ ├── opening_loc: ∅ - │ │ │ │ ├── value_loc: (41,12)-(41,14) = "n\\" - │ │ │ │ ├── closing_loc: ∅ - │ │ │ │ └── unescaped: "n\n" - │ │ │ └── @ SymbolNode (location: (44,0)-(44,1)) - │ │ │ ├── flags: static_literal, forced_us_ascii_encoding + │ │ ├── elements: (length: 1) + │ │ │ └── @ InterpolatedSymbolNode (location: (41,12)-(41,14)) + │ │ │ ├── flags: static_literal │ │ │ ├── opening_loc: ∅ - │ │ │ ├── value_loc: (44,0)-(44,1) = "n" - │ │ │ ├── closing_loc: ∅ - │ │ │ └── unescaped: "n" + │ │ │ ├── parts: (length: 2) + │ │ │ │ ├── @ StringNode (location: (41,12)-(41,14)) + │ │ │ │ │ ├── flags: static_literal, frozen + │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ ├── content_loc: (41,12)-(41,14) = "n\\" + │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ └── unescaped: "n\n" + │ │ │ │ └── @ StringNode (location: (41,12)-(41,14)) + │ │ │ │ ├── flags: static_literal, frozen + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── content_loc: (41,12)-(41,14) = "n\\" + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── unescaped: "n" + │ │ │ └── closing_loc: ∅ │ │ ├── opening_loc: (41,9)-(41,12) = "%i[" │ │ └── closing_loc: (44,1)-(44,2) = "]" │ ├── closing_loc: ∅ diff --git a/src/prism.c b/src/prism.c index cd4d166a12..291d1d8521 100644 --- a/src/prism.c +++ b/src/prism.c @@ -19299,18 +19299,52 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b parser_lex(parser); pm_token_t opening = parser->previous; pm_array_node_t *array = pm_array_node_create(parser, &opening); + pm_node_t *current = NULL; while (!match2(parser, PM_TOKEN_STRING_END, PM_TOKEN_EOF)) { accept1(parser, PM_TOKEN_WORDS_SEP); if (match1(parser, PM_TOKEN_STRING_END)) break; - if (match1(parser, PM_TOKEN_STRING_CONTENT)) { + // Interpolation is not possible but nested heredocs can still lead to + // consecutive (disjoint) string tokens when the final newline is escaped. + while (match1(parser, PM_TOKEN_STRING_CONTENT)) { pm_token_t opening = not_provided(parser); pm_token_t closing = not_provided(parser); - pm_array_node_elements_append(array, UP(pm_symbol_node_create_current_string(parser, &opening, &parser->current, &closing))); + + // Record the string node, moving to interpolation if needed. + if (current == NULL) { + current = UP(pm_symbol_node_create_current_string(parser, &opening, &parser->current, &closing)); + parser_lex(parser); + } else if (PM_NODE_TYPE_P(current, PM_INTERPOLATED_SYMBOL_NODE)) { + pm_node_t *string = UP(pm_string_node_create_current_string(parser, &opening, &parser->current, &closing)); + parser_lex(parser); + pm_interpolated_symbol_node_append((pm_interpolated_symbol_node_t *) current, string); + } else if (PM_NODE_TYPE_P(current, PM_SYMBOL_NODE)) { + pm_symbol_node_t *cast = (pm_symbol_node_t *) current; + pm_token_t bounds = not_provided(parser); + + pm_token_t content = { .type = PM_TOKEN_STRING_CONTENT, .start = cast->value_loc.start, .end = cast->value_loc.end }; + pm_node_t *first_string = UP(pm_string_node_create_unescaped(parser, &bounds, &content, &bounds, &cast->unescaped)); + pm_node_t *second_string = UP(pm_string_node_create_current_string(parser, &opening, &parser->previous, &closing)); + parser_lex(parser); + + pm_interpolated_symbol_node_t *interpolated = pm_interpolated_symbol_node_create(parser, &opening, NULL, &closing); + pm_interpolated_symbol_node_append(interpolated, first_string); + pm_interpolated_symbol_node_append(interpolated, second_string); + + xfree(current); + current = UP(interpolated); + } else { + assert(false && "unreachable"); + } } - expect1(parser, PM_TOKEN_STRING_CONTENT, PM_ERR_LIST_I_LOWER_ELEMENT); + if (current) { + pm_array_node_elements_append(array, current); + current = NULL; + } else { + expect1(parser, PM_TOKEN_STRING_CONTENT, PM_ERR_LIST_W_LOWER_ELEMENT); + } } pm_token_t closing = parser->current; @@ -19489,23 +19523,42 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b parser_lex(parser); pm_token_t opening = parser->previous; pm_array_node_t *array = pm_array_node_create(parser, &opening); - - // skip all leading whitespaces - accept1(parser, PM_TOKEN_WORDS_SEP); + pm_node_t *current = NULL; while (!match2(parser, PM_TOKEN_STRING_END, PM_TOKEN_EOF)) { accept1(parser, PM_TOKEN_WORDS_SEP); if (match1(parser, PM_TOKEN_STRING_END)) break; - if (match1(parser, PM_TOKEN_STRING_CONTENT)) { + // Interpolation is not possible but nested heredocs can still lead to + // consecutive (disjoint) string tokens when the final newline is escaped. + while (match1(parser, PM_TOKEN_STRING_CONTENT)) { pm_token_t opening = not_provided(parser); pm_token_t closing = not_provided(parser); pm_node_t *string = UP(pm_string_node_create_current_string(parser, &opening, &parser->current, &closing)); - pm_array_node_elements_append(array, string); + + // Record the string node, moving to interpolation if needed. + if (current == NULL) { + current = string; + } else if (PM_NODE_TYPE_P(current, PM_INTERPOLATED_STRING_NODE)) { + pm_interpolated_string_node_append((pm_interpolated_string_node_t *) current, string); + } else if (PM_NODE_TYPE_P(current, PM_STRING_NODE)) { + pm_interpolated_string_node_t *interpolated = pm_interpolated_string_node_create(parser, &opening, NULL, &closing); + pm_interpolated_string_node_append(interpolated, current); + pm_interpolated_string_node_append(interpolated, string); + current = UP(interpolated); + } else { + assert(false && "unreachable"); + } + parser_lex(parser); } - expect1(parser, PM_TOKEN_STRING_CONTENT, PM_ERR_LIST_W_LOWER_ELEMENT); + if (current) { + pm_array_node_elements_append(array, current); + current = NULL; + } else { + expect1(parser, PM_TOKEN_STRING_CONTENT, PM_ERR_LIST_W_LOWER_ELEMENT); + } } pm_token_t closing = parser->current; From 1bc8ec5e5ddf577f6c785e9b74b8d183916f6f22 Mon Sep 17 00:00:00 2001 From: Earlopain <14981592+Earlopain@users.noreply.github.com> Date: Wed, 3 Dec 2025 09:06:22 +0100 Subject: [PATCH 251/333] Fix wrong error message for lower percent i arrays Not so sure how to trigger it but this is definitly more correct. --- src/prism.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/prism.c b/src/prism.c index 291d1d8521..02247734e2 100644 --- a/src/prism.c +++ b/src/prism.c @@ -19343,7 +19343,7 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b pm_array_node_elements_append(array, current); current = NULL; } else { - expect1(parser, PM_TOKEN_STRING_CONTENT, PM_ERR_LIST_W_LOWER_ELEMENT); + expect1(parser, PM_TOKEN_STRING_CONTENT, PM_ERR_LIST_I_LOWER_ELEMENT); } } From c8e1b111201c9a5fc044b1013bc086be3e355f4d Mon Sep 17 00:00:00 2001 From: Benoit Daloze Date: Wed, 3 Dec 2025 15:41:23 +0100 Subject: [PATCH 252/333] Follow repo move from oracle/truffleruby to truffleruby/truffleruby --- README.md | 2 +- docs/build_system.md | 4 ++-- docs/cruby_compilation.md | 2 +- include/prism.h | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 9d6056ef8c..e92ef7bfb3 100644 --- a/README.md +++ b/README.md @@ -116,7 +116,7 @@ Prism has been integrated into the majority of Ruby runtimes, many libraries, an * [JRuby](https://github.com/jruby/jruby/pull/8103) (via Java) * [Natalie](https://github.com/natalie-lang/natalie/pull/1213) (via C++ and Ruby) * [Opal](https://github.com/opal/opal/pull/2642) (via Ruby and WASM) -* [TruffleRuby](https://github.com/oracle/truffleruby/issues/3117) (via Java) +* [TruffleRuby](https://github.com/truffleruby/truffleruby/issues/3117) (via Java) ### Libraries diff --git a/docs/build_system.md b/docs/build_system.md index 98581f3898..3595c69741 100644 --- a/docs/build_system.md +++ b/docs/build_system.md @@ -58,12 +58,12 @@ prism's `Makefile` is not used at all in CRuby. Instead, CRuby's `Makefile` is u ### Building prism as part of TruffleRuby -[This script](https://github.com/oracle/truffleruby/blob/master/tool/import-prism.sh) imports prism sources in TruffleRuby. +[This script](https://github.com/truffleruby/truffleruby/blob/master/tool/import-prism.sh) imports prism sources in TruffleRuby. The script generates the templates when importing. Then when `mx build` builds TruffleRuby and the `prism` mx project inside, it runs `make`. -Then the `prism bindings` mx project is built, which contains the [bindings](https://github.com/oracle/truffleruby/blob/vm-24.1.1/src/main/c/yarp_bindings/src/yarp_bindings.c) +Then the `prism bindings` mx project is built, which contains the [bindings](https://github.com/truffleruby/truffleruby/blob/vm-24.1.1/src/main/c/yarp_bindings/src/yarp_bindings.c) and links to `libprism.a` (to avoid exporting symbols, so no conflict when installing the prism gem). ### Building prism as part of JRuby diff --git a/docs/cruby_compilation.md b/docs/cruby_compilation.md index 8440e9058c..8d98ef9eaa 100644 --- a/docs/cruby_compilation.md +++ b/docs/cruby_compilation.md @@ -1,6 +1,6 @@ # Compiling Prism's AST -One important class of consumers of Prism's AST is compilers. Currently [CRuby](https://github.com/ruby/ruby), [JRuby](https://github.com/jruby/jruby), [TruffleRuby](https://github.com/oracle/truffleruby), and [Natalie](https://github.com/natalie-lang/natalie) have all built compilation code on top of Prism's AST. +One important class of consumers of Prism's AST is compilers. Currently [CRuby](https://github.com/ruby/ruby), [JRuby](https://github.com/jruby/jruby), [TruffleRuby](https://github.com/truffleruby/truffleruby), and [Natalie](https://github.com/natalie-lang/natalie) have all built compilation code on top of Prism's AST. This document will describe, at a high level, how CRuby's compilation of Prism's AST works. diff --git a/include/prism.h b/include/prism.h index dc31f26e78..c468db18be 100644 --- a/include/prism.h +++ b/include/prism.h @@ -314,7 +314,7 @@ PRISM_EXPORTED_FUNCTION pm_string_query_t pm_string_query_method_name(const uint * dependencies. It is currently being integrated into * [CRuby](https://github.com/ruby/ruby), * [JRuby](https://github.com/jruby/jruby), - * [TruffleRuby](https://github.com/oracle/truffleruby), + * [TruffleRuby](https://github.com/truffleruby/truffleruby), * [Sorbet](https://github.com/sorbet/sorbet), and * [Syntax Tree](https://github.com/ruby-syntax-tree/syntax_tree). * From 7440eb4b11cd2da5283a8060bab0139c269a4195 Mon Sep 17 00:00:00 2001 From: Earlopain <14981592+Earlopain@users.noreply.github.com> Date: Thu, 4 Dec 2025 11:58:51 +0100 Subject: [PATCH 253/333] Fix `%Q` with newline delimiter and heredoc interpolation The lexer did not jump to the `heredoc_end`, causing the heredoc end delimiter to be parsed twice. Normally the heredocs get flushed when a newline is encountered. But because the newline is part of the string delimiter, that codepath is not taken. Fixes [Bug #21758] --- .../heredoc_percent_q_newline_delimiter.txt | 114 ++++++++++++++++++ src/prism.c | 7 ++ .../heredoc_percent_q_newline_delimiter.txt | 11 ++ .../heredoc_percent_q_newline_delimiter.txt | 22 ++++ test/prism/ruby/parser_test.rb | 3 + test/prism/ruby/ruby_parser_test.rb | 1 + 6 files changed, 158 insertions(+) create mode 100644 snapshots/heredoc_percent_q_newline_delimiter.txt create mode 100644 test/prism/errors/heredoc_percent_q_newline_delimiter.txt create mode 100644 test/prism/fixtures/heredoc_percent_q_newline_delimiter.txt diff --git a/snapshots/heredoc_percent_q_newline_delimiter.txt b/snapshots/heredoc_percent_q_newline_delimiter.txt new file mode 100644 index 0000000000..75c436b670 --- /dev/null +++ b/snapshots/heredoc_percent_q_newline_delimiter.txt @@ -0,0 +1,114 @@ +@ ProgramNode (location: (1,0)-(22,0)) +├── flags: ∅ +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(22,0)) + ├── flags: ∅ + └── body: (length: 7) + ├── @ InterpolatedStringNode (location: (1,0)-(3,0)) + │ ├── flags: newline, static_literal, mutable + │ ├── opening_loc: (1,0)-(2,0) = "%Q\n" + │ ├── parts: (length: 1) + │ │ └── @ EmbeddedStatementsNode (location: (2,0)-(2,6)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: (2,0)-(2,2) = "\#{" + │ │ ├── statements: + │ │ │ @ StatementsNode (location: (2,2)-(2,5)) + │ │ │ ├── flags: ∅ + │ │ │ └── body: (length: 1) + │ │ │ └── @ StringNode (location: (2,2)-(2,5)) + │ │ │ ├── flags: static_literal, frozen + │ │ │ ├── opening_loc: (2,2)-(2,5) = "<heredoc_end) { + parser_flush_heredoc_end(parser); + } + lex_state_set(parser, PM_LEX_STATE_END); lex_mode_pop(parser); LEX(PM_TOKEN_STRING_END); diff --git a/test/prism/errors/heredoc_percent_q_newline_delimiter.txt b/test/prism/errors/heredoc_percent_q_newline_delimiter.txt new file mode 100644 index 0000000000..73664c071f --- /dev/null +++ b/test/prism/errors/heredoc_percent_q_newline_delimiter.txt @@ -0,0 +1,11 @@ +%q +#{< Date: Thu, 4 Dec 2025 12:08:04 +0100 Subject: [PATCH 254/333] Don't fail-fast in cruby bindings I still want to see if the other passes if one fails --- .github/workflows/cruby-bindings.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/cruby-bindings.yml b/.github/workflows/cruby-bindings.yml index 2c63a76299..d635e550f0 100644 --- a/.github/workflows/cruby-bindings.yml +++ b/.github/workflows/cruby-bindings.yml @@ -13,6 +13,7 @@ on: jobs: test-all: strategy: + fail-fast: false matrix: # Some tests in this repository are only run against parse.y # We test them here in order to not fail ruby/ruby CI. From 3fe862534ba40dfdfd9202b16ed59ba3b99251cd Mon Sep 17 00:00:00 2001 From: Steven Johnstone Date: Fri, 5 Dec 2025 16:07:33 +0000 Subject: [PATCH 255/333] Avoid out-of-bounds reads Fixes #3784. --- src/encoding.c | 84 ++++++++++++++++++++++++++++++++++---------------- 1 file changed, 58 insertions(+), 26 deletions(-) diff --git a/src/encoding.c b/src/encoding.c index 424f149b8f..d7e5616840 100644 --- a/src/encoding.c +++ b/src/encoding.c @@ -2377,6 +2377,10 @@ pm_encoding_utf_8_char_width(const uint8_t *b, ptrdiff_t n) { */ size_t pm_encoding_utf_8_alpha_char(const uint8_t *b, ptrdiff_t n) { + if (n == 0) { + return 0; + } + if (*b < 0x80) { return (pm_encoding_unicode_table[*b] & PRISM_ENCODING_ALPHABETIC_BIT) ? 1 : 0; } @@ -2397,6 +2401,10 @@ pm_encoding_utf_8_alpha_char(const uint8_t *b, ptrdiff_t n) { */ size_t pm_encoding_utf_8_alnum_char(const uint8_t *b, ptrdiff_t n) { + if (n == 0) { + return 0; + } + if (*b < 0x80) { return (pm_encoding_unicode_table[*b] & (PRISM_ENCODING_ALPHANUMERIC_BIT)) ? 1 : 0; } @@ -2417,6 +2425,10 @@ pm_encoding_utf_8_alnum_char(const uint8_t *b, ptrdiff_t n) { */ bool pm_encoding_utf_8_isupper_char(const uint8_t *b, ptrdiff_t n) { + if (n == 0) { + return 0; + } + if (*b < 0x80) { return (pm_encoding_unicode_table[*b] & PRISM_ENCODING_UPPERCASE_BIT) ? true : false; } @@ -2435,7 +2447,8 @@ pm_encoding_utf_8_isupper_char(const uint8_t *b, ptrdiff_t n) { static pm_unicode_codepoint_t pm_cesu_8_codepoint(const uint8_t *b, ptrdiff_t n, size_t *width) { - if (b[0] < 0x80) { + + if ((n > 0) && (b[0] < 0x80)) { *width = 1; return (pm_unicode_codepoint_t) b[0]; } @@ -2474,6 +2487,10 @@ pm_cesu_8_codepoint(const uint8_t *b, ptrdiff_t n, size_t *width) { static size_t pm_encoding_cesu_8_char_width(const uint8_t *b, ptrdiff_t n) { + if (n == 0) { + return 0; + } + size_t width; pm_cesu_8_codepoint(b, n, &width); return width; @@ -2481,6 +2498,10 @@ pm_encoding_cesu_8_char_width(const uint8_t *b, ptrdiff_t n) { static size_t pm_encoding_cesu_8_alpha_char(const uint8_t *b, ptrdiff_t n) { + if (n == 0) { + return 0; + } + if (*b < 0x80) { return (pm_encoding_unicode_table[*b] & PRISM_ENCODING_ALPHABETIC_BIT) ? 1 : 0; } @@ -2497,6 +2518,10 @@ pm_encoding_cesu_8_alpha_char(const uint8_t *b, ptrdiff_t n) { static size_t pm_encoding_cesu_8_alnum_char(const uint8_t *b, ptrdiff_t n) { + if (n == 0) { + return 0; + } + if (*b < 0x80) { return (pm_encoding_unicode_table[*b] & (PRISM_ENCODING_ALPHANUMERIC_BIT)) ? 1 : 0; } @@ -2513,6 +2538,10 @@ pm_encoding_cesu_8_alnum_char(const uint8_t *b, ptrdiff_t n) { static bool pm_encoding_cesu_8_isupper_char(const uint8_t *b, ptrdiff_t n) { + if (n == 0) { + return 0; + } + if (*b < 0x80) { return (pm_encoding_unicode_table[*b] & PRISM_ENCODING_UPPERCASE_BIT) ? true : false; } @@ -3928,14 +3957,14 @@ static const uint8_t pm_encoding_windows_874_table[256] = { }; #define PRISM_ENCODING_TABLE(name) \ - static size_t pm_encoding_ ##name ## _alpha_char(const uint8_t *b, PRISM_ATTRIBUTE_UNUSED ptrdiff_t n) { \ - return (pm_encoding_ ##name ## _table[*b] & PRISM_ENCODING_ALPHABETIC_BIT); \ + static size_t pm_encoding_ ##name ## _alpha_char(const uint8_t *b, ptrdiff_t n) { \ + return ((n > 0) && (pm_encoding_ ##name ## _table[*b] & PRISM_ENCODING_ALPHABETIC_BIT)); \ } \ - static size_t pm_encoding_ ##name ## _alnum_char(const uint8_t *b, PRISM_ATTRIBUTE_UNUSED ptrdiff_t n) { \ - return (pm_encoding_ ##name ## _table[*b] & PRISM_ENCODING_ALPHANUMERIC_BIT) ? 1 : 0; \ + static size_t pm_encoding_ ##name ## _alnum_char(const uint8_t *b, ptrdiff_t n) { \ + return ((n > 0) && (pm_encoding_ ##name ## _table[*b] & PRISM_ENCODING_ALPHANUMERIC_BIT)) ? 1 : 0; \ } \ - static bool pm_encoding_ ##name ## _isupper_char(const uint8_t *b, PRISM_ATTRIBUTE_UNUSED ptrdiff_t n) { \ - return (pm_encoding_ ##name ## _table[*b] & PRISM_ENCODING_UPPERCASE_BIT); \ + static bool pm_encoding_ ##name ## _isupper_char(const uint8_t *b, ptrdiff_t n) { \ + return ((n > 0) && (pm_encoding_ ##name ## _table[*b] & PRISM_ENCODING_UPPERCASE_BIT)); \ } PRISM_ENCODING_TABLE(cp850) @@ -4004,8 +4033,8 @@ PRISM_ENCODING_TABLE(windows_874) * means that if the top bit is not set, the character is 1 byte long. */ static size_t -pm_encoding_ascii_char_width(const uint8_t *b, PRISM_ATTRIBUTE_UNUSED ptrdiff_t n) { - return *b < 0x80 ? 1 : 0; +pm_encoding_ascii_char_width(const uint8_t *b, ptrdiff_t n) { + return ((n > 0) && (*b < 0x80)) ? 1 : 0; } /** @@ -4013,8 +4042,8 @@ pm_encoding_ascii_char_width(const uint8_t *b, PRISM_ATTRIBUTE_UNUSED ptrdiff_t * alphabetical character. */ static size_t -pm_encoding_ascii_alpha_char(const uint8_t *b, PRISM_ATTRIBUTE_UNUSED ptrdiff_t n) { - return (pm_encoding_ascii_table[*b] & PRISM_ENCODING_ALPHABETIC_BIT); +pm_encoding_ascii_alpha_char(const uint8_t *b, ptrdiff_t n) { + return (n > 0) ? (pm_encoding_ascii_table[*b] & PRISM_ENCODING_ALPHABETIC_BIT) : 0; } /** @@ -4024,7 +4053,7 @@ pm_encoding_ascii_alpha_char(const uint8_t *b, PRISM_ATTRIBUTE_UNUSED ptrdiff_t */ static size_t pm_encoding_ascii_alpha_char_7bit(const uint8_t *b, ptrdiff_t n) { - return (*b < 0x80) ? pm_encoding_ascii_alpha_char(b, n) : 0; + return ((n > 0) && (*b < 0x80)) ? pm_encoding_ascii_alpha_char(b, n) : 0; } /** @@ -4032,8 +4061,8 @@ pm_encoding_ascii_alpha_char_7bit(const uint8_t *b, ptrdiff_t n) { * alphanumeric character. */ static size_t -pm_encoding_ascii_alnum_char(const uint8_t *b, PRISM_ATTRIBUTE_UNUSED ptrdiff_t n) { - return (pm_encoding_ascii_table[*b] & PRISM_ENCODING_ALPHANUMERIC_BIT) ? 1 : 0; +pm_encoding_ascii_alnum_char(const uint8_t *b, ptrdiff_t n) { + return ((n > 0) && (pm_encoding_ascii_table[*b] & PRISM_ENCODING_ALPHANUMERIC_BIT)) ? 1 : 0; } /** @@ -4043,7 +4072,7 @@ pm_encoding_ascii_alnum_char(const uint8_t *b, PRISM_ATTRIBUTE_UNUSED ptrdiff_t */ static size_t pm_encoding_ascii_alnum_char_7bit(const uint8_t *b, ptrdiff_t n) { - return (*b < 0x80) ? pm_encoding_ascii_alnum_char(b, n) : 0; + return ((n > 0) && (*b < 0x80)) ? pm_encoding_ascii_alnum_char(b, n) : 0; } /** @@ -4051,8 +4080,8 @@ pm_encoding_ascii_alnum_char_7bit(const uint8_t *b, ptrdiff_t n) { * character. */ static bool -pm_encoding_ascii_isupper_char(const uint8_t *b, PRISM_ATTRIBUTE_UNUSED ptrdiff_t n) { - return (pm_encoding_ascii_table[*b] & PRISM_ENCODING_UPPERCASE_BIT); +pm_encoding_ascii_isupper_char(const uint8_t *b, ptrdiff_t n) { + return (n > 0) && (pm_encoding_ascii_table[*b] & PRISM_ENCODING_UPPERCASE_BIT); } /** @@ -4071,7 +4100,7 @@ pm_encoding_single_char_width(PRISM_ATTRIBUTE_UNUSED const uint8_t *b, PRISM_ATT static size_t pm_encoding_euc_jp_char_width(const uint8_t *b, ptrdiff_t n) { // These are the single byte characters. - if (*b < 0x80) { + if ((n > 0) && (*b < 0x80)) { return 1; } @@ -4115,6 +4144,9 @@ pm_encoding_euc_jp_isupper_char(const uint8_t *b, ptrdiff_t n) { */ static size_t pm_encoding_shift_jis_char_width(const uint8_t *b, ptrdiff_t n) { + if (n == 0) { + return 0; + } // These are the single byte characters. if (b[0] < 0x80 || (b[0] >= 0xA1 && b[0] <= 0xDF)) { return 1; @@ -4178,7 +4210,7 @@ pm_encoding_shift_jis_isupper_char(const uint8_t *b, ptrdiff_t n) { */ static bool pm_encoding_ascii_isupper_char_7bit(const uint8_t *b, ptrdiff_t n) { - return (*b < 0x80) && pm_encoding_ascii_isupper_char(b, n); + return (n > 0) && (*b < 0x80) && pm_encoding_ascii_isupper_char(b, n); } /** @@ -4188,7 +4220,7 @@ pm_encoding_ascii_isupper_char_7bit(const uint8_t *b, ptrdiff_t n) { static size_t pm_encoding_big5_char_width(const uint8_t *b, ptrdiff_t n) { // These are the single byte characters. - if (*b < 0x80) { + if ((n > 0) && (*b < 0x80)) { return 1; } @@ -4207,7 +4239,7 @@ pm_encoding_big5_char_width(const uint8_t *b, ptrdiff_t n) { static size_t pm_encoding_cp949_char_width(const uint8_t *b, ptrdiff_t n) { // These are the single byte characters - if (*b <= 0x80) { + if ((n > 0) && (*b <= 0x80)) { return 1; } @@ -4226,7 +4258,7 @@ pm_encoding_cp949_char_width(const uint8_t *b, ptrdiff_t n) { static size_t pm_encoding_emacs_mule_char_width(const uint8_t *b, ptrdiff_t n) { // These are the 1 byte characters. - if (*b < 0x80) { + if ((n > 0) && (*b < 0x80)) { return 1; } @@ -4269,7 +4301,7 @@ pm_encoding_emacs_mule_char_width(const uint8_t *b, ptrdiff_t n) { static size_t pm_encoding_euc_kr_char_width(const uint8_t *b, ptrdiff_t n) { // These are the single byte characters. - if (*b < 0x80) { + if ((n > 0) && (*b < 0x80)) { return 1; } @@ -4288,7 +4320,7 @@ pm_encoding_euc_kr_char_width(const uint8_t *b, ptrdiff_t n) { static size_t pm_encoding_euc_tw_char_width(const uint8_t *b, ptrdiff_t n) { // These are the single byte characters. - if (*b < 0x80) { + if ((n > 0) && (*b < 0x80)) { return 1; } @@ -4312,7 +4344,7 @@ pm_encoding_euc_tw_char_width(const uint8_t *b, ptrdiff_t n) { static size_t pm_encoding_gb18030_char_width(const uint8_t *b, ptrdiff_t n) { // These are the 1 byte characters. - if (*b < 0x80) { + if ((n > 0) && (*b < 0x80)) { return 1; } @@ -4336,7 +4368,7 @@ pm_encoding_gb18030_char_width(const uint8_t *b, ptrdiff_t n) { static size_t pm_encoding_gbk_char_width(const uint8_t *b, ptrdiff_t n) { // These are the single byte characters. - if (*b <= 0x80) { + if ((n > 0) && (*b <= 0x80)) { return 1; } From b72b664675097d4474135f162924644f109ff5c7 Mon Sep 17 00:00:00 2001 From: Steven Johnstone Date: Fri, 5 Dec 2025 17:44:00 +0000 Subject: [PATCH 256/333] Avoid undefined int overflow behaviour Fixes #3786. --- templates/src/serialize.c.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/src/serialize.c.erb b/templates/src/serialize.c.erb index 3e15a11039..0f0aace445 100644 --- a/templates/src/serialize.c.erb +++ b/templates/src/serialize.c.erb @@ -315,7 +315,7 @@ pm_serialize_content(pm_parser_t *parser, pm_node_t *node, pm_buffer_t *buffer) // buffer offset. We will add a leading 1 to indicate that this // is a buffer offset. uint32_t content_offset = pm_sizet_to_u32(buffer->length); - uint32_t owned_mask = (uint32_t) (1 << 31); + uint32_t owned_mask = 1U << 31; assert(content_offset < owned_mask); content_offset |= owned_mask; From fbe9b131a10c0f34ff3d923b9bddc4c7d4e91884 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Fri, 5 Dec 2025 15:17:09 -0500 Subject: [PATCH 257/333] Correct constant pool bucket type logic When replacing an owned constant by a different type (constant or shared) replace with the correct type instead of defaulting to shared. --- src/util/pm_constant_pool.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util/pm_constant_pool.c b/src/util/pm_constant_pool.c index 38ea01a228..922ce6a18c 100644 --- a/src/util/pm_constant_pool.c +++ b/src/util/pm_constant_pool.c @@ -264,7 +264,7 @@ pm_constant_pool_insert(pm_constant_pool_t *pool, const uint8_t *start, size_t l // constant and replace it with the shared constant. xfree((void *) constant->start); constant->start = start; - bucket->type = (unsigned int) (PM_CONSTANT_POOL_BUCKET_DEFAULT & 0x3); + bucket->type = (unsigned int) (type & 0x3); } return bucket->id; From 173ccb84adb98e5ce6da9aae3afeaaa1ddeedc9b Mon Sep 17 00:00:00 2001 From: Steven Johnstone Date: Sat, 6 Dec 2025 00:37:53 +0000 Subject: [PATCH 258/333] Avoid out-of-bounds reads Fixes #3790. --- src/prism.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/prism.c b/src/prism.c index 77ac74192e..93392da349 100644 --- a/src/prism.c +++ b/src/prism.c @@ -12762,7 +12762,7 @@ parse_target(pm_parser_t *parser, pm_node_t *target, bool multiple, bool splat_p return UP(pm_local_variable_target_node_create(parser, &message_loc, name, 0)); } - if (*call->message_loc.start == '_' || parser->encoding->alnum_char(call->message_loc.start, call->message_loc.end - call->message_loc.start)) { + if (peek_at(parser, call->message_loc.start) == '_' || parser->encoding->alnum_char(call->message_loc.start, call->message_loc.end - call->message_loc.start)) { if (multiple && PM_NODE_FLAG_P(call, PM_CALL_NODE_FLAGS_SAFE_NAVIGATION)) { pm_parser_err_node(parser, (const pm_node_t *) call, PM_ERR_UNEXPECTED_SAFE_NAVIGATION); } @@ -16118,7 +16118,7 @@ parse_pattern(pm_parser_t *parser, pm_constant_id_list_t *captures, uint8_t flag static void parse_pattern_capture(pm_parser_t *parser, pm_constant_id_list_t *captures, pm_constant_id_t capture, const pm_location_t *location) { // Skip this capture if it starts with an underscore. - if (*location->start == '_') return; + if (peek_at(parser, location->start) == '_') return; if (pm_constant_id_list_includes(captures, capture)) { pm_parser_err(parser, location->start, location->end, PM_ERR_PATTERN_CAPTURE_DUPLICATE); From 0ad30561e2c045fdd3505041c88b24ea43951a26 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Mon, 8 Dec 2025 08:26:28 -0500 Subject: [PATCH 259/333] Fix hash pattern location when missing nodes --- src/prism.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/prism.c b/src/prism.c index 93392da349..0cb8c90570 100644 --- a/src/prism.c +++ b/src/prism.c @@ -4096,8 +4096,8 @@ pm_hash_pattern_node_node_list_create(pm_parser_t *parser, pm_node_list_t *eleme if (elements->size > 0) { if (rest) { - start = elements->nodes[0]->location.start; - end = rest->location.end; + start = MIN(rest->location.start, elements->nodes[0]->location.start); + end = MAX(rest->location.end, elements->nodes[elements->size - 1]->location.end); } else { start = elements->nodes[0]->location.start; end = elements->nodes[elements->size - 1]->location.end; @@ -4117,11 +4117,7 @@ pm_hash_pattern_node_node_list_create(pm_parser_t *parser, pm_node_list_t *eleme .closing_loc = { 0 } }; - pm_node_t *element; - PM_NODE_LIST_FOREACH(elements, index, element) { - pm_node_list_append(&node->elements, element); - } - + pm_node_list_concat(&node->elements, elements); return node; } From 937313d7f01cbd5ee387544d488818b1a4c0187b Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Mon, 8 Dec 2025 08:37:52 -0500 Subject: [PATCH 260/333] Fix up call target node when invalid When there is an invalid syntax tree, we need to make sure to fill in the required call operator location. --- src/prism.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/prism.c b/src/prism.c index 93392da349..ac01d95f60 100644 --- a/src/prism.c +++ b/src/prism.c @@ -3077,6 +3077,17 @@ pm_call_target_node_create(pm_parser_t *parser, pm_call_node_t *target) { .message_loc = target->message_loc }; + /* It is possible to get here where we have parsed an invalid syntax tree + * where the call operator was not present. In that case we will have a + * problem because it is a required location. In this case we need to fill + * it in with a fake location so that the syntax tree remains valid. */ + if (node->call_operator_loc.start == NULL) { + node->call_operator_loc = (pm_location_t) { + .start = target->base.location.start, + .end = target->base.location.start + }; + } + // Here we're going to free the target, since it is no longer necessary. // However, we don't want to call `pm_node_destroy` because we want to keep // around all of its children since we just reused them. From 855d81a4a87ca93aa71bf93c36497201589c526e Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Mon, 8 Dec 2025 10:07:39 -0500 Subject: [PATCH 261/333] Fully handle unreferencing a block exit If a block exit has a further block exit in its subtree, we need to keep recursing. --- src/prism.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/prism.c b/src/prism.c index 93392da349..0146d96f1a 100644 --- a/src/prism.c +++ b/src/prism.c @@ -12533,7 +12533,10 @@ pm_node_unreference_each(const pm_node_t *node, void *data) { ); } parser->current_block_exits->size--; - return false; + + /* Note returning true here because these nodes could have + * arguments that are themselves block exits. */ + return true; } index++; From 8eeb5f358b9cb69a17a1e97395856aa66272ffc9 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Mon, 8 Dec 2025 10:18:42 -0500 Subject: [PATCH 262/333] Nested heredoc with newline terminator When you have a heredoc interpolated into another heredoc where the inner heredoc is terminated by a newline, you need to avoid adding the newline character a second time. --- src/prism.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/prism.c b/src/prism.c index 93392da349..58a11dd89d 100644 --- a/src/prism.c +++ b/src/prism.c @@ -12024,7 +12024,10 @@ parser_lex(pm_parser_t *parser) { // string content. if (heredoc_lex_mode->indent == PM_HEREDOC_INDENT_TILDE) { const uint8_t *end = parser->current.end; - pm_newline_list_append(&parser->newline_list, end); + + if (parser->heredoc_end == NULL) { + pm_newline_list_append(&parser->newline_list, end); + } // Here we want the buffer to only // include up to the backslash. From af9b3640a8c82bf9d196298b30222347b987e0c3 Mon Sep 17 00:00:00 2001 From: Ryan Davis Date: Sun, 7 Dec 2025 01:11:04 -0800 Subject: [PATCH 263/333] Fixed Prism::Translation::RubyParser's comment processing Tests were failing in Flay under Prism. --- lib/prism/translation/ruby_parser.rb | 62 +++++++++++++++++++++------- 1 file changed, 46 insertions(+), 16 deletions(-) diff --git a/lib/prism/translation/ruby_parser.rb b/lib/prism/translation/ruby_parser.rb index 2ca7da0bf2..5149756add 100644 --- a/lib/prism/translation/ruby_parser.rb +++ b/lib/prism/translation/ruby_parser.rb @@ -415,14 +415,18 @@ def visit_class_node(node) visit(node.constant_path) end - if node.body.nil? - s(node, :class, name, visit(node.superclass)) - elsif node.body.is_a?(StatementsNode) - compiler = copy_compiler(in_def: false) - s(node, :class, name, visit(node.superclass)).concat(node.body.body.map { |child| child.accept(compiler) }) - else - s(node, :class, name, visit(node.superclass), node.body.accept(copy_compiler(in_def: false))) - end + result = + if node.body.nil? + s(node, :class, name, visit(node.superclass)) + elsif node.body.is_a?(StatementsNode) + compiler = copy_compiler(in_def: false) + s(node, :class, name, visit(node.superclass)).concat(node.body.body.map { |child| child.accept(compiler) }) + else + s(node, :class, name, visit(node.superclass), node.body.accept(copy_compiler(in_def: false))) + end + + attach_comments(result, node) + result end # ``` @@ -611,7 +615,9 @@ def visit_def_node(node) s(node, :defs, visit(node.receiver), name) end + attach_comments(result, node) result.line(node.name_loc.start_line) + if node.parameters.nil? result << s(node, :args).line(node.name_loc.start_line) else @@ -1270,14 +1276,18 @@ def visit_module_node(node) visit(node.constant_path) end - if node.body.nil? - s(node, :module, name) - elsif node.body.is_a?(StatementsNode) - compiler = copy_compiler(in_def: false) - s(node, :module, name).concat(node.body.body.map { |child| child.accept(compiler) }) - else - s(node, :module, name, node.body.accept(copy_compiler(in_def: false))) - end + result = + if node.body.nil? + s(node, :module, name) + elsif node.body.is_a?(StatementsNode) + compiler = copy_compiler(in_def: false) + s(node, :module, name).concat(node.body.body.map { |child| child.accept(compiler) }) + else + s(node, :module, name, node.body.accept(copy_compiler(in_def: false))) + end + + attach_comments(result, node) + result end # ``` @@ -1820,6 +1830,17 @@ def visit_yield_node(node) private + # Attach prism comments to the given sexp. + def attach_comments(sexp, node) + return unless node.comments + return if node.comments.empty? + + extra = node.location.start_line - node.comments.last.location.start_line + comments = node.comments.map(&:slice) + comments.concat([nil] * [0, extra].max) + sexp.comments = comments.join("\n") + end + # Create a new compiler with the given options. def copy_compiler(in_def: self.in_def, in_pattern: self.in_pattern) Compiler.new(file, in_def: in_def, in_pattern: in_pattern) @@ -1898,6 +1919,14 @@ def parse_file(filepath) translate(Prism.parse_file(filepath, partial_script: true), filepath) end + # Parse the give file and translate it into the + # seattlerb/ruby_parser gem's Sexp format. This method is + # provided for API compatibility to RubyParser and takes an + # optional +timeout+ argument. + def process(ruby, file = "(string)", timeout = nil) + Timeout.timeout(timeout) { parse(ruby, file) } + end + class << self # Parse the given source and translate it into the seattlerb/ruby_parser # gem's Sexp format. @@ -1922,6 +1951,7 @@ def translate(result, filepath) raise ::RubyParser::SyntaxError, "#{filepath}:#{error.location.start_line} :: #{error.message}" end + result.attach_comments! result.value.accept(Compiler.new(filepath)) end end From 810f30e2dbf90840246ef438da0e8eec59c58a6b Mon Sep 17 00:00:00 2001 From: Earlopain <14981592+Earlopain@users.noreply.github.com> Date: Sat, 13 Dec 2025 12:49:40 +0100 Subject: [PATCH 264/333] Silence clippy It's generated code ``` error: unnecessary structure name repetition --> /home/runner/work/prism/prism/rust/target/debug/build/ruby-prism-sys-c00cbfa68640095d/out/bindings.rs:2303:26 | 2303 | pub subsequent: *mut pm_rescue_node, | ^^^^^^^^^^^^^^ help: use the applicable keyword: `Self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.92.0/index.html#use_self = note: `-D clippy::use-self` implied by `-D warnings` = help: to override `-D warnings` add `#[allow(clippy::use_self)]` error: unnecessary structure name repetition --> /home/runner/work/prism/prism/rust/target/debug/build/ruby-prism-sys-c00cbfa68640095d/out/bindings.rs:2582:20 | 2582 | pub next: *mut pm_list_node, | ^^^^^^^^^^^^ help: use the applicable keyword: `Self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.92.0/index.html#use_self error: unnecessary structure name repetition --> /home/runner/work/prism/prism/rust/target/debug/build/ruby-prism-sys-c00cbfa68640095d/out/bindings.rs:2712:20 | 2712 | pub prev: *mut pm_lex_mode, | ^^^^^^^^^^^ help: use the applicable keyword: `Self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.92.0/index.html#use_self error: unnecessary structure name repetition --> /home/runner/work/prism/prism/rust/target/debug/build/ruby-prism-sys-c00cbfa68640095d/out/bindings.rs:2775:20 | 2775 | pub prev: *mut pm_context_node, | ^^^^^^^^^^^^^^^ help: use the applicable keyword: `Self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.92.0/index.html#use_self error: unnecessary structure name repetition --> /home/runner/work/prism/prism/rust/target/debug/build/ruby-prism-sys-c00cbfa68640095d/out/bindings.rs:2845:24 | 2845 | pub previous: *mut pm_scope, | ^^^^^^^^ help: use the applicable keyword: `Self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.92.0/index.html#use_self ``` --- rust/ruby-prism-sys/src/lib.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/rust/ruby-prism-sys/src/lib.rs b/rust/ruby-prism-sys/src/lib.rs index e18fced44e..8d4c979f5d 100644 --- a/rust/ruby-prism-sys/src/lib.rs +++ b/rust/ruby-prism-sys/src/lib.rs @@ -26,6 +26,7 @@ #[allow(non_upper_case_globals)] #[allow(unused_qualifications)] #[allow(clippy::missing_const_for_fn)] +#[allow(clippy::use_self)] mod bindings { // In `build.rs`, we use `bindgen` to generate bindings based on C headers // and `libprism`. Here is where we pull in those bindings and make From 30dc6d782dfc9bb9177ff44d8bef8d2db0f4b8dd Mon Sep 17 00:00:00 2001 From: Nathan Froyd Date: Sat, 13 Dec 2025 08:31:57 -0500 Subject: [PATCH 265/333] [rust] add `len()`/`is_empty()` to `ConstantList` --- rust/ruby-prism/src/lib.rs | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/rust/ruby-prism/src/lib.rs b/rust/ruby-prism/src/lib.rs index 34e1517be2..af430e1495 100644 --- a/rust/ruby-prism/src/lib.rs +++ b/rust/ruby-prism/src/lib.rs @@ -255,6 +255,18 @@ impl<'pr> ConstantList<'pr> { marker: PhantomData, } } + + /// Returns the length of the list. + #[must_use] + pub const fn len(&self) -> usize { + unsafe { self.pointer.as_ref().size } + } + + /// Returns whether the list is empty. + #[must_use] + pub const fn is_empty(&self) -> bool { + self.len() == 0 + } } impl<'pr> IntoIterator for &ConstantList<'pr> { @@ -811,11 +823,27 @@ mod tests { assert!(!node.as_program_node().unwrap().statements().body().is_empty()); let module = node.as_program_node().unwrap().statements().body().iter().next().unwrap(); let module = module.as_module_node().unwrap(); + + assert_eq!(module.locals().len(), 1); + assert!(!module.locals().is_empty()); + let locals = module.locals().iter().collect::>(); assert_eq!(locals.len(), 1); assert_eq!(locals[0].as_slice(), b"x"); + + let source = "module Foo; end"; + let result = parse(source.as_ref()); + + let node = result.node(); + assert_eq!(node.as_program_node().unwrap().statements().body().len(), 1); + assert!(!node.as_program_node().unwrap().statements().body().is_empty()); + let module = node.as_program_node().unwrap().statements().body().iter().next().unwrap(); + let module = module.as_module_node().unwrap(); + + assert_eq!(module.locals().len(), 0); + assert!(module.locals().is_empty()); } #[test] From b229e9dc8718dd583481d72ea79de77dad181e31 Mon Sep 17 00:00:00 2001 From: Earlopain <14981592+Earlopain@users.noreply.github.com> Date: Sat, 13 Dec 2025 15:08:21 +0100 Subject: [PATCH 266/333] Improve `bin/compare` * Handle unreadable files (some uploaded gems have wrong permissions) * Add warnings to things that get compared. They are part of the dumped content --- bin/compare | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/bin/compare b/bin/compare index 347c28a01a..d83de5dc64 100755 --- a/bin/compare +++ b/bin/compare @@ -26,15 +26,17 @@ def create_prism(ref) when "dump" begin child_socket.puts(Prism.dump_file(path).hash) - rescue Errno::EISDIR + rescue Errno::EISDIR, Errno::EACCES # Folder might end with `.rb` and get caught by the glob + # Some gems may contain files that are not readable by the current user child_socket.puts("") end when "details" parse_result = Prism.parse_file(path) child_socket.puts({ valid: parse_result.success?, - errors: parse_result.errors_format.hash, + errors: parse_result.errors.map(&:inspect).hash, + warnings: parse_result.warnings.map(&:inspect).hash, ast: parse_result.value.inspect.hash, }.to_json) else @@ -64,14 +66,15 @@ start = Process.clock_gettime(Process::CLOCK_MONOTONIC) def what_changed(baseline, compare, source_path) if baseline[:valid] != compare[:valid] - "#{source_path} changed from valid(#{baseline[:valid]}) to valid(#{compare[:valid]})" - elsif baseline[:valid] && compare[:valid] && baseline[:ast] != compare[:ast] - "#{source_path} is syntax valid with changed ast}" - elsif !baseline[:valid] && !compare[:valid] && baseline[:errors] != compare[:errors] - "#{source_path} is syntax invalid with changed errors" - else - raise "Unknown condition for #{source_path}" + return "#{source_path} changed from valid(#{baseline[:valid]}) to valid(#{compare[:valid]})" end + + changed = [] + %i[ast errors warnings].each do |type| + changed << type if baseline[type] != compare[type] + end + raise "Unknown changes for #{source_path}" if changed.empty? + "#{source_path} is valid(#{baseline[:valid]}) with changed #{changed.join(", ")}" end files.each_with_index do |source_path, i| From 6e5347803ccb4606c043a41c77cd175aa9213ff3 Mon Sep 17 00:00:00 2001 From: Steven Johnstone Date: Wed, 19 Nov 2025 09:30:57 +0000 Subject: [PATCH 267/333] Prevent an infinite loop parsing a capture name Fixes #3729. --- src/prism.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/prism.c b/src/prism.c index 20037b5b9f..7059db8f1d 100644 --- a/src/prism.c +++ b/src/prism.c @@ -20395,6 +20395,9 @@ pm_named_capture_escape_unicode(pm_parser_t *parser, pm_buffer_t *unescaped, con } size_t length = pm_strspn_hexadecimal_digit(cursor, end - cursor); + if (length == 0) { + break; + } uint32_t value = escape_unicode(parser, cursor, length); (void) pm_buffer_append_unicode_codepoint(unescaped, value); From f3f8fe776467876febdddbb7373c4b4c6442f3a2 Mon Sep 17 00:00:00 2001 From: Earlopain <14981592+Earlopain@users.noreply.github.com> Date: Sat, 13 Dec 2025 19:00:22 +0100 Subject: [PATCH 268/333] Fix npm publish workflow Last one didn't work out: ``` Run npm publish npm warn Unknown user config "always-auth". This will stop working in the next major version of npm. npm error code ENOENT npm error syscall open npm error path /home/runner/work/prism/prism/package.json npm error errno -2 npm error enoent Could not read package.json: Error: ENOENT: no such file or directory, open '/home/runner/work/prism/prism/package.json' npm error enoent This is related to npm not being able to find a file. npm error enoent npm error A complete log of this run can be found in: /home/runner/.npm/_logs/2025-10-16T12_44_21_684Z-debug-0.log ``` --- .github/workflows/publish-npm.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/publish-npm.yml b/.github/workflows/publish-npm.yml index 96e6654295..e14746a155 100644 --- a/.github/workflows/publish-npm.yml +++ b/.github/workflows/publish-npm.yml @@ -43,3 +43,4 @@ jobs: run: npm install -g npm@latest - run: npm publish + working-directory: javascript From df677c324fbd10e9f301d97754eb267d1c21e46c Mon Sep 17 00:00:00 2001 From: Ryan Davis Date: Fri, 12 Dec 2025 13:08:53 -0800 Subject: [PATCH 269/333] Define RubyParser::SyntaxError directly and drop require for ruby_parser. Had to add a require of sexp since that came in indirectly via ruby_parser. --- lib/prism/translation/ruby_parser.rb | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/prism/translation/ruby_parser.rb b/lib/prism/translation/ruby_parser.rb index 5149756add..a33ea2306c 100644 --- a/lib/prism/translation/ruby_parser.rb +++ b/lib/prism/translation/ruby_parser.rb @@ -2,12 +2,17 @@ # :markup: markdown begin - require "ruby_parser" + require "sexp" rescue LoadError - warn(%q{Error: Unable to load ruby_parser. Add `gem "ruby_parser"` to your Gemfile.}) + warn(%q{Error: Unable to load sexp. Add `gem "sexp"` to your Gemfile.}) exit(1) end +class RubyParser # :nodoc: + class SyntaxError < RuntimeError # :nodoc: + end +end + module Prism module Translation # This module is the entry-point for converting a prism syntax tree into the From fc150b15882bcc2d2bea3e52f645cceb773bd2e5 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Sun, 14 Dec 2025 11:48:23 -0500 Subject: [PATCH 270/333] Unreference the block node before destroying it --- src/prism.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/prism.c b/src/prism.c index 7059db8f1d..e10c39bb59 100644 --- a/src/prism.c +++ b/src/prism.c @@ -18492,6 +18492,7 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b // yield node. if (arguments.block != NULL) { pm_parser_err_node(parser, arguments.block, PM_ERR_UNEXPECTED_BLOCK_ARGUMENT); + pm_node_unreference(parser, arguments.block); pm_node_destroy(parser, arguments.block); arguments.block = NULL; } From 65595d6c2c70d15aac9ee67b8d7da16f60bd5248 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Sun, 14 Dec 2025 11:59:05 -0500 Subject: [PATCH 271/333] Only set location end when it is larger --- src/prism.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/prism.c b/src/prism.c index 7059db8f1d..2e6f018c2d 100644 --- a/src/prism.c +++ b/src/prism.c @@ -2075,7 +2075,10 @@ pm_arguments_node_arguments_append(pm_arguments_node_t *node, pm_node_t *argumen node->base.location.start = argument->location.start; } - node->base.location.end = argument->location.end; + if (node->base.location.end < argument->location.end) { + node->base.location.end = argument->location.end; + } + pm_node_list_append(&node->arguments, argument); if (PM_NODE_TYPE_P(argument, PM_SPLAT_NODE)) { From b8a00a5f15841fa45431312939f2b1a3d57fb20e Mon Sep 17 00:00:00 2001 From: Earlopain <14981592+Earlopain@users.noreply.github.com> Date: Sun, 14 Dec 2025 18:26:42 +0100 Subject: [PATCH 272/333] Fix `sexp_processor` gem reference It's https://rubygems.org/gems/sexp_processor, not https://rubygems.org/gems/sexp --- lib/prism/translation/ruby_parser.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/prism/translation/ruby_parser.rb b/lib/prism/translation/ruby_parser.rb index a33ea2306c..1fb0e27846 100644 --- a/lib/prism/translation/ruby_parser.rb +++ b/lib/prism/translation/ruby_parser.rb @@ -4,7 +4,7 @@ begin require "sexp" rescue LoadError - warn(%q{Error: Unable to load sexp. Add `gem "sexp"` to your Gemfile.}) + warn(%q{Error: Unable to load sexp. Add `gem "sexp_processor"` to your Gemfile.}) exit(1) end From 793a7a6a0a517b4230c7fd6e795c0332d2fb5d9e Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Sun, 14 Dec 2025 20:39:10 -0500 Subject: [PATCH 273/333] Escape error location is incorrect for some regex When you have a regular expression that has a named capture that has an escape sequence in the named capture, and that escape sequence is a unicode escape sequence with an invalid surrogate pair, the error was attached to the owned string as opposed to a location on the shared source. --- src/prism.c | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/src/prism.c b/src/prism.c index 677e65056f..06e692c95e 100644 --- a/src/prism.c +++ b/src/prism.c @@ -8613,7 +8613,7 @@ escape_hexadecimal_digit(const uint8_t value) { * validated. */ static inline uint32_t -escape_unicode(pm_parser_t *parser, const uint8_t *string, size_t length) { +escape_unicode(pm_parser_t *parser, const uint8_t *string, size_t length, const pm_location_t *error_location) { uint32_t value = 0; for (size_t index = 0; index < length; index++) { if (index != 0) value <<= 4; @@ -8623,7 +8623,11 @@ escape_unicode(pm_parser_t *parser, const uint8_t *string, size_t length) { // Here we're going to verify that the value is actually a valid Unicode // codepoint and not a surrogate pair. if (value >= 0xD800 && value <= 0xDFFF) { - pm_parser_err(parser, string, string + length, PM_ERR_ESCAPE_INVALID_UNICODE); + if (error_location != NULL) { + pm_parser_err(parser, error_location->start, error_location->end, PM_ERR_ESCAPE_INVALID_UNICODE); + } else { + pm_parser_err(parser, string, string + length, PM_ERR_ESCAPE_INVALID_UNICODE); + } return 0xFFFD; } @@ -8923,7 +8927,7 @@ escape_read(pm_parser_t *parser, pm_buffer_t *buffer, pm_buffer_t *regular_expre extra_codepoints_start = unicode_start; } - uint32_t value = escape_unicode(parser, unicode_start, hexadecimal_length); + uint32_t value = escape_unicode(parser, unicode_start, hexadecimal_length, NULL); escape_write_unicode(parser, buffer, flags, unicode_start, parser->current.end, value); parser->current.end += pm_strspn_inline_whitespace(parser->current.end, parser->end - parser->current.end); @@ -8964,7 +8968,7 @@ escape_read(pm_parser_t *parser, pm_buffer_t *buffer, pm_buffer_t *regular_expre PM_PARSER_ERR_FORMAT(parser, start, parser->current.end, PM_ERR_ESCAPE_INVALID_UNICODE_SHORT, 2, start); } } else if (length == 4) { - uint32_t value = escape_unicode(parser, parser->current.end, 4); + uint32_t value = escape_unicode(parser, parser->current.end, 4, NULL); if (flags & PM_ESCAPE_FLAG_REGEXP) { pm_buffer_append_bytes(regular_expression_buffer, start, (size_t) (parser->current.end + 4 - start)); @@ -20368,7 +20372,7 @@ pm_named_capture_escape_octal(pm_buffer_t *unescaped, const uint8_t *cursor, con } static inline const uint8_t * -pm_named_capture_escape_unicode(pm_parser_t *parser, pm_buffer_t *unescaped, const uint8_t *cursor, const uint8_t *end) { +pm_named_capture_escape_unicode(pm_parser_t *parser, pm_buffer_t *unescaped, const uint8_t *cursor, const uint8_t *end, const pm_location_t *error_location) { const uint8_t *start = cursor - 1; cursor++; @@ -20379,7 +20383,7 @@ pm_named_capture_escape_unicode(pm_parser_t *parser, pm_buffer_t *unescaped, con if (*cursor != '{') { size_t length = pm_strspn_hexadecimal_digit(cursor, MIN(end - cursor, 4)); - uint32_t value = escape_unicode(parser, cursor, length); + uint32_t value = escape_unicode(parser, cursor, length, error_location); if (!pm_buffer_append_unicode_codepoint(unescaped, value)) { pm_buffer_append_string(unescaped, (const char *) start, (size_t) ((cursor + length) - start)); @@ -20402,7 +20406,7 @@ pm_named_capture_escape_unicode(pm_parser_t *parser, pm_buffer_t *unescaped, con if (length == 0) { break; } - uint32_t value = escape_unicode(parser, cursor, length); + uint32_t value = escape_unicode(parser, cursor, length, error_location); (void) pm_buffer_append_unicode_codepoint(unescaped, value); cursor += length; @@ -20412,7 +20416,7 @@ pm_named_capture_escape_unicode(pm_parser_t *parser, pm_buffer_t *unescaped, con } static void -pm_named_capture_escape(pm_parser_t *parser, pm_buffer_t *unescaped, const uint8_t *source, const size_t length, const uint8_t *cursor) { +pm_named_capture_escape(pm_parser_t *parser, pm_buffer_t *unescaped, const uint8_t *source, const size_t length, const uint8_t *cursor, const pm_location_t *error_location) { const uint8_t *end = source + length; pm_buffer_append_string(unescaped, (const char *) source, (size_t) (cursor - source)); @@ -20430,7 +20434,7 @@ pm_named_capture_escape(pm_parser_t *parser, pm_buffer_t *unescaped, const uint8 cursor = pm_named_capture_escape_octal(unescaped, cursor, end); break; case 'u': - cursor = pm_named_capture_escape_unicode(parser, unescaped, cursor, end); + cursor = pm_named_capture_escape_unicode(parser, unescaped, cursor, end, error_location); break; default: pm_buffer_append_byte(unescaped, '\\'); @@ -20473,7 +20477,7 @@ parse_regular_expression_named_capture(const pm_string_t *capture, void *data) { // unescaped, which is what we need. const uint8_t *cursor = pm_memchr(source, '\\', length, parser->encoding_changed, parser->encoding); if (PRISM_UNLIKELY(cursor != NULL)) { - pm_named_capture_escape(parser, &unescaped, source, length, cursor); + pm_named_capture_escape(parser, &unescaped, source, length, cursor, callback_data->shared ? NULL : &call->receiver->location); source = (const uint8_t *) pm_buffer_value(&unescaped); length = pm_buffer_length(&unescaped); } From 609c80c91e146d9ac8f70deedfadca729e8a3e4f Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Mon, 15 Dec 2025 08:43:17 -0500 Subject: [PATCH 274/333] Unreference before destroying in call node in pattern --- src/prism.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/prism.c b/src/prism.c index 06e692c95e..f98032cd73 100644 --- a/src/prism.c +++ b/src/prism.c @@ -16690,6 +16690,8 @@ parse_pattern_primitive(pm_parser_t *parser, pm_constant_id_list_t *captures, pm if (PM_NODE_TYPE(node) == PM_CALL_NODE) { pm_parser_err_node(parser, node, diag_id); pm_missing_node_t *missing_node = pm_missing_node_create(parser, node->location.start, node->location.end); + + pm_node_unreference(parser, node); pm_node_destroy(parser, node); return UP(missing_node); } From 17ef702e215aaeb04d1cd40ed03cafacf21081a9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 15 Dec 2025 16:08:24 +0000 Subject: [PATCH 275/333] Bump the java-deps group in /java-wasm with 3 updates Bumps the java-deps group in /java-wasm with 3 updates: [com.dylibso.chicory:bom](https://github.com/dylibso/chicory), com.dylibso.chicory:annotations-processor and [com.dylibso.chicory:chicory-compiler-maven-plugin](https://github.com/dylibso/chicory). Updates `com.dylibso.chicory:bom` from 1.6.0 to 1.6.1 - [Release notes](https://github.com/dylibso/chicory/releases) - [Commits](https://github.com/dylibso/chicory/compare/1.6.0...1.6.1) Updates `com.dylibso.chicory:annotations-processor` from 1.6.0 to 1.6.1 Updates `com.dylibso.chicory:chicory-compiler-maven-plugin` from 1.6.0 to 1.6.1 - [Release notes](https://github.com/dylibso/chicory/releases) - [Commits](https://github.com/dylibso/chicory/compare/1.6.0...1.6.1) Updates `com.dylibso.chicory:annotations-processor` from 1.6.0 to 1.6.1 Updates `com.dylibso.chicory:chicory-compiler-maven-plugin` from 1.6.0 to 1.6.1 - [Release notes](https://github.com/dylibso/chicory/releases) - [Commits](https://github.com/dylibso/chicory/compare/1.6.0...1.6.1) --- updated-dependencies: - dependency-name: com.dylibso.chicory:bom dependency-version: 1.6.1 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: java-deps - dependency-name: com.dylibso.chicory:annotations-processor dependency-version: 1.6.1 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: java-deps - dependency-name: com.dylibso.chicory:chicory-compiler-maven-plugin dependency-version: 1.6.1 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: java-deps - dependency-name: com.dylibso.chicory:annotations-processor dependency-version: 1.6.1 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: java-deps - dependency-name: com.dylibso.chicory:chicory-compiler-maven-plugin dependency-version: 1.6.1 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: java-deps ... Signed-off-by: dependabot[bot] --- java-wasm/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java-wasm/pom.xml b/java-wasm/pom.xml index 2fb549844c..0d0a301dda 100644 --- a/java-wasm/pom.xml +++ b/java-wasm/pom.xml @@ -15,7 +15,7 @@ 11 11 - 1.6.0 + 1.6.1 6.0.1 From af8e11a5c15a76e2636ef23cb3f09725f3bbc4a7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 15 Dec 2025 16:09:37 +0000 Subject: [PATCH 276/333] Bump the action-deps group with 3 updates Bumps the action-deps group with 3 updates: [actions/upload-artifact](https://github.com/actions/upload-artifact), [actions/download-artifact](https://github.com/actions/download-artifact) and [actions/cache](https://github.com/actions/cache). Updates `actions/upload-artifact` from 5 to 6 - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](https://github.com/actions/upload-artifact/compare/v5...v6) Updates `actions/download-artifact` from 6 to 7 - [Release notes](https://github.com/actions/download-artifact/releases) - [Commits](https://github.com/actions/download-artifact/compare/v6...v7) Updates `actions/cache` from 4 to 5 - [Release notes](https://github.com/actions/cache/releases) - [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md) - [Commits](https://github.com/actions/cache/compare/v4...v5) --- updated-dependencies: - dependency-name: actions/upload-artifact dependency-version: '6' dependency-type: direct:production update-type: version-update:semver-major dependency-group: action-deps - dependency-name: actions/download-artifact dependency-version: '7' dependency-type: direct:production update-type: version-update:semver-major dependency-group: action-deps - dependency-name: actions/cache dependency-version: '5' dependency-type: direct:production update-type: version-update:semver-major dependency-group: action-deps ... Signed-off-by: dependabot[bot] --- .github/workflows/java-wasm-bindings.yml | 2 +- .github/workflows/javascript-bindings.yml | 2 +- .github/workflows/main.yml | 4 ++-- .github/workflows/rust-bindings.yml | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/java-wasm-bindings.yml b/.github/workflows/java-wasm-bindings.yml index 0e87046ae8..3a0a066334 100644 --- a/.github/workflows/java-wasm-bindings.yml +++ b/.github/workflows/java-wasm-bindings.yml @@ -45,7 +45,7 @@ jobs: run: mvn -B install working-directory: java-wasm - - uses: actions/upload-artifact@v5 + - uses: actions/upload-artifact@v6 with: name: prism.wasm path: java-wasm/src/test/resources/prism.wasm diff --git a/.github/workflows/javascript-bindings.yml b/.github/workflows/javascript-bindings.yml index 3b1ebe3d9b..6e7d51f282 100644 --- a/.github/workflows/javascript-bindings.yml +++ b/.github/workflows/javascript-bindings.yml @@ -34,7 +34,7 @@ jobs: - name: Build the project run: make wasm WASI_SDK_PATH=$(pwd)/wasi-sdk-25.0-x86_64-linux - - uses: actions/upload-artifact@v5 + - uses: actions/upload-artifact@v6 with: name: prism.wasm path: javascript/src/prism.wasm diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 624325d13a..2035b05b93 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -257,7 +257,7 @@ jobs: bundler-cache: true - run: bundle config --local frozen false - run: bundle exec rake build:dev - - uses: actions/upload-artifact@v5 + - uses: actions/upload-artifact@v6 with: name: gem-package path: pkg @@ -305,7 +305,7 @@ jobs: - uses: ruby/setup-ruby@v1 with: ruby-version: ${{ matrix.target.ruby }} - - uses: actions/download-artifact@v6 + - uses: actions/download-artifact@v7 with: name: gem-package path: pkg diff --git a/.github/workflows/rust-bindings.yml b/.github/workflows/rust-bindings.yml index 2a8a8b5024..359c459992 100644 --- a/.github/workflows/rust-bindings.yml +++ b/.github/workflows/rust-bindings.yml @@ -35,7 +35,7 @@ jobs: with: toolchain: stable targets: wasm32-wasip1 - - uses: actions/cache@v4 + - uses: actions/cache@v5 with: path: | ~/.cargo/registry @@ -66,7 +66,7 @@ jobs: with: toolchain: stable components: clippy, rustfmt - - uses: actions/cache@v4 + - uses: actions/cache@v5 with: path: | ~/.cargo/registry From 8f49ce3368893c9984ab644c379d8f693111447e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 15 Dec 2025 16:37:41 +0000 Subject: [PATCH 277/333] Bump the ruby-deps group across 10 directories with 2 updates Bumps the ruby-deps group with 1 update in the /gemfiles/2.7 directory: [rake-compiler](https://github.com/rake-compiler/rake-compiler). Bumps the ruby-deps group with 1 update in the /gemfiles/3.0 directory: [rake-compiler](https://github.com/rake-compiler/rake-compiler). Bumps the ruby-deps group with 1 update in the /gemfiles/3.1 directory: [rake-compiler](https://github.com/rake-compiler/rake-compiler). Bumps the ruby-deps group with 1 update in the /gemfiles/3.2 directory: [rake-compiler](https://github.com/rake-compiler/rake-compiler). Bumps the ruby-deps group with 1 update in the /gemfiles/3.3 directory: [rake-compiler](https://github.com/rake-compiler/rake-compiler). Bumps the ruby-deps group with 1 update in the /gemfiles/3.4 directory: [rake-compiler](https://github.com/rake-compiler/rake-compiler). Bumps the ruby-deps group with 1 update in the /gemfiles/4.0 directory: [rake-compiler](https://github.com/rake-compiler/rake-compiler). Bumps the ruby-deps group with 1 update in the /gemfiles/jruby directory: [rake-compiler](https://github.com/rake-compiler/rake-compiler). Bumps the ruby-deps group with 1 update in the /gemfiles/truffleruby directory: [rake-compiler](https://github.com/rake-compiler/rake-compiler). Bumps the ruby-deps group with 2 updates in the /gemfiles/typecheck directory: [rake-compiler](https://github.com/rake-compiler/rake-compiler) and [minitest](https://github.com/minitest/minitest). Updates `rake-compiler` from 1.3.0 to 1.3.1 - [Release notes](https://github.com/rake-compiler/rake-compiler/releases) - [Changelog](https://github.com/rake-compiler/rake-compiler/blob/master/History.md) - [Commits](https://github.com/rake-compiler/rake-compiler/compare/v1.3.0...v1.3.1) Updates `rake-compiler` from 1.3.0 to 1.3.1 - [Release notes](https://github.com/rake-compiler/rake-compiler/releases) - [Changelog](https://github.com/rake-compiler/rake-compiler/blob/master/History.md) - [Commits](https://github.com/rake-compiler/rake-compiler/compare/v1.3.0...v1.3.1) Updates `rake-compiler` from 1.3.0 to 1.3.1 - [Release notes](https://github.com/rake-compiler/rake-compiler/releases) - [Changelog](https://github.com/rake-compiler/rake-compiler/blob/master/History.md) - [Commits](https://github.com/rake-compiler/rake-compiler/compare/v1.3.0...v1.3.1) Updates `rake-compiler` from 1.3.0 to 1.3.1 - [Release notes](https://github.com/rake-compiler/rake-compiler/releases) - [Changelog](https://github.com/rake-compiler/rake-compiler/blob/master/History.md) - [Commits](https://github.com/rake-compiler/rake-compiler/compare/v1.3.0...v1.3.1) Updates `rake-compiler` from 1.3.0 to 1.3.1 - [Release notes](https://github.com/rake-compiler/rake-compiler/releases) - [Changelog](https://github.com/rake-compiler/rake-compiler/blob/master/History.md) - [Commits](https://github.com/rake-compiler/rake-compiler/compare/v1.3.0...v1.3.1) Updates `rake-compiler` from 1.3.0 to 1.3.1 - [Release notes](https://github.com/rake-compiler/rake-compiler/releases) - [Changelog](https://github.com/rake-compiler/rake-compiler/blob/master/History.md) - [Commits](https://github.com/rake-compiler/rake-compiler/compare/v1.3.0...v1.3.1) Updates `rake-compiler` from 1.3.0 to 1.3.1 - [Release notes](https://github.com/rake-compiler/rake-compiler/releases) - [Changelog](https://github.com/rake-compiler/rake-compiler/blob/master/History.md) - [Commits](https://github.com/rake-compiler/rake-compiler/compare/v1.3.0...v1.3.1) Updates `rake-compiler` from 1.3.0 to 1.3.1 - [Release notes](https://github.com/rake-compiler/rake-compiler/releases) - [Changelog](https://github.com/rake-compiler/rake-compiler/blob/master/History.md) - [Commits](https://github.com/rake-compiler/rake-compiler/compare/v1.3.0...v1.3.1) Updates `rake-compiler` from 1.3.0 to 1.3.1 - [Release notes](https://github.com/rake-compiler/rake-compiler/releases) - [Changelog](https://github.com/rake-compiler/rake-compiler/blob/master/History.md) - [Commits](https://github.com/rake-compiler/rake-compiler/compare/v1.3.0...v1.3.1) Updates `rake-compiler` from 1.3.0 to 1.3.1 - [Release notes](https://github.com/rake-compiler/rake-compiler/releases) - [Changelog](https://github.com/rake-compiler/rake-compiler/blob/master/History.md) - [Commits](https://github.com/rake-compiler/rake-compiler/compare/v1.3.0...v1.3.1) Updates `minitest` from 5.26.2 to 5.27.0 - [Changelog](https://github.com/minitest/minitest/blob/master/History.rdoc) - [Commits](https://github.com/minitest/minitest/compare/v5.26.2...v5.27.0) --- updated-dependencies: - dependency-name: rake-compiler dependency-version: 1.3.1 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps - dependency-name: rake-compiler dependency-version: 1.3.1 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps - dependency-name: rake-compiler dependency-version: 1.3.1 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps - dependency-name: rake-compiler dependency-version: 1.3.1 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps - dependency-name: rake-compiler dependency-version: 1.3.1 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps - dependency-name: rake-compiler dependency-version: 1.3.1 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps - dependency-name: rake-compiler dependency-version: 1.3.1 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps - dependency-name: rake-compiler dependency-version: 1.3.1 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps - dependency-name: rake-compiler dependency-version: 1.3.1 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps - dependency-name: rake-compiler dependency-version: 1.3.1 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps - dependency-name: minitest dependency-version: 5.27.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps ... Signed-off-by: dependabot[bot] --- 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/4.0/Gemfile.lock | 2 +- gemfiles/jruby/Gemfile.lock | 2 +- gemfiles/truffleruby/Gemfile.lock | 2 +- gemfiles/typecheck/Gemfile.lock | 4 ++-- 10 files changed, 11 insertions(+), 11 deletions(-) diff --git a/gemfiles/2.7/Gemfile.lock b/gemfiles/2.7/Gemfile.lock index 57e505ddbc..d8f93319ac 100644 --- a/gemfiles/2.7/Gemfile.lock +++ b/gemfiles/2.7/Gemfile.lock @@ -14,7 +14,7 @@ GEM power_assert (3.0.1) racc (1.8.1) rake (13.3.1) - rake-compiler (1.3.0) + rake-compiler (1.3.1) rake rbs (3.1.3) ruby_parser (3.21.1) diff --git a/gemfiles/3.0/Gemfile.lock b/gemfiles/3.0/Gemfile.lock index ea9fcfb4d5..bb2299a4d6 100644 --- a/gemfiles/3.0/Gemfile.lock +++ b/gemfiles/3.0/Gemfile.lock @@ -19,7 +19,7 @@ GEM power_assert (3.0.1) racc (1.8.1) rake (13.3.1) - rake-compiler (1.3.0) + rake-compiler (1.3.1) rake rbs (3.6.1) logger diff --git a/gemfiles/3.1/Gemfile.lock b/gemfiles/3.1/Gemfile.lock index f7f72a170f..45495af109 100644 --- a/gemfiles/3.1/Gemfile.lock +++ b/gemfiles/3.1/Gemfile.lock @@ -19,7 +19,7 @@ GEM power_assert (3.0.1) racc (1.8.1) rake (13.3.1) - rake-compiler (1.3.0) + rake-compiler (1.3.1) rake rbs (3.9.5) logger diff --git a/gemfiles/3.2/Gemfile.lock b/gemfiles/3.2/Gemfile.lock index 1118d93a6e..8689b73b57 100644 --- a/gemfiles/3.2/Gemfile.lock +++ b/gemfiles/3.2/Gemfile.lock @@ -19,7 +19,7 @@ GEM power_assert (3.0.1) racc (1.8.1) rake (13.3.1) - rake-compiler (1.3.0) + rake-compiler (1.3.1) rake rbs (3.9.5) logger diff --git a/gemfiles/3.3/Gemfile.lock b/gemfiles/3.3/Gemfile.lock index 99a98aa221..48b6178d67 100644 --- a/gemfiles/3.3/Gemfile.lock +++ b/gemfiles/3.3/Gemfile.lock @@ -19,7 +19,7 @@ GEM power_assert (3.0.1) racc (1.8.1) rake (13.3.1) - rake-compiler (1.3.0) + rake-compiler (1.3.1) rake rbs (3.9.5) logger diff --git a/gemfiles/3.4/Gemfile.lock b/gemfiles/3.4/Gemfile.lock index 7dbe76ba47..fa863216b5 100644 --- a/gemfiles/3.4/Gemfile.lock +++ b/gemfiles/3.4/Gemfile.lock @@ -19,7 +19,7 @@ GEM power_assert (3.0.1) racc (1.8.1) rake (13.3.1) - rake-compiler (1.3.0) + rake-compiler (1.3.1) rake rbs (3.9.5) logger diff --git a/gemfiles/4.0/Gemfile.lock b/gemfiles/4.0/Gemfile.lock index 3526e754c9..e927400416 100644 --- a/gemfiles/4.0/Gemfile.lock +++ b/gemfiles/4.0/Gemfile.lock @@ -20,7 +20,7 @@ GEM power_assert (3.0.1) racc (1.8.1) rake (13.3.1) - rake-compiler (1.3.0) + rake-compiler (1.3.1) rake rbs (3.9.5) logger diff --git a/gemfiles/jruby/Gemfile.lock b/gemfiles/jruby/Gemfile.lock index 3792cc697a..574af0754d 100644 --- a/gemfiles/jruby/Gemfile.lock +++ b/gemfiles/jruby/Gemfile.lock @@ -14,7 +14,7 @@ GEM racc (1.8.1) racc (1.8.1-java) rake (13.3.1) - rake-compiler (1.3.0) + rake-compiler (1.3.1) rake ruby_parser (3.21.1) racc (~> 1.5) diff --git a/gemfiles/truffleruby/Gemfile.lock b/gemfiles/truffleruby/Gemfile.lock index 5439692eae..f6d64b41fc 100644 --- a/gemfiles/truffleruby/Gemfile.lock +++ b/gemfiles/truffleruby/Gemfile.lock @@ -13,7 +13,7 @@ GEM power_assert (3.0.1) racc (1.8.1) rake (13.3.1) - rake-compiler (1.3.0) + rake-compiler (1.3.1) rake ruby_parser (3.21.1) racc (~> 1.5) diff --git a/gemfiles/typecheck/Gemfile.lock b/gemfiles/typecheck/Gemfile.lock index 6180c3f742..4783a1e079 100644 --- a/gemfiles/typecheck/Gemfile.lock +++ b/gemfiles/typecheck/Gemfile.lock @@ -34,7 +34,7 @@ GEM rb-fsevent (~> 0.10, >= 0.10.3) rb-inotify (~> 0.9, >= 0.9.10) logger (1.7.0) - minitest (5.26.2) + minitest (5.27.0) mutex_m (0.3.0) netrc (0.11.0) parallel (1.27.0) @@ -46,7 +46,7 @@ GEM racc (1.8.1) rainbow (3.1.1) rake (13.3.1) - rake-compiler (1.3.0) + rake-compiler (1.3.1) rake rb-fsevent (0.11.2) rb-inotify (0.11.1) From e3df994d47d1fc4fd9bd7cec3dcb03479557f85e Mon Sep 17 00:00:00 2001 From: Benoit Daloze Date: Tue, 16 Dec 2025 15:39:00 +0100 Subject: [PATCH 278/333] Fix assertions in location_test.rb * assert_raise's 2nd argument is the failure message, shown when the expected exception is not raised. It's not the expected message. See https://github.com/test-unit/test-unit/issues/347 --- test/prism/ruby/location_test.rb | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/test/prism/ruby/location_test.rb b/test/prism/ruby/location_test.rb index 33f844243c..5e2ab63802 100644 --- a/test/prism/ruby/location_test.rb +++ b/test/prism/ruby/location_test.rb @@ -13,19 +13,22 @@ def test_join assert_equal 0, joined.start_offset assert_equal 10, joined.length - assert_raise(RuntimeError, "Incompatible locations") do + e = assert_raise(RuntimeError) do argument.location.join(receiver.location) end + assert_equal "Incompatible locations", e.message other_argument = Prism.parse_statement("1234 + 567").arguments.arguments.first - assert_raise(RuntimeError, "Incompatible sources") do + e = assert_raise(RuntimeError) do other_argument.location.join(receiver.location) end + assert_equal "Incompatible sources", e.message - assert_raise(RuntimeError, "Incompatible sources") do + e = assert_raise(RuntimeError) do receiver.location.join(other_argument.location) end + assert_equal "Incompatible sources", e.message end def test_character_offsets From 138db9ccc4793b20cf7617349b462fe29236e332 Mon Sep 17 00:00:00 2001 From: Earlopain <14981592+Earlopain@users.noreply.github.com> Date: Wed, 17 Dec 2025 10:47:43 +0100 Subject: [PATCH 279/333] Add Ruby 4.1 as a version specifier --- include/prism/options.h | 5 ++++- java/org/prism/ParsingOptions.java | 3 ++- javascript/src/parsePrism.js | 2 ++ lib/prism/ffi.rb | 2 ++ lib/prism/translation.rb | 1 + lib/prism/translation/parser.rb | 4 +++- lib/prism/translation/parser41.rb | 13 +++++++++++++ lib/prism/translation/parser_current.rb | 2 ++ prism.gemspec | 2 ++ rbi/prism/translation/parser41.rbi | 6 ++++++ src/options.c | 10 ++++++++++ test/prism/api/parse_test.rb | 3 +++ test/prism/test_helper.rb | 2 +- 13 files changed, 51 insertions(+), 4 deletions(-) create mode 100644 lib/prism/translation/parser41.rb create mode 100644 rbi/prism/translation/parser41.rbi diff --git a/include/prism/options.h b/include/prism/options.h index a663c9767e..c00c7bf755 100644 --- a/include/prism/options.h +++ b/include/prism/options.h @@ -97,8 +97,11 @@ typedef enum { /** The vendored version of prism in CRuby 4.0.x. */ PM_OPTIONS_VERSION_CRUBY_4_0 = 3, + /** The vendored version of prism in CRuby 4.1.x. */ + PM_OPTIONS_VERSION_CRUBY_4_1 = 4, + /** The current version of prism. */ - PM_OPTIONS_VERSION_LATEST = PM_OPTIONS_VERSION_CRUBY_4_0 + PM_OPTIONS_VERSION_LATEST = PM_OPTIONS_VERSION_CRUBY_4_1 } pm_options_version_t; /** diff --git a/java/org/prism/ParsingOptions.java b/java/org/prism/ParsingOptions.java index 6f7a342818..be0a8a7dba 100644 --- a/java/org/prism/ParsingOptions.java +++ b/java/org/prism/ParsingOptions.java @@ -16,7 +16,8 @@ public enum SyntaxVersion { V3_3(1), V3_4(2), V3_5(3), - V4_0(3); + V4_0(3), + V4_1(4); private final int value; diff --git a/javascript/src/parsePrism.js b/javascript/src/parsePrism.js index a2f0370993..38084da3f1 100644 --- a/javascript/src/parsePrism.js +++ b/javascript/src/parsePrism.js @@ -148,6 +148,8 @@ function dumpOptions(options) { values.push(2); } else if (options.version.match(/^3\.5(\.\d+)?$/) || options.version.match(/^4\.0(\.\d+)?$/)) { values.push(3); + } else if (options.version.match(/^4\.1(\.\d+)?$/)) { + values.push(4); } else { throw new Error(`Unsupported version '${options.version}' in compiler options`); } diff --git a/lib/prism/ffi.rb b/lib/prism/ffi.rb index 7e6103fde7..d4c9d60c9a 100644 --- a/lib/prism/ffi.rb +++ b/lib/prism/ffi.rb @@ -434,6 +434,8 @@ def dump_options_version(version) 2 when /\A3\.5(\.\d+)?\z/, /\A4\.0(\.\d+)?\z/ 3 + when /\A4\.1(\.\d+)?\z/ + 4 else if current raise CurrentVersionError, RUBY_VERSION diff --git a/lib/prism/translation.rb b/lib/prism/translation.rb index 7933b4a722..89c70ee420 100644 --- a/lib/prism/translation.rb +++ b/lib/prism/translation.rb @@ -11,6 +11,7 @@ module Translation # steep:ignore autoload :Parser34, "prism/translation/parser34" autoload :Parser35, "prism/translation/parser35" autoload :Parser40, "prism/translation/parser40" + autoload :Parser41, "prism/translation/parser41" autoload :Ripper, "prism/translation/ripper" autoload :RubyParser, "prism/translation/ruby_parser" end diff --git a/lib/prism/translation/parser.rb b/lib/prism/translation/parser.rb index 23245dc383..fed4ac4cd1 100644 --- a/lib/prism/translation/parser.rb +++ b/lib/prism/translation/parser.rb @@ -84,7 +84,7 @@ def initialize(builder = Prism::Translation::Parser::Builder.new, parser: Prism) end def version # :nodoc: - 40 + 41 end # The default encoding for Ruby files is UTF-8. @@ -358,6 +358,8 @@ def convert_for_prism(version) "3.4.0" when 35, 40 "4.0.0" + when 41 + "4.1.0" else "latest" end diff --git a/lib/prism/translation/parser41.rb b/lib/prism/translation/parser41.rb new file mode 100644 index 0000000000..ed81906400 --- /dev/null +++ b/lib/prism/translation/parser41.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true +# :markup: markdown + +module Prism + module Translation + # This class is the entry-point for Ruby 4.1 of `Prism::Translation::Parser`. + class Parser41 < Parser + def version # :nodoc: + 41 + end + end + end +end diff --git a/lib/prism/translation/parser_current.rb b/lib/prism/translation/parser_current.rb index 76d71e9409..ac6daf7082 100644 --- a/lib/prism/translation/parser_current.rb +++ b/lib/prism/translation/parser_current.rb @@ -12,6 +12,8 @@ module Translation ParserCurrent = Parser34 when /^3\.5\./, /^4\.0\./ ParserCurrent = Parser40 + when /^4\.1\./ + ParserCurrent = Parser41 else # Keep this in sync with released Ruby. parser = Parser34 diff --git a/prism.gemspec b/prism.gemspec index 10c2eaad20..d9872f88ac 100644 --- a/prism.gemspec +++ b/prism.gemspec @@ -102,6 +102,7 @@ Gem::Specification.new do |spec| "lib/prism/translation/parser34.rb", "lib/prism/translation/parser35.rb", "lib/prism/translation/parser40.rb", + "lib/prism/translation/parser41.rb", "lib/prism/translation/parser/builder.rb", "lib/prism/translation/parser/compiler.rb", "lib/prism/translation/parser/lexer.rb", @@ -125,6 +126,7 @@ Gem::Specification.new do |spec| "rbi/prism/translation/parser34.rbi", "rbi/prism/translation/parser35.rbi", "rbi/prism/translation/parser40.rbi", + "rbi/prism/translation/parser41.rbi", "rbi/prism/translation/ripper.rbi", "rbi/prism/visitor.rbi", "sig/prism.rbs", diff --git a/rbi/prism/translation/parser41.rbi b/rbi/prism/translation/parser41.rbi new file mode 100644 index 0000000000..218682365b --- /dev/null +++ b/rbi/prism/translation/parser41.rbi @@ -0,0 +1,6 @@ +# typed: strict + +class Prism::Translation::Parser40 < Prism::Translation::Parser + sig { override.returns(Integer) } + def version; end +end diff --git a/src/options.c b/src/options.c index 4a8953da7d..09d2a65a6c 100644 --- a/src/options.c +++ b/src/options.c @@ -93,6 +93,11 @@ pm_options_version_set(pm_options_t *options, const char *version, size_t length return true; } + if (strncmp(version, "4.1", 3) == 0) { + options->version = PM_OPTIONS_VERSION_CRUBY_4_1; + return true; + } + return false; } @@ -111,6 +116,11 @@ pm_options_version_set(pm_options_t *options, const char *version, size_t length options->version = PM_OPTIONS_VERSION_CRUBY_4_0; return true; } + + if (strncmp(version, "4.1.", 4) == 0) { + options->version = PM_OPTIONS_VERSION_CRUBY_4_1; + return true; + } } if (length >= 6) { diff --git a/test/prism/api/parse_test.rb b/test/prism/api/parse_test.rb index bb1761109f..bbf28201ff 100644 --- a/test/prism/api/parse_test.rb +++ b/test/prism/api/parse_test.rb @@ -122,6 +122,9 @@ def test_version assert Prism.parse_success?("1 + 1", version: "4.0") assert Prism.parse_success?("1 + 1", version: "4.0.0") + assert Prism.parse_success?("1 + 1", version: "4.1") + assert Prism.parse_success?("1 + 1", version: "4.1.0") + assert Prism.parse_success?("1 + 1", version: "latest") # Test edge case diff --git a/test/prism/test_helper.rb b/test/prism/test_helper.rb index f78e68e87c..43771110b4 100644 --- a/test/prism/test_helper.rb +++ b/test/prism/test_helper.rb @@ -241,7 +241,7 @@ def self.windows? end # All versions that prism can parse - SYNTAX_VERSIONS = %w[3.3 3.4 4.0] + SYNTAX_VERSIONS = %w[3.3 3.4 4.0 4.1] # `RUBY_VERSION` with the patch version excluded CURRENT_MAJOR_MINOR = RUBY_VERSION.split(".")[0, 2].join(".") From 48b403ea7974927485ae34df6f6900a7660b6b84 Mon Sep 17 00:00:00 2001 From: Earlopain <14981592+Earlopain@users.noreply.github.com> Date: Mon, 1 Dec 2025 21:13:25 +0100 Subject: [PATCH 280/333] Reject `p(p a, &block => value)` and similar Redo of https://github.com/ruby/prism/pull/3669 with more tests --- snapshots/command_method_call_3.txt | 543 ++++++++++++++++++ src/prism.c | 26 +- test/prism/errors/command_calls_35.txt | 46 ++ test/prism/fixtures/command_method_call_3.txt | 19 + 4 files changed, 633 insertions(+), 1 deletion(-) create mode 100644 snapshots/command_method_call_3.txt create mode 100644 test/prism/errors/command_calls_35.txt create mode 100644 test/prism/fixtures/command_method_call_3.txt diff --git a/snapshots/command_method_call_3.txt b/snapshots/command_method_call_3.txt new file mode 100644 index 0000000000..e004f875de --- /dev/null +++ b/snapshots/command_method_call_3.txt @@ -0,0 +1,543 @@ +@ ProgramNode (location: (1,0)-(19,25)) +├── flags: ∅ +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(19,25)) + ├── flags: ∅ + └── body: (length: 10) + ├── @ CallNode (location: (1,0)-(1,22)) + │ ├── flags: newline, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :foo + │ ├── message_loc: (1,0)-(1,3) = "foo" + │ ├── opening_loc: (1,3)-(1,4) = "(" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (1,4)-(1,21)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ CallNode (location: (1,4)-(1,21)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :bar + │ │ ├── message_loc: (1,4)-(1,7) = "bar" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (1,8)-(1,21)) + │ │ │ ├── flags: contains_keywords + │ │ │ └── arguments: (length: 2) + │ │ │ ├── @ IntegerNode (location: (1,8)-(1,9)) + │ │ │ │ ├── flags: static_literal, decimal + │ │ │ │ └── value: 1 + │ │ │ └── @ KeywordHashNode (location: (1,11)-(1,21)) + │ │ │ ├── flags: ∅ + │ │ │ └── elements: (length: 1) + │ │ │ └── @ AssocNode (location: (1,11)-(1,21)) + │ │ │ ├── flags: ∅ + │ │ │ ├── key: + │ │ │ │ @ CallNode (location: (1,11)-(1,14)) + │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :key + │ │ │ │ ├── message_loc: (1,11)-(1,14) = "key" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ ├── value: + │ │ │ │ @ StringNode (location: (1,18)-(1,21)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── opening_loc: (1,18)-(1,19) = "'" + │ │ │ │ ├── content_loc: (1,19)-(1,20) = "2" + │ │ │ │ ├── closing_loc: (1,20)-(1,21) = "'" + │ │ │ │ └── unescaped: "2" + │ │ │ └── operator_loc: (1,15)-(1,17) = "=>" + │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ + │ │ └── block: ∅ + │ ├── closing_loc: (1,21)-(1,22) = ")" + │ ├── equal_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (3,0)-(3,22)) + │ ├── flags: newline, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :foo + │ ├── message_loc: (3,0)-(3,3) = "foo" + │ ├── opening_loc: (3,3)-(3,4) = "(" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (3,4)-(3,21)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ CallNode (location: (3,4)-(3,21)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :bar + │ │ ├── message_loc: (3,4)-(3,7) = "bar" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (3,8)-(3,21)) + │ │ │ ├── flags: contains_keywords + │ │ │ └── arguments: (length: 2) + │ │ │ ├── @ IntegerNode (location: (3,8)-(3,9)) + │ │ │ │ ├── flags: static_literal, decimal + │ │ │ │ └── value: 1 + │ │ │ └── @ KeywordHashNode (location: (3,11)-(3,21)) + │ │ │ ├── flags: ∅ + │ │ │ └── elements: (length: 1) + │ │ │ └── @ AssocNode (location: (3,11)-(3,21)) + │ │ │ ├── flags: ∅ + │ │ │ ├── key: + │ │ │ │ @ ConstantReadNode (location: (3,11)-(3,14)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── name: :KEY + │ │ │ ├── value: + │ │ │ │ @ StringNode (location: (3,18)-(3,21)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── opening_loc: (3,18)-(3,19) = "'" + │ │ │ │ ├── content_loc: (3,19)-(3,20) = "2" + │ │ │ │ ├── closing_loc: (3,20)-(3,21) = "'" + │ │ │ │ └── unescaped: "2" + │ │ │ └── operator_loc: (3,15)-(3,17) = "=>" + │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ + │ │ └── block: ∅ + │ ├── closing_loc: (3,21)-(3,22) = ")" + │ ├── equal_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (5,0)-(5,23)) + │ ├── flags: newline, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :foo + │ ├── message_loc: (5,0)-(5,3) = "foo" + │ ├── opening_loc: (5,3)-(5,4) = "(" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (5,4)-(5,22)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ CallNode (location: (5,4)-(5,22)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :bar + │ │ ├── message_loc: (5,4)-(5,7) = "bar" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (5,8)-(5,22)) + │ │ │ ├── flags: contains_keywords + │ │ │ └── arguments: (length: 2) + │ │ │ ├── @ IntegerNode (location: (5,8)-(5,9)) + │ │ │ │ ├── flags: static_literal, decimal + │ │ │ │ └── value: 1 + │ │ │ └── @ KeywordHashNode (location: (5,11)-(5,22)) + │ │ │ ├── flags: symbol_keys + │ │ │ └── elements: (length: 1) + │ │ │ └── @ AssocNode (location: (5,11)-(5,22)) + │ │ │ ├── flags: ∅ + │ │ │ ├── key: + │ │ │ │ @ SymbolNode (location: (5,11)-(5,15)) + │ │ │ │ ├── flags: static_literal, forced_us_ascii_encoding + │ │ │ │ ├── opening_loc: (5,11)-(5,12) = ":" + │ │ │ │ ├── value_loc: (5,12)-(5,15) = "key" + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ └── unescaped: "key" + │ │ │ ├── value: + │ │ │ │ @ StringNode (location: (5,19)-(5,22)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── opening_loc: (5,19)-(5,20) = "'" + │ │ │ │ ├── content_loc: (5,20)-(5,21) = "2" + │ │ │ │ ├── closing_loc: (5,21)-(5,22) = "'" + │ │ │ │ └── unescaped: "2" + │ │ │ └── operator_loc: (5,16)-(5,18) = "=>" + │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ + │ │ └── block: ∅ + │ ├── closing_loc: (5,22)-(5,23) = ")" + │ ├── equal_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (7,0)-(7,32)) + │ ├── flags: newline, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :foo + │ ├── message_loc: (7,0)-(7,3) = "foo" + │ ├── opening_loc: (7,3)-(7,4) = "(" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (7,4)-(7,31)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ CallNode (location: (7,4)-(7,31)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :bar + │ │ ├── message_loc: (7,4)-(7,7) = "bar" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (7,8)-(7,31)) + │ │ │ ├── flags: contains_keywords + │ │ │ └── arguments: (length: 2) + │ │ │ ├── @ IntegerNode (location: (7,8)-(7,9)) + │ │ │ │ ├── flags: static_literal, decimal + │ │ │ │ └── value: 1 + │ │ │ └── @ KeywordHashNode (location: (7,11)-(7,31)) + │ │ │ ├── flags: ∅ + │ │ │ └── elements: (length: 1) + │ │ │ └── @ AssocNode (location: (7,11)-(7,31)) + │ │ │ ├── flags: ∅ + │ │ │ ├── key: + │ │ │ │ @ HashNode (location: (7,11)-(7,24)) + │ │ │ │ ├── flags: static_literal + │ │ │ │ ├── opening_loc: (7,11)-(7,12) = "{" + │ │ │ │ ├── elements: (length: 1) + │ │ │ │ │ └── @ AssocNode (location: (7,13)-(7,22)) + │ │ │ │ │ ├── flags: static_literal + │ │ │ │ │ ├── key: + │ │ │ │ │ │ @ SymbolNode (location: (7,13)-(7,17)) + │ │ │ │ │ │ ├── flags: static_literal, forced_us_ascii_encoding + │ │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ │ ├── value_loc: (7,13)-(7,16) = "baz" + │ │ │ │ │ │ ├── closing_loc: (7,16)-(7,17) = ":" + │ │ │ │ │ │ └── unescaped: "baz" + │ │ │ │ │ ├── value: + │ │ │ │ │ │ @ SymbolNode (location: (7,18)-(7,22)) + │ │ │ │ │ │ ├── flags: static_literal, forced_us_ascii_encoding + │ │ │ │ │ │ ├── opening_loc: (7,18)-(7,19) = ":" + │ │ │ │ │ │ ├── value_loc: (7,19)-(7,22) = "bat" + │ │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ │ └── unescaped: "bat" + │ │ │ │ │ └── operator_loc: ∅ + │ │ │ │ └── closing_loc: (7,23)-(7,24) = "}" + │ │ │ ├── value: + │ │ │ │ @ StringNode (location: (7,28)-(7,31)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── opening_loc: (7,28)-(7,29) = "'" + │ │ │ │ ├── content_loc: (7,29)-(7,30) = "2" + │ │ │ │ ├── closing_loc: (7,30)-(7,31) = "'" + │ │ │ │ └── unescaped: "2" + │ │ │ └── operator_loc: (7,25)-(7,27) = "=>" + │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ + │ │ └── block: ∅ + │ ├── closing_loc: (7,31)-(7,32) = ")" + │ ├── equal_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (9,0)-(9,24)) + │ ├── flags: newline, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :foo + │ ├── message_loc: (9,0)-(9,3) = "foo" + │ ├── opening_loc: ∅ + │ ├── arguments: + │ │ @ ArgumentsNode (location: (9,4)-(9,24)) + │ │ ├── flags: contains_keywords + │ │ └── arguments: (length: 1) + │ │ └── @ KeywordHashNode (location: (9,4)-(9,24)) + │ │ ├── flags: ∅ + │ │ └── elements: (length: 1) + │ │ └── @ AssocNode (location: (9,4)-(9,24)) + │ │ ├── flags: ∅ + │ │ ├── key: + │ │ │ @ CallNode (location: (9,4)-(9,17)) + │ │ │ ├── flags: ∅ + │ │ │ ├── receiver: + │ │ │ │ @ CallNode (location: (9,4)-(9,7)) + │ │ │ │ ├── flags: variable_call, ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :bar + │ │ │ │ ├── message_loc: (9,4)-(9,7) = "bar" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ + │ │ │ │ └── block: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :- + │ │ │ ├── message_loc: (9,8)-(9,9) = "-" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: + │ │ │ │ @ ArgumentsNode (location: (9,10)-(9,17)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ └── arguments: (length: 1) + │ │ │ │ └── @ ArrayNode (location: (9,10)-(9,17)) + │ │ │ │ ├── flags: static_literal + │ │ │ │ ├── elements: (length: 1) + │ │ │ │ │ └── @ SymbolNode (location: (9,13)-(9,16)) + │ │ │ │ │ ├── flags: static_literal, forced_us_ascii_encoding + │ │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ │ ├── value_loc: (9,13)-(9,16) = "baz" + │ │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ │ └── unescaped: "baz" + │ │ │ │ ├── opening_loc: (9,10)-(9,13) = "%i[" + │ │ │ │ └── closing_loc: (9,16)-(9,17) = "]" + │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ + │ │ │ └── block: ∅ + │ │ ├── value: + │ │ │ @ StringNode (location: (9,21)-(9,24)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: (9,21)-(9,22) = "'" + │ │ │ ├── content_loc: (9,22)-(9,23) = "2" + │ │ │ ├── closing_loc: (9,23)-(9,24) = "'" + │ │ │ └── unescaped: "2" + │ │ └── operator_loc: (9,18)-(9,20) = "=>" + │ ├── closing_loc: ∅ + │ ├── equal_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (11,0)-(11,18)) + │ ├── flags: newline, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :foo + │ ├── message_loc: (11,0)-(11,3) = "foo" + │ ├── opening_loc: (11,3)-(11,4) = "(" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (11,4)-(11,17)) + │ │ ├── flags: contains_keywords + │ │ └── arguments: (length: 1) + │ │ └── @ KeywordHashNode (location: (11,4)-(11,17)) + │ │ ├── flags: ∅ + │ │ └── elements: (length: 1) + │ │ └── @ AssocNode (location: (11,4)-(11,17)) + │ │ ├── flags: ∅ + │ │ ├── key: + │ │ │ @ CallNode (location: (11,4)-(11,10)) + │ │ │ ├── flags: ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :bar + │ │ │ ├── message_loc: (11,4)-(11,7) = "bar" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ + │ │ │ └── block: + │ │ │ @ BlockNode (location: (11,8)-(11,10)) + │ │ │ ├── flags: ∅ + │ │ │ ├── locals: [] + │ │ │ ├── parameters: ∅ + │ │ │ ├── body: ∅ + │ │ │ ├── opening_loc: (11,8)-(11,9) = "{" + │ │ │ └── closing_loc: (11,9)-(11,10) = "}" + │ │ ├── value: + │ │ │ @ StringNode (location: (11,14)-(11,17)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: (11,14)-(11,15) = "'" + │ │ │ ├── content_loc: (11,15)-(11,16) = "2" + │ │ │ ├── closing_loc: (11,16)-(11,17) = "'" + │ │ │ └── unescaped: "2" + │ │ └── operator_loc: (11,11)-(11,13) = "=>" + │ ├── closing_loc: (11,17)-(11,18) = ")" + │ ├── equal_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (13,0)-(13,22)) + │ ├── flags: newline, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :foo + │ ├── message_loc: (13,0)-(13,3) = "foo" + │ ├── opening_loc: (13,3)-(13,4) = "(" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (13,4)-(13,21)) + │ │ ├── flags: ∅ + │ │ └── arguments: (length: 1) + │ │ └── @ CallNode (location: (13,4)-(13,21)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :bar + │ │ ├── message_loc: (13,4)-(13,7) = "bar" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: + │ │ │ @ ArgumentsNode (location: (13,8)-(13,21)) + │ │ │ ├── flags: contains_keywords + │ │ │ └── arguments: (length: 1) + │ │ │ └── @ KeywordHashNode (location: (13,8)-(13,21)) + │ │ │ ├── flags: ∅ + │ │ │ └── elements: (length: 1) + │ │ │ └── @ AssocNode (location: (13,8)-(13,21)) + │ │ │ ├── flags: ∅ + │ │ │ ├── key: + │ │ │ │ @ CallNode (location: (13,8)-(13,14)) + │ │ │ │ ├── flags: ignore_visibility + │ │ │ │ ├── receiver: ∅ + │ │ │ │ ├── call_operator_loc: ∅ + │ │ │ │ ├── name: :baz + │ │ │ │ ├── message_loc: (13,8)-(13,11) = "baz" + │ │ │ │ ├── opening_loc: ∅ + │ │ │ │ ├── arguments: ∅ + │ │ │ │ ├── closing_loc: ∅ + │ │ │ │ ├── equal_loc: ∅ + │ │ │ │ └── block: + │ │ │ │ @ BlockNode (location: (13,12)-(13,14)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── locals: [] + │ │ │ │ ├── parameters: ∅ + │ │ │ │ ├── body: ∅ + │ │ │ │ ├── opening_loc: (13,12)-(13,13) = "{" + │ │ │ │ └── closing_loc: (13,13)-(13,14) = "}" + │ │ │ ├── value: + │ │ │ │ @ StringNode (location: (13,18)-(13,21)) + │ │ │ │ ├── flags: ∅ + │ │ │ │ ├── opening_loc: (13,18)-(13,19) = "'" + │ │ │ │ ├── content_loc: (13,19)-(13,20) = "2" + │ │ │ │ ├── closing_loc: (13,20)-(13,21) = "'" + │ │ │ │ └── unescaped: "2" + │ │ │ └── operator_loc: (13,15)-(13,17) = "=>" + │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ + │ │ └── block: ∅ + │ ├── closing_loc: (13,21)-(13,22) = ")" + │ ├── equal_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (15,0)-(15,22)) + │ ├── flags: newline, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :foo + │ ├── message_loc: (15,0)-(15,3) = "foo" + │ ├── opening_loc: (15,3)-(15,4) = "(" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (15,4)-(15,21)) + │ │ ├── flags: contains_keywords + │ │ └── arguments: (length: 1) + │ │ └── @ KeywordHashNode (location: (15,4)-(15,21)) + │ │ ├── flags: ∅ + │ │ └── elements: (length: 1) + │ │ └── @ AssocNode (location: (15,4)-(15,21)) + │ │ ├── flags: ∅ + │ │ ├── key: + │ │ │ @ CallNode (location: (15,4)-(15,14)) + │ │ │ ├── flags: ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :bar + │ │ │ ├── message_loc: (15,4)-(15,7) = "bar" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ + │ │ │ └── block: + │ │ │ @ BlockNode (location: (15,8)-(15,14)) + │ │ │ ├── flags: ∅ + │ │ │ ├── locals: [] + │ │ │ ├── parameters: ∅ + │ │ │ ├── body: ∅ + │ │ │ ├── opening_loc: (15,8)-(15,10) = "do" + │ │ │ └── closing_loc: (15,11)-(15,14) = "end" + │ │ ├── value: + │ │ │ @ StringNode (location: (15,18)-(15,21)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: (15,18)-(15,19) = "'" + │ │ │ ├── content_loc: (15,19)-(15,20) = "2" + │ │ │ ├── closing_loc: (15,20)-(15,21) = "'" + │ │ │ └── unescaped: "2" + │ │ └── operator_loc: (15,15)-(15,17) = "=>" + │ ├── closing_loc: (15,21)-(15,22) = ")" + │ ├── equal_loc: ∅ + │ └── block: ∅ + ├── @ CallNode (location: (17,0)-(17,21)) + │ ├── flags: newline, ignore_visibility + │ ├── receiver: ∅ + │ ├── call_operator_loc: ∅ + │ ├── name: :foo + │ ├── message_loc: (17,0)-(17,3) = "foo" + │ ├── opening_loc: (17,3)-(17,4) = "(" + │ ├── arguments: + │ │ @ ArgumentsNode (location: (17,4)-(17,20)) + │ │ ├── flags: contains_keywords + │ │ └── arguments: (length: 2) + │ │ ├── @ IntegerNode (location: (17,4)-(17,5)) + │ │ │ ├── flags: static_literal, decimal + │ │ │ └── value: 1 + │ │ └── @ KeywordHashNode (location: (17,7)-(17,20)) + │ │ ├── flags: ∅ + │ │ └── elements: (length: 1) + │ │ └── @ AssocNode (location: (17,7)-(17,20)) + │ │ ├── flags: ∅ + │ │ ├── key: + │ │ │ @ CallNode (location: (17,7)-(17,13)) + │ │ │ ├── flags: ignore_visibility + │ │ │ ├── receiver: ∅ + │ │ │ ├── call_operator_loc: ∅ + │ │ │ ├── name: :bar + │ │ │ ├── message_loc: (17,7)-(17,10) = "bar" + │ │ │ ├── opening_loc: ∅ + │ │ │ ├── arguments: ∅ + │ │ │ ├── closing_loc: ∅ + │ │ │ ├── equal_loc: ∅ + │ │ │ └── block: + │ │ │ @ BlockNode (location: (17,11)-(17,13)) + │ │ │ ├── flags: ∅ + │ │ │ ├── locals: [] + │ │ │ ├── parameters: ∅ + │ │ │ ├── body: ∅ + │ │ │ ├── opening_loc: (17,11)-(17,12) = "{" + │ │ │ └── closing_loc: (17,12)-(17,13) = "}" + │ │ ├── value: + │ │ │ @ StringNode (location: (17,17)-(17,20)) + │ │ │ ├── flags: ∅ + │ │ │ ├── opening_loc: (17,17)-(17,18) = "'" + │ │ │ ├── content_loc: (17,18)-(17,19) = "2" + │ │ │ ├── closing_loc: (17,19)-(17,20) = "'" + │ │ │ └── unescaped: "2" + │ │ └── operator_loc: (17,14)-(17,16) = "=>" + │ ├── closing_loc: (17,20)-(17,21) = ")" + │ ├── equal_loc: ∅ + │ └── block: ∅ + └── @ CallNode (location: (19,0)-(19,25)) + ├── flags: newline, ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :foo + ├── message_loc: (19,0)-(19,3) = "foo" + ├── opening_loc: (19,3)-(19,4) = "(" + ├── arguments: + │ @ ArgumentsNode (location: (19,4)-(19,24)) + │ ├── flags: contains_keywords + │ └── arguments: (length: 2) + │ ├── @ IntegerNode (location: (19,4)-(19,5)) + │ │ ├── flags: static_literal, decimal + │ │ └── value: 1 + │ └── @ KeywordHashNode (location: (19,7)-(19,24)) + │ ├── flags: ∅ + │ └── elements: (length: 1) + │ └── @ AssocNode (location: (19,7)-(19,24)) + │ ├── flags: ∅ + │ ├── key: + │ │ @ CallNode (location: (19,7)-(19,17)) + │ │ ├── flags: ignore_visibility + │ │ ├── receiver: ∅ + │ │ ├── call_operator_loc: ∅ + │ │ ├── name: :bar + │ │ ├── message_loc: (19,7)-(19,10) = "bar" + │ │ ├── opening_loc: ∅ + │ │ ├── arguments: ∅ + │ │ ├── closing_loc: ∅ + │ │ ├── equal_loc: ∅ + │ │ └── block: + │ │ @ BlockNode (location: (19,11)-(19,17)) + │ │ ├── flags: ∅ + │ │ ├── locals: [] + │ │ ├── parameters: ∅ + │ │ ├── body: ∅ + │ │ ├── opening_loc: (19,11)-(19,13) = "do" + │ │ └── closing_loc: (19,14)-(19,17) = "end" + │ ├── value: + │ │ @ StringNode (location: (19,21)-(19,24)) + │ │ ├── flags: ∅ + │ │ ├── opening_loc: (19,21)-(19,22) = "'" + │ │ ├── content_loc: (19,22)-(19,23) = "2" + │ │ ├── closing_loc: (19,23)-(19,24) = "'" + │ │ └── unescaped: "2" + │ └── operator_loc: (19,18)-(19,20) = "=>" + ├── closing_loc: (19,24)-(19,25) = ")" + ├── equal_loc: ∅ + └── block: ∅ diff --git a/src/prism.c b/src/prism.c index f98032cd73..4c8ab91f0e 100644 --- a/src/prism.c +++ b/src/prism.c @@ -13412,6 +13412,30 @@ parse_assocs(pm_parser_t *parser, pm_static_literals_t *literals, pm_node_t *nod return contains_keyword_splat; } +static inline bool +argument_allowed_for_bare_hash(pm_parser_t *parser, pm_node_t *argument) { + if (pm_symbol_node_label_p(argument)) { + return true; + } + + switch (PM_NODE_TYPE(argument)) { + case PM_CALL_NODE: { + pm_call_node_t *cast = (pm_call_node_t *) argument; + if (cast->opening_loc.start == NULL && cast->arguments != NULL) { + if (PM_NODE_FLAG_P(cast->arguments, PM_ARGUMENTS_NODE_FLAGS_CONTAINS_KEYWORDS | PM_ARGUMENTS_NODE_FLAGS_CONTAINS_SPLAT)) { + return false; + } + if (cast->block != NULL) { + return false; + } + } + break; + } + default: break; + } + return accept1(parser, PM_TOKEN_EQUAL_GREATER); +} + /** * Append an argument to a list of arguments. */ @@ -13569,7 +13593,7 @@ parse_arguments(pm_parser_t *parser, pm_arguments_t *arguments, bool accepts_for bool contains_keywords = false; bool contains_keyword_splat = false; - if (pm_symbol_node_label_p(argument) || accept1(parser, PM_TOKEN_EQUAL_GREATER)) { + if (argument_allowed_for_bare_hash(parser, argument)){ if (parsed_bare_hash) { pm_parser_err_previous(parser, PM_ERR_ARGUMENT_BARE_HASH); } diff --git a/test/prism/errors/command_calls_35.txt b/test/prism/errors/command_calls_35.txt new file mode 100644 index 0000000000..45f569b117 --- /dev/null +++ b/test/prism/errors/command_calls_35.txt @@ -0,0 +1,46 @@ +p(p a, x: b => value) + ^~ unexpected '=>'; expected a `)` to close the arguments + ^ unexpected ')', expecting end-of-input + ^ unexpected ')', ignoring it + +p(p a, x: => value) + ^~ unexpected '=>'; expected a `)` to close the arguments + ^ unexpected ')', expecting end-of-input + ^ unexpected ')', ignoring it + +p(p a, &block => value) + ^~ unexpected '=>'; expected a `)` to close the arguments + ^ unexpected ')', expecting end-of-input + ^ unexpected ')', ignoring it + +p(p a do end => value) + ^~ unexpected '=>'; expected a `)` to close the arguments + ^ unexpected ')', expecting end-of-input + ^ unexpected ')', ignoring it + +p(p a, *args => value) + ^~ unexpected '=>'; expected a `)` to close the arguments + ^ unexpected ')', expecting end-of-input + ^ unexpected ')', ignoring it + +p(p a, **kwargs => value) + ^~ unexpected '=>'; expected a `)` to close the arguments + ^ unexpected ')', expecting end-of-input + ^ unexpected ')', ignoring it + +p p 1, &block => 2, &block + ^~ unexpected '=>', expecting end-of-input + ^~ unexpected '=>', ignoring it + ^ unexpected ',', expecting end-of-input + ^ unexpected ',', ignoring it + ^ unexpected '&', ignoring it + +p p p 1 => 2 => 3 => 4 + ^~ unexpected '=>', expecting end-of-input + ^~ unexpected '=>', ignoring it + +p[p a, x: b => value] + ^ expected a matching `]` + ^ unexpected ']', expecting end-of-input + ^ unexpected ']', ignoring it + diff --git a/test/prism/fixtures/command_method_call_3.txt b/test/prism/fixtures/command_method_call_3.txt new file mode 100644 index 0000000000..6de0446aa9 --- /dev/null +++ b/test/prism/fixtures/command_method_call_3.txt @@ -0,0 +1,19 @@ +foo(bar 1, key => '2') + +foo(bar 1, KEY => '2') + +foo(bar 1, :key => '2') + +foo(bar 1, { baz: :bat } => '2') + +foo bar - %i[baz] => '2' + +foo(bar {} => '2') + +foo(bar baz {} => '2') + +foo(bar do end => '2') + +foo(1, bar {} => '2') + +foo(1, bar do end => '2') From 21c499d6e4fb3ca72db1733cb497c14c1010a739 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Thu, 18 Dec 2025 10:10:13 -0500 Subject: [PATCH 281/333] Bump to v1.7.0 --- CHANGELOG.md | 24 ++++++++++++++++++++- 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/4.0/Gemfile.lock | 6 +++--- gemfiles/jruby/Gemfile.lock | 2 +- gemfiles/truffleruby/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 +- 22 files changed, 49 insertions(+), 27 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4070ee860c..c25ca88336 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.7.0] - 2025-12-18 + +### Added + +- Support `4.1` as a version option. +- Add `equal_loc` to `CallNode`. +- Add `len()`/`is_empty()` to `ConstantList` and `NodeList` in the Rust API. + +### Changed + +- Rename version `3.5` to version `4.0`. +- Fix compiling the gem from source on Windows. +- Fix parsing of unary method calls like `42.~@`. +- Reject `def f a, (b) = 1`. +- Reject endless method as a block parameter default. +- Reject variable capture in alternative pattern. +- Many fixes in regards to memory safety, found through fuzzing. +- Many fixes to better handle invalid syntax, also found through fuzzing. +- Fix the ruby version used by the `ripper` translator. +- Fix `ruby_parser` translation comment processing. + ## [1.6.0] - 2025-10-16 ### Added @@ -695,7 +716,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.6.0...HEAD +[unreleased]: https://github.com/ruby/prism/compare/v1.7.0...HEAD +[1.7.0]: https://github.com/ruby/prism/compare/v1.6.0...v1.7.0 [1.6.0]: https://github.com/ruby/prism/compare/v1.5.2...v1.6.0 [1.5.2]: https://github.com/ruby/prism/compare/v1.5.1...v1.5.2 [1.5.1]: https://github.com/ruby/prism/compare/v1.5.0...v1.5.1 diff --git a/Gemfile.lock b/Gemfile.lock index d9879c8976..32f4de5b98 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - prism (1.6.0) + prism (1.7.0) GEM remote: https://rubygems.org/ diff --git a/ext/prism/extension.h b/ext/prism/extension.h index 70017a4ae3..6c3de31adb 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.6.0" +#define EXPECTED_PRISM_VERSION "1.7.0" #include #include diff --git a/gemfiles/2.7/Gemfile.lock b/gemfiles/2.7/Gemfile.lock index d8f93319ac..955846d5da 100644 --- a/gemfiles/2.7/Gemfile.lock +++ b/gemfiles/2.7/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: ../.. specs: - prism (1.6.0) + prism (1.7.0) GEM remote: https://rubygems.org/ diff --git a/gemfiles/3.0/Gemfile.lock b/gemfiles/3.0/Gemfile.lock index bb2299a4d6..b39a99d8b8 100644 --- a/gemfiles/3.0/Gemfile.lock +++ b/gemfiles/3.0/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: ../.. specs: - prism (1.6.0) + prism (1.7.0) GEM remote: https://rubygems.org/ diff --git a/gemfiles/3.1/Gemfile.lock b/gemfiles/3.1/Gemfile.lock index 45495af109..862669bf7d 100644 --- a/gemfiles/3.1/Gemfile.lock +++ b/gemfiles/3.1/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: ../.. specs: - prism (1.6.0) + prism (1.7.0) GEM remote: https://rubygems.org/ diff --git a/gemfiles/3.2/Gemfile.lock b/gemfiles/3.2/Gemfile.lock index 8689b73b57..a12fd61e2b 100644 --- a/gemfiles/3.2/Gemfile.lock +++ b/gemfiles/3.2/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: ../.. specs: - prism (1.6.0) + prism (1.7.0) GEM remote: https://rubygems.org/ diff --git a/gemfiles/3.3/Gemfile.lock b/gemfiles/3.3/Gemfile.lock index 48b6178d67..f6463f4383 100644 --- a/gemfiles/3.3/Gemfile.lock +++ b/gemfiles/3.3/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: ../.. specs: - prism (1.6.0) + prism (1.7.0) GEM remote: https://rubygems.org/ diff --git a/gemfiles/3.4/Gemfile.lock b/gemfiles/3.4/Gemfile.lock index fa863216b5..46b44c8106 100644 --- a/gemfiles/3.4/Gemfile.lock +++ b/gemfiles/3.4/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: ../.. specs: - prism (1.6.0) + prism (1.7.0) GEM remote: https://rubygems.org/ diff --git a/gemfiles/4.0/Gemfile.lock b/gemfiles/4.0/Gemfile.lock index e927400416..b1dd615155 100644 --- a/gemfiles/4.0/Gemfile.lock +++ b/gemfiles/4.0/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: ../.. specs: - prism (1.6.0) + prism (1.7.0) GEM remote: https://rubygems.org/ @@ -49,7 +49,7 @@ DEPENDENCIES test-unit RUBY VERSION - ruby 3.5.0.dev + ruby 3.5.0.dev BUNDLED WITH - 4.0.0.dev + 4.0.0.dev diff --git a/gemfiles/jruby/Gemfile.lock b/gemfiles/jruby/Gemfile.lock index 574af0754d..102562caaf 100644 --- a/gemfiles/jruby/Gemfile.lock +++ b/gemfiles/jruby/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: ../.. specs: - prism (1.6.0) + prism (1.7.0) GEM remote: https://rubygems.org/ diff --git a/gemfiles/truffleruby/Gemfile.lock b/gemfiles/truffleruby/Gemfile.lock index f6d64b41fc..35b5718319 100644 --- a/gemfiles/truffleruby/Gemfile.lock +++ b/gemfiles/truffleruby/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: ../.. specs: - prism (1.6.0) + prism (1.7.0) GEM remote: https://rubygems.org/ diff --git a/include/prism/version.h b/include/prism/version.h index f202b0f4d7..0b64a70dff 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 6 +#define PRISM_VERSION_MINOR 7 /** * 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.6.0" +#define PRISM_VERSION "1.7.0" #endif diff --git a/javascript/package.json b/javascript/package.json index c7f074e449..c98c168da3 100644 --- a/javascript/package.json +++ b/javascript/package.json @@ -1,6 +1,6 @@ { "name": "@ruby/prism", - "version": "1.6.0", + "version": "1.7.0", "description": "Prism Ruby parser", "type": "module", "main": "src/index.js", diff --git a/prism.gemspec b/prism.gemspec index d9872f88ac..2fb5d1d0b3 100644 --- a/prism.gemspec +++ b/prism.gemspec @@ -2,7 +2,7 @@ Gem::Specification.new do |spec| spec.name = "prism" - spec.version = "1.6.0" + spec.version = "1.7.0" spec.authors = ["Shopify"] spec.email = ["ruby@shopify.com"] diff --git a/rust/Cargo.lock b/rust/Cargo.lock index e884dd43e2..68ee9317d9 100644 --- a/rust/Cargo.lock +++ b/rust/Cargo.lock @@ -202,7 +202,7 @@ checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" [[package]] name = "ruby-prism" -version = "1.6.0" +version = "1.7.0" dependencies = [ "ruby-prism-sys", "serde", @@ -211,7 +211,7 @@ dependencies = [ [[package]] name = "ruby-prism-sys" -version = "1.6.0" +version = "1.7.0" dependencies = [ "bindgen", "cc", diff --git a/rust/ruby-prism-sys/Cargo.toml b/rust/ruby-prism-sys/Cargo.toml index 64228ddf63..ee0c87f31a 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.6.0" +version = "1.7.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 a5f1b916ba..e65fb8119a 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.6.0"); + assert_eq!(&cstring.to_string_lossy(), "1.7.0"); } #[test] diff --git a/rust/ruby-prism/Cargo.toml b/rust/ruby-prism/Cargo.toml index 2f14c62d6a..14c156a4b8 100644 --- a/rust/ruby-prism/Cargo.toml +++ b/rust/ruby-prism/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ruby-prism" -version = "1.6.0" +version = "1.7.0" edition = "2021" license-file = "../../LICENSE.md" repository = "https://github.com/ruby/prism" @@ -26,7 +26,7 @@ serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" [dependencies] -ruby-prism-sys = { version = "1.6.0", path = "../ruby-prism-sys" } +ruby-prism-sys = { version = "1.7.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 6c52d36feb..1b86b5313d 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) 6, "prism minor version does not match"); + expect((byte) 7, "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 a058d6cfeb..dd113ba9ee 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 = 6; +const MINOR_VERSION = 7; 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 526be67431..63f97dddd7 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 = 6 + MINOR_VERSION = 7 # The patch version of prism that we are expecting to find in the serialized # strings. From 34ceaf3a6a9747f8714043d6bfe4f747f81eeaef Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Thu, 18 Dec 2025 11:05:08 -0500 Subject: [PATCH 282/333] Fix up package.json for publishing provenance --- javascript/package.json | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/javascript/package.json b/javascript/package.json index c98c168da3..570298da18 100644 --- a/javascript/package.json +++ b/javascript/package.json @@ -11,5 +11,9 @@ "type": "tsc --allowJs -d --target ES2015 --emitDeclarationOnly --outDir src src/index.js" }, "author": "Shopify ", - "license": "MIT" + "license": "MIT", + "repository": { + "type": "git", + "url": "git+https://github.com/ruby/prism.git" + } } From 3688c5cd8f2fab6330c073f9e69c819cb4d78b29 Mon Sep 17 00:00:00 2001 From: Patrick Linnane Date: Fri, 19 Dec 2025 09:02:26 -0800 Subject: [PATCH 283/333] Fix Sorbet RBI for Parser35 alias to Parser40 Signed-off-by: Patrick Linnane --- rbi/prism/translation/parser35.rbi | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/rbi/prism/translation/parser35.rbi b/rbi/prism/translation/parser35.rbi index 68d44e70c6..86b590fb07 100644 --- a/rbi/prism/translation/parser35.rbi +++ b/rbi/prism/translation/parser35.rbi @@ -1,4 +1,3 @@ # typed: strict -class Prism::Translation::Parser35 < Prism::Translation::Parser -end +Prism::Translation::Parser35 = Prism::Translation::Parser40 From 6b9674e42cf077b5a52eee5e54101bb801e09c4c Mon Sep 17 00:00:00 2001 From: Nathan Froyd Date: Sat, 20 Dec 2025 11:34:58 -0500 Subject: [PATCH 284/333] [rust] implement `first`/`last` on vector-like things --- rust/ruby-prism/src/lib.rs | 65 ++++++++++++++++++++++++++++++++------ 1 file changed, 56 insertions(+), 9 deletions(-) diff --git a/rust/ruby-prism/src/lib.rs b/rust/ruby-prism/src/lib.rs index af430e1495..3561761cc4 100644 --- a/rust/ruby-prism/src/lib.rs +++ b/rust/ruby-prism/src/lib.rs @@ -139,6 +139,11 @@ pub struct NodeList<'pr> { } impl<'pr> NodeList<'pr> { + unsafe fn at(&self, index: usize) -> Node<'pr> { + let node: *mut pm_node_t = *(self.pointer.as_ref().nodes.add(index)); + Node::new(self.parser, node) + } + /// Returns an iterator over the nodes. #[must_use] pub const fn iter(&self) -> NodeListIter<'pr> { @@ -161,6 +166,26 @@ impl<'pr> NodeList<'pr> { pub const fn is_empty(&self) -> bool { self.len() == 0 } + + /// Returns the first element of the list, or `None` if it is empty. + #[must_use] + pub fn first(&self) -> Option> { + if self.is_empty() { + None + } else { + Some(unsafe { self.at(0) }) + } + } + + /// Returns the last element of the list, or `None` if it is empty. + #[must_use] + pub fn last(&self) -> Option> { + if self.is_empty() { + None + } else { + Some(unsafe { self.at(self.len() - 1) }) + } + } } impl<'pr> IntoIterator for &NodeList<'pr> { @@ -245,6 +270,11 @@ pub struct ConstantList<'pr> { } impl<'pr> ConstantList<'pr> { + const unsafe fn at(&self, index: usize) -> ConstantId<'pr> { + let constant_id: pm_constant_id_t = *(self.pointer.as_ref().ids.add(index)); + ConstantId::new(self.parser, constant_id) + } + /// Returns an iterator over the constants in the list. #[must_use] pub const fn iter(&self) -> ConstantListIter<'pr> { @@ -267,6 +297,26 @@ impl<'pr> ConstantList<'pr> { pub const fn is_empty(&self) -> bool { self.len() == 0 } + + /// Returns the first element of the list, or `None` if it is empty. + #[must_use] + pub const fn first(&self) -> Option> { + if self.is_empty() { + None + } else { + Some(unsafe { self.at(0) }) + } + } + + /// Returns the last element of the list, or `None` if it is empty. + #[must_use] + pub const fn last(&self) -> Option> { + if self.is_empty() { + None + } else { + Some(unsafe { self.at(self.len() - 1) }) + } + } } impl<'pr> IntoIterator for &ConstantList<'pr> { @@ -815,23 +865,20 @@ mod tests { #[test] fn constant_id_test() { - let source = "module Foo; x = 1; end"; + let source = "module Foo; x = 1; y = 2; end"; let result = parse(source.as_ref()); let node = result.node(); assert_eq!(node.as_program_node().unwrap().statements().body().len(), 1); assert!(!node.as_program_node().unwrap().statements().body().is_empty()); - let module = node.as_program_node().unwrap().statements().body().iter().next().unwrap(); + let module = node.as_program_node().and_then(|pn| pn.statements().body().first()).unwrap(); let module = module.as_module_node().unwrap(); - assert_eq!(module.locals().len(), 1); + assert_eq!(module.locals().len(), 2); assert!(!module.locals().is_empty()); - let locals = module.locals().iter().collect::>(); - - assert_eq!(locals.len(), 1); - - assert_eq!(locals[0].as_slice(), b"x"); + assert_eq!(module.locals().first().unwrap().as_slice(), b"x"); + assert_eq!(module.locals().last().unwrap().as_slice(), b"y"); let source = "module Foo; end"; let result = parse(source.as_ref()); @@ -839,7 +886,7 @@ mod tests { let node = result.node(); assert_eq!(node.as_program_node().unwrap().statements().body().len(), 1); assert!(!node.as_program_node().unwrap().statements().body().is_empty()); - let module = node.as_program_node().unwrap().statements().body().iter().next().unwrap(); + let module = node.as_program_node().and_then(|pn| pn.statements().body().first()).unwrap(); let module = module.as_module_node().unwrap(); assert_eq!(module.locals().len(), 0); From 115f0a118c3b70874a125e571886fa228c5c6e7f Mon Sep 17 00:00:00 2001 From: Koichi ITO Date: Sun, 21 Dec 2025 05:58:23 +0900 Subject: [PATCH 285/333] Sync `Prism::Translation::ParserCurrent` with Ruby 4.0 This PR updates the fallback version for `Prism::Translation::ParserCurrent` from 3.4 to 4.0. Currently, the fallback resolves to `Parser34`, as shown below: ```console $ ruby -v -rprism -rprism/translation/parser_current -e 'p Prism::Translation::ParserCurrent' ruby 3.0.7p220 (2024-04-23 revision 724a071175) [x86_64-darwin23] warning: `Prism::Translation::Current` is loading Prism::Translation::Parser34, but you are running 3.0. Prism::Translation::Parser34 ``` Following the comment "Keep this in sync with released Ruby.", it seems like the right time to set this to Ruby 4.0, which is scheduled for release this week. --- lib/prism/translation/parser_current.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/prism/translation/parser_current.rb b/lib/prism/translation/parser_current.rb index ac6daf7082..f13eff6bbe 100644 --- a/lib/prism/translation/parser_current.rb +++ b/lib/prism/translation/parser_current.rb @@ -16,7 +16,7 @@ module Translation ParserCurrent = Parser41 else # Keep this in sync with released Ruby. - parser = Parser34 + parser = Parser40 major, minor, _patch = Gem::Version.new(RUBY_VERSION).segments warn "warning: `Prism::Translation::Current` is loading #{parser.name}, " \ "but you are running #{major}.#{minor}." From 9c5066e61c90805e67fb8f65211b1efff3b53a76 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Mon, 22 Dec 2025 09:43:15 -0500 Subject: [PATCH 286/333] Reduce size of the WASM file (2M->480K) --- Makefile | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index e71ba98fe9..265d478734 100644 --- a/Makefile +++ b/Makefile @@ -43,7 +43,13 @@ build/libprism.a: $(STATIC_OBJECTS) javascript/src/prism.wasm: Makefile $(SOURCES) $(HEADERS) $(ECHO) "building $@" - $(Q) $(WASI_SDK_PATH)/bin/clang --sysroot=$(WASI_SDK_PATH)/share/wasi-sysroot/ $(DEBUG_FLAGS) -DPRISM_EXPORT_SYMBOLS -D_WASI_EMULATED_MMAN -lwasi-emulated-mman $(CPPFLAGS) $(CFLAGS) -Wl,--export-all -Wl,--no-entry -mexec-model=reactor -o $@ $(SOURCES) + $(Q) $(WASI_SDK_PATH)/bin/clang --sysroot=$(WASI_SDK_PATH)/share/wasi-sysroot/ \ + $(DEBUG_FLAGS) \ + -DPRISM_EXPORT_SYMBOLS -DPRISM_EXCLUDE_PRETTYPRINT -DPRISM_EXCLUDE_JSON -DPRISM_EXCLUDE_PACK \ + -D_WASI_EMULATED_MMAN -lwasi-emulated-mman $(CPPFLAGS) $(CFLAGS) \ + -Wl,--export-all -Wl,--gc-sections -Wl,--strip-all -Wl,--lto-O3 -Wl,--no-entry -mexec-model=reactor \ + -Oz -g0 -flto -fdata-sections -ffunction-sections \ + -o $@ $(SOURCES) java-wasm/src/test/resources/prism.wasm: Makefile $(SOURCES) $(HEADERS) $(ECHO) "building $@" From ade8d010282fd6158fb6910a8b6fdf77784f2138 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 22 Dec 2025 16:29:23 +0000 Subject: [PATCH 287/333] Bump the ruby-deps group across 7 directories with 2 updates Bumps the ruby-deps group with 1 update in the /gemfiles/3.2 directory: [ruby_parser](https://github.com/seattlerb/ruby_parser). Bumps the ruby-deps group with 1 update in the /gemfiles/3.3 directory: [ruby_parser](https://github.com/seattlerb/ruby_parser). Bumps the ruby-deps group with 1 update in the /gemfiles/3.4 directory: [ruby_parser](https://github.com/seattlerb/ruby_parser). Bumps the ruby-deps group with 1 update in the /gemfiles/4.0 directory: [ruby_parser](https://github.com/seattlerb/ruby_parser). Bumps the ruby-deps group with 1 update in the /gemfiles/jruby directory: [ruby_parser](https://github.com/seattlerb/ruby_parser). Bumps the ruby-deps group with 1 update in the /gemfiles/truffleruby directory: [ruby_parser](https://github.com/seattlerb/ruby_parser). Bumps the ruby-deps group with 2 updates in the /gemfiles/typecheck directory: [ruby_parser](https://github.com/seattlerb/ruby_parser) and [minitest](https://github.com/minitest/minitest). Updates `ruby_parser` from 3.21.1 to 3.22.0 - [Changelog](https://github.com/seattlerb/ruby_parser/blob/master/History.rdoc) - [Commits](https://github.com/seattlerb/ruby_parser/compare/v3.21.1...v3.22.0) Updates `ruby_parser` from 3.21.1 to 3.22.0 - [Changelog](https://github.com/seattlerb/ruby_parser/blob/master/History.rdoc) - [Commits](https://github.com/seattlerb/ruby_parser/compare/v3.21.1...v3.22.0) Updates `ruby_parser` from 3.21.1 to 3.22.0 - [Changelog](https://github.com/seattlerb/ruby_parser/blob/master/History.rdoc) - [Commits](https://github.com/seattlerb/ruby_parser/compare/v3.21.1...v3.22.0) Updates `ruby_parser` from 3.21.1 to 3.22.0 - [Changelog](https://github.com/seattlerb/ruby_parser/blob/master/History.rdoc) - [Commits](https://github.com/seattlerb/ruby_parser/compare/v3.21.1...v3.22.0) Updates `ruby_parser` from 3.21.1 to 3.22.0 - [Changelog](https://github.com/seattlerb/ruby_parser/blob/master/History.rdoc) - [Commits](https://github.com/seattlerb/ruby_parser/compare/v3.21.1...v3.22.0) Updates `ruby_parser` from 3.21.1 to 3.22.0 - [Changelog](https://github.com/seattlerb/ruby_parser/blob/master/History.rdoc) - [Commits](https://github.com/seattlerb/ruby_parser/compare/v3.21.1...v3.22.0) Updates `ruby_parser` from 3.21.1 to 3.22.0 - [Changelog](https://github.com/seattlerb/ruby_parser/blob/master/History.rdoc) - [Commits](https://github.com/seattlerb/ruby_parser/compare/v3.21.1...v3.22.0) Updates `minitest` from 5.27.0 to 6.0.0 - [Changelog](https://github.com/minitest/minitest/blob/master/History.rdoc) - [Commits](https://github.com/minitest/minitest/compare/v5.27.0...v6.0.0) --- updated-dependencies: - dependency-name: ruby_parser dependency-version: 3.22.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: ruby_parser dependency-version: 3.22.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: ruby_parser dependency-version: 3.22.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: ruby_parser dependency-version: 3.22.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: ruby_parser dependency-version: 3.22.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: ruby_parser dependency-version: 3.22.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: ruby_parser dependency-version: 3.22.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: minitest dependency-version: 6.0.0 dependency-type: direct:production update-type: version-update:semver-major dependency-group: ruby-deps ... Signed-off-by: dependabot[bot] --- gemfiles/3.2/Gemfile.lock | 2 +- gemfiles/3.3/Gemfile.lock | 2 +- gemfiles/3.4/Gemfile.lock | 2 +- gemfiles/4.0/Gemfile.lock | 2 +- gemfiles/jruby/Gemfile.lock | 2 +- gemfiles/truffleruby/Gemfile.lock | 2 +- gemfiles/typecheck/Gemfile.lock | 5 +++-- 7 files changed, 9 insertions(+), 8 deletions(-) diff --git a/gemfiles/3.2/Gemfile.lock b/gemfiles/3.2/Gemfile.lock index a12fd61e2b..a3d7698007 100644 --- a/gemfiles/3.2/Gemfile.lock +++ b/gemfiles/3.2/Gemfile.lock @@ -25,7 +25,7 @@ GEM logger ruby_memcheck (3.0.1) nokogiri - ruby_parser (3.21.1) + ruby_parser (3.22.0) racc (~> 1.5) sexp_processor (~> 4.16) sexp_processor (4.17.4) diff --git a/gemfiles/3.3/Gemfile.lock b/gemfiles/3.3/Gemfile.lock index f6463f4383..5bb7cd4119 100644 --- a/gemfiles/3.3/Gemfile.lock +++ b/gemfiles/3.3/Gemfile.lock @@ -25,7 +25,7 @@ GEM logger ruby_memcheck (3.0.1) nokogiri - ruby_parser (3.21.1) + ruby_parser (3.22.0) racc (~> 1.5) sexp_processor (~> 4.16) sexp_processor (4.17.4) diff --git a/gemfiles/3.4/Gemfile.lock b/gemfiles/3.4/Gemfile.lock index 46b44c8106..36c52c963d 100644 --- a/gemfiles/3.4/Gemfile.lock +++ b/gemfiles/3.4/Gemfile.lock @@ -25,7 +25,7 @@ GEM logger ruby_memcheck (3.0.1) nokogiri - ruby_parser (3.21.1) + ruby_parser (3.22.0) racc (~> 1.5) sexp_processor (~> 4.16) sexp_processor (4.17.4) diff --git a/gemfiles/4.0/Gemfile.lock b/gemfiles/4.0/Gemfile.lock index b1dd615155..f98d9d054b 100644 --- a/gemfiles/4.0/Gemfile.lock +++ b/gemfiles/4.0/Gemfile.lock @@ -26,7 +26,7 @@ GEM logger ruby_memcheck (3.0.1) nokogiri - ruby_parser (3.21.1) + ruby_parser (3.22.0) racc (~> 1.5) sexp_processor (~> 4.16) sexp_processor (4.17.4) diff --git a/gemfiles/jruby/Gemfile.lock b/gemfiles/jruby/Gemfile.lock index 102562caaf..c49a7c8512 100644 --- a/gemfiles/jruby/Gemfile.lock +++ b/gemfiles/jruby/Gemfile.lock @@ -16,7 +16,7 @@ GEM rake (13.3.1) rake-compiler (1.3.1) rake - ruby_parser (3.21.1) + ruby_parser (3.22.0) racc (~> 1.5) sexp_processor (~> 4.16) sexp_processor (4.17.4) diff --git a/gemfiles/truffleruby/Gemfile.lock b/gemfiles/truffleruby/Gemfile.lock index 35b5718319..17b62c0cae 100644 --- a/gemfiles/truffleruby/Gemfile.lock +++ b/gemfiles/truffleruby/Gemfile.lock @@ -15,7 +15,7 @@ GEM rake (13.3.1) rake-compiler (1.3.1) rake - ruby_parser (3.21.1) + ruby_parser (3.22.0) racc (~> 1.5) sexp_processor (~> 4.16) sexp_processor (4.17.4) diff --git a/gemfiles/typecheck/Gemfile.lock b/gemfiles/typecheck/Gemfile.lock index 4783a1e079..2d0baa55ae 100644 --- a/gemfiles/typecheck/Gemfile.lock +++ b/gemfiles/typecheck/Gemfile.lock @@ -34,7 +34,8 @@ GEM rb-fsevent (~> 0.10, >= 0.10.3) rb-inotify (~> 0.9, >= 0.9.10) logger (1.7.0) - minitest (5.27.0) + minitest (6.0.0) + prism (~> 1.5) mutex_m (0.3.0) netrc (0.11.0) parallel (1.27.0) @@ -57,7 +58,7 @@ GEM rbs (3.9.5) logger rexml (3.4.4) - ruby_parser (3.21.1) + ruby_parser (3.22.0) racc (~> 1.5) sexp_processor (~> 4.16) securerandom (0.4.1) From bf631750cf39827b750f13d55c90af0ea95817ea Mon Sep 17 00:00:00 2001 From: Earlopain <14981592+Earlopain@users.noreply.github.com> Date: Tue, 23 Dec 2025 14:41:09 +0100 Subject: [PATCH 288/333] Optimize ruby visitor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `compact_child_nodes` allocates an array. We can skip that step by simply yielding the nodes. Benchmark for visiting the rails codebase: ```rb require "prism" require "benchmark/ips" files = Dir.glob("../rails/**/*.rb") results = files.map { Prism.parse_file(it) } visitor = Prism::Visitor.new Benchmark.ips do |x| x.config(warmup: 3, time: 10) x.report do results.each do visitor.visit(it.value) end end end RubyVM::YJIT.enable Benchmark.ips do |x| x.config(warmup: 3, time: 10) x.report do results.each do visitor.visit(it.value) end end end ``` Before: ``` ruby 3.4.8 (2025-12-17 revision 995b59f666) +PRISM [x86_64-linux] Warming up -------------------------------------- 1.000 i/100ms Calculating ------------------------------------- 2.691 (± 0.0%) i/s (371.55 ms/i) - 27.000 in 10.089422s ruby 3.4.8 (2025-12-17 revision 995b59f666) +YJIT +PRISM [x86_64-linux] Warming up -------------------------------------- 1.000 i/100ms Calculating ------------------------------------- 7.278 (±13.7%) i/s (137.39 ms/i) - 70.000 in 10.071568s ``` After: ``` ruby 3.4.8 (2025-12-17 revision 995b59f666) +PRISM [x86_64-linux] Warming up -------------------------------------- 1.000 i/100ms Calculating ------------------------------------- 3.429 (± 0.0%) i/s (291.65 ms/i) - 35.000 in 10.208580s ruby 3.4.8 (2025-12-17 revision 995b59f666) +YJIT +PRISM [x86_64-linux] Warming up -------------------------------------- 1.000 i/100ms Calculating ------------------------------------- 16.815 (± 0.0%) i/s (59.47 ms/i) - 169.000 in 10.054668s ``` ~21% faster on the interpreter, ~56% with YJIT --- docs/ruby_api.md | 1 + lib/prism/translation/ruby_parser.rb | 2 +- sample/prism/find_comments.rb | 4 ++-- sample/prism/locate_nodes.rb | 11 ++++++----- templates/lib/prism/compiler.rb.erb | 4 ++-- templates/lib/prism/node.rb.erb | 25 ++++++++++++++++++++++++- templates/lib/prism/visitor.rb.erb | 4 ++-- templates/sig/prism/node.rbs.erb | 1 + 8 files changed, 39 insertions(+), 13 deletions(-) diff --git a/docs/ruby_api.md b/docs/ruby_api.md index 6cfde4c1f3..c378417cfc 100644 --- a/docs/ruby_api.md +++ b/docs/ruby_api.md @@ -36,6 +36,7 @@ Once you have nodes in hand coming out of a parse result, there are a number of * `#accept(visitor)` - a method that will immediately call `visit_*` to specialize for the node type * `#child_nodes` - a positional array of the child nodes of the node, with `nil` values for any missing children * `#compact_child_nodes` - a positional array of the child nodes of the node with no `nil` values +* `#each_child_node` - with a block given yields all child nodes, without a block return an enumerator containing all child nodes * `#copy(**keys)` - a method that allows creating a shallow copy of the node with the given keys overridden * `#deconstruct`/`#deconstruct_keys(keys)` - the pattern matching interface for nodes * `#inspect` - a string representation that looks like the syntax tree of the node diff --git a/lib/prism/translation/ruby_parser.rb b/lib/prism/translation/ruby_parser.rb index 1fb0e27846..c026c4ad9c 100644 --- a/lib/prism/translation/ruby_parser.rb +++ b/lib/prism/translation/ruby_parser.rb @@ -1422,7 +1422,7 @@ def visit_or_node(node) # ``` def visit_parameters_node(node) children = - node.compact_child_nodes.map do |element| + node.each_child_node.map do |element| if element.is_a?(MultiTargetNode) visit_destructured_parameter(element) else diff --git a/sample/prism/find_comments.rb b/sample/prism/find_comments.rb index 6a26cd32b7..314bbb9b8e 100644 --- a/sample/prism/find_comments.rb +++ b/sample/prism/find_comments.rb @@ -16,7 +16,7 @@ def initialize(target, comments, nesting = []) # method definition on the node. def visit_module_node(node) visitor = FindMethodComments.new(@target, @comments, [*@nesting, node.name]) - node.compact_child_nodes.each { |child| child.accept(visitor) } + node.each_child_node { |child| child.accept(visitor) } end def visit_class_node(node) @@ -26,7 +26,7 @@ def visit_class_node(node) # because then the state is immutable and it's easier to reason about. This # also provides for more debugging opportunity in the initializer. visitor = FindMethodComments.new(@target, @comments, [*@nesting, node.name]) - node.compact_child_nodes.each { |child| child.accept(visitor) } + node.each_child_node { |child| child.accept(visitor) } end def visit_def_node(node) diff --git a/sample/prism/locate_nodes.rb b/sample/prism/locate_nodes.rb index 7a51db4367..dd70f87850 100644 --- a/sample/prism/locate_nodes.rb +++ b/sample/prism/locate_nodes.rb @@ -40,11 +40,12 @@ def locate(node, line:, column:) while (node = queue.shift) result << node - # Nodes have `child_nodes` and `compact_child_nodes`. `child_nodes` have - # consistent indices but include `nil` for optional fields that are not - # present, whereas `compact_child_nodes` has inconsistent indices but does - # not include `nil` for optional fields that are not present. - node.compact_child_nodes.find do |child| + # Nodes have `child_nodes`, `compact_child_nodes`, and `each_child_node`. + # `child_nodes` have consistent indices but include `nil` for optional fields that + # are not present, whereas `compact_child_nodes` has inconsistent indices but does + # not include `nil` for optional fields that are not present. `each_child_node` is + # like `compact_child_nodes`, returning an enumerator instead of an array. + node.each_child_node.find do |child| queue << child if covers?(child.location, line: line, column: column) end end diff --git a/templates/lib/prism/compiler.rb.erb b/templates/lib/prism/compiler.rb.erb index 9102025c20..66dbe666b9 100644 --- a/templates/lib/prism/compiler.rb.erb +++ b/templates/lib/prism/compiler.rb.erb @@ -29,14 +29,14 @@ module Prism # Visit the child nodes of the given node. def visit_child_nodes(node) - node.compact_child_nodes.map { |node| node.accept(self) } + node.each_child_node.map { |node| node.accept(self) } end <%- nodes.each_with_index do |node, index| -%> <%= "\n" if index != 0 -%> # Compile a <%= node.name %> node def visit_<%= node.human %>(node) - node.compact_child_nodes.map { |node| node.accept(self) } + node.each_child_node.map { |node| node.accept(self) } end <%- end -%> end diff --git a/templates/lib/prism/node.rb.erb b/templates/lib/prism/node.rb.erb index ceee2b0ffe..c97c029d3b 100644 --- a/templates/lib/prism/node.rb.erb +++ b/templates/lib/prism/node.rb.erb @@ -187,7 +187,7 @@ module Prism while (node = queue.shift) result << node - node.compact_child_nodes.each do |child_node| + node.each_child_node do |child_node| child_location = child_node.location start_line = child_location.start_line @@ -259,6 +259,13 @@ module Prism alias deconstruct child_nodes + # With a block given, yields each child node. Without a block, returns + # an enumerator that contains each child node. Excludes any `nil`s in + # the place of optional nodes that were not present. + def each_child_node + raise NoMethodError, "undefined method `each_child_node' for #{inspect}" + end + # Returns an array of child nodes, excluding any `nil`s in the place of # optional nodes that were not present. def compact_child_nodes @@ -335,6 +342,22 @@ module Prism }.compact.join(", ") %>] end + # def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] + def each_child_node + return to_enum(:each_child_node) unless block_given? + + <%- node.fields.each do |field| -%> + <%- case field -%> + <%- when Prism::Template::NodeField -%> + yield <%= field.name %> + <%- when Prism::Template::OptionalNodeField -%> + yield <%= field.name %> if <%= field.name %> + <%- when Prism::Template::NodeListField -%> + <%= field.name %>.each {|node| yield node } + <%- end -%> + <%- end -%> + end + # def compact_child_nodes: () -> Array[Node] def compact_child_nodes <%- if node.fields.any? { |field| field.is_a?(Prism::Template::OptionalNodeField) } -%> diff --git a/templates/lib/prism/visitor.rb.erb b/templates/lib/prism/visitor.rb.erb index b1a03c3f1a..76f907724f 100644 --- a/templates/lib/prism/visitor.rb.erb +++ b/templates/lib/prism/visitor.rb.erb @@ -20,7 +20,7 @@ module Prism # Visits the child nodes of `node` by calling `accept` on each one. def visit_child_nodes(node) # @type self: _Visitor - node.compact_child_nodes.each { |node| node.accept(self) } + node.each_child_node { |node| node.accept(self) } end end @@ -48,7 +48,7 @@ module Prism <%= "\n" if index != 0 -%> # Visit a <%= node.name %> node def visit_<%= node.human %>(node) - node.compact_child_nodes.each { |node| node.accept(self) } + node.each_child_node { |node| node.accept(self) } end <%- end -%> end diff --git a/templates/sig/prism/node.rbs.erb b/templates/sig/prism/node.rbs.erb index 6d6fe67336..01914b571c 100644 --- a/templates/sig/prism/node.rbs.erb +++ b/templates/sig/prism/node.rbs.erb @@ -12,6 +12,7 @@ module Prism def child_nodes: () -> Array[Prism::node?] def comment_targets: () -> Array[Prism::node | Location] def compact_child_nodes: () -> Array[Prism::node] + def each_child_node: () { (Prism::node) -> void } -> void | () -> Enumerator[Prism::node] def self.fields: () -> Array[Prism::Reflection::Field] def type: () -> Symbol def self.type: () -> Symbol From 166764f7942f1baa9d3709a1f9eb625724e200dc Mon Sep 17 00:00:00 2001 From: Thomas Marshall Date: Mon, 29 Dec 2025 12:54:28 +0000 Subject: [PATCH 289/333] Add unterminated construct tests --- test/prism/errors/unterminated_begin.txt | 4 ++++ test/prism/errors/unterminated_begin_upcase.txt | 4 ++++ test/prism/errors/unterminated_block_do_end.txt | 4 ++++ test/prism/errors/unterminated_class.txt | 4 ++++ test/prism/errors/unterminated_def.txt | 5 +++++ test/prism/errors/unterminated_end_upcase.txt | 4 ++++ test/prism/errors/unterminated_for.txt | 5 +++++ test/prism/errors/unterminated_if.txt | 5 +++++ test/prism/errors/unterminated_if_else.txt | 5 +++++ test/prism/errors/unterminated_lambda_brace.txt | 4 ++++ test/prism/errors/unterminated_module.txt | 4 ++++ test/prism/errors/unterminated_pattern_bracket.txt | 7 +++++++ test/prism/errors/unterminated_pattern_paren.txt | 7 +++++++ test/prism/errors/unterminated_until.txt | 5 +++++ 14 files changed, 67 insertions(+) create mode 100644 test/prism/errors/unterminated_begin.txt create mode 100644 test/prism/errors/unterminated_begin_upcase.txt create mode 100644 test/prism/errors/unterminated_block_do_end.txt create mode 100644 test/prism/errors/unterminated_class.txt create mode 100644 test/prism/errors/unterminated_def.txt create mode 100644 test/prism/errors/unterminated_end_upcase.txt create mode 100644 test/prism/errors/unterminated_for.txt create mode 100644 test/prism/errors/unterminated_if.txt create mode 100644 test/prism/errors/unterminated_if_else.txt create mode 100644 test/prism/errors/unterminated_lambda_brace.txt create mode 100644 test/prism/errors/unterminated_module.txt create mode 100644 test/prism/errors/unterminated_pattern_bracket.txt create mode 100644 test/prism/errors/unterminated_pattern_paren.txt create mode 100644 test/prism/errors/unterminated_until.txt diff --git a/test/prism/errors/unterminated_begin.txt b/test/prism/errors/unterminated_begin.txt new file mode 100644 index 0000000000..6217f80a0b --- /dev/null +++ b/test/prism/errors/unterminated_begin.txt @@ -0,0 +1,4 @@ +begin + ^ unexpected end-of-input, assuming it is closing the parent top level context + ^ expected an `end` to close the `begin` statement + diff --git a/test/prism/errors/unterminated_begin_upcase.txt b/test/prism/errors/unterminated_begin_upcase.txt new file mode 100644 index 0000000000..92b975bf76 --- /dev/null +++ b/test/prism/errors/unterminated_begin_upcase.txt @@ -0,0 +1,4 @@ +BEGIN { + ^ unexpected end-of-input, assuming it is closing the parent top level context + ^ expected a `}` to close the `BEGIN` statement + diff --git a/test/prism/errors/unterminated_block_do_end.txt b/test/prism/errors/unterminated_block_do_end.txt new file mode 100644 index 0000000000..fb7ca53d6a --- /dev/null +++ b/test/prism/errors/unterminated_block_do_end.txt @@ -0,0 +1,4 @@ +foo do + ^ unexpected end-of-input, assuming it is closing the parent top level context + ^ expected a block beginning with `do` to end with `end` + diff --git a/test/prism/errors/unterminated_class.txt b/test/prism/errors/unterminated_class.txt new file mode 100644 index 0000000000..ea80ab8fc7 --- /dev/null +++ b/test/prism/errors/unterminated_class.txt @@ -0,0 +1,4 @@ +class Foo + ^ unexpected end-of-input, assuming it is closing the parent top level context + ^ expected an `end` to close the `class` statement + diff --git a/test/prism/errors/unterminated_def.txt b/test/prism/errors/unterminated_def.txt new file mode 100644 index 0000000000..83ec939fea --- /dev/null +++ b/test/prism/errors/unterminated_def.txt @@ -0,0 +1,5 @@ +def foo + ^ expected a delimiter to close the parameters + ^ unexpected end-of-input, assuming it is closing the parent top level context + ^ expected an `end` to close the `def` statement + diff --git a/test/prism/errors/unterminated_end_upcase.txt b/test/prism/errors/unterminated_end_upcase.txt new file mode 100644 index 0000000000..42ccd22bd5 --- /dev/null +++ b/test/prism/errors/unterminated_end_upcase.txt @@ -0,0 +1,4 @@ +END { + ^ unexpected end-of-input, assuming it is closing the parent top level context + ^ expected a `}` to close the `END` statement + diff --git a/test/prism/errors/unterminated_for.txt b/test/prism/errors/unterminated_for.txt new file mode 100644 index 0000000000..cbd17f0b84 --- /dev/null +++ b/test/prism/errors/unterminated_for.txt @@ -0,0 +1,5 @@ +for x in y + ^ unexpected end-of-input; expected a 'do', newline, or ';' after the 'for' loop collection + ^ unexpected end-of-input, assuming it is closing the parent top level context + ^ expected an `end` to close the `for` loop + diff --git a/test/prism/errors/unterminated_if.txt b/test/prism/errors/unterminated_if.txt new file mode 100644 index 0000000000..559a006022 --- /dev/null +++ b/test/prism/errors/unterminated_if.txt @@ -0,0 +1,5 @@ +if true + ^ expected `then` or `;` or '\n' + ^ unexpected end-of-input, assuming it is closing the parent top level context + ^ expected an `end` to close the conditional clause + diff --git a/test/prism/errors/unterminated_if_else.txt b/test/prism/errors/unterminated_if_else.txt new file mode 100644 index 0000000000..35a181e844 --- /dev/null +++ b/test/prism/errors/unterminated_if_else.txt @@ -0,0 +1,5 @@ +if true +else + ^ unexpected end-of-input, assuming it is closing the parent top level context + ^ expected an `end` to close the `else` clause + diff --git a/test/prism/errors/unterminated_lambda_brace.txt b/test/prism/errors/unterminated_lambda_brace.txt new file mode 100644 index 0000000000..bb8c1090ab --- /dev/null +++ b/test/prism/errors/unterminated_lambda_brace.txt @@ -0,0 +1,4 @@ +-> { + ^ unexpected end-of-input, assuming it is closing the parent top level context + ^ expected a lambda block beginning with `{` to end with `}` + diff --git a/test/prism/errors/unterminated_module.txt b/test/prism/errors/unterminated_module.txt new file mode 100644 index 0000000000..cf207c06a7 --- /dev/null +++ b/test/prism/errors/unterminated_module.txt @@ -0,0 +1,4 @@ +module Foo + ^ unexpected end-of-input, assuming it is closing the parent top level context + ^ expected an `end` to close the `module` statement + diff --git a/test/prism/errors/unterminated_pattern_bracket.txt b/test/prism/errors/unterminated_pattern_bracket.txt new file mode 100644 index 0000000000..cc2630f8e9 --- /dev/null +++ b/test/prism/errors/unterminated_pattern_bracket.txt @@ -0,0 +1,7 @@ +case x +in [1 + ^ expected a `]` to close the pattern expression + ^ expected a delimiter after the patterns of an `in` clause + ^ unexpected end-of-input, assuming it is closing the parent top level context + ^ expected an `end` to close the `case` statement + diff --git a/test/prism/errors/unterminated_pattern_paren.txt b/test/prism/errors/unterminated_pattern_paren.txt new file mode 100644 index 0000000000..162a128546 --- /dev/null +++ b/test/prism/errors/unterminated_pattern_paren.txt @@ -0,0 +1,7 @@ +case x +in (1 + ^ expected a `)` to close the pattern expression + ^ expected a delimiter after the patterns of an `in` clause + ^ unexpected end-of-input, assuming it is closing the parent top level context + ^ expected an `end` to close the `case` statement + diff --git a/test/prism/errors/unterminated_until.txt b/test/prism/errors/unterminated_until.txt new file mode 100644 index 0000000000..b9d7eee40f --- /dev/null +++ b/test/prism/errors/unterminated_until.txt @@ -0,0 +1,5 @@ +until true + ^ expected a predicate expression for the `until` statement + ^ unexpected end-of-input, assuming it is closing the parent top level context + ^ expected an `end` to close the `until` statement + From 2d7829f060763acdb341cd17ab2c236e40abf4d7 Mon Sep 17 00:00:00 2001 From: Thomas Marshall Date: Mon, 29 Dec 2025 12:55:18 +0000 Subject: [PATCH 290/333] Report missing end errors at opening token This commit adds an `expect1_opening` function that expects a token and attaches the error to the opening token location rather than the current position. This is useful for errors about missing closing tokens, where we want to point to the line with the opening token rather than the end of the file. For example: ```ruby def foo def bar def baz ^ expected an `end` to close the `def` statement ^ expected an `end` to close the `def` statement ^ expected an `end` to close the `def` statement ``` This would previously produce three identical errors at the end of the file. After this commit, they would be reported at the opening token location: ```ruby def foo ^~~ expected an `end` to close the `def` statement def bar ^~~ expected an `end` to close the `def` statement def baz ^~~ expected an `end` to close the `def` statement ``` I considered using the end of the line where the opening token is located, but in some cases that would be less useful than the opening token location itself. For example: ```ruby def foo def bar def baz ``` Here the end of the line where the opening token is located would be the same for each of the unclosed `def` nodes. --- src/prism.c | 67 ++++++++++++------- ...ginning_with_brace_and_ending_with_end.txt | 2 +- test/prism/errors/command_calls_2.txt | 2 +- test/prism/errors/command_calls_24.txt | 2 +- test/prism/errors/command_calls_25.txt | 2 +- test/prism/errors/heredoc_unterminated.txt | 2 +- test/prism/errors/infix_after_label.txt | 2 +- .../errors/label_in_interpolated_string.txt | 2 +- test/prism/errors/pattern_string_key.txt | 2 +- test/prism/errors/shadow_args_in_lambda.txt | 2 +- test/prism/errors/unterminated_begin.txt | 2 +- .../errors/unterminated_begin_upcase.txt | 2 +- test/prism/errors/unterminated_block.txt | 2 +- .../errors/unterminated_block_do_end.txt | 2 +- test/prism/errors/unterminated_class.txt | 2 +- test/prism/errors/unterminated_def.txt | 2 +- test/prism/errors/unterminated_end_upcase.txt | 2 +- test/prism/errors/unterminated_for.txt | 2 +- test/prism/errors/unterminated_if.txt | 2 +- test/prism/errors/unterminated_if_else.txt | 2 +- .../errors/unterminated_lambda_brace.txt | 2 +- test/prism/errors/unterminated_module.txt | 2 +- .../errors/unterminated_pattern_bracket.txt | 4 +- .../errors/unterminated_pattern_paren.txt | 4 +- test/prism/errors/unterminated_until.txt | 2 +- test/prism/errors/while_endless_method.txt | 2 +- 26 files changed, 69 insertions(+), 52 deletions(-) diff --git a/src/prism.c b/src/prism.c index 4c8ab91f0e..1a8cdf7568 100644 --- a/src/prism.c +++ b/src/prism.c @@ -12422,6 +12422,22 @@ expect1_heredoc_term(pm_parser_t *parser, const uint8_t *ident_start, size_t ide } } +/** + * A special expect1 that attaches the error to the opening token location + * rather than the current position. This is useful for errors about missing + * closing tokens, where we want to point to the line with the opening token + * (e.g., `def`, `class`, `if`, `{`) rather than the end of the file. + */ +static void +expect1_opening(pm_parser_t *parser, pm_token_type_t type, pm_diagnostic_id_t diag_id, const pm_token_t *opening) { + if (accept1(parser, type)) return; + + pm_parser_err(parser, opening->start, opening->end, diag_id); + + parser->previous.start = opening->end; + parser->previous.type = PM_TOKEN_MISSING; +} + static pm_node_t * parse_expression(pm_parser_t *parser, pm_binding_power_t binding_power, bool accepts_command_call, bool accepts_label, pm_diagnostic_id_t diag_id, uint16_t depth); @@ -14764,7 +14780,7 @@ parse_block(pm_parser_t *parser, uint16_t depth) { statements = UP(parse_statements(parser, PM_CONTEXT_BLOCK_BRACES, (uint16_t) (depth + 1))); } - expect1(parser, PM_TOKEN_BRACE_RIGHT, PM_ERR_BLOCK_TERM_BRACE); + expect1_opening(parser, PM_TOKEN_BRACE_RIGHT, PM_ERR_BLOCK_TERM_BRACE, &opening); } else { if (!match1(parser, PM_TOKEN_KEYWORD_END)) { if (!match3(parser, PM_TOKEN_KEYWORD_RESCUE, PM_TOKEN_KEYWORD_ELSE, PM_TOKEN_KEYWORD_ENSURE)) { @@ -14779,7 +14795,7 @@ parse_block(pm_parser_t *parser, uint16_t depth) { } } - expect1(parser, PM_TOKEN_KEYWORD_END, PM_ERR_BLOCK_TERM_END); + expect1_opening(parser, PM_TOKEN_KEYWORD_END, PM_ERR_BLOCK_TERM_END, &opening); } pm_constant_id_list_t locals; @@ -15204,7 +15220,7 @@ parse_conditional(pm_parser_t *parser, pm_context_t context, size_t opening_newl accept2(parser, PM_TOKEN_NEWLINE, PM_TOKEN_SEMICOLON); parser_warn_indentation_mismatch(parser, opening_newline_index, &else_keyword, false, false); - expect1(parser, PM_TOKEN_KEYWORD_END, PM_ERR_CONDITIONAL_TERM_ELSE); + expect1_opening(parser, PM_TOKEN_KEYWORD_END, PM_ERR_CONDITIONAL_TERM_ELSE, &keyword); pm_else_node_t *else_node = pm_else_node_create(parser, &else_keyword, else_statements, &parser->previous); @@ -15221,7 +15237,7 @@ parse_conditional(pm_parser_t *parser, pm_context_t context, size_t opening_newl } } else { parser_warn_indentation_mismatch(parser, opening_newline_index, &keyword, if_after_else, false); - expect1(parser, PM_TOKEN_KEYWORD_END, PM_ERR_CONDITIONAL_TERM); + expect1_opening(parser, PM_TOKEN_KEYWORD_END, PM_ERR_CONDITIONAL_TERM, &keyword); } // Set the appropriate end location for all of the nodes in the subtree. @@ -16202,7 +16218,7 @@ parse_pattern_constant_path(pm_parser_t *parser, pm_constant_id_list_t *captures if (!accept1(parser, PM_TOKEN_BRACKET_RIGHT)) { inner = parse_pattern(parser, captures, PM_PARSE_PATTERN_TOP | PM_PARSE_PATTERN_MULTI, PM_ERR_PATTERN_EXPRESSION_AFTER_BRACKET, (uint16_t) (depth + 1)); accept1(parser, PM_TOKEN_NEWLINE); - expect1(parser, PM_TOKEN_BRACKET_RIGHT, PM_ERR_PATTERN_TERM_BRACKET); + expect1_opening(parser, PM_TOKEN_BRACKET_RIGHT, PM_ERR_PATTERN_TERM_BRACKET, &opening); } closing = parser->previous; @@ -16214,7 +16230,7 @@ parse_pattern_constant_path(pm_parser_t *parser, pm_constant_id_list_t *captures if (!accept1(parser, PM_TOKEN_PARENTHESIS_RIGHT)) { inner = parse_pattern(parser, captures, PM_PARSE_PATTERN_TOP | PM_PARSE_PATTERN_MULTI, PM_ERR_PATTERN_EXPRESSION_AFTER_PAREN, (uint16_t) (depth + 1)); accept1(parser, PM_TOKEN_NEWLINE); - expect1(parser, PM_TOKEN_PARENTHESIS_RIGHT, PM_ERR_PATTERN_TERM_PAREN); + expect1_opening(parser, PM_TOKEN_PARENTHESIS_RIGHT, PM_ERR_PATTERN_TERM_PAREN, &opening); } closing = parser->previous; @@ -16594,7 +16610,7 @@ parse_pattern_primitive(pm_parser_t *parser, pm_constant_id_list_t *captures, pm pm_node_t *inner = parse_pattern(parser, captures, PM_PARSE_PATTERN_MULTI, PM_ERR_PATTERN_EXPRESSION_AFTER_BRACKET, (uint16_t) (depth + 1)); accept1(parser, PM_TOKEN_NEWLINE); - expect1(parser, PM_TOKEN_BRACKET_RIGHT, PM_ERR_PATTERN_TERM_BRACKET); + expect1_opening(parser, PM_TOKEN_BRACKET_RIGHT, PM_ERR_PATTERN_TERM_BRACKET, &opening); pm_token_t closing = parser->previous; switch (PM_NODE_TYPE(inner)) { @@ -16672,7 +16688,7 @@ parse_pattern_primitive(pm_parser_t *parser, pm_constant_id_list_t *captures, pm node = parse_pattern_hash(parser, captures, first_node, (uint16_t) (depth + 1)); accept1(parser, PM_TOKEN_NEWLINE); - expect1(parser, PM_TOKEN_BRACE_RIGHT, PM_ERR_PATTERN_TERM_BRACE); + expect1_opening(parser, PM_TOKEN_BRACE_RIGHT, PM_ERR_PATTERN_TERM_BRACE, &opening); pm_token_t closing = parser->previous; node->base.location.start = opening.start; @@ -16798,7 +16814,7 @@ parse_pattern_primitive(pm_parser_t *parser, pm_constant_id_list_t *captures, pm parser->pattern_matching_newlines = previous_pattern_matching_newlines; accept1(parser, PM_TOKEN_NEWLINE); - expect1(parser, PM_TOKEN_PARENTHESIS_RIGHT, PM_ERR_PATTERN_TERM_PAREN); + expect1_opening(parser, PM_TOKEN_PARENTHESIS_RIGHT, PM_ERR_PATTERN_TERM_PAREN, &lparen); return UP(pm_pinned_expression_node_create(parser, expression, &operator, &lparen, &parser->previous)); } default: { @@ -16896,7 +16912,7 @@ parse_pattern_primitives(pm_parser_t *parser, pm_constant_id_list_t *captures, p pm_node_t *body = parse_pattern(parser, captures, PM_PARSE_PATTERN_SINGLE, PM_ERR_PATTERN_EXPRESSION_AFTER_PAREN, (uint16_t) (depth + 1)); accept1(parser, PM_TOKEN_NEWLINE); - expect1(parser, PM_TOKEN_PARENTHESIS_RIGHT, PM_ERR_PATTERN_TERM_PAREN); + expect1_opening(parser, PM_TOKEN_PARENTHESIS_RIGHT, PM_ERR_PATTERN_TERM_PAREN, &opening); pm_node_t *right = UP(pm_parentheses_node_create(parser, &opening, body, &parser->previous, 0)); if (!alternation) { @@ -17748,7 +17764,8 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b pm_accepts_block_stack_push(parser, true); parser_lex(parser); - pm_hash_node_t *node = pm_hash_node_create(parser, &parser->previous); + pm_token_t opening = parser->previous; + pm_hash_node_t *node = pm_hash_node_create(parser, &opening); if (!match2(parser, PM_TOKEN_BRACE_RIGHT, PM_TOKEN_EOF)) { if (current_hash_keys != NULL) { @@ -17763,7 +17780,7 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b } pm_accepts_block_stack_pop(parser); - expect1(parser, PM_TOKEN_BRACE_RIGHT, PM_ERR_HASH_TERM); + expect1_opening(parser, PM_TOKEN_BRACE_RIGHT, PM_ERR_HASH_TERM, &opening); pm_hash_node_closing_loc_set(node, &parser->previous); return UP(node); @@ -18380,7 +18397,7 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b } parser_warn_indentation_mismatch(parser, opening_newline_index, &case_keyword, false, false); - expect1(parser, PM_TOKEN_KEYWORD_END, PM_ERR_CASE_TERM); + expect1_opening(parser, PM_TOKEN_KEYWORD_END, PM_ERR_CASE_TERM, &case_keyword); if (PM_NODE_TYPE_P(node, PM_CASE_NODE)) { pm_case_node_end_keyword_loc_set((pm_case_node_t *) node, &parser->previous); @@ -18413,7 +18430,7 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b pm_begin_node_t *begin_node = pm_begin_node_create(parser, &begin_keyword, begin_statements); parse_rescues(parser, opening_newline_index, &begin_keyword, begin_node, PM_RESCUES_BEGIN, (uint16_t) (depth + 1)); - expect1(parser, PM_TOKEN_KEYWORD_END, PM_ERR_BEGIN_TERM); + expect1_opening(parser, PM_TOKEN_KEYWORD_END, PM_ERR_BEGIN_TERM, &begin_keyword); begin_node->base.location.end = parser->previous.end; pm_begin_node_end_keyword_set(begin_node, &parser->previous); @@ -18438,7 +18455,7 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b pm_token_t opening = parser->previous; pm_statements_node_t *statements = parse_statements(parser, PM_CONTEXT_PREEXE, (uint16_t) (depth + 1)); - expect1(parser, PM_TOKEN_BRACE_RIGHT, PM_ERR_BEGIN_UPCASE_TERM); + expect1_opening(parser, PM_TOKEN_BRACE_RIGHT, PM_ERR_BEGIN_UPCASE_TERM, &opening); pm_context_t context = parser->current_context->context; if ((context != PM_CONTEXT_MAIN) && (context != PM_CONTEXT_PREEXE)) { pm_parser_err_token(parser, &keyword, PM_ERR_BEGIN_UPCASE_TOPLEVEL); @@ -18568,7 +18585,7 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b parser_warn_indentation_mismatch(parser, opening_newline_index, &class_keyword, false, false); } - expect1(parser, PM_TOKEN_KEYWORD_END, PM_ERR_CLASS_TERM); + expect1_opening(parser, PM_TOKEN_KEYWORD_END, PM_ERR_CLASS_TERM, &class_keyword); pm_constant_id_list_t locals; pm_locals_order(parser, &parser->current_scope->locals, &locals, false); @@ -18626,7 +18643,7 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b parser_warn_indentation_mismatch(parser, opening_newline_index, &class_keyword, false, false); } - expect1(parser, PM_TOKEN_KEYWORD_END, PM_ERR_CLASS_TERM); + expect1_opening(parser, PM_TOKEN_KEYWORD_END, PM_ERR_CLASS_TERM, &class_keyword); if (context_def_p(parser)) { pm_parser_err_token(parser, &class_keyword, PM_ERR_CLASS_IN_METHOD); @@ -18936,7 +18953,7 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b pm_accepts_block_stack_pop(parser); pm_do_loop_stack_pop(parser); - expect1(parser, PM_TOKEN_KEYWORD_END, PM_ERR_DEF_TERM); + expect1_opening(parser, PM_TOKEN_KEYWORD_END, PM_ERR_DEF_TERM, &def_keyword); end_keyword = parser->previous; } @@ -19030,7 +19047,7 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b pm_token_t opening = parser->previous; pm_statements_node_t *statements = parse_statements(parser, PM_CONTEXT_POSTEXE, (uint16_t) (depth + 1)); - expect1(parser, PM_TOKEN_BRACE_RIGHT, PM_ERR_END_UPCASE_TERM); + expect1_opening(parser, PM_TOKEN_BRACE_RIGHT, PM_ERR_END_UPCASE_TERM, &opening); return UP(pm_post_execution_node_create(parser, &keyword, &opening, statements, &parser->previous)); } case PM_TOKEN_KEYWORD_FALSE: @@ -19094,7 +19111,7 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b } parser_warn_indentation_mismatch(parser, opening_newline_index, &for_keyword, false, false); - expect1(parser, PM_TOKEN_KEYWORD_END, PM_ERR_FOR_TERM); + expect1_opening(parser, PM_TOKEN_KEYWORD_END, PM_ERR_FOR_TERM, &for_keyword); return UP(pm_for_node_create(parser, index, collection, statements, &for_keyword, &in_keyword, &do_keyword, &parser->previous)); } @@ -19245,7 +19262,7 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b pm_locals_order(parser, &parser->current_scope->locals, &locals, false); pm_parser_scope_pop(parser); - expect1(parser, PM_TOKEN_KEYWORD_END, PM_ERR_MODULE_TERM); + expect1_opening(parser, PM_TOKEN_KEYWORD_END, PM_ERR_MODULE_TERM, &module_keyword); if (context_def_p(parser)) { pm_parser_err_token(parser, &module_keyword, PM_ERR_MODULE_IN_METHOD); @@ -19311,7 +19328,7 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b } parser_warn_indentation_mismatch(parser, opening_newline_index, &keyword, false, false); - expect1(parser, PM_TOKEN_KEYWORD_END, PM_ERR_UNTIL_TERM); + expect1_opening(parser, PM_TOKEN_KEYWORD_END, PM_ERR_UNTIL_TERM, &keyword); return UP(pm_until_node_create(parser, &keyword, &do_keyword, &parser->previous, predicate, statements, 0)); } @@ -19345,7 +19362,7 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b } parser_warn_indentation_mismatch(parser, opening_newline_index, &keyword, false, false); - expect1(parser, PM_TOKEN_KEYWORD_END, PM_ERR_WHILE_TERM); + expect1_opening(parser, PM_TOKEN_KEYWORD_END, PM_ERR_WHILE_TERM, &keyword); return UP(pm_while_node_create(parser, &keyword, &do_keyword, &parser->previous, predicate, statements, 0)); } @@ -20091,7 +20108,7 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b } parser_warn_indentation_mismatch(parser, opening_newline_index, &operator, false, false); - expect1(parser, PM_TOKEN_BRACE_RIGHT, PM_ERR_LAMBDA_TERM_BRACE); + expect1_opening(parser, PM_TOKEN_BRACE_RIGHT, PM_ERR_LAMBDA_TERM_BRACE, &opening); } else { expect1(parser, PM_TOKEN_KEYWORD_DO, PM_ERR_LAMBDA_OPEN); opening = parser->previous; @@ -20109,7 +20126,7 @@ parse_expression_prefix(pm_parser_t *parser, pm_binding_power_t binding_power, b parser_warn_indentation_mismatch(parser, opening_newline_index, &operator, false, false); } - expect1(parser, PM_TOKEN_KEYWORD_END, PM_ERR_LAMBDA_TERM_END); + expect1_opening(parser, PM_TOKEN_KEYWORD_END, PM_ERR_LAMBDA_TERM_END, &operator); } pm_constant_id_list_t locals; diff --git a/test/prism/errors/block_beginning_with_brace_and_ending_with_end.txt b/test/prism/errors/block_beginning_with_brace_and_ending_with_end.txt index 16af8200ec..1184b38ce8 100644 --- a/test/prism/errors/block_beginning_with_brace_and_ending_with_end.txt +++ b/test/prism/errors/block_beginning_with_brace_and_ending_with_end.txt @@ -1,5 +1,5 @@ x.each { x end ^~~ unexpected 'end', expecting end-of-input ^~~ unexpected 'end', ignoring it - ^ expected a block beginning with `{` to end with `}` + ^ expected a block beginning with `{` to end with `}` diff --git a/test/prism/errors/command_calls_2.txt b/test/prism/errors/command_calls_2.txt index b0983c015b..13e10f7ebf 100644 --- a/test/prism/errors/command_calls_2.txt +++ b/test/prism/errors/command_calls_2.txt @@ -1,5 +1,5 @@ {a: b c} - ^ expected a `}` to close the hash literal +^ expected a `}` to close the hash literal ^ unexpected local variable or method, expecting end-of-input ^ unexpected '}', expecting end-of-input ^ unexpected '}', ignoring it diff --git a/test/prism/errors/command_calls_24.txt b/test/prism/errors/command_calls_24.txt index 3046b36dc1..27a32ea3bf 100644 --- a/test/prism/errors/command_calls_24.txt +++ b/test/prism/errors/command_calls_24.txt @@ -1,5 +1,5 @@ ->a=b c{} ^ expected a `do` keyword or a `{` to open the lambda block ^ unexpected end-of-input, assuming it is closing the parent top level context - ^ expected a lambda block beginning with `do` to end with `end` +^~ expected a lambda block beginning with `do` to end with `end` diff --git a/test/prism/errors/command_calls_25.txt b/test/prism/errors/command_calls_25.txt index 5fddd90fdd..cf04508f87 100644 --- a/test/prism/errors/command_calls_25.txt +++ b/test/prism/errors/command_calls_25.txt @@ -4,5 +4,5 @@ ^ unexpected ')', expecting end-of-input ^ unexpected ')', ignoring it ^ unexpected end-of-input, assuming it is closing the parent top level context - ^ expected a lambda block beginning with `do` to end with `end` +^~ expected a lambda block beginning with `do` to end with `end` diff --git a/test/prism/errors/heredoc_unterminated.txt b/test/prism/errors/heredoc_unterminated.txt index 3c6aeaeb81..56bd162998 100644 --- a/test/prism/errors/heredoc_unterminated.txt +++ b/test/prism/errors/heredoc_unterminated.txt @@ -3,7 +3,7 @@ a=>{< 1 } ^ unexpected '.'; expected a value in the hash literal - ^ expected a `}` to close the hash literal +^ expected a `}` to close the hash literal ^ unexpected '}', expecting end-of-input ^ unexpected '}', ignoring it diff --git a/test/prism/errors/label_in_interpolated_string.txt b/test/prism/errors/label_in_interpolated_string.txt index e8f40dd2a8..29af5310a1 100644 --- a/test/prism/errors/label_in_interpolated_string.txt +++ b/test/prism/errors/label_in_interpolated_string.txt @@ -2,6 +2,7 @@ case in el""Q ^~~~ expected a predicate for a case matching statement ^ expected a delimiter after the patterns of an `in` clause ^ unexpected constant, expecting end-of-input +^~~~ expected an `end` to close the `case` statement !"""#{in el"":Q ^~ unexpected 'in', assuming it is closing the parent 'in' clause ^ expected a `}` to close the embedded expression @@ -10,5 +11,4 @@ case in el""Q ^ cannot parse the string part ^~~~~~~~~~~ unexpected label ^~~~~~~~~~~ expected a string for concatenation - ^ expected an `end` to close the `case` statement diff --git a/test/prism/errors/pattern_string_key.txt b/test/prism/errors/pattern_string_key.txt index 9f28feddb9..41bc1fa57b 100644 --- a/test/prism/errors/pattern_string_key.txt +++ b/test/prism/errors/pattern_string_key.txt @@ -1,8 +1,8 @@ case:a +^~~~ expected an `end` to close the `case` statement in b:"","#{}" ^~~~~ expected a label after the `,` in the hash pattern ^ expected a pattern expression after the key ^ expected a delimiter after the patterns of an `in` clause ^ unexpected end-of-input, assuming it is closing the parent top level context - ^ expected an `end` to close the `case` statement diff --git a/test/prism/errors/shadow_args_in_lambda.txt b/test/prism/errors/shadow_args_in_lambda.txt index 2399a0ebd5..7fc78d7d8f 100644 --- a/test/prism/errors/shadow_args_in_lambda.txt +++ b/test/prism/errors/shadow_args_in_lambda.txt @@ -1,5 +1,5 @@ ->a;b{} ^ expected a `do` keyword or a `{` to open the lambda block ^ unexpected end-of-input, assuming it is closing the parent top level context - ^ expected a lambda block beginning with `do` to end with `end` +^~ expected a lambda block beginning with `do` to end with `end` diff --git a/test/prism/errors/unterminated_begin.txt b/test/prism/errors/unterminated_begin.txt index 6217f80a0b..2733f830c9 100644 --- a/test/prism/errors/unterminated_begin.txt +++ b/test/prism/errors/unterminated_begin.txt @@ -1,4 +1,4 @@ begin ^ unexpected end-of-input, assuming it is closing the parent top level context - ^ expected an `end` to close the `begin` statement +^~~~~ expected an `end` to close the `begin` statement diff --git a/test/prism/errors/unterminated_begin_upcase.txt b/test/prism/errors/unterminated_begin_upcase.txt index 92b975bf76..5512f2089e 100644 --- a/test/prism/errors/unterminated_begin_upcase.txt +++ b/test/prism/errors/unterminated_begin_upcase.txt @@ -1,4 +1,4 @@ BEGIN { ^ unexpected end-of-input, assuming it is closing the parent top level context - ^ expected a `}` to close the `BEGIN` statement + ^ expected a `}` to close the `BEGIN` statement diff --git a/test/prism/errors/unterminated_block.txt b/test/prism/errors/unterminated_block.txt index 8cc772db16..db6a4aa56c 100644 --- a/test/prism/errors/unterminated_block.txt +++ b/test/prism/errors/unterminated_block.txt @@ -1,4 +1,4 @@ foo { ^ unexpected end-of-input, assuming it is closing the parent top level context - ^ expected a block beginning with `{` to end with `}` + ^ expected a block beginning with `{` to end with `}` diff --git a/test/prism/errors/unterminated_block_do_end.txt b/test/prism/errors/unterminated_block_do_end.txt index fb7ca53d6a..0b7c64965f 100644 --- a/test/prism/errors/unterminated_block_do_end.txt +++ b/test/prism/errors/unterminated_block_do_end.txt @@ -1,4 +1,4 @@ foo do ^ unexpected end-of-input, assuming it is closing the parent top level context - ^ expected a block beginning with `do` to end with `end` + ^~ expected a block beginning with `do` to end with `end` diff --git a/test/prism/errors/unterminated_class.txt b/test/prism/errors/unterminated_class.txt index ea80ab8fc7..f47a3aa7df 100644 --- a/test/prism/errors/unterminated_class.txt +++ b/test/prism/errors/unterminated_class.txt @@ -1,4 +1,4 @@ class Foo ^ unexpected end-of-input, assuming it is closing the parent top level context - ^ expected an `end` to close the `class` statement +^~~~~ expected an `end` to close the `class` statement diff --git a/test/prism/errors/unterminated_def.txt b/test/prism/errors/unterminated_def.txt index 83ec939fea..a6212e3a21 100644 --- a/test/prism/errors/unterminated_def.txt +++ b/test/prism/errors/unterminated_def.txt @@ -1,5 +1,5 @@ def foo ^ expected a delimiter to close the parameters ^ unexpected end-of-input, assuming it is closing the parent top level context - ^ expected an `end` to close the `def` statement +^~~ expected an `end` to close the `def` statement diff --git a/test/prism/errors/unterminated_end_upcase.txt b/test/prism/errors/unterminated_end_upcase.txt index 42ccd22bd5..ef01caa0ca 100644 --- a/test/prism/errors/unterminated_end_upcase.txt +++ b/test/prism/errors/unterminated_end_upcase.txt @@ -1,4 +1,4 @@ END { ^ unexpected end-of-input, assuming it is closing the parent top level context - ^ expected a `}` to close the `END` statement + ^ expected a `}` to close the `END` statement diff --git a/test/prism/errors/unterminated_for.txt b/test/prism/errors/unterminated_for.txt index cbd17f0b84..75978a7cae 100644 --- a/test/prism/errors/unterminated_for.txt +++ b/test/prism/errors/unterminated_for.txt @@ -1,5 +1,5 @@ for x in y ^ unexpected end-of-input; expected a 'do', newline, or ';' after the 'for' loop collection ^ unexpected end-of-input, assuming it is closing the parent top level context - ^ expected an `end` to close the `for` loop +^~~ expected an `end` to close the `for` loop diff --git a/test/prism/errors/unterminated_if.txt b/test/prism/errors/unterminated_if.txt index 559a006022..1697931773 100644 --- a/test/prism/errors/unterminated_if.txt +++ b/test/prism/errors/unterminated_if.txt @@ -1,5 +1,5 @@ if true ^ expected `then` or `;` or '\n' ^ unexpected end-of-input, assuming it is closing the parent top level context - ^ expected an `end` to close the conditional clause +^~ expected an `end` to close the conditional clause diff --git a/test/prism/errors/unterminated_if_else.txt b/test/prism/errors/unterminated_if_else.txt index 35a181e844..db7828cce8 100644 --- a/test/prism/errors/unterminated_if_else.txt +++ b/test/prism/errors/unterminated_if_else.txt @@ -1,5 +1,5 @@ if true +^~ expected an `end` to close the `else` clause else ^ unexpected end-of-input, assuming it is closing the parent top level context - ^ expected an `end` to close the `else` clause diff --git a/test/prism/errors/unterminated_lambda_brace.txt b/test/prism/errors/unterminated_lambda_brace.txt index bb8c1090ab..75474c7534 100644 --- a/test/prism/errors/unterminated_lambda_brace.txt +++ b/test/prism/errors/unterminated_lambda_brace.txt @@ -1,4 +1,4 @@ -> { ^ unexpected end-of-input, assuming it is closing the parent top level context - ^ expected a lambda block beginning with `{` to end with `}` + ^ expected a lambda block beginning with `{` to end with `}` diff --git a/test/prism/errors/unterminated_module.txt b/test/prism/errors/unterminated_module.txt index cf207c06a7..4c50ba5f63 100644 --- a/test/prism/errors/unterminated_module.txt +++ b/test/prism/errors/unterminated_module.txt @@ -1,4 +1,4 @@ module Foo ^ unexpected end-of-input, assuming it is closing the parent top level context - ^ expected an `end` to close the `module` statement +^~~~~~ expected an `end` to close the `module` statement diff --git a/test/prism/errors/unterminated_pattern_bracket.txt b/test/prism/errors/unterminated_pattern_bracket.txt index cc2630f8e9..4f35cd84af 100644 --- a/test/prism/errors/unterminated_pattern_bracket.txt +++ b/test/prism/errors/unterminated_pattern_bracket.txt @@ -1,7 +1,7 @@ case x +^~~~ expected an `end` to close the `case` statement in [1 - ^ expected a `]` to close the pattern expression + ^ expected a `]` to close the pattern expression ^ expected a delimiter after the patterns of an `in` clause ^ unexpected end-of-input, assuming it is closing the parent top level context - ^ expected an `end` to close the `case` statement diff --git a/test/prism/errors/unterminated_pattern_paren.txt b/test/prism/errors/unterminated_pattern_paren.txt index 162a128546..426d614e61 100644 --- a/test/prism/errors/unterminated_pattern_paren.txt +++ b/test/prism/errors/unterminated_pattern_paren.txt @@ -1,7 +1,7 @@ case x +^~~~ expected an `end` to close the `case` statement in (1 - ^ expected a `)` to close the pattern expression + ^ expected a `)` to close the pattern expression ^ expected a delimiter after the patterns of an `in` clause ^ unexpected end-of-input, assuming it is closing the parent top level context - ^ expected an `end` to close the `case` statement diff --git a/test/prism/errors/unterminated_until.txt b/test/prism/errors/unterminated_until.txt index b9d7eee40f..42a0545200 100644 --- a/test/prism/errors/unterminated_until.txt +++ b/test/prism/errors/unterminated_until.txt @@ -1,5 +1,5 @@ until true ^ expected a predicate expression for the `until` statement ^ unexpected end-of-input, assuming it is closing the parent top level context - ^ expected an `end` to close the `until` statement +^~~~~ expected an `end` to close the `until` statement diff --git a/test/prism/errors/while_endless_method.txt b/test/prism/errors/while_endless_method.txt index 6f062d89d0..cdd7ba9aba 100644 --- a/test/prism/errors/while_endless_method.txt +++ b/test/prism/errors/while_endless_method.txt @@ -1,5 +1,5 @@ while def f = g do end ^ expected a predicate expression for the `while` statement ^ unexpected end-of-input, assuming it is closing the parent top level context - ^ expected an `end` to close the `while` statement +^~~~~ expected an `end` to close the `while` statement From 2b9fd2b6f3cdfe5cdbe83a7a79278f8f30cbf804 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 29 Dec 2025 16:30:15 +0000 Subject: [PATCH 291/333] Bump the ruby-deps group across 10 directories with 3 updates Bumps the ruby-deps group with 1 update in the /gemfiles/2.7 directory: [test-unit](https://github.com/test-unit/test-unit). Bumps the ruby-deps group with 1 update in the /gemfiles/3.0 directory: [test-unit](https://github.com/test-unit/test-unit). Bumps the ruby-deps group with 2 updates in the /gemfiles/3.1 directory: [rbs](https://github.com/ruby/rbs) and [test-unit](https://github.com/test-unit/test-unit). Bumps the ruby-deps group with 2 updates in the /gemfiles/3.2 directory: [rbs](https://github.com/ruby/rbs) and [test-unit](https://github.com/test-unit/test-unit). Bumps the ruby-deps group with 2 updates in the /gemfiles/3.3 directory: [rbs](https://github.com/ruby/rbs) and [test-unit](https://github.com/test-unit/test-unit). Bumps the ruby-deps group with 2 updates in the /gemfiles/3.4 directory: [rbs](https://github.com/ruby/rbs) and [test-unit](https://github.com/test-unit/test-unit). Bumps the ruby-deps group with 2 updates in the /gemfiles/4.0 directory: [rbs](https://github.com/ruby/rbs) and [test-unit](https://github.com/test-unit/test-unit). Bumps the ruby-deps group with 1 update in the /gemfiles/jruby directory: [test-unit](https://github.com/test-unit/test-unit). Bumps the ruby-deps group with 1 update in the /gemfiles/truffleruby directory: [test-unit](https://github.com/test-unit/test-unit). Bumps the ruby-deps group with 3 updates in the /gemfiles/typecheck directory: [rbs](https://github.com/ruby/rbs), [test-unit](https://github.com/test-unit/test-unit) and [minitest](https://github.com/minitest/minitest). Updates `test-unit` from 3.7.3 to 3.7.6 - [Release notes](https://github.com/test-unit/test-unit/releases) - [Commits](https://github.com/test-unit/test-unit/compare/3.7.3...3.7.6) Updates `test-unit` from 3.7.3 to 3.7.6 - [Release notes](https://github.com/test-unit/test-unit/releases) - [Commits](https://github.com/test-unit/test-unit/compare/3.7.3...3.7.6) Updates `rbs` from 3.9.5 to 3.10.0 - [Release notes](https://github.com/ruby/rbs/releases) - [Changelog](https://github.com/ruby/rbs/blob/master/CHANGELOG.md) - [Commits](https://github.com/ruby/rbs/compare/v3.9.5...v3.10.0) Updates `test-unit` from 3.7.3 to 3.7.6 - [Release notes](https://github.com/test-unit/test-unit/releases) - [Commits](https://github.com/test-unit/test-unit/compare/3.7.3...3.7.6) Updates `rbs` from 3.9.5 to 3.10.0 - [Release notes](https://github.com/ruby/rbs/releases) - [Changelog](https://github.com/ruby/rbs/blob/master/CHANGELOG.md) - [Commits](https://github.com/ruby/rbs/compare/v3.9.5...v3.10.0) Updates `test-unit` from 3.7.3 to 3.7.6 - [Release notes](https://github.com/test-unit/test-unit/releases) - [Commits](https://github.com/test-unit/test-unit/compare/3.7.3...3.7.6) Updates `rbs` from 3.9.5 to 3.10.0 - [Release notes](https://github.com/ruby/rbs/releases) - [Changelog](https://github.com/ruby/rbs/blob/master/CHANGELOG.md) - [Commits](https://github.com/ruby/rbs/compare/v3.9.5...v3.10.0) Updates `test-unit` from 3.7.3 to 3.7.6 - [Release notes](https://github.com/test-unit/test-unit/releases) - [Commits](https://github.com/test-unit/test-unit/compare/3.7.3...3.7.6) Updates `rbs` from 3.9.5 to 3.10.0 - [Release notes](https://github.com/ruby/rbs/releases) - [Changelog](https://github.com/ruby/rbs/blob/master/CHANGELOG.md) - [Commits](https://github.com/ruby/rbs/compare/v3.9.5...v3.10.0) Updates `test-unit` from 3.7.3 to 3.7.6 - [Release notes](https://github.com/test-unit/test-unit/releases) - [Commits](https://github.com/test-unit/test-unit/compare/3.7.3...3.7.6) Updates `rbs` from 3.9.5 to 3.10.0 - [Release notes](https://github.com/ruby/rbs/releases) - [Changelog](https://github.com/ruby/rbs/blob/master/CHANGELOG.md) - [Commits](https://github.com/ruby/rbs/compare/v3.9.5...v3.10.0) Updates `test-unit` from 3.7.3 to 3.7.6 - [Release notes](https://github.com/test-unit/test-unit/releases) - [Commits](https://github.com/test-unit/test-unit/compare/3.7.3...3.7.6) Updates `test-unit` from 3.7.3 to 3.7.6 - [Release notes](https://github.com/test-unit/test-unit/releases) - [Commits](https://github.com/test-unit/test-unit/compare/3.7.3...3.7.6) Updates `test-unit` from 3.7.3 to 3.7.6 - [Release notes](https://github.com/test-unit/test-unit/releases) - [Commits](https://github.com/test-unit/test-unit/compare/3.7.3...3.7.6) Updates `rbs` from 3.9.5 to 3.10.0 - [Release notes](https://github.com/ruby/rbs/releases) - [Changelog](https://github.com/ruby/rbs/blob/master/CHANGELOG.md) - [Commits](https://github.com/ruby/rbs/compare/v3.9.5...v3.10.0) Updates `test-unit` from 3.7.3 to 3.7.6 - [Release notes](https://github.com/test-unit/test-unit/releases) - [Commits](https://github.com/test-unit/test-unit/compare/3.7.3...3.7.6) Updates `minitest` from 6.0.0 to 6.0.1 - [Changelog](https://github.com/minitest/minitest/blob/master/History.rdoc) - [Commits](https://github.com/minitest/minitest/compare/v6.0.0...v6.0.1) --- updated-dependencies: - dependency-name: test-unit dependency-version: 3.7.6 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps - dependency-name: test-unit dependency-version: 3.7.6 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps - dependency-name: rbs dependency-version: 3.10.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: test-unit dependency-version: 3.7.6 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps - dependency-name: rbs dependency-version: 3.10.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: test-unit dependency-version: 3.7.6 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps - dependency-name: rbs dependency-version: 3.10.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: test-unit dependency-version: 3.7.6 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps - dependency-name: rbs dependency-version: 3.10.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: test-unit dependency-version: 3.7.6 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps - dependency-name: rbs dependency-version: 3.10.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: test-unit dependency-version: 3.7.6 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps - dependency-name: test-unit dependency-version: 3.7.6 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps - dependency-name: test-unit dependency-version: 3.7.6 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps - dependency-name: rbs dependency-version: 3.10.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: ruby-deps - dependency-name: test-unit dependency-version: 3.7.6 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps - dependency-name: minitest dependency-version: 6.0.1 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps ... Signed-off-by: dependabot[bot] --- gemfiles/2.7/Gemfile.lock | 2 +- gemfiles/3.0/Gemfile.lock | 2 +- gemfiles/3.1/Gemfile.lock | 4 ++-- gemfiles/3.2/Gemfile.lock | 4 ++-- gemfiles/3.3/Gemfile.lock | 4 ++-- gemfiles/3.4/Gemfile.lock | 4 ++-- gemfiles/4.0/Gemfile.lock | 4 ++-- gemfiles/jruby/Gemfile.lock | 2 +- gemfiles/truffleruby/Gemfile.lock | 2 +- gemfiles/typecheck/Gemfile.lock | 8 ++++---- 10 files changed, 18 insertions(+), 18 deletions(-) diff --git a/gemfiles/2.7/Gemfile.lock b/gemfiles/2.7/Gemfile.lock index 955846d5da..3e2658ee26 100644 --- a/gemfiles/2.7/Gemfile.lock +++ b/gemfiles/2.7/Gemfile.lock @@ -21,7 +21,7 @@ GEM racc (~> 1.5) sexp_processor (~> 4.16) sexp_processor (4.17.4) - test-unit (3.7.3) + test-unit (3.7.6) power_assert PLATFORMS diff --git a/gemfiles/3.0/Gemfile.lock b/gemfiles/3.0/Gemfile.lock index b39a99d8b8..ee7a9c5f00 100644 --- a/gemfiles/3.0/Gemfile.lock +++ b/gemfiles/3.0/Gemfile.lock @@ -29,7 +29,7 @@ GEM racc (~> 1.5) sexp_processor (~> 4.16) sexp_processor (4.17.4) - test-unit (3.7.3) + test-unit (3.7.6) power_assert PLATFORMS diff --git a/gemfiles/3.1/Gemfile.lock b/gemfiles/3.1/Gemfile.lock index 862669bf7d..e6d2276f12 100644 --- a/gemfiles/3.1/Gemfile.lock +++ b/gemfiles/3.1/Gemfile.lock @@ -21,7 +21,7 @@ GEM rake (13.3.1) rake-compiler (1.3.1) rake - rbs (3.9.5) + rbs (3.10.0) logger ruby_memcheck (3.0.1) nokogiri @@ -29,7 +29,7 @@ GEM racc (~> 1.5) sexp_processor (~> 4.16) sexp_processor (4.17.4) - test-unit (3.7.3) + test-unit (3.7.6) power_assert PLATFORMS diff --git a/gemfiles/3.2/Gemfile.lock b/gemfiles/3.2/Gemfile.lock index a3d7698007..390d045dd9 100644 --- a/gemfiles/3.2/Gemfile.lock +++ b/gemfiles/3.2/Gemfile.lock @@ -21,7 +21,7 @@ GEM rake (13.3.1) rake-compiler (1.3.1) rake - rbs (3.9.5) + rbs (3.10.0) logger ruby_memcheck (3.0.1) nokogiri @@ -29,7 +29,7 @@ GEM racc (~> 1.5) sexp_processor (~> 4.16) sexp_processor (4.17.4) - test-unit (3.7.3) + test-unit (3.7.6) power_assert PLATFORMS diff --git a/gemfiles/3.3/Gemfile.lock b/gemfiles/3.3/Gemfile.lock index 5bb7cd4119..e55992a8af 100644 --- a/gemfiles/3.3/Gemfile.lock +++ b/gemfiles/3.3/Gemfile.lock @@ -21,7 +21,7 @@ GEM rake (13.3.1) rake-compiler (1.3.1) rake - rbs (3.9.5) + rbs (3.10.0) logger ruby_memcheck (3.0.1) nokogiri @@ -29,7 +29,7 @@ GEM racc (~> 1.5) sexp_processor (~> 4.16) sexp_processor (4.17.4) - test-unit (3.7.3) + test-unit (3.7.6) power_assert PLATFORMS diff --git a/gemfiles/3.4/Gemfile.lock b/gemfiles/3.4/Gemfile.lock index 36c52c963d..1076f302f2 100644 --- a/gemfiles/3.4/Gemfile.lock +++ b/gemfiles/3.4/Gemfile.lock @@ -21,7 +21,7 @@ GEM rake (13.3.1) rake-compiler (1.3.1) rake - rbs (3.9.5) + rbs (3.10.0) logger ruby_memcheck (3.0.1) nokogiri @@ -29,7 +29,7 @@ GEM racc (~> 1.5) sexp_processor (~> 4.16) sexp_processor (4.17.4) - test-unit (3.7.3) + test-unit (3.7.6) power_assert PLATFORMS diff --git a/gemfiles/4.0/Gemfile.lock b/gemfiles/4.0/Gemfile.lock index f98d9d054b..1b7e4431e8 100644 --- a/gemfiles/4.0/Gemfile.lock +++ b/gemfiles/4.0/Gemfile.lock @@ -22,7 +22,7 @@ GEM rake (13.3.1) rake-compiler (1.3.1) rake - rbs (3.9.5) + rbs (3.10.0) logger ruby_memcheck (3.0.1) nokogiri @@ -30,7 +30,7 @@ GEM racc (~> 1.5) sexp_processor (~> 4.16) sexp_processor (4.17.4) - test-unit (3.7.3) + test-unit (3.7.6) power_assert PLATFORMS diff --git a/gemfiles/jruby/Gemfile.lock b/gemfiles/jruby/Gemfile.lock index c49a7c8512..d253f0f578 100644 --- a/gemfiles/jruby/Gemfile.lock +++ b/gemfiles/jruby/Gemfile.lock @@ -20,7 +20,7 @@ GEM racc (~> 1.5) sexp_processor (~> 4.16) sexp_processor (4.17.4) - test-unit (3.7.3) + test-unit (3.7.6) power_assert PLATFORMS diff --git a/gemfiles/truffleruby/Gemfile.lock b/gemfiles/truffleruby/Gemfile.lock index 17b62c0cae..a83d7dfe8b 100644 --- a/gemfiles/truffleruby/Gemfile.lock +++ b/gemfiles/truffleruby/Gemfile.lock @@ -19,7 +19,7 @@ GEM racc (~> 1.5) sexp_processor (~> 4.16) sexp_processor (4.17.4) - test-unit (3.7.3) + test-unit (3.7.6) power_assert PLATFORMS diff --git a/gemfiles/typecheck/Gemfile.lock b/gemfiles/typecheck/Gemfile.lock index 2d0baa55ae..a7440d3425 100644 --- a/gemfiles/typecheck/Gemfile.lock +++ b/gemfiles/typecheck/Gemfile.lock @@ -34,7 +34,7 @@ GEM rb-fsevent (~> 0.10, >= 0.10.3) rb-inotify (~> 0.9, >= 0.9.10) logger (1.7.0) - minitest (6.0.0) + minitest (6.0.1) prism (~> 1.5) mutex_m (0.3.0) netrc (0.11.0) @@ -43,7 +43,7 @@ GEM ast (~> 2.4.1) racc power_assert (3.0.1) - prism (1.6.0) + prism (1.7.0) racc (1.8.1) rainbow (3.1.1) rake (13.3.1) @@ -55,7 +55,7 @@ GEM rbi (0.3.7) prism (~> 1.0) rbs (>= 3.4.4) - rbs (3.9.5) + rbs (3.10.0) logger rexml (3.4.4) ruby_parser (3.22.0) @@ -108,7 +108,7 @@ GEM yard-sorbet terminal-table (4.0.0) unicode-display_width (>= 1.1.1, < 4) - test-unit (3.7.3) + test-unit (3.7.6) power_assert thor (1.4.0) tzinfo (2.0.6) From 1974b3aea47b77362f357f776d66d10ec3a722a8 Mon Sep 17 00:00:00 2001 From: Earlopain <14981592+Earlopain@users.noreply.github.com> Date: Wed, 31 Dec 2025 12:17:10 +0100 Subject: [PATCH 292/333] Update dependencies/Fix CI/Add Ruby 4.1 --- .github/dependabot.yml | 1 + .github/workflows/main.yml | 11 +++++--- Gemfile.lock | 28 +++++++++---------- bin/prism | 1 + docs/releasing.md | 4 +-- gemfiles/3.2/Gemfile.lock | 6 ++--- gemfiles/3.3/Gemfile.lock | 4 +-- gemfiles/3.4/Gemfile.lock | 4 +-- gemfiles/4.0/Gemfile | 2 +- gemfiles/4.0/Gemfile.lock | 10 +++---- gemfiles/4.1/Gemfile | 17 ++++++++++++ gemfiles/4.1/Gemfile.lock | 55 ++++++++++++++++++++++++++++++++++++++ 12 files changed, 110 insertions(+), 33 deletions(-) create mode 100644 gemfiles/4.1/Gemfile create mode 100644 gemfiles/4.1/Gemfile.lock diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 8ea06081e2..1b499e783c 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -25,6 +25,7 @@ updates: - '/gemfiles/3.3' - '/gemfiles/3.4' - '/gemfiles/4.0' + - '/gemfiles/4.1' - '/gemfiles/jruby' - '/gemfiles/truffleruby' - '/gemfiles/typecheck' diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2035b05b93..c257cf0d15 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -104,7 +104,7 @@ jobs: fail-fast: false matrix: target: - - { ruby: "head", gemfile: "4.0" } + - { ruby: "head", gemfile: "4.1" } - { ruby: "jruby-10.0.0.0", gemfile: "jruby" } # https://github.com/jruby/jruby/issues/8923 - { ruby: "truffleruby", gemfile: "truffleruby" } runs-on: ubuntu-latest @@ -275,7 +275,8 @@ jobs: - { ruby: "3.2", os: "ubuntu-latest", gemfile: "3.2" } - { ruby: "3.3", os: "ubuntu-latest", gemfile: "3.3" } - { ruby: "3.4", os: "ubuntu-latest", gemfile: "3.4" } - - { ruby: "head", os: "ubuntu-latest", gemfile: "4.0" } + - { ruby: "4.0", os: "ubuntu-latest", gemfile: "4.0" } + - { ruby: "head", os: "ubuntu-latest", gemfile: "4.1" } - { ruby: "jruby-10.0.0.0", os: "ubuntu-latest", gemfile: "jruby" } # https://github.com/jruby/jruby/issues/8923 - { ruby: "truffleruby", os: "ubuntu-latest", gemfile: "truffleruby" } @@ -285,7 +286,8 @@ jobs: - { ruby: "3.2", os: "macos-latest", gemfile: "3.2" } - { ruby: "3.3", os: "macos-latest", gemfile: "3.3" } - { ruby: "3.4", os: "macos-latest", gemfile: "3.4" } - - { ruby: "head", os: "macos-latest", gemfile: "4.0" } + - { ruby: "4.0", os: "macos-latest", gemfile: "4.0" } + - { ruby: "head", os: "macos-latest", gemfile: "4.1" } - { ruby: "jruby-10.0.0.0", os: "macos-latest", gemfile: "jruby" } # https://github.com/jruby/jruby/issues/8923 - { ruby: "truffleruby", os: "macos-latest", gemfile: "truffleruby" } @@ -295,7 +297,8 @@ jobs: - { ruby: "3.2", os: "windows-latest", gemfile: "3.2" } - { ruby: "3.3", os: "windows-latest", gemfile: "3.3" } - { ruby: "3.4", os: "windows-latest", gemfile: "3.4" } - - { ruby: "head", os: "windows-latest", gemfile: "4.0" } + - { ruby: "4.0", os: "windows-latest", gemfile: "4.0" } + # - { ruby: "head", os: "windows-latest", gemfile: "4.1" } TODO: No windows build yet - { ruby: "jruby-10.0.0.0", os: "windows-latest", gemfile: "jruby" } # https://github.com/jruby/jruby/issues/8923 env: BUNDLE_GEMFILE: gemfiles/${{ matrix.target.gemfile }}/Gemfile diff --git a/Gemfile.lock b/Gemfile.lock index 32f4de5b98..13cb8198a7 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -8,37 +8,37 @@ GEM specs: ast (2.4.3) benchmark-ips (2.14.0) - date (3.4.1) - erb (5.1.1) - ffi (1.17.2) + date (3.5.1) + erb (6.0.1) + ffi (1.17.3) mini_portile2 (2.8.9) - nokogiri (1.18.10) + nokogiri (1.19.0) mini_portile2 (~> 2.8.2) racc (~> 1.4) onigmo (0.1.0) - parser (3.3.9.0) + parser (3.3.10.0) ast (~> 2.4.1) racc - power_assert (2.0.5) - psych (5.2.6) + power_assert (3.0.1) + psych (5.3.1) date stringio racc (1.8.1) - rake (13.3.0) - rake-compiler (1.3.0) + rake (13.3.1) + rake-compiler (1.3.1) rake - rdoc (6.15.0) + rdoc (7.0.3) erb psych (>= 4.0.0) tsort ruby_memcheck (3.0.1) nokogiri - ruby_parser (3.21.1) + ruby_parser (3.22.0) racc (~> 1.5) sexp_processor (~> 4.16) - sexp_processor (4.17.4) - stringio (3.1.7) - test-unit (3.7.0) + sexp_processor (4.17.5) + stringio (3.2.0) + test-unit (3.7.6) power_assert tsort (0.2.0) diff --git a/bin/prism b/bin/prism index b6301b3dd9..7d8e97fb46 100755 --- a/bin/prism +++ b/bin/prism @@ -100,6 +100,7 @@ module Prism ["3.3", ["3.3"]], ["3.4", ["3.4", "typecheck"]], ["4.0", ["4.0"]], + ["4.1", ["4.1"]], ["jruby", ["jruby"]], ["truffleruby", ["truffleruby"]] ].each do |ruby_version, gemfiles| diff --git a/docs/releasing.md b/docs/releasing.md index 4af8ea847c..0853c2f853 100644 --- a/docs/releasing.md +++ b/docs/releasing.md @@ -47,8 +47,8 @@ bundle install * Update the version-specific lockfiles: ```sh -for VERSION in "2.7" "3.0" "3.1" "3.2" "3.3" "3.4"; do docker run -it --rm -v "$PWD":/usr/src/app -w /usr/src/app -e BUNDLE_GEMFILE="gemfiles/$VERSION/Gemfile" "ruby:$VERSION" bundle update; done -docker run -it --rm -v "$PWD":/usr/src/app -w /usr/src/app -e BUNDLE_GEMFILE="gemfiles/4.0/Gemfile" ruby:4.0.0-preview2 bundle update +for VERSION in "2.7" "3.0" "3.1" "3.2" "3.3" "3.4" "4.0"; do docker run -it --rm -v "$PWD":/usr/src/app -w /usr/src/app -e BUNDLE_GEMFILE="gemfiles/$VERSION/Gemfile" "ruby:$VERSION" bundle update; done +chruby ruby-4.1.0-dev && BUNDLE_GEMFILE=gemfiles/4.1/Gemfile bundle install docker run -it --rm -v "$PWD":/usr/src/app -w /usr/src/app -e BUNDLE_GEMFILE="gemfiles/jruby/Gemfile" jruby:latest bundle update BUNDLE_GEMFILE=gemfiles/truffleruby/Gemfile chruby-exec truffleruby -- bundle update ``` diff --git a/gemfiles/3.2/Gemfile.lock b/gemfiles/3.2/Gemfile.lock index 390d045dd9..84574fd28b 100644 --- a/gemfiles/3.2/Gemfile.lock +++ b/gemfiles/3.2/Gemfile.lock @@ -9,7 +9,7 @@ GEM ast (2.4.3) logger (1.7.0) mini_portile2 (2.8.9) - nokogiri (1.18.10) + nokogiri (1.19.0) mini_portile2 (~> 2.8.2) racc (~> 1.4) onigmo (0.1.0) @@ -28,7 +28,7 @@ GEM ruby_parser (3.22.0) racc (~> 1.5) sexp_processor (~> 4.16) - sexp_processor (4.17.4) + sexp_processor (4.17.5) test-unit (3.7.6) power_assert @@ -50,4 +50,4 @@ RUBY VERSION ruby 3.2.3p157 BUNDLED WITH - 2.4.19 + 2.6.2 diff --git a/gemfiles/3.3/Gemfile.lock b/gemfiles/3.3/Gemfile.lock index e55992a8af..b7fbf11c47 100644 --- a/gemfiles/3.3/Gemfile.lock +++ b/gemfiles/3.3/Gemfile.lock @@ -9,7 +9,7 @@ GEM ast (2.4.3) logger (1.7.0) mini_portile2 (2.8.9) - nokogiri (1.18.10) + nokogiri (1.19.0) mini_portile2 (~> 2.8.2) racc (~> 1.4) onigmo (0.1.0) @@ -28,7 +28,7 @@ GEM ruby_parser (3.22.0) racc (~> 1.5) sexp_processor (~> 4.16) - sexp_processor (4.17.4) + sexp_processor (4.17.5) test-unit (3.7.6) power_assert diff --git a/gemfiles/3.4/Gemfile.lock b/gemfiles/3.4/Gemfile.lock index 1076f302f2..7f3d61f323 100644 --- a/gemfiles/3.4/Gemfile.lock +++ b/gemfiles/3.4/Gemfile.lock @@ -9,7 +9,7 @@ GEM ast (2.4.3) logger (1.7.0) mini_portile2 (2.8.9) - nokogiri (1.18.10) + nokogiri (1.19.0) mini_portile2 (~> 2.8.2) racc (~> 1.4) onigmo (0.1.0) @@ -28,7 +28,7 @@ GEM ruby_parser (3.22.0) racc (~> 1.5) sexp_processor (~> 4.16) - sexp_processor (4.17.4) + sexp_processor (4.17.5) test-unit (3.7.6) power_assert diff --git a/gemfiles/4.0/Gemfile b/gemfiles/4.0/Gemfile index 85fde92128..f3fef38fe8 100644 --- a/gemfiles/4.0/Gemfile +++ b/gemfiles/4.0/Gemfile @@ -2,7 +2,7 @@ source "https://rubygems.org" -ruby ">= 3.5.0.dev" +ruby "~> 4.0.0" gemspec path: "../.." diff --git a/gemfiles/4.0/Gemfile.lock b/gemfiles/4.0/Gemfile.lock index 1b7e4431e8..1c4da8061c 100644 --- a/gemfiles/4.0/Gemfile.lock +++ b/gemfiles/4.0/Gemfile.lock @@ -7,10 +7,10 @@ GEM remote: https://rubygems.org/ specs: ast (2.4.3) - ffi (1.17.2) + ffi (1.17.3) logger (1.7.0) mini_portile2 (2.8.9) - nokogiri (1.18.10) + nokogiri (1.19.0) mini_portile2 (~> 2.8.2) racc (~> 1.4) onigmo (0.1.0) @@ -29,7 +29,7 @@ GEM ruby_parser (3.22.0) racc (~> 1.5) sexp_processor (~> 4.16) - sexp_processor (4.17.4) + sexp_processor (4.17.5) test-unit (3.7.6) power_assert @@ -49,7 +49,7 @@ DEPENDENCIES test-unit RUBY VERSION - ruby 3.5.0.dev + ruby 4.0.0 BUNDLED WITH - 4.0.0.dev + 4.0.3 diff --git a/gemfiles/4.1/Gemfile b/gemfiles/4.1/Gemfile new file mode 100644 index 0000000000..3fde9d4ac1 --- /dev/null +++ b/gemfiles/4.1/Gemfile @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +source "https://rubygems.org" + +ruby ">= 4.1.0.dev" + +gemspec path: "../.." + +gem "ffi" +gem "onigmo", platforms: :ruby +gem "parser" +gem "rake-compiler" +gem "rake" +gem "rbs" +gem "ruby_memcheck" +gem "ruby_parser" +gem "test-unit" diff --git a/gemfiles/4.1/Gemfile.lock b/gemfiles/4.1/Gemfile.lock new file mode 100644 index 0000000000..d7103701aa --- /dev/null +++ b/gemfiles/4.1/Gemfile.lock @@ -0,0 +1,55 @@ +PATH + remote: ../.. + specs: + prism (1.7.0) + +GEM + remote: https://rubygems.org/ + specs: + ast (2.4.3) + ffi (1.17.3) + logger (1.7.0) + mini_portile2 (2.8.9) + nokogiri (1.19.0) + mini_portile2 (~> 2.8.2) + racc (~> 1.4) + onigmo (0.1.0) + parser (3.3.10.0) + ast (~> 2.4.1) + racc + power_assert (3.0.1) + racc (1.8.1) + rake (13.3.1) + rake-compiler (1.3.1) + rake + rbs (3.10.0) + logger + ruby_memcheck (3.0.1) + nokogiri + ruby_parser (3.22.0) + racc (~> 1.5) + sexp_processor (~> 4.16) + sexp_processor (4.17.5) + test-unit (3.7.6) + power_assert + +PLATFORMS + ruby + +DEPENDENCIES + ffi + onigmo + parser + prism! + rake + rake-compiler + rbs + ruby_memcheck + ruby_parser + test-unit + +RUBY VERSION + ruby 4.1.0.dev + +BUNDLED WITH + 4.1.0.dev From 93fc4b888d1c8d7ef8f3e08b196868b949bdb5e4 Mon Sep 17 00:00:00 2001 From: Earlopain <14981592+Earlopain@users.noreply.github.com> Date: Wed, 31 Dec 2025 12:14:14 +0100 Subject: [PATCH 293/333] Use a stable version for cargo lint When a new rust version releases, CI shouldn't fail because of new rules --- .github/workflows/rust-bindings.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/rust-bindings.yml b/.github/workflows/rust-bindings.yml index 359c459992..51e90fdaf0 100644 --- a/.github/workflows/rust-bindings.yml +++ b/.github/workflows/rust-bindings.yml @@ -51,8 +51,6 @@ jobs: lint: name: cargo:lint - strategy: - fail-fast: false runs-on: ubuntu-latest steps: - uses: actions/checkout@v6 @@ -64,7 +62,7 @@ jobs: - name: Set up Rust uses: dtolnay/rust-toolchain@master with: - toolchain: stable + toolchain: "1.91.1" components: clippy, rustfmt - uses: actions/cache@v5 with: From 91f60cb736d28fe55477e23fa3ac673b515ae145 Mon Sep 17 00:00:00 2001 From: Benoit Daloze Date: Wed, 31 Dec 2025 18:29:01 +0100 Subject: [PATCH 294/333] Fix spacing in the generated #each_child_node --- templates/lib/prism/node.rb.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/lib/prism/node.rb.erb b/templates/lib/prism/node.rb.erb index c97c029d3b..066a0cea1b 100644 --- a/templates/lib/prism/node.rb.erb +++ b/templates/lib/prism/node.rb.erb @@ -353,7 +353,7 @@ module Prism <%- when Prism::Template::OptionalNodeField -%> yield <%= field.name %> if <%= field.name %> <%- when Prism::Template::NodeListField -%> - <%= field.name %>.each {|node| yield node } + <%= field.name %>.each { |node| yield node } <%- end -%> <%- end -%> end From 2c903f73ddbeaa2a3e2c174259c4383e50d224ab Mon Sep 17 00:00:00 2001 From: Benoit Daloze Date: Wed, 31 Dec 2025 18:29:23 +0100 Subject: [PATCH 295/333] Add vendor to .gitignore * Otherwise directories like `gemfiles/typecheck/vendor/bundle` are tracked, when configuring bundler with a path. --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 1122263535..6706482b64 100644 --- a/.gitignore +++ b/.gitignore @@ -11,7 +11,7 @@ /spec/reports/ /top-100-gems/ tmp/ -/vendor/bundle +vendor/ /build/ /lib/prism/prism.* From 413813b1d80d01e42f781be2daaf8ea09c2024b8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 5 Jan 2026 16:32:28 +0000 Subject: [PATCH 296/333] Bump the ruby-deps group across 11 directories with 1 update Bumps the ruby-deps group with 1 update in the /gemfiles/2.7 directory: [test-unit](https://github.com/test-unit/test-unit). Bumps the ruby-deps group with 1 update in the /gemfiles/3.0 directory: [test-unit](https://github.com/test-unit/test-unit). Bumps the ruby-deps group with 1 update in the /gemfiles/3.1 directory: [test-unit](https://github.com/test-unit/test-unit). Bumps the ruby-deps group with 1 update in the /gemfiles/3.2 directory: [test-unit](https://github.com/test-unit/test-unit). Bumps the ruby-deps group with 1 update in the /gemfiles/3.3 directory: [test-unit](https://github.com/test-unit/test-unit). Bumps the ruby-deps group with 1 update in the /gemfiles/3.4 directory: [test-unit](https://github.com/test-unit/test-unit). Bumps the ruby-deps group with 1 update in the /gemfiles/4.0 directory: [test-unit](https://github.com/test-unit/test-unit). Bumps the ruby-deps group with 1 update in the /gemfiles/4.1 directory: [test-unit](https://github.com/test-unit/test-unit). Bumps the ruby-deps group with 1 update in the /gemfiles/jruby directory: [test-unit](https://github.com/test-unit/test-unit). Bumps the ruby-deps group with 1 update in the /gemfiles/truffleruby directory: [test-unit](https://github.com/test-unit/test-unit). Bumps the ruby-deps group with 1 update in the /gemfiles/typecheck directory: [test-unit](https://github.com/test-unit/test-unit). Updates `test-unit` from 3.7.6 to 3.7.7 - [Release notes](https://github.com/test-unit/test-unit/releases) - [Commits](https://github.com/test-unit/test-unit/compare/3.7.6...3.7.7) Updates `test-unit` from 3.7.6 to 3.7.7 - [Release notes](https://github.com/test-unit/test-unit/releases) - [Commits](https://github.com/test-unit/test-unit/compare/3.7.6...3.7.7) Updates `test-unit` from 3.7.6 to 3.7.7 - [Release notes](https://github.com/test-unit/test-unit/releases) - [Commits](https://github.com/test-unit/test-unit/compare/3.7.6...3.7.7) Updates `test-unit` from 3.7.6 to 3.7.7 - [Release notes](https://github.com/test-unit/test-unit/releases) - [Commits](https://github.com/test-unit/test-unit/compare/3.7.6...3.7.7) Updates `test-unit` from 3.7.6 to 3.7.7 - [Release notes](https://github.com/test-unit/test-unit/releases) - [Commits](https://github.com/test-unit/test-unit/compare/3.7.6...3.7.7) Updates `test-unit` from 3.7.6 to 3.7.7 - [Release notes](https://github.com/test-unit/test-unit/releases) - [Commits](https://github.com/test-unit/test-unit/compare/3.7.6...3.7.7) Updates `test-unit` from 3.7.6 to 3.7.7 - [Release notes](https://github.com/test-unit/test-unit/releases) - [Commits](https://github.com/test-unit/test-unit/compare/3.7.6...3.7.7) Updates `test-unit` from 3.7.6 to 3.7.7 - [Release notes](https://github.com/test-unit/test-unit/releases) - [Commits](https://github.com/test-unit/test-unit/compare/3.7.6...3.7.7) Updates `test-unit` from 3.7.6 to 3.7.7 - [Release notes](https://github.com/test-unit/test-unit/releases) - [Commits](https://github.com/test-unit/test-unit/compare/3.7.6...3.7.7) Updates `test-unit` from 3.7.6 to 3.7.7 - [Release notes](https://github.com/test-unit/test-unit/releases) - [Commits](https://github.com/test-unit/test-unit/compare/3.7.6...3.7.7) Updates `test-unit` from 3.7.6 to 3.7.7 - [Release notes](https://github.com/test-unit/test-unit/releases) - [Commits](https://github.com/test-unit/test-unit/compare/3.7.6...3.7.7) --- updated-dependencies: - dependency-name: test-unit dependency-version: 3.7.7 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps - dependency-name: test-unit dependency-version: 3.7.7 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps - dependency-name: test-unit dependency-version: 3.7.7 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps - dependency-name: test-unit dependency-version: 3.7.7 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps - dependency-name: test-unit dependency-version: 3.7.7 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps - dependency-name: test-unit dependency-version: 3.7.7 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps - dependency-name: test-unit dependency-version: 3.7.7 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps - dependency-name: test-unit dependency-version: 3.7.7 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps - dependency-name: test-unit dependency-version: 3.7.7 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps - dependency-name: test-unit dependency-version: 3.7.7 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps - dependency-name: test-unit dependency-version: 3.7.7 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps ... Signed-off-by: dependabot[bot] --- 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/4.0/Gemfile.lock | 2 +- gemfiles/4.1/Gemfile.lock | 2 +- gemfiles/jruby/Gemfile.lock | 2 +- gemfiles/truffleruby/Gemfile.lock | 2 +- gemfiles/typecheck/Gemfile.lock | 6 +++--- 11 files changed, 13 insertions(+), 13 deletions(-) diff --git a/gemfiles/2.7/Gemfile.lock b/gemfiles/2.7/Gemfile.lock index 3e2658ee26..fa6ec04127 100644 --- a/gemfiles/2.7/Gemfile.lock +++ b/gemfiles/2.7/Gemfile.lock @@ -21,7 +21,7 @@ GEM racc (~> 1.5) sexp_processor (~> 4.16) sexp_processor (4.17.4) - test-unit (3.7.6) + test-unit (3.7.7) power_assert PLATFORMS diff --git a/gemfiles/3.0/Gemfile.lock b/gemfiles/3.0/Gemfile.lock index ee7a9c5f00..e9dd35d5ed 100644 --- a/gemfiles/3.0/Gemfile.lock +++ b/gemfiles/3.0/Gemfile.lock @@ -29,7 +29,7 @@ GEM racc (~> 1.5) sexp_processor (~> 4.16) sexp_processor (4.17.4) - test-unit (3.7.6) + test-unit (3.7.7) power_assert PLATFORMS diff --git a/gemfiles/3.1/Gemfile.lock b/gemfiles/3.1/Gemfile.lock index e6d2276f12..7cdc907bef 100644 --- a/gemfiles/3.1/Gemfile.lock +++ b/gemfiles/3.1/Gemfile.lock @@ -29,7 +29,7 @@ GEM racc (~> 1.5) sexp_processor (~> 4.16) sexp_processor (4.17.4) - test-unit (3.7.6) + test-unit (3.7.7) power_assert PLATFORMS diff --git a/gemfiles/3.2/Gemfile.lock b/gemfiles/3.2/Gemfile.lock index 84574fd28b..2541fa0bb8 100644 --- a/gemfiles/3.2/Gemfile.lock +++ b/gemfiles/3.2/Gemfile.lock @@ -29,7 +29,7 @@ GEM racc (~> 1.5) sexp_processor (~> 4.16) sexp_processor (4.17.5) - test-unit (3.7.6) + test-unit (3.7.7) power_assert PLATFORMS diff --git a/gemfiles/3.3/Gemfile.lock b/gemfiles/3.3/Gemfile.lock index b7fbf11c47..4314831b7b 100644 --- a/gemfiles/3.3/Gemfile.lock +++ b/gemfiles/3.3/Gemfile.lock @@ -29,7 +29,7 @@ GEM racc (~> 1.5) sexp_processor (~> 4.16) sexp_processor (4.17.5) - test-unit (3.7.6) + test-unit (3.7.7) power_assert PLATFORMS diff --git a/gemfiles/3.4/Gemfile.lock b/gemfiles/3.4/Gemfile.lock index 7f3d61f323..c4ee812565 100644 --- a/gemfiles/3.4/Gemfile.lock +++ b/gemfiles/3.4/Gemfile.lock @@ -29,7 +29,7 @@ GEM racc (~> 1.5) sexp_processor (~> 4.16) sexp_processor (4.17.5) - test-unit (3.7.6) + test-unit (3.7.7) power_assert PLATFORMS diff --git a/gemfiles/4.0/Gemfile.lock b/gemfiles/4.0/Gemfile.lock index 1c4da8061c..4bf0b95561 100644 --- a/gemfiles/4.0/Gemfile.lock +++ b/gemfiles/4.0/Gemfile.lock @@ -30,7 +30,7 @@ GEM racc (~> 1.5) sexp_processor (~> 4.16) sexp_processor (4.17.5) - test-unit (3.7.6) + test-unit (3.7.7) power_assert PLATFORMS diff --git a/gemfiles/4.1/Gemfile.lock b/gemfiles/4.1/Gemfile.lock index d7103701aa..509057ac63 100644 --- a/gemfiles/4.1/Gemfile.lock +++ b/gemfiles/4.1/Gemfile.lock @@ -30,7 +30,7 @@ GEM racc (~> 1.5) sexp_processor (~> 4.16) sexp_processor (4.17.5) - test-unit (3.7.6) + test-unit (3.7.7) power_assert PLATFORMS diff --git a/gemfiles/jruby/Gemfile.lock b/gemfiles/jruby/Gemfile.lock index d253f0f578..e551b2e707 100644 --- a/gemfiles/jruby/Gemfile.lock +++ b/gemfiles/jruby/Gemfile.lock @@ -20,7 +20,7 @@ GEM racc (~> 1.5) sexp_processor (~> 4.16) sexp_processor (4.17.4) - test-unit (3.7.6) + test-unit (3.7.7) power_assert PLATFORMS diff --git a/gemfiles/truffleruby/Gemfile.lock b/gemfiles/truffleruby/Gemfile.lock index a83d7dfe8b..c3333766a5 100644 --- a/gemfiles/truffleruby/Gemfile.lock +++ b/gemfiles/truffleruby/Gemfile.lock @@ -19,7 +19,7 @@ GEM racc (~> 1.5) sexp_processor (~> 4.16) sexp_processor (4.17.4) - test-unit (3.7.6) + test-unit (3.7.7) power_assert PLATFORMS diff --git a/gemfiles/typecheck/Gemfile.lock b/gemfiles/typecheck/Gemfile.lock index a7440d3425..d45846d32b 100644 --- a/gemfiles/typecheck/Gemfile.lock +++ b/gemfiles/typecheck/Gemfile.lock @@ -23,8 +23,8 @@ GEM csv (3.3.5) drb (2.2.3) erubi (1.13.1) - ffi (1.17.2-arm64-darwin) - ffi (1.17.2-x86_64-linux-gnu) + ffi (1.17.3-arm64-darwin) + ffi (1.17.3-x86_64-linux-gnu) fileutils (1.8.0) i18n (1.14.7) concurrent-ruby (~> 1.0) @@ -108,7 +108,7 @@ GEM yard-sorbet terminal-table (4.0.0) unicode-display_width (>= 1.1.1, < 4) - test-unit (3.7.6) + test-unit (3.7.7) power_assert thor (1.4.0) tzinfo (2.0.6) From 3b5b4a8a6d3b06d020231d7d9e15772236a00b13 Mon Sep 17 00:00:00 2001 From: Earlopain <14981592+Earlopain@users.noreply.github.com> Date: Thu, 8 Jan 2026 10:53:42 +0100 Subject: [PATCH 297/333] Move `LexRipper` into its own file It has a hard dependency on ripper that can't be removed. This makes it so that ripper can be loaded only when the class is actually used. --- Steepfile | 1 + lib/prism.rb | 2 +- lib/prism/lex_compat.rb | 58 ------------------------------------- lib/prism/lex_ripper.rb | 64 +++++++++++++++++++++++++++++++++++++++++ prism.gemspec | 1 + rakelib/typecheck.rake | 1 + 6 files changed, 68 insertions(+), 59 deletions(-) create mode 100644 lib/prism/lex_ripper.rb diff --git a/Steepfile b/Steepfile index 433e53cd29..1aafafc523 100644 --- a/Steepfile +++ b/Steepfile @@ -10,6 +10,7 @@ target :lib do # TODO: Type-checking these files is still WIP ignore "lib/prism/desugar_compiler.rb" ignore "lib/prism/lex_compat.rb" + ignore "lib/prism/lex_ripper.rb" ignore "lib/prism/serialize.rb" ignore "lib/prism/ffi.rb" ignore "lib/prism/translation" diff --git a/lib/prism.rb b/lib/prism.rb index f6ad0c1fd1..d809557fce 100644 --- a/lib/prism.rb +++ b/lib/prism.rb @@ -20,7 +20,7 @@ module Prism autoload :DSL, "prism/dsl" autoload :InspectVisitor, "prism/inspect_visitor" autoload :LexCompat, "prism/lex_compat" - autoload :LexRipper, "prism/lex_compat" + autoload :LexRipper, "prism/lex_ripper" autoload :MutationCompiler, "prism/mutation_compiler" autoload :Pack, "prism/pack" autoload :Pattern, "prism/pattern" diff --git a/lib/prism/lex_compat.rb b/lib/prism/lex_compat.rb index 9b3f025ab6..48ac768b03 100644 --- a/lib/prism/lex_compat.rb +++ b/lib/prism/lex_compat.rb @@ -867,62 +867,4 @@ def result end private_constant :LexCompat - - # This is a class that wraps the Ripper lexer to produce almost exactly the - # same tokens. - class LexRipper # :nodoc: - attr_reader :source - - def initialize(source) - @source = source - end - - def result - previous = [] #: [[Integer, Integer], Symbol, String, untyped] | [] - results = [] #: Array[[[Integer, Integer], Symbol, String, untyped]] - - lex(source).each do |token| - case token[1] - when :on_sp - # skip - when :on_tstring_content - if previous[1] == :on_tstring_content && (token[2].start_with?("\#$") || token[2].start_with?("\#@")) - previous[2] << token[2] - else - results << token - previous = token - end - when :on_words_sep - if previous[1] == :on_words_sep - previous[2] << token[2] - else - results << token - previous = token - end - else - results << token - previous = token - end - end - - results - end - - private - - if Ripper.method(:lex).parameters.assoc(:keyrest) - def lex(source) - Ripper.lex(source, raise_errors: true) - end - else - def lex(source) - ripper = Ripper::Lexer.new(source) - ripper.lex.tap do |result| - raise SyntaxError, ripper.errors.map(&:message).join(' ;') if ripper.errors.any? - end - end - end - end - - private_constant :LexRipper end diff --git a/lib/prism/lex_ripper.rb b/lib/prism/lex_ripper.rb new file mode 100644 index 0000000000..4b5c3b77fd --- /dev/null +++ b/lib/prism/lex_ripper.rb @@ -0,0 +1,64 @@ +# frozen_string_literal: true +# :markup: markdown + +require "ripper" + +module Prism + # This is a class that wraps the Ripper lexer to produce almost exactly the + # same tokens. + class LexRipper # :nodoc: + attr_reader :source + + def initialize(source) + @source = source + end + + def result + previous = [] #: [[Integer, Integer], Symbol, String, untyped] | [] + results = [] #: Array[[[Integer, Integer], Symbol, String, untyped]] + + lex(source).each do |token| + case token[1] + when :on_sp + # skip + when :on_tstring_content + if previous[1] == :on_tstring_content && (token[2].start_with?("\#$") || token[2].start_with?("\#@")) + previous[2] << token[2] + else + results << token + previous = token + end + when :on_words_sep + if previous[1] == :on_words_sep + previous[2] << token[2] + else + results << token + previous = token + end + else + results << token + previous = token + end + end + + results + end + + private + + if Ripper.method(:lex).parameters.assoc(:keyrest) + def lex(source) + Ripper.lex(source, raise_errors: true) + end + else + def lex(source) + ripper = Ripper::Lexer.new(source) + ripper.lex.tap do |result| + raise SyntaxError, ripper.errors.map(&:message).join(' ;') if ripper.errors.any? + end + end + end + end + + private_constant :LexRipper +end diff --git a/prism.gemspec b/prism.gemspec index 2fb5d1d0b3..a45e0d93e7 100644 --- a/prism.gemspec +++ b/prism.gemspec @@ -77,6 +77,7 @@ Gem::Specification.new do |spec| "lib/prism/ffi.rb", "lib/prism/inspect_visitor.rb", "lib/prism/lex_compat.rb", + "lib/prism/lex_ripper.rb", "lib/prism/mutation_compiler.rb", "lib/prism/node_ext.rb", "lib/prism/node.rb", diff --git a/rakelib/typecheck.rake b/rakelib/typecheck.rake index 4f3fb1684e..4a83bad7d0 100644 --- a/rakelib/typecheck.rake +++ b/rakelib/typecheck.rake @@ -20,6 +20,7 @@ namespace :typecheck do File.write("sorbet/typed_overrides.yml", ERB.new(<<~YAML, trim_mode: "-").result_with_hash(locals)) false: - ./lib/prism/lex_compat.rb + - ./lib/prism/lex_ripper.rb - ./lib/prism/node_ext.rb - ./lib/prism/parse_result.rb - ./lib/prism/visitor.rb From a73a4fb00c094a50aeadbb4b4d6a40ef97376114 Mon Sep 17 00:00:00 2001 From: Earlopain <14981592+Earlopain@users.noreply.github.com> Date: Thu, 8 Jan 2026 11:12:15 +0100 Subject: [PATCH 298/333] Remove unneeded `ripper` requires Ripper is either not used or loaded where it is actually needed --- lib/prism/translation/ripper.rb | 2 -- rakelib/lex.rake | 4 ---- test/prism/magic_comment_test.rb | 1 + test/prism/ruby/ripper_test.rb | 1 + test/prism/test_helper.rb | 1 - 5 files changed, 2 insertions(+), 7 deletions(-) diff --git a/lib/prism/translation/ripper.rb b/lib/prism/translation/ripper.rb index e488b7c5cf..00d5f80af4 100644 --- a/lib/prism/translation/ripper.rb +++ b/lib/prism/translation/ripper.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true # :markup: markdown -require "ripper" - module Prism module Translation # This class provides a compatibility layer between prism and Ripper. It diff --git a/rakelib/lex.rake b/rakelib/lex.rake index 23807a81b6..59f7a52dd4 100644 --- a/rakelib/lex.rake +++ b/rakelib/lex.rake @@ -126,7 +126,6 @@ TARGETS.each do |name, target| desc "Lex #{repo} and compare with lex_compat" task "lex:#{name}" => [dirpath, :compile] do $:.unshift(File.expand_path("../lib", __dir__)) - require "ripper" require "prism" plain_text = ENV.fetch("CI", false) @@ -169,7 +168,6 @@ end desc "Lex files and compare with lex_compat" task lex: :compile do $:.unshift(File.expand_path("../lib", __dir__)) - require "ripper" require "prism" plain_text = ENV.fetch("CI", false) @@ -201,7 +199,6 @@ desc "Lex against the most recent version of various rubygems" task "lex:rubygems": [:compile, "tmp/failing"] do $:.unshift(File.expand_path("../lib", __dir__)) require "net/http" - require "ripper" require "rubygems/package" require "tmpdir" require "prism" @@ -333,7 +330,6 @@ desc "Lex against the top 100 rubygems" task "lex:topgems": ["download:topgems", :compile] do $:.unshift(File.expand_path("../lib", __dir__)) require "net/http" - require "ripper" require "rubygems/package" require "tmpdir" require "prism" diff --git a/test/prism/magic_comment_test.rb b/test/prism/magic_comment_test.rb index ab4b5f56e5..ccfe5a5d0a 100644 --- a/test/prism/magic_comment_test.rb +++ b/test/prism/magic_comment_test.rb @@ -1,6 +1,7 @@ # frozen_string_literal: true require_relative "test_helper" +require "ripper" module Prism class MagicCommentTest < TestCase diff --git a/test/prism/ruby/ripper_test.rb b/test/prism/ruby/ripper_test.rb index bd63302efc..defa95b6a8 100644 --- a/test/prism/ruby/ripper_test.rb +++ b/test/prism/ruby/ripper_test.rb @@ -3,6 +3,7 @@ return if RUBY_VERSION < "3.3" || RUBY_ENGINE != "ruby" require_relative "../test_helper" +require "ripper" module Prism class RipperTest < TestCase diff --git a/test/prism/test_helper.rb b/test/prism/test_helper.rb index 43771110b4..406582c0a5 100644 --- a/test/prism/test_helper.rb +++ b/test/prism/test_helper.rb @@ -2,7 +2,6 @@ require "prism" require "pp" -require "ripper" require "stringio" require "test/unit" require "tempfile" From 2c0bea076d75d6429a93c72c1436323e91c59d4e Mon Sep 17 00:00:00 2001 From: Earlopain <14981592+Earlopain@users.noreply.github.com> Date: Thu, 8 Jan 2026 13:47:35 +0100 Subject: [PATCH 299/333] Decouple ripper translator from ripper library Ripper exposes Ripper::Lexer:State in its output, which is a bit of a problem. To make this work, I basically copy-pasted the implementation. I'm unsure if that is acceptable and added a test to make sure that these values never go out of sync. I don't imagine them changing often, prism maps them 1:1 for its own usage. This also fixed the shim by accident. `Ripper.lex` went to `Translation::Ripper.lex` when it should have been the original. Removing the need for the original resolves that issue. --- lib/prism/lex_compat.rb | 86 +++++++++++++++++++++++++++------- test/prism/ruby/ripper_test.rb | 12 +++++ 2 files changed, 81 insertions(+), 17 deletions(-) diff --git a/lib/prism/lex_compat.rb b/lib/prism/lex_compat.rb index 48ac768b03..ebfb19e56d 100644 --- a/lib/prism/lex_compat.rb +++ b/lib/prism/lex_compat.rb @@ -2,7 +2,6 @@ # :markup: markdown require "delegate" -require "ripper" module Prism # This class is responsible for lexing the source using prism and then @@ -199,6 +198,58 @@ def deconstruct_keys(keys) "__END__": :on___end__ }.freeze + # Pretty much a 1:1 copy of Ripper::Lexer::State. We list all the available states + # to reimplement to_s without using Ripper. + class State + # Ripper-internal bitflags. + ALL = %i[ + BEG END ENDARG ENDFN ARG CMDARG MID FNAME DOT CLASS LABEL LABELED FITEM + ].map.with_index.to_h { |name, i| [2 ** i, name] } + ALL[0] = :NONE + ALL.freeze + ALL.each { |value, name| const_set(name, value) } + + # :stopdoc: + + attr_reader :to_int, :to_s + + def initialize(i) + @to_int = i + @to_s = state_name(i) + freeze + end + + def [](index) + case index + when 0, :to_int + @to_int + when 1, :to_s + @to_s + else + nil + end + end + + alias to_i to_int + alias inspect to_s + def pretty_print(q) q.text(to_s) end + def ==(i) super or to_int == i end + def &(i) self.class.new(to_int & i) end + def |(i) self.class.new(to_int | i) end + def allbits?(i) to_int.allbits?(i) end + def anybits?(i) to_int.anybits?(i) end + def nobits?(i) to_int.nobits?(i) end + + # :startdoc: + + private + + # Convert the state flags into the format exposed by ripper. + def state_name(bits) + ALL.filter_map { |flag, name| name if bits & flag != 0 }.join("|") + end + end + # When we produce tokens, we produce the same arrays that Ripper does. # However, we add a couple of convenience methods onto them to make them a # little easier to work with. We delegate all other methods to the array. @@ -249,8 +300,8 @@ def ==(other) # :nodoc: class IdentToken < Token def ==(other) # :nodoc: (self[0...-1] == other[0...-1]) && ( - (other[3] == Ripper::EXPR_LABEL | Ripper::EXPR_END) || - (other[3] & Ripper::EXPR_ARG_ANY != 0) + (other[3] == State::LABEL | State::END) || + (other[3] & (State::ARG | State::CMDARG) != 0) ) end end @@ -261,8 +312,8 @@ class IgnoredNewlineToken < Token def ==(other) # :nodoc: return false unless self[0...-1] == other[0...-1] - if self[3] == Ripper::EXPR_ARG | Ripper::EXPR_LABELED - other[3] & Ripper::EXPR_ARG | Ripper::EXPR_LABELED != 0 + if self[3] == State::ARG | State::LABELED + other[3] & State::ARG | State::LABELED != 0 else self[3] == other[3] end @@ -280,8 +331,8 @@ def ==(other) # :nodoc: class ParamToken < Token def ==(other) # :nodoc: (self[0...-1] == other[0...-1]) && ( - (other[3] == Ripper::EXPR_END) || - (other[3] == Ripper::EXPR_END | Ripper::EXPR_LABEL) + (other[3] == State::END) || + (other[3] == State::END | State::LABEL) ) end end @@ -615,6 +666,11 @@ def self.build(opening) private_constant :Heredoc + # In previous versions of Ruby, Ripper wouldn't flush the bom before the + # first token, so we had to have a hack in place to account for that. + BOM_FLUSHED = RUBY_VERSION >= "3.3.0" + private_constant :BOM_FLUSHED + attr_reader :source, :options def initialize(source, **options) @@ -630,13 +686,9 @@ def result result = Prism.lex(source, **options) result_value = result.value - previous_state = nil #: Ripper::Lexer::State? + previous_state = nil #: State? last_heredoc_end = nil #: Integer? - # In previous versions of Ruby, Ripper wouldn't flush the bom before the - # first token, so we had to have a hack in place to account for that. This - # checks for that behavior. - bom_flushed = Ripper.lex("\xEF\xBB\xBF# test")[0][0][1] == 0 bom = source.byteslice(0..2) == "\xEF\xBB\xBF" result_value.each_with_index do |(token, lex_state), index| @@ -651,7 +703,7 @@ def result if bom && lineno == 1 column -= 3 - if index == 0 && column == 0 && !bom_flushed + if index == 0 && column == 0 && !BOM_FLUSHED flushed = case token.type when :BACK_REFERENCE, :INSTANCE_VARIABLE, :CLASS_VARIABLE, @@ -675,7 +727,7 @@ def result event = RIPPER.fetch(token.type) value = token.value - lex_state = Ripper::Lexer::State.new(lex_state) + lex_state = State.new(lex_state) token = case event @@ -689,7 +741,7 @@ def result last_heredoc_end = token.location.end_offset IgnoreStateToken.new([[lineno, column], event, value, lex_state]) when :on_ident - if lex_state == Ripper::EXPR_END + if lex_state == State::END # If we have an identifier that follows a method name like: # # def foo bar @@ -699,7 +751,7 @@ def result # yet. We do this more accurately, so we need to allow comparing # against both END and END|LABEL. ParamToken.new([[lineno, column], event, value, lex_state]) - elsif lex_state == Ripper::EXPR_END | Ripper::EXPR_LABEL + elsif lex_state == State::END | State::LABEL # In the event that we're comparing identifiers, we're going to # allow a little divergence. Ripper doesn't account for local # variables introduced through named captures in regexes, and we @@ -739,7 +791,7 @@ def result counter += { on_embexpr_beg: -1, on_embexpr_end: 1 }[current_event] || 0 end - Ripper::Lexer::State.new(result_value[current_index][1]) + State.new(result_value[current_index][1]) else previous_state end diff --git a/test/prism/ruby/ripper_test.rb b/test/prism/ruby/ripper_test.rb index defa95b6a8..9d64c5c70c 100644 --- a/test/prism/ruby/ripper_test.rb +++ b/test/prism/ruby/ripper_test.rb @@ -63,6 +63,18 @@ class RipperTest < TestCase define_method(fixture.test_name) { assert_ripper(fixture.read) } end + # Check that the hardcoded values don't change without us noticing. + def test_internals + actual = LexCompat::State::ALL + expected = Ripper.constants.select { |name| name.start_with?("EXPR_") } + expected -= %i[EXPR_VALUE EXPR_BEG_ANY EXPR_ARG_ANY EXPR_END_ANY] + + assert_equal(expected.size, actual.size) + expected.each do |const_name| + assert_equal(const_name.to_s.delete_prefix("EXPR_").to_sym, actual[Ripper.const_get(const_name)]) + end + end + private def assert_ripper(source) From 396b8ff3f91c483f791f6c412d795298c0fa25b4 Mon Sep 17 00:00:00 2001 From: Earlopain <14981592+Earlopain@users.noreply.github.com> Date: Fri, 9 Jan 2026 12:45:31 +0100 Subject: [PATCH 300/333] Add irb to the gemfile On ruby 4.0.0, it is not a default gem anymore, which means you can't do `bundle exec irb` --- Gemfile | 1 + Gemfile.lock | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/Gemfile b/Gemfile index 7a7950b399..7a9ee85d52 100644 --- a/Gemfile +++ b/Gemfile @@ -11,6 +11,7 @@ gem "test-unit" platforms :mri, :mswin, :mingw, :x64_mingw do gem "ffi" + gem "irb" gem "parser" gem "ruby_memcheck" gem "ruby_parser" diff --git a/Gemfile.lock b/Gemfile.lock index 13cb8198a7..62a388d0ca 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -11,6 +11,11 @@ GEM date (3.5.1) erb (6.0.1) ffi (1.17.3) + io-console (0.8.2) + irb (1.16.0) + pp (>= 0.6.0) + rdoc (>= 4.0.0) + reline (>= 0.4.2) mini_portile2 (2.8.9) nokogiri (1.19.0) mini_portile2 (~> 2.8.2) @@ -20,6 +25,9 @@ GEM ast (~> 2.4.1) racc power_assert (3.0.1) + pp (0.6.3) + prettyprint + prettyprint (0.2.0) psych (5.3.1) date stringio @@ -31,6 +39,8 @@ GEM erb psych (>= 4.0.0) tsort + reline (0.6.3) + io-console (~> 0.5) ruby_memcheck (3.0.1) nokogiri ruby_parser (3.22.0) @@ -48,6 +58,7 @@ PLATFORMS DEPENDENCIES benchmark-ips ffi + irb onigmo parser prism! From e247cb58c738b3bc1edf3d4a9b147a7556b37c54 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Sun, 11 Jan 2026 22:46:06 +0900 Subject: [PATCH 301/333] [Bug #21831] Fix denominator of rational float literal Denominators can contain underscores in fraction part as well as other numeric literals. [Bug #21831]: https://bugs.ruby-lang.org/issues/21831 --- src/prism.c | 8 ++++++-- test/prism/result/numeric_value_test.rb | 11 +++++++++++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/src/prism.c b/src/prism.c index 1a8cdf7568..b36a6da204 100644 --- a/src/prism.c +++ b/src/prism.c @@ -3962,9 +3962,13 @@ pm_float_node_rational_create(pm_parser_t *parser, const pm_token_t *token) { memcpy(digits + (point - start), point + 1, (unsigned long) (end - point - 1)); pm_integer_parse(&node->numerator, PM_INTEGER_BASE_DEFAULT, digits, digits + length - 1); + size_t fract_length = 0; + for (const uint8_t *fract = point; fract < end; ++fract) { + if (*fract != '_') ++fract_length; + } digits[0] = '1'; - if (end - point > 1) memset(digits + 1, '0', (size_t) (end - point - 1)); - pm_integer_parse(&node->denominator, PM_INTEGER_BASE_DEFAULT, digits, digits + (end - point)); + if (fract_length > 1) memset(digits + 1, '0', fract_length - 1); + pm_integer_parse(&node->denominator, PM_INTEGER_BASE_DEFAULT, digits, digits + fract_length); xfree(digits); pm_integers_reduce(&node->numerator, &node->denominator); diff --git a/test/prism/result/numeric_value_test.rb b/test/prism/result/numeric_value_test.rb index 5c89230a1f..0207fa6a86 100644 --- a/test/prism/result/numeric_value_test.rb +++ b/test/prism/result/numeric_value_test.rb @@ -6,16 +6,27 @@ module Prism class NumericValueTest < TestCase def test_numeric_value assert_equal 123, Prism.parse_statement("123").value + assert_equal 123, Prism.parse_statement("1_23").value assert_equal 3.14, Prism.parse_statement("3.14").value + assert_equal 3.14, Prism.parse_statement("3.1_4").value assert_equal 42i, Prism.parse_statement("42i").value + assert_equal 42i, Prism.parse_statement("4_2i").value assert_equal 42.1ri, Prism.parse_statement("42.1ri").value + assert_equal 42.1ri, Prism.parse_statement("42.1_0ri").value assert_equal 3.14i, Prism.parse_statement("3.14i").value + assert_equal 3.14i, Prism.parse_statement("3.1_4i").value assert_equal 42r, Prism.parse_statement("42r").value + assert_equal 42r, Prism.parse_statement("4_2r").value assert_equal 0.5r, Prism.parse_statement("0.5r").value + assert_equal 0.5r, Prism.parse_statement("0.5_0r").value assert_equal 42ri, Prism.parse_statement("42ri").value + assert_equal 42ri, Prism.parse_statement("4_2ri").value assert_equal 0.5ri, Prism.parse_statement("0.5ri").value + assert_equal 0.5ri, Prism.parse_statement("0.5_0ri").value assert_equal 0xFFr, Prism.parse_statement("0xFFr").value + assert_equal 0xFFr, Prism.parse_statement("0xF_Fr").value assert_equal 0xFFri, Prism.parse_statement("0xFFri").value + assert_equal 0xFFri, Prism.parse_statement("0xF_Fri").value end end end From 23b9de6348e26194da513f38f8e7819204e3feb9 Mon Sep 17 00:00:00 2001 From: Earlopain <14981592+Earlopain@users.noreply.github.com> Date: Sun, 11 Jan 2026 20:27:08 +0100 Subject: [PATCH 302/333] Use main gemfile for truffleruby/jruby Each time they release a new X.Y, the versions in the gemfiles need to be updated in order to not fail CI. The `engine_version` can be removed but at that point might as well just use the main gemfile. During development, the main gemfile should support these two already anyways. --- .github/dependabot.yml | 2 -- .github/workflows/main.yml | 14 ++++----- Gemfile | 4 +-- Gemfile.lock | 11 ++++++++ bin/prism | 2 -- docs/releasing.md | 2 -- gemfiles/jruby/Gemfile | 13 --------- gemfiles/jruby/Gemfile.lock | 47 ------------------------------- gemfiles/truffleruby/Gemfile | 13 --------- gemfiles/truffleruby/Gemfile.lock | 40 -------------------------- test/prism/snapshots_test.rb | 2 -- 11 files changed, 20 insertions(+), 130 deletions(-) delete mode 100644 gemfiles/jruby/Gemfile delete mode 100644 gemfiles/jruby/Gemfile.lock delete mode 100644 gemfiles/truffleruby/Gemfile delete mode 100644 gemfiles/truffleruby/Gemfile.lock diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 1b499e783c..6e302f18de 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -26,8 +26,6 @@ updates: - '/gemfiles/3.4' - '/gemfiles/4.0' - '/gemfiles/4.1' - - '/gemfiles/jruby' - - '/gemfiles/truffleruby' - '/gemfiles/typecheck' schedule: interval: 'weekly' diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c257cf0d15..7b7f43650e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -105,8 +105,8 @@ jobs: matrix: target: - { ruby: "head", gemfile: "4.1" } - - { ruby: "jruby-10.0.0.0", gemfile: "jruby" } # https://github.com/jruby/jruby/issues/8923 - - { ruby: "truffleruby", gemfile: "truffleruby" } + - { ruby: "jruby-10.0.0.0", gemfile: ".." } # https://github.com/jruby/jruby/issues/8923 + - { ruby: "truffleruby", gemfile: ".." } runs-on: ubuntu-latest env: PRISM_FFI_BACKEND: "true" @@ -277,8 +277,8 @@ jobs: - { ruby: "3.4", os: "ubuntu-latest", gemfile: "3.4" } - { ruby: "4.0", os: "ubuntu-latest", gemfile: "4.0" } - { ruby: "head", os: "ubuntu-latest", gemfile: "4.1" } - - { ruby: "jruby-10.0.0.0", os: "ubuntu-latest", gemfile: "jruby" } # https://github.com/jruby/jruby/issues/8923 - - { ruby: "truffleruby", os: "ubuntu-latest", gemfile: "truffleruby" } + - { ruby: "jruby-10.0.0.0", os: "ubuntu-latest", gemfile: ".." } # https://github.com/jruby/jruby/issues/8923 + - { ruby: "truffleruby", os: "ubuntu-latest", gemfile: ".." } - { ruby: "2.7", os: "macos-latest", gemfile: "2.7" } - { ruby: "3.0", os: "macos-latest", gemfile: "3.0" } @@ -288,8 +288,8 @@ jobs: - { ruby: "3.4", os: "macos-latest", gemfile: "3.4" } - { ruby: "4.0", os: "macos-latest", gemfile: "4.0" } - { ruby: "head", os: "macos-latest", gemfile: "4.1" } - - { ruby: "jruby-10.0.0.0", os: "macos-latest", gemfile: "jruby" } # https://github.com/jruby/jruby/issues/8923 - - { ruby: "truffleruby", os: "macos-latest", gemfile: "truffleruby" } + - { ruby: "jruby-10.0.0.0", os: "macos-latest", gemfile: ".." } # https://github.com/jruby/jruby/issues/8923 + - { ruby: "truffleruby", os: "macos-latest", gemfile: ".." } - { ruby: "2.7", os: "windows-latest", gemfile: "2.7" } - { ruby: "3.0", os: "windows-latest", gemfile: "3.0" } @@ -299,7 +299,7 @@ jobs: - { ruby: "3.4", os: "windows-latest", gemfile: "3.4" } - { ruby: "4.0", os: "windows-latest", gemfile: "4.0" } # - { ruby: "head", os: "windows-latest", gemfile: "4.1" } TODO: No windows build yet - - { ruby: "jruby-10.0.0.0", os: "windows-latest", gemfile: "jruby" } # https://github.com/jruby/jruby/issues/8923 + - { ruby: "jruby-10.0.0.0", os: "windows-latest", gemfile: ".." } # https://github.com/jruby/jruby/issues/8923 env: BUNDLE_GEMFILE: gemfiles/${{ matrix.target.gemfile }}/Gemfile runs-on: ${{ matrix.target.os }} diff --git a/Gemfile b/Gemfile index 7a9ee85d52..1a1ed1b269 100644 --- a/Gemfile +++ b/Gemfile @@ -5,16 +5,16 @@ source "https://rubygems.org" gemspec gem "benchmark-ips" +gem "parser" gem "rake" gem "rake-compiler" +gem "ruby_parser" gem "test-unit" platforms :mri, :mswin, :mingw, :x64_mingw do gem "ffi" gem "irb" - gem "parser" gem "ruby_memcheck" - gem "ruby_parser" gem "rdoc" end diff --git a/Gemfile.lock b/Gemfile.lock index 62a388d0ca..0a320f9204 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -9,17 +9,23 @@ GEM ast (2.4.3) benchmark-ips (2.14.0) date (3.5.1) + date (3.5.1-java) erb (6.0.1) + erb (6.0.1-java) ffi (1.17.3) io-console (0.8.2) + io-console (0.8.2-java) irb (1.16.0) pp (>= 0.6.0) rdoc (>= 4.0.0) reline (>= 0.4.2) + jar-dependencies (0.5.5) mini_portile2 (2.8.9) nokogiri (1.19.0) mini_portile2 (~> 2.8.2) racc (~> 1.4) + nokogiri (1.19.0-java) + racc (~> 1.4) onigmo (0.1.0) parser (3.3.10.0) ast (~> 2.4.1) @@ -31,7 +37,11 @@ GEM psych (5.3.1) date stringio + psych (5.3.1-java) + date + jar-dependencies (>= 0.1.7) racc (1.8.1) + racc (1.8.1-java) rake (13.3.1) rake-compiler (1.3.1) rake @@ -53,6 +63,7 @@ GEM tsort (0.2.0) PLATFORMS + java ruby DEPENDENCIES diff --git a/bin/prism b/bin/prism index 7d8e97fb46..d91d9990bf 100755 --- a/bin/prism +++ b/bin/prism @@ -101,8 +101,6 @@ module Prism ["3.4", ["3.4", "typecheck"]], ["4.0", ["4.0"]], ["4.1", ["4.1"]], - ["jruby", ["jruby"]], - ["truffleruby", ["truffleruby"]] ].each do |ruby_version, gemfiles| gemfiles.each do |gemfile| system( diff --git a/docs/releasing.md b/docs/releasing.md index 0853c2f853..a7d3cf5eb3 100644 --- a/docs/releasing.md +++ b/docs/releasing.md @@ -49,8 +49,6 @@ bundle install ```sh for VERSION in "2.7" "3.0" "3.1" "3.2" "3.3" "3.4" "4.0"; do docker run -it --rm -v "$PWD":/usr/src/app -w /usr/src/app -e BUNDLE_GEMFILE="gemfiles/$VERSION/Gemfile" "ruby:$VERSION" bundle update; done chruby ruby-4.1.0-dev && BUNDLE_GEMFILE=gemfiles/4.1/Gemfile bundle install -docker run -it --rm -v "$PWD":/usr/src/app -w /usr/src/app -e BUNDLE_GEMFILE="gemfiles/jruby/Gemfile" jruby:latest bundle update -BUNDLE_GEMFILE=gemfiles/truffleruby/Gemfile chruby-exec truffleruby -- bundle update ``` * Update the cargo lockfiles: diff --git a/gemfiles/jruby/Gemfile b/gemfiles/jruby/Gemfile deleted file mode 100644 index 957c4c01d9..0000000000 --- a/gemfiles/jruby/Gemfile +++ /dev/null @@ -1,13 +0,0 @@ -# frozen_string_literal: true - -source "https://rubygems.org" - -ruby "~> 3.4.2", engine: "jruby", engine_version: "~> 10.0.0" - -gemspec path: "../.." - -gem "parser" -gem "rake" -gem "rake-compiler" -gem "ruby_parser" -gem "test-unit" diff --git a/gemfiles/jruby/Gemfile.lock b/gemfiles/jruby/Gemfile.lock deleted file mode 100644 index e551b2e707..0000000000 --- a/gemfiles/jruby/Gemfile.lock +++ /dev/null @@ -1,47 +0,0 @@ -PATH - remote: ../.. - specs: - prism (1.7.0) - -GEM - remote: https://rubygems.org/ - specs: - ast (2.4.3) - parser (3.3.10.0) - ast (~> 2.4.1) - racc - power_assert (3.0.1) - racc (1.8.1) - racc (1.8.1-java) - rake (13.3.1) - rake-compiler (1.3.1) - rake - ruby_parser (3.22.0) - racc (~> 1.5) - sexp_processor (~> 4.16) - sexp_processor (4.17.4) - test-unit (3.7.7) - power_assert - -PLATFORMS - universal-java-11 - universal-java-17 - universal-java-20 - universal-java-21 - universal-java-22 - universal-java-23 - x86_64-linux - -DEPENDENCIES - parser - prism! - rake - rake-compiler - ruby_parser - test-unit - -RUBY VERSION - ruby 3.4.2p0 (jruby 10.0.0.0) - -BUNDLED WITH - 2.7.2 diff --git a/gemfiles/truffleruby/Gemfile b/gemfiles/truffleruby/Gemfile deleted file mode 100644 index ce1282eacb..0000000000 --- a/gemfiles/truffleruby/Gemfile +++ /dev/null @@ -1,13 +0,0 @@ -# frozen_string_literal: true - -source "https://rubygems.org" - -ruby "~> 3.3.7", engine: "truffleruby", engine_version: "~> 25.0.0" - -gemspec path: "../.." - -gem "parser" -gem "rake" -gem "rake-compiler" -gem "ruby_parser" -gem "test-unit" diff --git a/gemfiles/truffleruby/Gemfile.lock b/gemfiles/truffleruby/Gemfile.lock deleted file mode 100644 index c3333766a5..0000000000 --- a/gemfiles/truffleruby/Gemfile.lock +++ /dev/null @@ -1,40 +0,0 @@ -PATH - remote: ../.. - specs: - prism (1.7.0) - -GEM - remote: https://rubygems.org/ - specs: - ast (2.4.3) - parser (3.3.10.0) - ast (~> 2.4.1) - racc - power_assert (3.0.1) - racc (1.8.1) - rake (13.3.1) - rake-compiler (1.3.1) - rake - ruby_parser (3.22.0) - racc (~> 1.5) - sexp_processor (~> 4.16) - sexp_processor (4.17.4) - test-unit (3.7.7) - power_assert - -PLATFORMS - ruby - -DEPENDENCIES - parser - prism! - rake - rake-compiler - ruby_parser - test-unit - -RUBY VERSION - ruby 3.3.7p0 (truffleruby 25.0.0) - -BUNDLED WITH - 2.5.22 diff --git a/test/prism/snapshots_test.rb b/test/prism/snapshots_test.rb index 23e5c9c087..b63dfaa4eb 100644 --- a/test/prism/snapshots_test.rb +++ b/test/prism/snapshots_test.rb @@ -31,8 +31,6 @@ def teardown if RUBY_ENGINE == "truffleruby" except.push( "emoji_method_calls.txt", - "seattlerb/bug202.txt", - "seattlerb/magic_encoding_comment.txt" ) end From 255aeb2485096f25d59603842432676016c2a381 Mon Sep 17 00:00:00 2001 From: Earlopain <14981592+Earlopain@users.noreply.github.com> Date: Mon, 12 Jan 2026 14:21:42 +0100 Subject: [PATCH 303/333] Correctly expose ripper state It is for example used by `irb`, `rdoc`, `syntax_suggest` --- lib/prism/lex_compat.rb | 72 ++++----------------------- lib/prism/translation/ripper.rb | 25 ++++++++++ lib/prism/translation/ripper/lexer.rb | 46 +++++++++++++++++ prism.gemspec | 1 + rakelib/typecheck.rake | 1 + test/prism/ruby/ripper_test.rb | 11 ++-- 6 files changed, 88 insertions(+), 68 deletions(-) create mode 100644 lib/prism/translation/ripper/lexer.rb diff --git a/lib/prism/lex_compat.rb b/lib/prism/lex_compat.rb index ebfb19e56d..46f6130357 100644 --- a/lib/prism/lex_compat.rb +++ b/lib/prism/lex_compat.rb @@ -198,58 +198,6 @@ def deconstruct_keys(keys) "__END__": :on___end__ }.freeze - # Pretty much a 1:1 copy of Ripper::Lexer::State. We list all the available states - # to reimplement to_s without using Ripper. - class State - # Ripper-internal bitflags. - ALL = %i[ - BEG END ENDARG ENDFN ARG CMDARG MID FNAME DOT CLASS LABEL LABELED FITEM - ].map.with_index.to_h { |name, i| [2 ** i, name] } - ALL[0] = :NONE - ALL.freeze - ALL.each { |value, name| const_set(name, value) } - - # :stopdoc: - - attr_reader :to_int, :to_s - - def initialize(i) - @to_int = i - @to_s = state_name(i) - freeze - end - - def [](index) - case index - when 0, :to_int - @to_int - when 1, :to_s - @to_s - else - nil - end - end - - alias to_i to_int - alias inspect to_s - def pretty_print(q) q.text(to_s) end - def ==(i) super or to_int == i end - def &(i) self.class.new(to_int & i) end - def |(i) self.class.new(to_int | i) end - def allbits?(i) to_int.allbits?(i) end - def anybits?(i) to_int.anybits?(i) end - def nobits?(i) to_int.nobits?(i) end - - # :startdoc: - - private - - # Convert the state flags into the format exposed by ripper. - def state_name(bits) - ALL.filter_map { |flag, name| name if bits & flag != 0 }.join("|") - end - end - # When we produce tokens, we produce the same arrays that Ripper does. # However, we add a couple of convenience methods onto them to make them a # little easier to work with. We delegate all other methods to the array. @@ -300,8 +248,8 @@ def ==(other) # :nodoc: class IdentToken < Token def ==(other) # :nodoc: (self[0...-1] == other[0...-1]) && ( - (other[3] == State::LABEL | State::END) || - (other[3] & (State::ARG | State::CMDARG) != 0) + (other[3] == Translation::Ripper::EXPR_LABEL | Translation::Ripper::EXPR_END) || + (other[3] & (Translation::Ripper::EXPR_ARG | Translation::Ripper::EXPR_CMDARG) != 0) ) end end @@ -312,8 +260,8 @@ class IgnoredNewlineToken < Token def ==(other) # :nodoc: return false unless self[0...-1] == other[0...-1] - if self[3] == State::ARG | State::LABELED - other[3] & State::ARG | State::LABELED != 0 + if self[3] == Translation::Ripper::EXPR_ARG | Translation::Ripper::EXPR_LABELED + other[3] & Translation::Ripper::EXPR_ARG | Translation::Ripper::EXPR_LABELED != 0 else self[3] == other[3] end @@ -331,8 +279,8 @@ def ==(other) # :nodoc: class ParamToken < Token def ==(other) # :nodoc: (self[0...-1] == other[0...-1]) && ( - (other[3] == State::END) || - (other[3] == State::END | State::LABEL) + (other[3] == Translation::Ripper::EXPR_END) || + (other[3] == Translation::Ripper::EXPR_END | Translation::Ripper::EXPR_LABEL) ) end end @@ -727,7 +675,7 @@ def result event = RIPPER.fetch(token.type) value = token.value - lex_state = State.new(lex_state) + lex_state = Translation::Ripper::Lexer::State.new(lex_state) token = case event @@ -741,7 +689,7 @@ def result last_heredoc_end = token.location.end_offset IgnoreStateToken.new([[lineno, column], event, value, lex_state]) when :on_ident - if lex_state == State::END + if lex_state == Translation::Ripper::EXPR_END # If we have an identifier that follows a method name like: # # def foo bar @@ -751,7 +699,7 @@ def result # yet. We do this more accurately, so we need to allow comparing # against both END and END|LABEL. ParamToken.new([[lineno, column], event, value, lex_state]) - elsif lex_state == State::END | State::LABEL + elsif lex_state == Translation::Ripper::EXPR_END | Translation::Ripper::EXPR_LABEL # In the event that we're comparing identifiers, we're going to # allow a little divergence. Ripper doesn't account for local # variables introduced through named captures in regexes, and we @@ -791,7 +739,7 @@ def result counter += { on_embexpr_beg: -1, on_embexpr_end: 1 }[current_event] || 0 end - State.new(result_value[current_index][1]) + Translation::Ripper::Lexer::State.new(result_value[current_index][1]) else previous_state end diff --git a/lib/prism/translation/ripper.rb b/lib/prism/translation/ripper.rb index 00d5f80af4..a901a72692 100644 --- a/lib/prism/translation/ripper.rb +++ b/lib/prism/translation/ripper.rb @@ -424,9 +424,34 @@ def self.sexp_raw(src, filename = "-", lineno = 1, raise_errors: false) end end + autoload :Lexer, "prism/translation/ripper/lexer" autoload :SexpBuilder, "prism/translation/ripper/sexp" autoload :SexpBuilderPP, "prism/translation/ripper/sexp" + # :stopdoc: + # This is not part of the public API but used by some gems. + + # Ripper-internal bitflags. + LEX_STATE_NAMES = %i[ + BEG END ENDARG ENDFN ARG CMDARG MID FNAME DOT CLASS LABEL LABELED FITEM + ].map.with_index.to_h { |name, i| [2 ** i, name] }.freeze + private_constant :LEX_STATE_NAMES + + LEX_STATE_NAMES.each do |value, key| + const_set("EXPR_#{key}", value) + end + EXPR_NONE = 0 + EXPR_VALUE = EXPR_BEG + EXPR_BEG_ANY = EXPR_BEG | EXPR_MID | EXPR_CLASS + EXPR_ARG_ANY = EXPR_ARG | EXPR_CMDARG + EXPR_END_ANY = EXPR_END | EXPR_ENDARG | EXPR_ENDFN + + def self.lex_state_name(state) + LEX_STATE_NAMES.filter_map { |flag, name| name if state & flag != 0 }.join("|") + end + + # :startdoc: + # The source that is being parsed. attr_reader :source diff --git a/lib/prism/translation/ripper/lexer.rb b/lib/prism/translation/ripper/lexer.rb new file mode 100644 index 0000000000..ed02e96574 --- /dev/null +++ b/lib/prism/translation/ripper/lexer.rb @@ -0,0 +1,46 @@ +# frozen_string_literal: true +# :markup: markdown + +require_relative "../ripper" + +module Prism + module Translation + class Ripper + class Lexer # :nodoc: + # :stopdoc: + class State + + attr_reader :to_int, :to_s + + def initialize(i) + @to_int = i + @to_s = Ripper.lex_state_name(i) + freeze + end + + def [](index) + case index + when 0, :to_int + @to_int + when 1, :to_s + @to_s + else + nil + end + end + + alias to_i to_int + alias inspect to_s + def pretty_print(q) q.text(to_s) end + def ==(i) super or to_int == i end + def &(i) self.class.new(to_int & i) end + def |(i) self.class.new(to_int | i) end + def allbits?(i) to_int.allbits?(i) end + def anybits?(i) to_int.anybits?(i) end + def nobits?(i) to_int.nobits?(i) end + end + # :startdoc: + end + end + end +end diff --git a/prism.gemspec b/prism.gemspec index a45e0d93e7..b6d1f16719 100644 --- a/prism.gemspec +++ b/prism.gemspec @@ -108,6 +108,7 @@ Gem::Specification.new do |spec| "lib/prism/translation/parser/compiler.rb", "lib/prism/translation/parser/lexer.rb", "lib/prism/translation/ripper.rb", + "lib/prism/translation/ripper/lexer.rb", "lib/prism/translation/ripper/sexp.rb", "lib/prism/translation/ripper/shim.rb", "lib/prism/translation/ruby_parser.rb", diff --git a/rakelib/typecheck.rake b/rakelib/typecheck.rake index 4a83bad7d0..439af9a8fa 100644 --- a/rakelib/typecheck.rake +++ b/rakelib/typecheck.rake @@ -26,6 +26,7 @@ namespace :typecheck do - ./lib/prism/visitor.rb - ./lib/prism/translation/parser/lexer.rb - ./lib/prism/translation/ripper.rb + - ./lib/prism/translation/ripper/lexer.rb - ./lib/prism/translation/ripper/sexp.rb - ./lib/prism/translation/ruby_parser.rb - ./lib/prism/inspect_visitor.rb diff --git a/test/prism/ruby/ripper_test.rb b/test/prism/ruby/ripper_test.rb index 9d64c5c70c..bbd85585a9 100644 --- a/test/prism/ruby/ripper_test.rb +++ b/test/prism/ruby/ripper_test.rb @@ -65,13 +65,12 @@ class RipperTest < TestCase # Check that the hardcoded values don't change without us noticing. def test_internals - actual = LexCompat::State::ALL - expected = Ripper.constants.select { |name| name.start_with?("EXPR_") } - expected -= %i[EXPR_VALUE EXPR_BEG_ANY EXPR_ARG_ANY EXPR_END_ANY] + actual = Translation::Ripper.constants.select { |name| name.start_with?("EXPR_") }.sort + expected = Ripper.constants.select { |name| name.start_with?("EXPR_") }.sort - assert_equal(expected.size, actual.size) - expected.each do |const_name| - assert_equal(const_name.to_s.delete_prefix("EXPR_").to_sym, actual[Ripper.const_get(const_name)]) + assert_equal(expected, actual) + expected.zip(actual).each do |ripper, prism| + assert_equal(Ripper.const_get(ripper), Translation::Ripper.const_get(prism)) end end From 458f622c349f717e3cfbdb5f6d8e5726ce6da4a2 Mon Sep 17 00:00:00 2001 From: Earlopain <14981592+Earlopain@users.noreply.github.com> Date: Mon, 12 Jan 2026 14:36:13 +0100 Subject: [PATCH 304/333] Use one file for versioned `parser` classes One per version seems excessive. Do note that `rubocop-ast` used to require individual parser files. I wouldn't consider that to be part of the API since everything is autoloaded. From a GitHub code search, I didn't find anyone else doing it like that. --- lib/prism/translation.rb | 10 +++---- lib/prism/translation/parser33.rb | 13 -------- lib/prism/translation/parser34.rb | 13 -------- lib/prism/translation/parser35.rb | 8 ----- lib/prism/translation/parser40.rb | 13 -------- lib/prism/translation/parser41.rb | 13 -------- lib/prism/translation/parser_versions.rb | 36 +++++++++++++++++++++++ prism.gemspec | 12 ++------ rbi/prism/translation/parser33.rbi | 6 ---- rbi/prism/translation/parser34.rbi | 6 ---- rbi/prism/translation/parser35.rbi | 3 -- rbi/prism/translation/parser40.rbi | 6 ---- rbi/prism/translation/parser41.rbi | 6 ---- rbi/prism/translation/parser_versions.rbi | 23 +++++++++++++++ test/prism/ruby/parser_test.rb | 2 -- 15 files changed, 66 insertions(+), 104 deletions(-) delete mode 100644 lib/prism/translation/parser33.rb delete mode 100644 lib/prism/translation/parser34.rb delete mode 100644 lib/prism/translation/parser35.rb delete mode 100644 lib/prism/translation/parser40.rb delete mode 100644 lib/prism/translation/parser41.rb create mode 100644 lib/prism/translation/parser_versions.rb delete mode 100644 rbi/prism/translation/parser33.rbi delete mode 100644 rbi/prism/translation/parser34.rbi delete mode 100644 rbi/prism/translation/parser35.rbi delete mode 100644 rbi/prism/translation/parser40.rbi delete mode 100644 rbi/prism/translation/parser41.rbi create mode 100644 rbi/prism/translation/parser_versions.rbi diff --git a/lib/prism/translation.rb b/lib/prism/translation.rb index 89c70ee420..57b57135bc 100644 --- a/lib/prism/translation.rb +++ b/lib/prism/translation.rb @@ -7,11 +7,11 @@ module Prism module Translation # steep:ignore autoload :Parser, "prism/translation/parser" autoload :ParserCurrent, "prism/translation/parser_current" - autoload :Parser33, "prism/translation/parser33" - autoload :Parser34, "prism/translation/parser34" - autoload :Parser35, "prism/translation/parser35" - autoload :Parser40, "prism/translation/parser40" - autoload :Parser41, "prism/translation/parser41" + autoload :Parser33, "prism/translation/parser_versions" + autoload :Parser34, "prism/translation/parser_versions" + autoload :Parser35, "prism/translation/parser_versions" + autoload :Parser40, "prism/translation/parser_versions" + autoload :Parser41, "prism/translation/parser_versions" autoload :Ripper, "prism/translation/ripper" autoload :RubyParser, "prism/translation/ruby_parser" end diff --git a/lib/prism/translation/parser33.rb b/lib/prism/translation/parser33.rb deleted file mode 100644 index 0a59669465..0000000000 --- a/lib/prism/translation/parser33.rb +++ /dev/null @@ -1,13 +0,0 @@ -# frozen_string_literal: true -# :markup: markdown - -module Prism - module Translation - # This class is the entry-point for Ruby 3.3 of `Prism::Translation::Parser`. - class Parser33 < Parser - def version # :nodoc: - 33 - end - end - end -end diff --git a/lib/prism/translation/parser34.rb b/lib/prism/translation/parser34.rb deleted file mode 100644 index 566a23fadb..0000000000 --- a/lib/prism/translation/parser34.rb +++ /dev/null @@ -1,13 +0,0 @@ -# frozen_string_literal: true -# :markup: markdown - -module Prism - module Translation - # This class is the entry-point for Ruby 3.4 of `Prism::Translation::Parser`. - class Parser34 < Parser - def version # :nodoc: - 34 - end - end - end -end diff --git a/lib/prism/translation/parser35.rb b/lib/prism/translation/parser35.rb deleted file mode 100644 index 52eeeb6c8c..0000000000 --- a/lib/prism/translation/parser35.rb +++ /dev/null @@ -1,8 +0,0 @@ -# frozen_string_literal: true -# :markup: markdown - -module Prism - module Translation - Parser35 = Parser40 # :nodoc: - end -end diff --git a/lib/prism/translation/parser40.rb b/lib/prism/translation/parser40.rb deleted file mode 100644 index 2ec7445882..0000000000 --- a/lib/prism/translation/parser40.rb +++ /dev/null @@ -1,13 +0,0 @@ -# frozen_string_literal: true -# :markup: markdown - -module Prism - module Translation - # This class is the entry-point for Ruby 4.0 of `Prism::Translation::Parser`. - class Parser40 < Parser - def version # :nodoc: - 40 - end - end - end -end diff --git a/lib/prism/translation/parser41.rb b/lib/prism/translation/parser41.rb deleted file mode 100644 index ed81906400..0000000000 --- a/lib/prism/translation/parser41.rb +++ /dev/null @@ -1,13 +0,0 @@ -# frozen_string_literal: true -# :markup: markdown - -module Prism - module Translation - # This class is the entry-point for Ruby 4.1 of `Prism::Translation::Parser`. - class Parser41 < Parser - def version # :nodoc: - 41 - end - end - end -end diff --git a/lib/prism/translation/parser_versions.rb b/lib/prism/translation/parser_versions.rb new file mode 100644 index 0000000000..720c7d548c --- /dev/null +++ b/lib/prism/translation/parser_versions.rb @@ -0,0 +1,36 @@ +# frozen_string_literal: true +# :markup: markdown + +module Prism + module Translation + # This class is the entry-point for Ruby 3.3 of `Prism::Translation::Parser`. + class Parser33 < Parser + def version # :nodoc: + 33 + end + end + + # This class is the entry-point for Ruby 3.4 of `Prism::Translation::Parser`. + class Parser34 < Parser + def version # :nodoc: + 34 + end + end + + # This class is the entry-point for Ruby 4.0 of `Prism::Translation::Parser`. + class Parser40 < Parser + def version # :nodoc: + 40 + end + end + + Parser35 = Parser40 # :nodoc: + + # This class is the entry-point for Ruby 4.1 of `Prism::Translation::Parser`. + class Parser41 < Parser + def version # :nodoc: + 41 + end + end + end +end diff --git a/prism.gemspec b/prism.gemspec index a45e0d93e7..6a3bed32d8 100644 --- a/prism.gemspec +++ b/prism.gemspec @@ -99,11 +99,7 @@ Gem::Specification.new do |spec| "lib/prism/translation.rb", "lib/prism/translation/parser.rb", "lib/prism/translation/parser_current.rb", - "lib/prism/translation/parser33.rb", - "lib/prism/translation/parser34.rb", - "lib/prism/translation/parser35.rb", - "lib/prism/translation/parser40.rb", - "lib/prism/translation/parser41.rb", + "lib/prism/translation/parser_versions.rb", "lib/prism/translation/parser/builder.rb", "lib/prism/translation/parser/compiler.rb", "lib/prism/translation/parser/lexer.rb", @@ -123,11 +119,7 @@ Gem::Specification.new do |spec| "rbi/prism/reflection.rbi", "rbi/prism/string_query.rbi", "rbi/prism/translation/parser.rbi", - "rbi/prism/translation/parser33.rbi", - "rbi/prism/translation/parser34.rbi", - "rbi/prism/translation/parser35.rbi", - "rbi/prism/translation/parser40.rbi", - "rbi/prism/translation/parser41.rbi", + "rbi/prism/translation/parser_versions.rbi", "rbi/prism/translation/ripper.rbi", "rbi/prism/visitor.rbi", "sig/prism.rbs", diff --git a/rbi/prism/translation/parser33.rbi b/rbi/prism/translation/parser33.rbi deleted file mode 100644 index de3f73131d..0000000000 --- a/rbi/prism/translation/parser33.rbi +++ /dev/null @@ -1,6 +0,0 @@ -# typed: strict - -class Prism::Translation::Parser33 < Prism::Translation::Parser - sig { override.returns(Integer) } - def version; end -end diff --git a/rbi/prism/translation/parser34.rbi b/rbi/prism/translation/parser34.rbi deleted file mode 100644 index 34fee5030b..0000000000 --- a/rbi/prism/translation/parser34.rbi +++ /dev/null @@ -1,6 +0,0 @@ -# typed: strict - -class Prism::Translation::Parser34 < Prism::Translation::Parser - sig { override.returns(Integer) } - def version; end -end diff --git a/rbi/prism/translation/parser35.rbi b/rbi/prism/translation/parser35.rbi deleted file mode 100644 index 86b590fb07..0000000000 --- a/rbi/prism/translation/parser35.rbi +++ /dev/null @@ -1,3 +0,0 @@ -# typed: strict - -Prism::Translation::Parser35 = Prism::Translation::Parser40 diff --git a/rbi/prism/translation/parser40.rbi b/rbi/prism/translation/parser40.rbi deleted file mode 100644 index 218682365b..0000000000 --- a/rbi/prism/translation/parser40.rbi +++ /dev/null @@ -1,6 +0,0 @@ -# typed: strict - -class Prism::Translation::Parser40 < Prism::Translation::Parser - sig { override.returns(Integer) } - def version; end -end diff --git a/rbi/prism/translation/parser41.rbi b/rbi/prism/translation/parser41.rbi deleted file mode 100644 index 218682365b..0000000000 --- a/rbi/prism/translation/parser41.rbi +++ /dev/null @@ -1,6 +0,0 @@ -# typed: strict - -class Prism::Translation::Parser40 < Prism::Translation::Parser - sig { override.returns(Integer) } - def version; end -end diff --git a/rbi/prism/translation/parser_versions.rbi b/rbi/prism/translation/parser_versions.rbi new file mode 100644 index 0000000000..8a7297be3e --- /dev/null +++ b/rbi/prism/translation/parser_versions.rbi @@ -0,0 +1,23 @@ +# typed: strict + +class Prism::Translation::Parser33 < Prism::Translation::Parser + sig { override.returns(Integer) } + def version; end +end + +class Prism::Translation::Parser34 < Prism::Translation::Parser + sig { override.returns(Integer) } + def version; end +end + +class Prism::Translation::Parser40 < Prism::Translation::Parser + sig { override.returns(Integer) } + def version; end +end + +Prism::Translation::Parser35 = Prism::Translation::Parser40 + +class Prism::Translation::Parser40 < Prism::Translation::Parser + sig { override.returns(Integer) } + def version; end +end diff --git a/test/prism/ruby/parser_test.rb b/test/prism/ruby/parser_test.rb index df290a6a8e..55c12cab6f 100644 --- a/test/prism/ruby/parser_test.rb +++ b/test/prism/ruby/parser_test.rb @@ -5,8 +5,6 @@ begin verbose, $VERBOSE = $VERBOSE, nil require "parser/ruby33" - require "prism/translation/parser33" - require "prism/translation/parser34" rescue LoadError # In CRuby's CI, we're not going to test against the parser gem because we # don't want to have to install it. So in this case we'll just skip this test. From 6631788b706544217ddbf9e067400ded64cccd9a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 12 Jan 2026 16:18:34 +0000 Subject: [PATCH 305/333] Bump the ruby-deps group across 7 directories with 1 update Bumps the ruby-deps group with 1 update in the /gemfiles/3.1 directory: [rbs](https://github.com/ruby/rbs). Bumps the ruby-deps group with 1 update in the /gemfiles/3.2 directory: [rbs](https://github.com/ruby/rbs). Bumps the ruby-deps group with 1 update in the /gemfiles/3.3 directory: [rbs](https://github.com/ruby/rbs). Bumps the ruby-deps group with 1 update in the /gemfiles/3.4 directory: [rbs](https://github.com/ruby/rbs). Bumps the ruby-deps group with 1 update in the /gemfiles/4.0 directory: [rbs](https://github.com/ruby/rbs). Bumps the ruby-deps group with 1 update in the /gemfiles/4.1 directory: [rbs](https://github.com/ruby/rbs). Bumps the ruby-deps group with 1 update in the /gemfiles/typecheck directory: [rbs](https://github.com/ruby/rbs). Updates `rbs` from 3.10.0 to 3.10.2 - [Release notes](https://github.com/ruby/rbs/releases) - [Changelog](https://github.com/ruby/rbs/blob/master/CHANGELOG.md) - [Commits](https://github.com/ruby/rbs/compare/v3.10.0...v3.10.2) Updates `rbs` from 3.10.0 to 3.10.2 - [Release notes](https://github.com/ruby/rbs/releases) - [Changelog](https://github.com/ruby/rbs/blob/master/CHANGELOG.md) - [Commits](https://github.com/ruby/rbs/compare/v3.10.0...v3.10.2) Updates `rbs` from 3.10.0 to 3.10.2 - [Release notes](https://github.com/ruby/rbs/releases) - [Changelog](https://github.com/ruby/rbs/blob/master/CHANGELOG.md) - [Commits](https://github.com/ruby/rbs/compare/v3.10.0...v3.10.2) Updates `rbs` from 3.10.0 to 3.10.2 - [Release notes](https://github.com/ruby/rbs/releases) - [Changelog](https://github.com/ruby/rbs/blob/master/CHANGELOG.md) - [Commits](https://github.com/ruby/rbs/compare/v3.10.0...v3.10.2) Updates `rbs` from 3.10.0 to 3.10.2 - [Release notes](https://github.com/ruby/rbs/releases) - [Changelog](https://github.com/ruby/rbs/blob/master/CHANGELOG.md) - [Commits](https://github.com/ruby/rbs/compare/v3.10.0...v3.10.2) Updates `rbs` from 3.10.0 to 3.10.2 - [Release notes](https://github.com/ruby/rbs/releases) - [Changelog](https://github.com/ruby/rbs/blob/master/CHANGELOG.md) - [Commits](https://github.com/ruby/rbs/compare/v3.10.0...v3.10.2) Updates `rbs` from 3.10.0 to 3.10.2 - [Release notes](https://github.com/ruby/rbs/releases) - [Changelog](https://github.com/ruby/rbs/blob/master/CHANGELOG.md) - [Commits](https://github.com/ruby/rbs/compare/v3.10.0...v3.10.2) --- updated-dependencies: - dependency-name: rbs dependency-version: 3.10.2 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps - dependency-name: rbs dependency-version: 3.10.2 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps - dependency-name: rbs dependency-version: 3.10.2 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps - dependency-name: rbs dependency-version: 3.10.2 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps - dependency-name: rbs dependency-version: 3.10.2 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps - dependency-name: rbs dependency-version: 3.10.2 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps - dependency-name: rbs dependency-version: 3.10.2 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps ... Signed-off-by: dependabot[bot] --- 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/4.0/Gemfile.lock | 2 +- gemfiles/4.1/Gemfile.lock | 2 +- gemfiles/typecheck/Gemfile.lock | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/gemfiles/3.1/Gemfile.lock b/gemfiles/3.1/Gemfile.lock index 7cdc907bef..90405a6ee6 100644 --- a/gemfiles/3.1/Gemfile.lock +++ b/gemfiles/3.1/Gemfile.lock @@ -21,7 +21,7 @@ GEM rake (13.3.1) rake-compiler (1.3.1) rake - rbs (3.10.0) + rbs (3.10.2) logger ruby_memcheck (3.0.1) nokogiri diff --git a/gemfiles/3.2/Gemfile.lock b/gemfiles/3.2/Gemfile.lock index 2541fa0bb8..03b6c11ec7 100644 --- a/gemfiles/3.2/Gemfile.lock +++ b/gemfiles/3.2/Gemfile.lock @@ -21,7 +21,7 @@ GEM rake (13.3.1) rake-compiler (1.3.1) rake - rbs (3.10.0) + rbs (3.10.2) logger ruby_memcheck (3.0.1) nokogiri diff --git a/gemfiles/3.3/Gemfile.lock b/gemfiles/3.3/Gemfile.lock index 4314831b7b..518470cc35 100644 --- a/gemfiles/3.3/Gemfile.lock +++ b/gemfiles/3.3/Gemfile.lock @@ -21,7 +21,7 @@ GEM rake (13.3.1) rake-compiler (1.3.1) rake - rbs (3.10.0) + rbs (3.10.2) logger ruby_memcheck (3.0.1) nokogiri diff --git a/gemfiles/3.4/Gemfile.lock b/gemfiles/3.4/Gemfile.lock index c4ee812565..695b0e979c 100644 --- a/gemfiles/3.4/Gemfile.lock +++ b/gemfiles/3.4/Gemfile.lock @@ -21,7 +21,7 @@ GEM rake (13.3.1) rake-compiler (1.3.1) rake - rbs (3.10.0) + rbs (3.10.2) logger ruby_memcheck (3.0.1) nokogiri diff --git a/gemfiles/4.0/Gemfile.lock b/gemfiles/4.0/Gemfile.lock index 4bf0b95561..a652b0a3d4 100644 --- a/gemfiles/4.0/Gemfile.lock +++ b/gemfiles/4.0/Gemfile.lock @@ -22,7 +22,7 @@ GEM rake (13.3.1) rake-compiler (1.3.1) rake - rbs (3.10.0) + rbs (3.10.2) logger ruby_memcheck (3.0.1) nokogiri diff --git a/gemfiles/4.1/Gemfile.lock b/gemfiles/4.1/Gemfile.lock index 509057ac63..efcf866916 100644 --- a/gemfiles/4.1/Gemfile.lock +++ b/gemfiles/4.1/Gemfile.lock @@ -22,7 +22,7 @@ GEM rake (13.3.1) rake-compiler (1.3.1) rake - rbs (3.10.0) + rbs (3.10.2) logger ruby_memcheck (3.0.1) nokogiri diff --git a/gemfiles/typecheck/Gemfile.lock b/gemfiles/typecheck/Gemfile.lock index d45846d32b..0d516a632b 100644 --- a/gemfiles/typecheck/Gemfile.lock +++ b/gemfiles/typecheck/Gemfile.lock @@ -55,7 +55,7 @@ GEM rbi (0.3.7) prism (~> 1.0) rbs (>= 3.4.4) - rbs (3.10.0) + rbs (3.10.2) logger rexml (3.4.4) ruby_parser (3.22.0) From acb7e70067ca8f464e1ef10b967c23a7f05105d7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 12 Jan 2026 20:44:21 +0000 Subject: [PATCH 306/333] Bump org.junit.jupiter:junit-jupiter-engine Bumps the java-deps group in /java-wasm with 1 update: [org.junit.jupiter:junit-jupiter-engine](https://github.com/junit-team/junit-framework). Updates `org.junit.jupiter:junit-jupiter-engine` from 6.0.1 to 6.0.2 - [Release notes](https://github.com/junit-team/junit-framework/releases) - [Commits](https://github.com/junit-team/junit-framework/compare/r6.0.1...r6.0.2) --- updated-dependencies: - dependency-name: org.junit.jupiter:junit-jupiter-engine dependency-version: 6.0.2 dependency-type: direct:development update-type: version-update:semver-patch dependency-group: java-deps ... Signed-off-by: dependabot[bot] --- java-wasm/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java-wasm/pom.xml b/java-wasm/pom.xml index 0d0a301dda..111d6020f1 100644 --- a/java-wasm/pom.xml +++ b/java-wasm/pom.xml @@ -16,7 +16,7 @@ 11 1.6.1 - 6.0.1 + 6.0.2 From 9c12be6e6a1ba7a0781e2706ad26f220ef229ded Mon Sep 17 00:00:00 2001 From: Takashi Kokubun Date: Mon, 12 Jan 2026 17:29:29 -0800 Subject: [PATCH 307/333] Bump to v1.8.0 --- CHANGELOG.md | 18 +++++++++++++++++- 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/4.0/Gemfile.lock | 2 +- gemfiles/4.1/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 +- 22 files changed, 41 insertions(+), 25 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c25ca88336..47309f6955 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,21 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). +## [1.8.0] - 2026-01-12 + +### Added + +- Optimize ruby visitor. +- Report unterminated construct errors at opening token. + +### Changed + +- Correctly expose ripper state. +- Use one file for versioned parser classes. +- Fix denominator of rational float literal. +- Decouple ripper translator from ripper library. +- Sync Prism::Translation::ParserCurrent with Ruby 4.0. + ## [Unreleased] ## [1.7.0] - 2025-12-18 @@ -716,7 +731,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.7.0...HEAD +[unreleased]: https://github.com/ruby/prism/compare/v1.8.0...HEAD +[1.8.0]: https://github.com/ruby/prism/compare/v1.7.0...v1.8.0 [1.7.0]: https://github.com/ruby/prism/compare/v1.6.0...v1.7.0 [1.6.0]: https://github.com/ruby/prism/compare/v1.5.2...v1.6.0 [1.5.2]: https://github.com/ruby/prism/compare/v1.5.1...v1.5.2 diff --git a/Gemfile.lock b/Gemfile.lock index 0a320f9204..be87f10dc9 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - prism (1.7.0) + prism (1.8.0) GEM remote: https://rubygems.org/ diff --git a/ext/prism/extension.h b/ext/prism/extension.h index 6c3de31adb..510faa48e8 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.7.0" +#define EXPECTED_PRISM_VERSION "1.8.0" #include #include diff --git a/gemfiles/2.7/Gemfile.lock b/gemfiles/2.7/Gemfile.lock index fa6ec04127..3fa115850d 100644 --- a/gemfiles/2.7/Gemfile.lock +++ b/gemfiles/2.7/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: ../.. specs: - prism (1.7.0) + prism (1.8.0) GEM remote: https://rubygems.org/ diff --git a/gemfiles/3.0/Gemfile.lock b/gemfiles/3.0/Gemfile.lock index e9dd35d5ed..303edfa80a 100644 --- a/gemfiles/3.0/Gemfile.lock +++ b/gemfiles/3.0/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: ../.. specs: - prism (1.7.0) + prism (1.8.0) GEM remote: https://rubygems.org/ diff --git a/gemfiles/3.1/Gemfile.lock b/gemfiles/3.1/Gemfile.lock index 90405a6ee6..3fbbe68884 100644 --- a/gemfiles/3.1/Gemfile.lock +++ b/gemfiles/3.1/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: ../.. specs: - prism (1.7.0) + prism (1.8.0) GEM remote: https://rubygems.org/ diff --git a/gemfiles/3.2/Gemfile.lock b/gemfiles/3.2/Gemfile.lock index 03b6c11ec7..e9ff984487 100644 --- a/gemfiles/3.2/Gemfile.lock +++ b/gemfiles/3.2/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: ../.. specs: - prism (1.7.0) + prism (1.8.0) GEM remote: https://rubygems.org/ diff --git a/gemfiles/3.3/Gemfile.lock b/gemfiles/3.3/Gemfile.lock index 518470cc35..41b37733e4 100644 --- a/gemfiles/3.3/Gemfile.lock +++ b/gemfiles/3.3/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: ../.. specs: - prism (1.7.0) + prism (1.8.0) GEM remote: https://rubygems.org/ diff --git a/gemfiles/3.4/Gemfile.lock b/gemfiles/3.4/Gemfile.lock index 695b0e979c..11aa5853ae 100644 --- a/gemfiles/3.4/Gemfile.lock +++ b/gemfiles/3.4/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: ../.. specs: - prism (1.7.0) + prism (1.8.0) GEM remote: https://rubygems.org/ diff --git a/gemfiles/4.0/Gemfile.lock b/gemfiles/4.0/Gemfile.lock index a652b0a3d4..1423f41818 100644 --- a/gemfiles/4.0/Gemfile.lock +++ b/gemfiles/4.0/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: ../.. specs: - prism (1.7.0) + prism (1.8.0) GEM remote: https://rubygems.org/ diff --git a/gemfiles/4.1/Gemfile.lock b/gemfiles/4.1/Gemfile.lock index efcf866916..a727c5e240 100644 --- a/gemfiles/4.1/Gemfile.lock +++ b/gemfiles/4.1/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: ../.. specs: - prism (1.7.0) + prism (1.8.0) GEM remote: https://rubygems.org/ diff --git a/gemfiles/typecheck/Gemfile.lock b/gemfiles/typecheck/Gemfile.lock index 0d516a632b..3b62db5c28 100644 --- a/gemfiles/typecheck/Gemfile.lock +++ b/gemfiles/typecheck/Gemfile.lock @@ -43,7 +43,7 @@ GEM ast (~> 2.4.1) racc power_assert (3.0.1) - prism (1.7.0) + prism (1.8.0) racc (1.8.1) rainbow (3.1.1) rake (13.3.1) diff --git a/include/prism/version.h b/include/prism/version.h index 0b64a70dff..0ef7435c17 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 7 +#define PRISM_VERSION_MINOR 8 /** * 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.7.0" +#define PRISM_VERSION "1.8.0" #endif diff --git a/javascript/package.json b/javascript/package.json index 570298da18..e99e83e219 100644 --- a/javascript/package.json +++ b/javascript/package.json @@ -1,6 +1,6 @@ { "name": "@ruby/prism", - "version": "1.7.0", + "version": "1.8.0", "description": "Prism Ruby parser", "type": "module", "main": "src/index.js", diff --git a/prism.gemspec b/prism.gemspec index 9f5d458d6c..463387e55c 100644 --- a/prism.gemspec +++ b/prism.gemspec @@ -2,7 +2,7 @@ Gem::Specification.new do |spec| spec.name = "prism" - spec.version = "1.7.0" + spec.version = "1.8.0" spec.authors = ["Shopify"] spec.email = ["ruby@shopify.com"] diff --git a/rust/Cargo.lock b/rust/Cargo.lock index 68ee9317d9..70d1bb1e99 100644 --- a/rust/Cargo.lock +++ b/rust/Cargo.lock @@ -202,7 +202,7 @@ checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" [[package]] name = "ruby-prism" -version = "1.7.0" +version = "1.8.0" dependencies = [ "ruby-prism-sys", "serde", @@ -211,7 +211,7 @@ dependencies = [ [[package]] name = "ruby-prism-sys" -version = "1.7.0" +version = "1.8.0" dependencies = [ "bindgen", "cc", diff --git a/rust/ruby-prism-sys/Cargo.toml b/rust/ruby-prism-sys/Cargo.toml index ee0c87f31a..d4db645e2a 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.7.0" +version = "1.8.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 e65fb8119a..00db216347 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.7.0"); + assert_eq!(&cstring.to_string_lossy(), "1.8.0"); } #[test] diff --git a/rust/ruby-prism/Cargo.toml b/rust/ruby-prism/Cargo.toml index 14c156a4b8..c3bb4cfc7a 100644 --- a/rust/ruby-prism/Cargo.toml +++ b/rust/ruby-prism/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ruby-prism" -version = "1.7.0" +version = "1.8.0" edition = "2021" license-file = "../../LICENSE.md" repository = "https://github.com/ruby/prism" @@ -26,7 +26,7 @@ serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" [dependencies] -ruby-prism-sys = { version = "1.7.0", path = "../ruby-prism-sys" } +ruby-prism-sys = { version = "1.8.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 1b86b5313d..7288aecc17 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) 7, "prism minor version does not match"); + expect((byte) 8, "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 dd113ba9ee..6a09098344 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 = 7; +const MINOR_VERSION = 8; 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 63f97dddd7..6902df5c01 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 = 7 + MINOR_VERSION = 8 # The patch version of prism that we are expecting to find in the serialized # strings. From 8d1894ca87c2f603ed00ed05548d598136172e14 Mon Sep 17 00:00:00 2001 From: Takashi Kokubun Date: Mon, 12 Jan 2026 17:37:40 -0800 Subject: [PATCH 308/333] Revert updating prism in typecheck --- gemfiles/typecheck/Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gemfiles/typecheck/Gemfile.lock b/gemfiles/typecheck/Gemfile.lock index 3b62db5c28..0d516a632b 100644 --- a/gemfiles/typecheck/Gemfile.lock +++ b/gemfiles/typecheck/Gemfile.lock @@ -43,7 +43,7 @@ GEM ast (~> 2.4.1) racc power_assert (3.0.1) - prism (1.8.0) + prism (1.7.0) racc (1.8.1) rainbow (3.1.1) rake (13.3.1) From 2c5826b39f28f92dfd86f4e496bdf7944c7c7dcd Mon Sep 17 00:00:00 2001 From: Earlopain <14981592+Earlopain@users.noreply.github.com> Date: Tue, 13 Jan 2026 19:35:21 +0100 Subject: [PATCH 309/333] Make irb work with the ripper shim This is everything that `irb` uses. It works in their test-suite, but there are 20 failures when using the shim that I haven't looked into at all. `parse` is not used by `irb`. `scan` is, and it's basically `parse` but also including errors. `irb` doesn't seem to care about the errors, so I didn't implement that. --- lib/prism/translation/ripper/lexer.rb | 88 ++++++++++++++++++++++++++- test/prism/ruby/ripper_test.rb | 48 +++++++++++++-- 2 files changed, 131 insertions(+), 5 deletions(-) diff --git a/lib/prism/translation/ripper/lexer.rb b/lib/prism/translation/ripper/lexer.rb index ed02e96574..787181b5a7 100644 --- a/lib/prism/translation/ripper/lexer.rb +++ b/lib/prism/translation/ripper/lexer.rb @@ -6,7 +6,7 @@ module Prism module Translation class Ripper - class Lexer # :nodoc: + class Lexer < Ripper # :nodoc: # :stopdoc: class State @@ -39,6 +39,92 @@ def allbits?(i) to_int.allbits?(i) end def anybits?(i) to_int.anybits?(i) end def nobits?(i) to_int.nobits?(i) end end + + class Elem + attr_accessor :pos, :event, :tok, :state, :message + + def initialize(pos, event, tok, state, message = nil) + @pos = pos + @event = event + @tok = tok + @state = State.new(state) + @message = message + end + + def [](index) + case index + when 0, :pos + @pos + when 1, :event + @event + when 2, :tok + @tok + when 3, :state + @state + when 4, :message + @message + else + nil + end + end + + def inspect + "#<#{self.class}: #{event}@#{pos[0]}:#{pos[1]}:#{state}: #{tok.inspect}#{": " if message}#{message}>" + end + + alias to_s inspect + + def pretty_print(q) + q.group(2, "#<#{self.class}:", ">") { + q.breakable + q.text("#{event}@#{pos[0]}:#{pos[1]}") + q.breakable + state.pretty_print(q) + q.breakable + q.text("token: ") + tok.pretty_print(q) + if message + q.breakable + q.text("message: ") + q.text(message) + end + } + end + + def to_a + if @message + [@pos, @event, @tok, @state, @message] + else + [@pos, @event, @tok, @state] + end + end + end + + def initialize(...) + super + @lex_compat = Prism.lex_compat(@source, filepath: filename, line: lineno) + end + + # Returns the lex_compat result wrapped in `Elem`. Errors are omitted. + # Since ripper is a streaming parser, tokens are expected to be emitted in the order + # that the parser encounters them. This is not implemented. + def parse(raise_errors: false) + if @lex_compat.failure? && raise_errors + raise SyntaxError, @lex_compat.errors.first.message + else + @lex_compat.value.map do |position, event, token, state| + Elem.new(position, event, token, state.to_int) + end + end + end + + # Similar to parse but ripper sorts the elements by position in the source. Also + # includes errors. Since prism does error recovery, in cases of syntax errors + # the result may differ greatly compared to ripper. + def scan(...) + parse(...) + end + # :startdoc: end end diff --git a/test/prism/ruby/ripper_test.rb b/test/prism/ruby/ripper_test.rb index bbd85585a9..2bd9c2fe4a 100644 --- a/test/prism/ruby/ripper_test.rb +++ b/test/prism/ruby/ripper_test.rb @@ -38,7 +38,7 @@ class RipperTest < TestCase end # Skip these tests that we haven't implemented yet. - omitted = [ + omitted_sexp_raw = [ "dos_endings.txt", "heredocs_with_fake_newlines.txt", "heredocs_with_ignored_newlines.txt", @@ -59,8 +59,29 @@ class RipperTest < TestCase "whitequark/slash_newline_in_heredocs.txt" ] - Fixture.each_for_current_ruby(except: incorrect | omitted) do |fixture| - define_method(fixture.test_name) { assert_ripper(fixture.read) } + omitted_lexer_parse = [ + "comments.txt", + "heredoc_percent_q_newline_delimiter.txt", + "heredoc_with_escaped_newline_at_start.txt", + "heredocs_with_fake_newlines.txt", + "indented_file_end.txt", + "seattlerb/TestRubyParserShared.txt", + "seattlerb/class_comments.txt", + "seattlerb/module_comments.txt", + "seattlerb/parse_line_block_inline_comment_leading_newlines.txt", + "seattlerb/parse_line_block_inline_multiline_comment.txt", + "spanning_heredoc_newlines.txt", + "strings.txt", + "whitequark/dedenting_heredoc.txt", + "whitequark/procarg0.txt", + ] + + Fixture.each_for_current_ruby(except: incorrect | omitted_sexp_raw) do |fixture| + define_method("#{fixture.test_name}_sexp_raw") { assert_ripper_sexp_raw(fixture.read) } + end + + Fixture.each_for_current_ruby(except: incorrect | omitted_lexer_parse) do |fixture| + define_method("#{fixture.test_name}_lexer_parse") { assert_ripper_lexer_parse(fixture.read) } end # Check that the hardcoded values don't change without us noticing. @@ -76,8 +97,27 @@ def test_internals private - def assert_ripper(source) + def assert_ripper_sexp_raw(source) assert_equal Ripper.sexp_raw(source), Prism::Translation::Ripper.sexp_raw(source) end + + def assert_ripper_lexer_parse(source) + prism = Translation::Ripper::Lexer.new(source).parse + ripper = Ripper::Lexer.new(source).parse + ripper.reject! { |elem| elem.event == :on_sp } # Prism doesn't emit on_sp + ripper.sort_by!(&:pos) # Prism emits tokens by their order in the code, not in parse order + + [prism.size, ripper.size].max.times do |i| + expected = ripper[i].to_a + actual = prism[i].to_a + # Since tokens related to heredocs are not emitted in the same order, + # the state also doesn't line up. + if expected[1] == :on_heredoc_end && actual[1] == :on_heredoc_end + expected[3] = actual[3] = nil + end + + assert_equal(expected, actual) + end + end end end From 219ee356d2f7952cd81d800e14dc72d8c57503cf Mon Sep 17 00:00:00 2001 From: Earlopain <14981592+Earlopain@users.noreply.github.com> Date: Wed, 14 Jan 2026 13:23:47 +0100 Subject: [PATCH 310/333] Update ripper translation docs * Prefer `Prism::Translation::Ripper` over the ripper shim * Don't list what is available (`Ripper::SexpBuilder` is nodoc) --- docs/ripper_translation.md | 25 ++++++++----------------- 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/docs/ripper_translation.md b/docs/ripper_translation.md index 196eeb811c..92bbe74569 100644 --- a/docs/ripper_translation.md +++ b/docs/ripper_translation.md @@ -1,22 +1,6 @@ # Ripper translation -Prism provides the ability to mirror the `Ripper` standard library. You can do this by: - -```ruby -require "prism/translation/ripper/shim" -``` - -This provides the APIs like: - -```ruby -Ripper.lex -Ripper.parse -Ripper.sexp_raw -Ripper.sexp - -Ripper::SexpBuilder -Ripper::SexpBuilderPP -``` +Prism provides the ability to mirror the `Ripper` standard library. It is available under `Prism::Translation::Ripper`. You can use the entire public API, and also some undocumented features that are commonly used. Briefly, `Ripper` is a streaming parser that allows you to construct your own syntax tree. As an example: @@ -49,6 +33,13 @@ ArithmeticRipper.new("1 + 2 - 3").parse # => [0] The exact names of the `on_*` methods are listed in the `Ripper` source. +You can can also automatically use the ripper translation in places that don't explicitly use the translation layer by doing the following: + +```ruby +# Will redirect access of the `Ripper` constant to `Prism::Translation::Ripper`. +require "prism/translation/ripper/shim" +``` + ## Background It is helpful to understand the differences between the `Ripper` library and the `Prism` library. Both libraries perform parsing and provide you with APIs to manipulate and understand the resulting syntax tree. However, there are a few key differences. From 8f69c5af08650c113fd68c2a75ba30b06b506e2f Mon Sep 17 00:00:00 2001 From: Earlopain <14981592+Earlopain@users.noreply.github.com> Date: Thu, 15 Jan 2026 21:47:26 +0100 Subject: [PATCH 311/333] Fix locations for invalid syntax when using `expect1_opening` Followup to https://github.com/ruby/prism/pull/3827 It sets the start to the opening but it should instead just continue on as usual. Fixes https://github.com/ruby/prism/issues/3851 Notice how the AST actually contains "123" in both the body and end keyword. --- src/prism.c | 2 +- test/prism/errors_test.rb | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/prism.c b/src/prism.c index b36a6da204..b158e505b2 100644 --- a/src/prism.c +++ b/src/prism.c @@ -12438,7 +12438,7 @@ expect1_opening(pm_parser_t *parser, pm_token_type_t type, pm_diagnostic_id_t di pm_parser_err(parser, opening->start, opening->end, diag_id); - parser->previous.start = opening->end; + parser->previous.start = parser->previous.end; parser->previous.type = PM_TOKEN_MISSING; } diff --git a/test/prism/errors_test.rb b/test/prism/errors_test.rb index 706b739557..aa264ae5b7 100644 --- a/test/prism/errors_test.rb +++ b/test/prism/errors_test.rb @@ -82,6 +82,11 @@ def test_regexp_encoding_option_mismatch_error assert_empty result.errors end + def test_incomplete_def_closing_loc + statement = Prism.parse_statement("def f; 123") + assert_empty(statement.end_keyword) + end + private def assert_errors(filepath, version) From 74bb12c8254b8fb9684e7395e0409084542e3a01 Mon Sep 17 00:00:00 2001 From: Earlopain <14981592+Earlopain@users.noreply.github.com> Date: Fri, 16 Jan 2026 10:47:18 +0100 Subject: [PATCH 312/333] Make the ripper shim work with rdoc The filter class is a 1:1 copy of ruby. rdoc has 32 test failures. It seems to expect `on_sp` in some cases to render code as written. --- lib/prism/translation/ripper.rb | 1 + lib/prism/translation/ripper/filter.rb | 53 ++++++++++++++++++++++++++ lib/prism/translation/ripper/lexer.rb | 16 +++----- prism.gemspec | 1 + rakelib/typecheck.rake | 1 + test/prism/ruby/ripper_test.rb | 32 +++++++++++----- 6 files changed, 84 insertions(+), 20 deletions(-) create mode 100644 lib/prism/translation/ripper/filter.rb diff --git a/lib/prism/translation/ripper.rb b/lib/prism/translation/ripper.rb index a901a72692..f70eb889dd 100644 --- a/lib/prism/translation/ripper.rb +++ b/lib/prism/translation/ripper.rb @@ -424,6 +424,7 @@ def self.sexp_raw(src, filename = "-", lineno = 1, raise_errors: false) end end + autoload :Filter, "prism/translation/ripper/filter" autoload :Lexer, "prism/translation/ripper/lexer" autoload :SexpBuilder, "prism/translation/ripper/sexp" autoload :SexpBuilderPP, "prism/translation/ripper/sexp" diff --git a/lib/prism/translation/ripper/filter.rb b/lib/prism/translation/ripper/filter.rb new file mode 100644 index 0000000000..19deef2d37 --- /dev/null +++ b/lib/prism/translation/ripper/filter.rb @@ -0,0 +1,53 @@ +# frozen_string_literal: true + +module Prism + module Translation + class Ripper + class Filter # :nodoc: + # :stopdoc: + def initialize(src, filename = '-', lineno = 1) + @__lexer = Lexer.new(src, filename, lineno) + @__line = nil + @__col = nil + @__state = nil + end + + def filename + @__lexer.filename + end + + def lineno + @__line + end + + def column + @__col + end + + def state + @__state + end + + def parse(init = nil) + data = init + @__lexer.lex.each do |pos, event, tok, state| + @__line, @__col = *pos + @__state = state + data = if respond_to?(event, true) + then __send__(event, tok, data) + else on_default(event, tok, data) + end + end + data + end + + private + + def on_default(event, token, data) + data + end + # :startdoc: + end + end + end +end diff --git a/lib/prism/translation/ripper/lexer.rb b/lib/prism/translation/ripper/lexer.rb index 787181b5a7..bd40fb4c5a 100644 --- a/lib/prism/translation/ripper/lexer.rb +++ b/lib/prism/translation/ripper/lexer.rb @@ -100,21 +100,17 @@ def to_a end end - def initialize(...) - super - @lex_compat = Prism.lex_compat(@source, filepath: filename, line: lineno) + # Pretty much just the same as Prism.lex_compat. + def lex(raise_errors: false) + Ripper.lex(@source, filename, lineno, raise_errors: raise_errors) end # Returns the lex_compat result wrapped in `Elem`. Errors are omitted. # Since ripper is a streaming parser, tokens are expected to be emitted in the order # that the parser encounters them. This is not implemented. - def parse(raise_errors: false) - if @lex_compat.failure? && raise_errors - raise SyntaxError, @lex_compat.errors.first.message - else - @lex_compat.value.map do |position, event, token, state| - Elem.new(position, event, token, state.to_int) - end + def parse(...) + lex(...).map do |position, event, token, state| + Elem.new(position, event, token, state.to_int) end end diff --git a/prism.gemspec b/prism.gemspec index 463387e55c..283c7b04aa 100644 --- a/prism.gemspec +++ b/prism.gemspec @@ -104,6 +104,7 @@ Gem::Specification.new do |spec| "lib/prism/translation/parser/compiler.rb", "lib/prism/translation/parser/lexer.rb", "lib/prism/translation/ripper.rb", + "lib/prism/translation/ripper/filter.rb", "lib/prism/translation/ripper/lexer.rb", "lib/prism/translation/ripper/sexp.rb", "lib/prism/translation/ripper/shim.rb", diff --git a/rakelib/typecheck.rake b/rakelib/typecheck.rake index 439af9a8fa..67e2d4ed56 100644 --- a/rakelib/typecheck.rake +++ b/rakelib/typecheck.rake @@ -26,6 +26,7 @@ namespace :typecheck do - ./lib/prism/visitor.rb - ./lib/prism/translation/parser/lexer.rb - ./lib/prism/translation/ripper.rb + - ./lib/prism/translation/ripper/filter.rb - ./lib/prism/translation/ripper/lexer.rb - ./lib/prism/translation/ripper/sexp.rb - ./lib/prism/translation/ruby_parser.rb diff --git a/test/prism/ruby/ripper_test.rb b/test/prism/ruby/ripper_test.rb index 2bd9c2fe4a..8f7ffa45bf 100644 --- a/test/prism/ruby/ripper_test.rb +++ b/test/prism/ruby/ripper_test.rb @@ -59,7 +59,7 @@ class RipperTest < TestCase "whitequark/slash_newline_in_heredocs.txt" ] - omitted_lexer_parse = [ + omitted_lex = [ "comments.txt", "heredoc_percent_q_newline_delimiter.txt", "heredoc_with_escaped_newline_at_start.txt", @@ -80,8 +80,20 @@ class RipperTest < TestCase define_method("#{fixture.test_name}_sexp_raw") { assert_ripper_sexp_raw(fixture.read) } end - Fixture.each_for_current_ruby(except: incorrect | omitted_lexer_parse) do |fixture| - define_method("#{fixture.test_name}_lexer_parse") { assert_ripper_lexer_parse(fixture.read) } + Fixture.each_for_current_ruby(except: incorrect | omitted_lex) do |fixture| + define_method("#{fixture.test_name}_lex") { assert_ripper_lex(fixture.read) } + end + + def test_lexer + lexer = Translation::Ripper::Lexer.new("foo") + expected = [[1, 0], :on_ident, "foo", Translation::Ripper::EXPR_CMDARG] + + assert_equal([expected], lexer.lex) + assert_equal(expected, lexer.parse[0].to_a) + assert_equal(lexer.parse[0].to_a, lexer.scan[0].to_a) + + assert_equal(%i[on_int on_op], Translation::Ripper::Lexer.new("1 +").lex.map(&:event)) + assert_raise(SyntaxError) { Translation::Ripper::Lexer.new("1 +").lex(raise_errors: true) } end # Check that the hardcoded values don't change without us noticing. @@ -101,15 +113,15 @@ def assert_ripper_sexp_raw(source) assert_equal Ripper.sexp_raw(source), Prism::Translation::Ripper.sexp_raw(source) end - def assert_ripper_lexer_parse(source) - prism = Translation::Ripper::Lexer.new(source).parse - ripper = Ripper::Lexer.new(source).parse - ripper.reject! { |elem| elem.event == :on_sp } # Prism doesn't emit on_sp - ripper.sort_by!(&:pos) # Prism emits tokens by their order in the code, not in parse order + def assert_ripper_lex(source) + prism = Translation::Ripper.lex(source) + ripper = Ripper.lex(source) + ripper.reject! { |elem| elem[1] == :on_sp } # Prism doesn't emit on_sp + ripper.sort_by! { |elem| elem[0] } # Prism emits tokens by their order in the code, not in parse order [prism.size, ripper.size].max.times do |i| - expected = ripper[i].to_a - actual = prism[i].to_a + expected = ripper[i] + actual = prism[i] # Since tokens related to heredocs are not emitted in the same order, # the state also doesn't line up. if expected[1] == :on_heredoc_end && actual[1] == :on_heredoc_end From e77545f8b54ff474d62990a9abbd290f23509d1d Mon Sep 17 00:00:00 2001 From: Earlopain <14981592+Earlopain@users.noreply.github.com> Date: Fri, 16 Jan 2026 11:52:39 +0100 Subject: [PATCH 313/333] Add `Ripper.tokenize` to translation layer It's public API and trivial to implement. --- lib/prism/translation/ripper.rb | 13 +++++++++++++ test/prism/ruby/ripper_test.rb | 5 +++++ 2 files changed, 18 insertions(+) diff --git a/lib/prism/translation/ripper.rb b/lib/prism/translation/ripper.rb index a901a72692..6552d2dbb8 100644 --- a/lib/prism/translation/ripper.rb +++ b/lib/prism/translation/ripper.rb @@ -78,6 +78,19 @@ def self.lex(src, filename = "-", lineno = 1, raise_errors: false) end end + # Tokenizes the Ruby program and returns an array of strings. + # The +filename+ and +lineno+ arguments are mostly ignored, since the + # return value is just the tokenized input. + # By default, this method does not handle syntax errors in +src+, + # use the +raise_errors+ keyword to raise a SyntaxError for an error in +src+. + # + # p Ripper.tokenize("def m(a) nil end") + # # => ["def", " ", "m", "(", "a", ")", " ", "nil", " ", "end"] + # + def self.tokenize(...) + lex(...).map(&:value) + end + # This contains a table of all of the parser events and their # corresponding arity. PARSER_EVENT_TABLE = { diff --git a/test/prism/ruby/ripper_test.rb b/test/prism/ruby/ripper_test.rb index 2bd9c2fe4a..cac20a073d 100644 --- a/test/prism/ruby/ripper_test.rb +++ b/test/prism/ruby/ripper_test.rb @@ -84,6 +84,11 @@ class RipperTest < TestCase define_method("#{fixture.test_name}_lexer_parse") { assert_ripper_lexer_parse(fixture.read) } end + def test_tokenize + source = "foo;1;BAZ" + assert_equal(Ripper.tokenize(source), Translation::Ripper.tokenize(source)) + end + # Check that the hardcoded values don't change without us noticing. def test_internals actual = Translation::Ripper.constants.select { |name| name.start_with?("EXPR_") }.sort From 2792ac78cae2e2be64d894e59d3c25a22a74c07d Mon Sep 17 00:00:00 2001 From: Earlopain <14981592+Earlopain@users.noreply.github.com> Date: Sat, 17 Jan 2026 20:28:01 +0100 Subject: [PATCH 314/333] Fix ripper translator for `__END__` --- lib/prism/lex_compat.rb | 13 ++++--------- snapshots/__END__.txt | 18 ++++++++++++++++++ test/prism/fixtures/__END__.txt | 3 +++ 3 files changed, 25 insertions(+), 9 deletions(-) create mode 100644 snapshots/__END__.txt create mode 100644 test/prism/fixtures/__END__.txt diff --git a/lib/prism/lex_compat.rb b/lib/prism/lex_compat.rb index 46f6130357..b7c54178ac 100644 --- a/lib/prism/lex_compat.rb +++ b/lib/prism/lex_compat.rb @@ -225,14 +225,6 @@ def state end end - # Ripper doesn't include the rest of the token in the event, so we need to - # trim it down to just the content on the first line when comparing. - class EndContentToken < Token - def ==(other) # :nodoc: - [self[0], self[1], self[2][0..self[2].index("\n")], self[3]] == other - end - end - # Tokens where state should be ignored # used for :on_comment, :on_heredoc_end, :on_embexpr_end class IgnoreStateToken < Token @@ -680,7 +672,10 @@ def result token = case event when :on___end__ - EndContentToken.new([[lineno, column], event, value, lex_state]) + # Ripper doesn't include the rest of the token in the event, so we need to + # trim it down to just the content on the first line. + value = value[0..value.index("\n")] + Token.new([[lineno, column], event, value, lex_state]) when :on_comment IgnoreStateToken.new([[lineno, column], event, value, lex_state]) when :on_heredoc_end diff --git a/snapshots/__END__.txt b/snapshots/__END__.txt new file mode 100644 index 0000000000..786532cacb --- /dev/null +++ b/snapshots/__END__.txt @@ -0,0 +1,18 @@ +@ ProgramNode (location: (1,0)-(1,3)) +├── flags: ∅ +├── locals: [] +└── statements: + @ StatementsNode (location: (1,0)-(1,3)) + ├── flags: ∅ + └── body: (length: 1) + └── @ CallNode (location: (1,0)-(1,3)) + ├── flags: newline, variable_call, ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :foo + ├── message_loc: (1,0)-(1,3) = "foo" + ├── opening_loc: ∅ + ├── arguments: ∅ + ├── closing_loc: ∅ + ├── equal_loc: ∅ + └── block: ∅ diff --git a/test/prism/fixtures/__END__.txt b/test/prism/fixtures/__END__.txt new file mode 100644 index 0000000000..c0f4f28004 --- /dev/null +++ b/test/prism/fixtures/__END__.txt @@ -0,0 +1,3 @@ +foo +__END__ +Available in DATA constant From 0b22d9060a4c84cd7b418cbb15d95eacce352615 Mon Sep 17 00:00:00 2001 From: Benoit Daloze Date: Sun, 14 Dec 2025 15:07:21 +0100 Subject: [PATCH 315/333] Fix docs of opening_loc/closing_loc of BlockNode --- config.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/config.yml b/config.yml index 5e29d6fa18..4e5b077a35 100644 --- a/config.yml +++ b/config.yml @@ -1269,17 +1269,17 @@ nodes: - name: opening_loc type: location comment: | - Represents the location of the opening `|`. + Represents the location of the opening `{` or `do`. [1, 2, 3].each { |i| puts x } - ^ + ^ - name: closing_loc type: location comment: | - Represents the location of the closing `|`. + Represents the location of the closing `}` or `end`. [1, 2, 3].each { |i| puts x } - ^ + ^ comment: | Represents a block of ruby code. From 71fcb891e0198e97a712148f2f9613ca8d5ed74d Mon Sep 17 00:00:00 2001 From: Benoit Daloze Date: Sun, 14 Dec 2025 21:36:45 +0100 Subject: [PATCH 316/333] Simplify and optimize Prism::Node#tunnel * By comparing byte offsets which folds 3 branches into 1. * Also avoids allocation of Location objects. --- templates/lib/prism/node.rb.erb | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/templates/lib/prism/node.rb.erb b/templates/lib/prism/node.rb.erb index 066a0cea1b..181842e230 100644 --- a/templates/lib/prism/node.rb.erb +++ b/templates/lib/prism/node.rb.erb @@ -184,24 +184,14 @@ module Prism queue = [self] #: Array[Prism::node] result = [] #: Array[Prism::node] + line_offset = source.offsets[line - 1] or raise + search_offset = line_offset + column + while (node = queue.shift) result << node node.each_child_node do |child_node| - child_location = child_node.location - - start_line = child_location.start_line - end_line = child_location.end_line - - if start_line == end_line - if line == start_line && column >= child_location.start_column && column < child_location.end_column - queue << child_node - break - end - elsif (line == start_line && column >= child_location.start_column) || (line == end_line && column < child_location.end_column) - queue << child_node - break - elsif line > start_line && line < end_line + if child_node.start_offset <= search_offset && search_offset < child_node.end_offset queue << child_node break end From ff81a29ba5e1421da7c61e777a444ef3caa6704b Mon Sep 17 00:00:00 2001 From: Benoit Daloze Date: Mon, 15 Dec 2025 10:46:24 +0100 Subject: [PATCH 317/333] Add Prism::Source#line_to_byte_offset and replace direct accesses to offsets --- lib/prism/parse_result.rb | 9 +++++++ sig/prism/parse_result.rbs | 1 + templates/lib/prism/node.rb.erb | 3 +-- test/prism/ruby/source_test.rb | 47 +++++++++++++++++++++++++++++++++ 4 files changed, 58 insertions(+), 2 deletions(-) create mode 100644 test/prism/ruby/source_test.rb diff --git a/lib/prism/parse_result.rb b/lib/prism/parse_result.rb index 3570af136a..12d19da562 100644 --- a/lib/prism/parse_result.rb +++ b/lib/prism/parse_result.rb @@ -76,6 +76,15 @@ def slice(byte_offset, length) source.byteslice(byte_offset, length) or raise end + # Converts the line number to a byte offset corresponding to the start of that line + def line_to_byte_offset(line) + l = line - @start_line + if l < 0 || l >= offsets.size + raise ArgumentError, "line #{line} is out of range" + end + offsets[l] + end + # Binary search through the offsets to find the line number for the given # byte offset. def line(byte_offset) diff --git a/sig/prism/parse_result.rbs b/sig/prism/parse_result.rbs index e88e5f0664..d878ca2edd 100644 --- a/sig/prism/parse_result.rbs +++ b/sig/prism/parse_result.rbs @@ -14,6 +14,7 @@ module Prism def encoding: () -> Encoding def lines: () -> Array[String] def slice: (Integer byte_offset, Integer length) -> String + def line_to_byte_offset: (Integer line) -> Integer def line: (Integer byte_offset) -> Integer def line_start: (Integer byte_offset) -> Integer def line_end: (Integer byte_offset) -> Integer diff --git a/templates/lib/prism/node.rb.erb b/templates/lib/prism/node.rb.erb index 181842e230..8225bfb328 100644 --- a/templates/lib/prism/node.rb.erb +++ b/templates/lib/prism/node.rb.erb @@ -184,8 +184,7 @@ module Prism queue = [self] #: Array[Prism::node] result = [] #: Array[Prism::node] - line_offset = source.offsets[line - 1] or raise - search_offset = line_offset + column + search_offset = source.line_to_byte_offset(line) + column while (node = queue.shift) result << node diff --git a/test/prism/ruby/source_test.rb b/test/prism/ruby/source_test.rb new file mode 100644 index 0000000000..afd2825765 --- /dev/null +++ b/test/prism/ruby/source_test.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +require_relative "../test_helper" + +module Prism + class SourceTest < TestCase + def test_line_to_byte_offset + parse_result = Prism.parse(<<~SRC) + abcd + efgh + ijkl + SRC + source = parse_result.source + + assert_equal 0, source.line_to_byte_offset(1) + assert_equal 5, source.line_to_byte_offset(2) + assert_equal 10, source.line_to_byte_offset(3) + assert_equal 15, source.line_to_byte_offset(4) + e = assert_raise(ArgumentError) { source.line_to_byte_offset(5) } + assert_equal "line 5 is out of range", e.message + e = assert_raise(ArgumentError) { source.line_to_byte_offset(0) } + assert_equal "line 0 is out of range", e.message + e = assert_raise(ArgumentError) { source.line_to_byte_offset(-1) } + assert_equal "line -1 is out of range", e.message + end + + def test_line_to_byte_offset_with_start_line + parse_result = Prism.parse(<<~SRC, line: 11) + abcd + efgh + ijkl + SRC + source = parse_result.source + + assert_equal 0, source.line_to_byte_offset(11) + assert_equal 5, source.line_to_byte_offset(12) + assert_equal 10, source.line_to_byte_offset(13) + assert_equal 15, source.line_to_byte_offset(14) + e = assert_raise(ArgumentError) { source.line_to_byte_offset(15) } + assert_equal "line 15 is out of range", e.message + e = assert_raise(ArgumentError) { source.line_to_byte_offset(10) } + assert_equal "line 10 is out of range", e.message + e = assert_raise(ArgumentError) { source.line_to_byte_offset(9) } + assert_equal "line 9 is out of range", e.message + end + end +end From e86a28263cfcd81c8c64aabdb02aa92b3afbb0a7 Mon Sep 17 00:00:00 2001 From: Earlopain <14981592+Earlopain@users.noreply.github.com> Date: Mon, 19 Jan 2026 08:32:54 +0100 Subject: [PATCH 318/333] Remove duplicate lex tests `RipperTest` already does this (added in https://github.com/ruby/prism/pull/3849) Since it doesn't use the token classes, it also lists out all the excludes instead of just claiming some are passing. --- test/prism/lex_test.rb | 52 ++++-------------------------------------- 1 file changed, 5 insertions(+), 47 deletions(-) diff --git a/test/prism/lex_test.rb b/test/prism/lex_test.rb index 68e47a0964..ea4606d2fb 100644 --- a/test/prism/lex_test.rb +++ b/test/prism/lex_test.rb @@ -6,43 +6,6 @@ module Prism class LexTest < TestCase - except = [ - # https://bugs.ruby-lang.org/issues/21756 - "spanning_heredoc.txt", - # Prism emits a single string in some cases when ripper splits them up - "whitequark/dedenting_heredoc.txt", - "heredocs_with_fake_newlines.txt", - # Prism emits BEG for `on_regexp_end` - "spanning_heredoc_newlines.txt", - ] - - if RUBY_VERSION < "3.3.0" - # This file has changed behavior in Ripper in Ruby 3.3, so we skip it if - # we're on an earlier version. - except << "seattlerb/pct_w_heredoc_interp_nested.txt" - - # Ruby < 3.3.0 cannot parse heredocs where there are leading whitespace - # characters in the heredoc start. - # Example: <<~' EOF' or <<-' EOF' - # https://bugs.ruby-lang.org/issues/19539 - except << "heredocs_leading_whitespace.txt" - except << "whitequark/ruby_bug_19539.txt" - - # https://bugs.ruby-lang.org/issues/19025 - except << "whitequark/numparam_ruby_bug_19025.txt" - # https://bugs.ruby-lang.org/issues/18878 - except << "whitequark/ruby_bug_18878.txt" - # https://bugs.ruby-lang.org/issues/19281 - except << "whitequark/ruby_bug_19281.txt" - end - - # https://bugs.ruby-lang.org/issues/21168#note-5 - except << "command_method_call_2.txt" - - Fixture.each_for_current_ruby(except: except) do |fixture| - define_method(fixture.test_name) { assert_lex(fixture) } - end - def test_lex_file assert_nothing_raised do Prism.lex_file(__FILE__) @@ -83,16 +46,11 @@ def test_parse_lex_file end end - private - - def assert_lex(fixture) - source = fixture.read - - result = Prism.lex_compat(source, version: "current") - assert_equal [], result.errors - - Prism.lex_ripper(source).zip(result.value).each do |(ripper, prism)| - assert_equal ripper, prism + if RUBY_VERSION >= "3.3" + def test_lex_compare + prism = Prism.lex_compat(File.read(__FILE__), version: "current").value + ripper = Prism.lex_ripper(File.read(__FILE__)) + assert_equal(ripper, prism) end end end From 87293476118e0ebbf3b44fc7d00cf04c412f25d3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 19 Jan 2026 18:33:33 +0000 Subject: [PATCH 319/333] Bump org.codehaus.mojo:templating-maven-plugin Bumps the java-deps group in /java-wasm with 1 update: [org.codehaus.mojo:templating-maven-plugin](https://github.com/mojohaus/templating-maven-plugin). Updates `org.codehaus.mojo:templating-maven-plugin` from 3.0.0 to 3.1.0 - [Release notes](https://github.com/mojohaus/templating-maven-plugin/releases) - [Commits](https://github.com/mojohaus/templating-maven-plugin/compare/3.0.0...templating-maven-plugin-3.1.0) --- updated-dependencies: - dependency-name: org.codehaus.mojo:templating-maven-plugin dependency-version: 3.1.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: java-deps ... Signed-off-by: dependabot[bot] --- java-wasm/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java-wasm/pom.xml b/java-wasm/pom.xml index 111d6020f1..f69028bfd8 100644 --- a/java-wasm/pom.xml +++ b/java-wasm/pom.xml @@ -66,7 +66,7 @@ org.codehaus.mojo templating-maven-plugin - 3.0.0 + 3.1.0 filtering-java-templates From c19c7ee03d3fb29c37932d4b80de7dd4634d5be8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 19 Jan 2026 18:41:20 +0000 Subject: [PATCH 320/333] Bump the ruby-deps group across 9 directories with 1 update Bumps the ruby-deps group with 1 update in the /gemfiles/2.7 directory: [parser](https://github.com/whitequark/parser). Bumps the ruby-deps group with 1 update in the /gemfiles/3.0 directory: [parser](https://github.com/whitequark/parser). Bumps the ruby-deps group with 1 update in the /gemfiles/3.1 directory: [parser](https://github.com/whitequark/parser). Bumps the ruby-deps group with 1 update in the /gemfiles/3.2 directory: [parser](https://github.com/whitequark/parser). Bumps the ruby-deps group with 1 update in the /gemfiles/3.3 directory: [parser](https://github.com/whitequark/parser). Bumps the ruby-deps group with 1 update in the /gemfiles/3.4 directory: [parser](https://github.com/whitequark/parser). Bumps the ruby-deps group with 1 update in the /gemfiles/4.0 directory: [parser](https://github.com/whitequark/parser). Bumps the ruby-deps group with 1 update in the /gemfiles/4.1 directory: [parser](https://github.com/whitequark/parser). Bumps the ruby-deps group with 1 update in the /gemfiles/typecheck directory: [parser](https://github.com/whitequark/parser). Updates `parser` from 3.3.10.0 to 3.3.10.1 - [Changelog](https://github.com/whitequark/parser/blob/master/CHANGELOG.md) - [Commits](https://github.com/whitequark/parser/compare/v3.3.10.0...v3.3.10.1) Updates `parser` from 3.3.10.0 to 3.3.10.1 - [Changelog](https://github.com/whitequark/parser/blob/master/CHANGELOG.md) - [Commits](https://github.com/whitequark/parser/compare/v3.3.10.0...v3.3.10.1) Updates `parser` from 3.3.10.0 to 3.3.10.1 - [Changelog](https://github.com/whitequark/parser/blob/master/CHANGELOG.md) - [Commits](https://github.com/whitequark/parser/compare/v3.3.10.0...v3.3.10.1) Updates `parser` from 3.3.10.0 to 3.3.10.1 - [Changelog](https://github.com/whitequark/parser/blob/master/CHANGELOG.md) - [Commits](https://github.com/whitequark/parser/compare/v3.3.10.0...v3.3.10.1) Updates `parser` from 3.3.10.0 to 3.3.10.1 - [Changelog](https://github.com/whitequark/parser/blob/master/CHANGELOG.md) - [Commits](https://github.com/whitequark/parser/compare/v3.3.10.0...v3.3.10.1) Updates `parser` from 3.3.10.0 to 3.3.10.1 - [Changelog](https://github.com/whitequark/parser/blob/master/CHANGELOG.md) - [Commits](https://github.com/whitequark/parser/compare/v3.3.10.0...v3.3.10.1) Updates `parser` from 3.3.10.0 to 3.3.10.1 - [Changelog](https://github.com/whitequark/parser/blob/master/CHANGELOG.md) - [Commits](https://github.com/whitequark/parser/compare/v3.3.10.0...v3.3.10.1) Updates `parser` from 3.3.10.0 to 3.3.10.1 - [Changelog](https://github.com/whitequark/parser/blob/master/CHANGELOG.md) - [Commits](https://github.com/whitequark/parser/compare/v3.3.10.0...v3.3.10.1) Updates `parser` from 3.3.10.0 to 3.3.10.1 - [Changelog](https://github.com/whitequark/parser/blob/master/CHANGELOG.md) - [Commits](https://github.com/whitequark/parser/compare/v3.3.10.0...v3.3.10.1) --- updated-dependencies: - dependency-name: parser dependency-version: 3.3.10.1 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps - dependency-name: parser dependency-version: 3.3.10.1 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps - dependency-name: parser dependency-version: 3.3.10.1 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps - dependency-name: parser dependency-version: 3.3.10.1 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps - dependency-name: parser dependency-version: 3.3.10.1 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps - dependency-name: parser dependency-version: 3.3.10.1 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps - dependency-name: parser dependency-version: 3.3.10.1 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps - dependency-name: parser dependency-version: 3.3.10.1 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps - dependency-name: parser dependency-version: 3.3.10.1 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: ruby-deps ... Signed-off-by: dependabot[bot] --- 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/4.0/Gemfile.lock | 2 +- gemfiles/4.1/Gemfile.lock | 2 +- gemfiles/typecheck/Gemfile.lock | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/gemfiles/2.7/Gemfile.lock b/gemfiles/2.7/Gemfile.lock index 3fa115850d..9ade0c96f1 100644 --- a/gemfiles/2.7/Gemfile.lock +++ b/gemfiles/2.7/Gemfile.lock @@ -8,7 +8,7 @@ GEM specs: ast (2.4.3) onigmo (0.1.0) - parser (3.3.10.0) + parser (3.3.10.1) ast (~> 2.4.1) racc power_assert (3.0.1) diff --git a/gemfiles/3.0/Gemfile.lock b/gemfiles/3.0/Gemfile.lock index 303edfa80a..ad6244bfbd 100644 --- a/gemfiles/3.0/Gemfile.lock +++ b/gemfiles/3.0/Gemfile.lock @@ -13,7 +13,7 @@ GEM mini_portile2 (~> 2.8.2) racc (~> 1.4) onigmo (0.1.0) - parser (3.3.10.0) + parser (3.3.10.1) ast (~> 2.4.1) racc power_assert (3.0.1) diff --git a/gemfiles/3.1/Gemfile.lock b/gemfiles/3.1/Gemfile.lock index 3fbbe68884..54b6cbb4c2 100644 --- a/gemfiles/3.1/Gemfile.lock +++ b/gemfiles/3.1/Gemfile.lock @@ -13,7 +13,7 @@ GEM mini_portile2 (~> 2.8.2) racc (~> 1.4) onigmo (0.1.0) - parser (3.3.10.0) + parser (3.3.10.1) ast (~> 2.4.1) racc power_assert (3.0.1) diff --git a/gemfiles/3.2/Gemfile.lock b/gemfiles/3.2/Gemfile.lock index e9ff984487..c859d7f8d4 100644 --- a/gemfiles/3.2/Gemfile.lock +++ b/gemfiles/3.2/Gemfile.lock @@ -13,7 +13,7 @@ GEM mini_portile2 (~> 2.8.2) racc (~> 1.4) onigmo (0.1.0) - parser (3.3.10.0) + parser (3.3.10.1) ast (~> 2.4.1) racc power_assert (3.0.1) diff --git a/gemfiles/3.3/Gemfile.lock b/gemfiles/3.3/Gemfile.lock index 41b37733e4..74c43f1841 100644 --- a/gemfiles/3.3/Gemfile.lock +++ b/gemfiles/3.3/Gemfile.lock @@ -13,7 +13,7 @@ GEM mini_portile2 (~> 2.8.2) racc (~> 1.4) onigmo (0.1.0) - parser (3.3.10.0) + parser (3.3.10.1) ast (~> 2.4.1) racc power_assert (3.0.1) diff --git a/gemfiles/3.4/Gemfile.lock b/gemfiles/3.4/Gemfile.lock index 11aa5853ae..6588db982a 100644 --- a/gemfiles/3.4/Gemfile.lock +++ b/gemfiles/3.4/Gemfile.lock @@ -13,7 +13,7 @@ GEM mini_portile2 (~> 2.8.2) racc (~> 1.4) onigmo (0.1.0) - parser (3.3.10.0) + parser (3.3.10.1) ast (~> 2.4.1) racc power_assert (3.0.1) diff --git a/gemfiles/4.0/Gemfile.lock b/gemfiles/4.0/Gemfile.lock index 1423f41818..639c008144 100644 --- a/gemfiles/4.0/Gemfile.lock +++ b/gemfiles/4.0/Gemfile.lock @@ -14,7 +14,7 @@ GEM mini_portile2 (~> 2.8.2) racc (~> 1.4) onigmo (0.1.0) - parser (3.3.10.0) + parser (3.3.10.1) ast (~> 2.4.1) racc power_assert (3.0.1) diff --git a/gemfiles/4.1/Gemfile.lock b/gemfiles/4.1/Gemfile.lock index a727c5e240..b0741aa37f 100644 --- a/gemfiles/4.1/Gemfile.lock +++ b/gemfiles/4.1/Gemfile.lock @@ -14,7 +14,7 @@ GEM mini_portile2 (~> 2.8.2) racc (~> 1.4) onigmo (0.1.0) - parser (3.3.10.0) + parser (3.3.10.1) ast (~> 2.4.1) racc power_assert (3.0.1) diff --git a/gemfiles/typecheck/Gemfile.lock b/gemfiles/typecheck/Gemfile.lock index 0d516a632b..d3d512dc9e 100644 --- a/gemfiles/typecheck/Gemfile.lock +++ b/gemfiles/typecheck/Gemfile.lock @@ -39,7 +39,7 @@ GEM mutex_m (0.3.0) netrc (0.11.0) parallel (1.27.0) - parser (3.3.10.0) + parser (3.3.10.1) ast (~> 2.4.1) racc power_assert (3.0.1) From bdde16554cef76300b021be74055cc5333325e1f Mon Sep 17 00:00:00 2001 From: Earlopain <14981592+Earlopain@users.noreply.github.com> Date: Mon, 19 Jan 2026 22:31:13 +0100 Subject: [PATCH 321/333] Optimize ripper translator MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Creating state classes is pretty expensive. Since they are not modifiable, we can reuse them instead. Benchmark script: ```rb require "ripper" require "prism" require "benchmark/ips" codes = Dir["**/*.rb"].map { File.read(it) } Benchmark.ips do |x| x.config(time: 10) x.report("prism") { codes.each { Prism::Translation::Ripper.lex(it) } } x.report("ripper") { codes.each { Ripper.lex(it) } } x.compare! end ``` Before: ``` ruby 4.0.0 (2025-12-25 revision 553f1675f3) +PRISM [x86_64-linux] Warming up -------------------------------------- prism 1.000 i/100ms ripper 1.000 i/100ms Calculating ------------------------------------- prism 0.293 (± 0.0%) i/s (3.42 s/i) - 3.000 in 10.248348s ripper 0.633 (± 0.0%) i/s (1.58 s/i) - 7.000 in 11.055687s Comparison: ripper: 0.6 i/s prism: 0.3 i/s - 2.16x slower ``` After ``` ruby 4.0.0 (2025-12-25 revision 553f1675f3) +PRISM [x86_64-linux] Warming up -------------------------------------- prism 1.000 i/100ms ripper 1.000 i/100ms Calculating ------------------------------------- prism 0.486 (± 0.0%) i/s (2.06 s/i) - 5.000 in 10.280413s ripper 0.635 (± 0.0%) i/s (1.58 s/i) - 7.000 in 11.027169s Comparison: ripper: 0.6 i/s prism: 0.5 i/s - 1.31x slower ``` --- lib/prism/lex_compat.rb | 4 ++-- lib/prism/translation/ripper/lexer.rb | 9 ++++++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/lib/prism/lex_compat.rb b/lib/prism/lex_compat.rb index b7c54178ac..f7b9a0effc 100644 --- a/lib/prism/lex_compat.rb +++ b/lib/prism/lex_compat.rb @@ -667,7 +667,7 @@ def result event = RIPPER.fetch(token.type) value = token.value - lex_state = Translation::Ripper::Lexer::State.new(lex_state) + lex_state = Translation::Ripper::Lexer::State.cached(lex_state) token = case event @@ -734,7 +734,7 @@ def result counter += { on_embexpr_beg: -1, on_embexpr_end: 1 }[current_event] || 0 end - Translation::Ripper::Lexer::State.new(result_value[current_index][1]) + Translation::Ripper::Lexer::State.cached(result_value[current_index][1]) else previous_state end diff --git a/lib/prism/translation/ripper/lexer.rb b/lib/prism/translation/ripper/lexer.rb index bd40fb4c5a..bed863af08 100644 --- a/lib/prism/translation/ripper/lexer.rb +++ b/lib/prism/translation/ripper/lexer.rb @@ -38,6 +38,13 @@ def |(i) self.class.new(to_int | i) end def allbits?(i) to_int.allbits?(i) end def anybits?(i) to_int.anybits?(i) end def nobits?(i) to_int.nobits?(i) end + + # Instances are frozen and there are only a handful of them so we cache them here. + STATES = Hash.new { |h,k| h[k] = State.new(k) } + + def self.cached(i) + STATES[i] + end end class Elem @@ -47,7 +54,7 @@ def initialize(pos, event, tok, state, message = nil) @pos = pos @event = event @tok = tok - @state = State.new(state) + @state = State.cached(state) @message = message end From df7b4e527682c949409f8c79366bf2235d5e8aad Mon Sep 17 00:00:00 2001 From: Benoit Daloze Date: Mon, 19 Jan 2026 22:21:59 +0100 Subject: [PATCH 322/333] Ignore *.rb at the root for `rake typecheck:sorbet` --- rakelib/typecheck.rake | 1 + 1 file changed, 1 insertion(+) diff --git a/rakelib/typecheck.rake b/rakelib/typecheck.rake index 67e2d4ed56..b11df3a6be 100644 --- a/rakelib/typecheck.rake +++ b/rakelib/typecheck.rake @@ -51,6 +51,7 @@ namespace :typecheck do --ignore=rakelib/ --ignore=Rakefile --ignore=top-100-gems/ + #{Dir.glob("*.rb").map { |f| "--ignore=/#{f}" }.join("\n")} # Treat all files as "typed: true" by default --typed=true # Use the typed-override file to revert some files to "typed: false" From 32bd13eb7d8cc7ae66d2e207847fde6a77946d56 Mon Sep 17 00:00:00 2001 From: Benoit Daloze Date: Tue, 20 Jan 2026 08:53:39 +0100 Subject: [PATCH 323/333] Add Ripper :on_sp events for Prism.lex_compat and Prism::Translation::Ripper * Handle line continuations. * Handle space at the end of file in LexCompat. Co-authored-by: Earlopain <14981592+Earlopain@users.noreply.github.com> --- lib/prism.rb | 8 +- lib/prism/lex_compat.rb | 101 ++++++++++++++++++++-- lib/prism/lex_ripper.rb | 2 - snapshots/bom_leading_space.txt | 32 +++++++ snapshots/bom_spaces.txt | 32 +++++++ test/prism/fixtures/bom_leading_space.txt | 1 + test/prism/fixtures/bom_spaces.txt | 1 + test/prism/ruby/ripper_test.rb | 12 ++- 8 files changed, 170 insertions(+), 19 deletions(-) create mode 100644 snapshots/bom_leading_space.txt create mode 100644 snapshots/bom_spaces.txt create mode 100644 test/prism/fixtures/bom_leading_space.txt create mode 100644 test/prism/fixtures/bom_spaces.txt diff --git a/lib/prism.rb b/lib/prism.rb index d809557fce..dab3420377 100644 --- a/lib/prism.rb +++ b/lib/prism.rb @@ -61,8 +61,7 @@ def initialize(version) # Prism::lex_compat(source, **options) -> LexCompat::Result # # Returns a parse result whose value is an array of tokens that closely - # resembles the return value of Ripper::lex. The main difference is that the - # `:on_sp` token is not emitted. + # resembles the return value of Ripper::lex. # # For supported options, see Prism::parse. def self.lex_compat(source, **options) @@ -72,9 +71,8 @@ def self.lex_compat(source, **options) # :call-seq: # Prism::lex_ripper(source) -> Array # - # This lexes with the Ripper lex. It drops any space events but otherwise - # returns the same tokens. Raises SyntaxError if the syntax in source is - # invalid. + # This wraps the result of Ripper.lex. It produces almost exactly the + # same tokens. Raises SyntaxError if the syntax in source is invalid. def self.lex_ripper(source) LexRipper.new(source).result # steep:ignore end diff --git a/lib/prism/lex_compat.rb b/lib/prism/lex_compat.rb index f7b9a0effc..597e63c73e 100644 --- a/lib/prism/lex_compat.rb +++ b/lib/prism/lex_compat.rb @@ -226,7 +226,7 @@ def state end # Tokens where state should be ignored - # used for :on_comment, :on_heredoc_end, :on_embexpr_end + # used for :on_sp, :on_comment, :on_heredoc_end, :on_embexpr_end class IgnoreStateToken < Token def ==(other) # :nodoc: self[0...-1] == other[0...-1] @@ -611,10 +611,10 @@ def self.build(opening) BOM_FLUSHED = RUBY_VERSION >= "3.3.0" private_constant :BOM_FLUSHED - attr_reader :source, :options + attr_reader :options - def initialize(source, **options) - @source = source + def initialize(code, **options) + @code = code @options = options end @@ -624,12 +624,14 @@ def result state = :default heredoc_stack = [[]] #: Array[Array[Heredoc::PlainHeredoc | Heredoc::DashHeredoc | Heredoc::DedentingHeredoc]] - result = Prism.lex(source, **options) + result = Prism.lex(@code, **options) + source = result.source result_value = result.value previous_state = nil #: State? last_heredoc_end = nil #: Integer? + eof_token = nil - bom = source.byteslice(0..2) == "\xEF\xBB\xBF" + bom = source.slice(0, 3) == "\xEF\xBB\xBF" result_value.each_with_index do |(token, lex_state), index| lineno = token.location.start_line @@ -741,6 +743,7 @@ def result Token.new([[lineno, column], event, value, lex_state]) when :on_eof + eof_token = token previous_token = result_value[index - 1][0] # If we're at the end of the file and the previous token was a @@ -763,7 +766,7 @@ def result end_offset += 3 end - tokens << Token.new([[lineno, 0], :on_nl, source.byteslice(start_offset...end_offset), lex_state]) + tokens << Token.new([[lineno, 0], :on_nl, source.slice(start_offset, end_offset - start_offset), lex_state]) end end @@ -857,7 +860,89 @@ def result # We sort by location to compare against Ripper's output tokens.sort_by!(&:location) - Result.new(tokens, result.comments, result.magic_comments, result.data_loc, result.errors, result.warnings, Source.for(source)) + # Add :on_sp tokens + tokens = add_on_sp_tokens(tokens, source, result.data_loc, bom, eof_token) + + Result.new(tokens, result.comments, result.magic_comments, result.data_loc, result.errors, result.warnings, source) + end + + def add_on_sp_tokens(tokens, source, data_loc, bom, eof_token) + new_tokens = [] + + prev_token_state = Translation::Ripper::Lexer::State.cached(Translation::Ripper::EXPR_BEG) + prev_token_end = bom ? 3 : 0 + + tokens.each do |token| + line, column = token.location + start_offset = source.line_to_byte_offset(line) + column + # Ripper reports columns on line 1 without counting the BOM, so we adjust to get the real offset + start_offset += 3 if line == 1 && bom + + if start_offset > prev_token_end + sp_value = source.slice(prev_token_end, start_offset - prev_token_end) + sp_line = source.line(prev_token_end) + sp_column = source.column(prev_token_end) + # Ripper reports columns on line 1 without counting the BOM + sp_column -= 3 if sp_line == 1 && bom + continuation_index = sp_value.byteindex("\\") + + # ripper emits up to three :on_sp tokens when line continuations are used + if continuation_index + next_whitespace_index = continuation_index + 1 + next_whitespace_index += 1 if sp_value.byteslice(next_whitespace_index) == "\r" + next_whitespace_index += 1 + first_whitespace = sp_value[0...continuation_index] + continuation = sp_value[continuation_index...next_whitespace_index] + second_whitespace = sp_value[next_whitespace_index..] + + new_tokens << IgnoreStateToken.new([ + [sp_line, sp_column], + :on_sp, + first_whitespace, + prev_token_state + ]) unless first_whitespace.empty? + + new_tokens << IgnoreStateToken.new([ + [sp_line, sp_column + continuation_index], + :on_sp, + continuation, + prev_token_state + ]) + + new_tokens << IgnoreStateToken.new([ + [sp_line + 1, 0], + :on_sp, + second_whitespace, + prev_token_state + ]) unless second_whitespace.empty? + else + new_tokens << IgnoreStateToken.new([ + [sp_line, sp_column], + :on_sp, + sp_value, + prev_token_state + ]) + end + end + + new_tokens << token + prev_token_state = token.state + prev_token_end = start_offset + token.value.bytesize + end + + unless data_loc # no trailing :on_sp with __END__ as it is always preceded by :on_nl + end_offset = eof_token.location.end_offset + if prev_token_end < end_offset + new_tokens << IgnoreStateToken.new([ + [source.line(prev_token_end), source.column(prev_token_end)], + :on_sp, + source.slice(prev_token_end, end_offset - prev_token_end), + prev_token_state + ]) + end + end + + new_tokens end end diff --git a/lib/prism/lex_ripper.rb b/lib/prism/lex_ripper.rb index 4b5c3b77fd..2054cf55ac 100644 --- a/lib/prism/lex_ripper.rb +++ b/lib/prism/lex_ripper.rb @@ -19,8 +19,6 @@ def result lex(source).each do |token| case token[1] - when :on_sp - # skip when :on_tstring_content if previous[1] == :on_tstring_content && (token[2].start_with?("\#$") || token[2].start_with?("\#@")) previous[2] << token[2] diff --git a/snapshots/bom_leading_space.txt b/snapshots/bom_leading_space.txt new file mode 100644 index 0000000000..b99334d213 --- /dev/null +++ b/snapshots/bom_leading_space.txt @@ -0,0 +1,32 @@ +@ ProgramNode (location: (1,4)-(1,10)) +├── flags: ∅ +├── locals: [] +└── statements: + @ StatementsNode (location: (1,4)-(1,10)) + ├── flags: ∅ + └── body: (length: 1) + └── @ CallNode (location: (1,4)-(1,10)) + ├── flags: newline, ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :p + ├── message_loc: (1,4)-(1,5) = "p" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,6)-(1,10)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ ParenthesesNode (location: (1,6)-(1,10)) + │ ├── flags: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (1,7)-(1,9)) + │ │ ├── flags: ∅ + │ │ └── body: (length: 1) + │ │ └── @ IntegerNode (location: (1,7)-(1,9)) + │ │ ├── flags: newline, static_literal, decimal + │ │ └── value: 42 + │ ├── opening_loc: (1,6)-(1,7) = "(" + │ └── closing_loc: (1,9)-(1,10) = ")" + ├── closing_loc: ∅ + ├── equal_loc: ∅ + └── block: ∅ diff --git a/snapshots/bom_spaces.txt b/snapshots/bom_spaces.txt new file mode 100644 index 0000000000..445ea0efe9 --- /dev/null +++ b/snapshots/bom_spaces.txt @@ -0,0 +1,32 @@ +@ ProgramNode (location: (1,3)-(1,11)) +├── flags: ∅ +├── locals: [] +└── statements: + @ StatementsNode (location: (1,3)-(1,11)) + ├── flags: ∅ + └── body: (length: 1) + └── @ CallNode (location: (1,3)-(1,11)) + ├── flags: newline, ignore_visibility + ├── receiver: ∅ + ├── call_operator_loc: ∅ + ├── name: :p + ├── message_loc: (1,3)-(1,4) = "p" + ├── opening_loc: ∅ + ├── arguments: + │ @ ArgumentsNode (location: (1,5)-(1,11)) + │ ├── flags: ∅ + │ └── arguments: (length: 1) + │ └── @ ParenthesesNode (location: (1,5)-(1,11)) + │ ├── flags: ∅ + │ ├── body: + │ │ @ StatementsNode (location: (1,7)-(1,9)) + │ │ ├── flags: ∅ + │ │ └── body: (length: 1) + │ │ └── @ IntegerNode (location: (1,7)-(1,9)) + │ │ ├── flags: newline, static_literal, decimal + │ │ └── value: 42 + │ ├── opening_loc: (1,5)-(1,6) = "(" + │ └── closing_loc: (1,10)-(1,11) = ")" + ├── closing_loc: ∅ + ├── equal_loc: ∅ + └── block: ∅ diff --git a/test/prism/fixtures/bom_leading_space.txt b/test/prism/fixtures/bom_leading_space.txt new file mode 100644 index 0000000000..48d3ee50ea --- /dev/null +++ b/test/prism/fixtures/bom_leading_space.txt @@ -0,0 +1 @@ + p (42) diff --git a/test/prism/fixtures/bom_spaces.txt b/test/prism/fixtures/bom_spaces.txt new file mode 100644 index 0000000000..c18ad4c21a --- /dev/null +++ b/test/prism/fixtures/bom_spaces.txt @@ -0,0 +1 @@ +p ( 42 ) diff --git a/test/prism/ruby/ripper_test.rb b/test/prism/ruby/ripper_test.rb index 2a0504c19f..280abd94ea 100644 --- a/test/prism/ruby/ripper_test.rb +++ b/test/prism/ruby/ripper_test.rb @@ -39,6 +39,8 @@ class RipperTest < TestCase # Skip these tests that we haven't implemented yet. omitted_sexp_raw = [ + "bom_leading_space.txt", + "bom_spaces.txt", "dos_endings.txt", "heredocs_with_fake_newlines.txt", "heredocs_with_ignored_newlines.txt", @@ -92,7 +94,7 @@ def test_lexer assert_equal(expected, lexer.parse[0].to_a) assert_equal(lexer.parse[0].to_a, lexer.scan[0].to_a) - assert_equal(%i[on_int on_op], Translation::Ripper::Lexer.new("1 +").lex.map(&:event)) + assert_equal(%i[on_int on_sp on_op], Translation::Ripper::Lexer.new("1 +").lex.map(&:event)) assert_raise(SyntaxError) { Translation::Ripper::Lexer.new("1 +").lex(raise_errors: true) } end @@ -121,15 +123,17 @@ def assert_ripper_sexp_raw(source) def assert_ripper_lex(source) prism = Translation::Ripper.lex(source) ripper = Ripper.lex(source) - ripper.reject! { |elem| elem[1] == :on_sp } # Prism doesn't emit on_sp - ripper.sort_by! { |elem| elem[0] } # Prism emits tokens by their order in the code, not in parse order + + # Prism emits tokens by their order in the code, not in parse order + ripper.sort_by! { |elem| elem[0] } [prism.size, ripper.size].max.times do |i| expected = ripper[i] actual = prism[i] + # Since tokens related to heredocs are not emitted in the same order, # the state also doesn't line up. - if expected[1] == :on_heredoc_end && actual[1] == :on_heredoc_end + if expected && actual && expected[1] == :on_heredoc_end && actual[1] == :on_heredoc_end expected[3] = actual[3] = nil end From 94e0107729cde0619466be4e5ae356eaa4a706b5 Mon Sep 17 00:00:00 2001 From: Earlopain <14981592+Earlopain@users.noreply.github.com> Date: Tue, 20 Jan 2026 20:34:49 +0100 Subject: [PATCH 324/333] Fix `on_*` return value of ripper translator You're supposed to return the first argument. ```rb # Before [[:stmts_new], [:rescue_mod, nil, nil], [:stmts_add, nil, nil], [:program, nil]] # After [[:stmts_new], [:rescue_mod, "1", "2"], [:stmts_add, nil, "1"], [:program, nil]] ``` The correct result would be: `[[:rescue_mod, "1", "2"], [:stmts_new], [:stmts_add, nil, "1"], [:program, nil]]` But the order depends on the prism AST so it seems very difficult to match. --- lib/prism/translation/ripper.rb | 12 ++++++------ test/prism/ruby/ripper_test.rb | 34 +++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+), 6 deletions(-) diff --git a/lib/prism/translation/ripper.rb b/lib/prism/translation/ripper.rb index c8f9fa7731..afe30bb5db 100644 --- a/lib/prism/translation/ripper.rb +++ b/lib/prism/translation/ripper.rb @@ -3446,12 +3446,12 @@ def bounds(location) # :stopdoc: def _dispatch_0; end - def _dispatch_1(_); end - def _dispatch_2(_, _); end - def _dispatch_3(_, _, _); end - def _dispatch_4(_, _, _, _); end - def _dispatch_5(_, _, _, _, _); end - def _dispatch_7(_, _, _, _, _, _, _); end + def _dispatch_1(arg); arg end + def _dispatch_2(arg, _); arg end + def _dispatch_3(arg, _, _); arg end + def _dispatch_4(arg, _, _, _); arg end + def _dispatch_5(arg, _, _, _, _); arg end + def _dispatch_7(arg, _, _, _, _, _, _); arg end # :startdoc: # diff --git a/test/prism/ruby/ripper_test.rb b/test/prism/ruby/ripper_test.rb index 280abd94ea..174c90cbca 100644 --- a/test/prism/ruby/ripper_test.rb +++ b/test/prism/ruby/ripper_test.rb @@ -86,6 +86,40 @@ class RipperTest < TestCase define_method("#{fixture.test_name}_lex") { assert_ripper_lex(fixture.read) } end + module Events + attr_reader :events + + def initialize(...) + super + @events = [] + end + + Prism::Translation::Ripper::PARSER_EVENTS.each do |event| + define_method(:"on_#{event}") do |*args| + @events << [event, *args] + super(*args) + end + end + end + + class RipperEvents < Ripper + include Events + end + + class PrismEvents < Translation::Ripper + include Events + end + + def test_events + source = "1 rescue 2" + ripper = RipperEvents.new(source) + prism = PrismEvents.new(source) + ripper.parse + prism.parse + # This makes sure that the content is the same. Ordering is not correct for now. + assert_equal(ripper.events.sort, prism.events.sort) + end + def test_lexer lexer = Translation::Ripper::Lexer.new("foo") expected = [[1, 0], :on_ident, "foo", Translation::Ripper::EXPR_CMDARG] From 4deba7b15895ba4d9c9021c9b310421ec7d776ee Mon Sep 17 00:00:00 2001 From: Vinicius Stock Date: Tue, 20 Jan 2026 14:43:02 -0500 Subject: [PATCH 325/333] Add `license` identifier to Rust crates --- rust/ruby-prism-sys/Cargo.toml | 1 + rust/ruby-prism/Cargo.toml | 1 + 2 files changed, 2 insertions(+) diff --git a/rust/ruby-prism-sys/Cargo.toml b/rust/ruby-prism-sys/Cargo.toml index d4db645e2a..78e157273c 100644 --- a/rust/ruby-prism-sys/Cargo.toml +++ b/rust/ruby-prism-sys/Cargo.toml @@ -2,6 +2,7 @@ name = "ruby-prism-sys" version = "1.8.0" edition = "2021" +license = "MIT" license-file = "../../LICENSE.md" repository = "https://github.com/ruby/prism" description = "Rust bindings to Ruby's prism parsing library" diff --git a/rust/ruby-prism/Cargo.toml b/rust/ruby-prism/Cargo.toml index c3bb4cfc7a..73cfa0314d 100644 --- a/rust/ruby-prism/Cargo.toml +++ b/rust/ruby-prism/Cargo.toml @@ -2,6 +2,7 @@ name = "ruby-prism" version = "1.8.0" edition = "2021" +license = "MIT" license-file = "../../LICENSE.md" repository = "https://github.com/ruby/prism" description = "Rustified version of Ruby's prism parsing library" From bed4271ce2d706e50e210b717f7960f5cf743eeb Mon Sep 17 00:00:00 2001 From: Benoit Daloze Date: Tue, 20 Jan 2026 21:20:06 +0100 Subject: [PATCH 326/333] Check using Prism nodes if a command call has any arguments in Ripper translator * We don't know what `on_*` events might return so we cannot assume it's an Array. * See https://github.com/ruby/prism/issues/3838#issuecomment-3774702396 --- lib/prism/translation/ripper.rb | 18 +++++++++++++----- test/prism/ruby/ripper_test.rb | 12 ++++++++++++ 2 files changed, 25 insertions(+), 5 deletions(-) diff --git a/lib/prism/translation/ripper.rb b/lib/prism/translation/ripper.rb index afe30bb5db..41dd699438 100644 --- a/lib/prism/translation/ripper.rb +++ b/lib/prism/translation/ripper.rb @@ -1112,7 +1112,7 @@ def visit_call_node(node) else arguments, block = visit_call_node_arguments(node.arguments, node.block, trailing_comma?(node.arguments&.location || node.location, node.closing_loc || node.location)) call = - if node.opening_loc.nil? && arguments&.any? + if node.opening_loc.nil? && get_arguments_and_block(node.arguments, node.block).first.any? bounds(node.location) on_command(message, arguments) elsif !node.opening_loc.nil? @@ -1179,17 +1179,25 @@ def visit_call_node(node) end end - # Visit the arguments and block of a call node and return the arguments - # and block as they should be used. - private def visit_call_node_arguments(arguments_node, block_node, trailing_comma) + # Extract the arguments and block Ripper-style, which means if the block + # is like `&b` then it's moved to arguments. + private def get_arguments_and_block(arguments_node, block_node) arguments = arguments_node&.arguments || [] block = block_node if block.is_a?(BlockArgumentNode) - arguments << block + arguments += [block] block = nil end + [arguments, block] + end + + # Visit the arguments and block of a call node and return the arguments + # and block as they should be used. + private def visit_call_node_arguments(arguments_node, block_node, trailing_comma) + arguments, block = get_arguments_and_block(arguments_node, block_node) + [ if arguments.length == 1 && arguments.first.is_a?(ForwardingArgumentsNode) visit(arguments.first) diff --git a/test/prism/ruby/ripper_test.rb b/test/prism/ruby/ripper_test.rb index 174c90cbca..8848c6a8c0 100644 --- a/test/prism/ruby/ripper_test.rb +++ b/test/prism/ruby/ripper_test.rb @@ -110,6 +110,14 @@ class PrismEvents < Translation::Ripper include Events end + class ObjectEvents < Translation::Ripper + Prism::Translation::Ripper::PARSER_EVENTS.each do |event| + define_method(:"on_#{event}") do |*args| + Object.new + end + end + end + def test_events source = "1 rescue 2" ripper = RipperEvents.new(source) @@ -152,6 +160,10 @@ def test_internals def assert_ripper_sexp_raw(source) assert_equal Ripper.sexp_raw(source), Prism::Translation::Ripper.sexp_raw(source) + + # Similar to test/ripper/assert_parse_files.rb in CRuby + object_events = ObjectEvents.new(source) + assert_nothing_raised { object_events.parse } end def assert_ripper_lex(source) From 52c4fa785eeebf25b77f2ea5dad0109435c96b7c Mon Sep 17 00:00:00 2001 From: Earlopain <14981592+Earlopain@users.noreply.github.com> Date: Wed, 21 Jan 2026 13:19:42 +0100 Subject: [PATCH 327/333] Also handle `BasicObject` as a return value We should touch these as little as possible and just pass them along --- lib/prism/translation/ripper.rb | 51 +++++++++++++++++---------------- test/prism/ruby/ripper_test.rb | 18 +++++++----- 2 files changed, 37 insertions(+), 32 deletions(-) diff --git a/lib/prism/translation/ripper.rb b/lib/prism/translation/ripper.rb index 41dd699438..735217d2e0 100644 --- a/lib/prism/translation/ripper.rb +++ b/lib/prism/translation/ripper.rb @@ -832,7 +832,7 @@ def visit_array_pattern_node(node) # foo(bar) # ^^^ def visit_arguments_node(node) - arguments, _ = visit_call_node_arguments(node, nil, false) + arguments, _, _ = visit_call_node_arguments(node, nil, false) arguments end @@ -1042,16 +1042,16 @@ def visit_call_node(node) case node.name when :[] receiver = visit(node.receiver) - arguments, block = visit_call_node_arguments(node.arguments, node.block, trailing_comma?(node.arguments&.location || node.location, node.closing_loc)) + arguments, block, has_ripper_block = visit_call_node_arguments(node.arguments, node.block, trailing_comma?(node.arguments&.location || node.location, node.closing_loc)) bounds(node.location) call = on_aref(receiver, arguments) - if block.nil? - call - else + if has_ripper_block bounds(node.location) on_method_add_block(call, block) + else + call end when :[]= receiver = visit(node.receiver) @@ -1110,7 +1110,7 @@ def visit_call_node(node) if node.variable_call? on_vcall(message) else - arguments, block = visit_call_node_arguments(node.arguments, node.block, trailing_comma?(node.arguments&.location || node.location, node.closing_loc || node.location)) + arguments, block, has_ripper_block = visit_call_node_arguments(node.arguments, node.block, trailing_comma?(node.arguments&.location || node.location, node.closing_loc || node.location)) call = if node.opening_loc.nil? && get_arguments_and_block(node.arguments, node.block).first.any? bounds(node.location) @@ -1123,11 +1123,11 @@ def visit_call_node(node) on_method_add_arg(on_fcall(message), on_args_new) end - if block.nil? - call - else + if has_ripper_block bounds(node.block.location) on_method_add_block(call, block) + else + call end end end @@ -1151,7 +1151,7 @@ def visit_call_node(node) bounds(node.location) on_assign(on_field(receiver, call_operator, message), value) else - arguments, block = visit_call_node_arguments(node.arguments, node.block, trailing_comma?(node.arguments&.location || node.location, node.closing_loc || node.location)) + arguments, block, has_ripper_block = visit_call_node_arguments(node.arguments, node.block, trailing_comma?(node.arguments&.location || node.location, node.closing_loc || node.location)) call = if node.opening_loc.nil? bounds(node.location) @@ -1169,11 +1169,11 @@ def visit_call_node(node) on_method_add_arg(on_call(receiver, call_operator, message), arguments) end - if block.nil? - call - else + if has_ripper_block bounds(node.block.location) on_method_add_block(call, block) + else + call end end end @@ -1211,7 +1211,8 @@ def visit_call_node(node) on_args_add_block(args, false) end end, - visit(block) + visit(block), + block != nil, ] end @@ -1648,10 +1649,10 @@ def visit_def_node(node) end bounds(node.location) - if receiver.nil? - on_def(name, parameters, bodystmt) - else + if receiver on_defs(receiver, operator, name, parameters, bodystmt) + else + on_def(name, parameters, bodystmt) end end @@ -2049,7 +2050,7 @@ def visit_in_node(node) # ^^^^^^^^^^^^^^^ def visit_index_operator_write_node(node) receiver = visit(node.receiver) - arguments, _ = visit_call_node_arguments(node.arguments, node.block, trailing_comma?(node.arguments&.location || node.location, node.closing_loc)) + arguments, _, _ = visit_call_node_arguments(node.arguments, node.block, trailing_comma?(node.arguments&.location || node.location, node.closing_loc)) bounds(node.location) target = on_aref_field(receiver, arguments) @@ -2066,7 +2067,7 @@ def visit_index_operator_write_node(node) # ^^^^^^^^^^^^^^^^ def visit_index_and_write_node(node) receiver = visit(node.receiver) - arguments, _ = visit_call_node_arguments(node.arguments, node.block, trailing_comma?(node.arguments&.location || node.location, node.closing_loc)) + arguments, _, _ = visit_call_node_arguments(node.arguments, node.block, trailing_comma?(node.arguments&.location || node.location, node.closing_loc)) bounds(node.location) target = on_aref_field(receiver, arguments) @@ -2083,7 +2084,7 @@ def visit_index_and_write_node(node) # ^^^^^^^^^^^^^^^^ def visit_index_or_write_node(node) receiver = visit(node.receiver) - arguments, _ = visit_call_node_arguments(node.arguments, node.block, trailing_comma?(node.arguments&.location || node.location, node.closing_loc)) + arguments, _, _ = visit_call_node_arguments(node.arguments, node.block, trailing_comma?(node.arguments&.location || node.location, node.closing_loc)) bounds(node.location) target = on_aref_field(receiver, arguments) @@ -2100,7 +2101,7 @@ def visit_index_or_write_node(node) # ^^^^^^^^ def visit_index_target_node(node) receiver = visit(node.receiver) - arguments, _ = visit_call_node_arguments(node.arguments, node.block, trailing_comma?(node.arguments&.location || node.location, node.closing_loc)) + arguments, _, _ = visit_call_node_arguments(node.arguments, node.block, trailing_comma?(node.arguments&.location || node.location, node.closing_loc)) bounds(node.location) on_aref_field(receiver, arguments) @@ -3130,7 +3131,7 @@ def visit_string_node(node) # super(foo) # ^^^^^^^^^^ def visit_super_node(node) - arguments, block = visit_call_node_arguments(node.arguments, node.block, trailing_comma?(node.arguments&.location || node.location, node.rparen_loc || node.location)) + arguments, block, has_ripper_block = visit_call_node_arguments(node.arguments, node.block, trailing_comma?(node.arguments&.location || node.location, node.rparen_loc || node.location)) if !node.lparen_loc.nil? bounds(node.lparen_loc) @@ -3140,11 +3141,11 @@ def visit_super_node(node) bounds(node.location) call = on_super(arguments) - if block.nil? - call - else + if has_ripper_block bounds(node.block.location) on_method_add_block(call, block) + else + call end end diff --git a/test/prism/ruby/ripper_test.rb b/test/prism/ruby/ripper_test.rb index 8848c6a8c0..6e9dcee4c9 100644 --- a/test/prism/ruby/ripper_test.rb +++ b/test/prism/ruby/ripper_test.rb @@ -111,10 +111,18 @@ class PrismEvents < Translation::Ripper end class ObjectEvents < Translation::Ripper + OBJECT = BasicObject.new Prism::Translation::Ripper::PARSER_EVENTS.each do |event| - define_method(:"on_#{event}") do |*args| - Object.new - end + define_method(:"on_#{event}") { |*args| OBJECT } + end + end + + Fixture.each_for_current_ruby(except: incorrect) do |fixture| + define_method("#{fixture.test_name}_events") do + source = fixture.read + # Similar to test/ripper/assert_parse_files.rb in CRuby + object_events = ObjectEvents.new(source) + assert_nothing_raised { object_events.parse } end end @@ -160,10 +168,6 @@ def test_internals def assert_ripper_sexp_raw(source) assert_equal Ripper.sexp_raw(source), Prism::Translation::Ripper.sexp_raw(source) - - # Similar to test/ripper/assert_parse_files.rb in CRuby - object_events = ObjectEvents.new(source) - assert_nothing_raised { object_events.parse } end def assert_ripper_lex(source) From e0af0eff86bcd8ba13837a973a4ebb31422e0c88 Mon Sep 17 00:00:00 2001 From: Charles Oliver Nutter Date: Wed, 21 Jan 2026 17:00:41 -0600 Subject: [PATCH 328/333] Update group and artifact for publishing org.jruby:chicory-prism --- java-wasm/pom.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/java-wasm/pom.xml b/java-wasm/pom.xml index ba0b66da9c..592989a921 100644 --- a/java-wasm/pom.xml +++ b/java-wasm/pom.xml @@ -2,11 +2,11 @@ 4.0.0 - com.prism - java-prism - 999-SNAPSHOT + org.jruby + chicory-prism + 0.0.1-SNAPSHOT Java Prism - Pure Java Prism interpreting WASM + Pure Java Prism using Chicory WASM runtime From 0d3a2f26943c8ecfe4a8a6212a7ca7044d0ac566 Mon Sep 17 00:00:00 2001 From: Charles Oliver Nutter Date: Wed, 21 Jan 2026 17:01:28 -0600 Subject: [PATCH 329/333] Add JRuby dependency for building parser API Nodes need access to RubySymbol and support APIs at least. --- java-wasm/pom.xml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/java-wasm/pom.xml b/java-wasm/pom.xml index 592989a921..ebe08728f2 100644 --- a/java-wasm/pom.xml +++ b/java-wasm/pom.xml @@ -50,6 +50,11 @@ host-module-annotations-experimental provided + + org.jruby + jruby-base + 10.0.2.0 + From 239e5ee418346e393cf5243b06c0b1a0d2bf89a7 Mon Sep 17 00:00:00 2001 From: Charles Oliver Nutter Date: Wed, 21 Jan 2026 19:24:17 -0600 Subject: [PATCH 330/333] Move java_wasm output to src/main/resources * It is a resource used as source code (in wasm) that is compiled for the project artifact. * Added to Rake CLOBBER --- .github/workflows/java-wasm-bindings.yml | 2 +- Makefile | 5 +++-- Rakefile | 1 + java-wasm/pom.xml | 2 +- .../src/main/java-templates/org/prism/WasmResource.java | 2 +- java-wasm/src/{test => main}/resources/.gitignore | 0 6 files changed, 7 insertions(+), 5 deletions(-) rename java-wasm/src/{test => main}/resources/.gitignore (100%) diff --git a/.github/workflows/java-wasm-bindings.yml b/.github/workflows/java-wasm-bindings.yml index b3e427add0..12e465fd0b 100644 --- a/.github/workflows/java-wasm-bindings.yml +++ b/.github/workflows/java-wasm-bindings.yml @@ -48,4 +48,4 @@ jobs: - uses: actions/upload-artifact@v4 with: name: prism.wasm - path: java-wasm/src/test/resources/prism.wasm + path: java-wasm/src/main/resources/prism.wasm diff --git a/Makefile b/Makefile index afeb58ecd0..a9a0f74c4a 100644 --- a/Makefile +++ b/Makefile @@ -30,7 +30,7 @@ all: shared static shared: build/libprism.$(SOEXT) static: build/libprism.a wasm: javascript/src/prism.wasm -java-wasm: java-wasm/src/test/resources/prism.wasm +java-wasm: java-wasm/src/main/resources/prism.wasm build/libprism.$(SOEXT): $(SHARED_OBJECTS) $(ECHO) "linking $@ with $(CC)" @@ -44,8 +44,9 @@ javascript/src/prism.wasm: Makefile $(SOURCES) $(HEADERS) $(ECHO) "building $@" $(Q) $(WASI_SDK_PATH)/bin/clang --sysroot=$(WASI_SDK_PATH)/share/wasi-sysroot/ $(DEBUG_FLAGS) -DPRISM_EXPORT_SYMBOLS -D_WASI_EMULATED_MMAN -lwasi-emulated-mman $(CPPFLAGS) $(CFLAGS) -Wl,--export-all -Wl,--no-entry -mexec-model=reactor -o $@ $(SOURCES) -java-wasm/src/test/resources/prism.wasm: Makefile $(SOURCES) $(HEADERS) +java-wasm/src/main/resources/prism.wasm: Makefile $(SOURCES) $(HEADERS) $(ECHO) "building $@" + $(Q) $(MAKEDIRS) $(@D) $(Q) $(WASI_SDK_PATH)/bin/clang $(DEBUG_FLAGS) -DPRISM_EXCLUDE_PRETTYPRINT -DPRISM_EXPORT_SYMBOLS -D_WASI_EMULATED_MMAN -lwasi-emulated-mman $(CPPFLAGS) $(JAVA_WASM_CFLAGS) -Wl,--export-all -Wl,--no-entry -mexec-model=reactor -lc++ -lc++abi -o $@ $(SOURCES) build/shared/%.o: src/%.c Makefile $(HEADERS) diff --git a/Rakefile b/Rakefile index 7a5e537039..45329fa637 100644 --- a/Rakefile +++ b/Rakefile @@ -52,6 +52,7 @@ end CLOBBER.concat(Prism::Template::TEMPLATES) CLOBBER.concat(["build"]) CLOBBER << "lib/prism/prism.#{RbConfig::CONFIG["DLEXT"]}" +CLOBBER << "java-wasm/src/main/resources/prism.wasm" Prism::Template::TEMPLATES.each do |filepath| desc "Generate #{filepath}" diff --git a/java-wasm/pom.xml b/java-wasm/pom.xml index ebe08728f2..8004087ba8 100644 --- a/java-wasm/pom.xml +++ b/java-wasm/pom.xml @@ -122,7 +122,7 @@ org.prism.Prism - src/test/resources/prism.wasm + src/main/resources/prism.wasm diff --git a/java-wasm/src/main/java-templates/org/prism/WasmResource.java b/java-wasm/src/main/java-templates/org/prism/WasmResource.java index 48f2671714..ccf1d0bcdd 100644 --- a/java-wasm/src/main/java-templates/org/prism/WasmResource.java +++ b/java-wasm/src/main/java-templates/org/prism/WasmResource.java @@ -1,7 +1,7 @@ package org.prism; public final class WasmResource { - public static final String absoluteFile = "file://${project.basedir}/src/test/resources/prism.wasm"; + public static final String absoluteFile = "file://${project.basedir}/src/main/resources/prism.wasm"; private WasmResource() {} } diff --git a/java-wasm/src/test/resources/.gitignore b/java-wasm/src/main/resources/.gitignore similarity index 100% rename from java-wasm/src/test/resources/.gitignore rename to java-wasm/src/main/resources/.gitignore From 742872cfc3bf29e9ab4b4ea4a73fdca25baed399 Mon Sep 17 00:00:00 2001 From: Charles Oliver Nutter Date: Wed, 21 Jan 2026 19:26:47 -0600 Subject: [PATCH 331/333] Add basic bootstrapping instructions --- java-wasm/README.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 java-wasm/README.md diff --git a/java-wasm/README.md b/java-wasm/README.md new file mode 100644 index 0000000000..2ff93a66d7 --- /dev/null +++ b/java-wasm/README.md @@ -0,0 +1,23 @@ +This dir contains the chicory-prism artifact, a version of prism compiled to WASM and then AOT compiled to JVM bytecode by the Chicory project. + +Generate the templated sources: + +``` +PRISM_EXCLUDE_PRETTYPRINT=1 PRISM_SERIALIZE_ONLY_SEMANTICS_FIELDS=1 PRISM_JAVA_BACKEND=jruby bundle exec rake templates +``` + +Compile to WASM using WASI SDK version 25: + +``` +make java-wasm WASI_SDK_PATH=.../wasi-sdk-25.0-arm64-macos +``` + +Build the AOT-compiled machine and wrapper library: + +``` +mvn -f java-wasm/pom.xml clean package +``` + +This should build the chicory-wasm jar file and pass some basic tests. + +The jar will be under `java-wasm/target/chicory-prism-#####-SNAPSHOT.jar` or can be installed by using `install` instead of `pacakge` in the `mvn` command line above. From 70c40c1b84c53594a4a653194b4880b72d8621a9 Mon Sep 17 00:00:00 2001 From: Charles Oliver Nutter Date: Thu, 22 Jan 2026 01:17:12 -0600 Subject: [PATCH 332/333] Upgrade to chicory 1.6.1 --- java-wasm/pom.xml | 12 ++++++------ java-wasm/src/main/java/org/prism/Prism.java | 9 ++++++--- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/java-wasm/pom.xml b/java-wasm/pom.xml index 8004087ba8..f0b54fd783 100644 --- a/java-wasm/pom.xml +++ b/java-wasm/pom.xml @@ -15,7 +15,7 @@ 11 11 - 1.2.1 + 1.6.1 5.12.1 @@ -47,7 +47,7 @@ com.dylibso.chicory - host-module-annotations-experimental + annotations provided @@ -81,7 +81,7 @@ com.dylibso.chicory - host-module-processor-experimental + annotations-processor ${chicory.version} @@ -112,16 +112,16 @@ com.dylibso.chicory - aot-maven-plugin-experimental + chicory-compiler-maven-plugin ${chicory.version} prism - wasm-aot-gen + compile - org.prism.Prism + org.prism.PrismParser src/main/resources/prism.wasm diff --git a/java-wasm/src/main/java/org/prism/Prism.java b/java-wasm/src/main/java/org/prism/Prism.java index a4a8e65111..ba13f18aed 100644 --- a/java-wasm/src/main/java/org/prism/Prism.java +++ b/java-wasm/src/main/java/org/prism/Prism.java @@ -1,11 +1,12 @@ package org.prism; +import com.dylibso.chicory.annotations.WasmModuleInterface; import com.dylibso.chicory.runtime.ByteArrayMemory; -import com.dylibso.chicory.experimental.hostmodule.annotations.WasmModuleInterface; import com.dylibso.chicory.runtime.ImportValues; import com.dylibso.chicory.runtime.Instance; import com.dylibso.chicory.wasi.WasiOptions; import com.dylibso.chicory.wasi.WasiPreview1; +import com.dylibso.chicory.wasm.WasmModule; import com.dylibso.chicory.wasm.types.MemoryLimits; import java.nio.charset.StandardCharsets; @@ -21,9 +22,11 @@ public Prism() { } public Prism(WasiOptions wasiOpts) { wasi = WasiPreview1.builder().withOptions(wasiOpts).build(); - instance = Instance.builder(PrismModule.load()) + WasmModule module = PrismParser.load(); + PrismParser parser = new PrismParser(); + instance = Instance.builder(module) .withMemoryFactory(limits -> new ByteArrayMemory(new MemoryLimits(10, MemoryLimits.MAX_PAGES))) - .withMachineFactory(PrismModule::create) + .withMachineFactory(parser.machineFactory()) .withImportValues(ImportValues.builder().addFunction(wasi.toHostFunctions()).build()) .build(); exports = new Prism_ModuleExports(instance); From 098305dd0da56325d96b7f12069ccbe6eca35d94 Mon Sep 17 00:00:00 2001 From: Charles Oliver Nutter Date: Sun, 25 Jan 2026 17:25:27 -0600 Subject: [PATCH 333/333] Simplify setup and teardown Allow the buffer functions to manage the internal pointer and use consistent argument order for calloc. --- java-wasm/src/main/java/org/prism/Prism.java | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/java-wasm/src/main/java/org/prism/Prism.java b/java-wasm/src/main/java/org/prism/Prism.java index ba13f18aed..51552569e6 100644 --- a/java-wasm/src/main/java/org/prism/Prism.java +++ b/java-wasm/src/main/java/org/prism/Prism.java @@ -40,10 +40,9 @@ public byte[] serialize(byte[] packedOptions, byte[] source, int sourceLength) { int sourcePointer = 0; int optionsPointer = 0; int bufferPointer = 0; - int resultPointer = 0; byte[] result; try { - sourcePointer = exports.calloc(1, sourceLength); + sourcePointer = exports.calloc(sourceLength, 1); exports.memory().write(sourcePointer, source); optionsPointer = exports.calloc(1, packedOptions.length); @@ -54,10 +53,8 @@ public byte[] serialize(byte[] packedOptions, byte[] source, int sourceLength) { exports.pmSerializeParse(bufferPointer, sourcePointer, sourceLength, optionsPointer); - resultPointer = exports.pmBufferValue(bufferPointer); - result = instance.memory().readBytes( - resultPointer, + exports.pmBufferValue(bufferPointer), exports.pmBufferLength(bufferPointer)); } finally { if (sourcePointer != 0) { @@ -67,11 +64,9 @@ public byte[] serialize(byte[] packedOptions, byte[] source, int sourceLength) { exports.free(optionsPointer); } if (bufferPointer != 0) { + exports.pmBufferFree(bufferPointer); exports.free(bufferPointer); } - if (resultPointer != 0) { - exports.free(resultPointer); - } } return result;