13 |
|
|
14 |
require Whatpm::WebIDL; |
require Whatpm::WebIDL; |
15 |
|
|
16 |
|
$self->result->layer_uncertain ('charset'); |
17 |
|
|
18 |
my $out = $self->output; |
my $out = $self->output; |
19 |
$out->start_section (role => 'parse-errors'); |
$out->start_section (role => 'parse-errors'); |
20 |
$out->start_error_list (role => 'parse-errors'); |
$out->start_error_list (role => 'parse-errors'); |
21 |
|
$self->result->layer_applicable ('syntax'); |
22 |
|
|
23 |
my $input = $self->input; |
my $input = $self->input; |
24 |
my $result = $self->result; |
my $result = $self->result; |
25 |
|
|
26 |
|
$self->result->layer_uncertain ('encode') unless $input->{is_char_string}; |
27 |
|
|
28 |
require Encode; |
require Encode; |
29 |
my $s = $input->{is_char_string} ? $input->{s} : Encode::decode ($input->{charset} || 'utf-8', $input->{s}); ## TODO: charset |
my $s = $input->{is_char_string} ? $input->{s} : Encode::decode ($input->{charset} || 'utf-8', $input->{s}); ## TODO: charset |
30 |
my $parser = Whatpm::WebIDL::Parser->new; |
my $parser = Whatpm::WebIDL::Parser->new; |
58 |
|
|
59 |
$out->start_section (role => 'structure-errors'); |
$out->start_section (role => 'structure-errors'); |
60 |
$out->start_error_list (role => 'structure-errors'); |
$out->start_error_list (role => 'structure-errors'); |
61 |
|
$self->result->layer_applicable ('structure'); |
62 |
|
|
63 |
$self->{structure}->check (sub { |
$self->{structure}->check (sub { |
64 |
$self->result->add_error (@_, layer => 'structure'); |
$self->result->add_error (@_, layer => 'structure'); |