/[suikacvs]/test/html-webhacc/cc.cgi
Suika

Diff of /test/html-webhacc/cc.cgi

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

revision 1.41 by wakaba, Sun Mar 16 11:38:47 2008 UTC revision 1.42 by wakaba, Mon Mar 17 13:25:19 2008 UTC
# Line 684  sub print_source_string_section ($$$) { Line 684  sub print_source_string_section ($$$) {
684      print STDOUT q[<li id="$input->{id_prefix}line-1"></li>];      print STDOUT q[<li id="$input->{id_prefix}line-1"></li>];
685    }    }
686    print STDOUT "</ol></div>    print STDOUT "</ol></div>
687  <script> addSourceToParseErrorList ('$input->{id_prefix}'); </script>";  <script>
688      addSourceToParseErrorList ('$input->{id_prefix}', 'parse-errors-list');
689    </script>";
690  } # print_input_string_section  } # print_input_string_section
691    
692  sub print_document_tree ($$) {  sub print_document_tree ($$) {
# Line 853  sub print_structure_error_dom_section ($ Line 855  sub print_structure_error_dom_section ($
855    print STDOUT qq[<div id="$input->{id_prefix}document-errors" class="section">    print STDOUT qq[<div id="$input->{id_prefix}document-errors" class="section">
856  <h2>Document Errors</h2>  <h2>Document Errors</h2>
857    
858  <dl>];  <dl id=document-errors-list>];
859    push @nav, [qq[#$input->{id_prefix}document-errors] => 'Document Error']    push @nav, [qq[#$input->{id_prefix}document-errors] => 'Document Error']
860        unless $input->{nested};        unless $input->{nested};
861    
# Line 881  sub print_structure_error_dom_section ($ Line 883  sub print_structure_error_dom_section ($
883    }    }
884    $time{check} = time - $time1;    $time{check} = time - $time1;
885    
886    print STDOUT qq[</dl></div>];    print STDOUT qq[</dl>
887    <script>
888      addSourceToParseErrorList ('$input->{id_prefix}', 'document-errors-list');
889    </script></div>];
890    
891    return $elements;    return $elements;
892  } # print_structure_error_dom_section  } # print_structure_error_dom_section
# Line 1121  sub get_error_label ($$) { Line 1126  sub get_error_label ($$) {
1126    
1127    my $r = '';    my $r = '';
1128    
1129    if (defined $err->{token} and defined $err->{token}->{line}) {    my $line;
1130      if ($err->{token}->{column} > 0) {    my $column;
1131        $r = qq[<a href="#$input->{id_prefix}line-$err->{token}->{line}">Line $err->{token}->{line}</a> column $err->{token}->{column}];      
1132      if (defined $err->{node}) {
1133        $line = $err->{node}->get_user_data ('manakai_source_line');
1134        if (defined $line) {
1135          $column = $err->{node}->get_user_data ('manakai_source_column');
1136      } else {      } else {
1137        $err->{token}->{line} = $err->{token}->{line} - 1 || 1;        if ($err->{node}->node_type == $err->{node}->ATTRIBUTE_NODE) {
1138        $r = qq[<a href="#$input->{id_prefix}line-$err->{token}->{line}">Line $err->{token}->{line}</a>];          my $owner = $err->{node}->owner_element;
1139            $line = $owner->get_user_data ('manakai_source_line');
1140            $column = $owner->get_user_data ('manakai_source_column');
1141          }
1142        }
1143      }
1144      unless (defined $line) {
1145        if (defined $err->{token} and defined $err->{token}->{line}) {
1146          $line = $err->{token}->{line};
1147          $column = $err->{token}->{column};
1148        } elsif (defined $err->{line}) {
1149          $line = $err->{line};
1150          $column = $err->{column};
1151      }      }
1152    } elsif (defined $err->{line}) {    }
1153      if ($err->{column} > 0) {  
1154        $r = qq[<a href="#$input->{id_prefix}line-$err->{line}">Line $err->{line}</a> column $err->{column}];    if (defined $line) {
1155        if (defined $column and $column > 0) {
1156          $r = qq[<a href="#$input->{id_prefix}line-$line">Line $line</a> column $column];
1157      } else {      } else {
1158        $err->{line} = $err->{line} - 1 || 1;        $line = $line - 1 || 1;
1159        $r = qq[<a href="#$input->{id_prefix}line-$err->{line}">Line $err->{line}</a>];        $r = qq[<a href="#$input->{id_prefix}line-$line">Line $line</a>];
1160      }      }
1161    }    }
1162    
1163    if (defined $err->{node}) {    if (defined $err->{node}) {
1164      $r .= ' ' if length $r;      $r .= ' ' if length $r;
1165      $r = get_node_link ($input, $err->{node});      $r .= get_node_link ($input, $err->{node});
1166    }    }
1167    
1168    if (defined $err->{index}) {    if (defined $err->{index}) {

Legend:
Removed from v.1.41  
changed lines
  Added in v.1.42

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24