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.
1 parent 1f72f37 commit dde8f6aCopy full SHA for dde8f6a
test/test_rdoc_ruby_lex.rb
@@ -435,5 +435,24 @@ def test_rational_imaginary_tokenize
435
assert_equal expected, tokens
436
end
437
438
+ def test_class_tokenize_square_bracket_as_method
439
+ tokens = RDoc::RubyLex.tokenize "Array.[](1, 2)", nil
440
+
441
+ expected = [
442
+ @TK::TkCONSTANT .new(0, 1, 0, "Array"),
443
+ @TK::TkDOT .new(5, 1, 5, "."),
444
+ @TK::TkIDENTIFIER.new(6, 1, 6, "[]"),
445
+ @TK::TkfLPAREN .new(8, 1, 8, "("),
446
+ @TK::TkINTEGER .new(9, 1, 9, "1"),
447
+ @TK::TkCOMMA .new(10, 1, 10, ","),
448
+ @TK::TkSPACE .new(11, 1, 11, " "),
449
+ @TK::TkINTEGER .new(12, 1, 12, "2"),
450
+ @TK::TkRPAREN .new(13, 1, 13, ")"),
451
+ @TK::TkNL .new(14, 1, 14, "\n")
452
+ ]
453
454
+ assert_equal expected, tokens
455
+ end
456
457
458
0 commit comments