/[suikacvs]/test/html-webhacc/WebHACC/Language/CacheManifest.pm
Suika

Diff of /test/html-webhacc/WebHACC/Language/CacheManifest.pm

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

revision 1.1 by wakaba, Sun Jul 20 14:58:24 2008 UTC revision 1.2 by wakaba, Sun Jul 20 16:53:10 2008 UTC
# Line 21  sub generate_syntax_error_section ($) { Line 21  sub generate_syntax_error_section ($) {
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          });
29    
30    $out->end_tag ('dl');    $out->end_tag ('dl');
31    $out->end_section;    $out->end_section;
# Line 87  sub generate_structure_error_section ($) Line 77  sub generate_structure_error_section ($)
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_section;    $out->end_section;

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24