/[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.171 by wakaba, Sun Sep 14 01:51:08 2008 UTC revision 1.172 by wakaba, Sun Sep 14 03:07:58 2008 UTC
# Line 714  sub parse_char_stream ($$$;$) { Line 714  sub parse_char_stream ($$$;$) {
714    $self->{prev_char} = [-1, -1, -1];    $self->{prev_char} = [-1, -1, -1];
715    $self->{next_char} = -1;    $self->{next_char} = -1;
716    
717    $self->{getc_until} = sub { return undef };    $self->{read_until} = sub {
718  #  if ($input->can ('manakai_getc_until')) {      #my ($scalar, $specials_range, $offset) = @_;
719      $self->{getc_until} = sub {      my $specials_range = $_[1];
720        my $special_range = shift;      return 0 if defined $self->{next_next_char};
721        return undef if defined $self->{next_next_char};      my $count = $input->manakai_read_until
722        my $s = $input->manakai_getc_until         ($_[0],
723            (qr/(?![$special_range\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}]/);          qr/(?![$specials_range\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}]/,
724        if ($s) {          $_[2]);
725          $self->{column} += length $$s;      if ($count) {
726          $self->{column_prev} += length $$s;        $self->{column} += $count;
727          $self->{prev_char} = [-1, -1, -1];        $self->{column_prev} += $count;
728          $self->{next_char} = -1;        $self->{prev_char} = [-1, -1, -1];
729        }        $self->{next_char} = -1;
730        return $s;      }
731      }; # $self->{getc_until}      return $count;
732  #  } else {    }; # $self->{read_until}
 #    $self->{getc_until} = sub {  
 #      my $special_range = shift;  
 #      return undef if defined $self->{next_next_char};  
 #      my $c = $input->getc;  
 #      if ($c =~ /^(?![$special_range\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}]/) {  
 #        $self->{column}++;  
 #        $self->{column_prev}++;  
 #        $self->{prev_char} = [-1, -1, -1];  
 #        $self->{next_char} = -1;  
 #        return \$c;  
 #      } elsif (defined $c) {  
 #        #$input->ungetc (ord $c);  
 #        $self->{next_next_char} = $c;  
 #        return undef;  
 #      } else {  
 #        return undef;  
 #      }  
 #    }; # $self->{getc_until}  
 #  }  
733    
734    my $onerror = $_[2] || sub {    my $onerror = $_[2] || sub {
735      my (%opt) = @_;      my (%opt) = @_;
# Line 1046  sub _get_next_token ($) { Line 1027  sub _get_next_token ($) {
1027                     data => chr $self->{next_char},                     data => chr $self->{next_char},
1028                     line => $self->{line}, column => $self->{column},                     line => $self->{line}, column => $self->{column},
1029                    };                    };
1030          $self->{read_until}->($token->{data}, q[-!<>&], length $token->{data});
       my $s = $self->{getc_until}->(q[-!<>&]);  
       if ($s) {  
         $token->{data} .= $$s;  
       }  
1031    
1032        ## Stay in the data state        ## Stay in the data state
1033        !!!next-input-character;        !!!next-input-character;
# Line 7818  sub set_inner_html ($$$;$) { Line 7795  sub set_inner_html ($$$;$) {
7795      $p->{prev_char} = [-1, -1, -1];      $p->{prev_char} = [-1, -1, -1];
7796      $p->{next_char} = -1;      $p->{next_char} = -1;
7797    
7798      $p->{getc_until} = sub {      $p->{read_until} = sub {
7799        ## TODO: ...        ## TODO: ...
7800        return undef;        return 0;
7801      }; # $p->{getc_until};      }; # $p->{read_until};
7802    
7803      my $ponerror = $onerror || sub {      my $ponerror = $onerror || sub {
7804        my (%opt) = @_;        my (%opt) = @_;

Legend:
Removed from v.1.171  
changed lines
  Added in v.1.172

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24