@exercism/codemirror-lang-shell 0.0.0-stage → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs ADDED
@@ -0,0 +1,2188 @@
1
+ 'use strict';
2
+
3
+ var lr = require('@lezer/lr');
4
+ var language = require('@codemirror/language');
5
+ var highlight = require('@lezer/highlight');
6
+ var common = require('@lezer/common');
7
+ var autocomplete = require('@codemirror/autocomplete');
8
+
9
+ // This file was generated by lezer-generator. You probably shouldn't edit it.
10
+ const If$2 = 1,
11
+ Then$1 = 2,
12
+ Elif = 3,
13
+ Else$2 = 4,
14
+ Fi = 5,
15
+ For$1 = 6,
16
+ While$2 = 7,
17
+ Until = 8,
18
+ Do = 9,
19
+ Done = 10,
20
+ Case$2 = 11,
21
+ Esac = 12,
22
+ In$1 = 13,
23
+ Function$1 = 14,
24
+ Select = 15,
25
+ Time = 16,
26
+ Always = 17,
27
+ GroupOpen$1 = 18,
28
+ GroupClose$1 = 19,
29
+ CondOpen = 20,
30
+ CondOp = 21,
31
+ CondMatchOp = 22,
32
+ CondRegexOp = 23,
33
+ CondClose = 24,
34
+ NotOp$1 = 25,
35
+ AssignName = 26,
36
+ ArrayAssignName = 27,
37
+ CompoundAssignName = 28,
38
+ DeclaredName = 29,
39
+ declarationWord = 185,
40
+ Regex = 30,
41
+ Terminator$2 = 31,
42
+ insertedTerminator$2 = 186,
43
+ blankLine$2 = 187,
44
+ HeredocBody$1 = 32,
45
+ Comment$2 = 33,
46
+ wordEnd$2 = 188,
47
+ noSpace = 189,
48
+ LineContinuation$1 = 34,
49
+ GlobQualifier = 35,
50
+ SubscriptOpen$1 = 36,
51
+ ArithOpen = 37,
52
+ SubscriptFlags = 38,
53
+ arithJoin = 190;
54
+
55
+ const space$2 = 32, tab$2 = 9, carriage$2 = 13, lineFeed$2 = 10, hash$2 = 35, semi$2 = 59, amp$2 = 38, pipe$2 = 124, lt$2 = 60, gt$2 = 62, parenL$1 = 40, parenR$2 = 41, braceL$1 = 123, braceR$1 = 125, bracketL$1 = 91, bracketR$1 = 93, bang = 33, dash$1 = 45, plus$1 = 43, eq = 61, dollar = 36, quote$1 = 34, apostrophe$1 = 39, backtick = 96, backslash$1 = 92, colon$1 = 58, dot = 46;
56
+ function isBlank$2(ch) {
57
+ return ch == space$2 || ch == tab$2 || ch == carriage$2;
58
+ }
59
+ // The characters that end a word. Everything else, `#` and `=` and `[` and `}`
60
+ // included, is an ordinary letter in the middle of one.
61
+ function endsWord$2(ch) {
62
+ return (ch < 0 ||
63
+ isBlank$2(ch) ||
64
+ ch == lineFeed$2 ||
65
+ ch == semi$2 ||
66
+ ch == amp$2 ||
67
+ ch == pipe$2 ||
68
+ ch == parenL$1 ||
69
+ ch == parenR$2 ||
70
+ ch == lt$2 ||
71
+ ch == gt$2);
72
+ }
73
+ function isLower(ch) {
74
+ return ch >= 97 && ch <= 122;
75
+ }
76
+ function isNameStart$2(ch) {
77
+ return (ch >= 65 && ch <= 90) || (ch >= 97 && ch <= 122) || ch == 95;
78
+ }
79
+ function isNameChar$2(ch) {
80
+ return isNameStart$2(ch) || (ch >= 48 && ch <= 57);
81
+ }
82
+ // ksh gives a variable named fields and writes them with a dot, as in
83
+ // `point.x=1`. No other shell has them, and no other shell has anything else
84
+ // that a dot in a name could be.
85
+ function isFieldChar(ch) {
86
+ return isNameChar$2(ch) || ch == dot;
87
+ }
88
+ // ── Words ─────────────────────────────────────────────────────────────────────
89
+ // The pieces of a word are parsed with nothing skipped between them, which
90
+ // leaves the grammar unable to see where the word stops. This token has no
91
+ // width and says exactly that: the shell would end the word here.
92
+ const words$2 = new lr.ExternalTokenizer((input, stack) => {
93
+ // A backslash before a newline joins the two lines. Between words the
94
+ // grammar skips it as space, but inside one it is a piece of the word:
95
+ // `echo ab\` and `cd` on the next line pass one argument. What tells the two
96
+ // apart is whether it touches the word, as with `noSpace` below, and a
97
+ // skipped token cannot also be shifted, so it is produced here. A word is
98
+ // what it touches, so a `|` or a `;` before it leaves nothing to join to and
99
+ // the continuation is space again: `--a|\` on one line and `--b)` on the
100
+ // next is a case pattern of two words.
101
+ if (input.next == backslash$1 &&
102
+ input.peek(1) == lineFeed$2 &&
103
+ !endsWord$2(input.peek(-1)) &&
104
+ stack.canShift(LineContinuation$1)) {
105
+ input.acceptToken(LineContinuation$1, 2);
106
+ return;
107
+ }
108
+ // zsh narrows a glob with a parenthesis after it: `*.txt(D)` matches the
109
+ // hidden files too, `*(.)` only the plain ones. A parenthesis ends a word
110
+ // everywhere else, so this has to be asked before `wordEnd` is, and it is
111
+ // only asked at all where a word is already under way.
112
+ if (input.next == parenL$1 && stack.canShift(GlobQualifier)) {
113
+ const length = globQualifierLength(input);
114
+ if (length) {
115
+ input.acceptToken(GlobQualifier, length);
116
+ return;
117
+ }
118
+ }
119
+ // zsh reaches into an array without braces round it, `$path[1]`. A bracket
120
+ // opens a glob everywhere else in a word, so this is only asked where the
121
+ // parser has just read a `$name` and nothing else could follow it.
122
+ if (input.next == bracketL$1 && stack.canShift(SubscriptOpen$1)) {
123
+ input.acceptToken(SubscriptOpen$1, 1);
124
+ return;
125
+ }
126
+ if (endsWord$2(input.next) && stack.canShift(wordEnd$2)) {
127
+ input.acceptToken(wordEnd$2);
128
+ return;
129
+ }
130
+ // The other half of the same question, and the only place a word has to
131
+ // begin where one has just ended. `x=1` assigns a value and `x= 1` runs a
132
+ // command called `1` with `x` set to nothing, so the value of an assignment
133
+ // has to touch the `=` that introduced it, and `arr=(a b)` has to touch its
134
+ // parenthesis or it is a subshell.
135
+ const before = input.peek(-1);
136
+ if (isBlank$2(before) || before == lineFeed$2 || before < 0)
137
+ return;
138
+ if (startsValue(input.next) && stack.canShift(noSpace))
139
+ input.acceptToken(noSpace);
140
+ }, { contextual: true });
141
+ function startsValue(ch) {
142
+ return ch >= 0 && !endsWord$2(ch) || ch == parenL$1;
143
+ }
144
+ // How long the qualifier is, or nothing if what follows the word is a
145
+ // parenthesis doing something else. Qualifiers are letters and a handful of
146
+ // punctuation; a space or a quote inside means this is a subshell, an extended
147
+ // pattern, or the parenthesis of a function definition.
148
+ function globQualifierLength(input) {
149
+ for (let at = 1; at < 64; at++) {
150
+ const ch = input.peek(at);
151
+ if (ch == parenR$2)
152
+ return at > 1 ? at + 1 : 0;
153
+ if (!isQualifierChar(ch))
154
+ return 0;
155
+ }
156
+ return 0;
157
+ }
158
+ // A qualifier is letters and a little punctuation. The `#` is the flag form,
159
+ // `(#qN)` rather than `(N)`, which is what a pattern has to write when the
160
+ // option that allows the short one is off.
161
+ function isQualifierChar(ch) {
162
+ return (isNameChar$2(ch) ||
163
+ ch == dot ||
164
+ ch == hash$2 ||
165
+ ch == dash$1 ||
166
+ ch == plus$1 ||
167
+ ch == 42 /* * */ ||
168
+ ch == 44 /* , */ ||
169
+ ch == 47 /* / */ ||
170
+ ch == 58 /* : */ ||
171
+ ch == 64 /* @ */ ||
172
+ ch == 94 /* ^ */ ||
173
+ ch == bracketL$1 ||
174
+ ch == bracketR$1);
175
+ }
176
+ // ── Arithmetic commands ───────────────────────────────────────────────────────
177
+ // `(( i++ ))` evaluates and `( (a) && b )` is a subshell holding a group. Three
178
+ // parens in a row are the one place the two readings collide, and which is
179
+ // meant is settled by how the whole thing closes: arithmetic ends in `))` and
180
+ // a subshell ends in a single `)`.
181
+ //
182
+ // ((( n % 15 == 0 )) && echo) a subshell holding an arithmetic command
183
+ // (((x += 2) <= 8)) arithmetic holding a parenthesised sum
184
+ //
185
+ // The shell decides this by parsing the arithmetic and taking the other
186
+ // reading when that fails, which is a thing a parser with no backtracking
187
+ // cannot do. Counting the parens gets the same answer.
188
+ const arithCommands = new lr.ExternalTokenizer((input, stack) => {
189
+ if (input.next == parenL$1 && stack.canShift(SubscriptFlags)) {
190
+ const length = subscriptFlagsLength(input);
191
+ if (length) {
192
+ input.acceptToken(SubscriptFlags, length);
193
+ return;
194
+ }
195
+ }
196
+ if (input.next != parenL$1 || input.peek(1) != parenL$1)
197
+ return;
198
+ if (!stack.canShift(ArithOpen))
199
+ return;
200
+ if (input.peek(2) == parenL$1 && !closesTwice(input))
201
+ return;
202
+ input.advance(2);
203
+ input.acceptToken(ArithOpen);
204
+ }, { contextual: true });
205
+ // Inside arithmetic, two pieces that touch are one operand: `0x$hex` and
206
+ // `1$(date +%j)`. This token has no width and stands between them. It is only
207
+ // produced after a name, a number or a closing bracket, and before a `$`, a
208
+ // backtick or a letter, so that `a+b` and `i++` keep their operators.
209
+ const arithJoins = new lr.ExternalTokenizer((input, stack) => {
210
+ const before = input.peek(-1);
211
+ if (!(isNameChar$2(before) || before == parenR$2 || before == braceR$1))
212
+ return;
213
+ const ch = input.next;
214
+ if (!(ch == dollar || ch == backtick || isNameChar$2(ch)))
215
+ return;
216
+ if (stack.canShift(arithJoin))
217
+ input.acceptToken(arithJoin);
218
+ }, { contextual: true });
219
+ // zsh's subscript flags, the letters that say what a subscript is asking for:
220
+ // `(i)` for an index, `(r)` for the value, `(e)` for a plain match, and the
221
+ // ones that take an argument between two colons, `(s: :w)` and `(ib:i+1:)`.
222
+ // Anything else between the parentheses is a group and not a flag.
223
+ const subscriptFlagLetters = "abeifIkKnNprRswW";
224
+ function subscriptFlagsLength(input) {
225
+ let at = 1;
226
+ let letters = 0;
227
+ for (;;) {
228
+ const ch = input.peek(at);
229
+ if (ch < 0 || ch == lineFeed$2)
230
+ return 0;
231
+ if (ch == parenR$2)
232
+ return letters ? at + 1 : 0;
233
+ if (ch == colon$1) {
234
+ at++;
235
+ for (;;) {
236
+ const inner = input.peek(at);
237
+ if (inner < 0 || inner == lineFeed$2)
238
+ return 0;
239
+ at++;
240
+ if (inner == colon$1)
241
+ break;
242
+ }
243
+ continue;
244
+ }
245
+ if (subscriptFlagLetters.indexOf(String.fromCharCode(ch)) < 0)
246
+ return 0;
247
+ letters++;
248
+ at++;
249
+ }
250
+ }
251
+ // How far ahead the paren count will look. Past that the answer is no, which
252
+ // is the reading that costs less when it is wrong: a subshell holds commands,
253
+ // and a command is nearly anything.
254
+ const parenScanLimit = 2048;
255
+ function closesTwice(input) {
256
+ let depth = 0;
257
+ for (let at = 0; at < parenScanLimit; at++) {
258
+ const ch = input.peek(at);
259
+ if (ch < 0)
260
+ return false;
261
+ if (ch == backslash$1)
262
+ at++;
263
+ else if (ch == apostrophe$1 || ch == quote$1)
264
+ at = skipQuoted$1(input, at, parenScanLimit, ch) - 1;
265
+ else if (ch == parenL$1)
266
+ depth++;
267
+ else if (ch == parenR$2 && --depth == 0)
268
+ return input.peek(at - 1) == parenR$2;
269
+ }
270
+ return false;
271
+ }
272
+ // ── Reserved words ────────────────────────────────────────────────────────────
273
+ // Longest first, so `=~` is not read as the `=` inside it.
274
+ const condOperators = [
275
+ ["=~", CondRegexOp],
276
+ ["==", CondMatchOp],
277
+ ["!=", CondMatchOp],
278
+ ["=", CondMatchOp],
279
+ ["<", CondOp],
280
+ [">", CondOp],
281
+ ["-", CondOp]
282
+ ];
283
+ const keywords$3 = {
284
+ if: If$2,
285
+ then: Then$1,
286
+ elif: Elif,
287
+ else: Else$2,
288
+ fi: Fi,
289
+ for: For$1,
290
+ while: While$2,
291
+ until: Until,
292
+ do: Do,
293
+ done: Done,
294
+ case: Case$2,
295
+ esac: Esac,
296
+ in: In$1,
297
+ function: Function$1,
298
+ select: Select,
299
+ time: Time,
300
+ always: Always
301
+ };
302
+ // A reserved word is reserved where a command may start and nowhere else, which
303
+ // is why `while true; do echo done; done` prints the word and then ends the
304
+ // loop. A command cannot start until the one before it is terminated, so the
305
+ // question "is this a keyword" is the question "has the parser room for one",
306
+ // and the parser is the one that knows.
307
+ //
308
+ // `{`, `}`, `[[`, `]]` and `!` are reserved words too, and are here rather than
309
+ // in the grammar's own tokens because a word would otherwise swallow them:
310
+ // `echo }` prints a brace.
311
+ const reservedWords$2 = new lr.ExternalTokenizer((input, stack) => {
312
+ const ch = input.next;
313
+ // An operator inside `[[ ]]` has blanks around it, and the same characters
314
+ // written against a word belong to the word: `[[ $line == *=* ]]` asks
315
+ // whether a line holds an equals sign, and only the first of the three is an
316
+ // operator.
317
+ const before = input.peek(-1);
318
+ if (isBlank$2(before) || before == lineFeed$2) {
319
+ for (const [text, term] of condOperators) {
320
+ let at = 0;
321
+ while (at < text.length && input.peek(at) == text.charCodeAt(at))
322
+ at++;
323
+ if (at < text.length)
324
+ continue;
325
+ if (text == "-" && !(isLower(input.peek(1)) && isLower(input.peek(2))))
326
+ continue;
327
+ const length = text == "-" ? 3 : text.length;
328
+ if (!blankFollows$1(input, length) || !stack.canShift(term))
329
+ continue;
330
+ input.advance(length);
331
+ input.acceptToken(term);
332
+ return;
333
+ }
334
+ }
335
+ // A brace and a `!` open something only when a space follows. `{x,y}` is a
336
+ // brace expansion and `!=` is a comparison, and neither is a reserved word.
337
+ if (ch == braceL$1)
338
+ return takeIf$1(input, stack, GroupOpen$1, 1, blankFollows$1(input, 1));
339
+ if (ch == bang)
340
+ return takeIf$1(input, stack, NotOp$1, 1, blankFollows$1(input, 1));
341
+ if (ch == braceR$1)
342
+ return takeIf$1(input, stack, GroupClose$1, 1, endsWord$2(input.peek(1)));
343
+ if (ch == bracketL$1 && input.peek(1) == bracketL$1)
344
+ return takeIf$1(input, stack, CondOpen, 2, blankFollows$1(input, 2));
345
+ if (ch == bracketR$1 && input.peek(1) == bracketR$1)
346
+ return takeIf$1(input, stack, CondClose, 2, endsWord$2(input.peek(2)));
347
+ if (!isNameStart$2(ch))
348
+ return;
349
+ let length = 0, word = "";
350
+ while (isNameChar$2(input.peek(length)))
351
+ word += String.fromCharCode(input.peek(length++));
352
+ const term = keywords$3[word];
353
+ if (term == null)
354
+ return;
355
+ takeIf$1(input, stack, term, length, endsWord$2(input.peek(length)));
356
+ }, { contextual: true });
357
+ function blankFollows$1(input, at) {
358
+ const ch = input.peek(at);
359
+ return ch < 0 || isBlank$2(ch) || ch == lineFeed$2;
360
+ }
361
+ function takeIf$1(input, stack, term, length, ok) {
362
+ if (!ok || !stack.canShift(term))
363
+ return;
364
+ input.advance(length);
365
+ input.acceptToken(term);
366
+ }
367
+ // ── Assignments ───────────────────────────────────────────────────────────────
368
+ // `x=1` sets a variable and `echo x=1` prints it, and again the difference is
369
+ // position: a word assigns only before the command name has been read. The
370
+ // name and its `=` come out as one token so that what follows is an ordinary
371
+ // word, which is what `x=$(date)` needs it to be.
372
+ const assignments = new lr.ExternalTokenizer((input, stack) => {
373
+ if (!isNameStart$2(input.next))
374
+ return;
375
+ let length = 0;
376
+ while (isFieldChar(input.peek(length)))
377
+ length++;
378
+ // `arr[i]=1` and `arr[$k]=1` assign to one element, and ksh subscripts an
379
+ // array of arrays with `grid[y][x]=1`.
380
+ while (input.peek(length) == bracketL$1) {
381
+ let depth = 1, at = length + 1;
382
+ while (depth > 0) {
383
+ const ch = input.peek(at);
384
+ if (ch < 0 || ch == lineFeed$2)
385
+ return;
386
+ if (ch == bracketL$1)
387
+ depth++;
388
+ else if (ch == bracketR$1)
389
+ depth--;
390
+ at++;
391
+ }
392
+ length = at;
393
+ }
394
+ if (input.peek(length) == plus$1 && input.peek(length + 1) == eq)
395
+ length += 2;
396
+ else if (input.peek(length) == eq)
397
+ length += 1;
398
+ else {
399
+ // `local m` declares `m` with no value. Only a declaration builtin has
400
+ // room for this token, so `echo m` stays a word.
401
+ if (endsWord$2(input.peek(length)) && stack.canShift(DeclaredName)) {
402
+ input.advance(length);
403
+ input.acceptToken(DeclaredName);
404
+ }
405
+ return;
406
+ }
407
+ // ksh's `typeset -T Point_t=( ... )` names a type, and what the parentheses
408
+ // hold is commands rather than words: field declarations and the functions
409
+ // that are the type's methods. Which of the two this is can be read off the
410
+ // body, because a `;` is a syntax error in an array and the punctuation
411
+ // between two commands everywhere else.
412
+ const compound = input.peek(length) == parenL$1 && holdsCommands(input, length);
413
+ // After the command name a word does not assign, with one exception the
414
+ // declaration builtins need: `local -a x=(1 2)` has an array on the right,
415
+ // and an array is the one thing a plain word cannot be.
416
+ let term = -1;
417
+ if (compound && stack.canShift(CompoundAssignName))
418
+ term = CompoundAssignName;
419
+ else if (stack.canShift(AssignName))
420
+ term = AssignName;
421
+ else if (input.peek(length) == parenL$1 && stack.canShift(ArrayAssignName))
422
+ term = ArrayAssignName;
423
+ else
424
+ return;
425
+ input.advance(length);
426
+ input.acceptToken(term);
427
+ }, { contextual: true });
428
+ // The builtins that declare the names they are given. A redirection or a
429
+ // prefix assignment may come before one, and the name has to stand alone:
430
+ // `local=1` assigns a variable called `local`.
431
+ const declarationBuiltins = ["local", "declare", "typeset", "readonly", "export"];
432
+ const declarations = new lr.ExternalTokenizer((input, stack) => {
433
+ if (!isLower(input.next))
434
+ return;
435
+ let length = 0, word = "";
436
+ while (isNameChar$2(input.peek(length)))
437
+ word += String.fromCharCode(input.peek(length++));
438
+ if (declarationBuiltins.indexOf(word) < 0 || !endsWord$2(input.peek(length)))
439
+ return;
440
+ if (!stack.canShift(declarationWord))
441
+ return;
442
+ input.advance(length);
443
+ input.acceptToken(declarationWord);
444
+ }, { contextual: true });
445
+ // Whether the parenthesis at `from` closes over something with a `;` in it,
446
+ // which is to say a list of commands rather than a list of words. Quotes are
447
+ // stepped over so that `x=(a ';' b)` stays an array.
448
+ function holdsCommands(input, from) {
449
+ let depth = 0;
450
+ for (let at = from; at < parenScanLimit; at++) {
451
+ const ch = input.peek(at);
452
+ if (ch < 0)
453
+ return false;
454
+ if (ch == backslash$1)
455
+ at++;
456
+ else if (ch == apostrophe$1 || ch == quote$1)
457
+ at = skipQuoted$1(input, at, parenScanLimit, ch) - 1;
458
+ else if (ch == parenL$1)
459
+ depth++;
460
+ else if (ch == parenR$2 && --depth == 0)
461
+ return false;
462
+ else if (ch == semi$2 && depth == 1)
463
+ return true;
464
+ }
465
+ return false;
466
+ }
467
+ // ── The right-hand side of `=~` ───────────────────────────────────────────────
468
+ // `[[ $f =~ ^a+(b|c)$ ]]` holds a regular expression where a word would hold
469
+ // metacharacters, so it is read to the next space and no further. Space is the
470
+ // only thing that ends it: `(`, `|` and `<` are all ordinary here, which is
471
+ // what a word cannot say.
472
+ //
473
+ // That is the shell's own rule as well. A pattern with a space in it has to be
474
+ // quoted, and a quoted one is an ordinary word, which is why this steps aside
475
+ // for a quote or a `$`. Two spaces are the pattern's own all the same: one
476
+ // written `\ `, and one inside a group, since bash reads a parenthesis here as
477
+ // the regular expression's and keeps what is between them whole.
478
+ const regexps = new lr.ExternalTokenizer((input, stack) => {
479
+ const first = input.next;
480
+ if (first == dollar || first == quote$1 || first == apostrophe$1)
481
+ return;
482
+ if (first < 0 || isBlank$2(first) || first == lineFeed$2 || !stack.canShift(Regex))
483
+ return;
484
+ let length = 0;
485
+ let depth = 0;
486
+ for (;;) {
487
+ const ch = input.peek(length);
488
+ if (ch < 0 || ch == lineFeed$2)
489
+ break;
490
+ if (ch == backslash$1 && input.peek(length + 1) >= 0) {
491
+ length += 2;
492
+ continue;
493
+ }
494
+ if (isBlank$2(ch) && depth == 0)
495
+ break;
496
+ // A quoted piece inside the pattern is matched literally, spaces and all:
497
+ // `[[ $s =~ [$'\n\r \t'] ]]` is a bracket expression holding four blanks.
498
+ if (ch == apostrophe$1 || ch == quote$1) {
499
+ length = skipQuoted$1(input, length, length + parenScanLimit, ch);
500
+ continue;
501
+ }
502
+ if (ch == parenL$1)
503
+ depth++;
504
+ else if (ch == parenR$2 && depth > 0)
505
+ depth--;
506
+ length++;
507
+ }
508
+ input.advance(length);
509
+ input.acceptToken(Regex);
510
+ }, { contextual: true });
511
+ // ── Newlines ──────────────────────────────────────────────────────────────────
512
+ // A newline ends a command where the parser has room for one and is skipped
513
+ // everywhere else, which is every place the shell allows a line to be broken:
514
+ // after `|`, `&&`, `do`, `then`, `else`, `{`, `(` or a `,` in an array.
515
+ //
516
+ // A run of `;` and newlines is one token, so that a blank line between two
517
+ // commands is not mistaken for a command of its own.
518
+ const terminators$2 = new lr.ExternalTokenizer((input, stack) => {
519
+ // The last command in a file, a substitution or a `case` clause needs no
520
+ // terminator of its own, so one is supplied where the text runs out. It is a
521
+ // token of its own width, which is none, and only these three places produce
522
+ // it; a shell that inserted one anywhere would read `if x then` as two
523
+ // commands, and `then` is not a command.
524
+ if (input.next < 0 ||
525
+ input.next == parenR$2 ||
526
+ (input.next == semi$2 && input.peek(1) == semi$2) ||
527
+ // zsh closes a group without asking for a `;` first: `f() { echo hi }` is
528
+ // a whole function. bash wants the semicolon, and a file that has one
529
+ // reads the same either way. A `}` with no group standing open is the
530
+ // character itself, which `echo done }` prints.
531
+ (input.next == braceR$1 && (stack.context > 0 || endsCompound(input))) ||
532
+ // bash lets a closing word follow a compound command straight away:
533
+ // `then { echo 0; exit; } fi` needs no `;` before the `fi`.
534
+ (closingWordAt(input) && endsCompound(input))) {
535
+ if (stack.canShift(insertedTerminator$2))
536
+ input.acceptToken(insertedTerminator$2);
537
+ return;
538
+ }
539
+ if (input.next != lineFeed$2 && input.next != semi$2)
540
+ return;
541
+ let length = 0, newlines = false;
542
+ for (;;) {
543
+ const ch = input.peek(length);
544
+ if (ch == lineFeed$2) {
545
+ length++;
546
+ newlines = true;
547
+ // A line that promised a heredoc has its body on the next line, so the
548
+ // run stops here and the heredoc tokenizer reads what follows.
549
+ if (heredocsBefore(input, length - 1).length)
550
+ break;
551
+ }
552
+ else if (ch == semi$2) {
553
+ // `;;` ends a `case` clause and is not a terminator.
554
+ if (input.peek(length + 1) == semi$2)
555
+ break;
556
+ length++;
557
+ }
558
+ else if (isBlank$2(ch)) {
559
+ length++;
560
+ }
561
+ else {
562
+ break;
563
+ }
564
+ }
565
+ if (length == 0)
566
+ return;
567
+ if (stack.canShift(Terminator$2))
568
+ input.acceptToken(Terminator$2, length);
569
+ // Nothing to end. A run of newlines here is a blank line between commands, or
570
+ // a line broken inside one; either way it is space. A `;` here is the one in
571
+ // a `for ((;;))` header, and is left for the grammar's own token.
572
+ else if (newlines)
573
+ input.acceptToken(blankLine$2, length);
574
+ }, { contextual: true });
575
+ // How many `{` groups the parser stands inside. The question comes up one
576
+ // token before the `}` is read, which is too early to ask the grammar, so the
577
+ // count is kept here.
578
+ const trackGroups = new lr.ContextTracker({
579
+ start: 0,
580
+ shift(depth, term) {
581
+ if (term == GroupOpen$1)
582
+ return depth + 1;
583
+ if (term == GroupClose$1)
584
+ return depth > 0 ? depth - 1 : 0;
585
+ return depth;
586
+ },
587
+ hash: depth => depth
588
+ });
589
+ // `f() { if x; then y; fi }` closes without a `;` and `f() { echo hi }` does
590
+ // not, because `}` is a reserved word where a command may start and a plain
591
+ // word where an argument may. A command that ended in one of the shell's own
592
+ // closing words has left room for another command, so this asks what the line
593
+ // ended with. It is the same question bash asks of the token it read last.
594
+ function endsCompound(input) {
595
+ let at = -1;
596
+ while (isBlank$2(input.peek(at)))
597
+ at--;
598
+ const ch = input.peek(at);
599
+ if (ch == parenR$2 || ch == braceR$1 || ch == bracketR$1)
600
+ return true;
601
+ return closingWords.some(word => {
602
+ const start = at - word.length + 1;
603
+ for (let i = 0; i < word.length; i++)
604
+ if (input.peek(start + i) != word.charCodeAt(i))
605
+ return false;
606
+ if (isNameChar$2(input.peek(start - 1)))
607
+ return false;
608
+ // The word has to be standing where a command could, or it is not the
609
+ // shell's word at all: `echo done` ends in the same four letters and means
610
+ // nothing by them.
611
+ let before = start - 1;
612
+ while (isBlank$2(input.peek(before)))
613
+ before--;
614
+ const previous = input.peek(before);
615
+ return (previous < 0 ||
616
+ previous == semi$2 ||
617
+ previous == lineFeed$2 ||
618
+ previous == amp$2 ||
619
+ previous == pipe$2 ||
620
+ previous == parenL$1 ||
621
+ previous == parenR$2 ||
622
+ previous == braceL$1 ||
623
+ previous == braceR$1);
624
+ });
625
+ }
626
+ const closingWords = ["fi", "done", "esac"];
627
+ // The words that may close or continue a compound command, where one may stand
628
+ // after another compound command with nothing in between.
629
+ const followingWords = ["then", "else", "elif", "fi", "do", "done", "esac"];
630
+ function closingWordAt(input) {
631
+ if (!isLower(input.next))
632
+ return false;
633
+ return followingWords.some(word => {
634
+ for (let i = 0; i < word.length; i++)
635
+ if (input.peek(i) != word.charCodeAt(i))
636
+ return false;
637
+ return endsWord$2(input.peek(word.length));
638
+ });
639
+ }
640
+ // ── Comments ──────────────────────────────────────────────────────────────────
641
+ // `#` to the end of the line, but only where a word could start: `a#b` is one
642
+ // word and `a #b` is a word and a comment. Nothing is skipped inside a word, so
643
+ // this is never asked about a `#` in the middle of one.
644
+ const comments$2 = new lr.ExternalTokenizer((input) => {
645
+ if (input.next != hash$2 || !endsWord$2(input.peek(-1)))
646
+ return;
647
+ while (input.next != lineFeed$2 && input.next >= 0)
648
+ input.advance();
649
+ input.acceptToken(Comment$2);
650
+ });
651
+ // The body of a heredoc starts on the line after the `<<` that promised it, and
652
+ // one line may promise several. Rather than carry the promise from token to
653
+ // token, it is recovered here by reading back over the line that just ended.
654
+ //
655
+ // The body is one token however many heredocs the line opened, and it is
656
+ // skipped like whitespace, since there is nowhere in the grammar for it to go.
657
+ const heredocs$1 = new lr.ExternalTokenizer((input) => {
658
+ if (input.peek(-1) != lineFeed$2)
659
+ return;
660
+ const pending = heredocsBefore(input, -1);
661
+ if (!pending.length)
662
+ return;
663
+ let length = 0;
664
+ for (const heredoc of pending)
665
+ length = skipBody$1(input, length, heredoc);
666
+ if (length > 0)
667
+ input.acceptToken(HeredocBody$1, length);
668
+ });
669
+ // Reads the line that ends at `end` and returns the heredocs it opened.
670
+ function heredocsBefore(input, end) {
671
+ let start = end;
672
+ while (input.peek(start - 1) >= 0 && input.peek(start - 1) != lineFeed$2)
673
+ start--;
674
+ // Cheap way out: a line with no `<` on it opened nothing, and nearly every
675
+ // line is one of those.
676
+ let seen = false;
677
+ for (let at = start; at < end && !seen; at++)
678
+ if (input.peek(at) == lt$2)
679
+ seen = true;
680
+ return seen ? scanLine$1(input, start, end) : none;
681
+ }
682
+ const none = [];
683
+ function scanLine$1(input, start, end) {
684
+ const found = [];
685
+ let at = start, arithmetic = 0;
686
+ while (at < end) {
687
+ const ch = input.peek(at);
688
+ if (ch == backslash$1) {
689
+ at += 2;
690
+ }
691
+ else if (ch == apostrophe$1 || ch == quote$1) {
692
+ at = skipQuoted$1(input, at, end, ch);
693
+ }
694
+ else if (ch == hash$2 && (at == start || endsWord$2(input.peek(at - 1)))) {
695
+ break;
696
+ }
697
+ else if (ch == parenL$1 && input.peek(at + 1) == parenL$1) {
698
+ // `$((1 << 2))` shifts a number and promises nothing.
699
+ arithmetic++;
700
+ at += 2;
701
+ }
702
+ else if (ch == parenR$2 && input.peek(at + 1) == parenR$2 && arithmetic > 0) {
703
+ arithmetic--;
704
+ at += 2;
705
+ }
706
+ else if (ch == lt$2 && input.peek(at + 1) == lt$2 && arithmetic == 0) {
707
+ if (input.peek(at + 2) == lt$2) {
708
+ // `<<<` is a here-string, which is written where it stands.
709
+ at += 3;
710
+ continue;
711
+ }
712
+ at += 2;
713
+ let stripTabs = false;
714
+ if (input.peek(at) == dash$1) {
715
+ stripTabs = true;
716
+ at++;
717
+ }
718
+ while (at < end && isBlank$2(input.peek(at)))
719
+ at++;
720
+ const delimiter = readDelimiter$1(input, at, end);
721
+ at = delimiter.at;
722
+ if (delimiter.text)
723
+ found.push({ delimiter: delimiter.text, stripTabs });
724
+ }
725
+ else {
726
+ at++;
727
+ }
728
+ }
729
+ return found;
730
+ }
731
+ function skipQuoted$1(input, at, end, quoteChar) {
732
+ at++;
733
+ while (at < end) {
734
+ const ch = input.peek(at);
735
+ if (ch == backslash$1 && quoteChar == quote$1)
736
+ at += 2;
737
+ else if (ch == quoteChar)
738
+ return at + 1;
739
+ else
740
+ at++;
741
+ }
742
+ return at;
743
+ }
744
+ // `<<EOF`, `<<'EOF'`, `<<"EOF"` and `<<\EOF` all name the same delimiter. The
745
+ // quoting decides whether the body is expanded, which is a question for the
746
+ // shell rather than for the parser.
747
+ function readDelimiter$1(input, at, end) {
748
+ let text = "";
749
+ while (at < end) {
750
+ const ch = input.peek(at);
751
+ if (ch == apostrophe$1 || ch == quote$1) {
752
+ const closing = ch;
753
+ at++;
754
+ while (at < end && input.peek(at) != closing)
755
+ text += String.fromCharCode(input.peek(at++));
756
+ at++;
757
+ }
758
+ else if (ch == backslash$1) {
759
+ at++;
760
+ if (at < end)
761
+ text += String.fromCharCode(input.peek(at++));
762
+ }
763
+ else if (endsWord$2(ch)) {
764
+ break;
765
+ }
766
+ else {
767
+ text += String.fromCharCode(input.peek(at++));
768
+ }
769
+ }
770
+ return { text, at };
771
+ }
772
+ // Reads lines from `at` until one of them is the delimiter on its own, and
773
+ // returns the offset just past it. An unclosed heredoc runs to the end of the
774
+ // file, which is what the shell does with it too.
775
+ function skipBody$1(input, at, heredoc) {
776
+ for (;;) {
777
+ if (input.peek(at) < 0)
778
+ return at;
779
+ let scan = at;
780
+ if (heredoc.stripTabs)
781
+ while (input.peek(scan) == tab$2)
782
+ scan++;
783
+ let matched = 0;
784
+ while (matched < heredoc.delimiter.length &&
785
+ input.peek(scan + matched) == heredoc.delimiter.charCodeAt(matched))
786
+ matched++;
787
+ const closed = matched == heredoc.delimiter.length &&
788
+ (input.peek(scan + matched) == lineFeed$2 || input.peek(scan + matched) < 0);
789
+ while (input.peek(at) >= 0 && input.peek(at) != lineFeed$2)
790
+ at++;
791
+ if (input.peek(at) == lineFeed$2)
792
+ at++;
793
+ if (closed)
794
+ return at;
795
+ }
796
+ }
797
+
798
+ // This file was generated by lezer-generator. You probably shouldn't edit it.
799
+ const parser$2 = lr.LRParser.deserialize({
800
+ version: 14,
801
+ states: "!,nQ`QBXOOO$WOMhO'#DdO$pO!LQO'#D]O$}Q$KhO'#DqO&OO:QO'#GvOOO#t'#Gv'#GvOOO#t'#Gl'#GlO'cO:QO'#EjOOO#t'#Gh'#GhOOO#t'#Fw'#FwO)qO:QO'#EuO)xQ<lO'#DVO+uQ9pO'#EqO(mQ<fO'#EsOOQ&`'#Gg'#GgOOQ&`'#Fv'#FvO+zQ<lO'#DUOOQ&['#Ew'#EwO,nQ<hO'#DUO-_Q<hO'#DUO.RQBXO'#EyO.qQ9qO'#HQO$}Q$KhO'#FOO.xQ<gO'#FPO/SQBQO'#FdO(mQ<fO'#FhO(mQ<fO'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Odlqrtuvwxy!c!l!{#]#a#b#g#h#j#l#n$q${%c%x&P'h'i'}(O(P(T(s(})V)X)p)q)w*T*U*X*b*c*h#OmOdlqrtuvwxy!c!l!{#]#a#b#g#h#j#l#n$q${%c%x&P'h'i'}(O(P(T(s(})V)X)p)q)w*T*U*X*b*c*hQ&Q#qQ(U%}R)Y(VQ#kwR#mxQ#QgQ%`#RQ%a#SQ'Y%YQ'd%]R'e%^W'^%Z%['_'aT(k'[(lQ#cpQ%i#WQ%n#YQ'h%cQ'l%jQ'r%oQ(z'qQ*R)kQ*`*PQ*g*^R*j*eR%j#WQ%h#WQ%m#YS'k%i%jS'p%n%oQ(t'lS(y'q'rQ)l(zQ*Q)kS*_*P*RS*f*^*`S*i*e*gR*k*j",
804
+ nodeNames: "⚠ if then elif else fi for while until do done case esac in function select time always { } [[ CondOp CondOp CondRegexOp ]] ! AssignName AssignName AssignName VariableName Regex Terminator HeredocBody Comment LineContinuation GlobQualifier [ (( SubscriptFlags Script SimpleCommand Assignment Word ParameterExpansion SimpleExpansion ] Subscript ParameterExpansion ${ ExpansionFlags ParamOp ParamName SpecialParam \" String Escape Dollar ) $( CommandSubstitution [ Subscript ParamOp Glob RawString SimpleExpansion $(( ArithmeticExpansion ArithNumber ArithBase ArithBasePrefix ArithBaseValue ParameterExpansion String CommandSubstitution ArithCall ( ArithmeticExpansion ArithVariable ArithSubscript Backtick ArithGroup ArithBinary ArithPowerOp ArithMulOp ArithAddOp ArithShiftOp ArithRelateOp ArithEqualOp ArithBitAndOp ArithBitXorOp ArithBitOrOp ArithAndOp ArithOrOp ArithConcat ArithUnary ArithNotOp ArithPrefix ArithIncDecOp ArithPostfix ArithTernary ? : ArithAssignment ArithAssignOp ArithSequence ExtGlob ExtGlobStart PipeOp AnsiString ProcessSubstitution ProcessSubstitutionStart ArrayLiteral Assignment CompoundBlock Redirect RedirectOp CommandName Assignment CommandName Subshell Group AlwaysBlock IfStatement ElifClause ElseClause ArithmeticCommand ConditionalExpression CondPrimary CondBinary CondPrimary Word GlobGroup NumRange CondMatch CondAnd AndOp CondOr OrOp CondNegation CondGroup ShortCommand WhileStatement DoGroup Background UntilStatement ForStatement VariableName ArithmeticForStatement ; SelectStatement CaseStatement CaseClause CasePattern CaseTerminator CaseClause FunctionDefinition FunctionName FunctionDefinition Pipeline LogicalList Negation TimedCommand",
805
+ maxTerm: 226,
806
+ context: trackGroups,
807
+ nodeProps: [
808
+ ["openedBy", 45,"[",57,"$( $(( ("],
809
+ ["closedBy", -3,58,66,76,")",60,"]"]
810
+ ],
811
+ skippedNodes: [0,32,33],
812
+ repeatNodeCount: 21,
813
+ tokenData: "%%e~R!OOX$RXY1ZYZ&_Z]$R]^1Z^p$Rpq1Zqr3Trs7xst8ftu=WuvAgvwFXwx!#]xy!)fyz!8Xz{!9o{|!=u|}!AV}!O!Cl!O!P!Hd!P!Q!KW!Q!R!Mp!R![#'i![!]#;S!]!^#@S!^!_#Dt!_!`$!g!`!a$'X!a!b$*|!b!c$,U!c!}$.U!}#O$0z#O#P$2z#P#Q$8b#Q#R$:b#R#S$.U#S#T$<w#T#o$.U#o#p$=x#p#q$Jf#q#r% [#r#s%#R#s;'S$R;'S;=`1T<%lO$R5Z$^o%cQ%_#t%],V%f'[OX$RXZ&_Z]$R]^&_^p$Rpr&_rs'sst$Ruv$Rvw&_wx(exz&_z{(e{|&_|!]$R!]!_&_!_!`$R!`!a&_!a!b(e!b!c&_!c!}$R!}#O+i#O#P's#P#Q+i#Q#S$R#T#p$R#p#q&_#q#r/Y#r;'S$R;'S;=`1T<%lO$R*S&hc%cQ%_#t%f'[Or&_rs'sst&_uw&_wx(exz&_z{(e{!a&_!a!b(e!b!}&_!}#O*V#O#P's#P#Q*V#Q#S&_#T#q&_#q#r(e#r;'S&_;'S;=`+c<%lO&_#t'xV%_#tOt'su!}'s#O#P's#Q#S's#T;'S's;'S;=`(_<%lO's#t(bP;=`<%l's#v(lZ%cQ%_#tOr(ers'sst(eu!}(e!}#O)_#O#P's#P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&_!c!}$R!}#O+i#O#P's#P#Q+i#Q#S$R#T#p$R#p#q&_#q#r/Y#r;'S$R;'S;=`1T<%lO$R",
814
+ tokenizers: [reservedWords$2, assignments, declarations, regexps, terminators$2, heredocs$1, comments$2, words$2, arithCommands, arithJoins, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9],
815
+ topRules: {"Script":[0,39]},
816
+ tokenPrec: 3556
817
+ });
818
+
819
+ /**
820
+ Snippets for the constructs people type most: functions, conditionals,
821
+ loops, `case`, the `[[ ]]` test and arithmetic.
822
+ */
823
+ const snippets = [
824
+ autocomplete.snippetCompletion("${name}() {\n\t${}\n}", { label: "function", detail: "definition", type: "keyword" }),
825
+ autocomplete.snippetCompletion("if ${condition}; then\n\t${}\nfi", { label: "if", detail: "block", type: "keyword" }),
826
+ autocomplete.snippetCompletion("if ${condition}; then\n\t${}\nelse\n\t${}\nfi", {
827
+ label: "if",
828
+ detail: "/ else block",
829
+ type: "keyword"
830
+ }),
831
+ autocomplete.snippetCompletion("if ${condition}; then\n\t${}\nelif ${condition}; then\n\t${}\nelse\n\t${}\nfi", {
832
+ label: "if",
833
+ detail: "/ elif / else block",
834
+ type: "keyword"
835
+ }),
836
+ autocomplete.snippetCompletion("elif ${condition}; then\n\t${}", { label: "elif", detail: "branch", type: "keyword" }),
837
+ autocomplete.snippetCompletion("for ${item} in ${list}; do\n\t${}\ndone", { label: "for", detail: "in loop", type: "keyword" }),
838
+ autocomplete.snippetCompletion("for (( ${i} = 0; ${i} < ${n}; ${i}++ )); do\n\t${}\ndone", {
839
+ label: "for",
840
+ detail: "(( )) loop",
841
+ type: "keyword"
842
+ }),
843
+ autocomplete.snippetCompletion("while ${condition}; do\n\t${}\ndone", { label: "while", detail: "loop", type: "keyword" }),
844
+ autocomplete.snippetCompletion("while IFS= read -r ${line}; do\n\t${}\ndone", {
845
+ label: "while",
846
+ detail: "read loop",
847
+ type: "keyword"
848
+ }),
849
+ autocomplete.snippetCompletion("until ${condition}; do\n\t${}\ndone", { label: "until", detail: "loop", type: "keyword" }),
850
+ autocomplete.snippetCompletion("case ${word} in\n\t${pattern})\n\t\t${}\n\t\t;;\n\t*)\n\t\t;;\nesac", {
851
+ label: "case",
852
+ detail: "statement",
853
+ type: "keyword"
854
+ }),
855
+ autocomplete.snippetCompletion("[[ ${condition} ]]", { label: "[[ ]]", detail: "test", type: "keyword" }),
856
+ autocomplete.snippetCompletion("(( ${expression} ))", { label: "(( ))", detail: "arithmetic", type: "keyword" }),
857
+ autocomplete.snippetCompletion("$(( ${expression} ))", { label: "$(( ))", detail: "arithmetic", type: "keyword" }),
858
+ autocomplete.snippetCompletion("$(${command})", { label: "$( )", detail: "command substitution", type: "keyword" })
859
+ ];
860
+ // After a `$` the snippets above are offered without their `$`, so typing
861
+ // `$` and picking one gives the same text.
862
+ const dollarSnippets = [
863
+ autocomplete.snippetCompletion("(( ${expression} ))", { label: "(( ))", detail: "arithmetic", type: "keyword" }),
864
+ autocomplete.snippetCompletion("(${command})", { label: "( )", detail: "command substitution", type: "keyword" })
865
+ ];
866
+ const keywords$2 = "then else fi do done esac in function select time"
867
+ .split(" ")
868
+ .map(label => ({ label, type: "keyword" }));
869
+ // The shell's builtin commands. These change the shell itself, so a `man`
870
+ // page for them is hard to find.
871
+ const builtins$2 = [
872
+ "alias", "bg", "bind", "break", "builtin", "caller", "cd", "command", "compgen",
873
+ "complete", "continue", "declare", "dirs", "disown", "echo", "enable", "eval",
874
+ "exec", "exit", "export", "false", "fc", "fg", "getopts", "hash", "help",
875
+ "history", "jobs", "kill", "let", "local", "logout", "mapfile", "popd",
876
+ "printf", "pushd", "pwd", "read", "readarray", "readonly", "return", "set",
877
+ "shift", "shopt", "source", "suspend", "test", "times", "trap", "true", "type",
878
+ "typeset", "ulimit", "umask", "unalias", "unset", "wait"
879
+ ];
880
+ // Programs that scripts call most often.
881
+ const commands = [
882
+ "awk", "basename", "bc", "cat", "column", "cp", "cut", "date", "diff",
883
+ "dirname", "env", "expr", "find", "fold", "grep", "head", "ls", "mkdir", "mv",
884
+ "paste", "rev", "rm", "sed", "seq", "sleep", "sort", "tail", "tee", "touch",
885
+ "tr", "uniq", "wc", "xargs"
886
+ ];
887
+ // The variables the shell sets, which cannot be guessed from the language.
888
+ const shellVariables = [
889
+ "BASH", "BASH_REMATCH", "BASH_SOURCE", "BASH_VERSION", "BASHPID", "EUID",
890
+ "FUNCNAME", "GROUPS", "HOME", "HOSTNAME", "IFS", "LANG", "LINENO", "OLDPWD",
891
+ "OPTARG", "OPTIND", "PATH", "PIPESTATUS", "PPID", "PS1", "PS2", "PWD",
892
+ "RANDOM", "REPLY", "SECONDS", "SHELL", "SHLVL", "TMPDIR", "UID", "USER"
893
+ ];
894
+ // The positional and special parameters, offered after `$` and `${`.
895
+ const parameters = [
896
+ ..."123456789".split("").map(label => ({ label, type: "variable", detail: "positional parameter" })),
897
+ { label: "@", type: "variable", detail: "all arguments" },
898
+ { label: "*", type: "variable", detail: "all arguments as one word" },
899
+ { label: "#", type: "variable", detail: "number of arguments" },
900
+ { label: "?", type: "variable", detail: "last exit status" },
901
+ { label: "0", type: "variable", detail: "script name" },
902
+ { label: "$", type: "variable", detail: "process id" },
903
+ { label: "!", type: "variable", detail: "last background process id" }
904
+ ];
905
+ const wordOptions = [
906
+ ...snippets,
907
+ ...keywords$2,
908
+ ...builtins$2.map(label => ({ label, type: "function", detail: "builtin" })),
909
+ ...commands.map(label => ({ label, type: "function", detail: "command" }))
910
+ ];
911
+ const variableOptions = shellVariables.map(label => ({ label, type: "constant" }));
912
+ const cache = new WeakMap();
913
+ function text(state, node) {
914
+ return state.sliceDoc(node.from, node.to);
915
+ }
916
+ const nameAtStart = /^[A-Za-z_][A-Za-z0-9_]*/;
917
+ function nameOf(state, node) {
918
+ const match = nameAtStart.exec(text(state, node));
919
+ return match ? match[0] : null;
920
+ }
921
+ function functionAround(node) {
922
+ for (let n = node === null || node === void 0 ? void 0 : node.parent; n; n = n.parent)
923
+ if (n.name == "FunctionDefinition")
924
+ return n;
925
+ return null;
926
+ }
927
+ function commandName(state, command) {
928
+ const name = command.getChild("CommandName");
929
+ return name ? text(state, name) : null;
930
+ }
931
+ // The variables `read` and `mapfile` set. A flag that takes a value skips
932
+ // the next word, and `read -a arr` names an array.
933
+ function readTargets(state, command, builtin) {
934
+ const words = command.getChildren("Word");
935
+ const targets = [];
936
+ const valueFlags = builtin == "read" ? "dinNptu" : "dnOsuCc";
937
+ for (let i = 0; i < words.length; i++) {
938
+ const word = text(state, words[i]);
939
+ if (word.startsWith("-") && word.length > 1) {
940
+ const last = word[word.length - 1];
941
+ if (builtin == "read" && last == "a" && words[i + 1])
942
+ targets.push(words[++i]);
943
+ else if (valueFlags.includes(last))
944
+ i++;
945
+ continue;
946
+ }
947
+ if (/^[A-Za-z_][A-Za-z0-9_]*$/.test(word))
948
+ targets.push(words[i]);
949
+ }
950
+ if (builtin != "read")
951
+ return targets.slice(-1);
952
+ return targets;
953
+ }
954
+ function gather(state, tree) {
955
+ var _a;
956
+ const cached = cache.get(tree);
957
+ if (cached)
958
+ return cached;
959
+ const end = state.doc.length;
960
+ const definitions = [];
961
+ // A name set without `local` is global, unless the function it is set in
962
+ // declared it local. Those are settled once the whole tree is read.
963
+ const assigned = [];
964
+ const locals = new Map();
965
+ const local = (name, node, fn) => {
966
+ let names = locals.get(fn.from);
967
+ if (!names)
968
+ locals.set(fn.from, (names = new Set()));
969
+ names.add(name);
970
+ definitions.push({ label: name, type: "variable", at: node.from, to: node.to, scopeFrom: node.from, scopeTo: fn.to });
971
+ };
972
+ const assign = (node, name) => {
973
+ if (name)
974
+ assigned.push({ name, node, fn: functionAround(node) });
975
+ };
976
+ tree.iterate({
977
+ enter: ref => {
978
+ var _a;
979
+ const node = ref.node;
980
+ switch (node.name) {
981
+ case "FunctionDefinition": {
982
+ const name = node.getChild("FunctionName");
983
+ if (name)
984
+ definitions.push({
985
+ label: text(state, name),
986
+ type: "function",
987
+ at: name.from,
988
+ to: name.to,
989
+ scopeFrom: 0,
990
+ scopeTo: end
991
+ });
992
+ break;
993
+ }
994
+ case "SimpleCommand": {
995
+ const builtin = commandName(state, node);
996
+ if (builtin == "read" || builtin == "mapfile" || builtin == "readarray") {
997
+ for (const target of readTargets(state, node, builtin))
998
+ assign(target, text(state, target));
999
+ break;
1000
+ }
1001
+ if (builtin == "getopts") {
1002
+ const words = node.getChildren("Word");
1003
+ if (words[1])
1004
+ assign(words[1], nameOf(state, words[1]));
1005
+ break;
1006
+ }
1007
+ const fn = functionAround(node);
1008
+ const isLocal = (builtin == "local" || builtin == "declare" || builtin == "typeset") && fn;
1009
+ for (let child = node.firstChild; child; child = child.nextSibling) {
1010
+ if (child.name != "Assignment" && child.name != "VariableName")
1011
+ continue;
1012
+ const target = child.name == "Assignment" ? child.getChild("AssignName") : child;
1013
+ if (!target)
1014
+ continue;
1015
+ const name = nameOf(state, target);
1016
+ if (!name)
1017
+ continue;
1018
+ if (isLocal)
1019
+ local(name, target, fn);
1020
+ else
1021
+ assign(target, name);
1022
+ }
1023
+ break;
1024
+ }
1025
+ case "ForStatement":
1026
+ case "SelectStatement":
1027
+ for (const name of node.getChildren("VariableName"))
1028
+ assign(name, nameOf(state, name));
1029
+ break;
1030
+ case "ArithAssignment": {
1031
+ const target = node.firstChild;
1032
+ if ((target === null || target === void 0 ? void 0 : target.name) == "ArithVariable" && ((_a = target.firstChild) === null || _a === void 0 ? void 0 : _a.name) != "SimpleExpansion")
1033
+ assign(target, nameOf(state, target));
1034
+ break;
1035
+ }
1036
+ }
1037
+ }
1038
+ });
1039
+ for (const { name, node, fn } of assigned) {
1040
+ // A function's locals are found anywhere in its body, so `x=1` before a
1041
+ // later `local x` still counts as local. This is close enough for
1042
+ // completion, and a script that does it has a bug anyway.
1043
+ let owner = fn;
1044
+ while (owner && !((_a = locals.get(owner.from)) === null || _a === void 0 ? void 0 : _a.has(name)))
1045
+ owner = functionAround(owner);
1046
+ definitions.push({
1047
+ label: name,
1048
+ type: "variable",
1049
+ at: node.from,
1050
+ to: node.to,
1051
+ scopeFrom: owner ? owner.from : 0,
1052
+ scopeTo: owner ? owner.to : end
1053
+ });
1054
+ }
1055
+ cache.set(tree, definitions);
1056
+ return definitions;
1057
+ }
1058
+ function namesAt(context, kind) {
1059
+ const definitions = gather(context.state, language.syntaxTree(context.state));
1060
+ const options = [];
1061
+ const seen = new Set();
1062
+ for (const d of definitions) {
1063
+ if (kind == "variable" && d.type != "variable")
1064
+ continue;
1065
+ if (d.scopeFrom > context.pos || d.scopeTo < context.pos || seen.has(d.label))
1066
+ continue;
1067
+ // The name being typed is not a completion of itself.
1068
+ if (d.at <= context.pos && d.to >= context.pos)
1069
+ continue;
1070
+ seen.add(d.label);
1071
+ options.push({ label: d.label, type: d.type });
1072
+ }
1073
+ return options;
1074
+ }
1075
+ // Nothing is offered inside these: they are text the shell does not expand.
1076
+ const quiet = new Set(["Comment", "RawString", "AnsiString", "HeredocBody", "Regex", "Escape"]);
1077
+ const arithmetic = new Set([
1078
+ "ArithmeticExpansion",
1079
+ "ArithmeticCommand",
1080
+ "ArithmeticForStatement",
1081
+ "ArithSubscript"
1082
+ ]);
1083
+ function where(node, pos) {
1084
+ let inString = false;
1085
+ for (let n = node; n; n = n.parent) {
1086
+ if (quiet.has(n.name))
1087
+ return "quiet";
1088
+ if (n.name == "String")
1089
+ inString = true;
1090
+ // A command substitution is commands again, wherever it stands.
1091
+ if (n.name == "CommandSubstitution" && n.from + 2 <= pos)
1092
+ break;
1093
+ // An index into an array is arithmetic, and the rest of an expansion is
1094
+ // text with expansions in it.
1095
+ if (n.name == "Subscript")
1096
+ return "arith";
1097
+ if (n.name == "ParameterExpansion" && n.from + 2 <= pos)
1098
+ return "string";
1099
+ if (arithmetic.has(n.name))
1100
+ return "arith";
1101
+ }
1102
+ return inString ? "string" : "word";
1103
+ }
1104
+ /**
1105
+ Completes the names declared in the file and the shell's own variables.
1106
+ After `$` or `${` it offers variables and the positional parameters, and
1107
+ inside `(( ))` and `$(( ))` the variables. Functions are offered
1108
+ everywhere, and a variable set with `local` or `declare` inside a function
1109
+ only inside that function.
1110
+ */
1111
+ const localCompletionSource = context => {
1112
+ const inner = language.syntaxTree(context.state).resolveInner(context.pos, -1);
1113
+ const place = where(inner, context.pos);
1114
+ if (place == "quiet")
1115
+ return null;
1116
+ const braced = context.matchBefore(/\$\{[#!]?\w*$/);
1117
+ if (braced) {
1118
+ const from = context.pos - /\w*$/.exec(braced.text)[0].length;
1119
+ return {
1120
+ from,
1121
+ options: [...namesAt(context, "variable"), ...variableOptions, ...parameters],
1122
+ validFor: /^\w*$/
1123
+ };
1124
+ }
1125
+ const dollar = context.matchBefore(/\$\w*$/);
1126
+ if (dollar) {
1127
+ return {
1128
+ from: dollar.from + 1,
1129
+ options: [...namesAt(context, "variable"), ...variableOptions, ...parameters, ...dollarSnippets],
1130
+ validFor: /^\w*$/
1131
+ };
1132
+ }
1133
+ if (place == "string")
1134
+ return null;
1135
+ const word = context.matchBefore(/[A-Za-z_]\w*$/);
1136
+ if (!word && !context.explicit)
1137
+ return null;
1138
+ const from = word ? word.from : context.pos;
1139
+ if (place == "arith")
1140
+ return { from, options: [...namesAt(context, "variable"), ...variableOptions], validFor: /^\w*$/ };
1141
+ return { from, options: namesAt(context, "any"), validFor: /^\w*$/ };
1142
+ };
1143
+ /**
1144
+ Keywords, snippets, builtins and common commands. It offers them where a
1145
+ word is being typed, and nothing after `$`, inside arithmetic, or inside
1146
+ strings and comments.
1147
+ */
1148
+ const shellKeywordCompletion = context => {
1149
+ const inner = language.syntaxTree(context.state).resolveInner(context.pos, -1);
1150
+ if (where(inner, context.pos) != "word")
1151
+ return null;
1152
+ if (context.matchBefore(/\$\{?[#!]?\w*$/))
1153
+ return null;
1154
+ const word = context.matchBefore(/(\[\[?|\(\(?|[A-Za-z_]\w*)$/);
1155
+ if (!word && !context.explicit)
1156
+ return null;
1157
+ return {
1158
+ from: word ? word.from : context.pos,
1159
+ options: [...wordOptions, ...variableOptions],
1160
+ validFor: /^(\[\[?|\(\(?|\w*)$/
1161
+ };
1162
+ };
1163
+
1164
+ // This file was generated by lezer-generator. You probably shouldn't edit it.
1165
+ const If$1 = 1,
1166
+ Then = 2,
1167
+ Else$1 = 3,
1168
+ Endif = 4,
1169
+ While$1 = 5,
1170
+ Foreach = 6,
1171
+ End$1 = 7,
1172
+ Switch$1 = 8,
1173
+ Case$1 = 9,
1174
+ Default = 10,
1175
+ Endsw = 11,
1176
+ Repeat = 12,
1177
+ Set$1 = 13,
1178
+ Setenv = 14,
1179
+ Unset = 15,
1180
+ Alias = 16,
1181
+ At = 17,
1182
+ GroupOpen = 18,
1183
+ GroupClose = 19,
1184
+ Label = 20,
1185
+ Terminator$1 = 21,
1186
+ insertedTerminator$1 = 104,
1187
+ blankLine$1 = 105,
1188
+ HeredocBody = 22,
1189
+ Comment$1 = 23,
1190
+ wordEnd$1 = 106,
1191
+ LineContinuation = 24,
1192
+ AssignOp = 25,
1193
+ IncDecOp = 26,
1194
+ EqualOp = 27,
1195
+ MatchOp = 28,
1196
+ RelateOp = 29,
1197
+ ShiftOp = 30,
1198
+ AddOp = 31,
1199
+ MulOp = 32,
1200
+ BitAndOp = 33,
1201
+ BitXorOp = 34,
1202
+ BitOrOp = 35,
1203
+ NotOp = 36,
1204
+ BitNotOp = 37,
1205
+ FileTestOp = 38,
1206
+ AndOp = 39,
1207
+ OrOp = 40,
1208
+ Number = 41;
1209
+
1210
+ const space$1 = 32, tab$1 = 9, carriage$1 = 13, lineFeed$1 = 10, hash$1 = 35, semi$1 = 59, amp$1 = 38, pipe$1 = 124, lt$1 = 60, gt$1 = 62, parenL = 40, parenR$1 = 41, braceL = 123, braceR = 125, colon = 58, at = 64, quote = 34, apostrophe = 39, backslash = 92, dash = 45, plus = 43;
1211
+ function isBlank$1(ch) {
1212
+ return ch == space$1 || ch == tab$1 || ch == carriage$1;
1213
+ }
1214
+ // The characters that end a word. `:` is one of them here and is not in the
1215
+ // shell command language, because csh hangs its modifiers off a word with one:
1216
+ // `$path:h` is two things and `$path` is one.
1217
+ function endsWord$1(ch) {
1218
+ return (ch < 0 ||
1219
+ isBlank$1(ch) ||
1220
+ ch == lineFeed$1 ||
1221
+ ch == semi$1 ||
1222
+ ch == amp$1 ||
1223
+ ch == pipe$1 ||
1224
+ ch == parenL ||
1225
+ ch == parenR$1 ||
1226
+ ch == lt$1 ||
1227
+ ch == gt$1);
1228
+ }
1229
+ function isNameStart$1(ch) {
1230
+ return (ch >= 65 && ch <= 90) || (ch >= 97 && ch <= 122) || ch == 95;
1231
+ }
1232
+ function isNameChar$1(ch) {
1233
+ return isNameStart$1(ch) || (ch >= 48 && ch <= 57);
1234
+ }
1235
+ // ── Words ─────────────────────────────────────────────────────────────────────
1236
+ // The pieces of a word are parsed with nothing skipped between them, which
1237
+ // leaves the grammar unable to see where the word stops. This token has no
1238
+ // width and says exactly that: the shell would end the word here.
1239
+ const words$1 = new lr.ExternalTokenizer((input, stack) => {
1240
+ // A backslash before a newline is a piece of the word it touches, and space
1241
+ // where it touches none.
1242
+ if (input.next == backslash &&
1243
+ input.peek(1) == lineFeed$1 &&
1244
+ !isBlank$1(input.peek(-1)) &&
1245
+ stack.canShift(LineContinuation)) {
1246
+ input.acceptToken(LineContinuation, 2);
1247
+ return;
1248
+ }
1249
+ if (isIncrement(input) && stack.canShift(wordEnd$1) && namedByAt(input)) {
1250
+ input.acceptToken(wordEnd$1);
1251
+ return;
1252
+ }
1253
+ if (endsWord$1(input.next) && stack.canShift(wordEnd$1))
1254
+ input.acceptToken(wordEnd$1);
1255
+ }, { contextual: true });
1256
+ function isIncrement(input) {
1257
+ return ((input.next == plus || input.next == dash) &&
1258
+ input.peek(1) == input.next &&
1259
+ endsWord$1(input.peek(2)));
1260
+ }
1261
+ // `@ n++` ends its word before the `++`, and `echo a++` does not. Which is
1262
+ // meant cannot be asked of the parser here: the word the increment follows has
1263
+ // not been reduced yet, so there is nowhere on the stack for the operator to go
1264
+ // even where one belongs. So it is asked of the text, which says the same
1265
+ // thing: the word an increment ends is the name an `@` opened.
1266
+ function namedByAt(input) {
1267
+ let back = -1;
1268
+ while (-back < wordScanLimit && !endsWord$1(input.peek(back)))
1269
+ back--;
1270
+ while (isBlank$1(input.peek(back)))
1271
+ back--;
1272
+ return input.peek(back) == at && endsWord$1(input.peek(back - 1));
1273
+ }
1274
+ const wordScanLimit = 256;
1275
+ // ── Reserved words ────────────────────────────────────────────────────────────
1276
+ const keywords$1 = {
1277
+ if: If$1,
1278
+ then: Then,
1279
+ else: Else$1,
1280
+ endif: Endif,
1281
+ while: While$1,
1282
+ foreach: Foreach,
1283
+ end: End$1,
1284
+ switch: Switch$1,
1285
+ case: Case$1,
1286
+ default: Default,
1287
+ endsw: Endsw,
1288
+ repeat: Repeat,
1289
+ set: Set$1,
1290
+ setenv: Setenv,
1291
+ unset: Unset,
1292
+ alias: Alias
1293
+ };
1294
+ // A reserved word is reserved where a command may start and nowhere else, so
1295
+ // `echo end` prints a word and the `end` on the next line closes the loop. The
1296
+ // question is the parser's, because a command cannot start until the one
1297
+ // before it has been terminated.
1298
+ //
1299
+ // `set` and `alias` are here with the rest of them. They are builtins rather
1300
+ // than reserved words in the shell's own reckoning, but what follows each is a
1301
+ // name being defined rather than an argument, and saying so is most of what a
1302
+ // reader wants from this grammar.
1303
+ const reservedWords$1 = new lr.ExternalTokenizer((input, stack) => {
1304
+ const ch = input.next;
1305
+ if (ch == at)
1306
+ return takeIf(input, stack, At, 1, blankFollows(input, 1));
1307
+ if (ch == braceL)
1308
+ return takeIf(input, stack, GroupOpen, 1, blankFollows(input, 1));
1309
+ if (ch == braceR)
1310
+ return takeIf(input, stack, GroupClose, 1, endsWord$1(input.peek(1)));
1311
+ if (!isNameStart$1(ch))
1312
+ return;
1313
+ let length = 0, word = "";
1314
+ while (isNameChar$1(input.peek(length)))
1315
+ word += String.fromCharCode(input.peek(length++));
1316
+ const term = keywords$1[word];
1317
+ if (term == null)
1318
+ return;
1319
+ // `default:` carries its colon, because a colon is an ordinary letter in a
1320
+ // csh word and leaving it out would put a stray one after the keyword. The
1321
+ // label of a `case` keeps its own for the same reason.
1322
+ if (term == Default && input.peek(length) == colon)
1323
+ length++;
1324
+ else if (!endsWord$1(input.peek(length)))
1325
+ return;
1326
+ takeIf(input, stack, term, length, true);
1327
+ }, { contextual: true });
1328
+ function blankFollows(input, from) {
1329
+ const ch = input.peek(from);
1330
+ return ch < 0 || isBlank$1(ch) || ch == lineFeed$1;
1331
+ }
1332
+ function takeIf(input, stack, term, length, ok) {
1333
+ if (!ok || !stack.canShift(term))
1334
+ return;
1335
+ input.advance(length);
1336
+ input.acceptToken(term);
1337
+ }
1338
+ // ── The expression operators ──────────────────────────────────────────────────
1339
+ // Nearly every operator csh has is also an ordinary letter in a word. `-n` is
1340
+ // a flag and `-e` a file test, `*` is a wildcard and multiplication, `!` is a
1341
+ // history reference and negation, and `|` and `&` are the two ways a command
1342
+ // list is punctuated. Which one is meant is the question the rest of this file
1343
+ // asks: an expression is the only place the parser has room for an operator,
1344
+ // so the operator is produced there and nowhere else.
1345
+ //
1346
+ // Longest first, so that `<<=` is not read as `<<` and then `=`.
1347
+ const operators = [
1348
+ ["<<=", () => AssignOp],
1349
+ [">>=", () => AssignOp],
1350
+ ["==", () => EqualOp],
1351
+ ["!=", () => EqualOp],
1352
+ ["=~", () => MatchOp],
1353
+ ["!~", () => MatchOp],
1354
+ ["<=", () => RelateOp],
1355
+ [">=", () => RelateOp],
1356
+ ["<<", () => ShiftOp],
1357
+ [">>", () => ShiftOp],
1358
+ ["&&", () => AndOp],
1359
+ ["||", () => OrOp],
1360
+ ["++", () => IncDecOp],
1361
+ ["--", () => IncDecOp],
1362
+ ["+=", () => AssignOp],
1363
+ ["-=", () => AssignOp],
1364
+ ["*=", () => AssignOp],
1365
+ ["/=", () => AssignOp],
1366
+ ["%=", () => AssignOp],
1367
+ ["&=", () => AssignOp],
1368
+ ["^=", () => AssignOp],
1369
+ ["|=", () => AssignOp],
1370
+ ["<", () => RelateOp],
1371
+ [">", () => RelateOp],
1372
+ ["+", () => AddOp],
1373
+ ["-", () => AddOp],
1374
+ ["*", () => MulOp],
1375
+ ["/", () => MulOp],
1376
+ ["%", () => MulOp],
1377
+ ["&", () => BitAndOp],
1378
+ ["^", () => BitXorOp],
1379
+ ["|", () => BitOrOp],
1380
+ ["!", () => NotOp],
1381
+ ["~", () => BitNotOp],
1382
+ ["=", () => AssignOp]
1383
+ ];
1384
+ // `-e`, `-r`, `-w` and the rest ask something about a file, and each is a
1385
+ // letter that a flag could just as well have been.
1386
+ const fileTests = "erwxfdzo";
1387
+ const expressionOps = new lr.ExternalTokenizer((input, stack) => {
1388
+ if (input.next == dash &&
1389
+ fileTests.indexOf(String.fromCharCode(input.peek(1))) > -1 &&
1390
+ blankFollows(input, 2) &&
1391
+ stack.canShift(FileTestOp)) {
1392
+ input.acceptToken(FileTestOp, 2);
1393
+ return;
1394
+ }
1395
+ for (const [text, term] of operators) {
1396
+ let i = 0;
1397
+ while (i < text.length && input.peek(i) == text.charCodeAt(i))
1398
+ i++;
1399
+ if (i < text.length)
1400
+ continue;
1401
+ const id = term();
1402
+ if (!stack.canShift(id))
1403
+ continue;
1404
+ input.acceptToken(id, text.length);
1405
+ return;
1406
+ }
1407
+ // A number is only a number in an expression. `echo 1` passes a word, and
1408
+ // csh has no numbers anywhere else.
1409
+ if (input.next >= 48 && input.next <= 57 && stack.canShift(Number)) {
1410
+ let length = 0;
1411
+ while (input.peek(length) >= 48 && input.peek(length) <= 57)
1412
+ length++;
1413
+ if (endsWord$1(input.peek(length)) || !isNameChar$1(input.peek(length)))
1414
+ input.acceptToken(Number, length);
1415
+ }
1416
+ }, { contextual: true });
1417
+ // ── Labels ────────────────────────────────────────────────────────────────────
1418
+ // `goto done` jumps to a line reading `done:`, which is a name and a colon and
1419
+ // nothing else. A colon after a word means a modifier everywhere else, so this
1420
+ // asks for the rest of the line to be empty before calling it a label.
1421
+ const labels = new lr.ExternalTokenizer((input, stack) => {
1422
+ if (!isNameStart$1(input.next) || !stack.canShift(Label))
1423
+ return;
1424
+ let length = 0;
1425
+ while (isNameChar$1(input.peek(length)))
1426
+ length++;
1427
+ if (input.peek(length) != colon)
1428
+ return;
1429
+ let at = length + 1;
1430
+ while (isBlank$1(input.peek(at)))
1431
+ at++;
1432
+ const ch = input.peek(at);
1433
+ if (ch >= 0 && ch != lineFeed$1 && ch != hash$1)
1434
+ return;
1435
+ input.acceptToken(Label, length + 1);
1436
+ }, { contextual: true });
1437
+ // ── Newlines ──────────────────────────────────────────────────────────────────
1438
+ // A newline ends a command where the parser has room for one and is skipped
1439
+ // everywhere else, which is every place csh allows a line to be broken: after
1440
+ // `|`, `&&`, or inside a parenthesised list.
1441
+ const terminators$1 = new lr.ExternalTokenizer((input, stack) => {
1442
+ // The last command in a file or a substitution needs no terminator of its
1443
+ // own, so one is supplied where the text runs out. It has its own width,
1444
+ // which is none.
1445
+ if (input.next < 0 || input.next == parenR$1 || input.next == braceR) {
1446
+ if (stack.canShift(insertedTerminator$1))
1447
+ input.acceptToken(insertedTerminator$1);
1448
+ return;
1449
+ }
1450
+ if (input.next != lineFeed$1 && input.next != semi$1)
1451
+ return;
1452
+ let length = 0, newlines = false;
1453
+ for (;;) {
1454
+ const ch = input.peek(length);
1455
+ if (ch == lineFeed$1) {
1456
+ length++;
1457
+ newlines = true;
1458
+ // A line that promised a heredoc has its body on the next line, so the
1459
+ // run stops here and the heredoc tokenizer reads what follows.
1460
+ if (heredocBefore(input, length - 1))
1461
+ break;
1462
+ }
1463
+ else if (ch == semi$1 || isBlank$1(ch)) {
1464
+ length++;
1465
+ }
1466
+ else {
1467
+ break;
1468
+ }
1469
+ }
1470
+ if (length == 0)
1471
+ return;
1472
+ if (stack.canShift(Terminator$1))
1473
+ input.acceptToken(Terminator$1, length);
1474
+ // Nothing to end, so a run of newlines here is a blank line between two
1475
+ // commands or a line broken inside one. Either way it is space.
1476
+ else if (newlines)
1477
+ input.acceptToken(blankLine$1, length);
1478
+ }, { contextual: true });
1479
+ // ── Comments ──────────────────────────────────────────────────────────────────
1480
+ // `#` to the end of the line, but only where a word could start, so that `a#b`
1481
+ // is one word and `a #b` is a word and a comment.
1482
+ const comments$1 = new lr.ExternalTokenizer((input) => {
1483
+ if (input.next != hash$1 || !endsWord$1(input.peek(-1)))
1484
+ return;
1485
+ while (input.next != lineFeed$1 && input.next >= 0)
1486
+ input.advance();
1487
+ input.acceptToken(Comment$1);
1488
+ });
1489
+ // ── Heredocs ──────────────────────────────────────────────────────────────────
1490
+ // The body of a heredoc starts on the line after the `<<` that promised it,
1491
+ // which is nowhere near the token that promised it. Rather than carry the
1492
+ // promise from token to token, it is recovered here by reading back over the
1493
+ // line that just ended. csh allows one per line, where the shell command
1494
+ // language allows several.
1495
+ const heredocs = new lr.ExternalTokenizer((input) => {
1496
+ if (input.peek(-1) != lineFeed$1)
1497
+ return;
1498
+ const delimiter = heredocBefore(input, -1);
1499
+ if (!delimiter)
1500
+ return;
1501
+ const length = skipBody(input, delimiter);
1502
+ if (length > 0)
1503
+ input.acceptToken(HeredocBody, length);
1504
+ });
1505
+ // Reads the line that ends at `end` and returns the delimiter it promised.
1506
+ function heredocBefore(input, end) {
1507
+ let start = end;
1508
+ while (input.peek(start - 1) >= 0 && input.peek(start - 1) != lineFeed$1)
1509
+ start--;
1510
+ // Cheap way out: a line with no `<` on it promised nothing, and nearly every
1511
+ // line is one of those.
1512
+ let seen = false;
1513
+ for (let at = start; at < end && !seen; at++)
1514
+ if (input.peek(at) == lt$1)
1515
+ seen = true;
1516
+ return seen ? scanLine(input, start, end) : null;
1517
+ }
1518
+ function scanLine(input, start, end) {
1519
+ let at = start;
1520
+ while (at < end) {
1521
+ const ch = input.peek(at);
1522
+ if (ch == backslash) {
1523
+ at += 2;
1524
+ }
1525
+ else if (ch == apostrophe || ch == quote) {
1526
+ at = skipQuoted(input, at, end, ch);
1527
+ }
1528
+ else if (ch == hash$1 && (at == start || endsWord$1(input.peek(at - 1)))) {
1529
+ return null;
1530
+ }
1531
+ else if (ch == lt$1 && input.peek(at + 1) == lt$1) {
1532
+ at += 2;
1533
+ while (at < end && isBlank$1(input.peek(at)))
1534
+ at++;
1535
+ return readDelimiter(input, at, end);
1536
+ }
1537
+ else {
1538
+ at++;
1539
+ }
1540
+ }
1541
+ return null;
1542
+ }
1543
+ function skipQuoted(input, at, end, quoteChar) {
1544
+ at++;
1545
+ while (at < end) {
1546
+ const ch = input.peek(at);
1547
+ if (ch == backslash && quoteChar == quote)
1548
+ at += 2;
1549
+ else if (ch == quoteChar)
1550
+ return at + 1;
1551
+ else
1552
+ at++;
1553
+ }
1554
+ return at;
1555
+ }
1556
+ // `<<EOF`, `<<'EOF'` and `<<\EOF` all name the same delimiter. The quoting
1557
+ // decides whether the body is expanded, which is a question for the shell
1558
+ // rather than for the parser.
1559
+ function readDelimiter(input, at, end) {
1560
+ let text = "";
1561
+ while (at < end) {
1562
+ const ch = input.peek(at);
1563
+ if (ch == apostrophe || ch == quote) {
1564
+ const closing = ch;
1565
+ at++;
1566
+ while (at < end && input.peek(at) != closing)
1567
+ text += String.fromCharCode(input.peek(at++));
1568
+ at++;
1569
+ }
1570
+ else if (ch == backslash) {
1571
+ at++;
1572
+ if (at < end)
1573
+ text += String.fromCharCode(input.peek(at++));
1574
+ }
1575
+ else if (endsWord$1(ch)) {
1576
+ break;
1577
+ }
1578
+ else {
1579
+ text += String.fromCharCode(input.peek(at++));
1580
+ }
1581
+ }
1582
+ return text || null;
1583
+ }
1584
+ // Everything up to and including the line that is the delimiter on its own.
1585
+ // A body with no delimiter after it runs to the end of the file, which is what
1586
+ // the shell does with it too.
1587
+ function skipBody(input, delimiter) {
1588
+ let at = 0;
1589
+ for (;;) {
1590
+ let lineStart = at;
1591
+ while (input.peek(at) >= 0 && input.peek(at) != lineFeed$1)
1592
+ at++;
1593
+ if (matchesDelimiter(input, lineStart, at, delimiter))
1594
+ return input.peek(at) < 0 ? at : at + 1;
1595
+ if (input.peek(at) < 0)
1596
+ return at;
1597
+ at++;
1598
+ }
1599
+ }
1600
+ function matchesDelimiter(input, start, end, delimiter) {
1601
+ if (end - start != delimiter.length)
1602
+ return false;
1603
+ for (let i = 0; i < delimiter.length; i++)
1604
+ if (input.peek(start + i) != delimiter.charCodeAt(i))
1605
+ return false;
1606
+ return true;
1607
+ }
1608
+
1609
+ // This file was generated by lezer-generator. You probably shouldn't edit it.
1610
+ const parser$1 = lr.LRParser.deserialize({
1611
+ version: 14,
1612
+ states: "6tQ`Q%VOOO!yO&jO'#D`O#gO,UO'#D^OOO#S'#Ep'#EpOOOp'#E]'#E]O$`O$fO'#DYO$gQ&fO'#DXO%QQ&gO'#DnO%QQ&gO'#EOO#nQ%SO'#ERO#nQ%SO'#ESO%kQ&fO'#ETOOQ#O'#Ex'#ExOOQ#O'#Eo'#EoO&UQ%tO'#EoO&mQ%tO'#EmOOQ#O'#En'#EnOOQ!a'#Em'#EmOOQ!a'#E['#E[Q`Q%VOOO%QQ&gO'#DzO#nQ%SO'#D{O`Q%VO'#EUO`Q%VO'#EVO'RO&jO,59zO'^O&jO,59zOOOO'#Er'#ErOOOO'#E^'#E^O'cO,UO,59xOOO#S,59x,59xOOOp-E8Z-E8ZOOQ#p,59t,59tO'jO$fO'#DkO#nQ%SO'#DlOOQ#p'#Ew'#EwOOQ#p'#Ea'#EaO'qQ&fO,59sOOO#S'#Eb'#EbO([O%xO'#DoO(fQ&fO'#DqO%QQ&gO'#DtO%QQ&gO'#DuO(mQ&gO,5:YOOQ#s'#Ey'#EyO`Q%VO'#DpO*[Q%uO,5:jO#nQ%SO,5:mO*iO$fO'#D|O*pQ%tO,5:nO*xQ&fO,5:oOOQ#O'#Ef'#EfO+fQ%tO,5;ZO+}Q%TO,5:rO+}Q%TO,5:tOOQ!a'#E|'#E|OOQ!a,5;X,5;XOOQ!a-E8Y-E8YO,wQ&iO,5:fO-nQ$bO,5:gO-sQ%VO,5:pO-zQ%VO,5:qO.RO7[O'#DfOOOO'#E`'#E`O.dO&jO1G/fOOO#S1G/f1G/fO.dO&jO1G/fO.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
+ nodeNames: "⚠ if then else endif while foreach end switch case default endsw repeat set setenv unset alias @ { } Label Terminator HeredocBody Comment LineContinuation AssignOp IncDecOp EqualOp MatchOp RelateOp ShiftOp AddOp MulOp BitAndOp BitXorOp BitOrOp NotOp BitNotOp FileTestOp AndOp OrOp Number Script SimpleCommand CommandName Glob Escape \" String SimpleExpansion ParameterExpansion ${ ParamOp ParamName ] [ Subscript Backtick Modifier Dollar RawString Word Redirect RedirectOp IfStatement ExprWord CommandValue FileTest ) ( ExprGroup ExprUnary ExprBinary ElseClause ElifClause ShortCommand WhileStatement ForeachStatement VariableName WordList SwitchStatement CaseClause DefaultClause RepeatStatement ArithmeticCommand SetCommand Subshell Group Pipeline PipeOp LogicalList Background",
1616
+ maxTerm: 124,
1617
+ nodeProps: [
1618
+ ["openedBy", 54,"[",68,"("],
1619
+ ["closedBy", 55,"]",69,")"]
1620
+ ],
1621
+ skippedNodes: [0,22,23],
1622
+ repeatNodeCount: 11,
1623
+ tokenData: "!0n~RzOX#uXY*RZ]#u]^*R^p#upq*Rqr#urs+^st+ztu-wuv#uvw/Xwx0Txy6dyz7`z{8[{|9W|}#u}!O9W!O!Q#u!Q![:S![!]<V!]!^%p!^!_Ke!_!`#u!`!aMc!a!b! p!b!c#u!c!}!!n!}#O!$z#O#P!&w#P#Q!+R#Q#R#u#R#S!!n#S#T!,s#T#o!!n#o#p%p#p#q!-t#q#r!/r#r;'S#u;'S;=`){<%lO#u]$Oj#gS#jW#ePOX#uXY%pZ]#u]^%p^p#upq%pqr#urs&jst#uuv#uv|%p|}#u}!O%p!O!]#u!]!_%p!_!`#u!`!b%p!b#O#u#O#P&j#P#Q(V#Q#S#u#T#o#u#o#r%p#r;'S#u;'S;=`){<%lO#u[%wZ#gS#jWOY%pZr%prs&jst%pu#O%p#O#P&j#P#Q'[#Q#S%p#T;'S%p;'S;=`(P<%lO%pW&oV#jWOY&jZt&ju#P&j#Q#S&j#T;'S&j;'S;=`'U<%lO&jW'XP;=`<%l&jS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[^p(Vpq'[qr(Vst(Vuv(Vv|'[|}(V}!O'[!O!](V!]!_'[!_!`(V!`!b'[!b#O(V#P#S(V#T#o(V#o#r'[#r;'S(V;'S;=`)u<%lO(V~!,vVO#O!,s#O#P!-]#P#S!,s#S#T!-o#T;'S!,s;'S;=`!-i<%lO!,s~!-`RO;'S!,s;'S;=`!-i<%lO!,s~!-lP;=`<%l!,s~!-tO!Z~]!-}]!{P#gS#jWOY%pZr%prs&jst%puv%pvw!.vw#O%p#O#P&j#P#Q'[#Q#S%p#T;'S%p;'S;=`(P<%lO%p]!/PZ!{P#gS#jWOY%pZr%prs&jst%pu#O%p#O#P&j#P#Q'[#Q#S%p#T;'S%p;'S;=`(P<%lO%p^!/{Z#hQ#gS#jWOY%pZr%prs&jst%pu#O%p#O#P&j#P#Q'[#Q#S%p#T;'S%p;'S;=`(P<%lO%p",
1624
+ tokenizers: [reservedWords$1, labels, terminators$1, heredocs, comments$1, words$1, expressionOps, 0, 1, 2, 3],
1625
+ topRules: {"Script":[0,42]},
1626
+ tokenPrec: 1715
1627
+ });
1628
+
1629
+ /**
1630
+ A language provider for the C shell, based on the Lezer grammar in
1631
+ `csh.grammar`.
1632
+ */
1633
+ const cshLanguage = language.LRLanguage.define({
1634
+ name: "csh",
1635
+ parser: parser$1.configure({
1636
+ props: [
1637
+ language.indentNodeProp.add({
1638
+ Group: language.delimitedIndent({ closing: "}" }),
1639
+ Subshell: language.delimitedIndent({ closing: ")" }),
1640
+ WhileStatement: language.delimitedIndent({ closing: "end" }),
1641
+ ForeachStatement: language.delimitedIndent({ closing: "end" }),
1642
+ SwitchStatement: language.delimitedIndent({ closing: "endsw" }),
1643
+ // `then` sits on the same line as the `if` it belongs to, so what is
1644
+ // indented is everything after that line.
1645
+ IfStatement: language.continuedIndent({ except: /^\s*(endif|else)\b/ }),
1646
+ CaseClause: language.continuedIndent({ except: /^\s*(case|default|endsw)\b/ })
1647
+ }),
1648
+ language.foldNodeProp.add({
1649
+ Group: language.foldInside,
1650
+ Subshell: language.foldInside,
1651
+ WhileStatement: language.foldInside,
1652
+ ForeachStatement: language.foldInside,
1653
+ SwitchStatement: language.foldInside
1654
+ }),
1655
+ highlight.styleTags({
1656
+ "if then else endif": highlight.tags.controlKeyword,
1657
+ "while foreach end repeat": highlight.tags.controlKeyword,
1658
+ "switch case default endsw": highlight.tags.controlKeyword,
1659
+ "set setenv unset alias": highlight.tags.definitionKeyword,
1660
+ Label: highlight.tags.labelName,
1661
+ Comment: highlight.tags.lineComment,
1662
+ String: highlight.tags.string,
1663
+ RawString: highlight.tags.string,
1664
+ HeredocBody: highlight.tags.special(highlight.tags.string),
1665
+ Escape: highlight.tags.escape,
1666
+ LineContinuation: highlight.tags.escape,
1667
+ Glob: highlight.tags.special(highlight.tags.string),
1668
+ "SimpleCommand/CommandName ShortCommand/CommandName": highlight.tags.function(highlight.tags.variableName),
1669
+ VariableName: highlight.tags.definition(highlight.tags.variableName),
1670
+ SimpleExpansion: highlight.tags.variableName,
1671
+ ParamName: highlight.tags.variableName,
1672
+ ParamOp: highlight.tags.operator,
1673
+ Dollar: highlight.tags.variableName,
1674
+ // `:q` and its relatives say what to do with the word before them,
1675
+ // which is what an operator is.
1676
+ Modifier: highlight.tags.operator,
1677
+ Number: highlight.tags.number,
1678
+ RedirectOp: highlight.tags.controlOperator,
1679
+ "PipeOp Background": highlight.tags.controlOperator,
1680
+ "AndOp OrOp NotOp": highlight.tags.logicOperator,
1681
+ "AddOp MulOp": highlight.tags.arithmeticOperator,
1682
+ "ShiftOp BitAndOp BitXorOp BitOrOp BitNotOp": highlight.tags.bitwiseOperator,
1683
+ "RelateOp EqualOp MatchOp": highlight.tags.compareOperator,
1684
+ FileTestOp: highlight.tags.operatorKeyword,
1685
+ AssignOp: highlight.tags.definitionOperator,
1686
+ IncDecOp: highlight.tags.updateOperator,
1687
+ // `@` is a command rather than a symbol, and reads as the arithmetic
1688
+ // it introduces.
1689
+ "@": highlight.tags.definitionKeyword,
1690
+ '"\\""': highlight.tags.string,
1691
+ '"${" "}" "{"': highlight.tags.brace,
1692
+ '"(" ")"': highlight.tags.paren,
1693
+ '"[" "]"': highlight.tags.squareBracket,
1694
+ '";"': highlight.tags.separator,
1695
+ Terminator: highlight.tags.separator
1696
+ })
1697
+ ]
1698
+ }),
1699
+ languageData: {
1700
+ commentTokens: { line: "#" },
1701
+ closeBrackets: { brackets: ["(", "[", "{", "'", '"', "`"] },
1702
+ indentOnInput: /^\s*(endif|end|endsw|else|breaksw|\}|\))$/
1703
+ }
1704
+ });
1705
+ // csh has no functions, so its builtins are the whole of what it can be told
1706
+ // to do on its own, and there are few enough to name.
1707
+ const builtins$1 = [
1708
+ "alias", "bg", "break", "breaksw", "case", "cd", "chdir", "continue",
1709
+ "default", "dirs", "echo", "else", "end", "endif", "endsw", "eval", "exec",
1710
+ "exit", "fg", "foreach", "glob", "goto", "hashstat", "history", "if", "jobs",
1711
+ "kill", "limit", "login", "logout", "nice", "nohup", "notify", "onintr",
1712
+ "popd", "pushd", "rehash", "repeat", "set", "setenv", "shift", "source",
1713
+ "stop", "suspend", "switch", "then", "time", "umask", "unalias", "unhash",
1714
+ "unlimit", "unset", "unsetenv", "wait", "while", "@"
1715
+ ].map(label => ({ label, type: "keyword" }));
1716
+ // The variables csh sets for you. `status` is where the last command's exit
1717
+ // code lands, which is `$?` everywhere else.
1718
+ const specials$1 = [
1719
+ "argv", "cdpath", "cwd", "echo", "histchars", "history", "home", "ignoreeof",
1720
+ "mail", "noclobber", "noglob", "nonomatch", "notify", "path", "prompt",
1721
+ "savehist", "shell", "status", "term", "time", "user", "verbose"
1722
+ ].map(label => ({ label, type: "constant" }));
1723
+ /**
1724
+ Autocompletion for the C shell's builtins and the variables it sets.
1725
+ */
1726
+ const cshCompletion = autocomplete.completeFromList([...builtins$1, ...specials$1]);
1727
+
1728
+ // This file was generated by lezer-generator. You probably shouldn't edit it.
1729
+ const If = 1,
1730
+ Else = 2,
1731
+ End = 3,
1732
+ While = 4,
1733
+ For = 5,
1734
+ In = 6,
1735
+ Switch = 7,
1736
+ Case = 8,
1737
+ Function = 9,
1738
+ Begin = 10,
1739
+ And = 11,
1740
+ Or = 12,
1741
+ Not = 13,
1742
+ Terminator = 14,
1743
+ insertedTerminator = 66,
1744
+ blankLine = 67,
1745
+ Comment = 15,
1746
+ wordEnd = 68,
1747
+ SubscriptOpen = 16,
1748
+ SubscriptClose = 17,
1749
+ bracketText = 69;
1750
+
1751
+ // The tokenizers fish's grammar cannot express.
1752
+ //
1753
+ // Each of them answers a question about where a word begins and ends, and each
1754
+ // answers it by asking the parser what it has room for here. `fish.grammar`
1755
+ // says which question is which and why it has to be asked this way.
1756
+ //
1757
+ // The file is self-contained, as the other two tokenizers in this package are.
1758
+ // Three shells that share a word layer would share a helper module too, and
1759
+ // then a change made for one would have to be checked against the other two.
1760
+ // A reader who wants fish should be able to read fish.
1761
+ const space = 32, tab = 9, carriage = 13, lineFeed = 10, hash = 35, semi = 59, amp = 38, pipe = 124, lt = 60, gt = 62, parenR = 41, bracketL = 91, bracketR = 93;
1762
+ function isBlank(ch) {
1763
+ return ch == space || ch == tab || ch == carriage;
1764
+ }
1765
+ // The characters that end a word. A `(` is not one of them: it opens a command
1766
+ // substitution, and `a(seq 3)b` is a single word in three pieces.
1767
+ function endsWord(ch) {
1768
+ return (ch < 0 ||
1769
+ isBlank(ch) ||
1770
+ ch == lineFeed ||
1771
+ ch == semi ||
1772
+ ch == amp ||
1773
+ ch == pipe ||
1774
+ ch == parenR ||
1775
+ ch == lt ||
1776
+ ch == gt);
1777
+ }
1778
+ function isNameStart(ch) {
1779
+ return (ch >= 65 && ch <= 90) || (ch >= 97 && ch <= 122) || ch == 95;
1780
+ }
1781
+ function isNameChar(ch) {
1782
+ return isNameStart(ch) || (ch >= 48 && ch <= 57);
1783
+ }
1784
+ // ── Words ─────────────────────────────────────────────────────────────────────
1785
+ // The pieces of a word are parsed with nothing skipped between them, which
1786
+ // leaves the grammar unable to see where the word stops. This token has no
1787
+ // width and says exactly that: the shell would end the word here.
1788
+ const words = new lr.ExternalTokenizer((input, stack) => {
1789
+ if (endsWord(input.next) && stack.canShift(wordEnd))
1790
+ input.acceptToken(wordEnd);
1791
+ }, { contextual: true });
1792
+ // ── Reserved words ────────────────────────────────────────────────────────────
1793
+ const keywords = {
1794
+ if: If,
1795
+ else: Else,
1796
+ end: End,
1797
+ while: While,
1798
+ for: For,
1799
+ in: In,
1800
+ switch: Switch,
1801
+ case: Case,
1802
+ function: Function,
1803
+ begin: Begin,
1804
+ and: And,
1805
+ or: Or,
1806
+ not: Not
1807
+ };
1808
+ // A reserved word is reserved where a command may start and nowhere else, so
1809
+ // `echo end` prints a word and the `end` on the next line closes the block. The
1810
+ // question is the parser's, because a command cannot start until the one before
1811
+ // it has been terminated.
1812
+ //
1813
+ // `in` is here with the rest of them, though it can only ever follow a `for`.
1814
+ // The parser knows that, and asking it is the same code as asking about `end`.
1815
+ const reservedWords = new lr.ExternalTokenizer((input, stack) => {
1816
+ if (!isNameStart(input.next))
1817
+ return;
1818
+ let length = 0, word = "";
1819
+ while (isNameChar(input.peek(length)))
1820
+ word += String.fromCharCode(input.peek(length++));
1821
+ const term = keywords[word];
1822
+ if (term == null || !endsWord(input.peek(length)) || !stack.canShift(term))
1823
+ return;
1824
+ input.advance(length);
1825
+ input.acceptToken(term);
1826
+ }, { contextual: true });
1827
+ // ── Subscripts ────────────────────────────────────────────────────────────────
1828
+ // `$argv[1]` indexes a list and `[ -f $file ]` runs the test command, and the
1829
+ // only difference between the two brackets is that the first one touches the
1830
+ // word in front of it. Both readings would otherwise be open at once, so the
1831
+ // choice is made here and the parser is handed one token or the other, never
1832
+ // both.
1833
+ const brackets = new lr.ExternalTokenizer((input, stack) => {
1834
+ if (input.next == bracketL) {
1835
+ if (touchesWord(input.peek(-1)) && stack.canShift(SubscriptOpen))
1836
+ input.acceptToken(SubscriptOpen, 1);
1837
+ else if (stack.canShift(bracketText))
1838
+ input.acceptToken(bracketText, 1);
1839
+ return;
1840
+ }
1841
+ if (input.next != bracketR)
1842
+ return;
1843
+ if (stack.canShift(SubscriptClose))
1844
+ input.acceptToken(SubscriptClose, 1);
1845
+ else if (stack.canShift(bracketText))
1846
+ input.acceptToken(bracketText, 1);
1847
+ }, { contextual: true });
1848
+ // A closing parenthesis ends a word everywhere else, and not here: `(seq 10)[-1]`
1849
+ // indexes what the command printed, and is the one thing a subscript may follow
1850
+ // that a word may not run into.
1851
+ function touchesWord(ch) {
1852
+ return ch == parenR || !endsWord(ch);
1853
+ }
1854
+ // ── Newlines ──────────────────────────────────────────────────────────────────
1855
+ // A newline ends a command where the parser has room for one and is skipped
1856
+ // everywhere else, which is every place fish allows a line to be broken: after
1857
+ // a `|`, an `and`, an `or`, or inside a command substitution.
1858
+ const terminators = new lr.ExternalTokenizer((input, stack) => {
1859
+ // The last command in a file or a substitution needs no terminator of its
1860
+ // own, so one is supplied where the text runs out. It has its own width,
1861
+ // which is none.
1862
+ if (input.next < 0 || input.next == parenR) {
1863
+ if (stack.canShift(insertedTerminator))
1864
+ input.acceptToken(insertedTerminator);
1865
+ return;
1866
+ }
1867
+ if (input.next != lineFeed && input.next != semi)
1868
+ return;
1869
+ let length = 0, newlines = false;
1870
+ for (;;) {
1871
+ const ch = input.peek(length);
1872
+ if (ch == lineFeed) {
1873
+ length++;
1874
+ newlines = true;
1875
+ }
1876
+ else if (ch == semi || isBlank(ch)) {
1877
+ length++;
1878
+ }
1879
+ else {
1880
+ break;
1881
+ }
1882
+ }
1883
+ if (length == 0)
1884
+ return;
1885
+ if (stack.canShift(Terminator))
1886
+ input.acceptToken(Terminator, length);
1887
+ // Nothing to end, so a run of newlines here is a blank line between two
1888
+ // commands or a line broken inside one. Either way it is space.
1889
+ else if (newlines)
1890
+ input.acceptToken(blankLine, length);
1891
+ }, { contextual: true });
1892
+ // ── Comments ──────────────────────────────────────────────────────────────────
1893
+ // `#` to the end of the line, but only where a word could start, so that `a#b`
1894
+ // is one word and `a #b` is a word and a comment.
1895
+ const comments = new lr.ExternalTokenizer((input) => {
1896
+ if (input.next != hash || !endsWord(input.peek(-1)))
1897
+ return;
1898
+ while (input.next != lineFeed && input.next >= 0)
1899
+ input.advance();
1900
+ input.acceptToken(Comment);
1901
+ });
1902
+
1903
+ // This file was generated by lezer-generator. You probably shouldn't edit it.
1904
+ const parser = lr.LRParser.deserialize({
1905
+ version: 14,
1906
+ states: "1dQ]Q!XOOO]Q!XO'#CoO!mO!rO'#CzO#dO$UO'#CuOOOh'#Dx'#DxOOOh'#Dh'#DhO#kO!YO'#CqO#rQ!WO'#CpO]Q!XO'#DTO]Q!XO'#DYOxQ!WO'#DZOxQ!WO'#D]OxQ!WO'#D_O$`Q!XO'#DaOOQU'#EP'#EPOOQU'#Dw'#DwO$pQvO'#DwO%[QvO'#DgOOQU'#Dv'#DvQ]Q!XOOO]Q!XO'#CyO]Q!XO'#C|OOQU,59Z,59ZOOO`'#D|'#D|OOO`'#Dj'#DjO%pO!rO,59fOOOh,59f,59fOOO`'#Dz'#DzOOO`'#Di'#DiO&RO$UO,59aOOOh,59a,59aOOOh-E7f-E7fOOQf,59],59]O&YO!YO'#DPOxQ!WO'#DQOOQf'#DQ'#DQOOQf'#EO'#EOOOQf'#Dk'#DkO&aQ!WO,59[O%[QvO'#DUO&}Q!XO,59oO'XQ!XO,59tO'`O!YO'#D[O'gQwO,59uO'lQvO,59wO'wO!YO'#D`O(OQ!WO,59yOOQg'#EQ'#EQOOQU,59{,59{O(cQ!XO,59{O(cQ!XO,59{OOQU'#Dn'#DnO(jQvO,5:cO]Q!XO,59|O]Q!XO,5:OOOQg,5:R,5:ROOQg-E7e-E7eO)UQ!XO,59eO)]Q!XO,59hOOO`-E7h-E7hOOOh1G/Q1G/QOOO`-E7g-E7gOOOh1G.{1G.{OOQf,59k,59kOOQf,59l,59lOOQf-E7i-E7iOOQg,59p,59pO)dQwO'#DXOOQV'#ER'#EROOQU1G/Z1G/ZO)rQwO1G/ZO)wQ!XO1G/ZOOQU1G/`1G/`O*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PWX]cdexy!R!S!V!W!Z![!i!k!q!s!y!z#Q#V#X#Z#[#_#a#c#g#i#k#l#m#qQxWQyXR#Z!yX!fx!i#Z#iR{YT#S!n#TR!O[!ibOWX]cdexy!R!S!V!W!Z![!i!k!q!s!y!z#Q#V#X#Z#[#_#a#c#g#i#k#l#m#qQcOQ!S]n!Yc!S!Z![!i!k!s#X#[#a#g#i#k#m#qQ!ZdQ![eQ!ixQ!kyQ!s!RQ#X!qQ#[!zQ#a#QQ#g#VQ#i#ZQ#k#_Q#m#cR#q#l!jUOPWX]cdexy!R!S!V!W!Z![!i!k!q!s!y!z#Q#V#X#Z#[#_#a#c#g#i#k#l#m#qWoUqz}dqVZrv!O!m!p#P#R#bQzYR}[QmRR!_mQiQR!]iQvVS!cv!pR!p!OQ#P!mS#^#P#bR#b#RQ#T!nR#d#TQ!U`R!t!U!^aO]cdexy!R!S!Z![!i!k!q!s!z#Q#V#X#Z#[#_#a#c#g#i#k#l#m#qUwWX!yQ!u!VR!v!W!hbOWX]cdexy!R!S!V!W!Z![!i!k!q!s!y!z#Q#V#X#Z#[#_#a#c#g#i#k#l#m#qRfP#]TOPUVWXYZ[]cdeqrvxyz}!O!R!S!V!W!Z![!i!k!m!p!q!s!y!z#P#Q#R#V#X#Z#[#_#a#b#c#g#i#k#l#m#qTlRmThQiXuVv!O!p!k`OPWX]cdexy!R!S!V!W!Z![!i!k!q!s!y!z#Q#V#X#Z#[#_#a#c#g#i#k#l#m#qQ!R]Q!XaQ!dwQ!n|Q!q!OQ!z!eQ#Q!mQ#V!pQ#_#PQ#c#RR#l#bQ!hxQ!|!iQ#h#ZR#o#i",
1909
+ nodeNames: "⚠ if else end while for in switch case function begin and or not Terminator Comment SubscriptOpen SubscriptClose Script Decorated SimpleCommand CommandName Glob Escape \" String SimpleExpansion ) $( CommandSubstitution Subscript ( CommandSubstitution Dollar RawString Word Redirect RedirectOp RedirectOp IfStatement Condition Background ElifClause ElseClause WhileStatement ForStatement VariableName SwitchStatement Ca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CsxzFkz#PCs#P#QFk#Q;'SCs;'S;=`Fp<%lOCsVCzV!qQgTOY&xZt&xux&xz#P&x#Q;'S&x;'S;=`'d<%lO&xVDh]!qQgTOX&xXYEaYZF_Z]&x]^Ea^p&xpqEaqt&xux&xz#P&x#Q;'S&x;'S;=`'d<%lO&xREf]!qQOX&xXYEaYZF_Z]&x]^Ea^p&xpqEaqt&xux&xz#P&x#Q;'S&x;'S;=`'d<%lO&xPFdO!iPTFkO!iPgTTFpOgTVFsP;=`<%lCsVGP_!oS!qQ!VPOY%ZYZ&ZZr%Zrs&xst%Zux%Zxz&Zz#O%Z#O#P&x#P#Q&Z#Q#p%Z#p#qHO#q;'S%Z;'S;=`'j<%lO%ZVHX]!oS!qQ!YPOY%ZYZ&ZZr%Zrs&xst%Zux%Zxz&Zz#O%Z#O#P&x#P#Q&Z#Q;'S%Z;'S;=`'j<%lO%Z",
1918
+ tokenizers: [reservedWords, terminators, comments, words, brackets, 0, 1, 2],
1919
+ topRules: {"Script":[0,18]},
1920
+ tokenPrec: 591
1921
+ });
1922
+
1923
+ /**
1924
+ A language provider for fish, based on the Lezer grammar in `fish.grammar`.
1925
+ */
1926
+ const fishLanguage = language.LRLanguage.define({
1927
+ name: "fish",
1928
+ parser: parser.configure({
1929
+ props: [
1930
+ language.indentNodeProp.add({
1931
+ CommandSubstitution: language.delimitedIndent({ closing: ")" }),
1932
+ // Every block ends with the same word, so every block indents the same
1933
+ // way, which is the one thing fish made easier than the shell did.
1934
+ "IfStatement WhileStatement ForStatement SwitchStatement FunctionDefinition BeginBlock": language.continuedIndent({ except: /^\s*(end|else)\b/ }),
1935
+ CaseClause: language.continuedIndent({ except: /^\s*(case|end)\b/ })
1936
+ }),
1937
+ language.foldNodeProp.add({
1938
+ CommandSubstitution: language.foldInside,
1939
+ "IfStatement WhileStatement ForStatement SwitchStatement FunctionDefinition BeginBlock": language.foldInside
1940
+ }),
1941
+ highlight.styleTags({
1942
+ "if else end": highlight.tags.controlKeyword,
1943
+ "while for in switch case begin": highlight.tags.controlKeyword,
1944
+ function: highlight.tags.definitionKeyword,
1945
+ // `and`, `or` and `not` are commands rather than punctuation, and read
1946
+ // as the logic they are either way.
1947
+ "and or not": highlight.tags.logicOperator,
1948
+ Comment: highlight.tags.lineComment,
1949
+ String: highlight.tags.string,
1950
+ RawString: highlight.tags.string,
1951
+ Escape: highlight.tags.escape,
1952
+ Glob: highlight.tags.special(highlight.tags.string),
1953
+ "SimpleCommand/CommandName": highlight.tags.function(highlight.tags.variableName),
1954
+ "FunctionDefinition/FunctionName": highlight.tags.function(highlight.tags.definition(highlight.tags.variableName)),
1955
+ VariableName: highlight.tags.definition(highlight.tags.variableName),
1956
+ SimpleExpansion: highlight.tags.variableName,
1957
+ Dollar: highlight.tags.variableName,
1958
+ RedirectOp: highlight.tags.controlOperator,
1959
+ "PipeOp Background": highlight.tags.controlOperator,
1960
+ "AndOp OrOp": highlight.tags.logicOperator,
1961
+ Terminator: highlight.tags.separator,
1962
+ '"\\""': highlight.tags.string,
1963
+ '"$(" "(" ")"': highlight.tags.paren,
1964
+ "SubscriptOpen SubscriptClose": highlight.tags.squareBracket
1965
+ })
1966
+ ]
1967
+ }),
1968
+ languageData: {
1969
+ commentTokens: { line: "#" },
1970
+ closeBrackets: { brackets: ["(", "[", "{", "'", '"'] },
1971
+ indentOnInput: /^\s*(end|else|case)$/
1972
+ }
1973
+ });
1974
+ // fish keeps a great deal in builtins that other shells leave to programs on
1975
+ // the path, `string` and `math` above all, so this list is most of the
1976
+ // language rather than a footnote to it.
1977
+ const builtins = [
1978
+ "abbr", "alias", "and", "argparse", "begin", "bg", "bind", "block", "break",
1979
+ "breakpoint", "builtin", "case", "cd", "command", "commandline", "complete",
1980
+ "contains", "continue", "count", "dirh", "dirs", "echo", "else", "emit",
1981
+ "end", "eval", "exec", "exit", "false", "fg", "for", "funced", "funcsave",
1982
+ "function", "functions", "history", "if", "isatty", "jobs", "math", "nextd",
1983
+ "not", "or", "path", "popd", "prevd", "printf", "prompt_pwd", "pushd", "pwd",
1984
+ "random", "read", "realpath", "return", "set", "set_color", "source",
1985
+ "status", "string", "switch", "test", "time", "trap", "true", "type",
1986
+ "ulimit", "umask", "vared", "wait", "while"
1987
+ ].map(label => ({ label, type: "function" }));
1988
+ // The variables fish sets for you. `status` is the last command's exit code,
1989
+ // and `argv` is a list rather than a string, which is the difference between
1990
+ // fish and every other shell here.
1991
+ const specials = [
1992
+ "argv", "CMD_DURATION", "fish_pid", "history", "HOME", "hostname", "IFS",
1993
+ "last_pid", "PATH", "pipestatus", "PWD", "SHLVL", "status", "USER",
1994
+ "version"
1995
+ ].map(label => ({ label, type: "constant" }));
1996
+ /**
1997
+ Autocompletion for fish's builtins and the variables it sets.
1998
+ */
1999
+ const fishCompletion = autocomplete.completeFromList([...builtins, ...specials]);
2000
+
2001
+ // A backtick substitution holds commands, but its opening and closing
2002
+ // characters are the same one, so the grammar reads it as a single token and
2003
+ // the commands are parsed here instead, by handing the range between the
2004
+ // backticks back to this parser. The reference is resolved when a parse asks
2005
+ // for it, which is after the assignment below has run.
2006
+ const insideBackticks = common.parseMixed(node => node.name == "Backtick" && node.to - node.from > 2
2007
+ ? { parser: shellParser, overlay: [{ from: node.from + 1, to: node.to - 1 }] }
2008
+ : null);
2009
+ const shellParser = parser$2.configure({
2010
+ wrap: insideBackticks,
2011
+ props: [
2012
+ language.indentNodeProp.add({
2013
+ Group: language.delimitedIndent({ closing: "}" }),
2014
+ Subshell: language.delimitedIndent({ closing: ")" }),
2015
+ ArrayLiteral: language.delimitedIndent({ closing: ")" }),
2016
+ CommandSubstitution: language.delimitedIndent({ closing: ")" }),
2017
+ DoGroup: language.delimitedIndent({ closing: "done" }),
2018
+ CaseStatement: language.delimitedIndent({ closing: "esac" }),
2019
+ // `then`, `elif` and `else` sit on the same line as the `if` they
2020
+ // belong to, so what is indented is everything after that line.
2021
+ IfStatement: language.continuedIndent({ except: /^\s*(fi|elif|else)\b/ }),
2022
+ CaseClause: language.continuedIndent({ except: /^\s*;;/ })
2023
+ }),
2024
+ language.foldNodeProp.add({
2025
+ Group: language.foldInside,
2026
+ Subshell: language.foldInside,
2027
+ ArrayLiteral: language.foldInside,
2028
+ CommandSubstitution: language.foldInside,
2029
+ DoGroup: language.foldInside,
2030
+ CaseStatement: language.foldInside,
2031
+ // An `if` folds from its first `then`, so the condition stays in view.
2032
+ IfStatement: node => {
2033
+ const then = node.getChild("then"), fi = node.getChild("fi");
2034
+ return then && fi ? { from: then.to, to: fi.from } : null;
2035
+ }
2036
+ }),
2037
+ highlight.styleTags({
2038
+ "if then elif else fi": highlight.tags.controlKeyword,
2039
+ "for while until do done in select": highlight.tags.controlKeyword,
2040
+ "case esac": highlight.tags.controlKeyword,
2041
+ function: highlight.tags.definitionKeyword,
2042
+ Comment: highlight.tags.lineComment,
2043
+ String: highlight.tags.string,
2044
+ RawString: highlight.tags.string,
2045
+ AnsiString: highlight.tags.special(highlight.tags.string),
2046
+ HeredocBody: highlight.tags.special(highlight.tags.string),
2047
+ Escape: highlight.tags.escape,
2048
+ LineContinuation: highlight.tags.escape,
2049
+ Glob: highlight.tags.special(highlight.tags.string),
2050
+ GlobQualifier: highlight.tags.special(highlight.tags.string),
2051
+ Regex: highlight.tags.regexp,
2052
+ // A command name reads as the call it is. Shell declares nothing, so
2053
+ // every other word is text until something expands it.
2054
+ "SimpleCommand/CommandName": highlight.tags.function(highlight.tags.variableName),
2055
+ "FunctionDefinition/FunctionName": highlight.tags.function(highlight.tags.definition(highlight.tags.variableName)),
2056
+ VariableName: highlight.tags.definition(highlight.tags.variableName),
2057
+ AssignName: highlight.tags.definition(highlight.tags.variableName),
2058
+ SimpleExpansion: highlight.tags.variableName,
2059
+ ParamName: highlight.tags.variableName,
2060
+ SpecialParam: highlight.tags.special(highlight.tags.variableName),
2061
+ "ParamOp ExpansionFlags SubscriptFlags": highlight.tags.operator,
2062
+ Dollar: highlight.tags.variableName,
2063
+ ArithVariable: highlight.tags.variableName,
2064
+ ArithNumber: highlight.tags.number,
2065
+ // Everything that decides what runs next, rather than what it runs on.
2066
+ RedirectOp: highlight.tags.controlOperator,
2067
+ "PipeOp Background": highlight.tags.controlOperator,
2068
+ "AndOp OrOp NotOp": highlight.tags.logicOperator,
2069
+ CaseTerminator: highlight.tags.punctuation,
2070
+ Terminator: highlight.tags.separator,
2071
+ "CondOp CondRegexOp": highlight.tags.compareOperator,
2072
+ "ArithPowerOp ArithMulOp ArithAddOp": highlight.tags.arithmeticOperator,
2073
+ "ArithShiftOp ArithBitAndOp ArithBitXorOp ArithBitOrOp ArithNotOp": highlight.tags.bitwiseOperator,
2074
+ "ArithRelateOp ArithEqualOp": highlight.tags.compareOperator,
2075
+ "ArithAndOp ArithOrOp": highlight.tags.logicOperator,
2076
+ ArithIncDecOp: highlight.tags.updateOperator,
2077
+ ArithAssignOp: highlight.tags.definitionOperator,
2078
+ // The quotes belong to the string they open, so that a string reads as
2079
+ // one thing even where it holds an expansion.
2080
+ '"\\""': highlight.tags.string,
2081
+ '"${" "}" "{"': highlight.tags.brace,
2082
+ '"$((" "$(" "((" "(" ")"': highlight.tags.paren,
2083
+ '"[[" "]]" "[" "]"': highlight.tags.squareBracket,
2084
+ '";" "," "?" ":"': highlight.tags.separator
2085
+ })
2086
+ ]
2087
+ });
2088
+ /**
2089
+ A language provider based on the Lezer shell parser in this package,
2090
+ extended with highlighting, folding and indentation information.
2091
+ */
2092
+ const shellLanguage = language.LRLanguage.define({
2093
+ name: "shell",
2094
+ parser: shellParser,
2095
+ languageData: {
2096
+ commentTokens: { line: "#" },
2097
+ closeBrackets: { brackets: ["(", "[", "{", "'", '"', "`"] },
2098
+ indentOnInput: /^\s*(fi|done|esac|else|elif|\}|\)|;;)$/
2099
+ }
2100
+ });
2101
+ /**
2102
+ Autocompletion for the shell's keywords, snippets, builtin commands,
2103
+ common programs and the variables it sets.
2104
+ */
2105
+ const shellCompletion = shellKeywordCompletion;
2106
+ // The shells that are not read by the grammar above, because neither is a
2107
+ // dialect of the shell command language: each has a grammar of its own in this
2108
+ // package and answers to a name like any other shell.
2109
+ const ownGrammars = {
2110
+ csh: { language: cshLanguage, completion: cshCompletion },
2111
+ fish: { language: fishLanguage, completion: fishCompletion }
2112
+ };
2113
+ // The names an editor is likely to have to hand. sh, bash, zsh and ksh are one
2114
+ // grammar, the way this package's AWK grammar is one grammar for awk and gawk:
2115
+ // somebody reading a script does not always know which of them wrote it.
2116
+ const aliases = {
2117
+ sh: "sh",
2118
+ shell: "sh",
2119
+ bash: "sh",
2120
+ dash: "sh",
2121
+ ash: "sh",
2122
+ posix: "sh",
2123
+ zsh: "sh",
2124
+ ksh: "sh",
2125
+ ksh93: "sh",
2126
+ mksh: "sh",
2127
+ csh: "csh",
2128
+ tcsh: "csh",
2129
+ fish: "fish"
2130
+ };
2131
+ /**
2132
+ The language for one shell. `"csh"`, `"tcsh"` and `"fish"` are answered with
2133
+ their own grammars, and everything else with the shell command language.
2134
+ What a caller does with the result is the same either way.
2135
+ */
2136
+ function shellLanguageFor(shell) {
2137
+ var _a;
2138
+ const own = ownGrammars[(_a = aliases[shell.toLowerCase()]) !== null && _a !== void 0 ? _a : shell.toLowerCase()];
2139
+ return own ? own.language : shellLanguage;
2140
+ }
2141
+ /**
2142
+ Shell language support, with completion for keywords, snippets, builtins,
2143
+ the variables the shell sets and the names declared in the file.
2144
+ */
2145
+ function shell(config = {}) {
2146
+ var _a, _b;
2147
+ const own = ownGrammars[(_b = aliases[((_a = config.shell) !== null && _a !== void 0 ? _a : "sh").toLowerCase()]) !== null && _b !== void 0 ? _b : ""];
2148
+ const language$1 = own ? own.language : shellLanguage;
2149
+ const completion = own ? [own.completion] : [shellCompletion, localCompletionSource];
2150
+ return new language.LanguageSupport(language$1, completion.map(source => language$1.data.of({ autocomplete: source })));
2151
+ }
2152
+ /**
2153
+ C shell support, for a caller who knows which of the grammars they want.
2154
+ */
2155
+ function csh() {
2156
+ return shell({ shell: "csh" });
2157
+ }
2158
+ /**
2159
+ fish support, likewise.
2160
+ */
2161
+ function fish() {
2162
+ return shell({ shell: "fish" });
2163
+ }
2164
+ /**
2165
+ Bash support. This is `shell()`, named for the shell most scripts are
2166
+ written for.
2167
+ */
2168
+ function bash() {
2169
+ return shell({ shell: "bash" });
2170
+ }
2171
+
2172
+ exports.bash = bash;
2173
+ exports.csh = csh;
2174
+ exports.cshCompletion = cshCompletion;
2175
+ exports.cshLanguage = cshLanguage;
2176
+ exports.cshParser = parser$1;
2177
+ exports.fish = fish;
2178
+ exports.fishCompletion = fishCompletion;
2179
+ exports.fishLanguage = fishLanguage;
2180
+ exports.fishParser = parser;
2181
+ exports.localCompletionSource = localCompletionSource;
2182
+ exports.parser = parser$2;
2183
+ exports.shell = shell;
2184
+ exports.shellCompletion = shellCompletion;
2185
+ exports.shellKeywordCompletion = shellKeywordCompletion;
2186
+ exports.shellLanguage = shellLanguage;
2187
+ exports.shellLanguageFor = shellLanguageFor;
2188
+ exports.snippets = snippets;