86 |
<dd>$char_length byte@{[$char_length == 1 ? '' : 's']}</dd> |
<dd>$char_length byte@{[$char_length == 1 ? '' : 's']}</dd> |
87 |
</dl> |
</dl> |
88 |
</div> |
</div> |
89 |
|
|
90 |
|
<script src="../cc-script.js"></script> |
91 |
]; |
]; |
92 |
|
|
93 |
$input->{id_prefix} = ''; |
$input->{id_prefix} = ''; |
294 |
<div id="$input->{id_prefix}parse-errors" class="section"> |
<div id="$input->{id_prefix}parse-errors" class="section"> |
295 |
<h2>Parse Errors</h2> |
<h2>Parse Errors</h2> |
296 |
|
|
297 |
<dl>]; |
<dl id="$input->{id_prefix}parse-errors-list">]; |
298 |
push @nav, ['#parse-errors' => 'Parse Error'] unless $input->{nested}; |
push @nav, ['#parse-errors' => 'Parse Error'] unless $input->{nested}; |
299 |
|
|
300 |
my $onerror = sub { |
my $onerror = sub { |
301 |
my (%opt) = @_; |
my (%opt) = @_; |
302 |
my ($type, $cls, $msg) = get_text ($opt{type}, $opt{level}); |
my ($type, $cls, $msg) = get_text ($opt{type}, $opt{level}); |
303 |
if ($opt{column} > 0) { |
print STDOUT qq[<dt class="$cls">], get_error_label ($input, \%opt), |
304 |
print STDOUT qq[<dt class="$cls"><a href="#$input->{id_prefix}line-$opt{line}">Line $opt{line}</a> column $opt{column}</dt>\n]; |
qq[</dt>]; |
|
} else { |
|
|
$opt{line} = $opt{line} - 1 || 1; |
|
|
print STDOUT qq[<dt class="$cls"><a href="#$input->{id_prefix}line-$opt{line}">Line $opt{line}</a></dt>\n]; |
|
|
} |
|
305 |
$type =~ tr/ /-/; |
$type =~ tr/ /-/; |
306 |
$type =~ s/\|/%7C/g; |
$type =~ s/\|/%7C/g; |
307 |
$msg .= qq[ [<a href="../error-description#@{[htescape ($type)]}">Description</a>]]; |
$msg .= qq[ [<a href="../error-description#@{[htescape ($type)]}">Description</a>]]; |
348 |
<div id="$input->{id_prefix}parse-errors" class="section"> |
<div id="$input->{id_prefix}parse-errors" class="section"> |
349 |
<h2>Parse Errors</h2> |
<h2>Parse Errors</h2> |
350 |
|
|
351 |
<dl>]; |
<dl id="$input->{id_prefix}parse-errors-list">]; |
352 |
push @nav, ['#parse-errors' => 'Parse Error'] unless $input->{prefix}; |
push @nav, ['#parse-errors' => 'Parse Error'] unless $input->{prefix}; |
353 |
|
|
354 |
my $onerror = sub { |
my $onerror = sub { |
559 |
<div id="$input->{id_prefix}parse-errors" class="section"> |
<div id="$input->{id_prefix}parse-errors" class="section"> |
560 |
<h2>Parse Errors</h2> |
<h2>Parse Errors</h2> |
561 |
|
|
562 |
<dl>]; |
<dl id="$input->{id_prefix}parse-errors-list">]; |
563 |
push @nav, ['#parse-errors' => 'Parse Error'] unless $input->{nested}; |
push @nav, ['#parse-errors' => 'Parse Error'] unless $input->{nested}; |
564 |
|
|
565 |
my $p = get_css_parser (); |
my $p = get_css_parser (); |
625 |
<div id="$input->{id_prefix}parse-errors" class="section"> |
<div id="$input->{id_prefix}parse-errors" class="section"> |
626 |
<h2>Parse Errors</h2> |
<h2>Parse Errors</h2> |
627 |
|
|
628 |
<dl>]; |
<dl id="$input->{id_prefix}parse-errors-list">]; |
629 |
push @nav, ['#parse-errors' => 'Parse Error'] unless $input->{nested}; |
push @nav, ['#parse-errors' => 'Parse Error'] unless $input->{nested}; |
630 |
|
|
631 |
my $onerror = sub { |
my $onerror = sub { |
671 |
<h2>Document Source</h2> |
<h2>Document Source</h2> |
672 |
<ol lang="">\n]; |
<ol lang="">\n]; |
673 |
if (length $$s) { |
if (length $$s) { |
674 |
while ($$s =~ /\G([^\x0A]*?)\x0D?\x0A/gc) { |
while ($$s =~ /\G([^\x0D\x0A]*?)(?>\x0D\x0A?|\x0A)/gc) { |
675 |
print STDOUT qq[<li id="$input->{id_prefix}line-$i">], htescape $1, |
print STDOUT qq[<li id="$input->{id_prefix}line-$i">], htescape $1, |
676 |
"</li>\n"; |
"</li>\n"; |
677 |
$i++; |
$i++; |
678 |
} |
} |
679 |
if ($$s =~ /\G([^\x0A]+)/gc) { |
if ($$s =~ /\G([^\x0D\x0A]+)/gc) { |
680 |
print STDOUT qq[<li id="$input->{id_prefix}line-$i">], htescape $1, |
print STDOUT qq[<li id="$input->{id_prefix}line-$i">], htescape $1, |
681 |
"</li>\n"; |
"</li>\n"; |
682 |
} |
} |
683 |
} else { |
} else { |
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> |
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 ($$) { |
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 |
|
|
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 |
1126 |
|
|
1127 |
my $r = ''; |
my $r = ''; |
1128 |
|
|
1129 |
if (defined $err->{line}) { |
my $line; |
1130 |
if ($err->{column} > 0) { |
my $column; |
1131 |
$r = qq[<a href="#$input->{id_prefix}line-$err->{line}">Line $err->{line}</a> column $err->{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 { |
1137 |
|
if ($err->{node}->node_type == $err->{node}->ATTRIBUTE_NODE) { |
1138 |
|
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 |
|
} else { |
1142 |
|
my $parent = $err->{node}->parent_node; |
1143 |
|
$line = $parent->get_user_data ('manakai_source_line'); |
1144 |
|
$column = $parent->get_user_data ('manakai_source_column'); |
1145 |
|
} |
1146 |
|
} |
1147 |
|
} |
1148 |
|
unless (defined $line) { |
1149 |
|
if (defined $err->{token} and defined $err->{token}->{line}) { |
1150 |
|
$line = $err->{token}->{line}; |
1151 |
|
$column = $err->{token}->{column}; |
1152 |
|
} elsif (defined $err->{line}) { |
1153 |
|
$line = $err->{line}; |
1154 |
|
$column = $err->{column}; |
1155 |
|
} |
1156 |
|
} |
1157 |
|
|
1158 |
|
if (defined $line) { |
1159 |
|
if (defined $column and $column > 0) { |
1160 |
|
$r = qq[<a href="#$input->{id_prefix}line-$line">Line $line</a> column $column]; |
1161 |
} else { |
} else { |
1162 |
$err->{line} = $err->{line} - 1 || 1; |
$line = $line - 1 || 1; |
1163 |
$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>]; |
1164 |
} |
} |
1165 |
} |
} |
1166 |
|
|
1167 |
if (defined $err->{node}) { |
if (defined $err->{node}) { |
1168 |
$r .= ' ' if length $r; |
$r .= ' ' if length $r; |
1169 |
$r = get_node_link ($input, $err->{node}); |
$r .= get_node_link ($input, $err->{node}); |
1170 |
} |
} |
1171 |
|
|
1172 |
if (defined $err->{index}) { |
if (defined $err->{index}) { |