File tree Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -74,11 +74,16 @@ def self.to_html token_stream
74
74
##
75
75
# Adds +tokens+ to the collected tokens
76
76
77
- def add_tokens ( * tokens )
78
- tokens . flatten . each { | token | @token_stream << token }
77
+ def add_tokens ( tokens )
78
+ @token_stream . concat ( tokens )
79
79
end
80
80
81
- alias add_token add_tokens
81
+ ##
82
+ # Adds one +token+ to the collected tokens
83
+
84
+ def add_token ( token )
85
+ @token_stream . push ( token )
86
+ end
82
87
83
88
##
84
89
# Starts collecting tokens
Original file line number Diff line number Diff line change @@ -78,7 +78,7 @@ def test_markup_code
78
78
]
79
79
80
80
@c2_a . collect_tokens
81
- @c2_a . add_tokens ( * tokens )
81
+ @c2_a . add_tokens ( tokens )
82
82
83
83
expected = '<span class="ruby-constant">CONSTANT</span>'
84
84
@@ -96,7 +96,7 @@ def test_markup_code_with_line_numbers
96
96
]
97
97
98
98
@c2_a . collect_tokens
99
- @c2_a . add_tokens ( * tokens )
99
+ @c2_a . add_tokens ( tokens )
100
100
101
101
assert_equal <<-EXPECTED . chomp , @c2_a . markup_code
102
102
<span class="ruby-comment"># File xref_data.rb, line 1</span>
You can’t perform that action at this time.
0 commit comments