mirror of
https://github.com/ruby/ruby.git
synced 2025-09-16 17:14:01 +02:00
merge revision(s) 60160: [Backport #13998]
parse.y: token info with BOM * parse.y (parser_prepare): set token_info_enabled flag first, before returning at BOM. [ruby-dev:50288] [Bug #13998] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_4@62691 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
2921521e92
commit
4e9537bf33
3 changed files with 13 additions and 2 deletions
2
parse.y
2
parse.y
|
@ -7234,6 +7234,7 @@ static void
|
|||
parser_prepare(struct parser_params *parser)
|
||||
{
|
||||
int c = nextc();
|
||||
parser->token_info_enabled = !compile_for_eval && RTEST(ruby_verbose);
|
||||
switch (c) {
|
||||
case '#':
|
||||
if (peek('!')) parser->has_shebang = 1;
|
||||
|
@ -7253,7 +7254,6 @@ parser_prepare(struct parser_params *parser)
|
|||
}
|
||||
pushback(c);
|
||||
parser->enc = rb_enc_get(lex_lastline);
|
||||
parser->token_info_enabled = !compile_for_eval && RTEST(ruby_verbose);
|
||||
}
|
||||
|
||||
#define IS_ARG() IS_lex_state(EXPR_ARG_ANY)
|
||||
|
|
|
@ -443,6 +443,17 @@ class TestRubyOptions < Test::Unit::TestCase
|
|||
t.flush
|
||||
assert_in_out_err(["-w", t.path], "", [], [], '[ruby-core:25442]')
|
||||
end
|
||||
|
||||
a.for("BOM with #{b}") do
|
||||
err = ["#{t.path}:2: warning: mismatched indentations at '#{e}' with '#{k}' at 1"]
|
||||
t.rewind
|
||||
t.truncate(0)
|
||||
t.print "\u{feff}"
|
||||
t.puts src
|
||||
t.flush
|
||||
assert_in_out_err(["-w", t.path], "", [], err)
|
||||
assert_in_out_err(["-wr", t.path, "-e", ""], "", [], err)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#define RUBY_VERSION "2.4.4"
|
||||
#define RUBY_RELEASE_DATE "2018-03-07"
|
||||
#define RUBY_PATCHLEVEL 253
|
||||
#define RUBY_PATCHLEVEL 254
|
||||
|
||||
#define RUBY_RELEASE_YEAR 2018
|
||||
#define RUBY_RELEASE_MONTH 3
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue