diff options
author | Aaron Patterson <tenderlove@ruby-lang.org> | 2024-01-09 10:12:03 -0800 |
---|---|---|
committer | git <svn-admin@ruby-lang.org> | 2024-01-10 15:24:26 +0000 |
commit | 881c5a1846c220662a4ad49208a28fe0287b3c58 (patch) | |
tree | 2c88efc963b38b2adf3325a35f3703ea69f13b55 /test/prism/snapshots/seattlerb/block_decomp_arg_splat_arg.txt | |
parent | 8940922d1889f885d4f26b4c815beb136a9a2095 (diff) |
[ruby/prism] Add a "repeated flag" to parameter nodes
It's possible to repeat parameters in method definitions like so:
```ruby
def foo(_a, _a)
end
```
The compiler needs to know to adjust the local table size to account for
these duplicate names. We'll use the repeated parameter flag to account
for the extra stack space required
https://github.com/ruby/prism/commit/b443cb1f60
Co-Authored-By: Kevin Newton <kddnewton@gmail.com>
Co-Authored-By: Jemma Issroff <jemmaissroff@gmail.com>
Diffstat (limited to 'test/prism/snapshots/seattlerb/block_decomp_arg_splat_arg.txt')
-rw-r--r-- | test/prism/snapshots/seattlerb/block_decomp_arg_splat_arg.txt | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/test/prism/snapshots/seattlerb/block_decomp_arg_splat_arg.txt b/test/prism/snapshots/seattlerb/block_decomp_arg_splat_arg.txt index d5a8d7cbac..6b72016b6f 100644 --- a/test/prism/snapshots/seattlerb/block_decomp_arg_splat_arg.txt +++ b/test/prism/snapshots/seattlerb/block_decomp_arg_splat_arg.txt @@ -24,15 +24,18 @@ │ │ │ └── @ MultiTargetNode (location: (1,5)-(1,15)) │ │ │ ├── lefts: (length: 1) │ │ │ │ └── @ RequiredParameterNode (location: (1,6)-(1,7)) + │ │ │ │ ├── flags: ∅ │ │ │ │ └── name: :a │ │ │ ├── rest: │ │ │ │ @ SplatNode (location: (1,9)-(1,11)) │ │ │ │ ├── operator_loc: (1,9)-(1,10) = "*" │ │ │ │ └── expression: │ │ │ │ @ RequiredParameterNode (location: (1,10)-(1,11)) + │ │ │ │ ├── flags: ∅ │ │ │ │ └── name: :b │ │ │ ├── rights: (length: 1) │ │ │ │ └── @ RequiredParameterNode (location: (1,13)-(1,14)) + │ │ │ │ ├── flags: ∅ │ │ │ │ └── name: :c │ │ │ ├── lparen_loc: (1,5)-(1,6) = "(" │ │ │ └── rparen_loc: (1,14)-(1,15) = ")" |