summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Newton <kddnewton@gmail.com>2024-05-17 09:45:08 -0400
committerKevin Newton <kddnewton@gmail.com>2024-05-17 10:33:42 -0400
commit4ba0579da651ef3373fce59034f0fcb8b0ad9e5f (patch)
tree54c9bb6c8258d06c3279a351ec77307277bc6698
parent2d825ca7d0d8d57b49327c3760ec650776ebe60e (diff)
[PRISM] Enable TestSyntax#test_error_message_encoding
-rw-r--r--prism_compile.c3
-rw-r--r--test/.excludes-prism/TestSyntax.rb1
2 files changed, 2 insertions, 2 deletions
diff --git a/prism_compile.c b/prism_compile.c
index 5ecc69470f..a53d94f5c2 100644
--- a/prism_compile.c
+++ b/prism_compile.c
@@ -9269,7 +9269,8 @@ pm_parse_process_error(const pm_parse_result_t *result)
}
}
- VALUE error = rb_exc_new(rb_eSyntaxError, pm_buffer_value(&buffer), pm_buffer_length(&buffer));
+ VALUE message = rb_enc_str_new(pm_buffer_value(&buffer), pm_buffer_length(&buffer), result->node.encoding);
+ VALUE error = rb_exc_new_str(rb_eSyntaxError, message);
rb_encoding *filepath_encoding = result->node.filepath_encoding != NULL ? result->node.filepath_encoding : rb_utf8_encoding();
VALUE path = rb_enc_str_new((const char *) pm_string_source(filepath), pm_string_length(filepath), filepath_encoding);
diff --git a/test/.excludes-prism/TestSyntax.rb b/test/.excludes-prism/TestSyntax.rb
index 6e9f51604a..0505330b1c 100644
--- a/test/.excludes-prism/TestSyntax.rb
+++ b/test/.excludes-prism/TestSyntax.rb
@@ -1,5 +1,4 @@
exclude(:test_dedented_heredoc_continued_line, "heredoc line continuation dedent calculation")
-exclude(:test_error_message_encoding, "syntax error message encoding")
exclude(:test_it, "https://github.com/ruby/prism/issues/2323")
exclude(:test_numbered_parameter, "should raise syntax error for numbered parameters in inner blocks")
exclude(:test_unterminated_heredoc_cr, "quoted \r heredoc terminators should not match \r\n")