--- webroot/gate/2007/html/WebHACC/Language/WebIDL.pm 2008/07/20 14:58:24 1.1
+++ webroot/gate/2007/html/WebHACC/Language/WebIDL.pm 2008/07/20 16:53:10 1.2
@@ -20,25 +20,13 @@
my $input = $self->input;
my $result = $self->result;
- my $onerror = sub {
- my (%opt) = @_;
- my ($type, $cls, $msg) = main::get_text ($opt{type}, $opt{level});
- $out->html (qq[
] . $result->get_error_label ($input, \%opt));
- $type =~ tr/ /-/;
- $type =~ s/\|/%7C/g;
- $out->html (qq[], $result->get_error_level_label (\%opt) . $msg);
- $out->text (' [');
- $out->link ('Description', url => '../error-description#' . $type);
- $out->text (']');
-
- main::add_error ('syntax', \%opt => $result);
- };
-
require Encode;
my $s = $input->{is_char_string} ? $input->{s} : Encode::decode ($input->{charset} || 'utf-8', $input->{s}); ## TODO: charset
my $parser = Whatpm::WebIDL::Parser->new;
- $self->{structure} = $parser->parse_char_string ($input->{s}, $onerror);
+ $self->{structure} = $parser->parse_char_string ($input->{s}, sub {
+ $result->add_error (@_, layer => 'syntax');
+ });
$out->html ('');
} # generate_parse_error_section