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

Diff of /test/html-webhacc/WebHACC/Result.pm

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

revision 1.20 by wakaba, Sun Sep 14 06:33:27 2008 UTC revision 1.21 by wakaba, Thu Dec 11 03:22:57 2008 UTC
# Line 170  sub add_error ($%) { Line 170  sub add_error ($%) {
170      $has_location = 1;      $has_location = 1;
171    }    }
172    
173    if (defined $opt{value}) {    if (not defined $opt{valueref} and defined $opt{value}) {
174        $opt{valueref} = \($opt{value});
175      }
176    
177      if (defined $opt{valueref}) {
178      $out->html (' ');      $out->html (' ');
179      if (defined $opt{pos_start}) {      if (defined $opt{pos_start}) {
180        $out->start_tag ('code');        $out->start_tag ('code');
181        $out->text (substr $opt{value}, 0, $opt{pos_start});        $out->text (substr ${$opt{valueref}}, 0, $opt{pos_start});
182        $out->start_tag ('mark');        $out->start_tag ('mark');
183        $out->text (substr $opt{value}, $opt{pos_start},        $out->text (substr ${$opt{valueref}}, $opt{pos_start},
184                        $opt{pos_end} - $opt{pos_start} + 1);                        $opt{pos_end} - $opt{pos_start});
185        $out->end_tag ('mark');        $out->end_tag ('mark');
186        $out->text (substr $opt{value}, $opt{pos_end} + 1)        $out->text (substr ${$opt{valueref}}, $opt{pos_end})
187            if $opt{pos_end} < length $opt{value};            if $opt{pos_end} < length ${$opt{valueref}};
188        $out->end_tag ('code');        $out->end_tag ('code');
189      } elsif ($opt{value_mark_end}) {      } elsif ($opt{value_mark_end}) {
190        $out->start_tag ('code');        $out->start_tag ('code');
191        $out->text ($opt{value});        $out->text (${$opt{valueref}});
192        $out->start_tag ('mark');        $out->start_tag ('mark');
193        $out->end_tag ('mark');        $out->end_tag ('mark');
194        $out->end_tag ('code');        $out->end_tag ('code');
195      } elsif (defined $opt{value_mark}) {      } elsif (defined $opt{value_mark}) {
196        $out->start_tag ('code');        $out->start_tag ('code');
197        for (split /($opt{value_mark})/, $opt{value}) {        for (split /($opt{value_mark})/, ${$opt{valueref}}) {
198          if (/$opt{value_mark}/) {          if (/$opt{value_mark}/) {
199            $out->start_tag ('mark');            $out->start_tag ('mark');
200            $out->text ($_);            $out->text ($_);
# Line 201  sub add_error ($%) { Line 205  sub add_error ($%) {
205        }        }
206        $out->end_tag ('code');        $out->end_tag ('code');
207      } else {      } else {
208        $out->code ($opt{value});        $out->code (${$opt{valueref}});
209      }      }
210      $has_location = 1;      $has_location = 1;
211    }    }
# Line 237  sub add_error ($%) { Line 241  sub add_error ($%) {
241    ## Error message    ## Error message
242    my $error_type_text = $opt{type};    my $error_type_text = $opt{type};
243    $out->nl_text ($error_type_text, node => $opt{node}, text => $opt{text},    $out->nl_text ($error_type_text, node => $opt{node}, text => $opt{text},
244                   value => $opt{value}, char => $opt{char},                   value => ${$opt{valueref} or \''}, char => $opt{char},
245                   octets => $opt{octets});                   octets => $opt{octets});
246        
247    ## Link to a long description    ## Link to a long description

Legend:
Removed from v.1.20  
changed lines
  Added in v.1.21

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24