/[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.120 by wakaba, Thu Mar 20 03:57:00 2008 UTC revision 1.121 by wakaba, Thu Mar 20 08:04:58 2008 UTC
# Line 6483  sub set_inner_html ($$$) { Line 6483  sub set_inner_html ($$$) {
6483    
6484      ## Step 8 # MUST      ## Step 8 # MUST
6485      my $i = 0;      my $i = 0;
6486      my $line = 1;      $p->{line_prev} = $p->{line} = 1;
6487      my $column = 0;      $p->{column_prev} = $p->{column} = 0;
6488      $p->{set_next_char} = sub {      $p->{set_next_char} = sub {
6489        my $self = shift;        my $self = shift;
6490    
# Line 6493  sub set_inner_html ($$$) { Line 6493  sub set_inner_html ($$$) {
6493    
6494        $self->{next_char} = -1 and return if $i >= length $$s;        $self->{next_char} = -1 and return if $i >= length $$s;
6495        $self->{next_char} = ord substr $$s, $i++, 1;        $self->{next_char} = ord substr $$s, $i++, 1;
6496        $column++;  
6497          ($p->{line_prev}, $p->{column_prev}) = ($p->{line}, $p->{column});
6498          $p->{column}++;
6499    
6500        if ($self->{next_char} == 0x000A) { # LF        if ($self->{next_char} == 0x000A) { # LF
6501          $line++;          $p->{line}++;
6502          $column = 0;          $p->{column} = 0;
6503          !!!cp ('i1');          !!!cp ('i1');
6504        } elsif ($self->{next_char} == 0x000D) { # CR        } elsif ($self->{next_char} == 0x000D) { # CR
6505          $i++ if substr ($$s, $i, 1) eq "\x0A";          $i++ if substr ($$s, $i, 1) eq "\x0A";
6506          $self->{next_char} = 0x000A; # LF # MUST          $self->{next_char} = 0x000A; # LF # MUST
6507          $line++;          $p->{line}++;
6508          $column = 0;          $p->{column} = 0;
6509          !!!cp ('i2');          !!!cp ('i2');
6510        } elsif ($self->{next_char} > 0x10FFFF) {        } elsif ($self->{next_char} > 0x10FFFF) {
6511          $self->{next_char} = 0xFFFD; # REPLACEMENT CHARACTER # MUST          $self->{next_char} = 0xFFFD; # REPLACEMENT CHARACTER # MUST
# Line 6519  sub set_inner_html ($$$) { Line 6521  sub set_inner_html ($$$) {
6521            
6522      my $ponerror = $onerror || sub {      my $ponerror = $onerror || sub {
6523        my (%opt) = @_;        my (%opt) = @_;
6524        warn "Parse error ($opt{type}) at line $opt{line} column $opt{column}\n";        my $line = $opt{line};
6525          my $column = $opt{column};
6526          if (defined $opt{token} and defined $opt{token}->{line}) {
6527            $line = $opt{token}->{line};
6528            $column = $opt{token}->{column};
6529          }
6530          warn "Parse error ($opt{type}) at line $line column $column\n";
6531      };      };
6532      $p->{parse_error} = sub {      $p->{parse_error} = sub {
6533        $ponerror->(@_, line => $line, column => $column);        $ponerror->(line => $p->{line}, column => $p->{column}, @_);
6534      };      };
6535            
6536      $p->_initialize_tokenizer;      $p->_initialize_tokenizer;
# Line 6602  sub set_inner_html ($$$) { Line 6610  sub set_inner_html ($$$) {
6610      ## ISSUE: mutation events?      ## ISSUE: mutation events?
6611    
6612      $p->_terminate_tree_constructor;      $p->_terminate_tree_constructor;
6613    
6614        delete $p->{parse_error}; # delete loop
6615    } else {    } else {
6616      die "$0: |set_inner_html| is not defined for node of type $nt";      die "$0: |set_inner_html| is not defined for node of type $nt";
6617    }    }

Legend:
Removed from v.1.120  
changed lines
  Added in v.1.121

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24