/[suikacvs]/markup/html/whatpm/What/mkhtmlparser.pl
Suika

Contents of /markup/html/whatpm/What/mkhtmlparser.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (hide annotations) (download)
Sat Apr 28 14:29:01 2007 UTC (17 years, 7 months ago) by wakaba
Branch: MAIN
File MIME type: text/plain
++ whatpm/What/ChangeLog	28 Apr 2007 14:28:15 -0000
2007-04-28  Wakaba  <wakaba@suika.fam.cx>

	* HTML.pm.src, HTML-consume-entity.src: New files.

	* Makefile (HTML.pm): New rule.

	* mkhtmlparser.pl: New script.

1 wakaba 1.1 #!/usr/bin/perl
2     use strict;
3    
4     my $consume_entity_file_name = 'HTML-consume-entity.src';
5    
6     while (<>) {
7     s/!!!emit\b/return /;
8     s{!!!consume-entity\}}{
9     open my $consume_entity_file, '<', $consume_entity_file_name
10     or die "$0: $consume_entity_file_name: $!";
11     my $r = '';
12     while (defined (my $l = <$consume_entity_file>)) {
13     $r .= $l unless $l =~ /<javascript:/;
14     }
15     $r;
16     }e;
17     s{!!!next-input-character;}{q{
18     if (@{$self->{char}}) {
19     $self->{next_input_character} = shift @{$self->{char}};
20     } else {
21     $self->{set_next_input_character}->($self);
22     }
23     }}ge;
24     s{!!!back-next-input-character\b}{q{unshift @{$self->{char}}, }}ge;
25     s{!!!parse-error;}{q{$self->{parse_error}->();}}ge;
26     s{!!!parse-error\b}{q{$self->{parse_error}->}}ge;
27     print;
28     }

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24