From a9fa5f5a15d191bb2660da6be5ef898191c536d3 Mon Sep 17 00:00:00 2001 From: matz Date: Thu, 30 Jun 2005 08:31:38 +0000 Subject: * lib/irb/ruby-lex.rb (RubyLex::identify_number): should not treat plain zero as an octal number. [ruby-dev:26410] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@8680 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/irb/ruby-lex.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/irb/ruby-lex.rb b/lib/irb/ruby-lex.rb index 4c51afbc28..4b7ad6a0bf 100644 --- a/lib/irb/ruby-lex.rb +++ b/lib/irb/ruby-lex.rb @@ -936,6 +936,8 @@ class RubyLex @lex_state = EXPR_END if peek(0) == "0" && peek(1) !~ /[.eE]/ + len0 = true + non_digit = false getc if /[xX]/ =~ peek(0) ch = getc @@ -948,10 +950,9 @@ class RubyLex match = /[0-7_]/ else match = /[0-7_]/ + len0 = false end - len0 = true - non_digit = false while ch = getc if match =~ ch if ch == "_" -- cgit v1.2.3