| 177 |
sub DOCTYPE_ATTLIST_ATTRIBUTE_DECLARATION_STATE () { 82 } |
sub DOCTYPE_ATTLIST_ATTRIBUTE_DECLARATION_STATE () { 82 } |
| 178 |
sub DOCTYPE_ATTLIST_ATTRIBUTE_DECLARATION_AFTER_STATE () { 83 } |
sub DOCTYPE_ATTLIST_ATTRIBUTE_DECLARATION_AFTER_STATE () { 83 } |
| 179 |
sub AFTER_ATTLIST_ATTR_VALUE_QUOTED_STATE () { 84 } |
sub AFTER_ATTLIST_ATTR_VALUE_QUOTED_STATE () { 84 } |
| 180 |
sub BOGUS_MD_STATE () { 85 } |
sub BEFORE_NDATA_STATE () { 85 } |
| 181 |
|
sub NDATA_STATE () { 86 } |
| 182 |
|
sub AFTER_NDATA_STATE () { 87 } |
| 183 |
|
sub BEFORE_NOTATION_NAME_STATE () { 88 } |
| 184 |
|
sub NOTATION_NAME_STATE () { 89 } |
| 185 |
|
sub AFTER_NOTATION_NAME_STATE () { 90 } |
| 186 |
|
sub DOCTYPE_ENTITY_VALUE_DOUBLE_QUOTED_STATE () { 91 } |
| 187 |
|
sub DOCTYPE_ENTITY_VALUE_SINGLE_QUOTED_STATE () { 92 } |
| 188 |
|
sub ENTITY_VALUE_ENTITY_STATE () { 93 } |
| 189 |
|
sub BOGUS_MD_STATE () { 94 } |
| 190 |
|
|
| 191 |
## Tree constructor state constants (see Whatpm::HTML for the full |
## Tree constructor state constants (see Whatpm::HTML for the full |
| 192 |
## list and descriptions) |
## list and descriptions) |
| 3265 |
} |
} |
| 3266 |
|
|
| 3267 |
redo A; |
redo A; |
| 3268 |
## TODO: " and ' for ENTITY |
} elsif ($self->{nc} == 0x0022 and # " |
| 3269 |
|
($self->{ct}->{type} == GENERAL_ENTITY_TOKEN or |
| 3270 |
|
$self->{ct}->{type} == PARAMETER_ENTITY_TOKEN)) { |
| 3271 |
|
|
| 3272 |
|
$self->{state} = DOCTYPE_ENTITY_VALUE_DOUBLE_QUOTED_STATE; |
| 3273 |
|
$self->{ct}->{value} = ''; # ENTITY |
| 3274 |
|
|
| 3275 |
|
if ($self->{char_buffer_pos} < length $self->{char_buffer}) { |
| 3276 |
|
$self->{line_prev} = $self->{line}; |
| 3277 |
|
$self->{column_prev} = $self->{column}; |
| 3278 |
|
$self->{column}++; |
| 3279 |
|
$self->{nc} |
| 3280 |
|
= ord substr ($self->{char_buffer}, $self->{char_buffer_pos}++, 1); |
| 3281 |
|
} else { |
| 3282 |
|
$self->{set_nc}->($self); |
| 3283 |
|
} |
| 3284 |
|
|
| 3285 |
|
redo A; |
| 3286 |
|
} elsif ($self->{nc} == 0x0027 and # ' |
| 3287 |
|
($self->{ct}->{type} == GENERAL_ENTITY_TOKEN or |
| 3288 |
|
$self->{ct}->{type} == PARAMETER_ENTITY_TOKEN)) { |
| 3289 |
|
|
| 3290 |
|
$self->{state} = DOCTYPE_ENTITY_VALUE_SINGLE_QUOTED_STATE; |
| 3291 |
|
$self->{ct}->{value} = ''; # ENTITY |
| 3292 |
|
|
| 3293 |
|
if ($self->{char_buffer_pos} < length $self->{char_buffer}) { |
| 3294 |
|
$self->{line_prev} = $self->{line}; |
| 3295 |
|
$self->{column_prev} = $self->{column}; |
| 3296 |
|
$self->{column}++; |
| 3297 |
|
$self->{nc} |
| 3298 |
|
= ord substr ($self->{char_buffer}, $self->{char_buffer_pos}++, 1); |
| 3299 |
|
} else { |
| 3300 |
|
$self->{set_nc}->($self); |
| 3301 |
|
} |
| 3302 |
|
|
| 3303 |
|
redo A; |
| 3304 |
} elsif ($self->{is_xml} and |
} elsif ($self->{is_xml} and |
| 3305 |
$self->{ct}->{type} == DOCTYPE_TOKEN and |
$self->{ct}->{type} == DOCTYPE_TOKEN and |
| 3306 |
$self->{nc} == 0x005B) { # [ |
$self->{nc} == 0x005B) { # [ |
| 4216 |
} |
} |
| 4217 |
} elsif ($self->{state} == AFTER_DOCTYPE_SYSTEM_IDENTIFIER_STATE) { |
} elsif ($self->{state} == AFTER_DOCTYPE_SYSTEM_IDENTIFIER_STATE) { |
| 4218 |
if ($is_space->{$self->{nc}}) { |
if ($is_space->{$self->{nc}}) { |
| 4219 |
|
if ($self->{ct}->{type} == GENERAL_ENTITY_TOKEN) { |
| 4220 |
## Stay in the state |
|
| 4221 |
|
$self->{state} = BEFORE_NDATA_STATE; |
| 4222 |
|
} else { |
| 4223 |
|
|
| 4224 |
|
## Stay in the state |
| 4225 |
|
} |
| 4226 |
|
|
| 4227 |
if ($self->{char_buffer_pos} < length $self->{char_buffer}) { |
if ($self->{char_buffer_pos} < length $self->{char_buffer}) { |
| 4228 |
$self->{line_prev} = $self->{line}; |
$self->{line_prev} = $self->{line}; |
| 4258 |
|
|
| 4259 |
return ($self->{ct}); # DOCTYPE/ENTITY/NOTATION |
return ($self->{ct}); # DOCTYPE/ENTITY/NOTATION |
| 4260 |
redo A; |
redo A; |
| 4261 |
## TODO: "NDATA" |
} elsif ($self->{ct}->{type} == GENERAL_ENTITY_TOKEN and |
| 4262 |
|
($self->{nc} == 0x004E or # N |
| 4263 |
|
$self->{nc} == 0x006E)) { # n |
| 4264 |
|
|
| 4265 |
|
$self->{parse_error}->(level => $self->{level}->{must}, type => 'no space before NDATA'); ## TODO: type |
| 4266 |
|
$self->{state} = NDATA_STATE; |
| 4267 |
|
$self->{kwd} = chr $self->{nc}; |
| 4268 |
|
|
| 4269 |
|
if ($self->{char_buffer_pos} < length $self->{char_buffer}) { |
| 4270 |
|
$self->{line_prev} = $self->{line}; |
| 4271 |
|
$self->{column_prev} = $self->{column}; |
| 4272 |
|
$self->{column}++; |
| 4273 |
|
$self->{nc} |
| 4274 |
|
= ord substr ($self->{char_buffer}, $self->{char_buffer_pos}++, 1); |
| 4275 |
|
} else { |
| 4276 |
|
$self->{set_nc}->($self); |
| 4277 |
|
} |
| 4278 |
|
|
| 4279 |
|
redo A; |
| 4280 |
} elsif ($self->{nc} == -1) { |
} elsif ($self->{nc} == -1) { |
| 4281 |
if ($self->{ct}->{type} == DOCTYPE_TOKEN) { |
if ($self->{ct}->{type} == DOCTYPE_TOKEN) { |
| 4282 |
|
|
| 4338 |
|
|
| 4339 |
redo A; |
redo A; |
| 4340 |
} |
} |
| 4341 |
|
} elsif ($self->{state} == BEFORE_NDATA_STATE) { |
| 4342 |
|
if ($is_space->{$self->{nc}}) { |
| 4343 |
|
|
| 4344 |
|
## Stay in the state. |
| 4345 |
|
|
| 4346 |
|
if ($self->{char_buffer_pos} < length $self->{char_buffer}) { |
| 4347 |
|
$self->{line_prev} = $self->{line}; |
| 4348 |
|
$self->{column_prev} = $self->{column}; |
| 4349 |
|
$self->{column}++; |
| 4350 |
|
$self->{nc} |
| 4351 |
|
= ord substr ($self->{char_buffer}, $self->{char_buffer_pos}++, 1); |
| 4352 |
|
} else { |
| 4353 |
|
$self->{set_nc}->($self); |
| 4354 |
|
} |
| 4355 |
|
|
| 4356 |
|
redo A; |
| 4357 |
|
} elsif ($self->{nc} == 0x003E) { # > |
| 4358 |
|
|
| 4359 |
|
$self->{state} = DOCTYPE_INTERNAL_SUBSET_STATE; |
| 4360 |
|
|
| 4361 |
|
if ($self->{char_buffer_pos} < length $self->{char_buffer}) { |
| 4362 |
|
$self->{line_prev} = $self->{line}; |
| 4363 |
|
$self->{column_prev} = $self->{column}; |
| 4364 |
|
$self->{column}++; |
| 4365 |
|
$self->{nc} |
| 4366 |
|
= ord substr ($self->{char_buffer}, $self->{char_buffer_pos}++, 1); |
| 4367 |
|
} else { |
| 4368 |
|
$self->{set_nc}->($self); |
| 4369 |
|
} |
| 4370 |
|
|
| 4371 |
|
return ($self->{ct}); # ENTITY |
| 4372 |
|
redo A; |
| 4373 |
|
} elsif ($self->{nc} == 0x004E or # N |
| 4374 |
|
$self->{nc} == 0x006E) { # n |
| 4375 |
|
|
| 4376 |
|
$self->{state} = NDATA_STATE; |
| 4377 |
|
$self->{kwd} = chr $self->{nc}; |
| 4378 |
|
|
| 4379 |
|
if ($self->{char_buffer_pos} < length $self->{char_buffer}) { |
| 4380 |
|
$self->{line_prev} = $self->{line}; |
| 4381 |
|
$self->{column_prev} = $self->{column}; |
| 4382 |
|
$self->{column}++; |
| 4383 |
|
$self->{nc} |
| 4384 |
|
= ord substr ($self->{char_buffer}, $self->{char_buffer_pos}++, 1); |
| 4385 |
|
} else { |
| 4386 |
|
$self->{set_nc}->($self); |
| 4387 |
|
} |
| 4388 |
|
|
| 4389 |
|
redo A; |
| 4390 |
|
} elsif ($self->{nc} == -1) { |
| 4391 |
|
|
| 4392 |
|
$self->{parse_error}->(level => $self->{level}->{must}, type => 'unclosed md'); ## TODO: type |
| 4393 |
|
$self->{state} = DOCTYPE_INTERNAL_SUBSET_STATE; |
| 4394 |
|
## reconsume |
| 4395 |
|
return ($self->{ct}); # ENTITY |
| 4396 |
|
redo A; |
| 4397 |
|
} else { |
| 4398 |
|
|
| 4399 |
|
$self->{parse_error}->(level => $self->{level}->{must}, type => 'string after SYSTEM literal'); |
| 4400 |
|
$self->{state} = BOGUS_MD_STATE; |
| 4401 |
|
|
| 4402 |
|
if ($self->{char_buffer_pos} < length $self->{char_buffer}) { |
| 4403 |
|
$self->{line_prev} = $self->{line}; |
| 4404 |
|
$self->{column_prev} = $self->{column}; |
| 4405 |
|
$self->{column}++; |
| 4406 |
|
$self->{nc} |
| 4407 |
|
= ord substr ($self->{char_buffer}, $self->{char_buffer_pos}++, 1); |
| 4408 |
|
} else { |
| 4409 |
|
$self->{set_nc}->($self); |
| 4410 |
|
} |
| 4411 |
|
|
| 4412 |
|
redo A; |
| 4413 |
|
} |
| 4414 |
} elsif ($self->{state} == BOGUS_DOCTYPE_STATE) { |
} elsif ($self->{state} == BOGUS_DOCTYPE_STATE) { |
| 4415 |
if ($self->{nc} == 0x003E) { # > |
if ($self->{nc} == 0x003E) { # > |
| 4416 |
|
|
| 5622 |
} |
} |
| 5623 |
|
|
| 5624 |
redo A; |
redo A; |
| 5625 |
} elsif ($self->{nc} == 0x0045) { # E |
} elsif ($self->{nc} == 0x0045 or # E |
| 5626 |
|
$self->{nc} == 0x0065) { # e |
| 5627 |
$self->{state} = MD_E_STATE; |
$self->{state} = MD_E_STATE; |
| 5628 |
$self->{kwd} = chr $self->{nc}; |
$self->{kwd} = chr $self->{nc}; |
| 5629 |
|
|
| 5638 |
} |
} |
| 5639 |
|
|
| 5640 |
redo A; |
redo A; |
| 5641 |
} elsif ($self->{nc} == 0x0041) { # A |
} elsif ($self->{nc} == 0x0041 or # A |
| 5642 |
|
$self->{nc} == 0x0061) { # a |
| 5643 |
$self->{state} = MD_ATTLIST_STATE; |
$self->{state} = MD_ATTLIST_STATE; |
| 5644 |
$self->{kwd} = chr $self->{nc}; |
$self->{kwd} = chr $self->{nc}; |
| 5645 |
|
|
| 5654 |
} |
} |
| 5655 |
|
|
| 5656 |
redo A; |
redo A; |
| 5657 |
} elsif ($self->{nc} == 0x004E) { # N |
} elsif ($self->{nc} == 0x004E or # N |
| 5658 |
|
$self->{nc} == 0x006E) { # n |
| 5659 |
$self->{state} = MD_NOTATION_STATE; |
$self->{state} = MD_NOTATION_STATE; |
| 5660 |
$self->{kwd} = chr $self->{nc}; |
$self->{kwd} = chr $self->{nc}; |
| 5661 |
|
|
| 5683 |
$self->{ct} = {type => COMMENT_TOKEN, data => ''}; ## Will be discarded. |
$self->{ct} = {type => COMMENT_TOKEN, data => ''}; ## Will be discarded. |
| 5684 |
redo A; |
redo A; |
| 5685 |
} elsif ($self->{state} == MD_E_STATE) { |
} elsif ($self->{state} == MD_E_STATE) { |
| 5686 |
if ($self->{nc} == 0x004E) { # N |
if ($self->{nc} == 0x004E or # N |
| 5687 |
|
$self->{nc} == 0x006E) { # n |
| 5688 |
$self->{state} = MD_ENTITY_STATE; |
$self->{state} = MD_ENTITY_STATE; |
| 5689 |
$self->{kwd} .= chr $self->{nc}; |
$self->{kwd} .= chr $self->{nc}; |
| 5690 |
|
|
| 5699 |
} |
} |
| 5700 |
|
|
| 5701 |
redo A; |
redo A; |
| 5702 |
} elsif ($self->{nc} == 0x004C) { # L |
} elsif ($self->{nc} == 0x004C or # L |
| 5703 |
|
$self->{nc} == 0x006C) { # l |
| 5704 |
## XML5: <!ELEMENT> not supported. |
## XML5: <!ELEMENT> not supported. |
| 5705 |
$self->{state} = MD_ELEMENT_STATE; |
$self->{state} = MD_ELEMENT_STATE; |
| 5706 |
$self->{kwd} .= chr $self->{nc}; |
$self->{kwd} .= chr $self->{nc}; |
| 5728 |
redo A; |
redo A; |
| 5729 |
} |
} |
| 5730 |
} elsif ($self->{state} == MD_ENTITY_STATE) { |
} elsif ($self->{state} == MD_ENTITY_STATE) { |
| 5731 |
if ($self->{nc} == { |
if ($self->{nc} == [ |
| 5732 |
'EN' => 0x0054, # T |
undef, |
| 5733 |
'ENT' => 0x0049, # I |
undef, |
| 5734 |
'ENTI' => 0x0054, # T |
0x0054, # T |
| 5735 |
}->{$self->{kwd}}) { |
0x0049, # I |
| 5736 |
|
0x0054, # T |
| 5737 |
|
]->[length $self->{kwd}] or |
| 5738 |
|
$self->{nc} == [ |
| 5739 |
|
undef, |
| 5740 |
|
undef, |
| 5741 |
|
0x0074, # t |
| 5742 |
|
0x0069, # i |
| 5743 |
|
0x0074, # t |
| 5744 |
|
]->[length $self->{kwd}]) { |
| 5745 |
## Stay in the state. |
## Stay in the state. |
| 5746 |
$self->{kwd} .= chr $self->{nc}; |
$self->{kwd} .= chr $self->{nc}; |
| 5747 |
|
|
| 5756 |
} |
} |
| 5757 |
|
|
| 5758 |
redo A; |
redo A; |
| 5759 |
} elsif ($self->{kwd} eq 'ENTIT' and |
} elsif ((length $self->{kwd}) == 5 and |
| 5760 |
$self->{nc} == 0x0059) { # Y |
($self->{nc} == 0x0059 or # Y |
| 5761 |
$self->{ct} = {type => GENERAL_ENTITY_TOKEN, name => '', text => '', |
$self->{nc} == 0x0079)) { # y |
| 5762 |
|
if ($self->{kwd} ne 'ENTIT' or $self->{nc} == 0x0079) { |
| 5763 |
|
$self->{parse_error}->(level => $self->{level}->{must}, type => 'lowercase keyword', ## TODO: type |
| 5764 |
|
text => 'ENTITY', |
| 5765 |
|
line => $self->{line_prev}, |
| 5766 |
|
column => $self->{column_prev} - 4); |
| 5767 |
|
} |
| 5768 |
|
$self->{ct} = {type => GENERAL_ENTITY_TOKEN, name => '', |
| 5769 |
line => $self->{line_prev}, |
line => $self->{line_prev}, |
| 5770 |
column => $self->{column_prev} - 6}; |
column => $self->{column_prev} - 6}; |
| 5771 |
$self->{state} = DOCTYPE_MD_STATE; |
$self->{state} = DOCTYPE_MD_STATE; |
| 5793 |
redo A; |
redo A; |
| 5794 |
} |
} |
| 5795 |
} elsif ($self->{state} == MD_ELEMENT_STATE) { |
} elsif ($self->{state} == MD_ELEMENT_STATE) { |
| 5796 |
if ($self->{nc} == { |
if ($self->{nc} == [ |
| 5797 |
'EL' => 0x0045, # E |
undef, |
| 5798 |
'ELE' => 0x004D, # M |
undef, |
| 5799 |
'ELEM' => 0x0045, # E |
0x0045, # E |
| 5800 |
'ELEME' => 0x004E, # N |
0x004D, # M |
| 5801 |
}->{$self->{kwd}}) { |
0x0045, # E |
| 5802 |
|
0x004E, # N |
| 5803 |
|
]->[length $self->{kwd}] or |
| 5804 |
|
$self->{nc} == [ |
| 5805 |
|
undef, |
| 5806 |
|
undef, |
| 5807 |
|
0x0065, # e |
| 5808 |
|
0x006D, # m |
| 5809 |
|
0x0065, # e |
| 5810 |
|
0x006E, # n |
| 5811 |
|
]->[length $self->{kwd}]) { |
| 5812 |
## Stay in the state. |
## Stay in the state. |
| 5813 |
$self->{kwd} .= chr $self->{nc}; |
$self->{kwd} .= chr $self->{nc}; |
| 5814 |
|
|
| 5823 |
} |
} |
| 5824 |
|
|
| 5825 |
redo A; |
redo A; |
| 5826 |
} elsif ($self->{kwd} eq 'ELEMEN' and |
} elsif ((length $self->{kwd}) == 6 and |
| 5827 |
$self->{nc} == 0x0054) { # T |
($self->{nc} == 0x0054 or # T |
| 5828 |
|
$self->{nc} == 0x0074)) { # t |
| 5829 |
|
if ($self->{kwd} ne 'ELEMEN' or $self->{nc} == 0x0074) { |
| 5830 |
|
$self->{parse_error}->(level => $self->{level}->{must}, type => 'lowercase keyword', ## TODO: type |
| 5831 |
|
text => 'ELEMENT', |
| 5832 |
|
line => $self->{line_prev}, |
| 5833 |
|
column => $self->{column_prev} - 5); |
| 5834 |
|
} |
| 5835 |
$self->{ct} = {type => ELEMENT_TOKEN, name => '', |
$self->{ct} = {type => ELEMENT_TOKEN, name => '', |
| 5836 |
line => $self->{line_prev}, |
line => $self->{line_prev}, |
| 5837 |
column => $self->{column_prev} - 6}; |
column => $self->{column_prev} - 6}; |
| 5860 |
redo A; |
redo A; |
| 5861 |
} |
} |
| 5862 |
} elsif ($self->{state} == MD_ATTLIST_STATE) { |
} elsif ($self->{state} == MD_ATTLIST_STATE) { |
| 5863 |
if ($self->{nc} == { |
if ($self->{nc} == [ |
| 5864 |
'A' => 0x0054, # T |
undef, |
| 5865 |
'AT' => 0x0054, # T |
0x0054, # T |
| 5866 |
'ATT' => 0x004C, # L |
0x0054, # T |
| 5867 |
'ATTL' => 0x0049, # I |
0x004C, # L |
| 5868 |
'ATTLI' => 0x0053, # S |
0x0049, # I |
| 5869 |
}->{$self->{kwd}}) { |
0x0053, # S |
| 5870 |
|
]->[length $self->{kwd}] or |
| 5871 |
|
$self->{nc} == [ |
| 5872 |
|
undef, |
| 5873 |
|
0x0074, # t |
| 5874 |
|
0x0074, # t |
| 5875 |
|
0x006C, # l |
| 5876 |
|
0x0069, # i |
| 5877 |
|
0x0073, # s |
| 5878 |
|
]->[length $self->{kwd}]) { |
| 5879 |
## Stay in the state. |
## Stay in the state. |
| 5880 |
$self->{kwd} .= chr $self->{nc}; |
$self->{kwd} .= chr $self->{nc}; |
| 5881 |
|
|
| 5890 |
} |
} |
| 5891 |
|
|
| 5892 |
redo A; |
redo A; |
| 5893 |
} elsif ($self->{kwd} eq 'ATTLIS' and |
} elsif ((length $self->{kwd}) == 6 and |
| 5894 |
$self->{nc} == 0x0054) { # T |
($self->{nc} == 0x0054 or # T |
| 5895 |
|
$self->{nc} == 0x0074)) { # t |
| 5896 |
|
if ($self->{kwd} ne 'ATTLIS' or $self->{nc} == 0x0074) { |
| 5897 |
|
$self->{parse_error}->(level => $self->{level}->{must}, type => 'lowercase keyword', ## TODO: type |
| 5898 |
|
text => 'ATTLIST', |
| 5899 |
|
line => $self->{line_prev}, |
| 5900 |
|
column => $self->{column_prev} - 5); |
| 5901 |
|
} |
| 5902 |
$self->{ct} = {type => ATTLIST_TOKEN, name => '', |
$self->{ct} = {type => ATTLIST_TOKEN, name => '', |
| 5903 |
attrdefs => [], |
attrdefs => [], |
| 5904 |
line => $self->{line_prev}, |
line => $self->{line_prev}, |
| 5928 |
redo A; |
redo A; |
| 5929 |
} |
} |
| 5930 |
} elsif ($self->{state} == MD_NOTATION_STATE) { |
} elsif ($self->{state} == MD_NOTATION_STATE) { |
| 5931 |
if ($self->{nc} == { |
if ($self->{nc} == [ |
| 5932 |
'N' => 0x004F, # O |
undef, |
| 5933 |
'NO' => 0x0054, # T |
0x004F, # O |
| 5934 |
'NOT' => 0x0041, # A |
0x0054, # T |
| 5935 |
'NOTA' => 0x0054, # T |
0x0041, # A |
| 5936 |
'NOTAT' => 0x0049, # I |
0x0054, # T |
| 5937 |
'NOTATI' => 0x004F, # O |
0x0049, # I |
| 5938 |
}->{$self->{kwd}}) { |
0x004F, # O |
| 5939 |
|
]->[length $self->{kwd}] or |
| 5940 |
|
$self->{nc} == [ |
| 5941 |
|
undef, |
| 5942 |
|
0x006F, # o |
| 5943 |
|
0x0074, # t |
| 5944 |
|
0x0061, # a |
| 5945 |
|
0x0074, # t |
| 5946 |
|
0x0069, # i |
| 5947 |
|
0x006F, # o |
| 5948 |
|
]->[length $self->{kwd}]) { |
| 5949 |
## Stay in the state. |
## Stay in the state. |
| 5950 |
$self->{kwd} .= chr $self->{nc}; |
$self->{kwd} .= chr $self->{nc}; |
| 5951 |
|
|
| 5960 |
} |
} |
| 5961 |
|
|
| 5962 |
redo A; |
redo A; |
| 5963 |
} elsif ($self->{kwd} eq 'NOTATIO' and |
} elsif ((length $self->{kwd}) == 7 and |
| 5964 |
$self->{nc} == 0x004E) { # N |
($self->{nc} == 0x004E or # N |
| 5965 |
|
$self->{nc} == 0x006E)) { # n |
| 5966 |
|
if ($self->{kwd} ne 'NOTATIO' or $self->{nc} == 0x006E) { |
| 5967 |
|
$self->{parse_error}->(level => $self->{level}->{must}, type => 'lowercase keyword', ## TODO: type |
| 5968 |
|
text => 'NOTATION', |
| 5969 |
|
line => $self->{line_prev}, |
| 5970 |
|
column => $self->{column_prev} - 6); |
| 5971 |
|
} |
| 5972 |
$self->{ct} = {type => NOTATION_TOKEN, name => '', |
$self->{ct} = {type => NOTATION_TOKEN, name => '', |
| 5973 |
line => $self->{line_prev}, |
line => $self->{line_prev}, |
| 5974 |
column => $self->{column_prev} - 6}; |
column => $self->{column_prev} - 6}; |
| 7482 |
## Reconsume. |
## Reconsume. |
| 7483 |
redo A; |
redo A; |
| 7484 |
} |
} |
| 7485 |
|
} elsif ($self->{state} == NDATA_STATE) { |
| 7486 |
|
## ASCII case-insensitive |
| 7487 |
|
if ($self->{nc} == [ |
| 7488 |
|
undef, |
| 7489 |
|
0x0044, # D |
| 7490 |
|
0x0041, # A |
| 7491 |
|
0x0054, # T |
| 7492 |
|
]->[length $self->{kwd}] or |
| 7493 |
|
$self->{nc} == [ |
| 7494 |
|
undef, |
| 7495 |
|
0x0064, # d |
| 7496 |
|
0x0061, # a |
| 7497 |
|
0x0074, # t |
| 7498 |
|
]->[length $self->{kwd}]) { |
| 7499 |
|
|
| 7500 |
|
## Stay in the state. |
| 7501 |
|
$self->{kwd} .= chr $self->{nc}; |
| 7502 |
|
|
| 7503 |
|
if ($self->{char_buffer_pos} < length $self->{char_buffer}) { |
| 7504 |
|
$self->{line_prev} = $self->{line}; |
| 7505 |
|
$self->{column_prev} = $self->{column}; |
| 7506 |
|
$self->{column}++; |
| 7507 |
|
$self->{nc} |
| 7508 |
|
= ord substr ($self->{char_buffer}, $self->{char_buffer_pos}++, 1); |
| 7509 |
|
} else { |
| 7510 |
|
$self->{set_nc}->($self); |
| 7511 |
|
} |
| 7512 |
|
|
| 7513 |
|
redo A; |
| 7514 |
|
} elsif ((length $self->{kwd}) == 4 and |
| 7515 |
|
($self->{nc} == 0x0041 or # A |
| 7516 |
|
$self->{nc} == 0x0061)) { # a |
| 7517 |
|
if ($self->{kwd} ne 'NDAT' or $self->{nc} == 0x0061) { # a |
| 7518 |
|
|
| 7519 |
|
$self->{parse_error}->(level => $self->{level}->{must}, type => 'lowercase keyword', ## TODO: type |
| 7520 |
|
text => 'NDATA', |
| 7521 |
|
line => $self->{line_prev}, |
| 7522 |
|
column => $self->{column_prev} - 4); |
| 7523 |
|
} else { |
| 7524 |
|
|
| 7525 |
|
} |
| 7526 |
|
$self->{state} = AFTER_NDATA_STATE; |
| 7527 |
|
|
| 7528 |
|
if ($self->{char_buffer_pos} < length $self->{char_buffer}) { |
| 7529 |
|
$self->{line_prev} = $self->{line}; |
| 7530 |
|
$self->{column_prev} = $self->{column}; |
| 7531 |
|
$self->{column}++; |
| 7532 |
|
$self->{nc} |
| 7533 |
|
= ord substr ($self->{char_buffer}, $self->{char_buffer_pos}++, 1); |
| 7534 |
|
} else { |
| 7535 |
|
$self->{set_nc}->($self); |
| 7536 |
|
} |
| 7537 |
|
|
| 7538 |
|
redo A; |
| 7539 |
|
} else { |
| 7540 |
|
$self->{parse_error}->(level => $self->{level}->{must}, type => 'string after literal', ## TODO: type |
| 7541 |
|
line => $self->{line_prev}, |
| 7542 |
|
column => $self->{column_prev} + 1 |
| 7543 |
|
- length $self->{kwd}); |
| 7544 |
|
|
| 7545 |
|
$self->{state} = BOGUS_MD_STATE; |
| 7546 |
|
## Reconsume. |
| 7547 |
|
redo A; |
| 7548 |
|
} |
| 7549 |
|
} elsif ($self->{state} == AFTER_NDATA_STATE) { |
| 7550 |
|
if ($is_space->{$self->{nc}}) { |
| 7551 |
|
$self->{state} = BEFORE_NOTATION_NAME_STATE; |
| 7552 |
|
|
| 7553 |
|
if ($self->{char_buffer_pos} < length $self->{char_buffer}) { |
| 7554 |
|
$self->{line_prev} = $self->{line}; |
| 7555 |
|
$self->{column_prev} = $self->{column}; |
| 7556 |
|
$self->{column}++; |
| 7557 |
|
$self->{nc} |
| 7558 |
|
= ord substr ($self->{char_buffer}, $self->{char_buffer_pos}++, 1); |
| 7559 |
|
} else { |
| 7560 |
|
$self->{set_nc}->($self); |
| 7561 |
|
} |
| 7562 |
|
|
| 7563 |
|
redo A; |
| 7564 |
|
} elsif ($self->{nc} == 0x003E) { # > |
| 7565 |
|
$self->{parse_error}->(level => $self->{level}->{must}, type => 'no notation name'); ## TODO: type |
| 7566 |
|
$self->{state} = DOCTYPE_INTERNAL_SUBSET_STATE; |
| 7567 |
|
|
| 7568 |
|
if ($self->{char_buffer_pos} < length $self->{char_buffer}) { |
| 7569 |
|
$self->{line_prev} = $self->{line}; |
| 7570 |
|
$self->{column_prev} = $self->{column}; |
| 7571 |
|
$self->{column}++; |
| 7572 |
|
$self->{nc} |
| 7573 |
|
= ord substr ($self->{char_buffer}, $self->{char_buffer_pos}++, 1); |
| 7574 |
|
} else { |
| 7575 |
|
$self->{set_nc}->($self); |
| 7576 |
|
} |
| 7577 |
|
|
| 7578 |
|
return ($self->{ct}); # ENTITY |
| 7579 |
|
redo A; |
| 7580 |
|
} elsif ($self->{nc} == -1) { |
| 7581 |
|
$self->{parse_error}->(level => $self->{level}->{must}, type => 'unclosed md'); ## TODO: type |
| 7582 |
|
$self->{state} = DOCTYPE_INTERNAL_SUBSET_STATE; |
| 7583 |
|
|
| 7584 |
|
if ($self->{char_buffer_pos} < length $self->{char_buffer}) { |
| 7585 |
|
$self->{line_prev} = $self->{line}; |
| 7586 |
|
$self->{column_prev} = $self->{column}; |
| 7587 |
|
$self->{column}++; |
| 7588 |
|
$self->{nc} |
| 7589 |
|
= ord substr ($self->{char_buffer}, $self->{char_buffer_pos}++, 1); |
| 7590 |
|
} else { |
| 7591 |
|
$self->{set_nc}->($self); |
| 7592 |
|
} |
| 7593 |
|
|
| 7594 |
|
return ($self->{ct}); # ENTITY |
| 7595 |
|
redo A; |
| 7596 |
|
} else { |
| 7597 |
|
$self->{parse_error}->(level => $self->{level}->{must}, type => 'string after literal', ## TODO: type |
| 7598 |
|
line => $self->{line_prev}, |
| 7599 |
|
column => $self->{column_prev} + 1 |
| 7600 |
|
- length $self->{kwd}); |
| 7601 |
|
$self->{state} = BOGUS_MD_STATE; |
| 7602 |
|
## Reconsume. |
| 7603 |
|
redo A; |
| 7604 |
|
} |
| 7605 |
|
} elsif ($self->{state} == BEFORE_NOTATION_NAME_STATE) { |
| 7606 |
|
if ($is_space->{$self->{nc}}) { |
| 7607 |
|
## Stay in the state. |
| 7608 |
|
|
| 7609 |
|
if ($self->{char_buffer_pos} < length $self->{char_buffer}) { |
| 7610 |
|
$self->{line_prev} = $self->{line}; |
| 7611 |
|
$self->{column_prev} = $self->{column}; |
| 7612 |
|
$self->{column}++; |
| 7613 |
|
$self->{nc} |
| 7614 |
|
= ord substr ($self->{char_buffer}, $self->{char_buffer_pos}++, 1); |
| 7615 |
|
} else { |
| 7616 |
|
$self->{set_nc}->($self); |
| 7617 |
|
} |
| 7618 |
|
|
| 7619 |
|
redo A; |
| 7620 |
|
} elsif ($self->{nc} == 0x003E) { # > |
| 7621 |
|
$self->{parse_error}->(level => $self->{level}->{must}, type => 'no notation name'); ## TODO: type |
| 7622 |
|
$self->{state} = DOCTYPE_INTERNAL_SUBSET_STATE; |
| 7623 |
|
|
| 7624 |
|
if ($self->{char_buffer_pos} < length $self->{char_buffer}) { |
| 7625 |
|
$self->{line_prev} = $self->{line}; |
| 7626 |
|
$self->{column_prev} = $self->{column}; |
| 7627 |
|
$self->{column}++; |
| 7628 |
|
$self->{nc} |
| 7629 |
|
= ord substr ($self->{char_buffer}, $self->{char_buffer_pos}++, 1); |
| 7630 |
|
} else { |
| 7631 |
|
$self->{set_nc}->($self); |
| 7632 |
|
} |
| 7633 |
|
|
| 7634 |
|
return ($self->{ct}); # ENTITY |
| 7635 |
|
redo A; |
| 7636 |
|
} elsif ($self->{nc} == -1) { |
| 7637 |
|
$self->{parse_error}->(level => $self->{level}->{must}, type => 'unclosed md'); ## TODO: type |
| 7638 |
|
$self->{state} = DOCTYPE_INTERNAL_SUBSET_STATE; |
| 7639 |
|
|
| 7640 |
|
if ($self->{char_buffer_pos} < length $self->{char_buffer}) { |
| 7641 |
|
$self->{line_prev} = $self->{line}; |
| 7642 |
|
$self->{column_prev} = $self->{column}; |
| 7643 |
|
$self->{column}++; |
| 7644 |
|
$self->{nc} |
| 7645 |
|
= ord substr ($self->{char_buffer}, $self->{char_buffer_pos}++, 1); |
| 7646 |
|
} else { |
| 7647 |
|
$self->{set_nc}->($self); |
| 7648 |
|
} |
| 7649 |
|
|
| 7650 |
|
return ($self->{ct}); # ENTITY |
| 7651 |
|
redo A; |
| 7652 |
|
} else { |
| 7653 |
|
$self->{ct}->{notation} = chr $self->{nc}; # ENTITY |
| 7654 |
|
$self->{state} = NOTATION_NAME_STATE; |
| 7655 |
|
|
| 7656 |
|
if ($self->{char_buffer_pos} < length $self->{char_buffer}) { |
| 7657 |
|
$self->{line_prev} = $self->{line}; |
| 7658 |
|
$self->{column_prev} = $self->{column}; |
| 7659 |
|
$self->{column}++; |
| 7660 |
|
$self->{nc} |
| 7661 |
|
= ord substr ($self->{char_buffer}, $self->{char_buffer_pos}++, 1); |
| 7662 |
|
} else { |
| 7663 |
|
$self->{set_nc}->($self); |
| 7664 |
|
} |
| 7665 |
|
|
| 7666 |
|
redo A; |
| 7667 |
|
} |
| 7668 |
|
} elsif ($self->{state} == NOTATION_NAME_STATE) { |
| 7669 |
|
if ($is_space->{$self->{nc}}) { |
| 7670 |
|
$self->{state} = AFTER_NOTATION_NAME_STATE; |
| 7671 |
|
|
| 7672 |
|
if ($self->{char_buffer_pos} < length $self->{char_buffer}) { |
| 7673 |
|
$self->{line_prev} = $self->{line}; |
| 7674 |
|
$self->{column_prev} = $self->{column}; |
| 7675 |
|
$self->{column}++; |
| 7676 |
|
$self->{nc} |
| 7677 |
|
= ord substr ($self->{char_buffer}, $self->{char_buffer_pos}++, 1); |
| 7678 |
|
} else { |
| 7679 |
|
$self->{set_nc}->($self); |
| 7680 |
|
} |
| 7681 |
|
|
| 7682 |
|
redo A; |
| 7683 |
|
} elsif ($self->{nc} == 0x003E) { # > |
| 7684 |
|
$self->{state} = DOCTYPE_INTERNAL_SUBSET_STATE; |
| 7685 |
|
|
| 7686 |
|
if ($self->{char_buffer_pos} < length $self->{char_buffer}) { |
| 7687 |
|
$self->{line_prev} = $self->{line}; |
| 7688 |
|
$self->{column_prev} = $self->{column}; |
| 7689 |
|
$self->{column}++; |
| 7690 |
|
$self->{nc} |
| 7691 |
|
= ord substr ($self->{char_buffer}, $self->{char_buffer_pos}++, 1); |
| 7692 |
|
} else { |
| 7693 |
|
$self->{set_nc}->($self); |
| 7694 |
|
} |
| 7695 |
|
|
| 7696 |
|
return ($self->{ct}); # ENTITY |
| 7697 |
|
redo A; |
| 7698 |
|
} elsif ($self->{nc} == -1) { |
| 7699 |
|
$self->{parse_error}->(level => $self->{level}->{must}, type => 'unclosed md'); ## TODO: type |
| 7700 |
|
$self->{state} = DOCTYPE_INTERNAL_SUBSET_STATE; |
| 7701 |
|
|
| 7702 |
|
if ($self->{char_buffer_pos} < length $self->{char_buffer}) { |
| 7703 |
|
$self->{line_prev} = $self->{line}; |
| 7704 |
|
$self->{column_prev} = $self->{column}; |
| 7705 |
|
$self->{column}++; |
| 7706 |
|
$self->{nc} |
| 7707 |
|
= ord substr ($self->{char_buffer}, $self->{char_buffer_pos}++, 1); |
| 7708 |
|
} else { |
| 7709 |
|
$self->{set_nc}->($self); |
| 7710 |
|
} |
| 7711 |
|
|
| 7712 |
|
return ($self->{ct}); # ENTITY |
| 7713 |
|
redo A; |
| 7714 |
|
} else { |
| 7715 |
|
$self->{ct}->{notation} .= chr $self->{nc}; # ENTITY |
| 7716 |
|
## Stay in the state. |
| 7717 |
|
|
| 7718 |
|
if ($self->{char_buffer_pos} < length $self->{char_buffer}) { |
| 7719 |
|
$self->{line_prev} = $self->{line}; |
| 7720 |
|
$self->{column_prev} = $self->{column}; |
| 7721 |
|
$self->{column}++; |
| 7722 |
|
$self->{nc} |
| 7723 |
|
= ord substr ($self->{char_buffer}, $self->{char_buffer_pos}++, 1); |
| 7724 |
|
} else { |
| 7725 |
|
$self->{set_nc}->($self); |
| 7726 |
|
} |
| 7727 |
|
|
| 7728 |
|
redo A; |
| 7729 |
|
} |
| 7730 |
|
} elsif ($self->{state} == DOCTYPE_ENTITY_VALUE_DOUBLE_QUOTED_STATE) { |
| 7731 |
|
if ($self->{nc} == 0x0022) { # " |
| 7732 |
|
$self->{state} = AFTER_NOTATION_NAME_STATE; |
| 7733 |
|
|
| 7734 |
|
if ($self->{char_buffer_pos} < length $self->{char_buffer}) { |
| 7735 |
|
$self->{line_prev} = $self->{line}; |
| 7736 |
|
$self->{column_prev} = $self->{column}; |
| 7737 |
|
$self->{column}++; |
| 7738 |
|
$self->{nc} |
| 7739 |
|
= ord substr ($self->{char_buffer}, $self->{char_buffer_pos}++, 1); |
| 7740 |
|
} else { |
| 7741 |
|
$self->{set_nc}->($self); |
| 7742 |
|
} |
| 7743 |
|
|
| 7744 |
|
redo A; |
| 7745 |
|
} elsif ($self->{nc} == 0x0026) { # & |
| 7746 |
|
$self->{prev_state} = $self->{state}; |
| 7747 |
|
$self->{state} = ENTITY_VALUE_ENTITY_STATE; |
| 7748 |
|
$self->{entity_add} = 0x0022; # " |
| 7749 |
|
|
| 7750 |
|
if ($self->{char_buffer_pos} < length $self->{char_buffer}) { |
| 7751 |
|
$self->{line_prev} = $self->{line}; |
| 7752 |
|
$self->{column_prev} = $self->{column}; |
| 7753 |
|
$self->{column}++; |
| 7754 |
|
$self->{nc} |
| 7755 |
|
= ord substr ($self->{char_buffer}, $self->{char_buffer_pos}++, 1); |
| 7756 |
|
} else { |
| 7757 |
|
$self->{set_nc}->($self); |
| 7758 |
|
} |
| 7759 |
|
|
| 7760 |
|
redo A; |
| 7761 |
|
## TODO: % |
| 7762 |
|
} elsif ($self->{nc} == -1) { |
| 7763 |
|
$self->{parse_error}->(level => $self->{level}->{must}, type => 'unclosed entity value'); ## TODO: type |
| 7764 |
|
$self->{state} = DOCTYPE_INTERNAL_SUBSET_STATE; |
| 7765 |
|
## Reconsume. |
| 7766 |
|
return ($self->{ct}); # ENTITY |
| 7767 |
|
redo A; |
| 7768 |
|
} else { |
| 7769 |
|
$self->{ct}->{value} .= chr $self->{nc}; # ENTITY |
| 7770 |
|
|
| 7771 |
|
if ($self->{char_buffer_pos} < length $self->{char_buffer}) { |
| 7772 |
|
$self->{line_prev} = $self->{line}; |
| 7773 |
|
$self->{column_prev} = $self->{column}; |
| 7774 |
|
$self->{column}++; |
| 7775 |
|
$self->{nc} |
| 7776 |
|
= ord substr ($self->{char_buffer}, $self->{char_buffer_pos}++, 1); |
| 7777 |
|
} else { |
| 7778 |
|
$self->{set_nc}->($self); |
| 7779 |
|
} |
| 7780 |
|
|
| 7781 |
|
redo A; |
| 7782 |
|
} |
| 7783 |
|
} elsif ($self->{state} == DOCTYPE_ENTITY_VALUE_SINGLE_QUOTED_STATE) { |
| 7784 |
|
if ($self->{nc} == 0x0027) { # ' |
| 7785 |
|
$self->{state} = AFTER_NOTATION_NAME_STATE; |
| 7786 |
|
|
| 7787 |
|
if ($self->{char_buffer_pos} < length $self->{char_buffer}) { |
| 7788 |
|
$self->{line_prev} = $self->{line}; |
| 7789 |
|
$self->{column_prev} = $self->{column}; |
| 7790 |
|
$self->{column}++; |
| 7791 |
|
$self->{nc} |
| 7792 |
|
= ord substr ($self->{char_buffer}, $self->{char_buffer_pos}++, 1); |
| 7793 |
|
} else { |
| 7794 |
|
$self->{set_nc}->($self); |
| 7795 |
|
} |
| 7796 |
|
|
| 7797 |
|
redo A; |
| 7798 |
|
} elsif ($self->{nc} == 0x0026) { # & |
| 7799 |
|
$self->{prev_state} = $self->{state}; |
| 7800 |
|
$self->{state} = ENTITY_VALUE_ENTITY_STATE; |
| 7801 |
|
$self->{entity_add} = 0x0027; # ' |
| 7802 |
|
|
| 7803 |
|
if ($self->{char_buffer_pos} < length $self->{char_buffer}) { |
| 7804 |
|
$self->{line_prev} = $self->{line}; |
| 7805 |
|
$self->{column_prev} = $self->{column}; |
| 7806 |
|
$self->{column}++; |
| 7807 |
|
$self->{nc} |
| 7808 |
|
= ord substr ($self->{char_buffer}, $self->{char_buffer_pos}++, 1); |
| 7809 |
|
} else { |
| 7810 |
|
$self->{set_nc}->($self); |
| 7811 |
|
} |
| 7812 |
|
|
| 7813 |
|
redo A; |
| 7814 |
|
## TODO: % |
| 7815 |
|
} elsif ($self->{nc} == -1) { |
| 7816 |
|
$self->{parse_error}->(level => $self->{level}->{must}, type => 'unclosed entity value'); ## TODO: type |
| 7817 |
|
$self->{state} = DOCTYPE_INTERNAL_SUBSET_STATE; |
| 7818 |
|
## Reconsume. |
| 7819 |
|
return ($self->{ct}); # ENTITY |
| 7820 |
|
redo A; |
| 7821 |
|
} else { |
| 7822 |
|
$self->{ct}->{value} .= chr $self->{nc}; # ENTITY |
| 7823 |
|
|
| 7824 |
|
if ($self->{char_buffer_pos} < length $self->{char_buffer}) { |
| 7825 |
|
$self->{line_prev} = $self->{line}; |
| 7826 |
|
$self->{column_prev} = $self->{column}; |
| 7827 |
|
$self->{column}++; |
| 7828 |
|
$self->{nc} |
| 7829 |
|
= ord substr ($self->{char_buffer}, $self->{char_buffer_pos}++, 1); |
| 7830 |
|
} else { |
| 7831 |
|
$self->{set_nc}->($self); |
| 7832 |
|
} |
| 7833 |
|
|
| 7834 |
|
redo A; |
| 7835 |
|
} |
| 7836 |
|
} elsif ($self->{state} == ENTITY_VALUE_ENTITY_STATE) { |
| 7837 |
|
## TODO: XMLize |
| 7838 |
|
|
| 7839 |
|
if ($is_space->{$self->{nc}} or |
| 7840 |
|
{ |
| 7841 |
|
0x003C => 1, 0x0026 => 1, -1 => 1, # <, & |
| 7842 |
|
$self->{entity_add} => 1, |
| 7843 |
|
}->{$self->{nc}}) { |
| 7844 |
|
## Don't consume |
| 7845 |
|
## No error |
| 7846 |
|
## Return nothing. |
| 7847 |
|
# |
| 7848 |
|
} elsif ($self->{nc} == 0x0023) { # # |
| 7849 |
|
$self->{ca} = $self->{ct}; |
| 7850 |
|
$self->{state} = ENTITY_HASH_STATE; |
| 7851 |
|
$self->{kwd} = '#'; |
| 7852 |
|
|
| 7853 |
|
if ($self->{char_buffer_pos} < length $self->{char_buffer}) { |
| 7854 |
|
$self->{line_prev} = $self->{line}; |
| 7855 |
|
$self->{column_prev} = $self->{column}; |
| 7856 |
|
$self->{column}++; |
| 7857 |
|
$self->{nc} |
| 7858 |
|
= ord substr ($self->{char_buffer}, $self->{char_buffer_pos}++, 1); |
| 7859 |
|
} else { |
| 7860 |
|
$self->{set_nc}->($self); |
| 7861 |
|
} |
| 7862 |
|
|
| 7863 |
|
redo A; |
| 7864 |
|
} elsif ((0x0041 <= $self->{nc} and |
| 7865 |
|
$self->{nc} <= 0x005A) or # A..Z |
| 7866 |
|
(0x0061 <= $self->{nc} and |
| 7867 |
|
$self->{nc} <= 0x007A)) { # a..z |
| 7868 |
|
# |
| 7869 |
|
} else { |
| 7870 |
|
$self->{parse_error}->(level => $self->{level}->{must}, type => 'bare ero'); |
| 7871 |
|
## Return nothing. |
| 7872 |
|
# |
| 7873 |
|
} |
| 7874 |
|
|
| 7875 |
|
$self->{ct}->{value} .= '&'; |
| 7876 |
|
$self->{state} = $self->{prev_state}; |
| 7877 |
|
## Reconsume. |
| 7878 |
|
redo A; |
| 7879 |
|
} elsif ($self->{state} == AFTER_NOTATION_NAME_STATE) { |
| 7880 |
|
if ($is_space->{$self->{nc}}) { |
| 7881 |
|
## Stay in the state. |
| 7882 |
|
|
| 7883 |
|
if ($self->{char_buffer_pos} < length $self->{char_buffer}) { |
| 7884 |
|
$self->{line_prev} = $self->{line}; |
| 7885 |
|
$self->{column_prev} = $self->{column}; |
| 7886 |
|
$self->{column}++; |
| 7887 |
|
$self->{nc} |
| 7888 |
|
= ord substr ($self->{char_buffer}, $self->{char_buffer_pos}++, 1); |
| 7889 |
|
} else { |
| 7890 |
|
$self->{set_nc}->($self); |
| 7891 |
|
} |
| 7892 |
|
|
| 7893 |
|
redo A; |
| 7894 |
|
} elsif ($self->{nc} == 0x003E) { # > |
| 7895 |
|
$self->{state} = DOCTYPE_INTERNAL_SUBSET_STATE; |
| 7896 |
|
|
| 7897 |
|
if ($self->{char_buffer_pos} < length $self->{char_buffer}) { |
| 7898 |
|
$self->{line_prev} = $self->{line}; |
| 7899 |
|
$self->{column_prev} = $self->{column}; |
| 7900 |
|
$self->{column}++; |
| 7901 |
|
$self->{nc} |
| 7902 |
|
= ord substr ($self->{char_buffer}, $self->{char_buffer_pos}++, 1); |
| 7903 |
|
} else { |
| 7904 |
|
$self->{set_nc}->($self); |
| 7905 |
|
} |
| 7906 |
|
|
| 7907 |
|
return ($self->{ct}); # ENTITY |
| 7908 |
|
redo A; |
| 7909 |
|
} elsif ($self->{nc} == -1) { |
| 7910 |
|
$self->{parse_error}->(level => $self->{level}->{must}, type => 'unclosed md'); ## TODO: type |
| 7911 |
|
$self->{state} = DOCTYPE_INTERNAL_SUBSET_STATE; |
| 7912 |
|
|
| 7913 |
|
if ($self->{char_buffer_pos} < length $self->{char_buffer}) { |
| 7914 |
|
$self->{line_prev} = $self->{line}; |
| 7915 |
|
$self->{column_prev} = $self->{column}; |
| 7916 |
|
$self->{column}++; |
| 7917 |
|
$self->{nc} |
| 7918 |
|
= ord substr ($self->{char_buffer}, $self->{char_buffer_pos}++, 1); |
| 7919 |
|
} else { |
| 7920 |
|
$self->{set_nc}->($self); |
| 7921 |
|
} |
| 7922 |
|
|
| 7923 |
|
return ($self->{ct}); # ENTITY |
| 7924 |
|
redo A; |
| 7925 |
|
} else { |
| 7926 |
|
$self->{parse_error}->(level => $self->{level}->{must}, type => 'string after notation name'); ## TODO: type |
| 7927 |
|
$self->{state} = BOGUS_MD_STATE; |
| 7928 |
|
## Reconsume. |
| 7929 |
|
redo A; |
| 7930 |
|
} |
| 7931 |
} elsif ($self->{state} == BOGUS_MD_STATE) { |
} elsif ($self->{state} == BOGUS_MD_STATE) { |
| 7932 |
if ($self->{nc} == 0x003E) { # > |
if ($self->{nc} == 0x003E) { # > |
| 7933 |
$self->{state} = DOCTYPE_INTERNAL_SUBSET_STATE; |
$self->{state} = DOCTYPE_INTERNAL_SUBSET_STATE; |