aboutsummaryrefslogtreecommitdiffstats
path: root/ruby.c
diff options
context:
space:
mode:
authorKevin Newton <kddnewton@gmail.com>2024-02-14 10:32:09 -0500
committerKevin Newton <kddnewton@gmail.com>2024-02-16 11:56:48 -0500
commit8414c26f0d858d343686825e58afa323fe90f4a2 (patch)
tree91621e3ed15df37d115749a7959821340085f116 /ruby.c
parentf5801e2bf404cbb0f673a6ebb040b0ba6cd01b77 (diff)
downloadruby-8414c26f0d858d343686825e58afa323fe90f4a2.tar.gz
[PRISM] Make prism compiler warning experimental
Diffstat (limited to 'ruby.c')
-rw-r--r--ruby.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/ruby.c b/ruby.c
index 5dda452c89..3d8823c0f3 100644
--- a/ruby.c
+++ b/ruby.c
@@ -1408,10 +1408,6 @@ proc_long_options(ruby_cmdline_options_t *opt, const char *s, long argc, char **
else if (is_option_with_arg("parser", Qfalse, Qtrue)) {
if (strcmp("prism", s) == 0) {
(*rb_ruby_prism_ptr()) = true;
- rb_warn("The compiler based on the Prism parser is currently experimental and "
- "compatibility with the compiler based on parse.y "
- "is not yet complete. Please report any issues you "
- "find on the `ruby/prism` issue tracker.");
}
else if (strcmp("parse.y", s) == 0) {
// default behavior
@@ -2089,6 +2085,16 @@ prism_script(ruby_cmdline_options_t *opt, pm_parse_result_t *result)
{
ruby_opt_init(opt);
+ if (rb_warning_category_enabled_p(RB_WARN_CATEGORY_EXPERIMENTAL)) {
+ rb_category_warn(
+ RB_WARN_CATEGORY_EXPERIMENTAL,
+ "The compiler based on the Prism parser is currently experimental "
+ "and compatibility with the compiler based on parse.y is not yet "
+ "complete. Please report any issues you find on the `ruby/prism` "
+ "issue tracker."
+ );
+ }
+
memset(result, 0, sizeof(*result));
result->options.line = 1;