| 1270 |
|
|
| 1271 |
redo A; |
redo A; |
| 1272 |
} else { |
} else { |
| 1273 |
if ($self->{nc} == 0x003D) { # = |
if ($self->{nc} == 0x003D or $self->{nc} == 0x003C) { # =, < |
| 1274 |
!!!cp (93); |
!!!cp (93); |
| 1275 |
## XML5: Not a parse error. |
## XML5: Not a parse error. |
| 1276 |
!!!parse-error (type => 'bad attribute value'); |
!!!parse-error (type => 'bad attribute value'); |
| 1316 |
$self->{state} = ENTITY_STATE; |
$self->{state} = ENTITY_STATE; |
| 1317 |
!!!next-input-character; |
!!!next-input-character; |
| 1318 |
redo A; |
redo A; |
| 1319 |
|
} elsif ($self->{is_xml} and |
| 1320 |
|
$is_space->{$self->{nc}}) { |
| 1321 |
|
!!!cp (97.1); |
| 1322 |
|
$self->{ca}->{value} .= ' '; |
| 1323 |
|
## Stay in the state. |
| 1324 |
|
!!!next-input-character; |
| 1325 |
|
redo A; |
| 1326 |
} elsif ($self->{nc} == -1) { |
} elsif ($self->{nc} == -1) { |
| 1327 |
!!!parse-error (type => 'unclosed attribute value'); |
!!!parse-error (type => 'unclosed attribute value'); |
| 1328 |
if ($self->{ct}->{type} == START_TAG_TOKEN) { |
if ($self->{ct}->{type} == START_TAG_TOKEN) { |
| 1370 |
} |
} |
| 1371 |
$self->{ca}->{value} .= chr ($self->{nc}); |
$self->{ca}->{value} .= chr ($self->{nc}); |
| 1372 |
$self->{read_until}->($self->{ca}->{value}, |
$self->{read_until}->($self->{ca}->{value}, |
| 1373 |
q["&<], |
qq["&<\x09\x0C\x20], |
| 1374 |
length $self->{ca}->{value}); |
length $self->{ca}->{value}); |
| 1375 |
|
|
| 1376 |
## Stay in the state |
## Stay in the state |
| 1407 |
$self->{state} = ENTITY_STATE; |
$self->{state} = ENTITY_STATE; |
| 1408 |
!!!next-input-character; |
!!!next-input-character; |
| 1409 |
redo A; |
redo A; |
| 1410 |
|
} elsif ($self->{is_xml} and |
| 1411 |
|
$is_space->{$self->{nc}}) { |
| 1412 |
|
!!!cp (103.1); |
| 1413 |
|
$self->{ca}->{value} .= ' '; |
| 1414 |
|
## Stay in the state. |
| 1415 |
|
!!!next-input-character; |
| 1416 |
|
redo A; |
| 1417 |
} elsif ($self->{nc} == -1) { |
} elsif ($self->{nc} == -1) { |
| 1418 |
!!!parse-error (type => 'unclosed attribute value'); |
!!!parse-error (type => 'unclosed attribute value'); |
| 1419 |
if ($self->{ct}->{type} == START_TAG_TOKEN) { |
if ($self->{ct}->{type} == START_TAG_TOKEN) { |
| 1461 |
} |
} |
| 1462 |
$self->{ca}->{value} .= chr ($self->{nc}); |
$self->{ca}->{value} .= chr ($self->{nc}); |
| 1463 |
$self->{read_until}->($self->{ca}->{value}, |
$self->{read_until}->($self->{ca}->{value}, |
| 1464 |
q['&<], |
qq['&<\x09\x0C\x20], |
| 1465 |
length $self->{ca}->{value}); |
length $self->{ca}->{value}); |
| 1466 |
|
|
| 1467 |
## Stay in the state |
## Stay in the state |
| 1573 |
0x0022 => 1, # " |
0x0022 => 1, # " |
| 1574 |
0x0027 => 1, # ' |
0x0027 => 1, # ' |
| 1575 |
0x003D => 1, # = |
0x003D => 1, # = |
| 1576 |
|
0x003C => 1, # < |
| 1577 |
}->{$self->{nc}}) { |
}->{$self->{nc}}) { |
| 1578 |
!!!cp (115); |
!!!cp (115); |
| 1579 |
## XML5: Not a parse error. |
## XML5: Not a parse error. |
| 1583 |
} |
} |
| 1584 |
$self->{ca}->{value} .= chr ($self->{nc}); |
$self->{ca}->{value} .= chr ($self->{nc}); |
| 1585 |
$self->{read_until}->($self->{ca}->{value}, |
$self->{read_until}->($self->{ca}->{value}, |
| 1586 |
q["'=& >], |
qq["'=& \x09\x0C>], |
| 1587 |
length $self->{ca}->{value}); |
length $self->{ca}->{value}); |
| 1588 |
|
|
| 1589 |
## Stay in the state |
## Stay in the state |
| 2119 |
redo A; |
redo A; |
| 2120 |
} else { |
} else { |
| 2121 |
!!!cp (154); |
!!!cp (154); |
|
## XML5: Not a parse error. |
|
|
!!!parse-error (type => 'dash in comment', |
|
|
line => $self->{line_prev}, |
|
|
column => $self->{column_prev}); |
|
| 2122 |
$self->{ct}->{data} .= '--' . chr ($self->{nc}); # comment |
$self->{ct}->{data} .= '--' . chr ($self->{nc}); # comment |
| 2123 |
$self->{state} = COMMENT_STATE; |
$self->{state} = COMMENT_STATE; |
| 2124 |
!!!next-input-character; |
!!!next-input-character; |
| 3089 |
0x003C => 1, 0x0026 => 1, -1 => 1, # <, & |
0x003C => 1, 0x0026 => 1, -1 => 1, # <, & |
| 3090 |
$self->{entity_add} => 1, |
$self->{entity_add} => 1, |
| 3091 |
}->{$self->{nc}}) { |
}->{$self->{nc}}) { |
| 3092 |
!!!cp (1001); |
if ($self->{is_xml}) { |
| 3093 |
|
!!!cp (1001.1); |
| 3094 |
|
!!!parse-error (type => 'bare ero', |
| 3095 |
|
line => $self->{line_prev}, |
| 3096 |
|
column => $self->{column_prev} |
| 3097 |
|
+ ($self->{nc} == -1 ? 1 : 0)); |
| 3098 |
|
} else { |
| 3099 |
|
!!!cp (1001); |
| 3100 |
|
## No error |
| 3101 |
|
} |
| 3102 |
## Don't consume |
## Don't consume |
|
## No error |
|
| 3103 |
## Return nothing. |
## Return nothing. |
| 3104 |
# |
# |
| 3105 |
} elsif ($self->{nc} == 0x0023) { # # |
} elsif ($self->{nc} == 0x0023) { # # |
| 3108 |
$self->{kwd} = '#'; |
$self->{kwd} = '#'; |
| 3109 |
!!!next-input-character; |
!!!next-input-character; |
| 3110 |
redo A; |
redo A; |
| 3111 |
} elsif ((0x0041 <= $self->{nc} and |
} elsif ($self->{is_xml} or |
| 3112 |
|
(0x0041 <= $self->{nc} and |
| 3113 |
$self->{nc} <= 0x005A) or # A..Z |
$self->{nc} <= 0x005A) or # A..Z |
| 3114 |
(0x0061 <= $self->{nc} and |
(0x0061 <= $self->{nc} and |
| 3115 |
$self->{nc} <= 0x007A)) { # a..z |
$self->{nc} <= 0x007A)) { # a..z |
| 3228 |
my $code = $self->{kwd}; |
my $code = $self->{kwd}; |
| 3229 |
my $l = $self->{line_prev}; |
my $l = $self->{line_prev}; |
| 3230 |
my $c = $self->{column_prev}; |
my $c = $self->{column_prev}; |
| 3231 |
if ($charref_map->{$code}) { |
if ((not $self->{is_xml} and $charref_map->{$code}) or |
| 3232 |
|
($self->{is_xml} and 0xD800 <= $code and $code <= 0xDFFF) or |
| 3233 |
|
($self->{is_xml} and $code == 0x0000)) { |
| 3234 |
!!!cp (1015); |
!!!cp (1015); |
| 3235 |
!!!parse-error (type => 'invalid character reference', |
!!!parse-error (type => 'invalid character reference', |
| 3236 |
text => (sprintf 'U+%04X', $code), |
text => (sprintf 'U+%04X', $code), |
| 3343 |
my $code = $self->{kwd}; |
my $code = $self->{kwd}; |
| 3344 |
my $l = $self->{line_prev}; |
my $l = $self->{line_prev}; |
| 3345 |
my $c = $self->{column_prev}; |
my $c = $self->{column_prev}; |
| 3346 |
if ($charref_map->{$code}) { |
if ((not $self->{is_xml} and $charref_map->{$code}) or |
| 3347 |
|
($self->{is_xml} and 0xD800 <= $code and $code <= 0xDFFF) or |
| 3348 |
|
($self->{is_xml} and $code == 0x0000)) { |
| 3349 |
!!!cp (1008); |
!!!cp (1008); |
| 3350 |
!!!parse-error (type => 'invalid character reference', |
!!!parse-error (type => 'invalid character reference', |
| 3351 |
text => (sprintf 'U+%04X', $code), |
text => (sprintf 'U+%04X', $code), |
| 3385 |
$self->{nc} <= 0x007A) or # z |
$self->{nc} <= 0x007A) or # z |
| 3386 |
(0x0030 <= $self->{nc} and # 0 |
(0x0030 <= $self->{nc} and # 0 |
| 3387 |
$self->{nc} <= 0x0039) or # 9 |
$self->{nc} <= 0x0039) or # 9 |
| 3388 |
$self->{nc} == 0x003B) { # ; |
$self->{nc} == 0x003B or # ; |
| 3389 |
|
($self->{is_xml} and |
| 3390 |
|
not ($is_space->{$self->{nc}} or |
| 3391 |
|
{ |
| 3392 |
|
0x003C => 1, 0x0026 => 1, -1 => 1, # <, & |
| 3393 |
|
$self->{entity_add} => 1, |
| 3394 |
|
}->{$self->{nc}}))) { |
| 3395 |
our $EntityChar; |
our $EntityChar; |
| 3396 |
$self->{kwd} .= chr $self->{nc}; |
$self->{kwd} .= chr $self->{nc}; |
| 3397 |
if (defined $EntityChar->{$self->{kwd}} or |
if (defined $EntityChar->{$self->{kwd}} or |
| 3674 |
## XML5: Not defined yet. |
## XML5: Not defined yet. |
| 3675 |
|
|
| 3676 |
## TODO: |
## TODO: |
| 3677 |
|
|
| 3678 |
|
if (not $self->{stop_processing} and |
| 3679 |
|
not $self->{document}->xml_standalone) { |
| 3680 |
|
!!!parse-error (type => 'stop processing', ## TODO: type |
| 3681 |
|
level => $self->{level}->{info}); |
| 3682 |
|
$self->{stop_processing} = 1; |
| 3683 |
|
} |
| 3684 |
|
|
| 3685 |
!!!next-input-character; |
!!!next-input-character; |
| 3686 |
redo A; |
redo A; |
| 3687 |
} elsif ($self->{nc} == 0x005D) { # ] |
} elsif ($self->{nc} == 0x005D) { # ] |
| 3916 |
} |
} |
| 3917 |
$self->{ct} = {type => ELEMENT_TOKEN, name => '', |
$self->{ct} = {type => ELEMENT_TOKEN, name => '', |
| 3918 |
line => $self->{line_prev}, |
line => $self->{line_prev}, |
| 3919 |
column => $self->{column_prev} - 6}; |
column => $self->{column_prev} - 7}; |
| 3920 |
$self->{state} = DOCTYPE_MD_STATE; |
$self->{state} = DOCTYPE_MD_STATE; |
| 3921 |
!!!next-input-character; |
!!!next-input-character; |
| 3922 |
redo A; |
redo A; |
| 3964 |
$self->{ct} = {type => ATTLIST_TOKEN, name => '', |
$self->{ct} = {type => ATTLIST_TOKEN, name => '', |
| 3965 |
attrdefs => [], |
attrdefs => [], |
| 3966 |
line => $self->{line_prev}, |
line => $self->{line_prev}, |
| 3967 |
column => $self->{column_prev} - 6}; |
column => $self->{column_prev} - 7}; |
| 3968 |
$self->{state} = DOCTYPE_MD_STATE; |
$self->{state} = DOCTYPE_MD_STATE; |
| 3969 |
!!!next-input-character; |
!!!next-input-character; |
| 3970 |
redo A; |
redo A; |
| 4013 |
} |
} |
| 4014 |
$self->{ct} = {type => NOTATION_TOKEN, name => '', |
$self->{ct} = {type => NOTATION_TOKEN, name => '', |
| 4015 |
line => $self->{line_prev}, |
line => $self->{line_prev}, |
| 4016 |
column => $self->{column_prev} - 6}; |
column => $self->{column_prev} - 8}; |
| 4017 |
$self->{state} = DOCTYPE_MD_STATE; |
$self->{state} = DOCTYPE_MD_STATE; |
| 4018 |
!!!next-input-character; |
!!!next-input-character; |
| 4019 |
redo A; |
redo A; |
| 4815 |
redo A; |
redo A; |
| 4816 |
} |
} |
| 4817 |
} elsif ($self->{state} == ENTITY_VALUE_ENTITY_STATE) { |
} elsif ($self->{state} == ENTITY_VALUE_ENTITY_STATE) { |
|
## TODO: XMLize |
|
|
|
|
| 4818 |
if ($is_space->{$self->{nc}} or |
if ($is_space->{$self->{nc}} or |
| 4819 |
{ |
{ |
| 4820 |
0x003C => 1, 0x0026 => 1, -1 => 1, # <, & |
0x003C => 1, 0x0026 => 1, -1 => 1, # <, & |
| 4821 |
$self->{entity_add} => 1, |
$self->{entity_add} => 1, |
| 4822 |
}->{$self->{nc}}) { |
}->{$self->{nc}}) { |
| 4823 |
|
!!!parse-error (type => 'bare ero', |
| 4824 |
|
line => $self->{line_prev}, |
| 4825 |
|
column => $self->{column_prev} |
| 4826 |
|
+ ($self->{nc} == -1 ? 1 : 0)); |
| 4827 |
## Don't consume |
## Don't consume |
|
## No error |
|
| 4828 |
## Return nothing. |
## Return nothing. |
| 4829 |
# |
# |
| 4830 |
} elsif ($self->{nc} == 0x0023) { # # |
} elsif ($self->{nc} == 0x0023) { # # |
| 4833 |
$self->{kwd} = '#'; |
$self->{kwd} = '#'; |
| 4834 |
!!!next-input-character; |
!!!next-input-character; |
| 4835 |
redo A; |
redo A; |
|
} elsif ((0x0041 <= $self->{nc} and |
|
|
$self->{nc} <= 0x005A) or # A..Z |
|
|
(0x0061 <= $self->{nc} and |
|
|
$self->{nc} <= 0x007A)) { # a..z |
|
|
# |
|
| 4836 |
} else { |
} else { |
|
!!!parse-error (type => 'bare ero'); |
|
|
## Return nothing. |
|
| 4837 |
# |
# |
| 4838 |
} |
} |
| 4839 |
|
|