We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents d3f8522 + a353417 commit a4baf6aCopy full SHA for a4baf6a
lib/rdoc/ruby_lex.rb
@@ -1170,7 +1170,7 @@ def identify_number(op = "")
1170
1171
num = op
1172
1173
- if peek(0) == "0" && peek(1) !~ /[.eE]/
+ if peek(0) == "0" && peek(1) !~ /[.eEri]/
1174
num << getc
1175
1176
case peek(0)
test/test_rdoc_ruby_lex.rb
@@ -527,7 +527,7 @@ def test_unary_minus
527
end
528
529
def test_rational_imaginary_tokenize
530
- tokens = RDoc::RubyLex.tokenize '1.11r + 2.34i + 5.55ri', nil
+ tokens = RDoc::RubyLex.tokenize '1.11r + 2.34i + 5.55ri + 0i', nil
531
532
expected = [
533
@TK::TkRATIONAL .new( 0, 1, 0, '1.11r'),
@@ -539,7 +539,11 @@ def test_rational_imaginary_tokenize
539
@TK::TkPLUS .new(14, 1, 14, '+'),
540
@TK::TkSPACE .new(15, 1, 15, ' '),
541
@TK::TkIMAGINARY.new(16, 1, 16, '5.55ri'),
542
- @TK::TkNL .new(22, 1, 22, "\n"),
+ @TK::TkSPACE .new(22, 1, 22, ' '),
543
+ @TK::TkPLUS .new(23, 1, 23, '+'),
544
+ @TK::TkSPACE .new(24, 1, 24, ' '),
545
+ @TK::TkIMAGINARY.new(25, 1, 25, '0i'),
546
+ @TK::TkNL .new(27, 1, 27, "\n"),
547
]
548
549
assert_equal expected, tokens
0 commit comments