merge revision(s) 61346: [Backport #14206]

parse.y: end of script at newline

	* parse.y (parser_yylex): deal with end of script chars just after
	  ignored newline as other places.  [ruby-core:84349] [Bug #14206]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_3@62938 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
usa 2018-03-28 04:49:41 +00:00
parent b24443d37d
commit 2d0062bcf5
4 changed files with 16 additions and 3 deletions

View File

@ -1,3 +1,10 @@
Thu Mar 28 13:48:35 2018 Nobuyoshi Nakada <nobu@ruby-lang.org>
parse.y: end of script at newline
* parse.y (parser_yylex): deal with end of script chars just after
ignored newline as other places. [Bug #14206]
Thu Mar 28 13:42:55 2018 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
[DOC] IO.new accepts external_encoding

View File

@ -8195,8 +8195,8 @@ parser_yylex(struct parser_params *parser)
}
goto retry;
}
while ((c = nextc())) {
switch (c) {
while (1) {
switch (c = nextc()) {
case ' ': case '\t': case '\f': case '\r':
case '\13': /* '\v' */
space_seen = 1;

View File

@ -899,6 +899,12 @@ x = __ENCODING__
assert_equal(line, obj.location.lineno, bug)
end
def test_eof_in_def
assert_raise(SyntaxError) { eval("def m\n\0""end") }
assert_raise(SyntaxError) { eval("def m\n\C-d""end") }
assert_raise(SyntaxError) { eval("def m\n\C-z""end") }
end
=begin
def test_past_scope_variable
assert_warning(/past scope/) {catch {|tag| eval("BEGIN{throw tag}; tap {a = 1}; a")}}

View File

@ -1,6 +1,6 @@
#define RUBY_VERSION "2.3.7"
#define RUBY_RELEASE_DATE "2018-03-28"
#define RUBY_PATCHLEVEL 434
#define RUBY_PATCHLEVEL 435
#define RUBY_RELEASE_YEAR 2018
#define RUBY_RELEASE_MONTH 3