summaryrefslogtreecommitdiff
path: root/compile.c
diff options
context:
space:
mode:
authorJeremy Evans <code@jeremyevans.net>2021-05-13 15:31:46 -0700
committerJeremy Evans <code@jeremyevans.net>2021-07-15 09:56:02 -0700
commitfa87f72e1e84e2b55516be188f00434a683b924c (patch)
tree0c4efbae462e0ebae46447ea0e18bbea4d7821f0 /compile.c
parentf1035248af04b2a4d58990740c3f1b840a5eac78 (diff)
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]
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/4502
Diffstat (limited to 'compile.c')
-rw-r--r--compile.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/compile.c b/compile.c
index a7862194c0..38a96f165e 100644
--- a/compile.c
+++ b/compile.c
@@ -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: