105 |
sub COMMENT_START_DASH_STATE () { 15 } |
sub COMMENT_START_DASH_STATE () { 15 } |
106 |
sub COMMENT_STATE () { 16 } |
sub COMMENT_STATE () { 16 } |
107 |
sub COMMENT_END_STATE () { 17 } |
sub COMMENT_END_STATE () { 17 } |
108 |
sub COMMENT_END_BANG_STATE () { 102 } ## LAST |
sub COMMENT_END_BANG_STATE () { 102 } |
109 |
|
sub COMMENT_END_SPACE_STATE () { 103 } ## LAST |
110 |
sub COMMENT_END_DASH_STATE () { 18 } |
sub COMMENT_END_DASH_STATE () { 18 } |
111 |
sub BOGUS_COMMENT_STATE () { 19 } |
sub BOGUS_COMMENT_STATE () { 19 } |
112 |
sub DOCTYPE_STATE () { 20 } |
sub DOCTYPE_STATE () { 20 } |
2119 |
} |
} |
2120 |
!!!next-input-character; |
!!!next-input-character; |
2121 |
redo A; |
redo A; |
2122 |
} elsif ($self->{nc} == 0x0021 and # ! |
} elsif ($self->{state} != COMMENT_END_BANG_STATE and |
2123 |
$self->{state} != COMMENT_END_BANG_STATE) { |
$is_space->{$self->{nc}}) { |
2124 |
|
!!!cp (152.1); |
2125 |
|
!!!parse-error (type => 'comment end space'); # XXX error type |
2126 |
|
$self->{ct}->{data} .= '--' . chr ($self->{nc}); # comment |
2127 |
|
$self->{state} = COMMENT_END_SPACE_STATE; |
2128 |
|
!!!next-input-character; |
2129 |
|
redo A; |
2130 |
|
} elsif ($self->{state} != COMMENT_END_BANG_STATE and |
2131 |
|
$self->{nc} == 0x0021) { # ! |
2132 |
|
!!!cp (152.2); |
2133 |
!!!parse-error (type => 'comment end bang'); # XXX error type |
!!!parse-error (type => 'comment end bang'); # XXX error type |
2134 |
$self->{state} = COMMENT_END_BANG_STATE; |
$self->{state} = COMMENT_END_BANG_STATE; |
2135 |
!!!next-input-character; |
!!!next-input-character; |
2160 |
!!!next-input-character; |
!!!next-input-character; |
2161 |
redo A; |
redo A; |
2162 |
} |
} |
2163 |
|
} elsif ($self->{state} == COMMENT_END_SPACE_STATE) { |
2164 |
|
## XML5: Not exist. |
2165 |
|
|
2166 |
|
if ($self->{nc} == 0x003E) { # > |
2167 |
|
if ($self->{in_subset}) { |
2168 |
|
!!!cp (154.4); |
2169 |
|
$self->{state} = DOCTYPE_INTERNAL_SUBSET_STATE; |
2170 |
|
} else { |
2171 |
|
!!!cp (154.5); |
2172 |
|
$self->{state} = DATA_STATE; |
2173 |
|
$self->{s_kwd} = ''; |
2174 |
|
} |
2175 |
|
!!!next-input-character; |
2176 |
|
|
2177 |
|
!!!emit ($self->{ct}); # comment |
2178 |
|
|
2179 |
|
redo A; |
2180 |
|
} elsif ($is_space->{$self->{nc}}) { |
2181 |
|
!!!cp (154.6); |
2182 |
|
$self->{ct}->{data} .= chr ($self->{nc}); # comment |
2183 |
|
## Stay in the state. |
2184 |
|
!!!next-input-character; |
2185 |
|
redo A; |
2186 |
|
} elsif ($self->{nc} == -1) { |
2187 |
|
!!!parse-error (type => 'unclosed comment'); |
2188 |
|
if ($self->{in_subset}) { |
2189 |
|
!!!cp (154.7); |
2190 |
|
$self->{state} = DOCTYPE_INTERNAL_SUBSET_STATE; |
2191 |
|
} else { |
2192 |
|
!!!cp (154.8); |
2193 |
|
$self->{state} = DATA_STATE; |
2194 |
|
$self->{s_kwd} = ''; |
2195 |
|
} |
2196 |
|
## Reconsume. |
2197 |
|
|
2198 |
|
!!!emit ($self->{ct}); # comment |
2199 |
|
|
2200 |
|
redo A; |
2201 |
|
} else { |
2202 |
|
!!!cp (154.9); |
2203 |
|
$self->{ct}->{data} .= chr ($self->{nc}); # comment |
2204 |
|
$self->{state} = COMMENT_STATE; |
2205 |
|
!!!next-input-character; |
2206 |
|
redo A; |
2207 |
|
} |
2208 |
} elsif ($self->{state} == DOCTYPE_STATE) { |
} elsif ($self->{state} == DOCTYPE_STATE) { |
2209 |
if ($is_space->{$self->{nc}}) { |
if ($is_space->{$self->{nc}}) { |
2210 |
!!!cp (155); |
!!!cp (155); |