aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-06-28 04:08:51 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-06-28 04:08:51 +0000
commit87afbe4685bf5d39d94e312b78515d50b9364f4d (patch)
tree9033545cb4ac99047307f53f2dc5183218bba55b /test
parent5b8ce2298ae990473a0356eb6bd5a949001aa70c (diff)
downloadruby-87afbe4685bf5d39d94e312b78515d50b9364f4d.tar.gz
parse.y: flush numeric token
* parse.y (parser_number_literal_suffix, parse_numeric): flush numeric token so following unexpected token part is marked. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59191 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_parse.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/ruby/test_parse.rb b/test/ruby/test_parse.rb
index d2fc5f0721..d869fbd7ab 100644
--- a/test/ruby/test_parse.rb
+++ b/test/ruby/test_parse.rb
@@ -1007,6 +1007,12 @@ x = __ENCODING__
end
end
+ def test_unexpected_token_after_numeric
+ assert_raise_with_message(SyntaxError, /^ \^~~\z/) do
+ eval('0000xyz')
+ end
+ end
+
=begin
def test_past_scope_variable
assert_warning(/past scope/) {catch {|tag| eval("BEGIN{throw tag}; tap {a = 1}; a")}}