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

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

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

revision 1.178 by wakaba, Sun Sep 14 11:57:41 2008 UTC revision 1.179 by wakaba, Sun Sep 14 13:09:01 2008 UTC
# Line 643  sub parse_char_stream ($$$;$) { Line 643  sub parse_char_stream ($$$;$) {
643    
644    my $i = 0;    my $i = 0;
645    $self->{line_prev} = $self->{line} = 1;    $self->{line_prev} = $self->{line} = 1;
646    $self->{column_prev} = $self->{column} = 0;    $self->{column_prev} = -1;
647      $self->{column} = 0;
648    $self->{set_next_char} = sub {    $self->{set_next_char} = sub {
649      my $self = shift;      my $self = shift;
650    
     pop @{$self->{prev_char}};  
     unshift @{$self->{prev_char}}, $self->{next_char};  
   
651      my $char = '';      my $char = '';
652      if (defined $self->{next_next_char}) {      if (defined $self->{next_next_char}) {
653        $char = $self->{next_next_char};        $char = $self->{next_next_char};
654        delete $self->{next_next_char};        delete $self->{next_next_char};
655        $self->{next_char} = ord $char;        $self->{next_char} = ord $char;
656      } else {      } else {
657          $self->{char_buffer} = '';
658          $self->{char_buffer_pos} = 0;
659    
660          my $count = $input->manakai_read_until
661             ($self->{char_buffer},
662              qr/(?!\x{FDD0}-\x{FDDF}\x{FFFE}\x{FFFF}\x{1FFFE}\x{1FFFF}\x{2FFFE}\x{2FFFF}\x{3FFFE}\x{3FFFF}\x{4FFFE}\x{4FFFF}\x{5FFFE}\x{5FFFF}\x{6FFFE}\x{6FFFF}\x{7FFFE}\x{7FFFF}\x{8FFFE}\x{8FFFF}\x{9FFFE}\x{9FFFF}\x{AFFFE}\x{AFFFF}\x{BFFFE}\x{BFFFF}\x{CFFFE}\x{CFFFF}\x{DFFFE}\x{DFFFF}\x{EFFFE}\x{EFFFF}\x{FFFFE}\x{FFFFF}])[\x20-\x7E\xA0-\x{D7FF}\x{E000}-\x{10FFFD}]/,
663              $self->{char_buffer_pos});
664          if ($count) {
665            $self->{line_prev} = $self->{line};
666            $self->{column_prev} = $self->{column};
667            $self->{column}++;
668            $self->{next_char}
669                = ord substr ($self->{char_buffer}, $self->{char_buffer_pos}++, 1);
670            return;
671          }
672    
673        if ($input->read ($char, 1)) {        if ($input->read ($char, 1)) {
674          $self->{next_char} = ord $char;          $self->{next_char} = ord $char;
675        } else {        } else {
# Line 735  sub parse_char_stream ($$$;$) { Line 749  sub parse_char_stream ($$$;$) {
749      }      }
750      return $count;      return $count;
751    }; # $self->{read_until}    }; # $self->{read_until}
752    $self->{read_until}=sub{0};
753    
754    my $onerror = $_[2] || sub {    my $onerror = $_[2] || sub {
755      my (%opt) = @_;      my (%opt) = @_;
# Line 906  sub _initialize_tokenizer ($) { Line 921  sub _initialize_tokenizer ($) {
921    undef $self->{last_emitted_start_tag_name};    undef $self->{last_emitted_start_tag_name};
922    #$self->{prev_state}; # initialized when used    #$self->{prev_state}; # initialized when used
923    delete $self->{self_closing};    delete $self->{self_closing};
924      $self->{char_buffer} = '';
925      $self->{char_buffer_pos} = 0;
926    # $self->{next_char}    # $self->{next_char}
927    !!!next-input-character;    !!!next-input-character;
928    $self->{token} = [];    $self->{token} = [];

Legend:
Removed from v.1.178  
changed lines
  Added in v.1.179

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24