mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
Workaround for Prism::ParseTest#test_filepath
for "unparser/corpus/literal/def.txt"
See the discussion on https://github.com/ruby/ruby/pull/9923
This commit is contained in:
parent
20dbc7a5f4
commit
2a4b6ed37c
2 changed files with 10 additions and 2 deletions
10
parse.y
10
parse.y
|
@ -9412,7 +9412,17 @@ formal_argument(struct parser_params *p, ID id)
|
||||||
#undef ERR
|
#undef ERR
|
||||||
}
|
}
|
||||||
shadowing_lvar(p, id);
|
shadowing_lvar(p, id);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Workaround for Prism::ParseTest#test_filepath for "unparser/corpus/literal/def.txt"
|
||||||
|
*
|
||||||
|
* See the discussion on https://github.com/ruby/ruby/pull/9923
|
||||||
|
*/
|
||||||
|
#ifndef RIPPER
|
||||||
return id;
|
return id;
|
||||||
|
#else
|
||||||
|
return 0;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef RIPPER
|
#ifdef RIPPER
|
||||||
|
|
|
@ -207,8 +207,6 @@ module Prism
|
||||||
# https://bugs.ruby-lang.org/issues/19539
|
# https://bugs.ruby-lang.org/issues/19539
|
||||||
ripper_should_parse = false if relative == "heredocs_leading_whitespace.txt" && RUBY_VERSION < "3.3.0"
|
ripper_should_parse = false if relative == "heredocs_leading_whitespace.txt" && RUBY_VERSION < "3.3.0"
|
||||||
|
|
||||||
ripper_should_parse = false if relative == "unparser/corpus/literal/def.txt"
|
|
||||||
|
|
||||||
define_method "test_filepath_#{relative}" do
|
define_method "test_filepath_#{relative}" do
|
||||||
# First, read the source from the filepath. Use binmode to avoid converting CRLF on Windows,
|
# First, read the source from the filepath. Use binmode to avoid converting CRLF on Windows,
|
||||||
# and explicitly set the external encoding to UTF-8 to override the binmode default.
|
# and explicitly set the external encoding to UTF-8 to override the binmode default.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue