[PRISM] Make prism compiler warning experimental
This commit is contained in:
parent
f5801e2bf4
commit
8414c26f0d
14
ruby.c
14
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)) {
|
else if (is_option_with_arg("parser", Qfalse, Qtrue)) {
|
||||||
if (strcmp("prism", s) == 0) {
|
if (strcmp("prism", s) == 0) {
|
||||||
(*rb_ruby_prism_ptr()) = true;
|
(*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) {
|
else if (strcmp("parse.y", s) == 0) {
|
||||||
// default behavior
|
// default behavior
|
||||||
@ -2089,6 +2085,16 @@ prism_script(ruby_cmdline_options_t *opt, pm_parse_result_t *result)
|
|||||||
{
|
{
|
||||||
ruby_opt_init(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."
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
memset(result, 0, sizeof(*result));
|
memset(result, 0, sizeof(*result));
|
||||||
result->options.line = 1;
|
result->options.line = 1;
|
||||||
|
|
||||||
|
@ -302,7 +302,7 @@ class TestRubyOptions < Test::Unit::TestCase
|
|||||||
|
|
||||||
assert_in_out_err(%w(--parser=notreal -e) + ["puts :hi"], "", [], /unknown parser notreal/)
|
assert_in_out_err(%w(--parser=notreal -e) + ["puts :hi"], "", [], /unknown parser notreal/)
|
||||||
|
|
||||||
assert_in_out_err(%w(--parser=prism --version), "", /\+PRISM/, warning)
|
assert_in_out_err(%w(--parser=prism --version), "", /\+PRISM/, [])
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_eval
|
def test_eval
|
||||||
|
Loading…
x
Reference in New Issue
Block a user