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