forked from browserslist/browserslist
-
Notifications
You must be signed in to change notification settings - Fork 0
/
grammar.w3c-ebnf
129 lines (90 loc) · 2.75 KB
/
grammar.w3c-ebnf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
NonSpaceChar ::= [#x21-#xD7FF] | [#xE000-#xFFFD]
Digit ::= [0-9]
Space ::= ' ' | '\t'
Numeric ::= (Digit* '.')? Digit+
BrowserName ::= 'ie'
| 'edge'
| 'firefox'
| 'chrome'
| 'safari'
| 'opera'
| 'ios_saf'
| 'op_mini'
| 'android'
| 'bb'
| 'op_mob'
| 'and_chr'
| 'and_ff'
| 'ie_mob'
| 'and_uc'
| 'samsung'
| 'and_qq'
| 'baidu'
| 'kaios'
| 'fx'
| 'ff'
| 'ios'
| 'explorer'
| 'blackberry'
| 'explorermobile'
| 'operamini'
| 'operamobile'
| 'chromeandroid'
| 'firefoxandroid'
| 'ucandroid'
| 'qqandroid'
CompareOperator ::= ('>' | '<') '='?
VersionKeyword ::= 'version' 's'?
LastBrowsers ::= 'last' Space+ Digit+ Space+ (BrowserName Space+)? ('major' Space+)? VersionKeyword
LastElectron ::= 'last' Space+ Digit+ Space+ 'electron' Space+ ('major' Space+)? VersionKeyword
LastNode ::= 'last' Space+ Digit+ Space+ 'node' Space+ ('major' Space+)? VersionKeyword
Unreleased ::= 'unreleased' Space+ ((BrowserName | 'electron') Space+)? VersionKeyword
Years ::= 'last' Space+ Numeric Space+ 'year' 's'?
Since ::= 'since' Space Digit+ ('-' Digit+ ('-' Digit+)?)?
Region ::= ('alt-' [a-z][a-z] | [A-Z][A-Z])
MyStats ::= 'my' Space+ 'stats'
CustomStats ::= NonSpaceChar+ Space+ 'stats'
Percentage ::= CompareOperator Space* Numeric '%' (Space+ 'in' Space+ (MyStats | CustomStats | Region))?
Cover ::= 'cover' Space+ Numeric '%' (Space+ 'in' Space+ (MyStats | Region))?
FeatureSupport ::= (('fully' | 'partially') Space+)? 'supports' Space+ ([a-z0-9] | '-')+
Version ::= (Digit | '.')+
BoundedRange ::= Version Space* '-' Space* Version
UnboundedRange ::= CompareOperator Space* Version
Electron ::= 'electron' Space+ (BoundedRange | UnboundedRange | Version)
Node ::= 'node' Space+ (BoundedRange | UnboundedRange | Version)
Browser ::= BrowserName Space+ (BoundedRange | UnboundedRange | Version | 'tp')
FirefoxESR ::= ('firefox' | 'fx' | 'ff') Space+ 'esr'
OperaMini ::= ('operamini' | 'op_mini') Space+ 'all'
CurrentNode ::= 'current' Space+ 'node'
MaintainedNode ::= 'maintained' Space+ 'node' Space+ 'versions'
Phantom ::= 'phantomjs' Space+ ('1.9' | '2.1')
BrowserslistConfig ::= 'browserslist config'
Extending ::= 'extends' Space NonSpaceChar+
Defaults ::= 'defaults'
Dead ::= 'dead'
QueryAtom ::= LastBrowsers
| LastElectron
| LastNode
| Unreleased
| Years
| Since
| Percentage
| Cover
| FeatureSupport
| Electron
| Node
| Browser
| FirefoxESR
| OperaMini
| CurrentNode
| MaintainedNode
| Phantom
| BrowserslistConfig
| Extending
| Defaults
| Dead
SingleQuery ::= ('not' Space)? QueryAtom
OrOperator ::= Space+ 'or' Space+ | Space* ',' Space*
AndOperator ::= Space+ 'and' Space+
BrowserslistQuery ::= QueryAtom ((OrOperator | AndOperator) SingleQuery)*
Root ::= BrowserslistQuery