diff options
author | Kevin Newton <[email protected]> | 2024-05-20 10:44:13 -0400 |
---|---|---|
committer | Kevin Newton <[email protected]> | 2024-05-20 11:28:53 -0400 |
commit | ca5b4580442eac3ee8ad3f98b692d204d7b92f03 () | |
tree | 2fa522f388847265e5c9331e6280ba3069cffb68 | |
parent | 1ba93c2c4d4fa89f5fda490b6e82caafb0d5abc6 (diff) |
[PRISM] Match CRuby line semantics for evstr
-rw-r--r-- | prism/prism.c | 7 | ||||
-rw-r--r-- | prism_compile.c | 17 | ||||
-rw-r--r-- | test/.excludes-prism/TestCoverage.rb | 1 |
3 files changed, 18 insertions, 7 deletions
@@ -15460,6 +15460,13 @@ parse_string_part(pm_parser_t *parser) { expect1(parser, PM_TOKEN_EMBEXPR_END, PM_ERR_EMBEXPR_END); pm_token_t closing = parser->previous; return (pm_node_t *) pm_embedded_statements_node_create(parser, &opening, statements, &closing); } @@ -570,6 +570,7 @@ pm_interpolated_node_compile(rb_iseq_t *iseq, const pm_node_list_t *parts, const if (parts_size > 0) { VALUE current_string = Qnil; for (size_t index = 0; index < parts_size; index++) { const pm_node_t *part = parts->nodes[index]; @@ -590,6 +591,7 @@ pm_interpolated_node_compile(rb_iseq_t *iseq, const pm_node_list_t *parts, const } else { current_string = string_value; } } else { @@ -616,6 +618,7 @@ pm_interpolated_node_compile(rb_iseq_t *iseq, const pm_node_list_t *parts, const } else { current_string = string_value; } } else { @@ -640,11 +643,13 @@ pm_interpolated_node_compile(rb_iseq_t *iseq, const pm_node_list_t *parts, const current_string = rb_enc_str_new(NULL, 0, encoding); } - PUSH_INSN1(ret, *node_location, putobject, rb_fstring(current_string)); PM_COMPILE_NOT_POPPED(part); - PUSH_INSN(ret, *node_location, dup); - PUSH_INSN1(ret, *node_location, objtostring, new_callinfo(iseq, idTo_s, 0, VM_CALL_FCALL | VM_CALL_ARGS_SIMPLE , NULL, FALSE)); - PUSH_INSN(ret, *node_location, anytostring); current_string = Qnil; stack_size += 2; @@ -656,10 +661,10 @@ pm_interpolated_node_compile(rb_iseq_t *iseq, const pm_node_list_t *parts, const current_string = rb_fstring(current_string); if (stack_size == 0 && interpolated) { - PUSH_INSN1(ret, *node_location, putstring, current_string); } else { - PUSH_INSN1(ret, *node_location, putobject, current_string); } current_string = Qnil; @@ -1 +0,0 @@ -exclude(:test_eval, "respect eval coverage setting") |