/[suikacvs]/markup/html/whatpm/Whatpm/HTML/Tokenizer.pm
Suika

Diff of /markup/html/whatpm/Whatpm/HTML/Tokenizer.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.5 by wakaba, Tue Oct 14 14:38:59 2008 UTC revision 1.7 by wakaba, Tue Oct 14 15:25:50 2008 UTC
# Line 219  sub _initialize_tokenizer ($) { Line 219  sub _initialize_tokenizer ($) {
219  ##        ->{value}  ##        ->{value}
220  ##        ->{has_reference} == 1 or 0  ##        ->{has_reference} == 1 or 0
221  ##   ->{data} (COMMENT_TOKEN, CHARACTER_TOKEN)  ##   ->{data} (COMMENT_TOKEN, CHARACTER_TOKEN)
222    ##   ->{has_reference} == 1 or 0 (CHARACTER_TOKEN)
223  ## NOTE: The "self-closing flag" is hold as |$self->{self_closing}|.  ## NOTE: The "self-closing flag" is hold as |$self->{self_closing}|.
224  ##     |->{self_closing}| is used to save the value of |$self->{self_closing}|  ##     |->{self_closing}| is used to save the value of |$self->{self_closing}|
225  ##     while the token is pushed back to the stack.  ##     while the token is pushed back to the stack.
# Line 2228  sub _get_next_token ($) { Line 2229  sub _get_next_token ($) {
2229        } elsif ($self->{s_kwd} eq '[CDATA' and        } elsif ($self->{s_kwd} eq '[CDATA' and
2230                 $self->{nc} == 0x005B) { # [                 $self->{nc} == 0x005B) { # [
2231                    
2232    
2233            if ($self->{is_xml} and
2234                not $self->{tainted} and
2235                @{$self->{open_elements} or []} == 0) {
2236              $self->{parse_error}->(level => $self->{level}->{must}, type => 'cdata outside of root element',
2237                              line => $self->{line_prev},
2238                              column => $self->{column_prev} - 7);
2239              $self->{tainted} = 1;
2240            }
2241    
2242          $self->{ct} = {type => CHARACTER_TOKEN,          $self->{ct} = {type => CHARACTER_TOKEN,
2243                                    data => '',                                    data => '',
2244                                    line => $self->{line_prev},                                    line => $self->{line_prev},
# Line 3631  sub _get_next_token ($) { Line 3642  sub _get_next_token ($) {
3642        
3643          redo A;          redo A;
3644        } elsif ($self->{nc} == -1) {        } elsif ($self->{nc} == -1) {
3645            if ($self->{is_xml}) {
3646              $self->{parse_error}->(level => $self->{level}->{must}, type => 'no mse'); ## TODO: type
3647            }
3648    
3649          $self->{state} = DATA_STATE;          $self->{state} = DATA_STATE;
3650          $self->{s_kwd} = '';          $self->{s_kwd} = '';
3651                    
# Line 3952  sub _get_next_token ($) { Line 3967  sub _get_next_token ($) {
3967          $self->{s_kwd} = '';          $self->{s_kwd} = '';
3968          ## Reconsume.          ## Reconsume.
3969          return  ({type => CHARACTER_TOKEN, data => chr $code,          return  ({type => CHARACTER_TOKEN, data => chr $code,
3970                      has_reference => 1,
3971                    line => $l, column => $c,                    line => $l, column => $c,
3972                   });                   });
3973          redo A;          redo A;
# Line 4104  sub _get_next_token ($) { Line 4120  sub _get_next_token ($) {
4120          $self->{s_kwd} = '';          $self->{s_kwd} = '';
4121          ## Reconsume.          ## Reconsume.
4122          return  ({type => CHARACTER_TOKEN, data => chr $code,          return  ({type => CHARACTER_TOKEN, data => chr $code,
4123                      has_reference => 1,
4124                    line => $l, column => $c,                    line => $l, column => $c,
4125                   });                   });
4126          redo A;          redo A;
# Line 4229  sub _get_next_token ($) { Line 4246  sub _get_next_token ($) {
4246          ## Reconsume.          ## Reconsume.
4247          return  ({type => CHARACTER_TOKEN,          return  ({type => CHARACTER_TOKEN,
4248                    data => $data,                    data => $data,
4249                      has_reference => $has_ref,
4250                    line => $self->{line_prev},                    line => $self->{line_prev},
4251                    column => $self->{column_prev} + 1 - length $self->{s_kwd},                    column => $self->{column_prev} + 1 - length $self->{s_kwd},
4252                   });                   });

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.7

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24