/[suikacvs]/webroot/gate/2007/html/WebHACC/Language/WebIDL.pm
Suika

Contents of /webroot/gate/2007/html/WebHACC/Language/WebIDL.pm

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.6 - (show annotations) (download)
Fri Aug 15 05:53:23 2008 UTC (15 years, 8 months ago) by wakaba
Branch: MAIN
CVS Tags: HEAD
Changes since 1.5: +2 -1 lines
++ ChangeLog	15 Aug 2008 05:43:43 -0000
2008-08-15  Wakaba  <wakaba@suika.fam.cx>

	* cc-style.css: Add icons to links and headings of error sections.
	Use standard "uncertain" color for level-u errors.  "No error found"
	messages are now handled by catalog, not by CSS presentation.
	The result paragraph saying that the conformance is unknown
	should be bordered as uncertain error messages are.

	* error-description-source.xml: New message entries
	for not-translated-yet messages.  Distinguish result table's
	layer names from other similar texts.

++ html/WebHACC/Language/ChangeLog	15 Aug 2008 05:53:19 -0000
2008-08-15  Wakaba  <wakaba@suika.fam.cx>

	* CSS.pm, CacheManifest.pm, HTML.pm, WebIDL.pm, XML.pm: Don't
	set "uncertain" flag to character encoding (encode) layer if the
	input is a character string.

++ html/WebHACC/ChangeLog	15 Aug 2008 05:51:54 -0000
2008-08-15  Wakaba  <wakaba@suika.fam.cx>

	* Input.pm (generate_transfer_sections): Use standard
	error list methods for transfer errors.  Typos fixed.

	* Output.pm (has_error): New attribute.
	(start_error_list, end_error_list): Support for role "transfer-errors".
	(end_error_list): Generate "no error found" paragraph if it should be.
	(generate_input_section): Decode parameters as UTF-8.

	* Result.pm (add_error): Set |has_error| flag.  Use catalog
	for "Unknown location" message.
	(generate_result_section): Use different text for
	result table rows than normal messages, to avoid collision
	with other messages (such as "Charset").

1 package WebHACC::Language::WebIDL;
2 use strict;
3 require WebHACC::Language::Base;
4 push our @ISA, 'WebHACC::Language::Base';
5
6 sub new ($) {
7 my $self = bless {}, shift;
8 return $self;
9 } # new
10
11 sub generate_syntax_error_section ($) {
12 my $self = shift;
13
14 require Whatpm::WebIDL;
15
16 $self->result->layer_uncertain ('charset');
17
18 my $out = $self->output;
19 $out->start_section (role => 'parse-errors');
20 $out->start_error_list (role => 'parse-errors');
21 $self->result->layer_applicable ('syntax');
22
23 my $input = $self->input;
24 my $result = $self->result;
25
26 $self->result->layer_uncertain ('encode') unless $input->{is_char_string};
27
28 require Encode;
29 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;
31
32 $self->{structure} = $parser->parse_char_string ($input->{s}, sub {
33 $result->add_error (@_, layer => 'syntax');
34 });
35
36 $out->end_error_list (role => 'parse-errors');
37 $out->end_section;
38 } # generate_parse_error_section
39
40 sub generate_structure_dump_section ($) {
41 my $self = shift;
42
43 my $out = $self->output;
44
45 $out->start_section (role => 'reformatted');
46
47 $out->start_code_block;
48 $out->text ($self->{structure}->idl_text);
49 $out->end_code_block;
50
51 $out->end_section
52 } # generate_structure_dump_section
53
54 sub generate_structure_error_section ($) {
55 my $self = shift;
56
57 my $out = $self->output;
58
59 $out->start_section (role => 'structure-errors');
60 $out->start_error_list (role => 'structure-errors');
61 $self->result->layer_applicable ('structure');
62
63 $self->{structure}->check (sub {
64 $self->result->add_error (@_, layer => 'structure');
65 });
66
67 $out->end_error_list (role => 'structure-errors');
68 $out->end_section;
69 } # generate_structure_error_section
70
71 1;

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24