| 15 |
|
|
| 16 |
my $out = $self->output; |
my $out = $self->output; |
| 17 |
|
|
| 18 |
$out->start_section (id => 'parse-errors', title => 'Parse Errors'); |
$out->start_section (role => 'parse-errors'); |
| 19 |
$out->start_tag ('dl', id => 'parse-errors-list'); |
$out->start_error_list (role => 'parse-errors'); |
| 20 |
|
|
| 21 |
my $input = $self->input; |
my $input = $self->input; |
| 22 |
my $result = $self->result; |
my $result = $self->result; |
| 23 |
|
|
|
my $onerror = sub { |
|
|
my (%opt) = @_; |
|
|
my ($type, $cls, $msg) = get_text ($opt{type}, $opt{level}); |
|
|
$out->html (qq[<dt class="$cls">], get_error_label ($input, \%opt)); |
|
|
$type =~ tr/ /-/; |
|
|
$type =~ s/\|/%7C/g; |
|
|
$msg .= qq[ [<a href="../error-description#@{[htescape ($type)]}">Description</a>]]; |
|
|
$out->html (qq[<dd class="$cls">], get_error_level_label (\%opt) . $msg); |
|
|
|
|
|
add_error ('syntax', \%opt => $result); |
|
|
}; |
|
|
|
|
| 24 |
my $m = $input->{is_char_string} ? 'parse_char_string' : 'parse_byte_string'; |
my $m = $input->{is_char_string} ? 'parse_char_string' : 'parse_byte_string'; |
| 25 |
$self->{structure} = Whatpm::CacheManifest->$m |
$self->{structure} = Whatpm::CacheManifest->$m |
| 26 |
($input->{s}, $input->{uri}, $input->{base_uri}, $onerror); |
($input->{s}, $input->{uri}, $input->{base_uri}, sub { |
| 27 |
|
$result->add_error (@_, layer => 'syntax', index_has_link => 1); |
| 28 |
$out->end_tag ('dl'); |
}); |
| 29 |
|
|
| 30 |
|
$out->end_error_list (role => 'parse-errors'); |
| 31 |
$out->end_section; |
$out->end_section; |
| 32 |
} # generate_syntax_error_section |
} # generate_syntax_error_section |
| 33 |
|
|
| 35 |
my $self = shift; |
my $self = shift; |
| 36 |
my $manifest = $self->{structure}; |
my $manifest = $self->{structure}; |
| 37 |
|
|
| 38 |
$self->start_section (id => 'dump-manifest', title => 'Cache Manifest'); |
$self->start_section (role => 'structure'); |
| 39 |
|
|
| 40 |
$self->html (qq[<dl><dt>Explicit entries</dt>]); |
$self->html (qq[<dl><dt>Explicit entries</dt>]); |
| 41 |
my $i = 0; |
my $i = 0; |
| 71 |
|
|
| 72 |
my $out = $self->output; |
my $out = $self->output; |
| 73 |
|
|
| 74 |
$out->start_section (id => 'document-errors', title => 'Document Errors'); |
$out->start_section (role => 'structure-errors'); |
| 75 |
$out->start_tag ('dl'); |
$out->start_error_list (role => 'structure-errors'); |
| 76 |
|
|
| 77 |
my $result = $out->result; |
my $result = $out->result; |
| 78 |
|
|
| 79 |
Whatpm::CacheManifest->check_manifest ($self->{structure}, sub { |
Whatpm::CacheManifest->check_manifest ($self->{structure}, sub { |
| 80 |
my %opt = @_; |
$result->add_error (@_, layer => 'structure'); |
|
my ($type, $cls, $msg) = get_text ($opt{type}, $opt{level}, $opt{node}); |
|
|
$type =~ tr/ /-/; |
|
|
$type =~ s/\|/%7C/g; |
|
|
$msg .= qq[ [<a href="../error-description#@{[htescape ($type)]}">Description</a>]]; |
|
|
$out->html (qq[<dt class="$cls">] . get_error_label ($input, \%opt) . |
|
|
qq[</dt>\n<dd class="$cls">], $msg, "</dd>\n"); |
|
|
add_error ('structure', \%opt => $result); |
|
| 81 |
}); |
}); |
| 82 |
|
|
| 83 |
|
$out->end_error_list; |
| 84 |
$out->end_section; |
$out->end_section; |
| 85 |
} # generate_structure_error_section |
} # generate_structure_error_section |
| 86 |
|
|