summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authoreileencodes <eileencodes@gmail.com>2023-12-04 11:45:42 -0500
committerAaron Patterson <aaron.patterson@gmail.com>2023-12-04 12:03:22 -0800
commit569750f624dbb4e9d5836d4e9c46816224f4b681 (patch)
treec6a7d470bc270f41bbcd2112afa4e6313dba84df /include
parente3ca50b02fc4e3381f62a60bce0164d2132cf4ed (diff)
[Prism] Implement backref and numbered reference for `defined?`
This PR implements `PM_BACK_REFERENCE_READ_NODE` and `PM_NUMBERED_REFERENCE_READ_NODE` for `defined?`. The following now works: * `PM_NUMBERED_REFERENCE_READ_NODE` ``` defined? $1 defined? $2 ``` Instructions: ``` "********* RUBY *************" == disasm: #<ISeq:<compiled>@<compiled>:0 (0,0)-(0,12)> 0000 putnil 0001 defined ref, :$1, "global-variable" 0005 leave "********* PRISM *************" == disasm: #<ISeq:<compiled>@<compiled>:0 (0,0)-(0,12)> 0000 putnil 0001 defined ref, :$1, "global-variable" 0005 leave ``` * `PM_BACK_REFERENCE_READ_NODE` ``` defined? $' defined? $` defined? $& ``` Instructions: ``` "********* RUBY *************" == disasm: #<ISeq:<compiled>@<compiled>:0 (0,0)-(0,12)> 0000 putnil 0001 defined ref, :$`, "global-variable" 0005 leave "********* PRISM *************" == disasm: #<ISeq:<compiled>@<compiled>:0 (0,0)-(0,12)> 0000 putnil 0001 defined ref, :$`, "global-variable" 0005 leave ```
Diffstat (limited to 'include')
0 files changed, 0 insertions, 0 deletions