jexl-lezer 0.4.1 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,176 +1,177 @@
1
1
  // This file was generated by lezer-generator. You probably shouldn't edit it.
2
2
  export const
3
- noSemi = 318,
4
- noSemiType = 319,
3
+ noSemi = 316,
4
+ noSemiType = 317,
5
5
  incdec = 1,
6
6
  incdecPrefix = 2,
7
7
  questionDot = 3,
8
8
  JSXStartTag = 4,
9
- insertSemi = 320,
10
- spaces = 322,
11
- newline = 323,
9
+ insertSemi = 318,
10
+ spaces = 320,
11
+ newline = 321,
12
12
  LineComment = 5,
13
13
  BlockComment = 6,
14
14
  Script = 7,
15
- ExportDeclaration = 8,
16
- _export = 9,
17
- Star = 10,
18
- as = 11,
19
- VariableName = 12,
20
- String = 13,
21
- Escape = 14,
22
- from = 15,
23
- _default = 17,
24
- FunctionDeclaration = 18,
25
- async = 61,
26
- _function = 20,
27
- VariableDefinition = 21,
28
- TypeParamList = 24,
29
- _const = 25,
30
- TypeDefinition = 26,
31
- _extends = 27,
32
- _this = 29,
33
- Number = 32,
34
- BooleanLiteral = 33,
35
- TemplateType = 34,
36
- InterpolationEnd = 35,
37
- templateType = 36,
38
- InterpolationStart = 37,
39
- _null = 39,
40
- _void = 41,
41
- _typeof = 43,
42
- PropertyName = 46,
43
- TemplateString = 48,
44
- templateEscape = 49,
45
- templateExpr = 50,
46
- _super = 51,
47
- RegExp = 52,
48
- ArrayExpression = 54,
49
- Property = 60,
50
- get = 62,
51
- set = 63,
52
- PropertyDefinition = 64,
53
- Block = 65,
54
- _new = 196,
55
- ArgList = 72,
56
- UnaryExpression = 73,
57
- _delete = 74,
58
- YieldExpression = 77,
59
- _yield = 78,
60
- AwaitExpression = 79,
61
- _await = 80,
62
- ParenthesizedExpression = 81,
63
- ClassExpression = 82,
64
- _class = 83,
65
- ClassBody = 84,
66
- MethodDeclaration = 85,
67
- Decorator = 86,
68
- TypeArgList = 90,
69
- LessThan = 91,
70
- declare = 221,
71
- Privacy = 111,
72
- _static = 234,
73
- abstract = 204,
74
- override = 97,
75
- PropertyDeclaration = 98,
76
- readonly = 112,
77
- accessor = 100,
78
- Optional = 101,
79
- TypeAnnotation = 102,
80
- FunctionExpression = 104,
81
- ArrowFunction = 105,
82
- ParamList = 107,
83
- ArrayPattern = 108,
84
- ObjectPattern = 109,
85
- PatternProperty = 110,
86
- MemberExpression = 115,
87
- BinaryExpression = 116,
88
- divide = 118,
89
- _instanceof = 123,
90
- satisfies = 124,
91
- _in = 125,
92
- questionOp = 133,
93
- AssignmentExpression = 135,
94
- _import = 142,
95
- JSXElement = 144,
96
- JSXSelfCloseEndTag = 145,
97
- JSXSelfClosingTag = 146,
98
- JSXIdentifier = 147,
99
- JSXLowerIdentifier = 149,
100
- JSXNamespacedName = 150,
101
- JSXMemberExpression = 151,
102
- JSXAttributeValue = 154,
103
- JSXEndTag = 156,
104
- JSXOpenTag = 157,
105
- JSXFragmentTag = 158,
106
- JSXText = 159,
107
- JSXEscape = 160,
108
- JSXStartCloseTag = 161,
109
- JSXCloseTag = 162,
110
- tsAngleOpen = 164,
111
- SequenceExpression = 167,
112
- keyof = 170,
113
- unique = 172,
114
- infer = 175,
115
- TypeName = 176,
116
- ParamTypeList = 179,
117
- IndexedType = 181,
118
- Label = 183,
119
- ObjectType = 186,
120
- MethodType = 187,
121
- PropertyType = 188,
122
- IndexSignature = 189,
123
- TypePredicate = 192,
124
- asserts = 193,
125
- is = 194,
126
- unionOp = 198,
127
- intersectionOp = 200,
128
- ClassDeclaration = 203,
129
- _implements = 205,
130
- type = 206,
131
- VariableDeclaration = 207,
132
- _let = 208,
133
- _var = 209,
134
- using = 210,
135
- TypeAliasDeclaration = 211,
136
- InterfaceDeclaration = 212,
137
- _interface = 213,
138
- EnumDeclaration = 214,
139
- _enum = 215,
140
- NamespaceDeclaration = 217,
141
- namespace = 218,
142
- module = 219,
143
- AmbientDeclaration = 220,
144
- global = 223,
145
- ExportGroup = 227,
146
- ImportDeclaration = 230,
147
- ImportGroup = 231,
148
- PragmaDeclaration = 232,
149
- pragma = 233,
150
- PragmaStaticStringClassPath = 235,
151
- ClassPath = 236,
152
- Alias = 237,
153
- _for = 239,
154
- ForSpec = 240,
155
- ForInSpec = 241,
156
- ForOfSpec = 242,
157
- of = 243,
158
- _while = 245,
159
- _with = 247,
160
- _do = 249,
161
- _if = 251,
162
- _else = 252,
163
- _switch = 254,
164
- _case = 257,
165
- _try = 260,
166
- _catch = 262,
167
- _finally = 264,
168
- _return = 266,
169
- _throw = 268,
170
- _break = 270,
171
- _continue = 272,
172
- _debugger = 274,
173
- SingleExpression = 277,
174
- SingleClassItem = 278,
15
+ Hashbang = 8,
16
+ ExportDeclaration = 9,
17
+ _export = 10,
18
+ Star = 11,
19
+ as = 12,
20
+ VariableName = 13,
21
+ String = 14,
22
+ Escape = 15,
23
+ from = 16,
24
+ _default = 18,
25
+ FunctionDeclaration = 19,
26
+ async = 64,
27
+ _function = 21,
28
+ VariableDefinition = 22,
29
+ TypeParamList = 25,
30
+ _in = 26,
31
+ out = 27,
32
+ _const = 28,
33
+ TypeDefinition = 29,
34
+ _extends = 30,
35
+ _this = 32,
36
+ Number = 35,
37
+ BooleanLiteral = 36,
38
+ TemplateType = 37,
39
+ InterpolationEnd = 38,
40
+ templateType = 39,
41
+ InterpolationStart = 40,
42
+ _null = 42,
43
+ _void = 44,
44
+ _typeof = 46,
45
+ PropertyName = 49,
46
+ TemplateString = 51,
47
+ templateEscape = 52,
48
+ templateExpr = 53,
49
+ _super = 54,
50
+ RegExp = 55,
51
+ ArrayExpression = 57,
52
+ Property = 63,
53
+ get = 65,
54
+ set = 66,
55
+ PropertyDefinition = 67,
56
+ Block = 68,
57
+ _new = 200,
58
+ ArgList = 75,
59
+ UnaryExpression = 76,
60
+ _delete = 77,
61
+ YieldExpression = 80,
62
+ _yield = 81,
63
+ AwaitExpression = 82,
64
+ _await = 83,
65
+ ParenthesizedExpression = 84,
66
+ ClassExpression = 85,
67
+ _class = 86,
68
+ ClassBody = 87,
69
+ MethodDeclaration = 88,
70
+ Decorator = 89,
71
+ PrivatePropertyName = 92,
72
+ TypeArgList = 94,
73
+ LessThan = 95,
74
+ declare = 225,
75
+ Privacy = 117,
76
+ _static = 99,
77
+ abstract = 208,
78
+ override = 101,
79
+ PrivatePropertyDefinition = 102,
80
+ PropertyDeclaration = 103,
81
+ readonly = 118,
82
+ accessor = 105,
83
+ Optional = 106,
84
+ TypeAnnotation = 107,
85
+ StaticBlock = 109,
86
+ FunctionExpression = 110,
87
+ ArrowFunction = 111,
88
+ ParamList = 113,
89
+ ArrayPattern = 114,
90
+ ObjectPattern = 115,
91
+ PatternProperty = 116,
92
+ MemberExpression = 120,
93
+ BinaryExpression = 121,
94
+ divide = 123,
95
+ _instanceof = 128,
96
+ satisfies = 129,
97
+ questionOp = 137,
98
+ AssignmentExpression = 139,
99
+ _import = 146,
100
+ JSXElement = 148,
101
+ JSXSelfCloseEndTag = 149,
102
+ JSXSelfClosingTag = 150,
103
+ JSXIdentifier = 151,
104
+ JSXLowerIdentifier = 153,
105
+ JSXNamespacedName = 154,
106
+ JSXMemberExpression = 155,
107
+ JSXAttributeValue = 158,
108
+ JSXEndTag = 160,
109
+ JSXOpenTag = 161,
110
+ JSXFragmentTag = 162,
111
+ JSXText = 163,
112
+ JSXEscape = 164,
113
+ JSXStartCloseTag = 165,
114
+ JSXCloseTag = 166,
115
+ tsAngleOpen = 168,
116
+ SequenceExpression = 171,
117
+ keyof = 174,
118
+ unique = 176,
119
+ infer = 179,
120
+ TypeName = 180,
121
+ ParamTypeList = 183,
122
+ IndexedType = 185,
123
+ Label = 187,
124
+ ObjectType = 190,
125
+ MethodType = 191,
126
+ PropertyType = 192,
127
+ IndexSignature = 193,
128
+ TypePredicate = 196,
129
+ asserts = 197,
130
+ is = 198,
131
+ unionOp = 202,
132
+ intersectionOp = 204,
133
+ ClassDeclaration = 207,
134
+ _implements = 209,
135
+ type = 210,
136
+ VariableDeclaration = 211,
137
+ _let = 212,
138
+ _var = 213,
139
+ using = 214,
140
+ TypeAliasDeclaration = 215,
141
+ InterfaceDeclaration = 216,
142
+ _interface = 217,
143
+ EnumDeclaration = 218,
144
+ _enum = 219,
145
+ NamespaceDeclaration = 221,
146
+ namespace = 222,
147
+ module = 223,
148
+ AmbientDeclaration = 224,
149
+ global = 227,
150
+ ExportGroup = 231,
151
+ ImportDeclaration = 234,
152
+ defer = 235,
153
+ ImportGroup = 236,
154
+ _for = 238,
155
+ ForSpec = 239,
156
+ ForInSpec = 240,
157
+ ForOfSpec = 241,
158
+ of = 242,
159
+ _while = 244,
160
+ _with = 246,
161
+ _do = 248,
162
+ _if = 250,
163
+ _else = 251,
164
+ _switch = 253,
165
+ _case = 256,
166
+ _try = 259,
167
+ _catch = 261,
168
+ _finally = 263,
169
+ _return = 265,
170
+ _throw = 267,
171
+ _break = 269,
172
+ _continue = 271,
173
+ _debugger = 273,
174
+ SingleExpression = 276,
175
+ SingleClassItem = 277,
175
176
  Dialect_jsx = 0,
176
177
  Dialect_ts = 1
@@ -0,0 +1,64 @@
1
+ # Decorators on classes and class fields
2
+
3
+ @d1 class Foo {
4
+ @d2 bar() {}
5
+ @d3 get baz() { return 1 }
6
+ @d4 quux = 1
7
+ }
8
+
9
+ ==>
10
+
11
+ Script(ClassDeclaration(
12
+ Decorator(VariableName),
13
+ class,VariableDefinition,ClassBody(
14
+ MethodDeclaration(Decorator(VariableName),PropertyDefinition,ParamList,Block),
15
+ MethodDeclaration(Decorator(VariableName),get,PropertyDefinition,ParamList,Block(
16
+ ReturnStatement(return,Number))),
17
+ PropertyDeclaration(Decorator(VariableName),PropertyDefinition,Equals,Number))))
18
+
19
+ # Multiple decorators
20
+
21
+ @d1 @d2 class Y {}
22
+
23
+ ==>
24
+
25
+ Script(ClassDeclaration(Decorator(VariableName),Decorator(VariableName),class,VariableDefinition,ClassBody))
26
+
27
+ # Member decorators
28
+
29
+ @one.two class X {}
30
+
31
+ ==>
32
+
33
+ Script(ClassDeclaration(Decorator(MemberExpression(VariableName,PropertyName)),class,VariableDefinition,ClassBody))
34
+
35
+ # Call decorators
36
+
37
+ @d(2) @a.b() class Z {}
38
+
39
+ ==>
40
+
41
+ Script(ClassDeclaration(
42
+ Decorator(CallExpression(VariableName,ArgList(Number))),
43
+ Decorator(CallExpression(MemberExpression(VariableName,PropertyName),ArgList)),
44
+ class,VariableDefinition,ClassBody))
45
+
46
+ # Parenthesized decorators
47
+
48
+ @(a instanceof Array ? x : y)(2) class P {}
49
+
50
+ ==>
51
+
52
+ Script(ClassDeclaration(
53
+ Decorator(CallExpression(ParenthesizedExpression(
54
+ ConditionalExpression(BinaryExpression(VariableName,instanceof,VariableName),LogicOp,VariableName,LogicOp,VariableName)),
55
+ ArgList(Number))),
56
+ class,VariableDefinition,ClassBody))
57
+
58
+ # Parameter decorators
59
+
60
+ function foo(@d bar) {}
61
+
62
+ ==>
63
+
64
+ Script(FunctionDeclaration(function,VariableDefinition,ParamList(Decorator(VariableName),VariableDefinition),Block))