summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ruby.c27
-rw-r--r--test/ruby/test_rubyoptions.rb7
2 files changed, 5 insertions, 29 deletions
diff --git a/ruby.c b/ruby.c
index 2c7e3285a7..a0982e86d9 100644
--- a/ruby.c
+++ b/ruby.c
@@ -2099,27 +2099,6 @@ process_script(ruby_cmdline_options_t *opt)
}
/**
- * Call ruby_opt_init to set up the global state based on the command line
- * options, and then warn if prism is enabled and the experimental warning
- * category is enabled.
- */
-static void
-prism_opt_init(ruby_cmdline_options_t *opt)
-{
- 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."
- );
- }
-}
-
-/**
* Process the command line options and parse the script into the given result.
* Raise an error if the script cannot be parsed.
*/
@@ -2147,14 +2126,14 @@ prism_script(ruby_cmdline_options_t *opt, pm_parse_result_t *result)
pm_options_command_line_set(options, command_line);
pm_options_filepath_set(options, "-");
- prism_opt_init(opt);
+ ruby_opt_init(opt);
error = pm_parse_stdin(result);
}
else if (opt->e_script) {
command_line |= PM_OPTIONS_COMMAND_LINE_E;
pm_options_command_line_set(options, command_line);
- prism_opt_init(opt);
+ ruby_opt_init(opt);
result->node.coverage_enabled = 0;
error = pm_parse_string(result, opt->e_script, rb_str_new2("-e"));
}
@@ -2166,7 +2145,7 @@ prism_script(ruby_cmdline_options_t *opt, pm_parse_result_t *result)
// line options. We do it in this order so that if the main script fails
// to load, it doesn't require files required by -r.
if (NIL_P(error)) {
- prism_opt_init(opt);
+ ruby_opt_init(opt);
error = pm_parse_file(result, opt->script_name);
}
diff --git a/test/ruby/test_rubyoptions.rb b/test/ruby/test_rubyoptions.rb
index d9b98be8ba..22663ed007 100644
--- a/test/ruby/test_rubyoptions.rb
+++ b/test/ruby/test_rubyoptions.rb
@@ -302,11 +302,8 @@ class TestRubyOptions < Test::Unit::TestCase
end
def test_parser_flag
- warning = /compiler based on the Prism parser is currently experimental/
-
- assert_in_out_err(%w(--parser=prism -e) + ["puts :hi"], "", %w(hi), warning)
- assert_in_out_err(%w(--parser=prism -W:no-experimental -e) + ["puts :hi"], "", %w(hi), [])
- assert_in_out_err(%w(--parser=prism -W:no-experimental --dump=parsetree -e _=:hi), "", /"hi"/, [])
+ assert_in_out_err(%w(--parser=prism -e) + ["puts :hi"], "", %w(hi), [])
+ assert_in_out_err(%w(--parser=prism --dump=parsetree -e _=:hi), "", /"hi"/, [])
assert_in_out_err(%w(--parser=parse.y -e) + ["puts :hi"], "", %w(hi), [])
assert_norun_with_rflag('--parser=parse.y', '--version', "")