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 |
109 |
sub COMMENT_END_DASH_STATE () { 18 } |
sub COMMENT_END_DASH_STATE () { 18 } |
110 |
sub BOGUS_COMMENT_STATE () { 19 } |
sub BOGUS_COMMENT_STATE () { 19 } |
111 |
sub DOCTYPE_STATE () { 20 } |
sub DOCTYPE_STATE () { 20 } |
2083 |
!!!next-input-character; |
!!!next-input-character; |
2084 |
redo A; |
redo A; |
2085 |
} |
} |
2086 |
} elsif ($self->{state} == COMMENT_END_STATE) { |
} elsif ($self->{state} == COMMENT_END_STATE or |
2087 |
|
$self->{state} == COMMENT_END_BANG_STATE) { |
2088 |
## XML5: "Comment end state" and "DOCTYPE comment end state". |
## XML5: "Comment end state" and "DOCTYPE comment end state". |
2089 |
|
## (No comment end bang state.) |
2090 |
|
|
2091 |
if ($self->{nc} == 0x003E) { # > |
if ($self->{nc} == 0x003E) { # > |
2092 |
if ($self->{in_subset}) { |
if ($self->{in_subset}) { |
2103 |
|
|
2104 |
redo A; |
redo A; |
2105 |
} elsif ($self->{nc} == 0x002D) { # - |
} elsif ($self->{nc} == 0x002D) { # - |
2106 |
!!!cp (152); |
if ($self->{state} == COMMENT_END_BANG_STATE) { |
2107 |
## XML5: Not a parse error. |
!!!cp (154.3); |
2108 |
!!!parse-error (type => 'dash in comment', |
$self->{ct}->{data} .= '--!'; # comment |
2109 |
line => $self->{line_prev}, |
$self->{state} = COMMENT_END_DASH_STATE; |
2110 |
column => $self->{column_prev}); |
} else { |
2111 |
$self->{ct}->{data} .= '-'; # comment |
!!!cp (152); |
2112 |
## Stay in the state |
## XML5: Not a parse error. |
2113 |
|
!!!parse-error (type => 'dash in comment', |
2114 |
|
line => $self->{line_prev}, |
2115 |
|
column => $self->{column_prev}); |
2116 |
|
$self->{ct}->{data} .= '-'; # comment |
2117 |
|
## Stay in the state |
2118 |
|
} |
2119 |
|
!!!next-input-character; |
2120 |
|
redo A; |
2121 |
|
} elsif ($self->{nc} == 0x0021 and # ! |
2122 |
|
$self->{state} != COMMENT_END_BANG_STATE) { |
2123 |
|
!!!parse-error (type => 'comment end bang'); # XXX error type |
2124 |
|
$self->{state} = COMMENT_END_BANG_STATE; |
2125 |
!!!next-input-character; |
!!!next-input-character; |
2126 |
redo A; |
redo A; |
2127 |
} elsif ($self->{nc} == -1) { |
} elsif ($self->{nc} == -1) { |
2134 |
$self->{state} = DATA_STATE; |
$self->{state} = DATA_STATE; |
2135 |
$self->{s_kwd} = ''; |
$self->{s_kwd} = ''; |
2136 |
} |
} |
2137 |
## reconsume |
## Reconsume. |
2138 |
|
|
2139 |
!!!emit ($self->{ct}); # comment |
!!!emit ($self->{ct}); # comment |
2140 |
|
|
2141 |
redo A; |
redo A; |
2142 |
} else { |
} else { |
2143 |
!!!cp (154); |
!!!cp (154); |
2144 |
$self->{ct}->{data} .= '--' . chr ($self->{nc}); # comment |
if ($self->{state} == COMMENT_END_BANG_STATE) { |
2145 |
|
$self->{ct}->{data} .= '--!' . chr ($self->{nc}); # comment |
2146 |
|
} else { |
2147 |
|
$self->{ct}->{data} .= '--' . chr ($self->{nc}); # comment |
2148 |
|
} |
2149 |
$self->{state} = COMMENT_STATE; |
$self->{state} = COMMENT_STATE; |
2150 |
!!!next-input-character; |
!!!next-input-character; |
2151 |
redo A; |
redo A; |