@pyscript/core 0.6.9 → 0.6.11

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.
Files changed (86) hide show
  1. package/dist/codemirror-CAEZ6Sg7.js +2 -0
  2. package/dist/{codemirror-1dOfKU91.js.map → codemirror-CAEZ6Sg7.js.map} +1 -1
  3. package/dist/codemirror_commands-BPM8HxXO.js +2 -0
  4. package/dist/{codemirror_commands-CKMxnUcp.js.map → codemirror_commands-BPM8HxXO.js.map} +1 -1
  5. package/dist/codemirror_lang-python-DvjhpaK2.js +2 -0
  6. package/dist/{codemirror_lang-python-D9DYtDWr.js.map → codemirror_lang-python-DvjhpaK2.js.map} +1 -1
  7. package/dist/codemirror_language-4kk4Aqm3.js +2 -0
  8. package/dist/{codemirror_language-B5lTPv2c.js.map → codemirror_language-4kk4Aqm3.js.map} +1 -1
  9. package/dist/codemirror_state-1d1uncXx.js +2 -0
  10. package/dist/{codemirror_state-n1sFh2hh.js.map → codemirror_state-1d1uncXx.js.map} +1 -1
  11. package/dist/codemirror_view-aIuSN42d.js +2 -0
  12. package/dist/{codemirror_view-1a1gCrKZ.js.map → codemirror_view-aIuSN42d.js.map} +1 -1
  13. package/dist/core-hN7rJB9q.js +2 -0
  14. package/dist/core-hN7rJB9q.js.map +1 -0
  15. package/dist/core.css +1 -75
  16. package/dist/core.js +1 -1
  17. package/dist/deprecations-manager-DTY9DgQj.js +2 -0
  18. package/dist/deprecations-manager-DTY9DgQj.js.map +1 -0
  19. package/dist/donkey-DHUqA8KM.js +2 -0
  20. package/dist/{donkey-Cc8svH2Q.js.map → donkey-DHUqA8KM.js.map} +1 -1
  21. package/dist/error-CL2MCT5A.js +2 -0
  22. package/dist/error-CL2MCT5A.js.map +1 -0
  23. package/dist/index-DqgFLybq.js +2 -0
  24. package/dist/{index-BVFrv_QY.js.map → index-DqgFLybq.js.map} +1 -1
  25. package/dist/mpy-CMrxRmg5.js +2 -0
  26. package/dist/{mpy-CQiuZcjW.js.map → mpy-CMrxRmg5.js.map} +1 -1
  27. package/dist/py-BE0TtYqn.js +2 -0
  28. package/dist/{py-BgH4mprx.js.map → py-BE0TtYqn.js.map} +1 -1
  29. package/dist/py-editor-ChUKHNHb.js +2 -0
  30. package/dist/{py-editor-Dzsa3rsF.js.map → py-editor-ChUKHNHb.js.map} +1 -1
  31. package/dist/py-terminal-lpYLTFln.js +2 -0
  32. package/dist/{py-terminal-BX_wPoTi.js.map → py-terminal-lpYLTFln.js.map} +1 -1
  33. package/dist/storage.js +1 -421
  34. package/dist/storage.js.map +1 -1
  35. package/dist/toml-CvAfdf9_.js +3 -0
  36. package/dist/toml-CvAfdf9_.js.map +1 -0
  37. package/dist/toml-DiUM0_qs.js +3 -0
  38. package/dist/{toml-CkEFU7ly.js.map → toml-DiUM0_qs.js.map} +1 -1
  39. package/dist/xterm-BY7uk_OU.js +2 -0
  40. package/dist/xterm-BY7uk_OU.js.map +1 -0
  41. package/dist/xterm-readline-CZfBw7ic.js +2 -0
  42. package/dist/xterm-readline-CZfBw7ic.js.map +1 -0
  43. package/dist/xterm_addon-fit--gyF3PcZ.js +2 -0
  44. package/dist/xterm_addon-fit--gyF3PcZ.js.map +1 -0
  45. package/dist/xterm_addon-web-links-Cnej-nJ6.js +2 -0
  46. package/dist/xterm_addon-web-links-Cnej-nJ6.js.map +1 -0
  47. package/dist/zip-Bf48tRr5.js +2 -0
  48. package/dist/zip-Bf48tRr5.js.map +1 -0
  49. package/package.json +1 -1
  50. package/src/core.js +4 -2
  51. package/src/plugins/deprecations-manager.js +2 -1
  52. package/src/plugins/error.js +2 -0
  53. package/src/plugins/py-terminal/mpy.js +1 -1
  54. package/src/plugins/py-terminal/py.js +1 -1
  55. package/src/stdlib/pyscript.js +13 -13
  56. package/dist/codemirror-1dOfKU91.js +0 -1832
  57. package/dist/codemirror_commands-CKMxnUcp.js +0 -1714
  58. package/dist/codemirror_lang-python-D9DYtDWr.js +0 -2462
  59. package/dist/codemirror_language-B5lTPv2c.js +0 -5337
  60. package/dist/codemirror_state-n1sFh2hh.js +0 -3930
  61. package/dist/codemirror_view-1a1gCrKZ.js +0 -11428
  62. package/dist/core-D2ytnMSk.js +0 -4349
  63. package/dist/core-D2ytnMSk.js.map +0 -1
  64. package/dist/deprecations-manager-Cf_aFUPK.js +0 -29
  65. package/dist/deprecations-manager-Cf_aFUPK.js.map +0 -1
  66. package/dist/donkey-Cc8svH2Q.js +0 -170
  67. package/dist/error-DWoeKPDI.js +0 -59
  68. package/dist/error-DWoeKPDI.js.map +0 -1
  69. package/dist/index-BVFrv_QY.js +0 -1911
  70. package/dist/mpy-CQiuZcjW.js +0 -255
  71. package/dist/py-BgH4mprx.js +0 -182
  72. package/dist/py-editor-Dzsa3rsF.js +0 -433
  73. package/dist/py-terminal-BX_wPoTi.js +0 -61
  74. package/dist/toml-CkEFU7ly.js +0 -103
  75. package/dist/toml-DTuPg5as.js +0 -5
  76. package/dist/toml-DTuPg5as.js.map +0 -1
  77. package/dist/xterm-eU6F6YKE.js +0 -10
  78. package/dist/xterm-eU6F6YKE.js.map +0 -1
  79. package/dist/xterm-readline-C7HDczqS.js +0 -501
  80. package/dist/xterm-readline-C7HDczqS.js.map +0 -1
  81. package/dist/xterm_addon-fit-Cotzxdkz.js +0 -10
  82. package/dist/xterm_addon-fit-Cotzxdkz.js.map +0 -1
  83. package/dist/xterm_addon-web-links-DoNfCjeX.js +0 -10
  84. package/dist/xterm_addon-web-links-DoNfCjeX.js.map +0 -1
  85. package/dist/zip-Cj6c-tjp.js +0 -13
  86. package/dist/zip-Cj6c-tjp.js.map +0 -1
@@ -1,2462 +0,0 @@
1
- import { P as Parser, N as NodeSet, a as NodeType, D as DefaultBufferLength, b as NodeProp, T as Tree, I as IterMode, c as styleTags, t as tags, s as syntaxTree, L as LRLanguage, d as indentNodeProp, e as delimitedIndent, f as foldNodeProp, g as foldInside, h as LanguageSupport, j as NodeWeakMap } from './codemirror_language-B5lTPv2c.js';
2
- import { i as ifNotIn, c as completeFromList, s as snippetCompletion } from './index-BVFrv_QY.js';
3
- import './codemirror_state-n1sFh2hh.js';
4
- import './codemirror_view-1a1gCrKZ.js';
5
-
6
- /**
7
- A parse stack. These are used internally by the parser to track
8
- parsing progress. They also provide some properties and methods
9
- that external code such as a tokenizer can use to get information
10
- about the parse state.
11
- */
12
- class Stack {
13
- /**
14
- @internal
15
- */
16
- constructor(
17
- /**
18
- The parse that this stack is part of @internal
19
- */
20
- p,
21
- /**
22
- Holds state, input pos, buffer index triplets for all but the
23
- top state @internal
24
- */
25
- stack,
26
- /**
27
- The current parse state @internal
28
- */
29
- state,
30
- // The position at which the next reduce should take place. This
31
- // can be less than `this.pos` when skipped expressions have been
32
- // added to the stack (which should be moved outside of the next
33
- // reduction)
34
- /**
35
- @internal
36
- */
37
- reducePos,
38
- /**
39
- The input position up to which this stack has parsed.
40
- */
41
- pos,
42
- /**
43
- The dynamic score of the stack, including dynamic precedence
44
- and error-recovery penalties
45
- @internal
46
- */
47
- score,
48
- // The output buffer. Holds (type, start, end, size) quads
49
- // representing nodes created by the parser, where `size` is
50
- // amount of buffer array entries covered by this node.
51
- /**
52
- @internal
53
- */
54
- buffer,
55
- // The base offset of the buffer. When stacks are split, the split
56
- // instance shared the buffer history with its parent up to
57
- // `bufferBase`, which is the absolute offset (including the
58
- // offset of previous splits) into the buffer at which this stack
59
- // starts writing.
60
- /**
61
- @internal
62
- */
63
- bufferBase,
64
- /**
65
- @internal
66
- */
67
- curContext,
68
- /**
69
- @internal
70
- */
71
- lookAhead = 0,
72
- // A parent stack from which this was split off, if any. This is
73
- // set up so that it always points to a stack that has some
74
- // additional buffer content, never to a stack with an equal
75
- // `bufferBase`.
76
- /**
77
- @internal
78
- */
79
- parent) {
80
- this.p = p;
81
- this.stack = stack;
82
- this.state = state;
83
- this.reducePos = reducePos;
84
- this.pos = pos;
85
- this.score = score;
86
- this.buffer = buffer;
87
- this.bufferBase = bufferBase;
88
- this.curContext = curContext;
89
- this.lookAhead = lookAhead;
90
- this.parent = parent;
91
- }
92
- /**
93
- @internal
94
- */
95
- toString() {
96
- return `[${this.stack.filter((_, i) => i % 3 == 0).concat(this.state)}]@${this.pos}${this.score ? "!" + this.score : ""}`;
97
- }
98
- // Start an empty stack
99
- /**
100
- @internal
101
- */
102
- static start(p, state, pos = 0) {
103
- let cx = p.parser.context;
104
- return new Stack(p, [], state, pos, pos, 0, [], 0, cx ? new StackContext(cx, cx.start) : null, 0, null);
105
- }
106
- /**
107
- The stack's current [context](#lr.ContextTracker) value, if
108
- any. Its type will depend on the context tracker's type
109
- parameter, or it will be `null` if there is no context
110
- tracker.
111
- */
112
- get context() { return this.curContext ? this.curContext.context : null; }
113
- // Push a state onto the stack, tracking its start position as well
114
- // as the buffer base at that point.
115
- /**
116
- @internal
117
- */
118
- pushState(state, start) {
119
- this.stack.push(this.state, start, this.bufferBase + this.buffer.length);
120
- this.state = state;
121
- }
122
- // Apply a reduce action
123
- /**
124
- @internal
125
- */
126
- reduce(action) {
127
- var _a;
128
- let depth = action >> 19 /* Action.ReduceDepthShift */, type = action & 65535 /* Action.ValueMask */;
129
- let { parser } = this.p;
130
- let lookaheadRecord = this.reducePos < this.pos - 25 /* Lookahead.Margin */;
131
- if (lookaheadRecord)
132
- this.setLookAhead(this.pos);
133
- let dPrec = parser.dynamicPrecedence(type);
134
- if (dPrec)
135
- this.score += dPrec;
136
- if (depth == 0) {
137
- this.pushState(parser.getGoto(this.state, type, true), this.reducePos);
138
- // Zero-depth reductions are a special case—they add stuff to
139
- // the stack without popping anything off.
140
- if (type < parser.minRepeatTerm)
141
- this.storeNode(type, this.reducePos, this.reducePos, lookaheadRecord ? 8 : 4, true);
142
- this.reduceContext(type, this.reducePos);
143
- return;
144
- }
145
- // Find the base index into `this.stack`, content after which will
146
- // be dropped. Note that with `StayFlag` reductions we need to
147
- // consume two extra frames (the dummy parent node for the skipped
148
- // expression and the state that we'll be staying in, which should
149
- // be moved to `this.state`).
150
- let base = this.stack.length - ((depth - 1) * 3) - (action & 262144 /* Action.StayFlag */ ? 6 : 0);
151
- let start = base ? this.stack[base - 2] : this.p.ranges[0].from, size = this.reducePos - start;
152
- // This is a kludge to try and detect overly deep left-associative
153
- // trees, which will not increase the parse stack depth and thus
154
- // won't be caught by the regular stack-depth limit check.
155
- if (size >= 2000 /* Recover.MinBigReduction */ && !((_a = this.p.parser.nodeSet.types[type]) === null || _a === void 0 ? void 0 : _a.isAnonymous)) {
156
- if (start == this.p.lastBigReductionStart) {
157
- this.p.bigReductionCount++;
158
- this.p.lastBigReductionSize = size;
159
- }
160
- else if (this.p.lastBigReductionSize < size) {
161
- this.p.bigReductionCount = 1;
162
- this.p.lastBigReductionStart = start;
163
- this.p.lastBigReductionSize = size;
164
- }
165
- }
166
- let bufferBase = base ? this.stack[base - 1] : 0, count = this.bufferBase + this.buffer.length - bufferBase;
167
- // Store normal terms or `R -> R R` repeat reductions
168
- if (type < parser.minRepeatTerm || (action & 131072 /* Action.RepeatFlag */)) {
169
- let pos = parser.stateFlag(this.state, 1 /* StateFlag.Skipped */) ? this.pos : this.reducePos;
170
- this.storeNode(type, start, pos, count + 4, true);
171
- }
172
- if (action & 262144 /* Action.StayFlag */) {
173
- this.state = this.stack[base];
174
- }
175
- else {
176
- let baseStateID = this.stack[base - 3];
177
- this.state = parser.getGoto(baseStateID, type, true);
178
- }
179
- while (this.stack.length > base)
180
- this.stack.pop();
181
- this.reduceContext(type, start);
182
- }
183
- // Shift a value into the buffer
184
- /**
185
- @internal
186
- */
187
- storeNode(term, start, end, size = 4, mustSink = false) {
188
- if (term == 0 /* Term.Err */ &&
189
- (!this.stack.length || this.stack[this.stack.length - 1] < this.buffer.length + this.bufferBase)) {
190
- // Try to omit/merge adjacent error nodes
191
- let cur = this, top = this.buffer.length;
192
- if (top == 0 && cur.parent) {
193
- top = cur.bufferBase - cur.parent.bufferBase;
194
- cur = cur.parent;
195
- }
196
- if (top > 0 && cur.buffer[top - 4] == 0 /* Term.Err */ && cur.buffer[top - 1] > -1) {
197
- if (start == end)
198
- return;
199
- if (cur.buffer[top - 2] >= start) {
200
- cur.buffer[top - 2] = end;
201
- return;
202
- }
203
- }
204
- }
205
- if (!mustSink || this.pos == end) { // Simple case, just append
206
- this.buffer.push(term, start, end, size);
207
- }
208
- else { // There may be skipped nodes that have to be moved forward
209
- let index = this.buffer.length;
210
- if (index > 0 && this.buffer[index - 4] != 0 /* Term.Err */) {
211
- let mustMove = false;
212
- for (let scan = index; scan > 0 && this.buffer[scan - 2] > end; scan -= 4) {
213
- if (this.buffer[scan - 1] >= 0) {
214
- mustMove = true;
215
- break;
216
- }
217
- }
218
- if (mustMove)
219
- while (index > 0 && this.buffer[index - 2] > end) {
220
- // Move this record forward
221
- this.buffer[index] = this.buffer[index - 4];
222
- this.buffer[index + 1] = this.buffer[index - 3];
223
- this.buffer[index + 2] = this.buffer[index - 2];
224
- this.buffer[index + 3] = this.buffer[index - 1];
225
- index -= 4;
226
- if (size > 4)
227
- size -= 4;
228
- }
229
- }
230
- this.buffer[index] = term;
231
- this.buffer[index + 1] = start;
232
- this.buffer[index + 2] = end;
233
- this.buffer[index + 3] = size;
234
- }
235
- }
236
- // Apply a shift action
237
- /**
238
- @internal
239
- */
240
- shift(action, type, start, end) {
241
- if (action & 131072 /* Action.GotoFlag */) {
242
- this.pushState(action & 65535 /* Action.ValueMask */, this.pos);
243
- }
244
- else if ((action & 262144 /* Action.StayFlag */) == 0) { // Regular shift
245
- let nextState = action, { parser } = this.p;
246
- if (end > this.pos || type <= parser.maxNode) {
247
- this.pos = end;
248
- if (!parser.stateFlag(nextState, 1 /* StateFlag.Skipped */))
249
- this.reducePos = end;
250
- }
251
- this.pushState(nextState, start);
252
- this.shiftContext(type, start);
253
- if (type <= parser.maxNode)
254
- this.buffer.push(type, start, end, 4);
255
- }
256
- else { // Shift-and-stay, which means this is a skipped token
257
- this.pos = end;
258
- this.shiftContext(type, start);
259
- if (type <= this.p.parser.maxNode)
260
- this.buffer.push(type, start, end, 4);
261
- }
262
- }
263
- // Apply an action
264
- /**
265
- @internal
266
- */
267
- apply(action, next, nextStart, nextEnd) {
268
- if (action & 65536 /* Action.ReduceFlag */)
269
- this.reduce(action);
270
- else
271
- this.shift(action, next, nextStart, nextEnd);
272
- }
273
- // Add a prebuilt (reused) node into the buffer.
274
- /**
275
- @internal
276
- */
277
- useNode(value, next) {
278
- let index = this.p.reused.length - 1;
279
- if (index < 0 || this.p.reused[index] != value) {
280
- this.p.reused.push(value);
281
- index++;
282
- }
283
- let start = this.pos;
284
- this.reducePos = this.pos = start + value.length;
285
- this.pushState(next, start);
286
- this.buffer.push(index, start, this.reducePos, -1 /* size == -1 means this is a reused value */);
287
- if (this.curContext)
288
- this.updateContext(this.curContext.tracker.reuse(this.curContext.context, value, this, this.p.stream.reset(this.pos - value.length)));
289
- }
290
- // Split the stack. Due to the buffer sharing and the fact
291
- // that `this.stack` tends to stay quite shallow, this isn't very
292
- // expensive.
293
- /**
294
- @internal
295
- */
296
- split() {
297
- let parent = this;
298
- let off = parent.buffer.length;
299
- // Because the top of the buffer (after this.pos) may be mutated
300
- // to reorder reductions and skipped tokens, and shared buffers
301
- // should be immutable, this copies any outstanding skipped tokens
302
- // to the new buffer, and puts the base pointer before them.
303
- while (off > 0 && parent.buffer[off - 2] > parent.reducePos)
304
- off -= 4;
305
- let buffer = parent.buffer.slice(off), base = parent.bufferBase + off;
306
- // Make sure parent points to an actual parent with content, if there is such a parent.
307
- while (parent && base == parent.bufferBase)
308
- parent = parent.parent;
309
- return new Stack(this.p, this.stack.slice(), this.state, this.reducePos, this.pos, this.score, buffer, base, this.curContext, this.lookAhead, parent);
310
- }
311
- // Try to recover from an error by 'deleting' (ignoring) one token.
312
- /**
313
- @internal
314
- */
315
- recoverByDelete(next, nextEnd) {
316
- let isNode = next <= this.p.parser.maxNode;
317
- if (isNode)
318
- this.storeNode(next, this.pos, nextEnd, 4);
319
- this.storeNode(0 /* Term.Err */, this.pos, nextEnd, isNode ? 8 : 4);
320
- this.pos = this.reducePos = nextEnd;
321
- this.score -= 190 /* Recover.Delete */;
322
- }
323
- /**
324
- Check if the given term would be able to be shifted (optionally
325
- after some reductions) on this stack. This can be useful for
326
- external tokenizers that want to make sure they only provide a
327
- given token when it applies.
328
- */
329
- canShift(term) {
330
- for (let sim = new SimulatedStack(this);;) {
331
- let action = this.p.parser.stateSlot(sim.state, 4 /* ParseState.DefaultReduce */) || this.p.parser.hasAction(sim.state, term);
332
- if (action == 0)
333
- return false;
334
- if ((action & 65536 /* Action.ReduceFlag */) == 0)
335
- return true;
336
- sim.reduce(action);
337
- }
338
- }
339
- // Apply up to Recover.MaxNext recovery actions that conceptually
340
- // inserts some missing token or rule.
341
- /**
342
- @internal
343
- */
344
- recoverByInsert(next) {
345
- if (this.stack.length >= 300 /* Recover.MaxInsertStackDepth */)
346
- return [];
347
- let nextStates = this.p.parser.nextStates(this.state);
348
- if (nextStates.length > 4 /* Recover.MaxNext */ << 1 || this.stack.length >= 120 /* Recover.DampenInsertStackDepth */) {
349
- let best = [];
350
- for (let i = 0, s; i < nextStates.length; i += 2) {
351
- if ((s = nextStates[i + 1]) != this.state && this.p.parser.hasAction(s, next))
352
- best.push(nextStates[i], s);
353
- }
354
- if (this.stack.length < 120 /* Recover.DampenInsertStackDepth */)
355
- for (let i = 0; best.length < 4 /* Recover.MaxNext */ << 1 && i < nextStates.length; i += 2) {
356
- let s = nextStates[i + 1];
357
- if (!best.some((v, i) => (i & 1) && v == s))
358
- best.push(nextStates[i], s);
359
- }
360
- nextStates = best;
361
- }
362
- let result = [];
363
- for (let i = 0; i < nextStates.length && result.length < 4 /* Recover.MaxNext */; i += 2) {
364
- let s = nextStates[i + 1];
365
- if (s == this.state)
366
- continue;
367
- let stack = this.split();
368
- stack.pushState(s, this.pos);
369
- stack.storeNode(0 /* Term.Err */, stack.pos, stack.pos, 4, true);
370
- stack.shiftContext(nextStates[i], this.pos);
371
- stack.reducePos = this.pos;
372
- stack.score -= 200 /* Recover.Insert */;
373
- result.push(stack);
374
- }
375
- return result;
376
- }
377
- // Force a reduce, if possible. Return false if that can't
378
- // be done.
379
- /**
380
- @internal
381
- */
382
- forceReduce() {
383
- let { parser } = this.p;
384
- let reduce = parser.stateSlot(this.state, 5 /* ParseState.ForcedReduce */);
385
- if ((reduce & 65536 /* Action.ReduceFlag */) == 0)
386
- return false;
387
- if (!parser.validAction(this.state, reduce)) {
388
- let depth = reduce >> 19 /* Action.ReduceDepthShift */, term = reduce & 65535 /* Action.ValueMask */;
389
- let target = this.stack.length - depth * 3;
390
- if (target < 0 || parser.getGoto(this.stack[target], term, false) < 0) {
391
- let backup = this.findForcedReduction();
392
- if (backup == null)
393
- return false;
394
- reduce = backup;
395
- }
396
- this.storeNode(0 /* Term.Err */, this.pos, this.pos, 4, true);
397
- this.score -= 100 /* Recover.Reduce */;
398
- }
399
- this.reducePos = this.pos;
400
- this.reduce(reduce);
401
- return true;
402
- }
403
- /**
404
- Try to scan through the automaton to find some kind of reduction
405
- that can be applied. Used when the regular ForcedReduce field
406
- isn't a valid action. @internal
407
- */
408
- findForcedReduction() {
409
- let { parser } = this.p, seen = [];
410
- let explore = (state, depth) => {
411
- if (seen.includes(state))
412
- return;
413
- seen.push(state);
414
- return parser.allActions(state, (action) => {
415
- if (action & (262144 /* Action.StayFlag */ | 131072 /* Action.GotoFlag */)) ;
416
- else if (action & 65536 /* Action.ReduceFlag */) {
417
- let rDepth = (action >> 19 /* Action.ReduceDepthShift */) - depth;
418
- if (rDepth > 1) {
419
- let term = action & 65535 /* Action.ValueMask */, target = this.stack.length - rDepth * 3;
420
- if (target >= 0 && parser.getGoto(this.stack[target], term, false) >= 0)
421
- return (rDepth << 19 /* Action.ReduceDepthShift */) | 65536 /* Action.ReduceFlag */ | term;
422
- }
423
- }
424
- else {
425
- let found = explore(action, depth + 1);
426
- if (found != null)
427
- return found;
428
- }
429
- });
430
- };
431
- return explore(this.state, 0);
432
- }
433
- /**
434
- @internal
435
- */
436
- forceAll() {
437
- while (!this.p.parser.stateFlag(this.state, 2 /* StateFlag.Accepting */)) {
438
- if (!this.forceReduce()) {
439
- this.storeNode(0 /* Term.Err */, this.pos, this.pos, 4, true);
440
- break;
441
- }
442
- }
443
- return this;
444
- }
445
- /**
446
- Check whether this state has no further actions (assumed to be a direct descendant of the
447
- top state, since any other states must be able to continue
448
- somehow). @internal
449
- */
450
- get deadEnd() {
451
- if (this.stack.length != 3)
452
- return false;
453
- let { parser } = this.p;
454
- return parser.data[parser.stateSlot(this.state, 1 /* ParseState.Actions */)] == 65535 /* Seq.End */ &&
455
- !parser.stateSlot(this.state, 4 /* ParseState.DefaultReduce */);
456
- }
457
- /**
458
- Restart the stack (put it back in its start state). Only safe
459
- when this.stack.length == 3 (state is directly below the top
460
- state). @internal
461
- */
462
- restart() {
463
- this.storeNode(0 /* Term.Err */, this.pos, this.pos, 4, true);
464
- this.state = this.stack[0];
465
- this.stack.length = 0;
466
- }
467
- /**
468
- @internal
469
- */
470
- sameState(other) {
471
- if (this.state != other.state || this.stack.length != other.stack.length)
472
- return false;
473
- for (let i = 0; i < this.stack.length; i += 3)
474
- if (this.stack[i] != other.stack[i])
475
- return false;
476
- return true;
477
- }
478
- /**
479
- Get the parser used by this stack.
480
- */
481
- get parser() { return this.p.parser; }
482
- /**
483
- Test whether a given dialect (by numeric ID, as exported from
484
- the terms file) is enabled.
485
- */
486
- dialectEnabled(dialectID) { return this.p.parser.dialect.flags[dialectID]; }
487
- shiftContext(term, start) {
488
- if (this.curContext)
489
- this.updateContext(this.curContext.tracker.shift(this.curContext.context, term, this, this.p.stream.reset(start)));
490
- }
491
- reduceContext(term, start) {
492
- if (this.curContext)
493
- this.updateContext(this.curContext.tracker.reduce(this.curContext.context, term, this, this.p.stream.reset(start)));
494
- }
495
- /**
496
- @internal
497
- */
498
- emitContext() {
499
- let last = this.buffer.length - 1;
500
- if (last < 0 || this.buffer[last] != -3)
501
- this.buffer.push(this.curContext.hash, this.pos, this.pos, -3);
502
- }
503
- /**
504
- @internal
505
- */
506
- emitLookAhead() {
507
- let last = this.buffer.length - 1;
508
- if (last < 0 || this.buffer[last] != -4)
509
- this.buffer.push(this.lookAhead, this.pos, this.pos, -4);
510
- }
511
- updateContext(context) {
512
- if (context != this.curContext.context) {
513
- let newCx = new StackContext(this.curContext.tracker, context);
514
- if (newCx.hash != this.curContext.hash)
515
- this.emitContext();
516
- this.curContext = newCx;
517
- }
518
- }
519
- /**
520
- @internal
521
- */
522
- setLookAhead(lookAhead) {
523
- if (lookAhead > this.lookAhead) {
524
- this.emitLookAhead();
525
- this.lookAhead = lookAhead;
526
- }
527
- }
528
- /**
529
- @internal
530
- */
531
- close() {
532
- if (this.curContext && this.curContext.tracker.strict)
533
- this.emitContext();
534
- if (this.lookAhead > 0)
535
- this.emitLookAhead();
536
- }
537
- }
538
- class StackContext {
539
- constructor(tracker, context) {
540
- this.tracker = tracker;
541
- this.context = context;
542
- this.hash = tracker.strict ? tracker.hash(context) : 0;
543
- }
544
- }
545
- // Used to cheaply run some reductions to scan ahead without mutating
546
- // an entire stack
547
- class SimulatedStack {
548
- constructor(start) {
549
- this.start = start;
550
- this.state = start.state;
551
- this.stack = start.stack;
552
- this.base = this.stack.length;
553
- }
554
- reduce(action) {
555
- let term = action & 65535 /* Action.ValueMask */, depth = action >> 19 /* Action.ReduceDepthShift */;
556
- if (depth == 0) {
557
- if (this.stack == this.start.stack)
558
- this.stack = this.stack.slice();
559
- this.stack.push(this.state, 0, 0);
560
- this.base += 3;
561
- }
562
- else {
563
- this.base -= (depth - 1) * 3;
564
- }
565
- let goto = this.start.p.parser.getGoto(this.stack[this.base - 3], term, true);
566
- this.state = goto;
567
- }
568
- }
569
- // This is given to `Tree.build` to build a buffer, and encapsulates
570
- // the parent-stack-walking necessary to read the nodes.
571
- class StackBufferCursor {
572
- constructor(stack, pos, index) {
573
- this.stack = stack;
574
- this.pos = pos;
575
- this.index = index;
576
- this.buffer = stack.buffer;
577
- if (this.index == 0)
578
- this.maybeNext();
579
- }
580
- static create(stack, pos = stack.bufferBase + stack.buffer.length) {
581
- return new StackBufferCursor(stack, pos, pos - stack.bufferBase);
582
- }
583
- maybeNext() {
584
- let next = this.stack.parent;
585
- if (next != null) {
586
- this.index = this.stack.bufferBase - next.bufferBase;
587
- this.stack = next;
588
- this.buffer = next.buffer;
589
- }
590
- }
591
- get id() { return this.buffer[this.index - 4]; }
592
- get start() { return this.buffer[this.index - 3]; }
593
- get end() { return this.buffer[this.index - 2]; }
594
- get size() { return this.buffer[this.index - 1]; }
595
- next() {
596
- this.index -= 4;
597
- this.pos -= 4;
598
- if (this.index == 0)
599
- this.maybeNext();
600
- }
601
- fork() {
602
- return new StackBufferCursor(this.stack, this.pos, this.index);
603
- }
604
- }
605
-
606
- // See lezer-generator/src/encode.ts for comments about the encoding
607
- // used here
608
- function decodeArray(input, Type = Uint16Array) {
609
- if (typeof input != "string")
610
- return input;
611
- let array = null;
612
- for (let pos = 0, out = 0; pos < input.length;) {
613
- let value = 0;
614
- for (;;) {
615
- let next = input.charCodeAt(pos++), stop = false;
616
- if (next == 126 /* Encode.BigValCode */) {
617
- value = 65535 /* Encode.BigVal */;
618
- break;
619
- }
620
- if (next >= 92 /* Encode.Gap2 */)
621
- next--;
622
- if (next >= 34 /* Encode.Gap1 */)
623
- next--;
624
- let digit = next - 32 /* Encode.Start */;
625
- if (digit >= 46 /* Encode.Base */) {
626
- digit -= 46 /* Encode.Base */;
627
- stop = true;
628
- }
629
- value += digit;
630
- if (stop)
631
- break;
632
- value *= 46 /* Encode.Base */;
633
- }
634
- if (array)
635
- array[out++] = value;
636
- else
637
- array = new Type(value);
638
- }
639
- return array;
640
- }
641
-
642
- class CachedToken {
643
- constructor() {
644
- this.start = -1;
645
- this.value = -1;
646
- this.end = -1;
647
- this.extended = -1;
648
- this.lookAhead = 0;
649
- this.mask = 0;
650
- this.context = 0;
651
- }
652
- }
653
- const nullToken = new CachedToken;
654
- /**
655
- [Tokenizers](#lr.ExternalTokenizer) interact with the input
656
- through this interface. It presents the input as a stream of
657
- characters, tracking lookahead and hiding the complexity of
658
- [ranges](#common.Parser.parse^ranges) from tokenizer code.
659
- */
660
- class InputStream {
661
- /**
662
- @internal
663
- */
664
- constructor(
665
- /**
666
- @internal
667
- */
668
- input,
669
- /**
670
- @internal
671
- */
672
- ranges) {
673
- this.input = input;
674
- this.ranges = ranges;
675
- /**
676
- @internal
677
- */
678
- this.chunk = "";
679
- /**
680
- @internal
681
- */
682
- this.chunkOff = 0;
683
- /**
684
- Backup chunk
685
- */
686
- this.chunk2 = "";
687
- this.chunk2Pos = 0;
688
- /**
689
- The character code of the next code unit in the input, or -1
690
- when the stream is at the end of the input.
691
- */
692
- this.next = -1;
693
- /**
694
- @internal
695
- */
696
- this.token = nullToken;
697
- this.rangeIndex = 0;
698
- this.pos = this.chunkPos = ranges[0].from;
699
- this.range = ranges[0];
700
- this.end = ranges[ranges.length - 1].to;
701
- this.readNext();
702
- }
703
- /**
704
- @internal
705
- */
706
- resolveOffset(offset, assoc) {
707
- let range = this.range, index = this.rangeIndex;
708
- let pos = this.pos + offset;
709
- while (pos < range.from) {
710
- if (!index)
711
- return null;
712
- let next = this.ranges[--index];
713
- pos -= range.from - next.to;
714
- range = next;
715
- }
716
- while (assoc < 0 ? pos > range.to : pos >= range.to) {
717
- if (index == this.ranges.length - 1)
718
- return null;
719
- let next = this.ranges[++index];
720
- pos += next.from - range.to;
721
- range = next;
722
- }
723
- return pos;
724
- }
725
- /**
726
- @internal
727
- */
728
- clipPos(pos) {
729
- if (pos >= this.range.from && pos < this.range.to)
730
- return pos;
731
- for (let range of this.ranges)
732
- if (range.to > pos)
733
- return Math.max(pos, range.from);
734
- return this.end;
735
- }
736
- /**
737
- Look at a code unit near the stream position. `.peek(0)` equals
738
- `.next`, `.peek(-1)` gives you the previous character, and so
739
- on.
740
-
741
- Note that looking around during tokenizing creates dependencies
742
- on potentially far-away content, which may reduce the
743
- effectiveness incremental parsing—when looking forward—or even
744
- cause invalid reparses when looking backward more than 25 code
745
- units, since the library does not track lookbehind.
746
- */
747
- peek(offset) {
748
- let idx = this.chunkOff + offset, pos, result;
749
- if (idx >= 0 && idx < this.chunk.length) {
750
- pos = this.pos + offset;
751
- result = this.chunk.charCodeAt(idx);
752
- }
753
- else {
754
- let resolved = this.resolveOffset(offset, 1);
755
- if (resolved == null)
756
- return -1;
757
- pos = resolved;
758
- if (pos >= this.chunk2Pos && pos < this.chunk2Pos + this.chunk2.length) {
759
- result = this.chunk2.charCodeAt(pos - this.chunk2Pos);
760
- }
761
- else {
762
- let i = this.rangeIndex, range = this.range;
763
- while (range.to <= pos)
764
- range = this.ranges[++i];
765
- this.chunk2 = this.input.chunk(this.chunk2Pos = pos);
766
- if (pos + this.chunk2.length > range.to)
767
- this.chunk2 = this.chunk2.slice(0, range.to - pos);
768
- result = this.chunk2.charCodeAt(0);
769
- }
770
- }
771
- if (pos >= this.token.lookAhead)
772
- this.token.lookAhead = pos + 1;
773
- return result;
774
- }
775
- /**
776
- Accept a token. By default, the end of the token is set to the
777
- current stream position, but you can pass an offset (relative to
778
- the stream position) to change that.
779
- */
780
- acceptToken(token, endOffset = 0) {
781
- let end = endOffset ? this.resolveOffset(endOffset, -1) : this.pos;
782
- if (end == null || end < this.token.start)
783
- throw new RangeError("Token end out of bounds");
784
- this.token.value = token;
785
- this.token.end = end;
786
- }
787
- /**
788
- Accept a token ending at a specific given position.
789
- */
790
- acceptTokenTo(token, endPos) {
791
- this.token.value = token;
792
- this.token.end = endPos;
793
- }
794
- getChunk() {
795
- if (this.pos >= this.chunk2Pos && this.pos < this.chunk2Pos + this.chunk2.length) {
796
- let { chunk, chunkPos } = this;
797
- this.chunk = this.chunk2;
798
- this.chunkPos = this.chunk2Pos;
799
- this.chunk2 = chunk;
800
- this.chunk2Pos = chunkPos;
801
- this.chunkOff = this.pos - this.chunkPos;
802
- }
803
- else {
804
- this.chunk2 = this.chunk;
805
- this.chunk2Pos = this.chunkPos;
806
- let nextChunk = this.input.chunk(this.pos);
807
- let end = this.pos + nextChunk.length;
808
- this.chunk = end > this.range.to ? nextChunk.slice(0, this.range.to - this.pos) : nextChunk;
809
- this.chunkPos = this.pos;
810
- this.chunkOff = 0;
811
- }
812
- }
813
- readNext() {
814
- if (this.chunkOff >= this.chunk.length) {
815
- this.getChunk();
816
- if (this.chunkOff == this.chunk.length)
817
- return this.next = -1;
818
- }
819
- return this.next = this.chunk.charCodeAt(this.chunkOff);
820
- }
821
- /**
822
- Move the stream forward N (defaults to 1) code units. Returns
823
- the new value of [`next`](#lr.InputStream.next).
824
- */
825
- advance(n = 1) {
826
- this.chunkOff += n;
827
- while (this.pos + n >= this.range.to) {
828
- if (this.rangeIndex == this.ranges.length - 1)
829
- return this.setDone();
830
- n -= this.range.to - this.pos;
831
- this.range = this.ranges[++this.rangeIndex];
832
- this.pos = this.range.from;
833
- }
834
- this.pos += n;
835
- if (this.pos >= this.token.lookAhead)
836
- this.token.lookAhead = this.pos + 1;
837
- return this.readNext();
838
- }
839
- setDone() {
840
- this.pos = this.chunkPos = this.end;
841
- this.range = this.ranges[this.rangeIndex = this.ranges.length - 1];
842
- this.chunk = "";
843
- return this.next = -1;
844
- }
845
- /**
846
- @internal
847
- */
848
- reset(pos, token) {
849
- if (token) {
850
- this.token = token;
851
- token.start = pos;
852
- token.lookAhead = pos + 1;
853
- token.value = token.extended = -1;
854
- }
855
- else {
856
- this.token = nullToken;
857
- }
858
- if (this.pos != pos) {
859
- this.pos = pos;
860
- if (pos == this.end) {
861
- this.setDone();
862
- return this;
863
- }
864
- while (pos < this.range.from)
865
- this.range = this.ranges[--this.rangeIndex];
866
- while (pos >= this.range.to)
867
- this.range = this.ranges[++this.rangeIndex];
868
- if (pos >= this.chunkPos && pos < this.chunkPos + this.chunk.length) {
869
- this.chunkOff = pos - this.chunkPos;
870
- }
871
- else {
872
- this.chunk = "";
873
- this.chunkOff = 0;
874
- }
875
- this.readNext();
876
- }
877
- return this;
878
- }
879
- /**
880
- @internal
881
- */
882
- read(from, to) {
883
- if (from >= this.chunkPos && to <= this.chunkPos + this.chunk.length)
884
- return this.chunk.slice(from - this.chunkPos, to - this.chunkPos);
885
- if (from >= this.chunk2Pos && to <= this.chunk2Pos + this.chunk2.length)
886
- return this.chunk2.slice(from - this.chunk2Pos, to - this.chunk2Pos);
887
- if (from >= this.range.from && to <= this.range.to)
888
- return this.input.read(from, to);
889
- let result = "";
890
- for (let r of this.ranges) {
891
- if (r.from >= to)
892
- break;
893
- if (r.to > from)
894
- result += this.input.read(Math.max(r.from, from), Math.min(r.to, to));
895
- }
896
- return result;
897
- }
898
- }
899
- /**
900
- @internal
901
- */
902
- class TokenGroup {
903
- constructor(data, id) {
904
- this.data = data;
905
- this.id = id;
906
- }
907
- token(input, stack) {
908
- let { parser } = stack.p;
909
- readToken(this.data, input, stack, this.id, parser.data, parser.tokenPrecTable);
910
- }
911
- }
912
- TokenGroup.prototype.contextual = TokenGroup.prototype.fallback = TokenGroup.prototype.extend = false;
913
- TokenGroup.prototype.fallback = TokenGroup.prototype.extend = false;
914
- /**
915
- `@external tokens` declarations in the grammar should resolve to
916
- an instance of this class.
917
- */
918
- class ExternalTokenizer {
919
- /**
920
- Create a tokenizer. The first argument is the function that,
921
- given an input stream, scans for the types of tokens it
922
- recognizes at the stream's position, and calls
923
- [`acceptToken`](#lr.InputStream.acceptToken) when it finds
924
- one.
925
- */
926
- constructor(
927
- /**
928
- @internal
929
- */
930
- token, options = {}) {
931
- this.token = token;
932
- this.contextual = !!options.contextual;
933
- this.fallback = !!options.fallback;
934
- this.extend = !!options.extend;
935
- }
936
- }
937
- // Tokenizer data is stored a big uint16 array containing, for each
938
- // state:
939
- //
940
- // - A group bitmask, indicating what token groups are reachable from
941
- // this state, so that paths that can only lead to tokens not in
942
- // any of the current groups can be cut off early.
943
- //
944
- // - The position of the end of the state's sequence of accepting
945
- // tokens
946
- //
947
- // - The number of outgoing edges for the state
948
- //
949
- // - The accepting tokens, as (token id, group mask) pairs
950
- //
951
- // - The outgoing edges, as (start character, end character, state
952
- // index) triples, with end character being exclusive
953
- //
954
- // This function interprets that data, running through a stream as
955
- // long as new states with the a matching group mask can be reached,
956
- // and updating `input.token` when it matches a token.
957
- function readToken(data, input, stack, group, precTable, precOffset) {
958
- let state = 0, groupMask = 1 << group, { dialect } = stack.p.parser;
959
- scan: for (;;) {
960
- if ((groupMask & data[state]) == 0)
961
- break;
962
- let accEnd = data[state + 1];
963
- // Check whether this state can lead to a token in the current group
964
- // Accept tokens in this state, possibly overwriting
965
- // lower-precedence / shorter tokens
966
- for (let i = state + 3; i < accEnd; i += 2)
967
- if ((data[i + 1] & groupMask) > 0) {
968
- let term = data[i];
969
- if (dialect.allows(term) &&
970
- (input.token.value == -1 || input.token.value == term ||
971
- overrides(term, input.token.value, precTable, precOffset))) {
972
- input.acceptToken(term);
973
- break;
974
- }
975
- }
976
- let next = input.next, low = 0, high = data[state + 2];
977
- // Special case for EOF
978
- if (input.next < 0 && high > low && data[accEnd + high * 3 - 3] == 65535 /* Seq.End */) {
979
- state = data[accEnd + high * 3 - 1];
980
- continue scan;
981
- }
982
- // Do a binary search on the state's edges
983
- for (; low < high;) {
984
- let mid = (low + high) >> 1;
985
- let index = accEnd + mid + (mid << 1);
986
- let from = data[index], to = data[index + 1] || 0x10000;
987
- if (next < from)
988
- high = mid;
989
- else if (next >= to)
990
- low = mid + 1;
991
- else {
992
- state = data[index + 2];
993
- input.advance();
994
- continue scan;
995
- }
996
- }
997
- break;
998
- }
999
- }
1000
- function findOffset(data, start, term) {
1001
- for (let i = start, next; (next = data[i]) != 65535 /* Seq.End */; i++)
1002
- if (next == term)
1003
- return i - start;
1004
- return -1;
1005
- }
1006
- function overrides(token, prev, tableData, tableOffset) {
1007
- let iPrev = findOffset(tableData, tableOffset, prev);
1008
- return iPrev < 0 || findOffset(tableData, tableOffset, token) < iPrev;
1009
- }
1010
-
1011
- // Environment variable used to control console output
1012
- const verbose = typeof process != "undefined" && process.env && /\bparse\b/.test(process.env.LOG);
1013
- let stackIDs = null;
1014
- function cutAt(tree, pos, side) {
1015
- let cursor = tree.cursor(IterMode.IncludeAnonymous);
1016
- cursor.moveTo(pos);
1017
- for (;;) {
1018
- if (!(side < 0 ? cursor.childBefore(pos) : cursor.childAfter(pos)))
1019
- for (;;) {
1020
- if ((side < 0 ? cursor.to < pos : cursor.from > pos) && !cursor.type.isError)
1021
- return side < 0 ? Math.max(0, Math.min(cursor.to - 1, pos - 25 /* Lookahead.Margin */))
1022
- : Math.min(tree.length, Math.max(cursor.from + 1, pos + 25 /* Lookahead.Margin */));
1023
- if (side < 0 ? cursor.prevSibling() : cursor.nextSibling())
1024
- break;
1025
- if (!cursor.parent())
1026
- return side < 0 ? 0 : tree.length;
1027
- }
1028
- }
1029
- }
1030
- class FragmentCursor {
1031
- constructor(fragments, nodeSet) {
1032
- this.fragments = fragments;
1033
- this.nodeSet = nodeSet;
1034
- this.i = 0;
1035
- this.fragment = null;
1036
- this.safeFrom = -1;
1037
- this.safeTo = -1;
1038
- this.trees = [];
1039
- this.start = [];
1040
- this.index = [];
1041
- this.nextFragment();
1042
- }
1043
- nextFragment() {
1044
- let fr = this.fragment = this.i == this.fragments.length ? null : this.fragments[this.i++];
1045
- if (fr) {
1046
- this.safeFrom = fr.openStart ? cutAt(fr.tree, fr.from + fr.offset, 1) - fr.offset : fr.from;
1047
- this.safeTo = fr.openEnd ? cutAt(fr.tree, fr.to + fr.offset, -1) - fr.offset : fr.to;
1048
- while (this.trees.length) {
1049
- this.trees.pop();
1050
- this.start.pop();
1051
- this.index.pop();
1052
- }
1053
- this.trees.push(fr.tree);
1054
- this.start.push(-fr.offset);
1055
- this.index.push(0);
1056
- this.nextStart = this.safeFrom;
1057
- }
1058
- else {
1059
- this.nextStart = 1e9;
1060
- }
1061
- }
1062
- // `pos` must be >= any previously given `pos` for this cursor
1063
- nodeAt(pos) {
1064
- if (pos < this.nextStart)
1065
- return null;
1066
- while (this.fragment && this.safeTo <= pos)
1067
- this.nextFragment();
1068
- if (!this.fragment)
1069
- return null;
1070
- for (;;) {
1071
- let last = this.trees.length - 1;
1072
- if (last < 0) { // End of tree
1073
- this.nextFragment();
1074
- return null;
1075
- }
1076
- let top = this.trees[last], index = this.index[last];
1077
- if (index == top.children.length) {
1078
- this.trees.pop();
1079
- this.start.pop();
1080
- this.index.pop();
1081
- continue;
1082
- }
1083
- let next = top.children[index];
1084
- let start = this.start[last] + top.positions[index];
1085
- if (start > pos) {
1086
- this.nextStart = start;
1087
- return null;
1088
- }
1089
- if (next instanceof Tree) {
1090
- if (start == pos) {
1091
- if (start < this.safeFrom)
1092
- return null;
1093
- let end = start + next.length;
1094
- if (end <= this.safeTo) {
1095
- let lookAhead = next.prop(NodeProp.lookAhead);
1096
- if (!lookAhead || end + lookAhead < this.fragment.to)
1097
- return next;
1098
- }
1099
- }
1100
- this.index[last]++;
1101
- if (start + next.length >= Math.max(this.safeFrom, pos)) { // Enter this node
1102
- this.trees.push(next);
1103
- this.start.push(start);
1104
- this.index.push(0);
1105
- }
1106
- }
1107
- else {
1108
- this.index[last]++;
1109
- this.nextStart = start + next.length;
1110
- }
1111
- }
1112
- }
1113
- }
1114
- class TokenCache {
1115
- constructor(parser, stream) {
1116
- this.stream = stream;
1117
- this.tokens = [];
1118
- this.mainToken = null;
1119
- this.actions = [];
1120
- this.tokens = parser.tokenizers.map(_ => new CachedToken);
1121
- }
1122
- getActions(stack) {
1123
- let actionIndex = 0;
1124
- let main = null;
1125
- let { parser } = stack.p, { tokenizers } = parser;
1126
- let mask = parser.stateSlot(stack.state, 3 /* ParseState.TokenizerMask */);
1127
- let context = stack.curContext ? stack.curContext.hash : 0;
1128
- let lookAhead = 0;
1129
- for (let i = 0; i < tokenizers.length; i++) {
1130
- if (((1 << i) & mask) == 0)
1131
- continue;
1132
- let tokenizer = tokenizers[i], token = this.tokens[i];
1133
- if (main && !tokenizer.fallback)
1134
- continue;
1135
- if (tokenizer.contextual || token.start != stack.pos || token.mask != mask || token.context != context) {
1136
- this.updateCachedToken(token, tokenizer, stack);
1137
- token.mask = mask;
1138
- token.context = context;
1139
- }
1140
- if (token.lookAhead > token.end + 25 /* Lookahead.Margin */)
1141
- lookAhead = Math.max(token.lookAhead, lookAhead);
1142
- if (token.value != 0 /* Term.Err */) {
1143
- let startIndex = actionIndex;
1144
- if (token.extended > -1)
1145
- actionIndex = this.addActions(stack, token.extended, token.end, actionIndex);
1146
- actionIndex = this.addActions(stack, token.value, token.end, actionIndex);
1147
- if (!tokenizer.extend) {
1148
- main = token;
1149
- if (actionIndex > startIndex)
1150
- break;
1151
- }
1152
- }
1153
- }
1154
- while (this.actions.length > actionIndex)
1155
- this.actions.pop();
1156
- if (lookAhead)
1157
- stack.setLookAhead(lookAhead);
1158
- if (!main && stack.pos == this.stream.end) {
1159
- main = new CachedToken;
1160
- main.value = stack.p.parser.eofTerm;
1161
- main.start = main.end = stack.pos;
1162
- actionIndex = this.addActions(stack, main.value, main.end, actionIndex);
1163
- }
1164
- this.mainToken = main;
1165
- return this.actions;
1166
- }
1167
- getMainToken(stack) {
1168
- if (this.mainToken)
1169
- return this.mainToken;
1170
- let main = new CachedToken, { pos, p } = stack;
1171
- main.start = pos;
1172
- main.end = Math.min(pos + 1, p.stream.end);
1173
- main.value = pos == p.stream.end ? p.parser.eofTerm : 0 /* Term.Err */;
1174
- return main;
1175
- }
1176
- updateCachedToken(token, tokenizer, stack) {
1177
- let start = this.stream.clipPos(stack.pos);
1178
- tokenizer.token(this.stream.reset(start, token), stack);
1179
- if (token.value > -1) {
1180
- let { parser } = stack.p;
1181
- for (let i = 0; i < parser.specialized.length; i++)
1182
- if (parser.specialized[i] == token.value) {
1183
- let result = parser.specializers[i](this.stream.read(token.start, token.end), stack);
1184
- if (result >= 0 && stack.p.parser.dialect.allows(result >> 1)) {
1185
- if ((result & 1) == 0 /* Specialize.Specialize */)
1186
- token.value = result >> 1;
1187
- else
1188
- token.extended = result >> 1;
1189
- break;
1190
- }
1191
- }
1192
- }
1193
- else {
1194
- token.value = 0 /* Term.Err */;
1195
- token.end = this.stream.clipPos(start + 1);
1196
- }
1197
- }
1198
- putAction(action, token, end, index) {
1199
- // Don't add duplicate actions
1200
- for (let i = 0; i < index; i += 3)
1201
- if (this.actions[i] == action)
1202
- return index;
1203
- this.actions[index++] = action;
1204
- this.actions[index++] = token;
1205
- this.actions[index++] = end;
1206
- return index;
1207
- }
1208
- addActions(stack, token, end, index) {
1209
- let { state } = stack, { parser } = stack.p, { data } = parser;
1210
- for (let set = 0; set < 2; set++) {
1211
- for (let i = parser.stateSlot(state, set ? 2 /* ParseState.Skip */ : 1 /* ParseState.Actions */);; i += 3) {
1212
- if (data[i] == 65535 /* Seq.End */) {
1213
- if (data[i + 1] == 1 /* Seq.Next */) {
1214
- i = pair(data, i + 2);
1215
- }
1216
- else {
1217
- if (index == 0 && data[i + 1] == 2 /* Seq.Other */)
1218
- index = this.putAction(pair(data, i + 2), token, end, index);
1219
- break;
1220
- }
1221
- }
1222
- if (data[i] == token)
1223
- index = this.putAction(pair(data, i + 1), token, end, index);
1224
- }
1225
- }
1226
- return index;
1227
- }
1228
- }
1229
- class Parse {
1230
- constructor(parser, input, fragments, ranges) {
1231
- this.parser = parser;
1232
- this.input = input;
1233
- this.ranges = ranges;
1234
- this.recovering = 0;
1235
- this.nextStackID = 0x2654; // ♔, ♕, ♖, ♗, ♘, ♙, ♠, ♡, ♢, ♣, ♤, ♥, ♦, ♧
1236
- this.minStackPos = 0;
1237
- this.reused = [];
1238
- this.stoppedAt = null;
1239
- this.lastBigReductionStart = -1;
1240
- this.lastBigReductionSize = 0;
1241
- this.bigReductionCount = 0;
1242
- this.stream = new InputStream(input, ranges);
1243
- this.tokens = new TokenCache(parser, this.stream);
1244
- this.topTerm = parser.top[1];
1245
- let { from } = ranges[0];
1246
- this.stacks = [Stack.start(this, parser.top[0], from)];
1247
- this.fragments = fragments.length && this.stream.end - from > parser.bufferLength * 4
1248
- ? new FragmentCursor(fragments, parser.nodeSet) : null;
1249
- }
1250
- get parsedPos() {
1251
- return this.minStackPos;
1252
- }
1253
- // Move the parser forward. This will process all parse stacks at
1254
- // `this.pos` and try to advance them to a further position. If no
1255
- // stack for such a position is found, it'll start error-recovery.
1256
- //
1257
- // When the parse is finished, this will return a syntax tree. When
1258
- // not, it returns `null`.
1259
- advance() {
1260
- let stacks = this.stacks, pos = this.minStackPos;
1261
- // This will hold stacks beyond `pos`.
1262
- let newStacks = this.stacks = [];
1263
- let stopped, stoppedTokens;
1264
- // If a large amount of reductions happened with the same start
1265
- // position, force the stack out of that production in order to
1266
- // avoid creating a tree too deep to recurse through.
1267
- // (This is an ugly kludge, because unfortunately there is no
1268
- // straightforward, cheap way to check for this happening, due to
1269
- // the history of reductions only being available in an
1270
- // expensive-to-access format in the stack buffers.)
1271
- if (this.bigReductionCount > 300 /* Rec.MaxLeftAssociativeReductionCount */ && stacks.length == 1) {
1272
- let [s] = stacks;
1273
- while (s.forceReduce() && s.stack.length && s.stack[s.stack.length - 2] >= this.lastBigReductionStart) { }
1274
- this.bigReductionCount = this.lastBigReductionSize = 0;
1275
- }
1276
- // Keep advancing any stacks at `pos` until they either move
1277
- // forward or can't be advanced. Gather stacks that can't be
1278
- // advanced further in `stopped`.
1279
- for (let i = 0; i < stacks.length; i++) {
1280
- let stack = stacks[i];
1281
- for (;;) {
1282
- this.tokens.mainToken = null;
1283
- if (stack.pos > pos) {
1284
- newStacks.push(stack);
1285
- }
1286
- else if (this.advanceStack(stack, newStacks, stacks)) {
1287
- continue;
1288
- }
1289
- else {
1290
- if (!stopped) {
1291
- stopped = [];
1292
- stoppedTokens = [];
1293
- }
1294
- stopped.push(stack);
1295
- let tok = this.tokens.getMainToken(stack);
1296
- stoppedTokens.push(tok.value, tok.end);
1297
- }
1298
- break;
1299
- }
1300
- }
1301
- if (!newStacks.length) {
1302
- let finished = stopped && findFinished(stopped);
1303
- if (finished) {
1304
- if (verbose)
1305
- console.log("Finish with " + this.stackID(finished));
1306
- return this.stackToTree(finished);
1307
- }
1308
- if (this.parser.strict) {
1309
- if (verbose && stopped)
1310
- console.log("Stuck with token " + (this.tokens.mainToken ? this.parser.getName(this.tokens.mainToken.value) : "none"));
1311
- throw new SyntaxError("No parse at " + pos);
1312
- }
1313
- if (!this.recovering)
1314
- this.recovering = 5 /* Rec.Distance */;
1315
- }
1316
- if (this.recovering && stopped) {
1317
- let finished = this.stoppedAt != null && stopped[0].pos > this.stoppedAt ? stopped[0]
1318
- : this.runRecovery(stopped, stoppedTokens, newStacks);
1319
- if (finished) {
1320
- if (verbose)
1321
- console.log("Force-finish " + this.stackID(finished));
1322
- return this.stackToTree(finished.forceAll());
1323
- }
1324
- }
1325
- if (this.recovering) {
1326
- let maxRemaining = this.recovering == 1 ? 1 : this.recovering * 3 /* Rec.MaxRemainingPerStep */;
1327
- if (newStacks.length > maxRemaining) {
1328
- newStacks.sort((a, b) => b.score - a.score);
1329
- while (newStacks.length > maxRemaining)
1330
- newStacks.pop();
1331
- }
1332
- if (newStacks.some(s => s.reducePos > pos))
1333
- this.recovering--;
1334
- }
1335
- else if (newStacks.length > 1) {
1336
- // Prune stacks that are in the same state, or that have been
1337
- // running without splitting for a while, to avoid getting stuck
1338
- // with multiple successful stacks running endlessly on.
1339
- outer: for (let i = 0; i < newStacks.length - 1; i++) {
1340
- let stack = newStacks[i];
1341
- for (let j = i + 1; j < newStacks.length; j++) {
1342
- let other = newStacks[j];
1343
- if (stack.sameState(other) ||
1344
- stack.buffer.length > 500 /* Rec.MinBufferLengthPrune */ && other.buffer.length > 500 /* Rec.MinBufferLengthPrune */) {
1345
- if (((stack.score - other.score) || (stack.buffer.length - other.buffer.length)) > 0) {
1346
- newStacks.splice(j--, 1);
1347
- }
1348
- else {
1349
- newStacks.splice(i--, 1);
1350
- continue outer;
1351
- }
1352
- }
1353
- }
1354
- }
1355
- if (newStacks.length > 12 /* Rec.MaxStackCount */)
1356
- newStacks.splice(12 /* Rec.MaxStackCount */, newStacks.length - 12 /* Rec.MaxStackCount */);
1357
- }
1358
- this.minStackPos = newStacks[0].pos;
1359
- for (let i = 1; i < newStacks.length; i++)
1360
- if (newStacks[i].pos < this.minStackPos)
1361
- this.minStackPos = newStacks[i].pos;
1362
- return null;
1363
- }
1364
- stopAt(pos) {
1365
- if (this.stoppedAt != null && this.stoppedAt < pos)
1366
- throw new RangeError("Can't move stoppedAt forward");
1367
- this.stoppedAt = pos;
1368
- }
1369
- // Returns an updated version of the given stack, or null if the
1370
- // stack can't advance normally. When `split` and `stacks` are
1371
- // given, stacks split off by ambiguous operations will be pushed to
1372
- // `split`, or added to `stacks` if they move `pos` forward.
1373
- advanceStack(stack, stacks, split) {
1374
- let start = stack.pos, { parser } = this;
1375
- let base = verbose ? this.stackID(stack) + " -> " : "";
1376
- if (this.stoppedAt != null && start > this.stoppedAt)
1377
- return stack.forceReduce() ? stack : null;
1378
- if (this.fragments) {
1379
- let strictCx = stack.curContext && stack.curContext.tracker.strict, cxHash = strictCx ? stack.curContext.hash : 0;
1380
- for (let cached = this.fragments.nodeAt(start); cached;) {
1381
- let match = this.parser.nodeSet.types[cached.type.id] == cached.type ? parser.getGoto(stack.state, cached.type.id) : -1;
1382
- if (match > -1 && cached.length && (!strictCx || (cached.prop(NodeProp.contextHash) || 0) == cxHash)) {
1383
- stack.useNode(cached, match);
1384
- if (verbose)
1385
- console.log(base + this.stackID(stack) + ` (via reuse of ${parser.getName(cached.type.id)})`);
1386
- return true;
1387
- }
1388
- if (!(cached instanceof Tree) || cached.children.length == 0 || cached.positions[0] > 0)
1389
- break;
1390
- let inner = cached.children[0];
1391
- if (inner instanceof Tree && cached.positions[0] == 0)
1392
- cached = inner;
1393
- else
1394
- break;
1395
- }
1396
- }
1397
- let defaultReduce = parser.stateSlot(stack.state, 4 /* ParseState.DefaultReduce */);
1398
- if (defaultReduce > 0) {
1399
- stack.reduce(defaultReduce);
1400
- if (verbose)
1401
- console.log(base + this.stackID(stack) + ` (via always-reduce ${parser.getName(defaultReduce & 65535 /* Action.ValueMask */)})`);
1402
- return true;
1403
- }
1404
- if (stack.stack.length >= 8400 /* Rec.CutDepth */) {
1405
- while (stack.stack.length > 6000 /* Rec.CutTo */ && stack.forceReduce()) { }
1406
- }
1407
- let actions = this.tokens.getActions(stack);
1408
- for (let i = 0; i < actions.length;) {
1409
- let action = actions[i++], term = actions[i++], end = actions[i++];
1410
- let last = i == actions.length || !split;
1411
- let localStack = last ? stack : stack.split();
1412
- let main = this.tokens.mainToken;
1413
- localStack.apply(action, term, main ? main.start : localStack.pos, end);
1414
- if (verbose)
1415
- console.log(base + this.stackID(localStack) + ` (via ${(action & 65536 /* Action.ReduceFlag */) == 0 ? "shift"
1416
- : `reduce of ${parser.getName(action & 65535 /* Action.ValueMask */)}`} for ${parser.getName(term)} @ ${start}${localStack == stack ? "" : ", split"})`);
1417
- if (last)
1418
- return true;
1419
- else if (localStack.pos > start)
1420
- stacks.push(localStack);
1421
- else
1422
- split.push(localStack);
1423
- }
1424
- return false;
1425
- }
1426
- // Advance a given stack forward as far as it will go. Returns the
1427
- // (possibly updated) stack if it got stuck, or null if it moved
1428
- // forward and was given to `pushStackDedup`.
1429
- advanceFully(stack, newStacks) {
1430
- let pos = stack.pos;
1431
- for (;;) {
1432
- if (!this.advanceStack(stack, null, null))
1433
- return false;
1434
- if (stack.pos > pos) {
1435
- pushStackDedup(stack, newStacks);
1436
- return true;
1437
- }
1438
- }
1439
- }
1440
- runRecovery(stacks, tokens, newStacks) {
1441
- let finished = null, restarted = false;
1442
- for (let i = 0; i < stacks.length; i++) {
1443
- let stack = stacks[i], token = tokens[i << 1], tokenEnd = tokens[(i << 1) + 1];
1444
- let base = verbose ? this.stackID(stack) + " -> " : "";
1445
- if (stack.deadEnd) {
1446
- if (restarted)
1447
- continue;
1448
- restarted = true;
1449
- stack.restart();
1450
- if (verbose)
1451
- console.log(base + this.stackID(stack) + " (restarted)");
1452
- let done = this.advanceFully(stack, newStacks);
1453
- if (done)
1454
- continue;
1455
- }
1456
- let force = stack.split(), forceBase = base;
1457
- for (let j = 0; force.forceReduce() && j < 10 /* Rec.ForceReduceLimit */; j++) {
1458
- if (verbose)
1459
- console.log(forceBase + this.stackID(force) + " (via force-reduce)");
1460
- let done = this.advanceFully(force, newStacks);
1461
- if (done)
1462
- break;
1463
- if (verbose)
1464
- forceBase = this.stackID(force) + " -> ";
1465
- }
1466
- for (let insert of stack.recoverByInsert(token)) {
1467
- if (verbose)
1468
- console.log(base + this.stackID(insert) + " (via recover-insert)");
1469
- this.advanceFully(insert, newStacks);
1470
- }
1471
- if (this.stream.end > stack.pos) {
1472
- if (tokenEnd == stack.pos) {
1473
- tokenEnd++;
1474
- token = 0 /* Term.Err */;
1475
- }
1476
- stack.recoverByDelete(token, tokenEnd);
1477
- if (verbose)
1478
- console.log(base + this.stackID(stack) + ` (via recover-delete ${this.parser.getName(token)})`);
1479
- pushStackDedup(stack, newStacks);
1480
- }
1481
- else if (!finished || finished.score < stack.score) {
1482
- finished = stack;
1483
- }
1484
- }
1485
- return finished;
1486
- }
1487
- // Convert the stack's buffer to a syntax tree.
1488
- stackToTree(stack) {
1489
- stack.close();
1490
- return Tree.build({ buffer: StackBufferCursor.create(stack),
1491
- nodeSet: this.parser.nodeSet,
1492
- topID: this.topTerm,
1493
- maxBufferLength: this.parser.bufferLength,
1494
- reused: this.reused,
1495
- start: this.ranges[0].from,
1496
- length: stack.pos - this.ranges[0].from,
1497
- minRepeatType: this.parser.minRepeatTerm });
1498
- }
1499
- stackID(stack) {
1500
- let id = (stackIDs || (stackIDs = new WeakMap)).get(stack);
1501
- if (!id)
1502
- stackIDs.set(stack, id = String.fromCodePoint(this.nextStackID++));
1503
- return id + stack;
1504
- }
1505
- }
1506
- function pushStackDedup(stack, newStacks) {
1507
- for (let i = 0; i < newStacks.length; i++) {
1508
- let other = newStacks[i];
1509
- if (other.pos == stack.pos && other.sameState(stack)) {
1510
- if (newStacks[i].score < stack.score)
1511
- newStacks[i] = stack;
1512
- return;
1513
- }
1514
- }
1515
- newStacks.push(stack);
1516
- }
1517
- class Dialect {
1518
- constructor(source, flags, disabled) {
1519
- this.source = source;
1520
- this.flags = flags;
1521
- this.disabled = disabled;
1522
- }
1523
- allows(term) { return !this.disabled || this.disabled[term] == 0; }
1524
- }
1525
- const id = x => x;
1526
- /**
1527
- Context trackers are used to track stateful context (such as
1528
- indentation in the Python grammar, or parent elements in the XML
1529
- grammar) needed by external tokenizers. You declare them in a
1530
- grammar file as `@context exportName from "module"`.
1531
-
1532
- Context values should be immutable, and can be updated (replaced)
1533
- on shift or reduce actions.
1534
-
1535
- The export used in a `@context` declaration should be of this
1536
- type.
1537
- */
1538
- class ContextTracker {
1539
- /**
1540
- Define a context tracker.
1541
- */
1542
- constructor(spec) {
1543
- this.start = spec.start;
1544
- this.shift = spec.shift || id;
1545
- this.reduce = spec.reduce || id;
1546
- this.reuse = spec.reuse || id;
1547
- this.hash = spec.hash || (() => 0);
1548
- this.strict = spec.strict !== false;
1549
- }
1550
- }
1551
- /**
1552
- Holds the parse tables for a given grammar, as generated by
1553
- `lezer-generator`, and provides [methods](#common.Parser) to parse
1554
- content with.
1555
- */
1556
- class LRParser extends Parser {
1557
- /**
1558
- @internal
1559
- */
1560
- constructor(spec) {
1561
- super();
1562
- /**
1563
- @internal
1564
- */
1565
- this.wrappers = [];
1566
- if (spec.version != 14 /* File.Version */)
1567
- throw new RangeError(`Parser version (${spec.version}) doesn't match runtime version (${14 /* File.Version */})`);
1568
- let nodeNames = spec.nodeNames.split(" ");
1569
- this.minRepeatTerm = nodeNames.length;
1570
- for (let i = 0; i < spec.repeatNodeCount; i++)
1571
- nodeNames.push("");
1572
- let topTerms = Object.keys(spec.topRules).map(r => spec.topRules[r][1]);
1573
- let nodeProps = [];
1574
- for (let i = 0; i < nodeNames.length; i++)
1575
- nodeProps.push([]);
1576
- function setProp(nodeID, prop, value) {
1577
- nodeProps[nodeID].push([prop, prop.deserialize(String(value))]);
1578
- }
1579
- if (spec.nodeProps)
1580
- for (let propSpec of spec.nodeProps) {
1581
- let prop = propSpec[0];
1582
- if (typeof prop == "string")
1583
- prop = NodeProp[prop];
1584
- for (let i = 1; i < propSpec.length;) {
1585
- let next = propSpec[i++];
1586
- if (next >= 0) {
1587
- setProp(next, prop, propSpec[i++]);
1588
- }
1589
- else {
1590
- let value = propSpec[i + -next];
1591
- for (let j = -next; j > 0; j--)
1592
- setProp(propSpec[i++], prop, value);
1593
- i++;
1594
- }
1595
- }
1596
- }
1597
- this.nodeSet = new NodeSet(nodeNames.map((name, i) => NodeType.define({
1598
- name: i >= this.minRepeatTerm ? undefined : name,
1599
- id: i,
1600
- props: nodeProps[i],
1601
- top: topTerms.indexOf(i) > -1,
1602
- error: i == 0,
1603
- skipped: spec.skippedNodes && spec.skippedNodes.indexOf(i) > -1
1604
- })));
1605
- if (spec.propSources)
1606
- this.nodeSet = this.nodeSet.extend(...spec.propSources);
1607
- this.strict = false;
1608
- this.bufferLength = DefaultBufferLength;
1609
- let tokenArray = decodeArray(spec.tokenData);
1610
- this.context = spec.context;
1611
- this.specializerSpecs = spec.specialized || [];
1612
- this.specialized = new Uint16Array(this.specializerSpecs.length);
1613
- for (let i = 0; i < this.specializerSpecs.length; i++)
1614
- this.specialized[i] = this.specializerSpecs[i].term;
1615
- this.specializers = this.specializerSpecs.map(getSpecializer);
1616
- this.states = decodeArray(spec.states, Uint32Array);
1617
- this.data = decodeArray(spec.stateData);
1618
- this.goto = decodeArray(spec.goto);
1619
- this.maxTerm = spec.maxTerm;
1620
- this.tokenizers = spec.tokenizers.map(value => typeof value == "number" ? new TokenGroup(tokenArray, value) : value);
1621
- this.topRules = spec.topRules;
1622
- this.dialects = spec.dialects || {};
1623
- this.dynamicPrecedences = spec.dynamicPrecedences || null;
1624
- this.tokenPrecTable = spec.tokenPrec;
1625
- this.termNames = spec.termNames || null;
1626
- this.maxNode = this.nodeSet.types.length - 1;
1627
- this.dialect = this.parseDialect();
1628
- this.top = this.topRules[Object.keys(this.topRules)[0]];
1629
- }
1630
- createParse(input, fragments, ranges) {
1631
- let parse = new Parse(this, input, fragments, ranges);
1632
- for (let w of this.wrappers)
1633
- parse = w(parse, input, fragments, ranges);
1634
- return parse;
1635
- }
1636
- /**
1637
- Get a goto table entry @internal
1638
- */
1639
- getGoto(state, term, loose = false) {
1640
- let table = this.goto;
1641
- if (term >= table[0])
1642
- return -1;
1643
- for (let pos = table[term + 1];;) {
1644
- let groupTag = table[pos++], last = groupTag & 1;
1645
- let target = table[pos++];
1646
- if (last && loose)
1647
- return target;
1648
- for (let end = pos + (groupTag >> 1); pos < end; pos++)
1649
- if (table[pos] == state)
1650
- return target;
1651
- if (last)
1652
- return -1;
1653
- }
1654
- }
1655
- /**
1656
- Check if this state has an action for a given terminal @internal
1657
- */
1658
- hasAction(state, terminal) {
1659
- let data = this.data;
1660
- for (let set = 0; set < 2; set++) {
1661
- for (let i = this.stateSlot(state, set ? 2 /* ParseState.Skip */ : 1 /* ParseState.Actions */), next;; i += 3) {
1662
- if ((next = data[i]) == 65535 /* Seq.End */) {
1663
- if (data[i + 1] == 1 /* Seq.Next */)
1664
- next = data[i = pair(data, i + 2)];
1665
- else if (data[i + 1] == 2 /* Seq.Other */)
1666
- return pair(data, i + 2);
1667
- else
1668
- break;
1669
- }
1670
- if (next == terminal || next == 0 /* Term.Err */)
1671
- return pair(data, i + 1);
1672
- }
1673
- }
1674
- return 0;
1675
- }
1676
- /**
1677
- @internal
1678
- */
1679
- stateSlot(state, slot) {
1680
- return this.states[(state * 6 /* ParseState.Size */) + slot];
1681
- }
1682
- /**
1683
- @internal
1684
- */
1685
- stateFlag(state, flag) {
1686
- return (this.stateSlot(state, 0 /* ParseState.Flags */) & flag) > 0;
1687
- }
1688
- /**
1689
- @internal
1690
- */
1691
- validAction(state, action) {
1692
- return !!this.allActions(state, a => a == action ? true : null);
1693
- }
1694
- /**
1695
- @internal
1696
- */
1697
- allActions(state, action) {
1698
- let deflt = this.stateSlot(state, 4 /* ParseState.DefaultReduce */);
1699
- let result = deflt ? action(deflt) : undefined;
1700
- for (let i = this.stateSlot(state, 1 /* ParseState.Actions */); result == null; i += 3) {
1701
- if (this.data[i] == 65535 /* Seq.End */) {
1702
- if (this.data[i + 1] == 1 /* Seq.Next */)
1703
- i = pair(this.data, i + 2);
1704
- else
1705
- break;
1706
- }
1707
- result = action(pair(this.data, i + 1));
1708
- }
1709
- return result;
1710
- }
1711
- /**
1712
- Get the states that can follow this one through shift actions or
1713
- goto jumps. @internal
1714
- */
1715
- nextStates(state) {
1716
- let result = [];
1717
- for (let i = this.stateSlot(state, 1 /* ParseState.Actions */);; i += 3) {
1718
- if (this.data[i] == 65535 /* Seq.End */) {
1719
- if (this.data[i + 1] == 1 /* Seq.Next */)
1720
- i = pair(this.data, i + 2);
1721
- else
1722
- break;
1723
- }
1724
- if ((this.data[i + 2] & (65536 /* Action.ReduceFlag */ >> 16)) == 0) {
1725
- let value = this.data[i + 1];
1726
- if (!result.some((v, i) => (i & 1) && v == value))
1727
- result.push(this.data[i], value);
1728
- }
1729
- }
1730
- return result;
1731
- }
1732
- /**
1733
- Configure the parser. Returns a new parser instance that has the
1734
- given settings modified. Settings not provided in `config` are
1735
- kept from the original parser.
1736
- */
1737
- configure(config) {
1738
- // Hideous reflection-based kludge to make it easy to create a
1739
- // slightly modified copy of a parser.
1740
- let copy = Object.assign(Object.create(LRParser.prototype), this);
1741
- if (config.props)
1742
- copy.nodeSet = this.nodeSet.extend(...config.props);
1743
- if (config.top) {
1744
- let info = this.topRules[config.top];
1745
- if (!info)
1746
- throw new RangeError(`Invalid top rule name ${config.top}`);
1747
- copy.top = info;
1748
- }
1749
- if (config.tokenizers)
1750
- copy.tokenizers = this.tokenizers.map(t => {
1751
- let found = config.tokenizers.find(r => r.from == t);
1752
- return found ? found.to : t;
1753
- });
1754
- if (config.specializers) {
1755
- copy.specializers = this.specializers.slice();
1756
- copy.specializerSpecs = this.specializerSpecs.map((s, i) => {
1757
- let found = config.specializers.find(r => r.from == s.external);
1758
- if (!found)
1759
- return s;
1760
- let spec = Object.assign(Object.assign({}, s), { external: found.to });
1761
- copy.specializers[i] = getSpecializer(spec);
1762
- return spec;
1763
- });
1764
- }
1765
- if (config.contextTracker)
1766
- copy.context = config.contextTracker;
1767
- if (config.dialect)
1768
- copy.dialect = this.parseDialect(config.dialect);
1769
- if (config.strict != null)
1770
- copy.strict = config.strict;
1771
- if (config.wrap)
1772
- copy.wrappers = copy.wrappers.concat(config.wrap);
1773
- if (config.bufferLength != null)
1774
- copy.bufferLength = config.bufferLength;
1775
- return copy;
1776
- }
1777
- /**
1778
- Tells you whether any [parse wrappers](#lr.ParserConfig.wrap)
1779
- are registered for this parser.
1780
- */
1781
- hasWrappers() {
1782
- return this.wrappers.length > 0;
1783
- }
1784
- /**
1785
- Returns the name associated with a given term. This will only
1786
- work for all terms when the parser was generated with the
1787
- `--names` option. By default, only the names of tagged terms are
1788
- stored.
1789
- */
1790
- getName(term) {
1791
- return this.termNames ? this.termNames[term] : String(term <= this.maxNode && this.nodeSet.types[term].name || term);
1792
- }
1793
- /**
1794
- The eof term id is always allocated directly after the node
1795
- types. @internal
1796
- */
1797
- get eofTerm() { return this.maxNode + 1; }
1798
- /**
1799
- The type of top node produced by the parser.
1800
- */
1801
- get topNode() { return this.nodeSet.types[this.top[1]]; }
1802
- /**
1803
- @internal
1804
- */
1805
- dynamicPrecedence(term) {
1806
- let prec = this.dynamicPrecedences;
1807
- return prec == null ? 0 : prec[term] || 0;
1808
- }
1809
- /**
1810
- @internal
1811
- */
1812
- parseDialect(dialect) {
1813
- let values = Object.keys(this.dialects), flags = values.map(() => false);
1814
- if (dialect)
1815
- for (let part of dialect.split(" ")) {
1816
- let id = values.indexOf(part);
1817
- if (id >= 0)
1818
- flags[id] = true;
1819
- }
1820
- let disabled = null;
1821
- for (let i = 0; i < values.length; i++)
1822
- if (!flags[i]) {
1823
- for (let j = this.dialects[values[i]], id; (id = this.data[j++]) != 65535 /* Seq.End */;)
1824
- (disabled || (disabled = new Uint8Array(this.maxTerm + 1)))[id] = 1;
1825
- }
1826
- return new Dialect(dialect, flags, disabled);
1827
- }
1828
- /**
1829
- Used by the output of the parser generator. Not available to
1830
- user code. @hide
1831
- */
1832
- static deserialize(spec) {
1833
- return new LRParser(spec);
1834
- }
1835
- }
1836
- function pair(data, off) { return data[off] | (data[off + 1] << 16); }
1837
- function findFinished(stacks) {
1838
- let best = null;
1839
- for (let stack of stacks) {
1840
- let stopped = stack.p.stoppedAt;
1841
- if ((stack.pos == stack.p.stream.end || stopped != null && stack.pos > stopped) &&
1842
- stack.p.parser.stateFlag(stack.state, 2 /* StateFlag.Accepting */) &&
1843
- (!best || best.score < stack.score))
1844
- best = stack;
1845
- }
1846
- return best;
1847
- }
1848
- function getSpecializer(spec) {
1849
- if (spec.external) {
1850
- let mask = spec.extend ? 1 /* Specialize.Extend */ : 0 /* Specialize.Specialize */;
1851
- return (value, stack) => (spec.external(value, stack) << 1) | mask;
1852
- }
1853
- return spec.get;
1854
- }
1855
-
1856
- // This file was generated by lezer-generator. You probably shouldn't edit it.
1857
- const printKeyword = 1,
1858
- indent = 194,
1859
- dedent = 195,
1860
- newline$1 = 196,
1861
- blankLineStart = 197,
1862
- newlineBracketed = 198,
1863
- eof = 199,
1864
- stringContent = 200,
1865
- Escape = 2,
1866
- replacementStart = 3,
1867
- stringEnd = 201,
1868
- ParenL = 24,
1869
- ParenthesizedExpression = 25,
1870
- TupleExpression = 49,
1871
- ComprehensionExpression = 50,
1872
- BracketL = 55,
1873
- ArrayExpression = 56,
1874
- ArrayComprehensionExpression = 57,
1875
- BraceL = 59,
1876
- DictionaryExpression = 60,
1877
- DictionaryComprehensionExpression = 61,
1878
- SetExpression = 62,
1879
- SetComprehensionExpression = 63,
1880
- ArgList = 65,
1881
- subscript = 238,
1882
- String$1 = 71,
1883
- stringStart = 241,
1884
- stringStartD = 242,
1885
- stringStartL = 243,
1886
- stringStartLD = 244,
1887
- stringStartR = 245,
1888
- stringStartRD = 246,
1889
- stringStartRL = 247,
1890
- stringStartRLD = 248,
1891
- FormatString = 72,
1892
- stringStartF = 249,
1893
- stringStartFD = 250,
1894
- stringStartFL = 251,
1895
- stringStartFLD = 252,
1896
- stringStartFR = 253,
1897
- stringStartFRD = 254,
1898
- stringStartFRL = 255,
1899
- stringStartFRLD = 256,
1900
- FormatReplacement = 73,
1901
- nestedFormatReplacement = 77,
1902
- importList = 263,
1903
- TypeParamList = 112,
1904
- ParamList = 130,
1905
- SequencePattern = 151,
1906
- MappingPattern = 152,
1907
- PatternArgList = 155;
1908
-
1909
- const newline = 10, carriageReturn = 13, space = 32, tab = 9, hash = 35, parenOpen = 40, dot = 46,
1910
- braceOpen = 123, braceClose = 125, singleQuote = 39, doubleQuote = 34, backslash = 92,
1911
- letter_o = 111, letter_x = 120, letter_N = 78, letter_u = 117, letter_U = 85;
1912
-
1913
- const bracketed = new Set([
1914
- ParenthesizedExpression, TupleExpression, ComprehensionExpression, importList, ArgList, ParamList,
1915
- ArrayExpression, ArrayComprehensionExpression, subscript,
1916
- SetExpression, SetComprehensionExpression, FormatString, FormatReplacement, nestedFormatReplacement,
1917
- DictionaryExpression, DictionaryComprehensionExpression,
1918
- SequencePattern, MappingPattern, PatternArgList, TypeParamList
1919
- ]);
1920
-
1921
- function isLineBreak(ch) {
1922
- return ch == newline || ch == carriageReturn
1923
- }
1924
-
1925
- function isHex(ch) {
1926
- return ch >= 48 && ch <= 57 || ch >= 65 && ch <= 70 || ch >= 97 && ch <= 102
1927
- }
1928
-
1929
- const newlines = new ExternalTokenizer((input, stack) => {
1930
- let prev;
1931
- if (input.next < 0) {
1932
- input.acceptToken(eof);
1933
- } else if (stack.context.flags & cx_Bracketed) {
1934
- if (isLineBreak(input.next)) input.acceptToken(newlineBracketed, 1);
1935
- } else if (((prev = input.peek(-1)) < 0 || isLineBreak(prev)) &&
1936
- stack.canShift(blankLineStart)) {
1937
- let spaces = 0;
1938
- while (input.next == space || input.next == tab) { input.advance(); spaces++; }
1939
- if (input.next == newline || input.next == carriageReturn || input.next == hash)
1940
- input.acceptToken(blankLineStart, -spaces);
1941
- } else if (isLineBreak(input.next)) {
1942
- input.acceptToken(newline$1, 1);
1943
- }
1944
- }, {contextual: true});
1945
-
1946
- const indentation = new ExternalTokenizer((input, stack) => {
1947
- let context = stack.context;
1948
- if (context.flags) return
1949
- let prev = input.peek(-1);
1950
- if (prev == newline || prev == carriageReturn) {
1951
- let depth = 0, chars = 0;
1952
- for (;;) {
1953
- if (input.next == space) depth++;
1954
- else if (input.next == tab) depth += 8 - (depth % 8);
1955
- else break
1956
- input.advance();
1957
- chars++;
1958
- }
1959
- if (depth != context.indent &&
1960
- input.next != newline && input.next != carriageReturn && input.next != hash) {
1961
- if (depth < context.indent) input.acceptToken(dedent, -chars);
1962
- else input.acceptToken(indent);
1963
- }
1964
- }
1965
- });
1966
-
1967
- // Flags used in Context objects
1968
- const cx_Bracketed = 1, cx_String = 2, cx_DoubleQuote = 4, cx_Long = 8, cx_Raw = 16, cx_Format = 32;
1969
-
1970
- function Context(parent, indent, flags) {
1971
- this.parent = parent;
1972
- this.indent = indent;
1973
- this.flags = flags;
1974
- this.hash = (parent ? parent.hash + parent.hash << 8 : 0) + indent + (indent << 4) + flags + (flags << 6);
1975
- }
1976
-
1977
- const topIndent = new Context(null, 0, 0);
1978
-
1979
- function countIndent(space) {
1980
- let depth = 0;
1981
- for (let i = 0; i < space.length; i++)
1982
- depth += space.charCodeAt(i) == tab ? 8 - (depth % 8) : 1;
1983
- return depth
1984
- }
1985
-
1986
- const stringFlags = new Map([
1987
- [stringStart, 0],
1988
- [stringStartD, cx_DoubleQuote],
1989
- [stringStartL, cx_Long],
1990
- [stringStartLD, cx_Long | cx_DoubleQuote],
1991
- [stringStartR, cx_Raw],
1992
- [stringStartRD, cx_Raw | cx_DoubleQuote],
1993
- [stringStartRL, cx_Raw | cx_Long],
1994
- [stringStartRLD, cx_Raw | cx_Long | cx_DoubleQuote],
1995
- [stringStartF, cx_Format],
1996
- [stringStartFD, cx_Format | cx_DoubleQuote],
1997
- [stringStartFL, cx_Format | cx_Long],
1998
- [stringStartFLD, cx_Format | cx_Long | cx_DoubleQuote],
1999
- [stringStartFR, cx_Format | cx_Raw],
2000
- [stringStartFRD, cx_Format | cx_Raw | cx_DoubleQuote],
2001
- [stringStartFRL, cx_Format | cx_Raw | cx_Long],
2002
- [stringStartFRLD, cx_Format | cx_Raw | cx_Long | cx_DoubleQuote]
2003
- ].map(([term, flags]) => [term, flags | cx_String]));
2004
-
2005
- const trackIndent = new ContextTracker({
2006
- start: topIndent,
2007
- reduce(context, term, _, input) {
2008
- if ((context.flags & cx_Bracketed) && bracketed.has(term) ||
2009
- (term == String$1 || term == FormatString) && (context.flags & cx_String))
2010
- return context.parent
2011
- return context
2012
- },
2013
- shift(context, term, stack, input) {
2014
- if (term == indent)
2015
- return new Context(context, countIndent(input.read(input.pos, stack.pos)), 0)
2016
- if (term == dedent)
2017
- return context.parent
2018
- if (term == ParenL || term == BracketL || term == BraceL || term == replacementStart)
2019
- return new Context(context, 0, cx_Bracketed)
2020
- if (stringFlags.has(term))
2021
- return new Context(context, 0, stringFlags.get(term) | (context.flags & cx_Bracketed))
2022
- return context
2023
- },
2024
- hash(context) { return context.hash }
2025
- });
2026
-
2027
- const legacyPrint = new ExternalTokenizer(input => {
2028
- for (let i = 0; i < 5; i++) {
2029
- if (input.next != "print".charCodeAt(i)) return
2030
- input.advance();
2031
- }
2032
- if (/\w/.test(String.fromCharCode(input.next))) return
2033
- for (let off = 0;; off++) {
2034
- let next = input.peek(off);
2035
- if (next == space || next == tab) continue
2036
- if (next != parenOpen && next != dot && next != newline && next != carriageReturn && next != hash)
2037
- input.acceptToken(printKeyword);
2038
- return
2039
- }
2040
- });
2041
-
2042
- const strings = new ExternalTokenizer((input, stack) => {
2043
- let {flags} = stack.context;
2044
- let quote = (flags & cx_DoubleQuote) ? doubleQuote : singleQuote;
2045
- let long = (flags & cx_Long) > 0;
2046
- let escapes = !(flags & cx_Raw);
2047
- let format = (flags & cx_Format) > 0;
2048
-
2049
- let start = input.pos;
2050
- for (;;) {
2051
- if (input.next < 0) {
2052
- break
2053
- } else if (format && input.next == braceOpen) {
2054
- if (input.peek(1) == braceOpen) {
2055
- input.advance(2);
2056
- } else {
2057
- if (input.pos == start) {
2058
- input.acceptToken(replacementStart, 1);
2059
- return
2060
- }
2061
- break
2062
- }
2063
- } else if (escapes && input.next == backslash) {
2064
- if (input.pos == start) {
2065
- input.advance();
2066
- let escaped = input.next;
2067
- if (escaped >= 0) {
2068
- input.advance();
2069
- skipEscape(input, escaped);
2070
- }
2071
- input.acceptToken(Escape);
2072
- return
2073
- }
2074
- break
2075
- } else if (input.next == quote && (!long || input.peek(1) == quote && input.peek(2) == quote)) {
2076
- if (input.pos == start) {
2077
- input.acceptToken(stringEnd, long ? 3 : 1);
2078
- return
2079
- }
2080
- break
2081
- } else if (input.next == newline) {
2082
- if (long) {
2083
- input.advance();
2084
- } else if (input.pos == start) {
2085
- input.acceptToken(stringEnd);
2086
- return
2087
- }
2088
- break
2089
- } else {
2090
- input.advance();
2091
- }
2092
- }
2093
- if (input.pos > start) input.acceptToken(stringContent);
2094
- });
2095
-
2096
- function skipEscape(input, ch) {
2097
- if (ch == letter_o) {
2098
- for (let i = 0; i < 2 && input.next >= 48 && input.next <= 55; i++) input.advance();
2099
- } else if (ch == letter_x) {
2100
- for (let i = 0; i < 2 && isHex(input.next); i++) input.advance();
2101
- } else if (ch == letter_u) {
2102
- for (let i = 0; i < 4 && isHex(input.next); i++) input.advance();
2103
- } else if (ch == letter_U) {
2104
- for (let i = 0; i < 8 && isHex(input.next); i++) input.advance();
2105
- } else if (ch == letter_N) {
2106
- if (input.next == braceOpen) {
2107
- input.advance();
2108
- while (input.next >= 0 && input.next != braceClose && input.next != singleQuote &&
2109
- input.next != doubleQuote && input.next != newline) input.advance();
2110
- if (input.next == braceClose) input.advance();
2111
- }
2112
- }
2113
- }
2114
-
2115
- const pythonHighlighting = styleTags({
2116
- "async \"*\" \"**\" FormatConversion FormatSpec": tags.modifier,
2117
- "for while if elif else try except finally return raise break continue with pass assert await yield match case": tags.controlKeyword,
2118
- "in not and or is del": tags.operatorKeyword,
2119
- "from def class global nonlocal lambda": tags.definitionKeyword,
2120
- import: tags.moduleKeyword,
2121
- "with as print": tags.keyword,
2122
- Boolean: tags.bool,
2123
- None: tags.null,
2124
- VariableName: tags.variableName,
2125
- "CallExpression/VariableName": tags.function(tags.variableName),
2126
- "FunctionDefinition/VariableName": tags.function(tags.definition(tags.variableName)),
2127
- "ClassDefinition/VariableName": tags.definition(tags.className),
2128
- PropertyName: tags.propertyName,
2129
- "CallExpression/MemberExpression/PropertyName": tags.function(tags.propertyName),
2130
- Comment: tags.lineComment,
2131
- Number: tags.number,
2132
- String: tags.string,
2133
- FormatString: tags.special(tags.string),
2134
- Escape: tags.escape,
2135
- UpdateOp: tags.updateOperator,
2136
- "ArithOp!": tags.arithmeticOperator,
2137
- BitOp: tags.bitwiseOperator,
2138
- CompareOp: tags.compareOperator,
2139
- AssignOp: tags.definitionOperator,
2140
- Ellipsis: tags.punctuation,
2141
- At: tags.meta,
2142
- "( )": tags.paren,
2143
- "[ ]": tags.squareBracket,
2144
- "{ }": tags.brace,
2145
- ".": tags.derefOperator,
2146
- ", ;": tags.separator
2147
- });
2148
-
2149
- // This file was generated by lezer-generator. You probably shouldn't edit it.
2150
- const spec_identifier = {__proto__:null,await:44, or:54, and:56, in:60, not:62, is:64, if:70, else:72, lambda:76, yield:94, from:96, async:102, for:104, None:162, True:164, False:164, del:178, pass:182, break:186, continue:190, return:194, raise:202, import:206, as:208, global:212, nonlocal:214, assert:218, type:223, elif:236, while:240, try:246, except:248, finally:250, with:254, def:258, class:268, match:279, case:285};
2151
- const parser = LRParser.deserialize({
2152
- version: 14,
2153
- states: "##jO`QeOOP$}OSOOO&WQtO'#HUOOQS'#Co'#CoOOQS'#Cp'#CpO'vQdO'#CnO*UQtO'#HTOOQS'#HU'#HUOOQS'#DU'#DUOOQS'#HT'#HTO*rQdO'#D_O+VQdO'#DfO+gQdO'#DjO+zOWO'#DuO,VO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'w(p(r)t,P%S!uYZ[drxy}!P!Q!U!i!k#[#y#{#}$Q$h$}%S%^%`%g%l%n%w&Z&j&k&u&x'P'W'Z'l'm'p'r's(O(W(^(d(g(z)^)e)g)p)z*O*Y*d*g*h*k*q*t*v*y*z*}+U+V+Y+a+d+k,X,Y,],g,h,i,k,l,o,s,u,w,y,z-O-d-f-m-p.f.g/Z0i0j0kQ#qpW%W!o!s0d0nQ%X!pQ%Y!qQ%[!tQ%f0cS'v%Z0hQ'x0eQ'y0fQ,p*rQ-u,qS.i-s/sR0p0rU#uq.k0qR(w&][cOn#g$j)t,PZ!xY#[#}$Q+YQ#W[Q#zrR$TxQ%b!yQ%i!}Q%o#RQ'j${Q(V%eQ(Z%jQ(c%pQ(f%qQ*|(`Q,f*bQ-t,pQ.m-uR/].lQ$StQ(R%cR*s(SQ.l-sR/}/sR#QZR#V[R%Q!iQ%O!iV*c'm*d,g!]!lQ!n#c#p$R$d$p$u$v$w$x$y$z%e%j%p%q&`'O'g(q(|)j*o*x+w,v/q0gR%T!kT#]^#_Q%x#[R,{+YQ(m%xS+_(n(oQ,}+`Q-x,{S.n-y-zR/^.oT+Z(k+]Q$`}Q&g$QQ)o'PR+{)pQ$XzQ)W&qR+i)XQ$XzQ&o$WQ)W&qR+i)XQ#khW$Vz$W&q)XQ$[{Q&r$ZZ)R&l)S+f+g-RR$^|R)c&wXlOn)t,PQ$f!RR'Q$gQ$m!UR'R$hR*X'_Q*V'_V-g,`-h.TQ.d-lQ/P.^R/Q._U.]-l.^._Q/U.aQ/b.tQ/g.zU/i.|/j/yQ/n/RQ/|/oQ0O/tU0Q/u0S0[Q0]0UQ0a0ZR0b0^R/T.`R/d.t",
2156
- nodeNames: "⚠ print Escape { Comment Script AssignStatement * BinaryExpression BitOp BitOp BitOp BitOp ArithOp ArithOp @ ArithOp ** UnaryExpression ArithOp BitOp AwaitExpression await ) ( ParenthesizedExpression BinaryExpression or and CompareOp in not is UnaryExpression ConditionalExpression if else LambdaExpression lambda ParamList VariableName AssignOp , : NamedExpression AssignOp YieldExpression yield from TupleExpression ComprehensionExpression async for LambdaExpression ] [ ArrayExpression ArrayComprehensionExpression } { DictionaryExpression DictionaryComprehensionExpression SetExpression SetComprehensionExpression CallExpression ArgList AssignOp MemberExpression . PropertyName Number String FormatString FormatReplacement FormatSelfDoc FormatConversion FormatSpec FormatReplacement FormatSelfDoc ContinuedString Ellipsis None Boolean TypeDef AssignOp UpdateStatement UpdateOp ExpressionStatement DeleteStatement del PassStatement pass BreakStatement break ContinueStatement continue ReturnStatement return YieldStatement PrintStatement RaiseStatement raise ImportStatement import as ScopeStatement global nonlocal AssertStatement assert TypeDefinition type TypeParamList TypeParam StatementGroup ; IfStatement Body elif WhileStatement while ForStatement TryStatement try except finally WithStatement with FunctionDefinition def ParamList AssignOp TypeDef ClassDefinition class DecoratedStatement Decorator At MatchStatement match MatchBody MatchClause case CapturePattern LiteralPattern ArithOp ArithOp AsPattern OrPattern LogicOp AttributePattern SequencePattern MappingPattern StarPattern ClassPattern PatternArgList KeywordPattern KeywordPattern Guard",
2157
- maxTerm: 277,
2158
- context: trackIndent,
2159
- nodeProps: [
2160
- ["isolate", -5,4,71,72,73,77,""],
2161
- ["group", -15,6,85,87,88,90,92,94,96,98,99,100,102,105,108,110,"Statement Statement",-22,8,18,21,25,40,49,50,56,57,60,61,62,63,64,67,70,71,72,79,80,81,82,"Expression",-10,114,116,119,121,122,126,128,133,135,138,"Statement",-9,143,144,147,148,150,151,152,153,154,"Pattern"],
2162
- ["openedBy", 23,"(",54,"[",58,"{"],
2163
- ["closedBy", 24,")",55,"]",59,"}"]
2164
- ],
2165
- propSources: [pythonHighlighting],
2166
- skippedNodes: [0,4],
2167
- repeatNodeCount: 34,
2168
- tokenData: "!2|~R!`OX%TXY%oY[%T[]%o]p%Tpq%oqr'ars)Yst*xtu%Tuv,dvw-hwx.Uxy/tyz0[z{0r{|2S|}2p}!O3W!O!P4_!P!Q:Z!Q!R;k!R![>_![!]Do!]!^Es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`!i!}JU!}#R%T#R#SJU#S#T%T#T#UJU#U#VLx#V#YJU#Y#Z!(`#Z#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUo!.}a&n`&YS%uZOr%Trs)Ysw%Twx.Ux!Q%T!Q![JU![!c%T!c!}JU!}#R%T#R#SJU#S#T%T#T#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUk!0ZT!XZ&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc!0qT!WR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tj!1XV%kQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T~!1sO!]~k!1zV%jR&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T~!2fO![~i!2mT%tX&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T",
2169
- tokenizers: [legacyPrint, indentation, newlines, strings, 0, 1, 2, 3, 4],
2170
- topRules: {"Script":[0,5]},
2171
- specialized: [{term: 221, get: (value) => spec_identifier[value] || -1}],
2172
- tokenPrec: 7652
2173
- });
2174
-
2175
- const cache = /*@__PURE__*/new NodeWeakMap();
2176
- const ScopeNodes = /*@__PURE__*/new Set([
2177
- "Script", "Body",
2178
- "FunctionDefinition", "ClassDefinition", "LambdaExpression",
2179
- "ForStatement", "MatchClause"
2180
- ]);
2181
- function defID(type) {
2182
- return (node, def, outer) => {
2183
- if (outer)
2184
- return false;
2185
- let id = node.node.getChild("VariableName");
2186
- if (id)
2187
- def(id, type);
2188
- return true;
2189
- };
2190
- }
2191
- const gatherCompletions = {
2192
- FunctionDefinition: /*@__PURE__*/defID("function"),
2193
- ClassDefinition: /*@__PURE__*/defID("class"),
2194
- ForStatement(node, def, outer) {
2195
- if (outer)
2196
- for (let child = node.node.firstChild; child; child = child.nextSibling) {
2197
- if (child.name == "VariableName")
2198
- def(child, "variable");
2199
- else if (child.name == "in")
2200
- break;
2201
- }
2202
- },
2203
- ImportStatement(_node, def) {
2204
- var _a, _b;
2205
- let { node } = _node;
2206
- let isFrom = ((_a = node.firstChild) === null || _a === void 0 ? void 0 : _a.name) == "from";
2207
- for (let ch = node.getChild("import"); ch; ch = ch.nextSibling) {
2208
- if (ch.name == "VariableName" && ((_b = ch.nextSibling) === null || _b === void 0 ? void 0 : _b.name) != "as")
2209
- def(ch, isFrom ? "variable" : "namespace");
2210
- }
2211
- },
2212
- AssignStatement(node, def) {
2213
- for (let child = node.node.firstChild; child; child = child.nextSibling) {
2214
- if (child.name == "VariableName")
2215
- def(child, "variable");
2216
- else if (child.name == ":" || child.name == "AssignOp")
2217
- break;
2218
- }
2219
- },
2220
- ParamList(node, def) {
2221
- for (let prev = null, child = node.node.firstChild; child; child = child.nextSibling) {
2222
- if (child.name == "VariableName" && (!prev || !/\*|AssignOp/.test(prev.name)))
2223
- def(child, "variable");
2224
- prev = child;
2225
- }
2226
- },
2227
- CapturePattern: /*@__PURE__*/defID("variable"),
2228
- AsPattern: /*@__PURE__*/defID("variable"),
2229
- __proto__: null
2230
- };
2231
- function getScope(doc, node) {
2232
- let cached = cache.get(node);
2233
- if (cached)
2234
- return cached;
2235
- let completions = [], top = true;
2236
- function def(node, type) {
2237
- let name = doc.sliceString(node.from, node.to);
2238
- completions.push({ label: name, type });
2239
- }
2240
- node.cursor(IterMode.IncludeAnonymous).iterate(node => {
2241
- if (node.name) {
2242
- let gather = gatherCompletions[node.name];
2243
- if (gather && gather(node, def, top) || !top && ScopeNodes.has(node.name))
2244
- return false;
2245
- top = false;
2246
- }
2247
- else if (node.to - node.from > 8192) {
2248
- // Allow caching for bigger internal nodes
2249
- for (let c of getScope(doc, node.node))
2250
- completions.push(c);
2251
- return false;
2252
- }
2253
- });
2254
- cache.set(node, completions);
2255
- return completions;
2256
- }
2257
- const Identifier = /^[\w\xa1-\uffff][\w\d\xa1-\uffff]*$/;
2258
- const dontComplete = ["String", "FormatString", "Comment", "PropertyName"];
2259
- /**
2260
- Completion source that looks up locally defined names in
2261
- Python code.
2262
- */
2263
- function localCompletionSource(context) {
2264
- let inner = syntaxTree(context.state).resolveInner(context.pos, -1);
2265
- if (dontComplete.indexOf(inner.name) > -1)
2266
- return null;
2267
- let isWord = inner.name == "VariableName" ||
2268
- inner.to - inner.from < 20 && Identifier.test(context.state.sliceDoc(inner.from, inner.to));
2269
- if (!isWord && !context.explicit)
2270
- return null;
2271
- let options = [];
2272
- for (let pos = inner; pos; pos = pos.parent) {
2273
- if (ScopeNodes.has(pos.name))
2274
- options = options.concat(getScope(context.state.doc, pos));
2275
- }
2276
- return {
2277
- options,
2278
- from: isWord ? inner.from : context.pos,
2279
- validFor: Identifier
2280
- };
2281
- }
2282
- const globals = /*@__PURE__*/[
2283
- "__annotations__", "__builtins__", "__debug__", "__doc__", "__import__", "__name__",
2284
- "__loader__", "__package__", "__spec__",
2285
- "False", "None", "True"
2286
- ].map(n => ({ label: n, type: "constant" })).concat(/*@__PURE__*/[
2287
- "ArithmeticError", "AssertionError", "AttributeError", "BaseException", "BlockingIOError",
2288
- "BrokenPipeError", "BufferError", "BytesWarning", "ChildProcessError", "ConnectionAbortedError",
2289
- "ConnectionError", "ConnectionRefusedError", "ConnectionResetError", "DeprecationWarning",
2290
- "EOFError", "Ellipsis", "EncodingWarning", "EnvironmentError", "Exception", "FileExistsError",
2291
- "FileNotFoundError", "FloatingPointError", "FutureWarning", "GeneratorExit", "IOError",
2292
- "ImportError", "ImportWarning", "IndentationError", "IndexError", "InterruptedError",
2293
- "IsADirectoryError", "KeyError", "KeyboardInterrupt", "LookupError", "MemoryError",
2294
- "ModuleNotFoundError", "NameError", "NotADirectoryError", "NotImplemented", "NotImplementedError",
2295
- "OSError", "OverflowError", "PendingDeprecationWarning", "PermissionError", "ProcessLookupError",
2296
- "RecursionError", "ReferenceError", "ResourceWarning", "RuntimeError", "RuntimeWarning",
2297
- "StopAsyncIteration", "StopIteration", "SyntaxError", "SyntaxWarning", "SystemError",
2298
- "SystemExit", "TabError", "TimeoutError", "TypeError", "UnboundLocalError", "UnicodeDecodeError",
2299
- "UnicodeEncodeError", "UnicodeError", "UnicodeTranslateError", "UnicodeWarning", "UserWarning",
2300
- "ValueError", "Warning", "ZeroDivisionError"
2301
- ].map(n => ({ label: n, type: "type" }))).concat(/*@__PURE__*/[
2302
- "bool", "bytearray", "bytes", "classmethod", "complex", "float", "frozenset", "int", "list",
2303
- "map", "memoryview", "object", "range", "set", "staticmethod", "str", "super", "tuple", "type"
2304
- ].map(n => ({ label: n, type: "class" }))).concat(/*@__PURE__*/[
2305
- "abs", "aiter", "all", "anext", "any", "ascii", "bin", "breakpoint", "callable", "chr",
2306
- "compile", "delattr", "dict", "dir", "divmod", "enumerate", "eval", "exec", "exit", "filter",
2307
- "format", "getattr", "globals", "hasattr", "hash", "help", "hex", "id", "input", "isinstance",
2308
- "issubclass", "iter", "len", "license", "locals", "max", "min", "next", "oct", "open",
2309
- "ord", "pow", "print", "property", "quit", "repr", "reversed", "round", "setattr", "slice",
2310
- "sorted", "sum", "vars", "zip"
2311
- ].map(n => ({ label: n, type: "function" })));
2312
- const snippets = [
2313
- /*@__PURE__*/snippetCompletion("def ${name}(${params}):\n\t${}", {
2314
- label: "def",
2315
- detail: "function",
2316
- type: "keyword"
2317
- }),
2318
- /*@__PURE__*/snippetCompletion("for ${name} in ${collection}:\n\t${}", {
2319
- label: "for",
2320
- detail: "loop",
2321
- type: "keyword"
2322
- }),
2323
- /*@__PURE__*/snippetCompletion("while ${}:\n\t${}", {
2324
- label: "while",
2325
- detail: "loop",
2326
- type: "keyword"
2327
- }),
2328
- /*@__PURE__*/snippetCompletion("try:\n\t${}\nexcept ${error}:\n\t${}", {
2329
- label: "try",
2330
- detail: "/ except block",
2331
- type: "keyword"
2332
- }),
2333
- /*@__PURE__*/snippetCompletion("if ${}:\n\t\n", {
2334
- label: "if",
2335
- detail: "block",
2336
- type: "keyword"
2337
- }),
2338
- /*@__PURE__*/snippetCompletion("if ${}:\n\t${}\nelse:\n\t${}", {
2339
- label: "if",
2340
- detail: "/ else block",
2341
- type: "keyword"
2342
- }),
2343
- /*@__PURE__*/snippetCompletion("class ${name}:\n\tdef __init__(self, ${params}):\n\t\t\t${}", {
2344
- label: "class",
2345
- detail: "definition",
2346
- type: "keyword"
2347
- }),
2348
- /*@__PURE__*/snippetCompletion("import ${module}", {
2349
- label: "import",
2350
- detail: "statement",
2351
- type: "keyword"
2352
- }),
2353
- /*@__PURE__*/snippetCompletion("from ${module} import ${names}", {
2354
- label: "from",
2355
- detail: "import",
2356
- type: "keyword"
2357
- })
2358
- ];
2359
- /**
2360
- Autocompletion for built-in Python globals and keywords.
2361
- */
2362
- const globalCompletion = /*@__PURE__*/ifNotIn(dontComplete, /*@__PURE__*/completeFromList(/*@__PURE__*/globals.concat(snippets)));
2363
-
2364
- function innerBody(context) {
2365
- let { node, pos } = context;
2366
- let lineIndent = context.lineIndent(pos, -1);
2367
- let found = null;
2368
- for (;;) {
2369
- let before = node.childBefore(pos);
2370
- if (!before) {
2371
- break;
2372
- }
2373
- else if (before.name == "Comment") {
2374
- pos = before.from;
2375
- }
2376
- else if (before.name == "Body") {
2377
- if (context.baseIndentFor(before) + context.unit <= lineIndent)
2378
- found = before;
2379
- node = before;
2380
- }
2381
- else if (before.type.is("Statement")) {
2382
- node = before;
2383
- }
2384
- else {
2385
- break;
2386
- }
2387
- }
2388
- return found;
2389
- }
2390
- function indentBody(context, node) {
2391
- let base = context.baseIndentFor(node);
2392
- let line = context.lineAt(context.pos, -1), to = line.from + line.text.length;
2393
- // Don't consider blank, deindented lines at the end of the
2394
- // block part of the block
2395
- if (/^\s*($|#)/.test(line.text) &&
2396
- context.node.to < to + 100 &&
2397
- !/\S/.test(context.state.sliceDoc(to, context.node.to)) &&
2398
- context.lineIndent(context.pos, -1) <= base)
2399
- return null;
2400
- // A normally deindenting keyword that appears at a higher
2401
- // indentation than the block should probably be handled by the next
2402
- // level
2403
- if (/^\s*(else:|elif |except |finally:)/.test(context.textAfter) && context.lineIndent(context.pos, -1) > base)
2404
- return null;
2405
- return base + context.unit;
2406
- }
2407
- /**
2408
- A language provider based on the [Lezer Python
2409
- parser](https://github.com/lezer-parser/python), extended with
2410
- highlighting and indentation information.
2411
- */
2412
- const pythonLanguage = /*@__PURE__*/LRLanguage.define({
2413
- name: "python",
2414
- parser: /*@__PURE__*/parser.configure({
2415
- props: [
2416
- /*@__PURE__*/indentNodeProp.add({
2417
- Body: context => {
2418
- var _a;
2419
- let inner = innerBody(context);
2420
- return (_a = indentBody(context, inner || context.node)) !== null && _a !== void 0 ? _a : context.continue();
2421
- },
2422
- IfStatement: cx => /^\s*(else:|elif )/.test(cx.textAfter) ? cx.baseIndent : cx.continue(),
2423
- "ForStatement WhileStatement": cx => /^\s*else:/.test(cx.textAfter) ? cx.baseIndent : cx.continue(),
2424
- TryStatement: cx => /^\s*(except |finally:|else:)/.test(cx.textAfter) ? cx.baseIndent : cx.continue(),
2425
- "TupleExpression ComprehensionExpression ParamList ArgList ParenthesizedExpression": /*@__PURE__*/delimitedIndent({ closing: ")" }),
2426
- "DictionaryExpression DictionaryComprehensionExpression SetExpression SetComprehensionExpression": /*@__PURE__*/delimitedIndent({ closing: "}" }),
2427
- "ArrayExpression ArrayComprehensionExpression": /*@__PURE__*/delimitedIndent({ closing: "]" }),
2428
- "String FormatString": () => null,
2429
- Script: context => {
2430
- var _a;
2431
- let inner = innerBody(context);
2432
- return (_a = (inner && indentBody(context, inner))) !== null && _a !== void 0 ? _a : context.continue();
2433
- }
2434
- }),
2435
- /*@__PURE__*/foldNodeProp.add({
2436
- "ArrayExpression DictionaryExpression SetExpression TupleExpression": foldInside,
2437
- Body: (node, state) => ({ from: node.from + 1, to: node.to - (node.to == state.doc.length ? 0 : 1) })
2438
- })
2439
- ],
2440
- }),
2441
- languageData: {
2442
- closeBrackets: {
2443
- brackets: ["(", "[", "{", "'", '"', "'''", '"""'],
2444
- stringPrefixes: ["f", "fr", "rf", "r", "u", "b", "br", "rb",
2445
- "F", "FR", "RF", "R", "U", "B", "BR", "RB"]
2446
- },
2447
- commentTokens: { line: "#" },
2448
- indentOnInput: /^\s*([\}\]\)]|else:|elif |except |finally:)$/
2449
- }
2450
- });
2451
- /**
2452
- Python language support.
2453
- */
2454
- function python() {
2455
- return new LanguageSupport(pythonLanguage, [
2456
- pythonLanguage.data.of({ autocomplete: localCompletionSource }),
2457
- pythonLanguage.data.of({ autocomplete: globalCompletion }),
2458
- ]);
2459
- }
2460
-
2461
- export { globalCompletion, localCompletionSource, python, pythonLanguage };
2462
- //# sourceMappingURL=codemirror_lang-python-D9DYtDWr.js.map