jexl-lezer 0.1.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.
package/CHANGELOG.md ADDED
@@ -0,0 +1,485 @@
1
+ ## 1.5.4 (2025-09-18)
2
+
3
+ ### Bug fixes
4
+
5
+ Support `this` parameters in function types.
6
+
7
+ ## 1.5.3 (2025-09-09)
8
+
9
+ ### Bug fixes
10
+
11
+ Fix missing highlight tag for `defer` contextual keyword.
12
+
13
+ ## 1.5.2 (2025-09-04)
14
+
15
+ ### Bug fixes
16
+
17
+ Allow `const` casts with old angle-bracket cast syntax.
18
+
19
+ Add support for `import defer` syntax.
20
+
21
+ ## 1.5.1 (2025-04-18)
22
+
23
+ ### Bug fixes
24
+
25
+ Properly highlight `satisfies` as a keyword.
26
+
27
+ ## 1.5.0 (2025-04-17)
28
+
29
+ ### Bug fixes
30
+
31
+ Support `in`/`out` modifiers on TypeScript type parameters.
32
+
33
+ ### New features
34
+
35
+ Support the TypeScript `satisfies` operator.
36
+
37
+ ## 1.4.21 (2024-12-03)
38
+
39
+ ### Bug fixes
40
+
41
+ Add support for `const` modifiers on TypeScript type parameters.
42
+
43
+ Allow TypeScript syntax, where the condition is just a variable.
44
+
45
+ Fix a bug where some TypeScript `<` tokens didn't appear in the syntax tree.
46
+
47
+ ## 1.4.20 (2024-12-02)
48
+
49
+ ### Bug fixes
50
+
51
+ Use the `className` style tag for variable names used as constructors with `new`.
52
+
53
+ Add support for `asserts` syntax in function return types.
54
+
55
+ ## 1.4.19 (2024-10-08)
56
+
57
+ ### Bug fixes
58
+
59
+ Support question marks after method names in TypeScript object type notation.
60
+
61
+ Support bracketed property names in TypeScript object types.
62
+
63
+ Allow TypeScript interface declarations to extend multiple types.
64
+
65
+ ## 1.4.18 (2024-09-17)
66
+
67
+ ### Bug fixes
68
+
69
+ Support `as` syntax in mapped object types.
70
+
71
+ Make sure the parser doesn't get confused when a template interpolation is missing its expression.
72
+
73
+ ## 1.4.17 (2024-06-11)
74
+
75
+ ### Bug fixes
76
+
77
+ Add support for `{-readonly [K in T]-?: U}` TypeScript syntax.
78
+
79
+ ## 1.4.16 (2024-05-04)
80
+
81
+ ### Bug fixes
82
+
83
+ Don't consume `?.` tokens when followed by a digit.
84
+
85
+ Support type arguments on non-call expressions.
86
+
87
+ ## 1.4.15 (2024-04-23)
88
+
89
+ ### Bug fixes
90
+
91
+ Add support for `new.target` syntax.
92
+
93
+ ## 1.4.14 (2024-03-30)
94
+
95
+ ### Bug fixes
96
+
97
+ Recognize the `d` and `v` RegExp flags. Support destructured parameters in function types
98
+
99
+ Allow destructured parameters in function signature types.
100
+
101
+ ## 1.4.13 (2024-01-16)
102
+
103
+ ### Bug fixes
104
+
105
+ Fix inverted relative precedence of `&`, `|`, and `^` bitwise operators.
106
+
107
+ Add an explicit dependency on @lezer/common ^1.2.0.
108
+
109
+ ## 1.4.12 (2024-01-04)
110
+
111
+ ### Bug fixes
112
+
113
+ Mark strings, comments, and interpolations as isolating for bidirectional text.
114
+
115
+ ## 1.4.11 (2023-12-18)
116
+
117
+ ### Bug fixes
118
+
119
+ In TSX mode, parse `<T,>` or `<T extends U>` as type parameters, not JSX tags.
120
+
121
+ ## 1.4.10 (2023-12-06)
122
+
123
+ ### Bug fixes
124
+
125
+ Support `|` and `&` as prefixes in TypeScript types.
126
+
127
+ ## 1.4.9 (2023-10-30)
128
+
129
+ ### Bug fixes
130
+
131
+ Allow `default` to be used in `import`/`export` binding sets.
132
+
133
+ ## 1.4.8 (2023-10-05)
134
+
135
+ ### Bug fixes
136
+
137
+ Properly highlight `using` as a keyword.
138
+
139
+ ## 1.4.7 (2023-08-23)
140
+
141
+ ### Bug fixes
142
+
143
+ Properly parse hashbang comments.
144
+
145
+ ## 1.4.6 (2023-08-22)
146
+
147
+ ### Bug fixes
148
+
149
+ Make sure that, in TypeScript, type argument lists are prefered over comparison operators when both produce valid parses.
150
+
151
+ ## 1.4.5 (2023-07-25)
152
+
153
+ ### Bug fixes
154
+
155
+ Allow the index in a TypeScript indexed type to be any kind of type.
156
+
157
+ ## 1.4.4 (2023-07-03)
158
+
159
+ ### Bug fixes
160
+
161
+ Add support for `using` syntax.
162
+
163
+ Make the package work with new TS resolution styles.
164
+
165
+ ## 1.4.3 (2023-04-24)
166
+
167
+ ### Bug fixes
168
+
169
+ Properly parse `this: Type` within parameter lists for TypeScript.
170
+
171
+ ## 1.4.2 (2023-03-29)
172
+
173
+ ### Bug fixes
174
+
175
+ Properly parse `declare` in front of class properties and methods in TypeScript.
176
+
177
+ ## 1.4.1 (2023-01-09)
178
+
179
+ ### Bug fixes
180
+
181
+ Fix a bug where something like `yield [1]` (or `await`) was parsed as a member expression.
182
+
183
+ Add support for `yield*` syntax.
184
+
185
+ Escapes in strings are now parsed as their own tokens (and styled with the `escape` tag).
186
+
187
+ ## 1.4.0 (2022-12-19)
188
+
189
+ ### New features
190
+
191
+ The new `"SingleClassItem"` top-level rule can be used to parse only a class item (method, property, or static block).
192
+
193
+ ## 1.3.2 (2022-12-14)
194
+
195
+ ### Bug fixes
196
+
197
+ Typescript allows `override` on all class elements, not just methods.
198
+
199
+ Allow expressions in class extends clauses in TypeScript.
200
+
201
+ ## 1.3.1 (2022-11-29)
202
+
203
+ ### Bug fixes
204
+
205
+ Actually emit a tree node for the `@` characters in decorators.
206
+
207
+ ## 1.3.0 (2022-11-28)
208
+
209
+ ### New features
210
+
211
+ Add support for decorator syntax.
212
+
213
+ ## 1.2.0 (2022-11-24)
214
+
215
+ ### New features
216
+
217
+ The grammar now supports `top: "SingleExpression"` to parse an expression rather than a script.
218
+
219
+ ## 1.1.1 (2022-11-19)
220
+
221
+ ### Bug fixes
222
+
223
+ Fix parsing of computed properties in class declarations.
224
+
225
+ ## 1.1.0 (2022-11-17)
226
+
227
+ ### Bug fixes
228
+
229
+ Fix parsing of 'null' as type in TypeScript.
230
+
231
+ Allow computed properties in object destructuring patterns.
232
+
233
+ Add TypeScript 4.9's `satisfies` operator.
234
+
235
+ Support `accessor` syntax on class properties.
236
+
237
+ ### New features
238
+
239
+ Add support for optional call syntax.
240
+
241
+ Distinguish lower-case JSX element names syntactically, give them a `standard(tagName)` highlight tag.
242
+
243
+ ## 1.0.2 (2022-07-21)
244
+
245
+ ### Bug fixes
246
+
247
+ Properly assign a highlighting tag to the `super` keyword.
248
+
249
+ ## 1.0.1 (2022-06-27)
250
+
251
+ ### Bug fixes
252
+
253
+ Fix parsing of TypeScript conditional types.
254
+
255
+ Support type parameters in TypeScript function type syntax.
256
+
257
+ ## 1.0.0 (2022-06-06)
258
+
259
+ ### New features
260
+
261
+ First stable version.
262
+
263
+ ## 0.16.0 (2022-04-20)
264
+
265
+ ### Breaking changes
266
+
267
+ Move to 0.16 serialized parser format.
268
+
269
+ ### Bug fixes
270
+
271
+ Allow commas as separators in TypeScript object type syntax.
272
+
273
+ ### New features
274
+
275
+ Add `CatchClause` and `FinallyClause` nodes wrapping parts of `TryStatement`.
276
+
277
+ The parser now includes syntax highlighting information in its node types.
278
+
279
+ ## 0.15.3 (2022-01-26)
280
+
281
+ ### Bug fixes
282
+
283
+ Support missing values in array pattern syntax.
284
+
285
+ Support quoted module export names.
286
+
287
+ ### New features
288
+
289
+ Template string interpolations now get their own nodes in the syntax tree.
290
+
291
+ ## 0.15.2 (2021-12-08)
292
+
293
+ ### Bug fixes
294
+
295
+ Fix a typo in the `TaggedTemplateExpression` node name. Support n suffixes after non-decimal integers
296
+
297
+ Add support for non-decimal bignum literals ().
298
+
299
+ Add support for static class initialization blocks.
300
+
301
+ ## 0.15.1 (2021-11-12)
302
+
303
+ ### Bug fixes
304
+
305
+ Add support for TypeScript `import {type X} from y` syntax.
306
+
307
+ Indexed TypeScript types can now take type parameters.
308
+
309
+ Add support for private field syntax.
310
+
311
+ Rename PropertyNameDefinition node to PropertyDefinition for consistency with other names.
312
+
313
+ ### New features
314
+
315
+ Recognize TypeScript 4.3's `override` keyword.
316
+
317
+ ## 0.15.0 (2021-08-11)
318
+
319
+ ### Breaking changes
320
+
321
+ The module's name changed from `lezer-javascript` to `@lezer/javascript`.
322
+
323
+ Upgrade to the 0.15.0 lezer interfaces.
324
+
325
+ ## 0.13.4 (2021-04-30)
326
+
327
+ ### Bug fixes
328
+
329
+ Fixes a bug where arrow functions with expression bodies would include commas after the expression.
330
+
331
+ ## 0.13.3 (2021-02-15)
332
+
333
+ ### Bug fixes
334
+
335
+ Wrap escaped JSX attribute values in a `JSXEscape` node.
336
+
337
+ ## 0.13.2 (2021-01-18)
338
+
339
+ ### Bug fixes
340
+
341
+ Fix parsing of async function expressions.
342
+
343
+ ## 0.13.1 (2020-12-04)
344
+
345
+ ### Bug fixes
346
+
347
+ Fix versions of lezer packages depended on.
348
+
349
+ ## 0.13.0 (2020-12-04)
350
+
351
+ ## 0.12.0 (2020-10-23)
352
+
353
+ ### Breaking changes
354
+
355
+ Adjust to changed serialized parser format.
356
+
357
+ ## 0.11.1 (2020-09-26)
358
+
359
+ ### Bug fixes
360
+
361
+ Fix lezer depencency versions
362
+
363
+ ## 0.11.0 (2020-09-26)
364
+
365
+ ### Breaking changes
366
+
367
+ Follow change in serialized parser format.
368
+
369
+ ## 0.10.1 (2020-09-02)
370
+
371
+ ### Bug fixes
372
+
373
+ Fix associativity of `else` and ternary operators.
374
+
375
+ Work around accidental ambiguity of TypeScript method and constructor signatures.
376
+
377
+ Properly parse `??=` as an update operator.
378
+
379
+ ## 0.10.0 (2020-08-07)
380
+
381
+ ### Breaking changes
382
+
383
+ Upgrade to 0.10 parser serialization
384
+
385
+ ### New features
386
+
387
+ The gammar now supports TypeScript (use the `"ts"` dialect).
388
+
389
+ The grammar can now parse JSX syntax (use the `"jsx"` dialect).
390
+
391
+ ## 0.9.1 (2020-06-29)
392
+
393
+ ### Bug fixes
394
+
395
+ Fix accidental use of non-ES5 library methods.
396
+
397
+ ## 0.9.0 (2020-06-08)
398
+
399
+ ### Breaking changes
400
+
401
+ Upgrade to 0.9 parser serialization
402
+
403
+ ## 0.8.4 (2020-05-30)
404
+
405
+ ### Bug fixes
406
+
407
+ Fix the package.json `main` field pointing at the wrong file, breaking the library in node versions older than 13.
408
+
409
+ ## 0.8.3 (2020-04-09)
410
+
411
+ ### Bug fixes
412
+
413
+ Regenerate parser with a fix in lezer-generator so that the top node prop is properly assigned.
414
+
415
+ ## 0.8.2 (2020-04-01)
416
+
417
+ ### Bug fixes
418
+
419
+ Make the package load as an ES module on node
420
+
421
+ ## 0.8.1 (2020-02-28)
422
+
423
+ ### New features
424
+
425
+ Provide an ES module file.
426
+
427
+ ## 0.8.0 (2020-02-03)
428
+
429
+ ### Bug fixes
430
+
431
+ Add support for the spread ... operator in array literals.
432
+
433
+ ### New features
434
+
435
+ Follow 0.8.0 release of the library.
436
+
437
+ Add support for nullish coalescing and optional chaining.
438
+
439
+ ## 0.7.0 (2020-01-20)
440
+
441
+ ### Breaking changes
442
+
443
+ Use the lezer 0.7.0 parser format.
444
+
445
+ ## 0.5.2 (2020-01-15)
446
+
447
+ ### Bug fixes
448
+
449
+ Regenerate with lezer-generator 0.5.2 to avoid cyclic forced reductions.
450
+
451
+ ## 0.5.1 (2019-10-22)
452
+
453
+ ### Bug fixes
454
+
455
+ Fix top prop missing from build output.
456
+
457
+ ## 0.5.0 (2019-10-22)
458
+
459
+ ### Breaking changes
460
+
461
+ Move from `lang` to `top` prop on document node.
462
+
463
+ ## 0.4.0 (2019-09-10)
464
+
465
+ ### Breaking changes
466
+
467
+ Adjust to 0.4.0 parse table format.
468
+
469
+ ## 0.3.0 (2019-08-22)
470
+
471
+ ### New features
472
+
473
+ Go back to node names, add props, follow changes in grammar syntax.
474
+
475
+ ## 0.2.0 (2019-08-02)
476
+
477
+ ### New features
478
+
479
+ Use tags rather than names.
480
+
481
+ ## 0.1.0 (2019-07-09)
482
+
483
+ ### New Features
484
+
485
+ First documented release.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (C) 2018 by Marijn Haverbeke <marijn@haverbeke.berlin> and others
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,14 @@
1
+ # @lezer/javascript
2
+
3
+ This is a JavaScript grammar for the
4
+ [lezer](https://lezer.codemirror.net/) parser system.
5
+
6
+ It parses modern JavaScript, and supports a `"ts"`
7
+ [dialect](https://lezer.codemirror.net/docs/guide/#dialects) to parse
8
+ TypeScript, and a `"jsx"` dialect to parse JSX.
9
+
10
+ The `top` option can be set to `"SingleExpression"` or
11
+ `"SingleClassItem"` to parse an expression or class item instead of a
12
+ full program.
13
+
14
+ The code is licensed under an MIT license.
package/package.json ADDED
@@ -0,0 +1,20 @@
1
+ {
2
+ "name": "jexl-lezer",
3
+ "description": "lezer-based Apache JEXL",
4
+ "version": "0.1.0",
5
+ "type": "module",
6
+ "devDependencies": {
7
+ "@lezer/generator": "^1.7.0",
8
+ "@rollup/plugin-node-resolve": "^9.0.0",
9
+ "mocha": "^10.2.0",
10
+ "rollup": "^2.52.2"
11
+ },
12
+ "dependencies": {
13
+ "@lezer/common": "^1.2.0",
14
+ "@lezer/highlight": "^1.1.3",
15
+ "@lezer/lr": "^1.3.0"
16
+ },
17
+ "scripts": {
18
+ "prepare": "lezer-generator src/jexl.grammar -o src/parser.js"
19
+ }
20
+ }
@@ -0,0 +1,16 @@
1
+ import {nodeResolve} from "@rollup/plugin-node-resolve"
2
+
3
+ export default {
4
+ input: "./src/parser.js",
5
+ output: [{
6
+ format: "cjs",
7
+ file: "./dist/index.cjs"
8
+ }, {
9
+ format: "es",
10
+ file: "./dist/index.js"
11
+ }],
12
+ external(id) { return !/^[\.\/]/.test(id) },
13
+ plugins: [
14
+ nodeResolve()
15
+ ]
16
+ }