desmost 0.9.1 → 0.10.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.
Files changed (97) hide show
  1. package/README.md +12 -3
  2. package/dist/compiler/compile.d.ts +1 -7
  3. package/dist/compiler/compile.d.ts.map +1 -1
  4. package/dist/compiler/compile.js +3 -94
  5. package/dist/compiler/compile.js.map +1 -1
  6. package/dist/compiler/compiler.d.ts +56 -0
  7. package/dist/compiler/compiler.d.ts.map +1 -0
  8. package/dist/compiler/compiler.js +209 -0
  9. package/dist/compiler/compiler.js.map +1 -0
  10. package/dist/compiler/format.d.ts +2 -2
  11. package/dist/compiler/format.d.ts.map +1 -1
  12. package/dist/compiler/format.js +18 -9
  13. package/dist/compiler/format.js.map +1 -1
  14. package/dist/decompiler/decompile.d.ts +1 -1
  15. package/dist/decompiler/decompile.d.ts.map +1 -1
  16. package/dist/decompiler/extract.d.ts.map +1 -1
  17. package/dist/decompiler/extract.js +7 -3
  18. package/dist/decompiler/extract.js.map +1 -1
  19. package/dist/errors.d.ts +35 -27
  20. package/dist/errors.d.ts.map +1 -1
  21. package/dist/errors.js +46 -48
  22. package/dist/errors.js.map +1 -1
  23. package/dist/index.internal.d.ts +1 -1
  24. package/dist/index.internal.d.ts.map +1 -1
  25. package/dist/magic/global/desmos.d.ts +2 -2
  26. package/dist/magic/global/desmos.d.ts.map +1 -1
  27. package/dist/magic/global/desmos.js +3 -2
  28. package/dist/magic/global/desmos.js.map +1 -1
  29. package/dist/magic/global/viewport.d.ts +2 -2
  30. package/dist/magic/global/viewport.d.ts.map +1 -1
  31. package/dist/magic/global/viewport.js +5 -5
  32. package/dist/magic/global/viewport.js.map +1 -1
  33. package/dist/magic/incantation.d.ts +4 -4
  34. package/dist/magic/incantation.d.ts.map +1 -1
  35. package/dist/magic/incantation.js +15 -8
  36. package/dist/magic/incantation.js.map +1 -1
  37. package/dist/magic/local/colour.d.ts +3 -1
  38. package/dist/magic/local/colour.d.ts.map +1 -1
  39. package/dist/magic/local/colour.js +15 -11
  40. package/dist/magic/local/colour.js.map +1 -1
  41. package/dist/magic/local/label.d.ts.map +1 -1
  42. package/dist/magic/local/label.js +7 -7
  43. package/dist/magic/local/label.js.map +1 -1
  44. package/dist/magic/local/line.d.ts +2 -2
  45. package/dist/magic/local/line.d.ts.map +1 -1
  46. package/dist/magic/local/line.js +0 -1
  47. package/dist/magic/local/line.js.map +1 -1
  48. package/dist/options.d.ts +57 -23
  49. package/dist/options.d.ts.map +1 -1
  50. package/dist/options.js +2 -1
  51. package/dist/options.js.map +1 -1
  52. package/dist/parser/ast.d.ts +3 -17
  53. package/dist/parser/ast.d.ts.map +1 -1
  54. package/dist/parser/ast.js +0 -2
  55. package/dist/parser/ast.js.map +1 -1
  56. package/dist/parser/desmost-parser.d.ts +33 -22
  57. package/dist/parser/desmost-parser.d.ts.map +1 -1
  58. package/dist/parser/desmost-parser.js +114 -100
  59. package/dist/parser/desmost-parser.js.map +1 -1
  60. package/dist/parser/generic-parser.d.ts +23 -14
  61. package/dist/parser/generic-parser.d.ts.map +1 -1
  62. package/dist/parser/generic-parser.js +67 -27
  63. package/dist/parser/generic-parser.js.map +1 -1
  64. package/dist/utils.d.ts +9 -2
  65. package/dist/utils.d.ts.map +1 -1
  66. package/dist/utils.js +13 -2
  67. package/dist/utils.js.map +1 -1
  68. package/package.json +5 -2
  69. package/src/compiler/compile.ts +7 -120
  70. package/src/compiler/compiler.ts +275 -0
  71. package/src/compiler/format.ts +19 -7
  72. package/src/decompiler/decompile.ts +1 -1
  73. package/src/decompiler/extract.ts +3 -1
  74. package/src/errors.ts +40 -24
  75. package/src/index.internal.ts +1 -1
  76. package/src/magic/.template.ts +2 -2
  77. package/src/magic/global/desmos.ts +7 -9
  78. package/src/magic/global/viewport.ts +11 -17
  79. package/src/magic/incantation.ts +21 -22
  80. package/src/magic/local/colour.ts +23 -13
  81. package/src/magic/local/label.ts +11 -17
  82. package/src/magic/local/line.ts +2 -2
  83. package/src/options.ts +81 -47
  84. package/src/parser/ast.ts +1 -21
  85. package/src/parser/desmost-parser.ts +139 -143
  86. package/src/parser/generic-parser.ts +82 -40
  87. package/src/utils.ts +25 -3
  88. package/dist/compiler/evaluate.d.ts +0 -18
  89. package/dist/compiler/evaluate.d.ts.map +0 -1
  90. package/dist/compiler/evaluate.js +0 -93
  91. package/dist/compiler/evaluate.js.map +0 -1
  92. package/dist/desmos.d.ts +0 -16
  93. package/dist/desmos.d.ts.map +0 -1
  94. package/dist/desmos.js +0 -19
  95. package/dist/desmos.js.map +0 -1
  96. package/src/compiler/evaluate.ts +0 -128
  97. 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, UnrecoverableError } from "../errors.js";
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, producing an `Ast` object, or `null` if the parser has successfully reached the end of the 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() {
20
- this.consume_spaces();
35
+ this.errors = [];
36
+ this.eat_whitespace();
21
37
  if (this.out_of_bounds()) {
22
- return null;
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
- // comment
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
- return r.global;
41
- }
42
- // 1+ locals + 1 expr
43
- let incantations = r.local;
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
- var expr = this.parse_post_sep();
48
- for (let invocation of incantations) {
49
- expr.incantations.push(invocation);
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
- var expr = this.parse_post_sep();
73
+ blocks.push(this.parse_post_sep());
55
74
  }
56
- this.consume_end_of_block();
57
- return expr;
75
+ this.eat_end_of_block();
76
+ return { blocks, errors: this.errors };
58
77
  }
59
78
  /**
60
79
  * Parse Desmost syntax before the `::` separator, which may be:
@@ -64,28 +83,64 @@ export class DesmostParser extends GenericParser {
64
83
  */
65
84
  parse_pre_sep() {
66
85
  // 1 global incantation
67
- let r = this.try_parse_global_incantation();
68
- if (r !== NO_MATCH) {
69
- this.consume_end_of_block(`Received excess input after global incantation /${r.incantation.identifier}`);
70
- return { global: r };
86
+ try {
87
+ let r = this.try_parse_incantation(GLOBAL_INCANTATIONS);
88
+ if (r !== NO_MATCH) {
89
+ this.eat_whitespace();
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
- let invocation = this.try_parse_local_incantation();
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.eat_newlines();
79
111
  }
80
- return { local: incantations };
112
+ return { locals: incantations };
81
113
  }
82
114
  /**
83
115
  * Parse the Desmost `::` separator.
84
116
  */
85
117
  parse_sep() {
86
- this.consume_whitespace();
87
- this.consume("::", `Expected \`::\` separator between local incantations and expression, but found: \`${this.preview()}\``);
88
- this.consume_whitespace();
118
+ this.eat_newlines();
119
+ try {
120
+ this.eat("::", {
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.eat("::");
142
+ }
143
+ this.eat_newlines();
89
144
  }
90
145
  /**
91
146
  * Parse Desmost syntax after the `::` separator, which may be:
@@ -94,7 +149,7 @@ export class DesmostParser extends GenericParser {
94
149
  * - 1 expression incantation
95
150
  */
96
151
  parse_post_sep() {
97
- this.consume_spaces();
152
+ this.eat_whitespace();
98
153
  switch (this.current) {
99
154
  // empty block
100
155
  case "\n":
@@ -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 a global incantation invocation.
197
+ * Attempt to parse an incantation invocation allowed by `incantations`.
143
198
  */
144
- try_parse_global_incantation() {
199
+ try_parse_incantation(incantations) {
145
200
  let init = this.i;
146
- if (this.try_consume("/") === NO_MATCH)
201
+ if (this.try_eat("/") === NO_MATCH)
147
202
  return NO_MATCH;
148
- let incantation = this.try_parse_identifier(GLOBAL_INCANTATIONS);
149
- if (incantation === NO_MATCH) {
203
+ let ident = this.try_eat_identifier();
204
+ if (ident === NO_MATCH) {
150
205
  this.i = init;
151
206
  return NO_MATCH;
152
207
  }
153
- let data = undefined;
154
- if (incantation instanceof ArgIncantation) {
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
- return {
193
- kind: Ast.Kind.INVALID_INCANTATION,
194
- incantation,
195
- error: new UnrecoverableError.MissingInput(`No argument provided for /${incantation.identifier}, which requires an argument of type: \`${incantation.arg_type}\``)
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,
@@ -209,14 +233,19 @@ export class DesmostParser extends GenericParser {
209
233
  */
210
234
  try_parse_expr_incantation() {
211
235
  let init = this.i;
212
- if (this.try_consume("/") === NO_MATCH)
236
+ if (this.try_eat("/") === NO_MATCH)
213
237
  return NO_MATCH;
214
- let incantation = this.try_parse_identifier(EXPR_INCANTATIONS);
215
- if (incantation === NO_MATCH) {
216
- // TODO maybe flag to user
238
+ let ident = this.try_eat_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("{", `Expected \`{\` to start incantation argument, but found: \`${this.preview()}\``);
324
+ this.eat("{", {
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(`Unexpected end of input while parsing incantation argument, stack: ${stack.debug()}`);
335
+ this.advance({ msg: `While parsing incantation argument`, debug: stack.debug() });
322
336
  }
323
337
  let top = stack.top;
324
338
  switch (this.current) {
@@ -337,7 +351,7 @@ export class DesmostParser extends GenericParser {
337
351
  stack.push(Ctx.ENUM);
338
352
  indices_to_insert_quotes.push(this.i);
339
353
  }
340
- else if (top === Ctx.ENUM && this.current?.match(/[^a-zA-Z]/)) {
354
+ else if (top === Ctx.ENUM && this.current?.match(/[^a-zA-Z-_]/)) {
341
355
  stack.pop();
342
356
  indices_to_insert_quotes.push(this.i);
343
357
  if (indices_to_insert_quotes.length % 2 != 0) {
@@ -365,7 +379,7 @@ export class DesmostParser extends GenericParser {
365
379
  break;
366
380
  }
367
381
  }
368
- this.advance(`Unexpected end of input while parsing incantation argument, stack: ${JSON.stringify(stack)}`);
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
- /** Backtrack until `ctx` is popped. */
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,OAAO,KAAK,KAAK,MAAM,UAAU,CAAC;AAElC,OAAO,EACN,WAAW,EAAE,cAAc,EAC3B,mBAAmB,EAAE,kBAAkB,EAAE,iBAAiB,EAC1D,MAAM,UAAU,CAAC;AAIlB;;GAEG;AACH,MAAM,OAAO,aAAc,SAAQ,aAAa;IAET;IAAtC,YAAY,MAAc,EAAY,OAAwB;QAE7D,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;QAFgB,YAAO,GAAP,OAAO,CAAiB;IAG9D,CAAC;IAGD,qBAAqB;IAErB;;OAEG;IACI,UAAU;QAEhB,IAAI,CAAC,cAAc,EAAE,CAAC;QAEtB,IAAI,IAAI,CAAC,aAAa,EAAE,EAAE,CAAC;YAC1B,OAAO,IAAI,CAAC;QACb,CAAC;QAED,IAAI,IAAI,CAAC,OAAO,KAAK,GAAG,EAAE,CAAC;YAC1B,IAAI,IAAI,CAAC,OAAO,EAAE,eAAe,EAAE,CAAC;gBACnC,iBAAiB;gBACjB,IAAI,CAAC,UAAU,EAAE,CAAC;gBAClB,IAAI,CAAC,oBAAoB,EAAE,CAAC;gBAC5B,OAAO,IAAI,CAAC,UAAU,EAAE,CAAC;YAC1B,CAAC;iBACI,CAAC;gBACL,UAAU;gBACV,IAAI,IAAI,GAAG,IAAI,CAAC,aAAa,EAAE,CAAC;YACjC,CAAC;QACF,CAAC;aACI,IAAI,IAAI,CAAC,OA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IAAK,GAQJ;AARD,WAAK,GAAG;IACP,kBAAY,CAAA;IACZ,kBAAY,CAAA;IACZ,8BAAyB,CAAA;IACzB,kBAAqB,CAAA;IACrB,mBAAqB,CAAA;IACrB,kBAAsB,CAAA;IACtB,oBAAuB,CAAA;AACxB,CAAC,EARI,GAAG,KAAH,GAAG,QAQP"}
@@ -1,17 +1,20 @@
1
- import type { NoMatch, Unrecoverable } from "../errors.js";
1
+ import { DesmostError } from "../errors.js";
2
+ import type { NoMatch, Fallible } from "../errors.js";
2
3
  /**
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 `UnrecoverableError`, but the latter instead backtracks and only returns a `NoMatch`. The former is for expected parses, while the latter is for speculative parsing.
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 this parser is parsing. */
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 a snippet of the upcoming source text.
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 the out-of-bounds *before* advancing.
42
+ * Errors if the parser is already out-of-bounds *before* advancing.
35
43
  */
36
- protected advance(error_msg?: string): Unrecoverable<void>;
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,21 +51,22 @@ export declare class GenericParser {
43
51
  /**
44
52
  * Consume `raw`, erroring if `raw` was not found.
45
53
  */
46
- protected consume(raw: string, error_msg?: string): Unrecoverable<void>;
54
+ protected eat(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
- protected try_consume(raw: string): void | NoMatch;
58
+ protected try_eat(raw: string): void | NoMatch;
59
+ protected try_eat_identifier(): string | NoMatch;
51
60
  /**
52
- * Consume 0 or more space characters.
61
+ * Consume 0 or more space or tab characters.
53
62
  */
54
- protected consume_spaces(): void;
63
+ protected eat_whitespace(): void;
55
64
  /**
56
65
  * Consume 0 or more whitespace characters.
57
66
  *
58
67
  * Same as `.consume_spaces()`, but allows tabs and newlines.
59
68
  */
60
- protected consume_whitespace(): void;
61
- protected consume_end_of_block(error_msg?: string): Unrecoverable<void>;
69
+ protected eat_newlines(): void;
70
+ protected eat_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":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAQxD;;;;GAIG;AACH,qBAAa,aAAa;;IAEzB,8CAA8C;IAC9C,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC;IAEzB,yEAAyE;IACzE,SAAS,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