зеркало из https://github.com/github/ruby.git
Remove string concat node in prism
This commit is contained in:
Родитель
ddacc08528
Коммит
a5b482837b
|
@ -3686,15 +3686,6 @@ pm_compile_node(rb_iseq_t *iseq, const pm_node_t *node, LINK_ANCHOR *const ret,
|
|||
}
|
||||
return;
|
||||
}
|
||||
case PM_STRING_CONCAT_NODE: {
|
||||
pm_string_concat_node_t *str_concat_node = (pm_string_concat_node_t *)node;
|
||||
PM_COMPILE(str_concat_node->left);
|
||||
PM_COMPILE(str_concat_node->right);
|
||||
if (!popped) {
|
||||
ADD_INSN1(ret, &dummy_line_node, concatstrings, INT2FIX(2));
|
||||
}
|
||||
return;
|
||||
}
|
||||
case PM_STRING_NODE: {
|
||||
if (!popped) {
|
||||
pm_string_node_t *string_node = (pm_string_node_t *) node;
|
||||
|
|
|
@ -417,6 +417,7 @@ module Prism
|
|||
def test_InterpolatedStringNode
|
||||
assert_prism_eval('$pit = 1; "1 #$pit 1"')
|
||||
assert_prism_eval('"1 #{1 + 2} 1"')
|
||||
assert_prism_eval('"Prism" "::" "TestCompilePrism"')
|
||||
end
|
||||
|
||||
def test_InterpolatedSymbolNode
|
||||
|
@ -461,10 +462,6 @@ module Prism
|
|||
assert_prism_eval('2.times.map { /#{1}/o }')
|
||||
end
|
||||
|
||||
def test_StringConcatNode
|
||||
assert_prism_eval('"Prism" "::" "TestCompilePrism"')
|
||||
end
|
||||
|
||||
def test_StringNode
|
||||
assert_prism_eval('"pit"')
|
||||
end
|
||||
|
|
Загрузка…
Ссылка в новой задаче