diff options
author | Jeremy Evans <code@jeremyevans.net> | 2021-05-13 15:31:46 -0700 |
---|---|---|
committer | Jeremy Evans <code@jeremyevans.net> | 2021-07-15 09:56:02 -0700 |
commit | fa87f72e1e84e2b55516be188f00434a683b924c (patch) | |
tree | 0c4efbae462e0ebae46447ea0e18bbea4d7821f0 /compile.c | |
parent | f1035248af04b2a4d58990740c3f1b840a5eac78 (diff) | |
download | ruby-fa87f72e1e84e2b55516be188f00434a683b924c.tar.gz |
Add pattern matching pin support for instance/class/global variables
Pin matching for local variables and constants is already supported,
and it is fairly simple to add support for these variable types.
Note that pin matching for method calls is still not supported
without wrapping in parentheses (pin expressions). I think that's
for the best as method calls are far more complex (arguments/blocks).
Implements [Feature #17724]
Diffstat (limited to 'compile.c')
-rw-r--r-- | compile.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -6462,6 +6462,9 @@ iseq_compile_pattern_each(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *c case NODE_CONST: case NODE_LVAR: case NODE_DVAR: + case NODE_IVAR: + case NODE_CVAR: + case NODE_GVAR: case NODE_TRUE: case NODE_FALSE: case NODE_SELF: |