Parent Directory
|
Revision Log
++ whatpm/Whatpm/ChangeLog 16 Aug 2008 07:34:18 -0000 * CacheManifest.pm: Support for new style of error reports. * HTML.pm.src: Set line=1, column=1 to the document node. 2008-08-16 Wakaba <wakaba@suika.fam.cx> ++ whatpm/Whatpm/CSS/ChangeLog 16 Aug 2008 07:34:47 -0000 2008-08-16 Wakaba <wakaba@suika.fam.cx> * MediaQueryParser.pm, SelectorsParser.pm, Parser.pm: Support for new style of error reports.
| 1 | package Whatpm::CSS::MediaQueryParser; |
| 2 | use strict; |
| 3 | our $VERSION=do{my @r=(q$Revision: 1.1 $=~/\d+/g);sprintf "%d."."%02d" x $#r,@r}; |
| 4 | |
| 5 | use Whatpm::CSS::Tokenizer qw(:token); |
| 6 | |
| 7 | sub new ($) { |
| 8 | my $self = bless { |
| 9 | onerror => sub { }, |
| 10 | level => { |
| 11 | must => 'm', |
| 12 | uncertain => 'u', |
| 13 | }, |
| 14 | }, shift; |
| 15 | #$self->{href} = \(uri in which the MQ appears); |
| 16 | return $self; |
| 17 | } # new |
| 18 | |
| 19 | sub parse_char_string ($$) { |
| 20 | my $self = $_[0]; |
| 21 | |
| 22 | my $s = $_[1]; |
| 23 | pos ($s) = 0; |
| 24 | |
| 25 | my $tt = Whatpm::CSS::Tokenizer->new; |
| 26 | $tt->{onerror} = $self->{onerror}; |
| 27 | $tt->{line} = 1; |
| 28 | $tt->{column} = 1; |
| 29 | $tt->{get_char} = sub { |
| 30 | if (pos $s < length $s) { |
| 31 | $tt->{column} = 1 + pos $s; |
| 32 | return ord substr $s, pos ($s)++, 1; |
| 33 | } else { |
| 34 |