diff options
author | Jemma Issroff <jemmaissroff@gmail.com> | 2023-11-28 15:42:33 -0500 |
---|---|---|
committer | git <svn-admin@ruby-lang.org> | 2023-11-28 21:08:46 +0000 |
commit | 04cbcd37b1c18c4db4b9df8d80abb4efec11755c (patch) | |
tree | cda45c96254e9720ac53101b74a962f4dace7c8a /test/prism/snapshots/seattlerb/case_in.txt | |
parent | 6310522a9a33c19e963e56a8f87388d802525937 (diff) | |
download | ruby-04cbcd37b1c18c4db4b9df8d80abb4efec11755c.tar.gz |
[ruby/prism] Add numbered_parameters field to BlockNode and LambdaNode
We are aware at parse time how many numbered parameters we have
on a BlockNode or LambdaNode, but prior to this commit, did not
store that information anywhere in its own right.
The numbered parameters were stored as locals, but this does not
distinguish them from other locals that have been set, for example
in `a { b = 1; _1 }` there is nothing on the AST that distinguishes
b from _1.
Consumers such as the compiler need to know information about how
many numbered parameters exist to set up their own tables around
parameters. Since we have this information at parse time, we should
compute it here, instead of deferring the work later on.
https://github.com/ruby/prism/commit/bf4a1e124d
Diffstat (limited to 'test/prism/snapshots/seattlerb/case_in.txt')
-rw-r--r-- | test/prism/snapshots/seattlerb/case_in.txt | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/test/prism/snapshots/seattlerb/case_in.txt b/test/prism/snapshots/seattlerb/case_in.txt index 793448fb7a..0000aa064d 100644 --- a/test/prism/snapshots/seattlerb/case_in.txt +++ b/test/prism/snapshots/seattlerb/case_in.txt @@ -539,10 +539,11 @@ │ │ │ │ │ │ ├── locals: (length: 0) │ │ │ │ │ │ ├── opening_loc: (70,6)-(70,7) = "(" │ │ │ │ │ │ └── closing_loc: (70,8)-(70,9) = ")" - │ │ │ │ │ └── body: - │ │ │ │ │ @ StatementsNode (location: (70,12)-(70,16)) - │ │ │ │ │ └── body: (length: 1) - │ │ │ │ │ └── @ TrueNode (location: (70,12)-(70,16)) + │ │ │ │ │ ├── body: + │ │ │ │ │ │ @ StatementsNode (location: (70,12)-(70,16)) + │ │ │ │ │ │ └── body: (length: 1) + │ │ │ │ │ │ └── @ TrueNode (location: (70,12)-(70,16)) + │ │ │ │ │ └── numbered_parameters: 0 │ │ │ │ └── @ LocalVariableTargetNode (location: (70,20)-(70,21)) │ │ │ │ ├── name: :c │ │ │ │ └── depth: 0 |