desmost 0.9.0 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +87 -11
- package/dist/compiler/compile.d.ts +1 -7
- package/dist/compiler/compile.d.ts.map +1 -1
- package/dist/compiler/compile.js +3 -94
- package/dist/compiler/compile.js.map +1 -1
- package/dist/compiler/compiler.d.ts +56 -0
- package/dist/compiler/compiler.d.ts.map +1 -0
- package/dist/compiler/compiler.js +209 -0
- package/dist/compiler/compiler.js.map +1 -0
- package/dist/compiler/format.d.ts +2 -2
- package/dist/compiler/format.d.ts.map +1 -1
- package/dist/compiler/format.js +18 -9
- package/dist/compiler/format.js.map +1 -1
- package/dist/decompiler/decompile.d.ts +1 -1
- package/dist/decompiler/decompile.d.ts.map +1 -1
- package/dist/decompiler/decompile.js +1 -3
- package/dist/decompiler/decompile.js.map +1 -1
- package/dist/decompiler/extract.d.ts.map +1 -1
- package/dist/decompiler/extract.js +7 -3
- package/dist/decompiler/extract.js.map +1 -1
- package/dist/decompiler/format.d.ts.map +1 -1
- package/dist/decompiler/format.js +0 -1
- package/dist/decompiler/format.js.map +1 -1
- package/dist/errors.d.ts +35 -27
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +46 -48
- package/dist/errors.js.map +1 -1
- package/dist/index.internal.d.ts +1 -1
- package/dist/index.internal.d.ts.map +1 -1
- package/dist/magic/global/desmos.d.ts +2 -2
- package/dist/magic/global/desmos.d.ts.map +1 -1
- package/dist/magic/global/desmos.js +3 -2
- package/dist/magic/global/desmos.js.map +1 -1
- package/dist/magic/global/viewport.d.ts +2 -2
- package/dist/magic/global/viewport.d.ts.map +1 -1
- package/dist/magic/global/viewport.js +5 -5
- package/dist/magic/global/viewport.js.map +1 -1
- package/dist/magic/incantation.d.ts +4 -4
- package/dist/magic/incantation.d.ts.map +1 -1
- package/dist/magic/incantation.js +15 -8
- package/dist/magic/incantation.js.map +1 -1
- package/dist/magic/local/colour.d.ts +3 -1
- package/dist/magic/local/colour.d.ts.map +1 -1
- package/dist/magic/local/colour.js +15 -11
- package/dist/magic/local/colour.js.map +1 -1
- package/dist/magic/local/label.d.ts +2 -2
- package/dist/magic/local/label.d.ts.map +1 -1
- package/dist/magic/local/label.js +8 -7
- package/dist/magic/local/label.js.map +1 -1
- package/dist/magic/local/line.d.ts +2 -2
- package/dist/magic/local/line.d.ts.map +1 -1
- package/dist/magic/local/line.js +0 -1
- package/dist/magic/local/line.js.map +1 -1
- package/dist/options.d.ts +59 -27
- package/dist/options.d.ts.map +1 -1
- package/dist/options.js +2 -1
- package/dist/options.js.map +1 -1
- package/dist/parser/ast.d.ts +3 -17
- package/dist/parser/ast.d.ts.map +1 -1
- package/dist/parser/ast.js +0 -2
- package/dist/parser/ast.js.map +1 -1
- package/dist/parser/desmost-parser.d.ts +33 -22
- package/dist/parser/desmost-parser.d.ts.map +1 -1
- package/dist/parser/desmost-parser.js +106 -92
- package/dist/parser/desmost-parser.js.map +1 -1
- package/dist/parser/generic-parser.d.ts +19 -10
- package/dist/parser/generic-parser.d.ts.map +1 -1
- package/dist/parser/generic-parser.js +56 -16
- package/dist/parser/generic-parser.js.map +1 -1
- package/dist/utils.d.ts +9 -2
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +13 -2
- package/dist/utils.js.map +1 -1
- package/package.json +4 -3
- package/src/compiler/compile.ts +7 -120
- package/src/compiler/compiler.ts +275 -0
- package/src/compiler/format.ts +19 -7
- package/src/decompiler/decompile.ts +1 -7
- package/src/decompiler/extract.ts +3 -1
- package/src/decompiler/format.ts +0 -1
- package/src/errors.ts +40 -24
- package/src/index.internal.ts +1 -1
- package/src/magic/.template.ts +2 -2
- package/src/magic/global/desmos.ts +7 -9
- package/src/magic/global/viewport.ts +11 -17
- package/src/magic/incantation.ts +21 -22
- package/src/magic/local/colour.ts +23 -13
- package/src/magic/local/label.ts +14 -19
- package/src/magic/local/line.ts +2 -2
- package/src/options.ts +83 -51
- package/src/parser/ast.ts +1 -21
- package/src/parser/desmost-parser.ts +131 -135
- package/src/parser/generic-parser.ts +71 -29
- package/src/utils.ts +25 -3
- package/dist/compiler/evaluate.d.ts +0 -18
- package/dist/compiler/evaluate.d.ts.map +0 -1
- package/dist/compiler/evaluate.js +0 -93
- package/dist/compiler/evaluate.js.map +0 -1
- package/dist/desmos.d.ts +0 -16
- package/dist/desmos.d.ts.map +0 -1
- package/dist/desmos.js +0 -19
- package/dist/desmos.js.map +0 -1
- package/src/compiler/evaluate.ts +0 -128
- package/src/desmos.ts +0 -22
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { GenericParser } from "./generic-parser.js";
|
|
2
2
|
import { Ast } from "./ast.js";
|
|
3
|
-
import { NO_MATCH,
|
|
3
|
+
import { NO_MATCH, DesmostError } from "../errors.js";
|
|
4
4
|
import * as utils from "../utils.js";
|
|
5
5
|
import { Incantation, ArgIncantation, GLOBAL_INCANTATIONS, LOCAL_INCANTATIONS, EXPR_INCANTATIONS } from "../magic/index.js";
|
|
6
6
|
/**
|
|
@@ -14,47 +14,66 @@ export class DesmostParser extends GenericParser {
|
|
|
14
14
|
}
|
|
15
15
|
// == TOP-LEVEL == //
|
|
16
16
|
/**
|
|
17
|
-
* Parse the next semantic block of source code
|
|
17
|
+
* Parse the next semantic block of source code.
|
|
18
|
+
*
|
|
19
|
+
* This returns:
|
|
20
|
+
*
|
|
21
|
+
* ```ts
|
|
22
|
+
* // an AST block(s) + any errors encountered
|
|
23
|
+
* { blocks: Ast[], errors: [...] }
|
|
24
|
+
*
|
|
25
|
+
* // ignored block + any errors encountered
|
|
26
|
+
* { blocks: [], errors: [...] }
|
|
27
|
+
*
|
|
28
|
+
* // parser has reached the end of the source
|
|
29
|
+
* undefined
|
|
30
|
+
* ```
|
|
31
|
+
*
|
|
32
|
+
* `block: null` could be ignored content like comments, or it could be a parse that couldn't recover and so failed to produce a block.
|
|
18
33
|
*/
|
|
19
34
|
parse_next() {
|
|
35
|
+
this.errors = [];
|
|
20
36
|
this.consume_spaces();
|
|
21
37
|
if (this.out_of_bounds()) {
|
|
22
|
-
return
|
|
38
|
+
return undefined;
|
|
23
39
|
}
|
|
40
|
+
let blocks = [];
|
|
24
41
|
if (this.current === "%") {
|
|
42
|
+
// comment
|
|
25
43
|
if (this.options?.ignore_comments) {
|
|
26
|
-
// ignore comment
|
|
27
44
|
this.parse_line();
|
|
28
|
-
this.consume_end_of_block();
|
|
29
|
-
return this.parse_next();
|
|
30
45
|
}
|
|
31
46
|
else {
|
|
32
|
-
|
|
33
|
-
var expr = this.parse_comment();
|
|
47
|
+
blocks.push(this.parse_comment());
|
|
34
48
|
}
|
|
35
49
|
}
|
|
36
50
|
else if (this.current === "/") {
|
|
37
51
|
let r = this.parse_pre_sep();
|
|
38
|
-
// 1 global
|
|
39
52
|
if ("global" in r) {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
if (incantations.length > 0) {
|
|
45
|
-
this.parse_sep();
|
|
53
|
+
// 1 global
|
|
54
|
+
if (r.global !== null) {
|
|
55
|
+
blocks.push(r.global);
|
|
56
|
+
}
|
|
46
57
|
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
58
|
+
else {
|
|
59
|
+
// 1+ locals + 1 expr
|
|
60
|
+
let incantations = r.locals;
|
|
61
|
+
if (incantations.length > 0) {
|
|
62
|
+
this.parse_sep();
|
|
63
|
+
}
|
|
64
|
+
let block = this.parse_post_sep();
|
|
65
|
+
for (let invocation of incantations) {
|
|
66
|
+
block.incantations.push(invocation);
|
|
67
|
+
}
|
|
68
|
+
blocks.push(block);
|
|
50
69
|
}
|
|
51
70
|
}
|
|
52
71
|
else {
|
|
53
72
|
// 1 expr
|
|
54
|
-
|
|
73
|
+
blocks.push(this.parse_post_sep());
|
|
55
74
|
}
|
|
56
75
|
this.consume_end_of_block();
|
|
57
|
-
return
|
|
76
|
+
return { blocks, errors: this.errors };
|
|
58
77
|
}
|
|
59
78
|
/**
|
|
60
79
|
* Parse Desmost syntax before the `::` separator, which may be:
|
|
@@ -64,27 +83,63 @@ export class DesmostParser extends GenericParser {
|
|
|
64
83
|
*/
|
|
65
84
|
parse_pre_sep() {
|
|
66
85
|
// 1 global incantation
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
86
|
+
try {
|
|
87
|
+
let r = this.try_parse_incantation(GLOBAL_INCANTATIONS);
|
|
88
|
+
if (r !== NO_MATCH) {
|
|
89
|
+
this.consume_spaces();
|
|
90
|
+
return { global: r };
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
catch (e) {
|
|
94
|
+
this.errors.push(e);
|
|
95
|
+
return { global: null };
|
|
71
96
|
}
|
|
72
97
|
// 1+ local incantations
|
|
73
98
|
let incantations = [];
|
|
74
99
|
while (this.current === "/") {
|
|
75
|
-
|
|
100
|
+
try {
|
|
101
|
+
var invocation = this.try_parse_incantation(LOCAL_INCANTATIONS);
|
|
102
|
+
}
|
|
103
|
+
catch (e) {
|
|
104
|
+
this.errors.push(e);
|
|
105
|
+
continue;
|
|
106
|
+
}
|
|
76
107
|
if (invocation === NO_MATCH)
|
|
77
108
|
break;
|
|
78
109
|
incantations.push(invocation);
|
|
110
|
+
this.consume_whitespace();
|
|
79
111
|
}
|
|
80
|
-
return {
|
|
112
|
+
return { locals: incantations };
|
|
81
113
|
}
|
|
82
114
|
/**
|
|
83
115
|
* Parse the Desmost `::` separator.
|
|
84
116
|
*/
|
|
85
117
|
parse_sep() {
|
|
86
118
|
this.consume_whitespace();
|
|
87
|
-
|
|
119
|
+
try {
|
|
120
|
+
this.consume("::", {
|
|
121
|
+
msg: `Expected \`::\` separator between local incantations and expression, but found: \`${this.preview()}\``,
|
|
122
|
+
hint: `Use \`/incantation :: ${this.preview()}\``,
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
catch (e) {
|
|
126
|
+
if (!this.peek_line().includes("::"))
|
|
127
|
+
throw e;
|
|
128
|
+
let init = this.i;
|
|
129
|
+
while (this.current !== ":" || this.peek() !== ":") {
|
|
130
|
+
this.advance();
|
|
131
|
+
}
|
|
132
|
+
const peek = 7;
|
|
133
|
+
const start = "...".length + Math.round(1.5 * peek);
|
|
134
|
+
this.errors.push(new DesmostError.ExcessInput({
|
|
135
|
+
msg: `While consuming \`::\` separator`,
|
|
136
|
+
show: {
|
|
137
|
+
text: `...${this.source.slice(init - peek, this.i + peek)}...`,
|
|
138
|
+
span: new utils.Range(start, start + this.i - init)
|
|
139
|
+
}
|
|
140
|
+
}));
|
|
141
|
+
this.consume("::");
|
|
142
|
+
}
|
|
88
143
|
this.consume_whitespace();
|
|
89
144
|
}
|
|
90
145
|
/**
|
|
@@ -139,47 +194,19 @@ export class DesmostParser extends GenericParser {
|
|
|
139
194
|
return this.source.slice(init, this.i).trim();
|
|
140
195
|
}
|
|
141
196
|
/**
|
|
142
|
-
* Attempt to parse
|
|
197
|
+
* Attempt to parse an incantation invocation allowed by `incantations`.
|
|
143
198
|
*/
|
|
144
|
-
|
|
199
|
+
try_parse_incantation(incantations) {
|
|
145
200
|
let init = this.i;
|
|
146
201
|
if (this.try_consume("/") === NO_MATCH)
|
|
147
202
|
return NO_MATCH;
|
|
148
|
-
let
|
|
149
|
-
if (
|
|
203
|
+
let ident = this.try_consume_identifier();
|
|
204
|
+
if (ident === NO_MATCH) {
|
|
150
205
|
this.i = init;
|
|
151
206
|
return NO_MATCH;
|
|
152
207
|
}
|
|
153
|
-
let
|
|
154
|
-
if (incantation
|
|
155
|
-
if (this.current === "{") {
|
|
156
|
-
data = this.parse_incantation_arg(incantation.arg_type);
|
|
157
|
-
}
|
|
158
|
-
else if (incantation.requires_arg) {
|
|
159
|
-
return {
|
|
160
|
-
kind: Ast.Kind.INVALID_INCANTATION,
|
|
161
|
-
incantation,
|
|
162
|
-
error: new UnrecoverableError.MissingInput(`No argument provided for /${incantation.identifier}, which requires an argument of type: \`${incantation.arg_type}\``)
|
|
163
|
-
};
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
this.consume_spaces();
|
|
167
|
-
// @ts-expect-error: FIXME
|
|
168
|
-
return {
|
|
169
|
-
kind: Ast.Kind.INCANTATION_INVOCATION,
|
|
170
|
-
incantation,
|
|
171
|
-
arg_raw: data,
|
|
172
|
-
};
|
|
173
|
-
}
|
|
174
|
-
/**
|
|
175
|
-
* Attempt to parse a local incantation invocation.
|
|
176
|
-
*/
|
|
177
|
-
try_parse_local_incantation() {
|
|
178
|
-
let init = this.i;
|
|
179
|
-
if (this.try_consume("/") === NO_MATCH)
|
|
180
|
-
return NO_MATCH;
|
|
181
|
-
let incantation = this.try_parse_identifier(LOCAL_INCANTATIONS);
|
|
182
|
-
if (incantation === NO_MATCH) {
|
|
208
|
+
let incantation = incantations.find(inc => inc.identifier === ident || inc.alias === ident);
|
|
209
|
+
if (incantation == undefined) {
|
|
183
210
|
this.i = init;
|
|
184
211
|
return NO_MATCH;
|
|
185
212
|
}
|
|
@@ -189,15 +216,12 @@ export class DesmostParser extends GenericParser {
|
|
|
189
216
|
arg_raw = this.parse_incantation_arg(incantation.arg_type);
|
|
190
217
|
}
|
|
191
218
|
else if (incantation.requires_arg) {
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
incantation
|
|
195
|
-
|
|
196
|
-
};
|
|
219
|
+
throw new DesmostError.MissingInput({
|
|
220
|
+
msg: `No argument provided for /${incantation.identifier}`,
|
|
221
|
+
hint: `/${incantation.identifier} requires an argument of type: \`${incantation.arg_type}\``,
|
|
222
|
+
});
|
|
197
223
|
}
|
|
198
224
|
}
|
|
199
|
-
this.consume_whitespace();
|
|
200
|
-
// @ts-expect-error: FIXME
|
|
201
225
|
return {
|
|
202
226
|
kind: Ast.Kind.INCANTATION_INVOCATION,
|
|
203
227
|
incantation,
|
|
@@ -211,12 +235,17 @@ export class DesmostParser extends GenericParser {
|
|
|
211
235
|
let init = this.i;
|
|
212
236
|
if (this.try_consume("/") === NO_MATCH)
|
|
213
237
|
return NO_MATCH;
|
|
214
|
-
let
|
|
215
|
-
if (
|
|
216
|
-
|
|
238
|
+
let ident = this.try_consume_identifier();
|
|
239
|
+
if (ident === NO_MATCH) {
|
|
240
|
+
this.i = init;
|
|
241
|
+
return NO_MATCH;
|
|
242
|
+
}
|
|
243
|
+
let incantation = EXPR_INCANTATIONS.find(inc => inc.identifier === ident || inc.alias === ident);
|
|
244
|
+
if (incantation == undefined) {
|
|
217
245
|
this.i = init;
|
|
218
246
|
return NO_MATCH;
|
|
219
247
|
}
|
|
248
|
+
/* NOTE: All expression incantations currently require arguments, and all for the foreseeable future will too */
|
|
220
249
|
let arg_raw = this.parse_incantation_arg(incantation.arg_type);
|
|
221
250
|
let data = {};
|
|
222
251
|
incantation.apply(data, arg_raw);
|
|
@@ -226,23 +255,6 @@ export class DesmostParser extends GenericParser {
|
|
|
226
255
|
incantations: [],
|
|
227
256
|
};
|
|
228
257
|
}
|
|
229
|
-
/**
|
|
230
|
-
* Attempt to parse an incantation identifier.
|
|
231
|
-
*/
|
|
232
|
-
try_parse_identifier(incantations) {
|
|
233
|
-
for (let incantation of incantations) {
|
|
234
|
-
// yeah the duplication here is a little meh, unfortunately needing `return` means we can't extract it into a helper
|
|
235
|
-
let r = this.try_consume(incantation.identifier);
|
|
236
|
-
if (r !== NO_MATCH)
|
|
237
|
-
return incantation;
|
|
238
|
-
if (incantation.alias != undefined) {
|
|
239
|
-
let r = this.try_consume(incantation.alias);
|
|
240
|
-
if (r !== NO_MATCH)
|
|
241
|
-
return incantation;
|
|
242
|
-
}
|
|
243
|
-
}
|
|
244
|
-
return NO_MATCH;
|
|
245
|
-
}
|
|
246
258
|
/**
|
|
247
259
|
* Parse an argument to an incantation, enclosed in `{}`.
|
|
248
260
|
*
|
|
@@ -309,7 +321,9 @@ export class DesmostParser extends GenericParser {
|
|
|
309
321
|
*/
|
|
310
322
|
arg_type) {
|
|
311
323
|
let init = this.i;
|
|
312
|
-
this.consume("{",
|
|
324
|
+
this.consume("{", {
|
|
325
|
+
msg: `Expected \`{\` to start incantation argument, but found: \`${this.preview()}\``
|
|
326
|
+
});
|
|
313
327
|
/** The context stack to keep track of when the closing `}` is encountered. */
|
|
314
328
|
let stack = new ContextStack();
|
|
315
329
|
/** Indices at which to later insert `"` quotes. */
|
|
@@ -318,7 +332,7 @@ export class DesmostParser extends GenericParser {
|
|
|
318
332
|
// If the last character was an escape, we don't care at all what the next character is!
|
|
319
333
|
// This handles \\ double escape perfectly fine, since the first negates the second
|
|
320
334
|
if (stack.try_pop(Ctx.ESCAPE)) {
|
|
321
|
-
this.advance(
|
|
335
|
+
this.advance({ msg: `While parsing incantation argument`, debug: stack.debug() });
|
|
322
336
|
}
|
|
323
337
|
let top = stack.top;
|
|
324
338
|
switch (this.current) {
|
|
@@ -365,7 +379,7 @@ export class DesmostParser extends GenericParser {
|
|
|
365
379
|
break;
|
|
366
380
|
}
|
|
367
381
|
}
|
|
368
|
-
this.advance(
|
|
382
|
+
this.advance({ msg: `While parsing incantation argument`, debug: stack.debug() });
|
|
369
383
|
}
|
|
370
384
|
/* NOTE: Cut in by 1 on both sides to exclude {} braces */
|
|
371
385
|
let raw = utils.chars(this.source, init + 1, this.i - 1);
|
|
@@ -413,7 +427,7 @@ class ContextStack {
|
|
|
413
427
|
return false;
|
|
414
428
|
}
|
|
415
429
|
}
|
|
416
|
-
/**
|
|
430
|
+
/** If `ctx` is in the context stack, backtrack until it is popped, returning `true` if so. */
|
|
417
431
|
force_pop(ctx, options) {
|
|
418
432
|
if (this.#should_skip(options))
|
|
419
433
|
return false;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"desmost-parser.js","sourceRoot":"","sources":["../../src/parser/desmost-parser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAG5B,OAAO,EAAE,QAAQ,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAEzD,OAA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|
3
4
|
* A stateful lazy parser, providing core (non-Desmost-specific) methods for parsing.
|
|
4
5
|
*
|
|
5
|
-
* Many methods come in `<verb>` and `try_<verb>` pairs. On parsing failure, the former throws an `
|
|
6
|
+
* Many methods come in `<verb>` and `try_<verb>` pairs. On parsing failure, the former throws an `DesmostError`, but the latter instead backtracks and only returns a `NoMatch`. The former is for expected parses, while the latter is for speculative parsing.
|
|
6
7
|
*/
|
|
7
8
|
export declare class GenericParser {
|
|
8
9
|
#private;
|
|
9
|
-
/** The source code
|
|
10
|
-
protected source: string;
|
|
10
|
+
/** The source code to parse. */
|
|
11
|
+
protected readonly source: string;
|
|
11
12
|
/** The current position in the source code the parser is pointing to. */
|
|
12
13
|
protected i: number;
|
|
13
14
|
/** The number of characters in the source code. */
|
|
14
|
-
protected length: number;
|
|
15
|
+
protected readonly length: number;
|
|
16
|
+
/** Accumulated errors in the current block being parsed. */
|
|
17
|
+
errors: DesmostError[];
|
|
15
18
|
/** Create a parser for parsing `source`. */
|
|
16
19
|
constructor(source: string);
|
|
17
20
|
/**
|
|
@@ -22,8 +25,13 @@ export declare class GenericParser {
|
|
|
22
25
|
* Get the character the parser is currently pointing at, or `undefined` if the parser is out-of-bounds.
|
|
23
26
|
*/
|
|
24
27
|
protected get current(): string | undefined;
|
|
28
|
+
protected peek(): string | undefined;
|
|
25
29
|
/**
|
|
26
|
-
* Peek
|
|
30
|
+
* Peek the rest of the content in the current line.
|
|
31
|
+
*/
|
|
32
|
+
protected peek_line(): string;
|
|
33
|
+
/**
|
|
34
|
+
* Peek a snippet of the upcoming source text for display purposes.
|
|
27
35
|
*
|
|
28
36
|
* Optionally start from the given `idx`.
|
|
29
37
|
*/
|
|
@@ -31,9 +39,9 @@ export declare class GenericParser {
|
|
|
31
39
|
/**
|
|
32
40
|
* Advance to the next character, skipping ignored characters.
|
|
33
41
|
*
|
|
34
|
-
* Errors if the parser is
|
|
42
|
+
* Errors if the parser is already out-of-bounds *before* advancing.
|
|
35
43
|
*/
|
|
36
|
-
protected advance(
|
|
44
|
+
protected advance(error_data?: DesmostError.Data): Fallible<void>;
|
|
37
45
|
/**
|
|
38
46
|
* Attempt to advance to the next character, skipping ignored characters.
|
|
39
47
|
*
|
|
@@ -43,11 +51,12 @@ export declare class GenericParser {
|
|
|
43
51
|
/**
|
|
44
52
|
* Consume `raw`, erroring if `raw` was not found.
|
|
45
53
|
*/
|
|
46
|
-
protected consume(raw: string,
|
|
54
|
+
protected consume(raw: string, error_data?: DesmostError.Data): Fallible<void>;
|
|
47
55
|
/**
|
|
48
56
|
* Attempt to consume `raw`, backtracking if `raw` was not found.
|
|
49
57
|
*/
|
|
50
58
|
protected try_consume(raw: string): void | NoMatch;
|
|
59
|
+
protected try_consume_identifier(): string | NoMatch;
|
|
51
60
|
/**
|
|
52
61
|
* Consume 0 or more space characters.
|
|
53
62
|
*/
|
|
@@ -58,6 +67,6 @@ export declare class GenericParser {
|
|
|
58
67
|
* Same as `.consume_spaces()`, but allows tabs and newlines.
|
|
59
68
|
*/
|
|
60
69
|
protected consume_whitespace(): void;
|
|
61
|
-
protected consume_end_of_block(
|
|
70
|
+
protected consume_end_of_block(error_data?: DesmostError.Data): Fallible<void>;
|
|
62
71
|
}
|
|
63
72
|
//# sourceMappingURL=generic-parser.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generic-parser.d.ts","sourceRoot":"","sources":["../../src/parser/generic-parser.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"generic-parser.d.ts","sourceRoot":"","sources":["../../src/parser/generic-parser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,YAAY,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAQnD;;;;GAIG;AACH,qBAAa,aAAa;;IAEzB,gCAAgC;IAChC,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IAEjC,yEAAyE;IACzE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esmostError } from "../errors.js";
|
|
2
2
|
const IGNORED_CHARACTERS = new Set([
|
|
3
|
-
|
|
3
|
+
'\r',
|
|
4
4
|
]);
|
|
5
5
|
/**
|
|
6
6
|
* A stateful lazy parser, providing core (non-Desmost-specific) methods for parsing.
|
|
7
7
|
*
|
|
8
|
-
* Many methods come in `<verb>` and `try_<verb>` pairs. On parsing failure, the former throws an `
|
|
8
|
+
* Many methods come in `<verb>` and `try_<verb>` pairs. On parsing failure, the former throws an `DesmostError`, but the latter instead backtracks and only returns a `NoMatch`. The former is for expected parses, while the latter is for speculative parsing.
|
|
9
9
|
*/
|
|
10
10
|
export class GenericParser {
|
|
11
|
-
/** The source code
|
|
11
|
+
/** The source code to parse. */
|
|
12
12
|
source;
|
|
13
13
|
/** The current position in the source code the parser is pointing to. */
|
|
14
14
|
i = 0;
|
|
15
15
|
/** The number of characters in the source code. */
|
|
16
16
|
length;
|
|
17
|
+
/** Accumulated errors in the current block being parsed. */
|
|
18
|
+
errors;
|
|
17
19
|
/** Create a parser for parsing `source`. */
|
|
18
20
|
constructor(source) {
|
|
19
21
|
this.source = source;
|
|
20
22
|
this.length = source.length;
|
|
23
|
+
this.errors = [];
|
|
21
24
|
}
|
|
22
25
|
/**
|
|
23
26
|
* Is the parser currently pointing at an invalid character?
|
|
@@ -31,8 +34,17 @@ export class GenericParser {
|
|
|
31
34
|
get current() {
|
|
32
35
|
return this.source.at(this.i);
|
|
33
36
|
}
|
|
37
|
+
peek() {
|
|
38
|
+
return this.source.at(this.i + 1);
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Peek the rest of the content in the current line.
|
|
42
|
+
*/
|
|
43
|
+
peek_line() {
|
|
44
|
+
return this.source.slice(this.i, this.source.indexOf("\n", this.i));
|
|
45
|
+
}
|
|
34
46
|
/**
|
|
35
|
-
* Peek a snippet of the upcoming source text.
|
|
47
|
+
* Peek a snippet of the upcoming source text for display purposes.
|
|
36
48
|
*
|
|
37
49
|
* Optionally start from the given `idx`.
|
|
38
50
|
*/
|
|
@@ -44,11 +56,11 @@ export class GenericParser {
|
|
|
44
56
|
/**
|
|
45
57
|
* Advance to the next character, skipping ignored characters.
|
|
46
58
|
*
|
|
47
|
-
* Errors if the parser is
|
|
59
|
+
* Errors if the parser is already out-of-bounds *before* advancing.
|
|
48
60
|
*/
|
|
49
|
-
advance(
|
|
61
|
+
advance(error_data) {
|
|
50
62
|
if (this.out_of_bounds()) {
|
|
51
|
-
throw new
|
|
63
|
+
throw new DesmostError.UnexpectedEnd(error_data ?? {});
|
|
52
64
|
}
|
|
53
65
|
this.#advance();
|
|
54
66
|
}
|
|
@@ -58,8 +70,9 @@ export class GenericParser {
|
|
|
58
70
|
* Fails if the parser is the out-of-bounds *before* advancing.
|
|
59
71
|
*/
|
|
60
72
|
try_advance() {
|
|
61
|
-
if (this.out_of_bounds())
|
|
73
|
+
if (this.out_of_bounds()) {
|
|
62
74
|
return NO_MATCH;
|
|
75
|
+
}
|
|
63
76
|
this.#advance();
|
|
64
77
|
}
|
|
65
78
|
#advance() {
|
|
@@ -72,19 +85,32 @@ export class GenericParser {
|
|
|
72
85
|
/**
|
|
73
86
|
* Consume `raw`, erroring if `raw` was not found.
|
|
74
87
|
*/
|
|
75
|
-
consume(raw,
|
|
88
|
+
consume(raw, error_data) {
|
|
76
89
|
if (this.out_of_bounds()) {
|
|
77
|
-
throw new
|
|
90
|
+
throw new DesmostError.UnexpectedEnd({
|
|
91
|
+
msg: `While trying to consume: \`${raw}\``,
|
|
92
|
+
show: {
|
|
93
|
+
text: this.preview(this.i - 5),
|
|
94
|
+
}
|
|
95
|
+
});
|
|
78
96
|
}
|
|
79
97
|
let init = this.i;
|
|
80
98
|
let ii = 0;
|
|
81
99
|
while (this.current === raw[ii]) {
|
|
82
|
-
this.advance(
|
|
100
|
+
this.advance({
|
|
101
|
+
msg: `While trying to consume: \`${raw}\``,
|
|
102
|
+
show: {
|
|
103
|
+
text: `\`${this.preview(init)}\``,
|
|
104
|
+
},
|
|
105
|
+
});
|
|
83
106
|
ii++;
|
|
84
107
|
if (ii === raw.length)
|
|
85
108
|
return;
|
|
86
109
|
}
|
|
87
|
-
throw new
|
|
110
|
+
throw new DesmostError.UnexpectedInput({
|
|
111
|
+
msg: `Expected: \`${raw}\`, but found: \`${this.preview(init)}\``,
|
|
112
|
+
...error_data,
|
|
113
|
+
});
|
|
88
114
|
}
|
|
89
115
|
/**
|
|
90
116
|
* Attempt to consume `raw`, backtracking if `raw` was not found.
|
|
@@ -95,7 +121,7 @@ export class GenericParser {
|
|
|
95
121
|
while (this.current === raw[ii]) {
|
|
96
122
|
let r = this.try_advance();
|
|
97
123
|
if (r === NO_MATCH)
|
|
98
|
-
|
|
124
|
+
break;
|
|
99
125
|
ii++;
|
|
100
126
|
if (ii === raw.length)
|
|
101
127
|
return;
|
|
@@ -105,6 +131,17 @@ export class GenericParser {
|
|
|
105
131
|
this.i = init;
|
|
106
132
|
return NO_MATCH;
|
|
107
133
|
}
|
|
134
|
+
try_consume_identifier() {
|
|
135
|
+
let init = this.i;
|
|
136
|
+
while (/[a-zA-Z-]/.test(this.current ?? "")) {
|
|
137
|
+
let r = this.try_advance();
|
|
138
|
+
if (r === NO_MATCH) {
|
|
139
|
+
this.i = init;
|
|
140
|
+
return NO_MATCH;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
return this.source.slice(init, this.i);
|
|
144
|
+
}
|
|
108
145
|
/**
|
|
109
146
|
* Consume 0 or more space characters.
|
|
110
147
|
*/
|
|
@@ -131,11 +168,14 @@ export class GenericParser {
|
|
|
131
168
|
this.advance();
|
|
132
169
|
}
|
|
133
170
|
}
|
|
134
|
-
consume_end_of_block(
|
|
171
|
+
consume_end_of_block(error_data) {
|
|
135
172
|
if (this.i >= this.length)
|
|
136
173
|
return;
|
|
137
174
|
this.consume_spaces();
|
|
138
|
-
this.consume("\n",
|
|
175
|
+
this.consume("\n", {
|
|
176
|
+
msg: `Expected a newline at the end of a block, but found: \`${this.preview()}\``,
|
|
177
|
+
...error_data
|
|
178
|
+
});
|
|
139
179
|
}
|
|
140
180
|
}
|
|
141
181
|
//# sourceMappingURL=generic-parser.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generic-parser.js","sourceRoot":"","sources":["../../src/parser/generic-parser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,
|
|
1
|
+
{"version":3,"file":"generic-parser.js","sourceRoot":"","sources":["../../src/parser/generic-parser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAInD,MAAM,kBAAkB,GAAG,IAAI,GAAG,CAAC;IAClC,IAAI;CACJ,CAAC,CAAC;AAGH;;;;GAIG;AACH,MAAM,OAAO,aAAa;IAEzB,gCAAgC;IACb,MAAM,CAAQ;IAEjC,yEAAyE;IAC/D,CAAC,GAAW,CAAC,CAAA;IAEvB,mDAAmD;IAChC,MAAM,CAAQ;IAEjC,4DAA4D;IAC5D,MAAM,CAAgB;IAGtB,4CAA4C;IAC5C,YAAY,MAAc;QAEzB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;QAC5B,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC;IAClB,CAAC;IAGD;;OAEG;IACO,aAAa;QAEtB,OAAO,IAAI,CAAC,CAAC,IAAI,IAAI,CAAC,MAAM,CAAC;IAC9B,CAAC;IAED;;OAEG;IACH,IAAc,OAAO;QAEpB,OAAO,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAC/B,CAAC;IAES,IAAI;QAEb,OAAO,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IACnC,CAAC;IAED;;OAEG;IACO,SAAS;QAElB,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,C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C;CACD"}
|
package/dist/utils.d.ts
CHANGED
|
@@ -1,12 +1,19 @@
|
|
|
1
1
|
export declare const LINE: string;
|
|
2
|
+
/**
|
|
3
|
+
* Is `expr` a Desmos LaTeX expression (as opposed to a note or table)?
|
|
4
|
+
*/
|
|
5
|
+
export declare function is_latex(expr: Desmos.ExpressionState): expr is Desmos.Expression;
|
|
2
6
|
export declare function reversing<T>(items: ArrayLike<T>): Generator<T>;
|
|
3
7
|
export declare function paired<T>(items: Iterable<T>): Array<[left: T, right: T]>;
|
|
4
8
|
export declare function pairing<T>(items: Iterable<T>): Generator<[left: T, right: T]>;
|
|
5
9
|
export declare function chars(s: string, start?: number, stop?: number): string[];
|
|
6
10
|
export declare class Range {
|
|
7
|
-
|
|
8
|
-
|
|
11
|
+
/** The lower bound of the range (inclusive). */
|
|
12
|
+
readonly start: number;
|
|
13
|
+
/** The upper bound of the range (exclusive). */
|
|
14
|
+
readonly stop: number;
|
|
9
15
|
constructor(start: number, stop: number);
|
|
16
|
+
get length(): number;
|
|
10
17
|
map<T>(callback: (n: number) => T): Generator<T>;
|
|
11
18
|
}
|
|
12
19
|
//# sourceMappingURL=utils.d.ts.map
|