948 |
if ({ |
if ({ |
949 |
0x0022 => 1, # " |
0x0022 => 1, # " |
950 |
0x0027 => 1, # ' |
0x0027 => 1, # ' |
951 |
|
0x003C => 1, # < |
952 |
0x003D => 1, # = |
0x003D => 1, # = |
953 |
}->{$self->{nc}}) { |
}->{$self->{nc}}) { |
954 |
!!!cp (55); |
!!!cp (55); |
1071 |
|
|
1072 |
redo A; |
redo A; |
1073 |
} else { |
} else { |
1074 |
if ($self->{nc} == 0x0022 or # " |
if ({ |
1075 |
$self->{nc} == 0x0027) { # ' |
0x0022 => 1, # " |
1076 |
|
0x0027 => 1, # ' |
1077 |
|
0x003C => 1, # < |
1078 |
|
}->{$self->{nc}}) { |
1079 |
!!!cp (69); |
!!!cp (69); |
1080 |
## XML5: Not a parse error. |
## XML5: Not a parse error. |
1081 |
!!!parse-error (type => 'bad attribute name'); |
!!!parse-error (type => 'bad attribute name'); |
1186 |
!!!cp (78.2); |
!!!cp (78.2); |
1187 |
} |
} |
1188 |
|
|
1189 |
if ($self->{nc} == 0x0022 or # " |
if ({ |
1190 |
$self->{nc} == 0x0027) { # ' |
0x0022 => 1, # " |
1191 |
|
0x0027 => 1, # ' |
1192 |
|
0x003C => 1, # < |
1193 |
|
}->{$self->{nc}}) { |
1194 |
!!!cp (78); |
!!!cp (78); |
1195 |
## XML5: Not a parse error. |
## XML5: Not a parse error. |
1196 |
!!!parse-error (type => 'bad attribute name'); |
!!!parse-error (type => 'bad attribute name'); |
2137 |
$self->{state} = BEFORE_DOCTYPE_NAME_STATE; |
$self->{state} = BEFORE_DOCTYPE_NAME_STATE; |
2138 |
!!!next-input-character; |
!!!next-input-character; |
2139 |
redo A; |
redo A; |
2140 |
|
} elsif ($self->{nc} == -1) { |
2141 |
|
!!!cp (155.1); |
2142 |
|
!!!parse-error (type => 'unclosed DOCTYPE'); |
2143 |
|
$self->{ct}->{quirks} = 1; |
2144 |
|
|
2145 |
|
$self->{state} = DATA_STATE; |
2146 |
|
## Reconsume. |
2147 |
|
!!!emit ($self->{ct}); # DOCTYPE (quirks) |
2148 |
|
|
2149 |
|
redo A; |
2150 |
} else { |
} else { |
2151 |
!!!cp (156); |
!!!cp (156); |
2152 |
## XML5: Unless EOF, swith to the bogus comment state. |
## XML5: Swith to the bogus comment state. |
2153 |
!!!parse-error (type => 'no space before DOCTYPE name'); |
!!!parse-error (type => 'no space before DOCTYPE name'); |
2154 |
$self->{state} = BEFORE_DOCTYPE_NAME_STATE; |
$self->{state} = BEFORE_DOCTYPE_NAME_STATE; |
2155 |
## reconsume |
## reconsume |
2174 |
!!!emit ($self->{ct}); # DOCTYPE (quirks) |
!!!emit ($self->{ct}); # DOCTYPE (quirks) |
2175 |
|
|
2176 |
redo A; |
redo A; |
2177 |
|
} elsif (0x0041 <= $self->{nc} and $self->{nc} <= 0x005A) { # A..Z |
2178 |
|
!!!cp (158.1); |
2179 |
|
$self->{ct}->{name} # DOCTYPE |
2180 |
|
= chr ($self->{nc} + ($self->{is_xml} ? 0 : 0x0020)); |
2181 |
|
delete $self->{ct}->{quirks}; |
2182 |
|
$self->{state} = DOCTYPE_NAME_STATE; |
2183 |
|
!!!next-input-character; |
2184 |
|
redo A; |
2185 |
} elsif ($self->{nc} == -1) { |
} elsif ($self->{nc} == -1) { |
2186 |
!!!cp (159); |
!!!cp (159); |
2187 |
!!!parse-error (type => 'no DOCTYPE name'); |
!!!parse-error (type => 'no DOCTYPE name'); |
2228 |
!!!emit ($self->{ct}); # DOCTYPE |
!!!emit ($self->{ct}); # DOCTYPE |
2229 |
|
|
2230 |
redo A; |
redo A; |
2231 |
|
} elsif (0x0041 <= $self->{nc} and $self->{nc} <= 0x005A) { # A..Z |
2232 |
|
!!!cp (162.1); |
2233 |
|
$self->{ct}->{name} # DOCTYPE |
2234 |
|
.= chr ($self->{nc} + ($self->{is_xml} ? 0 : 0x0020)); |
2235 |
|
delete $self->{ct}->{quirks}; |
2236 |
|
## Stay in the state. |
2237 |
|
!!!next-input-character; |
2238 |
|
redo A; |
2239 |
} elsif ($self->{nc} == -1) { |
} elsif ($self->{nc} == -1) { |
2240 |
!!!cp (163); |
!!!cp (163); |
2241 |
!!!parse-error (type => 'unclosed DOCTYPE'); |
!!!parse-error (type => 'unclosed DOCTYPE'); |
2257 |
redo A; |
redo A; |
2258 |
} else { |
} else { |
2259 |
!!!cp (164); |
!!!cp (164); |
2260 |
$self->{ct}->{name} |
$self->{ct}->{name} .= chr ($self->{nc}); # DOCTYPE |
2261 |
.= chr ($self->{nc}); # DOCTYPE |
## Stay in the state. |
|
## Stay in the state |
|
2262 |
!!!next-input-character; |
!!!next-input-character; |
2263 |
redo A; |
redo A; |
2264 |
} |
} |