@@ -134,7 +134,6 @@ module Private
134
134
ENTITYDECL_PATTERN = /(?:#{ GEDECL_PATTERN } )|(?:#{ PEDECL_PATTERN } )/um
135
135
end
136
136
private_constant :Private
137
- include Private
138
137
139
138
def initialize ( source )
140
139
self . stream = source
@@ -302,7 +301,7 @@ def pull_event
302
301
raise REXML ::ParseException . new ( "Bad ELEMENT declaration!" , @source ) if md . nil?
303
302
return [ :elementdecl , "<!ELEMENT" + md [ 1 ] ]
304
303
elsif @source . match ( "ENTITY" , true )
305
- match = [ :entitydecl , *@source . match ( ENTITYDECL_PATTERN , true ) . captures . compact ]
304
+ match = [ :entitydecl , *@source . match ( Private :: ENTITYDECL_PATTERN , true ) . captures . compact ]
306
305
ref = false
307
306
if match [ 1 ] == '%'
308
307
ref = true
@@ -328,7 +327,7 @@ def pull_event
328
327
match << '%' if ref
329
328
return match
330
329
elsif @source . match ( "ATTLIST" , true )
331
- md = @source . match ( ATTLISTDECL_END , true )
330
+ md = @source . match ( Private :: ATTLISTDECL_END , true )
332
331
raise REXML ::ParseException . new ( "Bad ATTLIST declaration!" , @source ) if md . nil?
333
332
element = md [ 1 ]
334
333
contents = md [ 0 ]
@@ -397,7 +396,7 @@ def pull_event
397
396
if @source . match ( "/" , true )
398
397
@nsstack . shift
399
398
last_tag = @tags . pop
400
- md = @source . match ( CLOSE_PATTERN , true )
399
+ md = @source . match ( Private :: CLOSE_PATTERN , true )
401
400
if md and !last_tag
402
401
message = "Unexpected top-level end tag (got '#{ md [ 1 ] } ')"
403
402
raise REXML ::ParseException . new ( message , @source )
@@ -431,7 +430,7 @@ def pull_event
431
430
return process_instruction ( start_position )
432
431
else
433
432
# Get the next tag
434
- md = @source . match ( TAG_PATTERN , true )
433
+ md = @source . match ( Private :: TAG_PATTERN , true )
435
434
unless md
436
435
@source . position = start_position
437
436
raise REXML ::ParseException . new ( "malformed XML: missing tag start" , @source )
@@ -539,7 +538,7 @@ def need_source_encoding_update?(xml_declaration_encoding)
539
538
end
540
539
541
540
def parse_name ( base_error_message )
542
- md = @source . match ( NAME_PATTERN , true )
541
+ md = @source . match ( Private :: NAME_PATTERN , true )
543
542
unless md
544
543
if @source . match ( /\s *\S /um )
545
544
message = "#{ base_error_message } : invalid name"
@@ -618,7 +617,7 @@ def parse_id_invalid_details(accept_external_id:,
618
617
end
619
618
620
619
def process_instruction ( start_position )
621
- match_data = @source . match ( INSTRUCTION_END , true )
620
+ match_data = @source . match ( Private :: INSTRUCTION_END , true )
622
621
unless match_data
623
622
message = "Invalid processing instruction node"
624
623
@source . position = start_position
0 commit comments