diff options
author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-03-18 15:16:52 +0000 |
---|---|---|
committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-03-18 15:16:52 +0000 |
commit | c17242100cd5ef5a5cb7165e1ffe237f1d120318 (patch) | |
tree | a5172521051ac1b38f381e5452efca814db9c721 | |
parent | 541f4f250276c1f999c651a6f5699565e77d850b (diff) |
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_3@62822 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | parse.y | 2 | ||||
-rw-r--r-- | test/ruby/test_rubyoptions.rb | 10 | ||||
-rw-r--r-- | version.h | 2 |
4 files changed, 19 insertions, 2 deletions
@@ -1,3 +1,10 @@ +Mon Mar 19 00:16:28 2018 Nobuyoshi Nakada <nobu@ruby-lang.org> + + parse.y: token info with BOM + + * parse.y (parser_prepare): set token_info_enabled flag first, before + returning at BOM. [Bug #13998] + Mon Mar 19 00:06:43 2018 Hiroshi Shirosaki <h.shirosaki@gmail.com> io.c: fix segfault with closing socket on Windows @@ -7364,6 +7364,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; @@ -7384,7 +7385,6 @@ parser_prepare(struct parser_params *parser) pushback(c); parser->enc = rb_enc_get(lex_lastline); deferred_nodes = 0; - parser->token_info_enabled = !compile_for_eval && RTEST(ruby_verbose); } #define IS_ARG() IS_lex_state(EXPR_ARG_ANY) diff --git a/test/ruby/test_rubyoptions.rb b/test/ruby/test_rubyoptions.rb index 4495e1e4ea..6f4ecc8d77 100644 --- a/test/ruby/test_rubyoptions.rb +++ b/test/ruby/test_rubyoptions.rb @@ -406,6 +406,16 @@ class TestRubyOptions < Test::Unit::TestCase t.puts " end" t.flush assert_in_out_err(["-w", t.path], "", [], [], '[ruby-core:25442]') + + err = ["#{t.path}:2: warning: mismatched indentations at 'end' with 'begin' at 1"] + t.rewind + t.truncate(0) + t.print "\u{feff}" + t.puts "begin" + t.puts " end" + t.flush + assert_in_out_err(["-w", t.path], "", [], err) + assert_in_out_err(["-wr", t.path, "-e", ""], "", [], err) } end @@ -1,6 +1,6 @@ #define RUBY_VERSION "2.3.7" #define RUBY_RELEASE_DATE "2018-03-19" -#define RUBY_PATCHLEVEL 422 +#define RUBY_PATCHLEVEL 423 #define RUBY_RELEASE_YEAR 2018 #define RUBY_RELEASE_MONTH 3 |