From bc44acb5a34f9b54c6188cb081f03f1935ce07dd Mon Sep 17 00:00:00 2001 From: nobu Date: Wed, 14 Dec 2016 04:35:28 +0000 Subject: parse.y: fix yyerror message * parse.y (parser_yyerror): show the error line even if the error is at the end. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57073 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_parse.rb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'test/ruby') diff --git a/test/ruby/test_parse.rb b/test/ruby/test_parse.rb index 57d03166c7..b4a63e369d 100644 --- a/test/ruby/test_parse.rb +++ b/test/ruby/test_parse.rb @@ -953,6 +953,11 @@ x = __ENCODING__ end end + def test_yyerror_at_eol + assert_syntax_error(" 0b", /\^/) + assert_syntax_error(" 0b\n", /\^/) + end + =begin def test_past_scope_variable assert_warning(/past scope/) {catch {|tag| eval("BEGIN{throw tag}; tap {a = 1}; a")}} -- cgit v1.2.3