line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package CSS::Selector::Grammar; |
2
|
|
|
|
|
|
|
$CSS::Selector::Grammar::VERSION = '0.002'; |
3
|
|
|
|
|
|
|
# ABSTRACT: Generate parse trees for CSS3 selectors. |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
748
|
use v5.10; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
52
|
|
7
|
1
|
|
|
1
|
|
5
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
36
|
|
8
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
23
|
|
9
|
|
|
|
|
|
|
|
10
|
1
|
|
|
1
|
|
1081
|
use parent 'Exporter'; |
|
1
|
|
|
|
|
684
|
|
|
1
|
|
|
|
|
7
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
our @EXPORT = qw(parse_selector); |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
{ |
15
|
1
|
|
|
1
|
|
2457
|
use Regexp::Grammars; |
|
1
|
|
|
|
|
94269
|
|
|
1
|
|
|
|
|
13
|
|
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
# lexemes |
18
|
|
|
|
|
|
|
qr/ |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
[-]?<.nmstart><.nmchar>* |
24
|
|
|
|
|
|
|
<.nmchar>+ |
25
|
|
|
|
|
|
|
[_a-zA-Z]|<.nonascii>|<.escape> |
26
|
|
|
|
|
|
|
[^\0-\177] |
27
|
|
|
|
|
|
|
\\[0-9a-fA-F]{1,6}(?:\r\n|[ \n\r\t\f])?+ |
28
|
|
|
|
|
|
|
<.unicode>|\\[^\n\r\f0-9a-f] |
29
|
|
|
|
|
|
|
[_a-zA-Z0-9-]|<.nonascii>|<.escape> |
30
|
|
|
|
|
|
|
[0-9]+|[0-9]*\.[0-9]++ |
31
|
|
|
|
|
|
|
<.string1>|<.string2> |
32
|
|
|
|
|
|
|
\"(?:[^\n\r\f\\"]|\\<.nl>|<.nonascii>|<.escape>)*+\" |
33
|
|
|
|
|
|
|
\'(?:[^\n\r\f\\']|\\<.nl>|<.nonascii>|<.escape>)*+\' |
34
|
|
|
|
|
|
|
<.invalid1>|<.invalid2> |
35
|
|
|
|
|
|
|
\"(?:[^\n\r\f\\"]|\\<.nl>|<.nonascii>|<.escape>)*+ |
36
|
|
|
|
|
|
|
\'(?:[^\n\r\f\\']|\\<.nl>|<.nonascii>|<.escape>)*+ |
37
|
|
|
|
|
|
|
\n|\r\n|\r|\f |
38
|
|
|
|
|
|
|
[ \t\r\n\f]*+ |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
(?i:d|\\0{0,4}(?:44|64)(?:\r\n|[ \t\r\n\f])?) |
41
|
|
|
|
|
|
|
(?i:e|\\0{0,4}(?:45|65)(?:\r\n|[ \t\r\n\f])?) |
42
|
|
|
|
|
|
|
(?i:n|\\0{0,4}(?:4e|6e)(?:\r\n|[ \t\r\n\f])?|\\n) |
43
|
|
|
|
|
|
|
(?i:o|\\0{0,4}(?:4f|6f)(?:\r\n|[ \t\r\n\f])?|\\o) |
44
|
|
|
|
|
|
|
(?i:t|\\0{0,4}(?:54|74)(?:\r\n|[ \t\r\n\f])?|\\t) |
45
|
|
|
|
|
|
|
(?i:v|\\0{0,4}(?:58|78)(?:\r\n|[ \t\r\n\f])?|\\v) |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
[ \t\r\n\f]+ |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
~= |
50
|
|
|
|
|
|
|
\|= |
51
|
|
|
|
|
|
|
\^= |
52
|
|
|
|
|
|
|
\$= |
53
|
|
|
|
|
|
|
\*= |
54
|
|
|
|
|
|
|
<.ident> |
55
|
|
|
|
|
|
|
<.string> |
56
|
|
|
|
|
|
|
<.ident> \( |
57
|
|
|
|
|
|
|
<.num> |
58
|
|
|
|
|
|
|
\# <.name> |
59
|
|
|
|
|
|
|
<.w> \+ |
60
|
|
|
|
|
|
|
<.w> \> |
61
|
|
|
|
|
|
|
<.w> , |
62
|
|
|
|
|
|
|
<.w> ~ |
63
|
|
|
|
|
|
|
: <.N><.O><.T> \( |
64
|
|
|
|
|
|
|
@ <.ident> |
65
|
|
|
|
|
|
|
<.invalid> |
66
|
|
|
|
|
|
|
<.num> % |
67
|
|
|
|
|
|
|
<.num> <.ident> |
68
|
|
|
|
|
|
|
\ |