@exercism/codemirror-lang-haskell 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 +95 -0
- package/LICENSE +21 -0
- package/README.md +196 -2
- package/dist/index.cjs +1146 -0
- package/dist/index.d.cts +144 -0
- package/dist/index.d.ts +144 -0
- package/dist/index.js +1139 -0
- package/package.json +54 -4
package/dist/index.js
ADDED
|
@@ -0,0 +1,1139 @@
|
|
|
1
|
+
import { ExternalTokenizer, ContextTracker, LRParser } from '@lezer/lr';
|
|
2
|
+
import { syntaxTree, indentService, LRLanguage, foldNodeProp, LanguageSupport } from '@codemirror/language';
|
|
3
|
+
import { styleTags, tags } from '@lezer/highlight';
|
|
4
|
+
import { snippetCompletion, ifNotIn, completeFromList } from '@codemirror/autocomplete';
|
|
5
|
+
import { NodeWeakMap } from '@lezer/common';
|
|
6
|
+
|
|
7
|
+
// This file was generated by lezer-generator. You probably shouldn't edit it.
|
|
8
|
+
const LineComment = 1,
|
|
9
|
+
BlockComment = 2,
|
|
10
|
+
DocComment = 3,
|
|
11
|
+
Pragma = 4,
|
|
12
|
+
Directive = 5,
|
|
13
|
+
blockOpen = 182,
|
|
14
|
+
blockEnd = 183,
|
|
15
|
+
blockSep = 184,
|
|
16
|
+
braceOpen = 185,
|
|
17
|
+
braceEnd = 186,
|
|
18
|
+
DeclarationQuoteOpen = 6,
|
|
19
|
+
QuasiQuote = 7,
|
|
20
|
+
QuoteOpen = 8,
|
|
21
|
+
TypedQuoteOpen = 9,
|
|
22
|
+
TypeQuoteOpen = 10,
|
|
23
|
+
Qualifier = 11,
|
|
24
|
+
OperatorQualifier = 12,
|
|
25
|
+
DeclName = 13,
|
|
26
|
+
strictPrefix = 187,
|
|
27
|
+
module$1 = 16,
|
|
28
|
+
closeParen = 18,
|
|
29
|
+
comma = 34,
|
|
30
|
+
where = 35,
|
|
31
|
+
closeBracket = 64,
|
|
32
|
+
closeBrace = 67,
|
|
33
|
+
quoteEnd = 99,
|
|
34
|
+
doubleQuoteEnd = 100,
|
|
35
|
+
_in = 115,
|
|
36
|
+
then = 118,
|
|
37
|
+
_else = 119,
|
|
38
|
+
of = 124;
|
|
39
|
+
|
|
40
|
+
function isSpace(ch) {
|
|
41
|
+
return (ch == 32 /* Ch.Space */ ||
|
|
42
|
+
ch == 9 /* Ch.Tab */ ||
|
|
43
|
+
ch == 10 /* Ch.Newline */ ||
|
|
44
|
+
ch == 13 /* Ch.Return */ ||
|
|
45
|
+
ch == 12 /* Ch.FormFeed */ ||
|
|
46
|
+
ch == 11 /* Ch.VerticalTab */);
|
|
47
|
+
}
|
|
48
|
+
function isDigit(ch) {
|
|
49
|
+
return ch >= 48 /* Ch.Zero */ && ch <= 57 /* Ch.Nine */;
|
|
50
|
+
}
|
|
51
|
+
function isUpper(ch) {
|
|
52
|
+
return ch >= 65 /* Ch.UpperA */ && ch <= 90 /* Ch.UpperZ */;
|
|
53
|
+
}
|
|
54
|
+
// Everything above Latin-1 that the grammar does not read as an operator counts
|
|
55
|
+
// as a lowercase letter, which is close enough to Haskell's own rule to lex the
|
|
56
|
+
// identifiers people write and cheap enough to ask about every character.
|
|
57
|
+
function isLower(ch) {
|
|
58
|
+
return ((ch >= 97 /* Ch.LowerA */ && ch <= 122 /* Ch.LowerZ */) ||
|
|
59
|
+
ch == 95 /* Ch.Underscore */ ||
|
|
60
|
+
(ch >= 161 /* Ch.Latin1 */ && ch < 8592 /* Ch.ArrowsFrom */) ||
|
|
61
|
+
ch >= 9312 /* Ch.LettersAgain */);
|
|
62
|
+
}
|
|
63
|
+
function isIdentifierStart(ch) {
|
|
64
|
+
return isLower(ch) || isUpper(ch);
|
|
65
|
+
}
|
|
66
|
+
function isIdentifierChar(ch) {
|
|
67
|
+
return isIdentifierStart(ch) || isDigit(ch) || ch == 39 /* Ch.Apostrophe */;
|
|
68
|
+
}
|
|
69
|
+
function isSymbol(ch) {
|
|
70
|
+
switch (ch) {
|
|
71
|
+
case 33 /* Ch.Bang */:
|
|
72
|
+
case 35 /* Ch.Hash */:
|
|
73
|
+
case 36 /* Ch.Dollar */:
|
|
74
|
+
case 37 /* Ch.Percent */:
|
|
75
|
+
case 38 /* Ch.Ampersand */:
|
|
76
|
+
case 42 /* Ch.Star */:
|
|
77
|
+
case 43 /* Ch.Plus */:
|
|
78
|
+
case 46 /* Ch.Dot */:
|
|
79
|
+
case 47 /* Ch.Slash */:
|
|
80
|
+
case 60 /* Ch.Less */:
|
|
81
|
+
case 61 /* Ch.Equals */:
|
|
82
|
+
case 62 /* Ch.Greater */:
|
|
83
|
+
case 63 /* Ch.Question */:
|
|
84
|
+
case 64 /* Ch.At */:
|
|
85
|
+
case 92 /* Ch.Backslash */:
|
|
86
|
+
case 94 /* Ch.Caret */:
|
|
87
|
+
case 124 /* Ch.Pipe */:
|
|
88
|
+
case 45 /* Ch.Minus */:
|
|
89
|
+
case 126 /* Ch.Tilde */:
|
|
90
|
+
case 58 /* Ch.Colon */:
|
|
91
|
+
return true;
|
|
92
|
+
default:
|
|
93
|
+
return ch >= 8592 /* Ch.ArrowsFrom */ && ch <= 8959 /* Ch.OperatorsTo */;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
// The word that starts `offset` characters ahead, or "" where no word stands.
|
|
97
|
+
function wordAt(input, offset) {
|
|
98
|
+
let word = "";
|
|
99
|
+
for (let pos = offset; isIdentifierChar(input.peek(pos)); pos++) {
|
|
100
|
+
word += String.fromCharCode(input.peek(pos));
|
|
101
|
+
}
|
|
102
|
+
return word;
|
|
103
|
+
}
|
|
104
|
+
// A line the C preprocessor owns. Several libraries still run their sources
|
|
105
|
+
// through it, and a `#if` in the middle of a module is a line Haskell never
|
|
106
|
+
// sees. It only counts at the left margin, which is where the preprocessor
|
|
107
|
+
// insists on it, so `x # y` further in is left alone.
|
|
108
|
+
function startsDirective(input, offset = 0) {
|
|
109
|
+
if (input.peek(offset) != 35 /* Ch.Hash */)
|
|
110
|
+
return false;
|
|
111
|
+
const before = input.peek(offset - 1);
|
|
112
|
+
return before == -1 /* Ch.EOF */ || before == 10 /* Ch.Newline */ || before == 13 /* Ch.Return */;
|
|
113
|
+
}
|
|
114
|
+
function startsSkipped(input, offset = 0) {
|
|
115
|
+
return startsComment(input, offset) || startsDirective(input, offset);
|
|
116
|
+
}
|
|
117
|
+
function startsComment(input, offset = 0) {
|
|
118
|
+
const next = input.peek(offset);
|
|
119
|
+
if (next == 123 /* Ch.BraceL */)
|
|
120
|
+
return input.peek(offset + 1) == 45 /* Ch.Minus */;
|
|
121
|
+
if (next != 45 /* Ch.Minus */ || input.peek(offset + 1) != 45 /* Ch.Minus */)
|
|
122
|
+
return false;
|
|
123
|
+
let pos = offset + 2;
|
|
124
|
+
while (input.peek(pos) == 45 /* Ch.Minus */)
|
|
125
|
+
pos++;
|
|
126
|
+
const after = input.peek(pos);
|
|
127
|
+
return !isSymbol(after);
|
|
128
|
+
}
|
|
129
|
+
// ── Comments ──────────────────────────────────────────────────────────────────
|
|
130
|
+
/**
|
|
131
|
+
Haskell's block comments nest, so `{- {- -} -}` is one comment rather than
|
|
132
|
+
two, and counting that is why comments are read here rather than by a token
|
|
133
|
+
rule. Two other things ride along. `{-# ... #-}` is a pragma, which is how a
|
|
134
|
+
file asks for a language extension and how a function asks to be inlined,
|
|
135
|
+
and Haddock's `-- |`, `-- ^`, `{-| ... -}` and `{-^ ... -}` are the
|
|
136
|
+
documentation that ends up on Hackage. A highlighter wants all three in
|
|
137
|
+
different colours.
|
|
138
|
+
|
|
139
|
+
A line comment is two or more dashes that no symbol character follows, which
|
|
140
|
+
is what keeps `-->` and `--|` operators rather than comments.
|
|
141
|
+
*/
|
|
142
|
+
const comments = /*@__PURE__*/new ExternalTokenizer((input) => {
|
|
143
|
+
if (startsDirective(input)) {
|
|
144
|
+
let pos = 0;
|
|
145
|
+
for (;;) {
|
|
146
|
+
const ch = input.peek(pos);
|
|
147
|
+
if (ch == -1 /* Ch.EOF */)
|
|
148
|
+
break;
|
|
149
|
+
if (ch == 10 /* Ch.Newline */ && input.peek(pos - 1) != 92 /* Ch.Backslash */)
|
|
150
|
+
break;
|
|
151
|
+
pos++;
|
|
152
|
+
}
|
|
153
|
+
input.acceptToken(Directive, pos);
|
|
154
|
+
return;
|
|
155
|
+
}
|
|
156
|
+
if (input.next == 45 /* Ch.Minus */) {
|
|
157
|
+
if (!startsComment(input))
|
|
158
|
+
return;
|
|
159
|
+
let pos = 2;
|
|
160
|
+
while (input.peek(pos) == 45 /* Ch.Minus */)
|
|
161
|
+
pos++;
|
|
162
|
+
let doc = false;
|
|
163
|
+
for (let scan = pos;; scan++) {
|
|
164
|
+
const ch = input.peek(scan);
|
|
165
|
+
if (ch == 32 /* Ch.Space */ || ch == 9 /* Ch.Tab */)
|
|
166
|
+
continue;
|
|
167
|
+
doc = ch == 124 /* Ch.Pipe */ || ch == 94 /* Ch.Caret */;
|
|
168
|
+
break;
|
|
169
|
+
}
|
|
170
|
+
while (input.peek(pos) != 10 /* Ch.Newline */ && input.peek(pos) != -1 /* Ch.EOF */)
|
|
171
|
+
pos++;
|
|
172
|
+
input.acceptToken(doc ? DocComment : LineComment, pos);
|
|
173
|
+
return;
|
|
174
|
+
}
|
|
175
|
+
if (input.next != 123 /* Ch.BraceL */ || input.peek(1) != 45 /* Ch.Minus */)
|
|
176
|
+
return;
|
|
177
|
+
const marker = input.peek(2);
|
|
178
|
+
const pragma = marker == 35 /* Ch.Hash */;
|
|
179
|
+
const doc = marker == 124 /* Ch.Pipe */ || marker == 94 /* Ch.Caret */;
|
|
180
|
+
let depth = 0;
|
|
181
|
+
for (let pos = 0;; pos++) {
|
|
182
|
+
const ch = input.peek(pos);
|
|
183
|
+
if (ch == -1 /* Ch.EOF */) {
|
|
184
|
+
input.acceptToken(pragma ? Pragma : doc ? DocComment : BlockComment, pos);
|
|
185
|
+
return;
|
|
186
|
+
}
|
|
187
|
+
if (ch == 123 /* Ch.BraceL */ && input.peek(pos + 1) == 45 /* Ch.Minus */) {
|
|
188
|
+
depth++;
|
|
189
|
+
pos++;
|
|
190
|
+
}
|
|
191
|
+
else if (ch == 45 /* Ch.Minus */ && input.peek(pos + 1) == 125 /* Ch.BraceR */) {
|
|
192
|
+
depth--;
|
|
193
|
+
pos++;
|
|
194
|
+
if (!depth) {
|
|
195
|
+
input.acceptToken(pragma ? Pragma : doc ? DocComment : BlockComment, pos + 1);
|
|
196
|
+
return;
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
});
|
|
201
|
+
// ── Layout ────────────────────────────────────────────────────────────────────
|
|
202
|
+
/**
|
|
203
|
+
One open block: the column its items line up on, and whether somebody wrote
|
|
204
|
+
the brace themselves. An explicit block has no column, because nothing about
|
|
205
|
+
it is decided by indentation.
|
|
206
|
+
*/
|
|
207
|
+
class Layout {
|
|
208
|
+
constructor(parent, column, explicit) {
|
|
209
|
+
this.parent = parent;
|
|
210
|
+
this.column = column;
|
|
211
|
+
this.explicit = explicit;
|
|
212
|
+
this.hash = (parent ? parent.hash * 31 : 0) + column * 2 + (explicit ? 1 : 0);
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
// Nothing is open yet, and a block may open at any column, including the first.
|
|
216
|
+
const noLayout = /*@__PURE__*/new Layout(null, -1, false);
|
|
217
|
+
// The column a position stands in, and whether anything but whitespace stands
|
|
218
|
+
// in front of it on its line. Tabs advance to the next multiple of eight, which
|
|
219
|
+
// is what the report says and what every Haskell file that mixes them assumes.
|
|
220
|
+
function lineInfo(input) {
|
|
221
|
+
const before = [];
|
|
222
|
+
for (let offset = -1; offset > -400; offset--) {
|
|
223
|
+
const ch = input.peek(offset);
|
|
224
|
+
if (ch == -1 /* Ch.EOF */ || ch == 10 /* Ch.Newline */ || ch == 13 /* Ch.Return */)
|
|
225
|
+
break;
|
|
226
|
+
before.push(ch);
|
|
227
|
+
}
|
|
228
|
+
let column = 0, firstOnLine = true;
|
|
229
|
+
for (let pos = before.length - 1; pos >= 0; pos--) {
|
|
230
|
+
const ch = before[pos];
|
|
231
|
+
if (ch == 9 /* Ch.Tab */)
|
|
232
|
+
column += 8 - (column % 8);
|
|
233
|
+
else
|
|
234
|
+
column++;
|
|
235
|
+
if (!isSpace(ch))
|
|
236
|
+
firstOnLine = false;
|
|
237
|
+
}
|
|
238
|
+
return { column, firstOnLine };
|
|
239
|
+
}
|
|
240
|
+
function columnAt(input) {
|
|
241
|
+
return lineInfo(input).column;
|
|
242
|
+
}
|
|
243
|
+
// The report closes an implicit block wherever the parser would otherwise fail,
|
|
244
|
+
// which is what ends the block in `let x = 1 in x` although nothing is indented
|
|
245
|
+
// differently. The parser is the only thing that knows, so it is asked: these
|
|
246
|
+
// are the tokens that stand behind a block often enough to be worth asking
|
|
247
|
+
// about.
|
|
248
|
+
function closesBlock(input, stack) {
|
|
249
|
+
switch (input.next) {
|
|
250
|
+
case 41 /* Ch.ParenR */:
|
|
251
|
+
return !stack.canShift(closeParen);
|
|
252
|
+
case 93 /* Ch.BracketR */:
|
|
253
|
+
return !stack.canShift(closeBracket);
|
|
254
|
+
case 125 /* Ch.BraceR */:
|
|
255
|
+
return !stack.canShift(closeBrace);
|
|
256
|
+
case 44 /* Ch.Comma */:
|
|
257
|
+
return !stack.canShift(comma);
|
|
258
|
+
case 124 /* Ch.Pipe */:
|
|
259
|
+
if (input.peek(1) == 124 /* Ch.Pipe */ && input.peek(2) == 93 /* Ch.BracketR */)
|
|
260
|
+
return !stack.canShift(doubleQuoteEnd);
|
|
261
|
+
return input.peek(1) == 93 /* Ch.BracketR */ && !stack.canShift(quoteEnd);
|
|
262
|
+
}
|
|
263
|
+
if (!isIdentifierStart(input.next))
|
|
264
|
+
return false;
|
|
265
|
+
switch (wordAt(input, 0)) {
|
|
266
|
+
case "in":
|
|
267
|
+
return !stack.canShift(_in);
|
|
268
|
+
case "then":
|
|
269
|
+
return !stack.canShift(then);
|
|
270
|
+
case "else":
|
|
271
|
+
return !stack.canShift(_else);
|
|
272
|
+
case "of":
|
|
273
|
+
return !stack.canShift(of);
|
|
274
|
+
case "where":
|
|
275
|
+
return !stack.canShift(where);
|
|
276
|
+
default:
|
|
277
|
+
return false;
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
/**
|
|
281
|
+
The braces and semicolons Haskell does not write. A block opens at the
|
|
282
|
+
column of the first token after `where`, `do`, `let` or `of`, an item
|
|
283
|
+
starts wherever a line begins at exactly that column, and the block ends at
|
|
284
|
+
the first token to the left of it, or where the parser would fail, or at the
|
|
285
|
+
end of the file.
|
|
286
|
+
|
|
287
|
+
The tokens carry no text, so a `where` block ends where the reader can see
|
|
288
|
+
that it ends rather than at a brace nobody wrote. Where somebody did write
|
|
289
|
+
the braces, they are read as the same two tokens, which is what lets one
|
|
290
|
+
rule in the grammar serve both. A semicolon needs no help: it is written
|
|
291
|
+
down, so the grammar can ask for it itself.
|
|
292
|
+
|
|
293
|
+
A block whose first token stands no further right than the block around it
|
|
294
|
+
is empty, and closes where it opened. That is the rule that lets a `where`
|
|
295
|
+
with nothing under it be followed by a declaration at the left margin.
|
|
296
|
+
*/
|
|
297
|
+
const layout = /*@__PURE__*/new ExternalTokenizer((input, stack) => {
|
|
298
|
+
const cx = stack.context;
|
|
299
|
+
const implicit = cx.parent != null && !cx.explicit;
|
|
300
|
+
if (input.next == -1 /* Ch.EOF */) {
|
|
301
|
+
if (stack.canShift(blockOpen))
|
|
302
|
+
input.acceptToken(blockOpen);
|
|
303
|
+
else if (implicit && stack.canShift(blockEnd))
|
|
304
|
+
input.acceptToken(blockEnd);
|
|
305
|
+
return;
|
|
306
|
+
}
|
|
307
|
+
// Whitespace and comments are skipped by the grammar. Layout is decided in
|
|
308
|
+
// front of the tokens that are left.
|
|
309
|
+
if (isSpace(input.next) || startsSkipped(input))
|
|
310
|
+
return;
|
|
311
|
+
if (input.next == 125 /* Ch.BraceR */ && cx.explicit && stack.canShift(braceEnd)) {
|
|
312
|
+
input.advance();
|
|
313
|
+
input.acceptToken(braceEnd);
|
|
314
|
+
return;
|
|
315
|
+
}
|
|
316
|
+
if (input.next == 123 /* Ch.BraceL */ && stack.canShift(braceOpen)) {
|
|
317
|
+
input.advance();
|
|
318
|
+
input.acceptToken(braceOpen);
|
|
319
|
+
return;
|
|
320
|
+
}
|
|
321
|
+
// The body of a module may open at the first token of the file, which is
|
|
322
|
+
// also where its header may stand. The header wins where there is one.
|
|
323
|
+
if (stack.canShift(blockOpen)) {
|
|
324
|
+
if (stack.canShift(module$1) && wordAt(input, 0) == "module")
|
|
325
|
+
return;
|
|
326
|
+
input.acceptToken(blockOpen);
|
|
327
|
+
return;
|
|
328
|
+
}
|
|
329
|
+
if (!implicit)
|
|
330
|
+
return;
|
|
331
|
+
// A block that opened no further right than the one around it holds
|
|
332
|
+
// nothing at all.
|
|
333
|
+
if (cx.column <= cx.parent.column && stack.canShift(blockEnd)) {
|
|
334
|
+
input.acceptToken(blockEnd);
|
|
335
|
+
return;
|
|
336
|
+
}
|
|
337
|
+
if (closesBlock(input, stack) && stack.canShift(blockEnd)) {
|
|
338
|
+
input.acceptToken(blockEnd);
|
|
339
|
+
return;
|
|
340
|
+
}
|
|
341
|
+
const { column, firstOnLine } = lineInfo(input);
|
|
342
|
+
if (!firstOnLine)
|
|
343
|
+
return;
|
|
344
|
+
// Nothing in any block starts with `where`, so a `where` standing where an
|
|
345
|
+
// item would stand belongs to whatever the block is inside of. That is what
|
|
346
|
+
// lets a `where` follow the alternatives of a `case` at their own column.
|
|
347
|
+
const closing = column < cx.column || (column == cx.column && wordAt(input, 0) == "where");
|
|
348
|
+
if (closing && stack.canShift(blockEnd))
|
|
349
|
+
input.acceptToken(blockEnd);
|
|
350
|
+
else if (column == cx.column && stack.canShift(blockSep))
|
|
351
|
+
input.acceptToken(blockSep);
|
|
352
|
+
}, { contextual: true });
|
|
353
|
+
/**
|
|
354
|
+
The stack of open blocks. A block remembers the column it opened on, which
|
|
355
|
+
is read off the line the opening token stands on, and the tokenizer above
|
|
356
|
+
compares every line against the top of the stack.
|
|
357
|
+
*/
|
|
358
|
+
const trackLayout = /*@__PURE__*/new ContextTracker({
|
|
359
|
+
start: noLayout,
|
|
360
|
+
shift(context, term, stack, input) {
|
|
361
|
+
var _a;
|
|
362
|
+
if (term == blockOpen)
|
|
363
|
+
return new Layout(context, columnAt(input), false);
|
|
364
|
+
if (term == braceOpen)
|
|
365
|
+
return new Layout(context, -1, true);
|
|
366
|
+
if (term == blockEnd || term == braceEnd)
|
|
367
|
+
return (_a = context.parent) !== null && _a !== void 0 ? _a : context;
|
|
368
|
+
return context;
|
|
369
|
+
},
|
|
370
|
+
hash: context => context.hash
|
|
371
|
+
});
|
|
372
|
+
// ── Quotations ────────────────────────────────────────────────────────────────
|
|
373
|
+
// How far ahead the reading below goes before it gives up. The scan stops at
|
|
374
|
+
// the first bracket that closes at the outer level, so it only runs long inside
|
|
375
|
+
// a quotation that really is long, and a migration written as one SQL string is
|
|
376
|
+
// the longest anybody writes.
|
|
377
|
+
const maxQuotation = 65536;
|
|
378
|
+
// Which Template Haskell quotation each letter opens.
|
|
379
|
+
const quoteOpeners = {
|
|
380
|
+
d: DeclarationQuoteOpen,
|
|
381
|
+
e: QuoteOpen,
|
|
382
|
+
p: QuoteOpen,
|
|
383
|
+
t: TypeQuoteOpen
|
|
384
|
+
};
|
|
385
|
+
// `[e| f x |]` is a quotation and `[e|e<-xs]` is a list comprehension, and no
|
|
386
|
+
// token rule can see the difference: GHC decides it by whether TemplateHaskell
|
|
387
|
+
// is on, which is written in a pragma or in the file that builds the package.
|
|
388
|
+
// The bracket that closes the run decides it here. A quotation ends on `|]` and
|
|
389
|
+
// a comprehension on `]`, and brackets inside either are counted past.
|
|
390
|
+
function closesOnBar(input, offset) {
|
|
391
|
+
let depth = 0;
|
|
392
|
+
for (let pos = offset; pos < offset + maxQuotation; pos++) {
|
|
393
|
+
const ch = input.peek(pos);
|
|
394
|
+
if (ch == -1 /* Ch.EOF */)
|
|
395
|
+
return false;
|
|
396
|
+
if (ch == 91 /* Ch.BracketL */)
|
|
397
|
+
depth++;
|
|
398
|
+
else if (ch == 93 /* Ch.BracketR */) {
|
|
399
|
+
if (depth)
|
|
400
|
+
depth--;
|
|
401
|
+
else
|
|
402
|
+
return input.peek(pos - 1) == 124 /* Ch.Pipe */;
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
return false;
|
|
406
|
+
}
|
|
407
|
+
/**
|
|
408
|
+
Everything written between a bracket and a bar. Template Haskell spells its
|
|
409
|
+
quotations `[| |]`, `[e| |]`, `[p| |]`, `[t| |]`, `[d| |]` and `[|| ||]`,
|
|
410
|
+
and each holds Haskell of a kind the letter names, so the parser is handed
|
|
411
|
+
an opening token that says which. Anything else between the bracket and the
|
|
412
|
+
bar is a quasi quoter's name, and what follows is that quoter's language
|
|
413
|
+
rather than this one: SQL, HTML, C, R. There is nothing for a Haskell parser
|
|
414
|
+
to do with it but read to the `|]` and hand the whole run over as one token.
|
|
415
|
+
*/
|
|
416
|
+
const quotations = /*@__PURE__*/new ExternalTokenizer((input, stack) => {
|
|
417
|
+
if (input.next != 91 /* Ch.BracketL */)
|
|
418
|
+
return;
|
|
419
|
+
if (input.peek(1) == 124 /* Ch.Pipe */) {
|
|
420
|
+
const typed = input.peek(2) == 124 /* Ch.Pipe */;
|
|
421
|
+
const term = typed ? TypedQuoteOpen : QuoteOpen;
|
|
422
|
+
if (stack.canShift(term))
|
|
423
|
+
input.acceptToken(term, typed ? 3 : 2);
|
|
424
|
+
return;
|
|
425
|
+
}
|
|
426
|
+
let pos = 1, letter = "", qualified = false;
|
|
427
|
+
for (;;) {
|
|
428
|
+
if (!isIdentifierStart(input.peek(pos)))
|
|
429
|
+
return;
|
|
430
|
+
letter = "";
|
|
431
|
+
while (isIdentifierChar(input.peek(pos)))
|
|
432
|
+
letter += String.fromCharCode(input.peek(pos++));
|
|
433
|
+
if (input.peek(pos) != 46 /* Ch.Dot */)
|
|
434
|
+
break;
|
|
435
|
+
qualified = true;
|
|
436
|
+
pos++;
|
|
437
|
+
}
|
|
438
|
+
if (input.peek(pos) != 124 /* Ch.Pipe */ || !closesOnBar(input, pos + 1))
|
|
439
|
+
return;
|
|
440
|
+
const opener = qualified ? undefined : quoteOpeners[letter];
|
|
441
|
+
if (opener != null) {
|
|
442
|
+
if (stack.canShift(opener))
|
|
443
|
+
input.acceptToken(opener, pos + 1);
|
|
444
|
+
return;
|
|
445
|
+
}
|
|
446
|
+
if (!stack.canShift(QuasiQuote))
|
|
447
|
+
return;
|
|
448
|
+
let end = pos + 1;
|
|
449
|
+
for (;;) {
|
|
450
|
+
const ch = input.peek(end);
|
|
451
|
+
if (ch == -1 /* Ch.EOF */)
|
|
452
|
+
break;
|
|
453
|
+
if (ch == 124 /* Ch.Pipe */ && input.peek(end + 1) == 93 /* Ch.BracketR */) {
|
|
454
|
+
end += 2;
|
|
455
|
+
break;
|
|
456
|
+
}
|
|
457
|
+
end++;
|
|
458
|
+
}
|
|
459
|
+
input.acceptToken(QuasiQuote, end);
|
|
460
|
+
});
|
|
461
|
+
// ── Names ─────────────────────────────────────────────────────────────────────
|
|
462
|
+
/**
|
|
463
|
+
The module a name is being read out of. `Data.Map.insert` is one name in
|
|
464
|
+
three parts, and the dots in it are not the composition operator, so the
|
|
465
|
+
module part is read here and handed over as a token of its own. What follows
|
|
466
|
+
it is lexed as any other name would be, which is what keeps `M.map`, `M.Map`
|
|
467
|
+
and `M.!` one rule each rather than three.
|
|
468
|
+
*/
|
|
469
|
+
const qualifiers = /*@__PURE__*/new ExternalTokenizer((input, stack) => {
|
|
470
|
+
if (!isUpper(input.next))
|
|
471
|
+
return;
|
|
472
|
+
let pos = 0, end = 0, operator = false;
|
|
473
|
+
for (;;) {
|
|
474
|
+
if (!isUpper(input.peek(pos)))
|
|
475
|
+
break;
|
|
476
|
+
while (isIdentifierChar(input.peek(pos)))
|
|
477
|
+
pos++;
|
|
478
|
+
if (input.peek(pos) != 46 /* Ch.Dot */)
|
|
479
|
+
break;
|
|
480
|
+
const after = input.peek(pos + 1);
|
|
481
|
+
if (!isIdentifierStart(after) && !isSymbol(after))
|
|
482
|
+
break;
|
|
483
|
+
pos++;
|
|
484
|
+
end = pos;
|
|
485
|
+
operator = isSymbol(after);
|
|
486
|
+
}
|
|
487
|
+
if (!end)
|
|
488
|
+
return;
|
|
489
|
+
// Whether an operator or a name follows is decided here rather than by the
|
|
490
|
+
// parser: `f M.x` applies a function and `f M.+ y` does not, and one token of
|
|
491
|
+
// lookahead is not enough to tell them apart after the fact.
|
|
492
|
+
const term = operator ? OperatorQualifier : Qualifier;
|
|
493
|
+
if (stack.canShift(term))
|
|
494
|
+
input.acceptToken(term, end);
|
|
495
|
+
});
|
|
496
|
+
const reserved = /*@__PURE__*/new Set([
|
|
497
|
+
"case",
|
|
498
|
+
"class",
|
|
499
|
+
"data",
|
|
500
|
+
"default",
|
|
501
|
+
"deriving",
|
|
502
|
+
"do",
|
|
503
|
+
"else",
|
|
504
|
+
"foreign",
|
|
505
|
+
"if",
|
|
506
|
+
"import",
|
|
507
|
+
"in",
|
|
508
|
+
"infix",
|
|
509
|
+
"infixl",
|
|
510
|
+
"infixr",
|
|
511
|
+
"instance",
|
|
512
|
+
"let",
|
|
513
|
+
"module",
|
|
514
|
+
"newtype",
|
|
515
|
+
"of",
|
|
516
|
+
"then",
|
|
517
|
+
"type",
|
|
518
|
+
"where",
|
|
519
|
+
"_"
|
|
520
|
+
]);
|
|
521
|
+
/**
|
|
522
|
+
The name a declaration is declaring. `f x = x` declares `f`, and so does
|
|
523
|
+
`f :: Int -> Int`, but `xs !! n = ...` declares the operator between the two
|
|
524
|
+
names and neither of them. Which it is depends on what stands after the
|
|
525
|
+
name, and an LR parser cannot hold both readings open long enough to find
|
|
526
|
+
out, so the tokenizer looks ahead one token and decides.
|
|
527
|
+
|
|
528
|
+
An operator behind the name means the name is not the one being declared,
|
|
529
|
+
with four exceptions: `::` opens a signature, `=` and `|` open a body, and a
|
|
530
|
+
`!` or `~` written against its argument is a pattern rather than an operator.
|
|
531
|
+
A backtick means somebody is declaring an infix function. Everything else,
|
|
532
|
+
including another name, a literal, a bracket and a comma, leaves the name in
|
|
533
|
+
front of it a declaration.
|
|
534
|
+
*/
|
|
535
|
+
const declNames = /*@__PURE__*/new ExternalTokenizer((input, stack) => {
|
|
536
|
+
if (!isLower(input.next) || !stack.canShift(DeclName))
|
|
537
|
+
return;
|
|
538
|
+
let pos = 0;
|
|
539
|
+
while (isIdentifierChar(input.peek(pos)))
|
|
540
|
+
pos++;
|
|
541
|
+
while (input.peek(pos) == 35 /* Ch.Hash */)
|
|
542
|
+
pos++;
|
|
543
|
+
if (reserved.has(wordAt(input, 0)))
|
|
544
|
+
return;
|
|
545
|
+
let scan = pos;
|
|
546
|
+
for (;;) {
|
|
547
|
+
if (isSpace(input.peek(scan))) {
|
|
548
|
+
scan++;
|
|
549
|
+
}
|
|
550
|
+
else if (startsComment(input, scan)) {
|
|
551
|
+
while (input.peek(scan) != 10 /* Ch.Newline */ && input.peek(scan) != -1 /* Ch.EOF */)
|
|
552
|
+
scan++;
|
|
553
|
+
}
|
|
554
|
+
else {
|
|
555
|
+
break;
|
|
556
|
+
}
|
|
557
|
+
}
|
|
558
|
+
const next = input.peek(scan);
|
|
559
|
+
if (next == 96 /* Ch.Backtick */)
|
|
560
|
+
return;
|
|
561
|
+
// `pattern` declares a pattern synonym when a constructor follows it, and so
|
|
562
|
+
// it does when an operator stands behind the name after it, which is how an
|
|
563
|
+
// infix synonym is written. Anywhere else it is a name like any other, and
|
|
564
|
+
// parsers are full of variables called `pattern`.
|
|
565
|
+
if (wordAt(input, 0) == "pattern") {
|
|
566
|
+
if (isUpper(next) || next == 40 /* Ch.ParenL */)
|
|
567
|
+
return;
|
|
568
|
+
let ahead = scan;
|
|
569
|
+
while (isIdentifierChar(input.peek(ahead)))
|
|
570
|
+
ahead++;
|
|
571
|
+
while (isSpace(input.peek(ahead)))
|
|
572
|
+
ahead++;
|
|
573
|
+
const behind = input.peek(ahead);
|
|
574
|
+
if (isSymbol(behind) && behind != 61 /* Ch.Equals */ && behind != 124 /* Ch.Pipe */)
|
|
575
|
+
return;
|
|
576
|
+
}
|
|
577
|
+
if ((next == 33 /* Ch.Bang */ || next == 126 /* Ch.Tilde */) && !isSymbol(input.peek(scan + 1))) {
|
|
578
|
+
// A `!` or `~` written against its argument marks the pattern rather than
|
|
579
|
+
// the name in front of it, and `a ~~> b = ...` declares the operator.
|
|
580
|
+
if (isSpace(input.peek(scan + 1)))
|
|
581
|
+
return;
|
|
582
|
+
}
|
|
583
|
+
else if (isSymbol(next)) {
|
|
584
|
+
const second = input.peek(scan + 1), third = input.peek(scan + 2);
|
|
585
|
+
// `∷` is what `UnicodeSyntax` writes where the rest of Haskell writes `::`.
|
|
586
|
+
const signature = (next == 58 /* Ch.Colon */ && second == 58 /* Ch.Colon */ && !isSymbol(third)) ||
|
|
587
|
+
(next == 8759 /* Ch.Colons */ && !isSymbol(second));
|
|
588
|
+
const body = (next == 61 /* Ch.Equals */ || next == 124 /* Ch.Pipe */) && !isSymbol(second);
|
|
589
|
+
if (!signature && !body)
|
|
590
|
+
return;
|
|
591
|
+
}
|
|
592
|
+
input.acceptToken(DeclName, pos);
|
|
593
|
+
});
|
|
594
|
+
/**
|
|
595
|
+
The `!` that makes a pattern strict and the `~` that makes it lazy. Both
|
|
596
|
+
characters spell operators as well, and GHC tells the two apart by the
|
|
597
|
+
whitespace around them: written against what follows it and with space in
|
|
598
|
+
front of it, the character marks a pattern, and written with space on both
|
|
599
|
+
sides it is the operator between two expressions. `m ! k` looks a map up and
|
|
600
|
+
`f !x` takes a strict argument.
|
|
601
|
+
*/
|
|
602
|
+
const patternMarks = /*@__PURE__*/new ExternalTokenizer((input, stack) => {
|
|
603
|
+
if (input.next != 33 /* Ch.Bang */ && input.next != 126 /* Ch.Tilde */)
|
|
604
|
+
return;
|
|
605
|
+
if (!stack.canShift(strictPrefix))
|
|
606
|
+
return;
|
|
607
|
+
const before = input.peek(-1);
|
|
608
|
+
const opensBefore = before == -1 /* Ch.EOF */ ||
|
|
609
|
+
isSpace(before) ||
|
|
610
|
+
before == 40 /* Ch.ParenL */ ||
|
|
611
|
+
before == 91 /* Ch.BracketL */ ||
|
|
612
|
+
before == 123 /* Ch.BraceL */ ||
|
|
613
|
+
before == 44 /* Ch.Comma */ ||
|
|
614
|
+
before == 59 /* Ch.Semicolon */;
|
|
615
|
+
if (!opensBefore)
|
|
616
|
+
return;
|
|
617
|
+
const after = input.peek(1);
|
|
618
|
+
if (after == -1 /* Ch.EOF */ || isSpace(after) || isSymbol(after))
|
|
619
|
+
return;
|
|
620
|
+
// `(!)` is the operator itself rather than a mark on the bracket behind it.
|
|
621
|
+
if (after == 41 /* Ch.ParenR */ ||
|
|
622
|
+
after == 93 /* Ch.BracketR */ ||
|
|
623
|
+
after == 125 /* Ch.BraceR */ ||
|
|
624
|
+
after == 44 /* Ch.Comma */)
|
|
625
|
+
return;
|
|
626
|
+
input.acceptToken(strictPrefix, 1);
|
|
627
|
+
});
|
|
628
|
+
|
|
629
|
+
// This file was generated by lezer-generator. You probably shouldn't edit it.
|
|
630
|
+
const spec_varid = {__proto__:null,module:32, type:46, pattern:49, where:70, import:74, qualified:77, as:81, hiding:83, default:88, forall:106, _:112, infixl:144, infixr:146, infix:148, family:153, instance:154, data:170, let:190, case:220, in:230, if:234, then:236, else:238, proc:245, of:248, do:252, mdo:255, deriving:268, stock:271, anyclass:273, newtype:274, via:277, class:282, foreign:294, export:297};
|
|
631
|
+
const spec_varsym = {__proto__:null,"..":66, "∷":94, "∀":108, "@":114, "->":116, "→":118, "=>":120, "⇒":122, "=":156, "|":160, "<-":192, "←":194, "\\":218};
|
|
632
|
+
const spec_consym = {__proto__:null,"::":92};
|
|
633
|
+
const parser = /*@__PURE__*/LRParser.deserialize({
|
|
634
|
+
version: 14,
|
|
635
|
+
states: "!C`OfQ!eOOO$gQ#sO'#GjO$qQ#sO'#GjQOQ!cOOOiQ!eOOO${Q!kO'#CkOOQ!P'#Cu'#CuO%TQ!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Q&{$fQ)e&yR+n)f#jzPQ`be|!Z!]!d!f#o#w#x#}$P$a$e$f$t${$}%O%o&i&j&k&m&p&r&y'_'b's(W(`(b(d)T)Y)[)`)a)c)f*X*Z*[*p+Z+]+^+`+c+d+f-P-u-x.ZR#mx#jyPQ`be|!Z!]!d!f#o#w#x#}$P$a$e$f$t${$}%O%o&i&j&k&m&p&r&y'_'b's(W(`(b(d)T)Y)[)`)a)c)f*X*Z*[*p+Z+]+^+`+c+d+f-P-u-x.ZS#eszQ#lxR%n#mQ+|)oQ-`+zR.S-a[!PPQ!f#}$P$tR&O#zS#y}!OQ%t#tQ(g&RR*r(fQ!hQQ$s!fR'f$t",
|
|
638
|
+
nodeNames: "⚠ LineComment BlockComment DocComment Pragma Directive DeclarationQuoteOpen QuasiQuote QuoteOpen TypedQuoteOpen TypeQuoteOpen Qualifier OperatorQualifier DeclName Module ModuleHeader module ModuleName ) ( ExportList ModuleExport ExportItem type pattern Variable Constructor ParenOperator Operator ConstructorOperator ` BacktickOperator SubordinateList .. , where ImportDeclaration import qualified String as hiding ImportList DefaultDeclaration default TypeSignature :: :: Type TypeConstructor TypeVariable TypeOperator TypeConstructorOperator forall forall ' Wildcard @ -> -> => => Number ParenType ] [ ListType } { RecordFields FieldDeclaration FixityDeclaration infixl infixr infix TypeSynonym family instance = FunctionalDependencies | WhereBlock TypeEquation ; DataDeclaration data ConstructorDeclaration GadtSignature ParenExpression Annotated Char NameQuote '' ListExpression LetStatement let <- <- QuoteExpression |] ||] RecordExpression RecordBraces FieldBind StrictPattern AsPattern ApplyExpression Callee LambdaExpression \\ case CaseAlternative WhereBlock GuardedEquation LetExpression in IfExpression if then else GuardedEquation ProcExpression proc CaseExpression of DoExpression do mdo BindStatement OperatorExpression ApplyExpression ApplyExpression ApplyExpression DerivingClause deriving stock anyclass newtype via NewtypeDeclaration ClassDeclaration class InstanceDeclaration StandaloneDeriving PatternSynonym SpliceDeclaration ForeignDeclaration foreign export TypeSignature GuardedEquation Bind",
|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mvw$mz{$m{|$m}!O$m!O!P$m!P!Q$m![!]$m!^!_$m!_!`$m!`!a$m!a!b$m!b!c$m#O#P$m#P#Q8}#Q#R$m#p#q9S#r#s$m%#t%+t$m~9SO#V~~9Xf%Z~qr$mst$mtu$muv$mvw$mz{$m{|$m}!O$m!O!P$m!P!Q$m![!]$m!^!_$m!_!`$m!`!a$m!a!b$m!b!c$m#O#P$m#P#Q:m#Q#R$m#p#q$m#r#s$m%#t%+t$m~:rO#W~~:wO!e~",
|
|
649
|
+
tokenizers: [comments, layout, quotations, qualifiers, declNames, patternMarks, 0],
|
|
650
|
+
topRules: {"Module":[0,14]},
|
|
651
|
+
specialized: [{term: 190, get: (value) => spec_varid[value] || -1},{term: 195, get: (value) => spec_varsym[value] || -1},{term: 196, get: (value) => spec_consym[value] || -1}],
|
|
652
|
+
tokenPrec: 5487
|
|
653
|
+
});
|
|
654
|
+
|
|
655
|
+
/**
|
|
656
|
+
Snippets for the constructs people write most often in Haskell.
|
|
657
|
+
*/
|
|
658
|
+
const snippets = [
|
|
659
|
+
/*@__PURE__*/snippetCompletion("${name} :: ${Type}\n${name} ${args} = ${}", {
|
|
660
|
+
label: "fun",
|
|
661
|
+
detail: "function with signature",
|
|
662
|
+
type: "keyword"
|
|
663
|
+
}),
|
|
664
|
+
/*@__PURE__*/snippetCompletion("${name} ${args}\n\t| ${condition} = ${}\n\t| otherwise = ${}", {
|
|
665
|
+
label: "guard",
|
|
666
|
+
detail: "function with guards",
|
|
667
|
+
type: "keyword"
|
|
668
|
+
}),
|
|
669
|
+
/*@__PURE__*/snippetCompletion("case ${expression} of\n\t${pattern} -> ${}", {
|
|
670
|
+
label: "case",
|
|
671
|
+
detail: "expression",
|
|
672
|
+
type: "keyword"
|
|
673
|
+
}),
|
|
674
|
+
/*@__PURE__*/snippetCompletion("if ${condition} then ${} else ${}", {
|
|
675
|
+
label: "if",
|
|
676
|
+
detail: "then else",
|
|
677
|
+
type: "keyword"
|
|
678
|
+
}),
|
|
679
|
+
/*@__PURE__*/snippetCompletion("let ${name} = ${value} in ${}", {
|
|
680
|
+
label: "let",
|
|
681
|
+
detail: "in",
|
|
682
|
+
type: "keyword"
|
|
683
|
+
}),
|
|
684
|
+
/*@__PURE__*/snippetCompletion("where\n\t${name} = ${}", {
|
|
685
|
+
label: "where",
|
|
686
|
+
detail: "block",
|
|
687
|
+
type: "keyword"
|
|
688
|
+
}),
|
|
689
|
+
/*@__PURE__*/snippetCompletion("do\n\t${}", {
|
|
690
|
+
label: "do",
|
|
691
|
+
detail: "block",
|
|
692
|
+
type: "keyword"
|
|
693
|
+
}),
|
|
694
|
+
/*@__PURE__*/snippetCompletion("\\${x} -> ${}", {
|
|
695
|
+
label: "\\",
|
|
696
|
+
detail: "lambda",
|
|
697
|
+
type: "keyword"
|
|
698
|
+
}),
|
|
699
|
+
/*@__PURE__*/snippetCompletion("[${expression} | ${x} <- ${list}]", {
|
|
700
|
+
label: "[|]",
|
|
701
|
+
detail: "list comprehension",
|
|
702
|
+
type: "keyword"
|
|
703
|
+
}),
|
|
704
|
+
/*@__PURE__*/snippetCompletion("foldr (\\${x} ${acc} -> ${}) ${initial} ${list}", {
|
|
705
|
+
label: "foldr",
|
|
706
|
+
detail: "fold with a lambda",
|
|
707
|
+
type: "keyword"
|
|
708
|
+
}),
|
|
709
|
+
/*@__PURE__*/snippetCompletion("data ${Name} = ${Constructor} deriving (Show, Eq)", {
|
|
710
|
+
label: "data",
|
|
711
|
+
detail: "type definition",
|
|
712
|
+
type: "keyword"
|
|
713
|
+
}),
|
|
714
|
+
/*@__PURE__*/snippetCompletion("data ${Name} = ${Name}\n\t{ ${field} :: ${Type}\n\t} deriving (Show, Eq)", {
|
|
715
|
+
label: "data",
|
|
716
|
+
detail: "record definition",
|
|
717
|
+
type: "keyword"
|
|
718
|
+
}),
|
|
719
|
+
/*@__PURE__*/snippetCompletion("newtype ${Name} = ${Name} ${Type} deriving (Show, Eq)", {
|
|
720
|
+
label: "newtype",
|
|
721
|
+
detail: "definition",
|
|
722
|
+
type: "keyword"
|
|
723
|
+
}),
|
|
724
|
+
/*@__PURE__*/snippetCompletion("type ${Name} = ${Type}", {
|
|
725
|
+
label: "type",
|
|
726
|
+
detail: "synonym",
|
|
727
|
+
type: "keyword"
|
|
728
|
+
}),
|
|
729
|
+
/*@__PURE__*/snippetCompletion("class ${Name} ${a} where\n\t${method} :: ${a} -> ${}", {
|
|
730
|
+
label: "class",
|
|
731
|
+
detail: "definition",
|
|
732
|
+
type: "keyword"
|
|
733
|
+
}),
|
|
734
|
+
/*@__PURE__*/snippetCompletion("instance ${Class} ${Type} where\n\t${method} = ${}", {
|
|
735
|
+
label: "instance",
|
|
736
|
+
detail: "definition",
|
|
737
|
+
type: "keyword"
|
|
738
|
+
}),
|
|
739
|
+
/*@__PURE__*/snippetCompletion("import qualified ${Data.Map} as ${M}", {
|
|
740
|
+
label: "import",
|
|
741
|
+
detail: "qualified",
|
|
742
|
+
type: "keyword"
|
|
743
|
+
}),
|
|
744
|
+
/*@__PURE__*/snippetCompletion("module ${Name} (${exports}) where\n\n${}", {
|
|
745
|
+
label: "module",
|
|
746
|
+
detail: "header",
|
|
747
|
+
type: "keyword"
|
|
748
|
+
})
|
|
749
|
+
];
|
|
750
|
+
// Every node here opens a scope: the names it binds are visible inside it and
|
|
751
|
+
// nowhere else. A `where` belongs to the binding or alternative it stands under,
|
|
752
|
+
// so it is read as part of that node's scope.
|
|
753
|
+
const ScopeNodes = /*@__PURE__*/new Set([
|
|
754
|
+
"Module",
|
|
755
|
+
"Bind",
|
|
756
|
+
"LambdaExpression",
|
|
757
|
+
"CaseAlternative",
|
|
758
|
+
"DoExpression",
|
|
759
|
+
"LetExpression",
|
|
760
|
+
"ListExpression",
|
|
761
|
+
"GuardedEquation"
|
|
762
|
+
]);
|
|
763
|
+
// A pattern is written as an expression, so its variables are the unqualified
|
|
764
|
+
// `Variable` nodes in it. A record pattern `P {field = x}` names a field before
|
|
765
|
+
// its `=`, and that name binds nothing. A signature inside a pattern names
|
|
766
|
+
// types, and a lambda or block inside one binds its own names.
|
|
767
|
+
const notPattern = /*@__PURE__*/new Set([
|
|
768
|
+
"Callee", "Type", "LambdaExpression", "CaseAlternative", "CaseExpression",
|
|
769
|
+
"DoExpression", "LetExpression"
|
|
770
|
+
]);
|
|
771
|
+
function patternVariables(node, def) {
|
|
772
|
+
var _a;
|
|
773
|
+
if (node.name == "Variable") {
|
|
774
|
+
const fieldName = ((_a = node.parent) === null || _a === void 0 ? void 0 : _a.name) == "FieldBind" && !node.prevSibling && node.nextSibling;
|
|
775
|
+
if (!node.firstChild && !fieldName)
|
|
776
|
+
def(node, "variable");
|
|
777
|
+
}
|
|
778
|
+
else if (!notPattern.has(node.name)) {
|
|
779
|
+
for (let ch = node.firstChild; ch; ch = ch.nextSibling)
|
|
780
|
+
patternVariables(ch, def);
|
|
781
|
+
}
|
|
782
|
+
}
|
|
783
|
+
function isRhs(node) {
|
|
784
|
+
return node.name == "=" || node.name == "->" || node.name == "GuardedEquation" ||
|
|
785
|
+
node.name == "WhereBlock";
|
|
786
|
+
}
|
|
787
|
+
// `x <+> y = ...` defines an operator, and the operands are its parameters.
|
|
788
|
+
// `(a, b) = ...` binds `a` and `b` where the binding stands.
|
|
789
|
+
function definesOperator(lhs) {
|
|
790
|
+
if (lhs.name != "OperatorExpression")
|
|
791
|
+
return false;
|
|
792
|
+
for (let ch = lhs.firstChild; ch; ch = ch.nextSibling)
|
|
793
|
+
if (ch.name == "Operator" || ch.name == "BacktickOperator")
|
|
794
|
+
return true;
|
|
795
|
+
return false;
|
|
796
|
+
}
|
|
797
|
+
// The name a type declaration introduces is the first constructor in its head,
|
|
798
|
+
// after any context. `class (Eq a) => Ord a` declares `Ord`.
|
|
799
|
+
function declaredType(type) {
|
|
800
|
+
if (!type)
|
|
801
|
+
return null;
|
|
802
|
+
let found = null;
|
|
803
|
+
for (let ch = type.firstChild; ch; ch = ch.nextSibling) {
|
|
804
|
+
if (ch.name == "=>")
|
|
805
|
+
found = null;
|
|
806
|
+
else if (ch.name == "TypeConstructor" && !found)
|
|
807
|
+
found = ch;
|
|
808
|
+
}
|
|
809
|
+
return found;
|
|
810
|
+
}
|
|
811
|
+
function gatherTypeDeclaration(node, def) {
|
|
812
|
+
var _a;
|
|
813
|
+
const name = declaredType(node.getChild("Type"));
|
|
814
|
+
if (name)
|
|
815
|
+
def(name, node.name == "ClassDeclaration" ? "class" : "type");
|
|
816
|
+
for (const con of node.getChildren("ConstructorDeclaration")) {
|
|
817
|
+
const type = con.getChild("Type");
|
|
818
|
+
const name = type === null || type === void 0 ? void 0 : type.getChild("TypeConstructor");
|
|
819
|
+
if (name)
|
|
820
|
+
def(name, "constant");
|
|
821
|
+
for (const fields of (_a = type === null || type === void 0 ? void 0 : type.getChildren("RecordFields")) !== null && _a !== void 0 ? _a : [])
|
|
822
|
+
for (const field of fields.getChildren("FieldDeclaration"))
|
|
823
|
+
for (const n of field.getChildren("DeclName"))
|
|
824
|
+
def(n, "property");
|
|
825
|
+
}
|
|
826
|
+
}
|
|
827
|
+
// What a node declares into the scope around it, when the walk over that scope
|
|
828
|
+
// meets it. Returning true stops the walk going into the node.
|
|
829
|
+
const gatherers = {
|
|
830
|
+
Bind(node, def) {
|
|
831
|
+
const first = node.firstChild;
|
|
832
|
+
if ((first === null || first === void 0 ? void 0 : first.name) == "DeclName") {
|
|
833
|
+
const hasParams = first.nextSibling && !isRhs(first.nextSibling);
|
|
834
|
+
def(first, hasParams ? "function" : "variable");
|
|
835
|
+
}
|
|
836
|
+
else if (first && !definesOperator(first)) {
|
|
837
|
+
patternVariables(first, def);
|
|
838
|
+
}
|
|
839
|
+
return true;
|
|
840
|
+
},
|
|
841
|
+
TypeSignature(node, def) {
|
|
842
|
+
var _a;
|
|
843
|
+
const isFunction = !!((_a = node.getChild("Type")) === null || _a === void 0 ? void 0 : _a.getChild("->"));
|
|
844
|
+
for (const n of node.getChildren("DeclName"))
|
|
845
|
+
def(n, isFunction ? "function" : "variable");
|
|
846
|
+
return true;
|
|
847
|
+
},
|
|
848
|
+
DataDeclaration(node, def) {
|
|
849
|
+
gatherTypeDeclaration(node, def);
|
|
850
|
+
for (const block of node.getChildren("GadtSignature"))
|
|
851
|
+
for (const n of block.getChildren("Constructor"))
|
|
852
|
+
def(n, "constant");
|
|
853
|
+
return true;
|
|
854
|
+
},
|
|
855
|
+
NewtypeDeclaration(node, def) {
|
|
856
|
+
gatherTypeDeclaration(node, def);
|
|
857
|
+
return true;
|
|
858
|
+
},
|
|
859
|
+
TypeSynonym(node, def) {
|
|
860
|
+
gatherTypeDeclaration(node, def);
|
|
861
|
+
return true;
|
|
862
|
+
},
|
|
863
|
+
ClassDeclaration(node, def) {
|
|
864
|
+
gatherTypeDeclaration(node, def);
|
|
865
|
+
return false;
|
|
866
|
+
},
|
|
867
|
+
BindStatement(node, def) {
|
|
868
|
+
if (node.firstChild)
|
|
869
|
+
patternVariables(node.firstChild, def);
|
|
870
|
+
return false;
|
|
871
|
+
},
|
|
872
|
+
ImportDeclaration(node, def) {
|
|
873
|
+
const as = node.getChild("as");
|
|
874
|
+
const alias = as === null || as === void 0 ? void 0 : as.nextSibling;
|
|
875
|
+
if ((alias === null || alias === void 0 ? void 0 : alias.name) == "ModuleName")
|
|
876
|
+
def(alias, "namespace");
|
|
877
|
+
return true;
|
|
878
|
+
},
|
|
879
|
+
InstanceDeclaration() {
|
|
880
|
+
return true;
|
|
881
|
+
}
|
|
882
|
+
};
|
|
883
|
+
// The names a scope node binds itself: a function's parameters, a lambda's
|
|
884
|
+
// arguments, the variables a `case` pattern or a generator binds.
|
|
885
|
+
function ownBindings(node, def) {
|
|
886
|
+
var _a;
|
|
887
|
+
switch (node.name) {
|
|
888
|
+
case "Bind": {
|
|
889
|
+
const first = node.firstChild;
|
|
890
|
+
if ((first === null || first === void 0 ? void 0 : first.name) == "DeclName") {
|
|
891
|
+
for (let ch = first.nextSibling; ch && !isRhs(ch); ch = ch.nextSibling)
|
|
892
|
+
patternVariables(ch, def);
|
|
893
|
+
}
|
|
894
|
+
else if (first && definesOperator(first)) {
|
|
895
|
+
patternVariables(first, def);
|
|
896
|
+
}
|
|
897
|
+
break;
|
|
898
|
+
}
|
|
899
|
+
case "LambdaExpression":
|
|
900
|
+
for (let ch = (_a = node.firstChild) === null || _a === void 0 ? void 0 : _a.nextSibling; ch && ch.name != "->"; ch = ch.nextSibling)
|
|
901
|
+
patternVariables(ch, def);
|
|
902
|
+
break;
|
|
903
|
+
case "CaseAlternative":
|
|
904
|
+
if (node.firstChild)
|
|
905
|
+
patternVariables(node.firstChild, def);
|
|
906
|
+
break;
|
|
907
|
+
case "ListExpression":
|
|
908
|
+
case "GuardedEquation":
|
|
909
|
+
for (let ch = node.firstChild; ch; ch = ch.nextSibling)
|
|
910
|
+
if (ch.name == "<-" && ch.prevSibling)
|
|
911
|
+
patternVariables(ch.prevSibling, def);
|
|
912
|
+
break;
|
|
913
|
+
}
|
|
914
|
+
}
|
|
915
|
+
const cache = /*@__PURE__*/new NodeWeakMap();
|
|
916
|
+
function getScope(doc, node) {
|
|
917
|
+
const cached = cache.get(node);
|
|
918
|
+
if (cached)
|
|
919
|
+
return cached;
|
|
920
|
+
const completions = [];
|
|
921
|
+
const seen = new Set();
|
|
922
|
+
const def = (n, type) => {
|
|
923
|
+
const label = doc.sliceString(n.from, n.to);
|
|
924
|
+
if (!label || seen.has(label))
|
|
925
|
+
return;
|
|
926
|
+
seen.add(label);
|
|
927
|
+
completions.push({ label, type });
|
|
928
|
+
};
|
|
929
|
+
ownBindings(node, def);
|
|
930
|
+
const walk = (parent) => {
|
|
931
|
+
for (let ch = parent.firstChild; ch; ch = ch.nextSibling) {
|
|
932
|
+
const gather = gatherers[ch.name];
|
|
933
|
+
if (gather && gather(ch, def))
|
|
934
|
+
continue;
|
|
935
|
+
if (!ScopeNodes.has(ch.name))
|
|
936
|
+
walk(ch);
|
|
937
|
+
}
|
|
938
|
+
};
|
|
939
|
+
walk(node);
|
|
940
|
+
cache.set(node, completions);
|
|
941
|
+
return completions;
|
|
942
|
+
}
|
|
943
|
+
const Identifier = /^[\w'\xa1-]*$/;
|
|
944
|
+
const dontComplete = [
|
|
945
|
+
"String",
|
|
946
|
+
"Char",
|
|
947
|
+
"Number",
|
|
948
|
+
"LineComment",
|
|
949
|
+
"BlockComment",
|
|
950
|
+
"DocComment",
|
|
951
|
+
"Pragma",
|
|
952
|
+
"QuasiQuote",
|
|
953
|
+
"Directive"
|
|
954
|
+
];
|
|
955
|
+
/**
|
|
956
|
+
Completes the names declared in the file that are in scope at the cursor:
|
|
957
|
+
top-level functions, types and constructors, parameters, pattern variables,
|
|
958
|
+
and the bindings of `let`, `where` and `do`.
|
|
959
|
+
*/
|
|
960
|
+
const localCompletionSource = (context) => {
|
|
961
|
+
var _a, _b;
|
|
962
|
+
const inner = syntaxTree(context.state).resolveInner(context.pos, -1);
|
|
963
|
+
if (dontComplete.includes(inner.name))
|
|
964
|
+
return null;
|
|
965
|
+
const word = context.matchBefore(/[\w'\xa1-]+/);
|
|
966
|
+
if (!word && !context.explicit)
|
|
967
|
+
return null;
|
|
968
|
+
// `Map.l` asks for a name out of another module, which this file does not
|
|
969
|
+
// declare.
|
|
970
|
+
const before = context.state.sliceDoc(Math.max(0, ((_a = word === null || word === void 0 ? void 0 : word.from) !== null && _a !== void 0 ? _a : context.pos) - 1), (_b = word === null || word === void 0 ? void 0 : word.from) !== null && _b !== void 0 ? _b : context.pos);
|
|
971
|
+
if (before == ".")
|
|
972
|
+
return null;
|
|
973
|
+
let options = [];
|
|
974
|
+
for (let pos = inner; pos; pos = pos.parent)
|
|
975
|
+
if (ScopeNodes.has(pos.name))
|
|
976
|
+
options = options.concat(getScope(context.state.doc, pos));
|
|
977
|
+
return {
|
|
978
|
+
options,
|
|
979
|
+
from: word ? word.from : context.pos,
|
|
980
|
+
validFor: Identifier
|
|
981
|
+
};
|
|
982
|
+
};
|
|
983
|
+
/**
|
|
984
|
+
Wraps a completion source so it says nothing in strings and comments.
|
|
985
|
+
*/
|
|
986
|
+
function outsideLiterals(source) {
|
|
987
|
+
return ifNotIn(dontComplete, source);
|
|
988
|
+
}
|
|
989
|
+
|
|
990
|
+
// The body of a block is everything below the line it opens on. Folding it
|
|
991
|
+
// leaves the `where`, the `do` or the head of the declaration in view, which is
|
|
992
|
+
// the line that says what was folded away.
|
|
993
|
+
function foldBody(node, state) {
|
|
994
|
+
const line = state.doc.lineAt(node.from);
|
|
995
|
+
return node.to > line.to ? { from: line.to, to: node.to } : null;
|
|
996
|
+
}
|
|
997
|
+
// Nothing in the tree says where the line somebody is typing belongs, because
|
|
998
|
+
// a block ends at the last token in it and the new line is past that. So the
|
|
999
|
+
// line above is read instead: a line that opens a block is followed by one
|
|
1000
|
+
// indented under it, and every other line is followed by one at its own
|
|
1001
|
+
// indentation. That is the rule people follow by hand.
|
|
1002
|
+
const opensBlock = /(^|[^\w'])(do|mdo|where|of|let)$/;
|
|
1003
|
+
const continuesLine = /(=|->|<-|=>|\$|\||,|\(|\[|\{|`|::|\bif|\bthen|\belse|\bcase)$/;
|
|
1004
|
+
const wantsIndent = /^\s*(where|then|else)\b/;
|
|
1005
|
+
const indentHaskell = /*@__PURE__*/indentService.of((context, pos) => {
|
|
1006
|
+
const inside = syntaxTree(context.state).resolveInner(pos, -1).name;
|
|
1007
|
+
if (inside == "BlockComment" || inside == "DocComment" || inside == "Pragma")
|
|
1008
|
+
return null;
|
|
1009
|
+
let line = context.lineAt(pos, -1);
|
|
1010
|
+
while (!/\S/.test(line.text) && line.from > 0)
|
|
1011
|
+
line = context.lineAt(line.from - 1, -1);
|
|
1012
|
+
if (!/\S/.test(line.text))
|
|
1013
|
+
return 0;
|
|
1014
|
+
const code = line.text.replace(/\s*--(\s.*|-*)$/, "").trimEnd();
|
|
1015
|
+
const base = context.lineIndent(line.from);
|
|
1016
|
+
if (opensBlock.test(code) || continuesLine.test(code))
|
|
1017
|
+
return base + context.unit;
|
|
1018
|
+
if (wantsIndent.test(context.state.doc.sliceString(pos, pos + 20)))
|
|
1019
|
+
return base + context.unit;
|
|
1020
|
+
return base;
|
|
1021
|
+
});
|
|
1022
|
+
const haskellLanguage = /*@__PURE__*/LRLanguage.define({
|
|
1023
|
+
name: "haskell",
|
|
1024
|
+
parser: /*@__PURE__*/parser.configure({
|
|
1025
|
+
props: [
|
|
1026
|
+
/*@__PURE__*/foldNodeProp.add({
|
|
1027
|
+
"WhereBlock DoExpression CaseExpression LetExpression LetStatement": foldBody,
|
|
1028
|
+
"DataDeclaration ClassDeclaration InstanceDeclaration Bind": foldBody,
|
|
1029
|
+
"BlockComment DocComment": foldBody
|
|
1030
|
+
}),
|
|
1031
|
+
/*@__PURE__*/styleTags({
|
|
1032
|
+
"module import": tags.moduleKeyword,
|
|
1033
|
+
"data newtype type class instance deriving foreign default": tags.definitionKeyword,
|
|
1034
|
+
"where let in of": tags.definitionKeyword,
|
|
1035
|
+
"case if then else do": tags.controlKeyword,
|
|
1036
|
+
"infix infixl infixr": tags.keyword,
|
|
1037
|
+
"qualified as hiding family stock anyclass via pattern export mdo forall": tags.keyword,
|
|
1038
|
+
Number: tags.number,
|
|
1039
|
+
String: tags.string,
|
|
1040
|
+
Char: tags.character,
|
|
1041
|
+
Wildcard: tags.atom,
|
|
1042
|
+
LineComment: tags.lineComment,
|
|
1043
|
+
BlockComment: tags.blockComment,
|
|
1044
|
+
DocComment: tags.docComment,
|
|
1045
|
+
Pragma: tags.meta,
|
|
1046
|
+
QuasiQuote: /*@__PURE__*/tags.special(tags.string),
|
|
1047
|
+
"DeclarationQuoteOpen QuoteOpen TypedQuoteOpen TypeQuoteOpen |] ||]": tags.meta,
|
|
1048
|
+
Qualifier: tags.namespace,
|
|
1049
|
+
OperatorQualifier: tags.namespace,
|
|
1050
|
+
ModuleName: tags.namespace,
|
|
1051
|
+
"ModuleName/Qualifier": tags.namespace,
|
|
1052
|
+
DeclName: /*@__PURE__*/tags.definition(tags.variableName),
|
|
1053
|
+
"Bind/DeclName": /*@__PURE__*/tags.definition(/*@__PURE__*/tags.function(tags.variableName)),
|
|
1054
|
+
"FieldDeclaration/DeclName": /*@__PURE__*/tags.definition(tags.propertyName),
|
|
1055
|
+
"GadtSignature/Constructor": /*@__PURE__*/tags.definition(tags.className),
|
|
1056
|
+
"FieldBind/Variable": tags.propertyName,
|
|
1057
|
+
"Callee/Variable": /*@__PURE__*/tags.function(tags.variableName),
|
|
1058
|
+
Variable: tags.variableName,
|
|
1059
|
+
Constructor: tags.className,
|
|
1060
|
+
TypeConstructor: tags.typeName,
|
|
1061
|
+
TypeVariable: tags.typeName,
|
|
1062
|
+
"Operator ConstructorOperator BacktickOperator": tags.operator,
|
|
1063
|
+
"TypeOperator TypeConstructorOperator": tags.typeOperator,
|
|
1064
|
+
"= <-": tags.definitionOperator,
|
|
1065
|
+
":: -> =>": tags.typeOperator,
|
|
1066
|
+
'| .. @ ~ "!" \\': tags.operator,
|
|
1067
|
+
"'": tags.meta,
|
|
1068
|
+
"''": tags.meta,
|
|
1069
|
+
"` ; ,": tags.separator,
|
|
1070
|
+
"( )": tags.paren,
|
|
1071
|
+
"[ ]": tags.squareBracket,
|
|
1072
|
+
"{ }": tags.brace
|
|
1073
|
+
})
|
|
1074
|
+
]
|
|
1075
|
+
}),
|
|
1076
|
+
languageData: {
|
|
1077
|
+
commentTokens: { line: "--", block: { open: "{-", close: "-}" } },
|
|
1078
|
+
closeBrackets: { brackets: ["(", "[", "{", '"'] },
|
|
1079
|
+
indentOnInput: /^\s*(where|in|then|else|of|deriving)$/
|
|
1080
|
+
}
|
|
1081
|
+
});
|
|
1082
|
+
const keywords = /*@__PURE__*/("module import qualified as hiding where let in do case of if then else " +
|
|
1083
|
+
"data newtype type class instance deriving foreign infix infixl infixr " +
|
|
1084
|
+
"default forall family pattern stock anyclass via mdo")
|
|
1085
|
+
.split(" ")
|
|
1086
|
+
.map(label => ({ label, type: "keyword" }));
|
|
1087
|
+
// The Prelude is in scope in every file that does not say otherwise, so its
|
|
1088
|
+
// names are the ones worth proposing without reading the imports.
|
|
1089
|
+
const preludeValues = /*@__PURE__*/[
|
|
1090
|
+
"abs", "all", "and", "any", "appendFile", "asTypeOf", "break", "ceiling", "compare",
|
|
1091
|
+
"concat", "concatMap", "const", "curry", "cycle", "div", "divMod", "drop", "dropWhile",
|
|
1092
|
+
"either", "elem", "error", "errorWithoutStackTrace", "even", "exp", "filter", "flip",
|
|
1093
|
+
"floor", "fmap", "foldl", "foldMap", "foldr", "fromEnum", "fromInteger", "fromIntegral",
|
|
1094
|
+
"fromRational", "fst", "gcd", "getContents", "getLine", "head", "id", "init", "interact",
|
|
1095
|
+
"ioError", "iterate", "last", "lcm", "length", "lines", "log", "lookup", "map", "mapM",
|
|
1096
|
+
"mapM_", "max", "maximum", "maybe", "min", "minimum", "mod", "negate", "not", "notElem",
|
|
1097
|
+
"null", "odd", "or", "otherwise", "print", "product", "properFraction", "putStr",
|
|
1098
|
+
"putStrLn", "quot", "quotRem", "read", "readFile", "readLn", "realToFrac", "recip",
|
|
1099
|
+
"rem", "repeat", "replicate", "return", "reverse", "round", "scanl", "scanl1", "scanr",
|
|
1100
|
+
"scanr1", "seq", "sequence", "sequenceA", "sequence_", "show", "showString", "signum",
|
|
1101
|
+
"snd", "span", "splitAt", "sqrt", "subtract", "sum", "tail", "take", "takeWhile",
|
|
1102
|
+
"toEnum", "toInteger", "toRational", "traverse", "truncate", "uncurry", "undefined",
|
|
1103
|
+
"unlines", "until", "unwords", "unzip", "unzip3", "words", "writeFile", "zip", "zip3",
|
|
1104
|
+
"zipWith", "zipWith3"
|
|
1105
|
+
].map(label => ({ label, type: "function" }));
|
|
1106
|
+
const preludeTypes = /*@__PURE__*/[
|
|
1107
|
+
"Bool", "Bounded", "Char", "Double", "Either", "Enum", "Eq", "Float", "Floating",
|
|
1108
|
+
"Foldable", "Fractional", "Functor", "IO", "IOError", "Int", "Integer", "Integral",
|
|
1109
|
+
"Maybe", "Monad", "MonadFail", "Monoid", "Num", "Ord", "Ordering", "Rational", "Read",
|
|
1110
|
+
"Real", "RealFloat", "RealFrac", "Semigroup", "Show", "String", "Traversable", "Word"
|
|
1111
|
+
].map(label => ({ label, type: "type" }));
|
|
1112
|
+
const constructors = /*@__PURE__*/[
|
|
1113
|
+
"True", "False", "Nothing", "Just", "Left", "Right", "LT", "EQ", "GT"
|
|
1114
|
+
].map(label => ({ label, type: "constant" }));
|
|
1115
|
+
/**
|
|
1116
|
+
Autocompletion for Haskell's keywords, the snippets, and the names the
|
|
1117
|
+
Prelude puts in scope whether a file imports anything or not. It offers
|
|
1118
|
+
nothing inside strings and comments.
|
|
1119
|
+
*/
|
|
1120
|
+
const haskellCompletion = /*@__PURE__*/outsideLiterals(/*@__PURE__*/completeFromList([
|
|
1121
|
+
...snippets,
|
|
1122
|
+
...keywords,
|
|
1123
|
+
...preludeValues,
|
|
1124
|
+
...preludeTypes,
|
|
1125
|
+
...constructors
|
|
1126
|
+
]));
|
|
1127
|
+
/**
|
|
1128
|
+
Haskell language support, with completion for keywords, snippets, Prelude
|
|
1129
|
+
names and the names declared in the file.
|
|
1130
|
+
*/
|
|
1131
|
+
function haskell() {
|
|
1132
|
+
return new LanguageSupport(haskellLanguage, [
|
|
1133
|
+
indentHaskell,
|
|
1134
|
+
haskellLanguage.data.of({ autocomplete: haskellCompletion }),
|
|
1135
|
+
haskellLanguage.data.of({ autocomplete: localCompletionSource })
|
|
1136
|
+
]);
|
|
1137
|
+
}
|
|
1138
|
+
|
|
1139
|
+
export { haskell, haskellCompletion, haskellLanguage, localCompletionSource, parser, snippets };
|