зеркало из https://github.com/github/ruby.git
[Prism] Implement defined? for PM_UNTIL_NODE
Ruby code: ```ruby defined?(until a == 1; end) ``` Instructions: ``` "********* Ruby *************" == disasm: #<ISeq:<compiled>@<compiled>:1 (1,0)-(59,16)> 0000 putobject "expression" ( 59)[Li] 0002 leave "********* PRISM *************" == disasm: #<ISeq:<compiled>@<compiled>:58 (58,0)-(58,16)> 0000 putobject "expression" ( 58)[Li] 0002 leave ``` Related: ruby/prism#2188
This commit is contained in:
Родитель
24d02cd485
Коммит
555af5e599
|
@ -2571,6 +2571,7 @@ pm_compile_defined_expr0(rb_iseq_t *iseq, const pm_node_t *node, LINK_ANCHOR *co
|
|||
case PM_SOURCE_LINE_NODE:
|
||||
case PM_STRING_NODE:
|
||||
case PM_SYMBOL_NODE:
|
||||
case PM_UNTIL_NODE:
|
||||
case PM_WHILE_NODE:
|
||||
case PM_X_STRING_NODE:
|
||||
dtype = DEFINED_EXPR;
|
||||
|
|
|
@ -261,6 +261,7 @@ module Prism
|
|||
assert_prism_eval("defined?(1.2r)")
|
||||
assert_prism_eval("defined?(class << self; end)")
|
||||
assert_prism_eval("defined?(while a != 1; end)")
|
||||
assert_prism_eval("defined?(until a == 1; end)")
|
||||
end
|
||||
|
||||
def test_GlobalVariableReadNode
|
||||
|
|
Загрузка…
Ссылка в новой задаче