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/block_return.txt | |
parent | 6310522a9a33c19e963e56a8f87388d802525937 (diff) |
[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/block_return.txt')
-rw-r--r-- | test/prism/snapshots/seattlerb/block_return.txt | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/test/prism/snapshots/seattlerb/block_return.txt b/test/prism/snapshots/seattlerb/block_return.txt index 858e1a9de4..c9f9a42f72 100644 --- a/test/prism/snapshots/seattlerb/block_return.txt +++ b/test/prism/snapshots/seattlerb/block_return.txt @@ -50,6 +50,7 @@ │ │ │ └── closing_loc: (1,22)-(1,23) = "|" │ │ ├── body: ∅ │ │ ├── opening_loc: (1,15)-(1,17) = "do" - │ │ └── closing_loc: (1,24)-(1,27) = "end" + │ │ ├── closing_loc: (1,24)-(1,27) = "end" + │ │ └── numbered_parameters: 0 │ └── flags: ∅ └── flags: ∅ |