@@ -53,10 +53,10 @@ class RDoc::Markup::AttributeManager
5353 attr_reader :protectable
5454
5555 ##
56- # And this maps _special_ sequences to a name. A special sequence is
57- # something like a WikiWord
56+ # And this maps _regexp handling_ sequences to a name. A regexp handling
57+ # sequence is something like a WikiWord
5858
59- attr_reader :special
59+ attr_reader :regexp_handlings
6060
6161 ##
6262 # Creates a new attribute manager that understands bold, emphasized and
@@ -66,7 +66,7 @@ def initialize
6666 @html_tags = { }
6767 @matching_word_pairs = { }
6868 @protectable = %w[ < ]
69- @special = [ ]
69+ @regexp_handlings = [ ]
7070 @word_pair_map = { }
7171 @attributes = RDoc ::Markup ::Attributes . new
7272
@@ -166,22 +166,22 @@ def convert_html(str, attrs)
166166 end
167167
168168 ##
169- # Converts special sequences to RDoc attributes
169+ # Converts regexp handling sequences to RDoc attributes
170170
171- def convert_specials str , attrs
172- @special . each do |regexp , attribute |
171+ def convert_regexp_handlings str , attrs
172+ @regexp_handlings . each do |regexp , attribute |
173173 str . scan ( regexp ) do
174174 capture = $~. size == 1 ? 0 : 1
175175
176176 s , e = $~. offset capture
177177
178- attrs . set_attrs s , e - s , attribute | @attributes . special
178+ attrs . set_attrs s , e - s , attribute | @attributes . regexp_handling
179179 end
180180 end
181181 end
182182
183183 ##
184- # Escapes special sequences of text to prevent conversion to RDoc
184+ # Escapes regexp handling sequences of text to prevent conversion to RDoc
185185
186186 def mask_protected_sequences
187187 # protect __send__, __FILE__, etc.
@@ -193,7 +193,7 @@ def mask_protected_sequences
193193 end
194194
195195 ##
196- # Unescapes special sequences of text
196+ # Unescapes regexp handling sequences of text
197197
198198 def unmask_protected_sequences
199199 @str . gsub! ( /(.)#{ PROTECT_ATTR } / , "\\ 1\000 " )
@@ -233,17 +233,17 @@ def add_html(tag, name)
233233 end
234234
235235 ##
236- # Adds a special handler for +pattern+ with +name+. A simple URL handler
236+ # Adds a regexp handling for +pattern+ with +name+. A simple URL handler
237237 # would be:
238238 #
239- # @am.add_special (/((https?:)\S+\w)/, :HYPERLINK)
239+ # @am.add_regexp_handling (/((https?:)\S+\w)/, :HYPERLINK)
240240
241- def add_special pattern , name
242- @special << [ pattern , @attributes . bitmap_for ( name ) ]
241+ def add_regexp_handling pattern , name
242+ @regexp_handlings << [ pattern , @attributes . bitmap_for ( name ) ]
243243 end
244244
245245 ##
246- # Processes +str+ converting attributes, HTML and specials
246+ # Processes +str+ converting attributes, HTML and regexp handlings
247247
248248 def flow str
249249 @str = str . dup
@@ -252,9 +252,9 @@ def flow str
252252
253253 @attrs = RDoc ::Markup ::AttrSpan . new @str . length
254254
255- convert_attrs @str , @attrs
256- convert_html @str , @attrs
257- convert_specials @str , @attrs
255+ convert_attrs @str , @attrs
256+ convert_html @str , @attrs
257+ convert_regexp_handlings @str , @attrs
258258
259259 unmask_protected_sequences
260260
@@ -312,12 +312,12 @@ def split_into_flow
312312 res << change_attribute ( current_attr , new_attr )
313313 current_attr = new_attr
314314
315- if ( current_attr & @attributes . special ) != 0 then
315+ if ( current_attr & @attributes . regexp_handling ) != 0 then
316316 i += 1 while
317- i < str_len and ( @attrs [ i ] & @attributes . special ) != 0
317+ i < str_len and ( @attrs [ i ] & @attributes . regexp_handling ) != 0
318318
319- res << RDoc ::Markup ::Special . new ( current_attr ,
320- copy_string ( start_pos , i ) )
319+ res << RDoc ::Markup ::RegexpHandling . new ( current_attr ,
320+ copy_string ( start_pos , i ) )
321321 start_pos = i
322322 next
323323 end
0 commit comments