ruby-changes:50550
From: nagachika <ko1@a...>
Date: Wed, 7 Mar 2018 23:26:20 +0900 (JST)
Subject: [ruby-changes:50550] nagachika:r62691 (ruby_2_4): merge revision(s) 60160: [Backport #13998]
nagachika 2018-03-07 23:26:14 +0900 (Wed, 07 Mar 2018) New Revision: 62691 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=62691 Log: 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] Modified directories: branches/ruby_2_4/ Modified files: branches/ruby_2_4/parse.y branches/ruby_2_4/test/ruby/test_rubyoptions.rb branches/ruby_2_4/version.h Index: ruby_2_4/version.h =================================================================== --- ruby_2_4/version.h (revision 62690) +++ ruby_2_4/version.h (revision 62691) @@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_4/version.h#L1 #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 Index: ruby_2_4/parse.y =================================================================== --- ruby_2_4/parse.y (revision 62690) +++ ruby_2_4/parse.y (revision 62691) @@ -7234,6 +7234,7 @@ static void https://github.com/ruby/ruby/blob/trunk/ruby_2_4/parse.y#L7234 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 *par https://github.com/ruby/ruby/blob/trunk/ruby_2_4/parse.y#L7254 } 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) Index: ruby_2_4/test/ruby/test_rubyoptions.rb =================================================================== --- ruby_2_4/test/ruby/test_rubyoptions.rb (revision 62690) +++ ruby_2_4/test/ruby/test_rubyoptions.rb (revision 62691) @@ -443,6 +443,17 @@ class TestRubyOptions < Test::Unit::Test https://github.com/ruby/ruby/blob/trunk/ruby_2_4/test/ruby/test_rubyoptions.rb#L443 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 Index: ruby_2_4 =================================================================== --- ruby_2_4 (revision 62690) +++ ruby_2_4 (revision 62691) Property changes on: ruby_2_4 ___________________________________________________________________ Modified: svn:mergeinfo ## -0,0 +0,1 ## Merged /trunk:r60160 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/