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 474b5ab commit bbd4cf6Copy full SHA for bbd4cf6
test/test_rdoc_ruby_lex.rb
@@ -101,6 +101,31 @@ def x
101
assert_equal expected, tokens
102
end
103
104
+ def test_class_tokenize_reserved_keyword_with_args
105
+ tokens = RDoc::RubyLex.tokenize <<-'RUBY', nil
106
+yield :foo
107
+super :bar
108
+defined? :baz
109
+ RUBY
110
+
111
+ expected = [
112
+ @TK::TkYIELD .new( 0, 1, 0, "yield"),
113
+ @TK::TkSPACE .new( 5, 1, 5, " "),
114
+ @TK::TkSYMBOL .new( 6, 1, 6, ":foo"),
115
+ @TK::TkNL .new(10, 1, 10, "\n"),
116
+ @TK::TkSUPER .new(11, 2, 0, "super"),
117
+ @TK::TkSPACE .new(16, 2, 5, " "),
118
+ @TK::TkSYMBOL .new(17, 2, 6, ":bar"),
119
+ @TK::TkNL .new(21, 2, 11, "\n"),
120
+ @TK::TkDEFINED.new(22, 3, 0, "defined?"),
121
+ @TK::TkSPACE .new(30, 3, 8, " "),
122
+ @TK::TkSYMBOL .new(31, 3, 9, ":baz"),
123
+ @TK::TkNL .new(35, 3, 22, "\n")
124
+ ]
125
126
+ assert_equal expected, tokens
127
+ end
128
129
def test_class_tokenize_hash_symbol
130
tokens = RDoc::RubyLex.tokenize '{ class:"foo" }', nil
131
0 commit comments