desmost 0.8.0 → 0.8.2

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 (92) hide show
  1. package/dist/compiler/compile.d.ts +25 -1
  2. package/dist/compiler/compile.d.ts.map +1 -1
  3. package/dist/compiler/compile.js +32 -2
  4. package/dist/compiler/compile.js.map +1 -1
  5. package/dist/compiler/evaluate.d.ts +11 -0
  6. package/dist/compiler/evaluate.d.ts.map +1 -1
  7. package/dist/compiler/evaluate.js +14 -0
  8. package/dist/compiler/evaluate.js.map +1 -1
  9. package/dist/compiler/format.d.ts +11 -0
  10. package/dist/compiler/format.d.ts.map +1 -1
  11. package/dist/compiler/format.js +14 -1
  12. package/dist/compiler/format.js.map +1 -1
  13. package/dist/compiler/index.d.ts.map +1 -1
  14. package/dist/compiler/index.js.map +1 -1
  15. package/dist/compiler/options.d.ts +79 -0
  16. package/dist/compiler/options.d.ts.map +1 -1
  17. package/dist/compiler/options.js +18 -11
  18. package/dist/compiler/options.js.map +1 -1
  19. package/dist/decompiler/decompile.d.ts +11 -0
  20. package/dist/decompiler/decompile.d.ts.map +1 -1
  21. package/dist/decompiler/decompile.js +11 -0
  22. package/dist/decompiler/decompile.js.map +1 -1
  23. package/dist/decompiler/emit.d.ts +6 -0
  24. package/dist/decompiler/emit.d.ts.map +1 -1
  25. package/dist/decompiler/emit.js +9 -0
  26. package/dist/decompiler/emit.js.map +1 -1
  27. package/dist/decompiler/extract.d.ts +9 -0
  28. package/dist/decompiler/extract.d.ts.map +1 -1
  29. package/dist/decompiler/extract.js +11 -1
  30. package/dist/decompiler/extract.js.map +1 -1
  31. package/dist/decompiler/format.js +6 -3
  32. package/dist/decompiler/format.js.map +1 -1
  33. package/dist/desmos.d.ts +3 -0
  34. package/dist/desmos.d.ts.map +1 -1
  35. package/dist/desmos.js +3 -0
  36. package/dist/desmos.js.map +1 -1
  37. package/dist/errors.d.ts +18 -4
  38. package/dist/errors.d.ts.map +1 -1
  39. package/dist/errors.js +13 -1
  40. package/dist/errors.js.map +1 -1
  41. package/dist/index.internal.d.ts +1 -1
  42. package/dist/index.internal.d.ts.map +1 -1
  43. package/dist/index.internal.js +1 -1
  44. package/dist/index.internal.js.map +1 -1
  45. package/dist/magic/expr/latex.js +1 -0
  46. package/dist/magic/expr/latex.js.map +1 -1
  47. package/dist/magic/expr/text.js +1 -0
  48. package/dist/magic/expr/text.js.map +1 -1
  49. package/dist/magic/global/desmos.d.ts +3 -1
  50. package/dist/magic/global/desmos.d.ts.map +1 -1
  51. package/dist/magic/global/desmos.js.map +1 -1
  52. package/dist/magic/incantation.d.ts +44 -0
  53. package/dist/magic/incantation.d.ts.map +1 -1
  54. package/dist/magic/incantation.js +38 -0
  55. package/dist/magic/incantation.js.map +1 -1
  56. package/dist/magic/index.d.ts +7 -0
  57. package/dist/magic/index.d.ts.map +1 -1
  58. package/dist/magic/index.js +7 -0
  59. package/dist/magic/index.js.map +1 -1
  60. package/dist/magic/local/anim.js +1 -0
  61. package/dist/magic/local/anim.js.map +1 -1
  62. package/dist/magic/local/label.js +1 -0
  63. package/dist/magic/local/label.js.map +1 -1
  64. package/dist/magic/local/slider.js +1 -0
  65. package/dist/magic/local/slider.js.map +1 -1
  66. package/dist/parser/ast.d.ts +9 -0
  67. package/dist/parser/ast.d.ts.map +1 -1
  68. package/dist/parser/ast.js +1 -0
  69. package/dist/parser/ast.js.map +1 -1
  70. package/dist/parser/desmost-parser.d.ts +101 -1
  71. package/dist/parser/desmost-parser.d.ts.map +1 -1
  72. package/dist/parser/desmost-parser.js +128 -1
  73. package/dist/parser/desmost-parser.js.map +1 -1
  74. package/dist/parser/generic-parser.d.ts +47 -0
  75. package/dist/parser/generic-parser.d.ts.map +1 -1
  76. package/dist/parser/generic-parser.js +50 -0
  77. package/dist/parser/generic-parser.js.map +1 -1
  78. package/dist/parser/index.d.ts.map +1 -1
  79. package/dist/parser/index.js.map +1 -1
  80. package/package.json +5 -2
  81. package/src/compiler/format.ts +6 -1
  82. package/src/compiler/index.ts +0 -7
  83. package/src/compiler/options.ts +18 -15
  84. package/src/compiler/readme.md +5 -0
  85. package/src/decompiler/readme.md +34 -0
  86. package/src/errors.ts +7 -7
  87. package/src/index.internal.ts +1 -1
  88. package/src/magic/global/desmos.ts +4 -1
  89. package/src/magic/readme.md +5 -0
  90. package/src/parser/ast.ts +3 -3
  91. package/src/parser/index.ts +0 -4
  92. package/src/parser/readme.md +21 -0
@@ -1,8 +1,11 @@
1
1
  export const stringify_json5 = (data, replacer, space) => {
2
- return (JSON.stringify(data, replacer, space)
3
- .slice(1, -1)
2
+ return (
3
+ /// @ts-expect-error: random `null`??
4
+ JSON.stringify(data, replacer, space)
5
+ .slice(1, -1) // strip surrounding {}
4
6
  .trim()
5
- .replaceAll(/"([^"]+)":/g, "$1:"));
7
+ .replaceAll(/"([^"]+)":/g, "$1:") // "key": <value> -> key: <value>
8
+ );
6
9
  };
7
10
  export function prettify_source(source) {
8
11
  source = source.replaceAll(/(?<=[^ ])=(?=[^ ])/g, " = ");
@@ -1 +1 @@
1
- {"version":3,"file":"format.js","sourceRoot":"","sources":["../../src/decompiler/format.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,eAAe,GAA4B,CACrD,IAAI,EAAE,QAAQ,EAAE,KAAK,EACtB,EAAE;IAED,OAAO,CAEJ,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,QAAQ,EAAE,KAAK,CAAC;SACpC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;SACZ,IAAI,EAAE;SACN,UAAU,CAAC,aAAa,EAAE,KAAK,CAAC,CACnC,CAAC;AACL,CAAC,CAAA;AAGD,MAAM,UAAU,eAAe,CAAC,MAAc;IAE3C,MAAM,GAAG,MAAM,CAAC,UAAU,CAAC,qBAAqB,EAAE,KAAK,CAAC,CAAC;IAEzD,OAAO,MAAM,CAAC;AACjB,CAAC"}
1
+ {"version":3,"file":"format.js","sourceRoot":"","sources":["../../src/decompiler/format.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,eAAe,GAA4B,CACrD,IAAI,EAAE,QAAQ,EAAE,KAAK,EACtB,EAAE;IAED,OAAO;IACJ,qCAAqC;IACrC,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,QAAQ,EAAE,KAAK,CAAC;SACpC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAE,uBAAuB;SACrC,IAAI,EAAE;SACN,UAAU,CAAC,aAAa,EAAE,KAAK,CAAC,CAAE,iCAAiC;KACtE,CAAC;AACL,CAAC,CAAA;AAGD,MAAM,UAAU,eAAe,CAAC,MAAc;IAE3C,MAAM,GAAG,MAAM,CAAC,UAAU,CAAC,qBAAqB,EAAE,KAAK,CAAC,CAAC;IAEzD,OAAO,MAAM,CAAC;AACjB,CAAC"}
package/dist/desmos.d.ts CHANGED
@@ -1,3 +1,6 @@
1
+ /**
2
+ * The Desmos API (currently) is browser-only, so we polyfill the API objects we need here for the server-side.
3
+ */
1
4
  export declare enum DesmosColour {
2
5
  RED = "#c74440",
3
6
  BLUE = "#2d70b3",
@@ -1 +1 @@
1
- {"version":3,"file":"desmos.d.ts","sourceRoot":"","sources":["../src/desmos.ts"],"names":[],"mappings":"AAIA,oBAAY,YAAY;IAEvB,GAAG,YAAe;IAClB,IAAI,YAAc;IAClB,KAAK,YAAa;IAClB,MAAM,YAAY;IAClB,MAAM,YAAY;IAClB,KAAK,YAAa;CAClB"}
1
+ {"version":3,"file":"desmos.d.ts","sourceRoot":"","sources":["../src/desmos.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,oBAAY,YAAY;IAEvB,GAAG,YAAe;IAClB,IAAI,YAAc;IAClB,KAAK,YAAa;IAClB,MAAM,YAAY;IAClB,MAAM,YAAY;IAClB,KAAK,YAAa;CAClB"}
package/dist/desmos.js CHANGED
@@ -1,3 +1,6 @@
1
+ /**
2
+ * The Desmos API (currently) is browser-only, so we polyfill the API objects we need here for the server-side.
3
+ */
1
4
  export var DesmosColour;
2
5
  (function (DesmosColour) {
3
6
  DesmosColour["RED"] = "#c74440";
@@ -1 +1 @@
1
- {"version":3,"file":"desmos.js","sourceRoot":"","sources":["../src/desmos.ts"],"names":[],"mappings":"AAIA,MAAM,CAAN,IAAY,YAQX;AARD,WAAY,YAAY;IAEvB,+BAAkB,CAAA;IAClB,gCAAkB,CAAA;IAClB,iCAAkB,CAAA;IAClB,kCAAkB,CAAA;IAClB,kCAAkB,CAAA;IAClB,iCAAkB,CAAA;AACnB,CAAC,EARW,YAAY,KAAZ,YAAY,QAQvB"}
1
+ {"version":3,"file":"desmos.js","sourceRoot":"","sources":["../src/desmos.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,CAAN,IAAY,YAQX;AARD,WAAY,YAAY;IAEvB,+BAAkB,CAAA;IAClB,gCAAkB,CAAA;IAClB,iCAAkB,CAAA;IAClB,kCAAkB,CAAA;IAClB,kCAAkB,CAAA;IAClB,iCAAkB,CAAA;AACnB,CAAC,EARW,YAAY,KAAZ,YAAY,QAQvB"}
package/dist/errors.d.ts CHANGED
@@ -1,23 +1,37 @@
1
+ /** The parser failed to parse something (usually during speculative parsing), which only results in internal backtracking. */
2
+ export declare const NO_MATCH: unique symbol;
3
+ /** The compiler encountered a non-fatal recoverable failure (usually during speculative parsing), which only results in internal backtracking. */
4
+ export type NoMatch = typeof NO_MATCH & {
5
+ readonly __brand?: unique symbol;
6
+ };
7
+ /**
8
+ * The compiler encountered a fatal unrecoverable error, which will reach the end user.
9
+ *
10
+ * It's not *literally* unrecoverable in the sense that it will crash the compiler completely, but it means there are no further fallbacks to try.
11
+ */
1
12
  export declare class UnrecoverableError extends Error {
2
13
  }
3
14
  export declare namespace UnrecoverableError {
15
+ /** The parser unexpectedly reached the end of its entire input source code. */
4
16
  class UnexpectedEnd extends UnrecoverableError {
5
17
  }
18
+ /** The parser did not receive input that it expected. */
6
19
  class MissingInput extends UnrecoverableError {
7
20
  }
21
+ /** The parser received input that did not match what it expected. */
8
22
  class UnexpectedInput extends UnrecoverableError {
9
23
  }
24
+ /** The parser received excess input that it did not expect. */
10
25
  class ExcessInput extends UnrecoverableError {
11
26
  }
27
+ /** An incantation can't be applied here. */
12
28
  class IllegalIncantation extends UnrecoverableError {
13
29
  }
30
+ /** An incantation's argument couldn't be parsed. */
14
31
  class InvalidArgument extends UnrecoverableError {
15
32
  }
16
33
  }
17
- export declare const NO_MATCH: unique symbol;
18
- export type NoMatch = typeof NO_MATCH & {
19
- readonly __brand?: unique symbol;
20
- };
34
+ /** Indicates that a function may throw an `UnrecoverableError`. */
21
35
  export type Unrecoverable<Result> = Result | Result & {
22
36
  readonly __brand?: unique symbol;
23
37
  };
@@ -1 +1 @@
1
- {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAKA,qBAAa,kBAAmB,SAAQ,KAAK;CAAG;AAEhD,yBAAiB,kBAAkB,CACnC;IAEC,MAAa,aAAc,SAAQ,kBAAkB;KAAG;IAGxD,MAAa,YAAa,SAAQ,kBAAkB;KAAG;IAGvD,MAAa,eAAgB,SAAQ,kBAAkB;KAAG;IAG1D,MAAa,WAAY,SAAQ,kBAAkB;KAAG;IAItD,MAAa,kBAAmB,SAAQ,kBAAkB;KAAG;IAG7D,MAAa,eAAgB,SAAQ,kBAAkB;KAAG;CAC1D;AAID,eAAO,MAAM,QAAQ,eAAqB,CAAC;AAG3C,MAAM,MAAM,OAAO,GAAG,OAAO,QAAQ,GAAG;IAAE,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,MAAM,CAAA;CAAE,CAAC;AAI7E,MAAM,MAAM,aAAa,CAAC,MAAM,IAAI,MAAM,GAAG,MAAM,GAAG;IAAE,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,MAAM,CAAA;CAAE,CAAC"}
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA,8HAA8H;AAC9H,eAAO,MAAM,QAAQ,eAAqB,CAAC;AAE3C,kJAAkJ;AAClJ,MAAM,MAAM,OAAO,GAAG,OAAO,QAAQ,GAAG;IAAE,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,MAAM,CAAA;CAAE,CAAC;AAG7E;;;;GAIG;AACH,qBAAa,kBAAmB,SAAQ,KAAK;CAAG;AAEhD,yBAAiB,kBAAkB,CACnC;IACC,+EAA+E;IAC/E,MAAa,aAAc,SAAQ,kBAAkB;KAAG;IAExD,yDAAyD;IACzD,MAAa,YAAa,SAAQ,kBAAkB;KAAG;IAEvD,qEAAqE;IACrE,MAAa,eAAgB,SAAQ,kBAAkB;KAAG;IAE1D,+DAA+D;IAC/D,MAAa,WAAY,SAAQ,kBAAkB;KAAG;IAGtD,4CAA4C;IAC5C,MAAa,kBAAmB,SAAQ,kBAAkB;KAAG;IAE7D,oDAAoD;IACpD,MAAa,eAAgB,SAAQ,kBAAkB;KAAG;CAC1D;AAGD,mEAAmE;AACnE,MAAM,MAAM,aAAa,CAAC,MAAM,IAAI,MAAM,GAAG,MAAM,GAAG;IAAE,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,MAAM,CAAA;CAAE,CAAC"}
package/dist/errors.js CHANGED
@@ -1,24 +1,36 @@
1
+ /** The parser failed to parse something (usually during speculative parsing), which only results in internal backtracking. */
2
+ export const NO_MATCH = Symbol("no-match");
3
+ /**
4
+ * The compiler encountered a fatal unrecoverable error, which will reach the end user.
5
+ *
6
+ * It's not *literally* unrecoverable in the sense that it will crash the compiler completely, but it means there are no further fallbacks to try.
7
+ */
1
8
  export class UnrecoverableError extends Error {
2
9
  }
3
10
  (function (UnrecoverableError) {
11
+ /** The parser unexpectedly reached the end of its entire input source code. */
4
12
  class UnexpectedEnd extends UnrecoverableError {
5
13
  }
6
14
  UnrecoverableError.UnexpectedEnd = UnexpectedEnd;
15
+ /** The parser did not receive input that it expected. */
7
16
  class MissingInput extends UnrecoverableError {
8
17
  }
9
18
  UnrecoverableError.MissingInput = MissingInput;
19
+ /** The parser received input that did not match what it expected. */
10
20
  class UnexpectedInput extends UnrecoverableError {
11
21
  }
12
22
  UnrecoverableError.UnexpectedInput = UnexpectedInput;
23
+ /** The parser received excess input that it did not expect. */
13
24
  class ExcessInput extends UnrecoverableError {
14
25
  }
15
26
  UnrecoverableError.ExcessInput = ExcessInput;
27
+ /** An incantation can't be applied here. */
16
28
  class IllegalIncantation extends UnrecoverableError {
17
29
  }
18
30
  UnrecoverableError.IllegalIncantation = IllegalIncantation;
31
+ /** An incantation's argument couldn't be parsed. */
19
32
  class InvalidArgument extends UnrecoverableError {
20
33
  }
21
34
  UnrecoverableError.InvalidArgument = InvalidArgument;
22
35
  })(UnrecoverableError || (UnrecoverableError = {}));
23
- export const NO_MATCH = Symbol("no-match");
24
36
  //# sourceMappingURL=errors.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAKA,MAAM,OAAO,kBAAmB,SAAQ,KAAK;CAAG;AAEhD,WAAiB,kBAAkB;IAGlC,MAAa,aAAc,SAAQ,kBAAkB;KAAG;IAA3C,gCAAa,gBAA8B,CAAA;IAGxD,MAAa,YAAa,SAAQ,kBAAkB;KAAG;IAA1C,+BAAY,eAA8B,CAAA;IAGvD,MAAa,eAAgB,SAAQ,kBAAkB;KAAG;IAA7C,kCAAe,kBAA8B,CAAA;IAG1D,MAAa,WAAY,SAAQ,kBAAkB;KAAG;IAAzC,8BAAW,cAA8B,CAAA;IAItD,MAAa,kBAAmB,SAAQ,kBAAkB;KAAG;IAAhD,qCAAkB,qBAA8B,CAAA;IAG7D,MAAa,eAAgB,SAAQ,kBAAkB;KAAG;IAA7C,kCAAe,kBAA8B,CAAA;AAC3D,CAAC,EApBgB,kBAAkB,KAAlB,kBAAkB,QAoBlC;AAID,MAAM,CAAC,MAAM,QAAQ,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC"}
1
+ {"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA,8HAA8H;AAC9H,MAAM,CAAC,MAAM,QAAQ,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC;AAM3C;;;;GAIG;AACH,MAAM,OAAO,kBAAmB,SAAQ,KAAK;CAAG;AAEhD,WAAiB,kBAAkB;IAElC,+EAA+E;IAC/E,MAAa,aAAc,SAAQ,kBAAkB;KAAG;IAA3C,gCAAa,gBAA8B,CAAA;IAExD,yDAAyD;IACzD,MAAa,YAAa,SAAQ,kBAAkB;KAAG;IAA1C,+BAAY,eAA8B,CAAA;IAEvD,qEAAqE;IACrE,MAAa,eAAgB,SAAQ,kBAAkB;KAAG;IAA7C,kCAAe,kBAA8B,CAAA;IAE1D,+DAA+D;IAC/D,MAAa,WAAY,SAAQ,kBAAkB;KAAG;IAAzC,8BAAW,cAA8B,CAAA;IAGtD,4CAA4C;IAC5C,MAAa,kBAAmB,SAAQ,kBAAkB;KAAG;IAAhD,qCAAkB,qBAA8B,CAAA;IAE7D,oDAAoD;IACpD,MAAa,eAAgB,SAAQ,kBAAkB;KAAG;IAA7C,kCAAe,kBAA8B,CAAA;AAC3D,CAAC,EApBgB,kBAAkB,KAAlB,kBAAkB,QAoBlC"}
@@ -1,4 +1,4 @@
1
- export { fill_defaults } from "./compiler/options.js";
1
+ export { fill_defaults, DEFAULT_OPTIONS } from "./compiler/options.js";
2
2
  export type { DesmostDebug } from "./compiler/compile.js";
3
3
  export { Ast } from "./parser/index.js";
4
4
  export { desmos_to_ast, ast_to_source } from "./decompiler/decompile.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.internal.d.ts","sourceRoot":"","sources":["../src/index.internal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,YAAY,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEvD,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAE/B,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC"}
1
+ {"version":3,"file":"index.internal.d.ts","sourceRoot":"","sources":["../src/index.internal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACpE,YAAY,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEvD,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAE/B,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC"}
@@ -1,4 +1,4 @@
1
- export { fill_defaults } from "./compiler/options.js";
1
+ export { fill_defaults, DEFAULT_OPTIONS } from "./compiler/options.js";
2
2
  export { Ast } from "./parser/index.js";
3
3
  export { desmos_to_ast, ast_to_source } from "./decompiler/decompile.js";
4
4
  //# sourceMappingURL=index.internal.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.internal.js","sourceRoot":"","sources":["../src/index.internal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAGnD,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAE/B,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC"}
1
+ {"version":3,"file":"index.internal.js","sourceRoot":"","sources":["../src/index.internal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAGpE,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAE/B,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC"}
@@ -6,6 +6,7 @@ export class LatexIncantation extends ArgIncantation {
6
6
  arg_type = Incantation.ArgType.LATEX;
7
7
  apply(target, data) {
8
8
  target.type = "expression";
9
+ // @ts-expect-error: outdated types
9
10
  target.latex = data === "" ? " " : data;
10
11
  }
11
12
  evaluate_arg(data) {
@@ -1 +1 @@
1
- {"version":3,"file":"latex.js","sourceRoot":"","sources":["../../../src/magic/expr/latex.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,cAAc,EAAa,MAAM,gBAAgB,CAAC;AAGxE,MAAM,OAAO,gBAAiB,SAAQ,cAAoB;IAEvC,WAAW,GAC1B,2EAA2E,CAAA;IAE5D,UAAU,GAAK,OAAO,CAAA;IACtB,YAAY,GAAG,IAAI,CAAA;IACnB,QAAQ,GAAO,WAAW,CAAC,OAAO,CAAC,KAAK,CAAA;IAE1D,KAAK,CAAC,MAA8B,EAAE,IAAY;QAEjD,MAAM,CAAC,IAAI,GAAG,YAAY,CAAC;QAE3B,MAAM,CAAC,KAAK,GAAG,IAAI,KAAK,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC;IACzC,CAAC;IAEQ,YAAY,CAAC,IAAY;QAEjC,OAAO,IAAI,CAAC;IACb,CAAC;CACD"}
1
+ {"version":3,"file":"latex.js","sourceRoot":"","sources":["../../../src/magic/expr/latex.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,cAAc,EAAa,MAAM,gBAAgB,CAAC;AAGxE,MAAM,OAAO,gBAAiB,SAAQ,cAAoB;IAEvC,WAAW,GAC1B,2EAA2E,CAAA;IAE5D,UAAU,GAAK,OAAO,CAAA;IACtB,YAAY,GAAG,IAAI,CAAA;IACnB,QAAQ,GAAO,WAAW,CAAC,OAAO,CAAC,KAAK,CAAA;IAE1D,KAAK,CAAC,MAA8B,EAAE,IAAY;QAEjD,MAAM,CAAC,IAAI,GAAG,YAAY,CAAC;QAC3B,mCAAmC;QACnC,MAAM,CAAC,KAAK,GAAG,IAAI,KAAK,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC;IACzC,CAAC;IAEQ,YAAY,CAAC,IAAY;QAEjC,OAAO,IAAI,CAAC;IACb,CAAC;CACD"}
@@ -7,6 +7,7 @@ export class TextIncantation extends ArgIncantation {
7
7
  arg_type = Incantation.ArgType.STRING;
8
8
  apply(target, data) {
9
9
  target.type = "text";
10
+ // @ts-expect-error: outdated types
10
11
  target.text = data;
11
12
  }
12
13
  }
@@ -1 +1 @@
1
- {"version":3,"file":"text.js","sourceRoot":"","sources":["../../../src/magic/expr/text.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,cAAc,EAAa,MAAM,gBAAgB,CAAC;AAGxE,MAAM,OAAO,eAAgB,SAAQ,cAAoB;IAEtC,WAAW,GAC1B,2DAA2D,CAAA;IAE5C,UAAU,GAAK,MAAM,CAAA;IACrB,KAAK,GAAU,MAAM,CAAA;IACrB,YAAY,GAAG,IAAI,CAAA;IACnB,QAAQ,GAAO,WAAW,CAAC,OAAO,CAAC,MAAM,CAAA;IAElD,KAAK,CAAC,MAA8B,EAAE,IAAY;QAE1D,MAAM,CAAC,IAAI,GAAG,MAAM,CAAC;QAErB,MAAM,CAAC,IAAI,GAAG,IAAI,CAAC;IACpB,CAAC;CACD"}
1
+ {"version":3,"file":"text.js","sourceRoot":"","sources":["../../../src/magic/expr/text.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,cAAc,EAAa,MAAM,gBAAgB,CAAC;AAGxE,MAAM,OAAO,eAAgB,SAAQ,cAAoB;IAEtC,WAAW,GAC1B,2DAA2D,CAAA;IAE5C,UAAU,GAAK,MAAM,CAAA;IACrB,KAAK,GAAU,MAAM,CAAA;IACrB,YAAY,GAAG,IAAI,CAAA;IACnB,QAAQ,GAAO,WAAW,CAAC,OAAO,CAAC,MAAM,CAAA;IAElD,KAAK,CAAC,MAA8B,EAAE,IAAY;QAE1D,MAAM,CAAC,IAAI,GAAG,MAAM,CAAC;QACrB,mCAAmC;QACnC,MAAM,CAAC,IAAI,GAAG,IAAI,CAAC;IACpB,CAAC;CACD"}
@@ -1,9 +1,11 @@
1
1
  import { Incantation, ArgIncantation, type GLOBAL } from "../incantation.js";
2
+ type DesmosSettings = Desmos.GraphConfiguration & Desmos.GraphSettings;
2
3
  export declare class DesmosIncantation extends ArgIncantation<GLOBAL> {
3
4
  readonly description = "Set the configuration of the calculator via `Calculator.updateSettings()`.";
4
5
  readonly identifier = "desmos";
5
6
  readonly requires_arg = false;
6
7
  readonly arg_type = Incantation.ArgType.OBJECT;
7
- apply(target: Desmos.Calculator, data?: Desmos.GraphConfiguration & Desmos.GraphSettings): void;
8
+ apply(target: Desmos.Calculator, data?: DesmosSettings): void;
8
9
  }
10
+ export {};
9
11
  //# sourceMappingURL=desmos.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"desmos.d.ts","sourceRoot":"","sources":["../../../src/magic/global/desmos.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,KAAK,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAG1E,qBAAa,iBAAkB,SAAQ,cAAc,CAAC,MAAM,CAAC;IAE5D,SAAkB,WAAW,gFACkD;IAE/E,SAAkB,UAAU,YAAa;IACzC,SAAkB,YAAY,SAAQ;IACtC,SAAkB,QAAQ,8BAAiC;IAElD,KAAK,CACb,MAAM,EAAE,MAAM,CAAC,UAAU,EACzB,IAAI,CAAC,EAAE,MAAM,CAAC,kBAAkB,GAAG,MAAM,CAAC,aAAa,GACrD,IAAI;CAMP"}
1
+ {"version":3,"file":"desmos.d.ts","sourceRoot":"","sources":["../../../src/magic/global/desmos.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,KAAK,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAG1E,KAAK,cAAc,GAAG,MAAM,CAAC,kBAAkB,GAAG,MAAM,CAAC,aAAa,CAAA;AAGtE,qBAAa,iBAAkB,SAAQ,cAAc,CAAC,MAAM,CAAC;IAE5D,SAAkB,WAAW,gFACkD;IAE/E,SAAkB,UAAU,YAAa;IACzC,SAAkB,YAAY,SAAQ;IACtC,SAAkB,QAAQ,8BAAiC;IAElD,KAAK,CACb,MAAM,EAAE,MAAM,CAAC,UAAU,EACzB,IAAI,CAAC,EAAE,cAAc,GACnB,IAAI;CAMP"}
@@ -1 +1 @@
1
- {"version":3,"file":"desmos.js","sourceRoot":"","sources":["../../../src/magic/global/desmos.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,cAAc,EAAe,MAAM,gBAAgB,CAAC;AAG1E,MAAM,OAAO,iBAAkB,SAAQ,cAAsB;IAE1C,WAAW,GAC1B,4EAA4E,CAAA;IAE7D,UAAU,GAAK,QAAQ,CAAA;IACvB,YAAY,GAAG,KAAK,CAAA;IACpB,QAAQ,GAAO,WAAW,CAAC,OAAO,CAAC,MAAM,CAAA;IAElD,KAAK,CACb,MAAyB,EACzB,IAAuD;QAGvD,IAAI,IAAI,IAAI,SAAS,EAAE,CAAC;YACvB,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;QAC7B,CAAC;IACF,CAAC;CACD"}
1
+ {"version":3,"file":"desmos.js","sourceRoot":"","sources":["../../../src/magic/global/desmos.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,cAAc,EAAe,MAAM,gBAAgB,CAAC;AAM1E,MAAM,OAAO,iBAAkB,SAAQ,cAAsB;IAE1C,WAAW,GAC1B,4EAA4E,CAAA;IAE7D,UAAU,GAAK,QAAQ,CAAA;IACvB,YAAY,GAAG,KAAK,CAAA;IACpB,QAAQ,GAAO,WAAW,CAAC,OAAO,CAAC,MAAM,CAAA;IAElD,KAAK,CACb,MAAyB,EACzB,IAAqB;QAGrB,IAAI,IAAI,IAAI,SAAS,EAAE,CAAC;YACvB,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;QAC7B,CAAC;IACF,CAAC;CACD"}
@@ -1,30 +1,74 @@
1
1
  import { type Unrecoverable } from "../errors.js";
2
+ /**
3
+ * An *Incantation* is like a slash command that tells Desmost to do something - like changing the properties of an expression, or applying some settings to the calculator as a whole.
4
+ *
5
+ * Incantations must be prefixed by a `/`. They look like this:
6
+ *
7
+ * ```math
8
+ * /viewport{ left: -1, right: 1 }
9
+ * /hidden :: x = 69
10
+ * /text :: Never gonna give you up
11
+ * ```
12
+ *
13
+ * Incantations that accept an argument derive from `ArgIncantation`.
14
+ */
2
15
  export declare abstract class Incantation<Effect extends Incantation.Effect = Incantation.Effect> {
16
+ /** Short user-facing description of what the incantation does. */
3
17
  abstract readonly description: string;
18
+ /** The raw text sequence that matches this incantation, such as `viewport` or `hidden`. */
4
19
  abstract readonly identifier: string;
20
+ /** An alternative `.identifier`, strictly for localisation purposes only. */
5
21
  readonly alias?: string;
22
+ /** Apply this incantation's effect to `target`, using the provided `data` if required. */
6
23
  abstract apply(target: Effect extends GLOBAL ? Desmos.Calculator : Desmos.ExpressionState, data?: unknown): void;
24
+ /** Error if the `actual` type of the given expression is not `required`. */
7
25
  protected require_expr_type<T extends Desmos.ExpressionState["type"]>(actual: unknown, required: T): asserts actual is T;
8
26
  }
27
+ /**
28
+ * An incantation that accepts an argument.
29
+ */
9
30
  export declare abstract class ArgIncantation<Effect extends Incantation.Effect = Incantation.Effect> extends Incantation<Effect> {
31
+ /** Does this incantation always require an argument to be passed? */
10
32
  readonly requires_arg: boolean;
33
+ /** What type of argument does this incantation accept? */
11
34
  abstract readonly arg_type: Incantation.ArgType;
35
+ /**
36
+ * Evaluate the argument provided to this incantation, throwing if an error is encountered.
37
+ *
38
+ * For instance, for `/viewport{ left: -1, right: 1 }`, this returns the POJO `{ left: -1, right: 1 }`.
39
+ *
40
+ * ## Notes
41
+ *
42
+ * Child incantation classes should override this method, though the defaults should cover most cases (except `ArgType.ENUM`).
43
+ */
12
44
  evaluate_arg(raw: string): Unrecoverable<unknown>;
13
45
  }
14
46
  export declare namespace Incantation {
47
+ /** The kind of effect an incantation produces - it either modifies only one block, or modifies the calculator as a whole. */
15
48
  enum Effect {
49
+ /** An incantation that affects the entire Desmos calculator state, like `/desmos` or `/viewport`. */
16
50
  GLOBAL = 0,
51
+ /** An incantation that affects only the expression immediately following it, like `/hide` or `/slider`. */
17
52
  LOCAL = 1,
53
+ /** An incantation that produces an expression, like `/latex` or `/text`. */
18
54
  EXPR = 2
19
55
  }
56
+ /** The type of argument an incantation accepts, which affects how it is parsed. */
20
57
  enum ArgType {
58
+ /** Any arbitrary user text content, where characters like `"` and `'` don't have semantic meaning and can be ignored. */
21
59
  STRING = "String",
60
+ /** LaTeX, which should have balanced `{}` braces. */
22
61
  LATEX = "LaTeX",
62
+ /** Specific value from an allowed set of values, which will map to an enum value in the Desmos API. */
23
63
  ENUM = "Enum",
64
+ /** JavaScript object fields, where characters like `{}` and `"` all have semantic meaning, and must be balanced. */
24
65
  OBJECT = "Object"
25
66
  }
26
67
  }
68
+ /** An incantation that affects the entire Desmos calculator state, like `/desmos` or `/viewport`. */
27
69
  export type GLOBAL = Incantation.Effect.GLOBAL;
70
+ /** An incantation that affects only the expression immediately following it, like `/hide` or `/slider`. */
28
71
  export type LOCAL = Incantation.Effect.LOCAL;
72
+ /** An incantation that produces an expression, like `/latex` or `/text`. */
29
73
  export type EXPR = Incantation.Effect.EXPR;
30
74
  //# sourceMappingURL=incantation.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"incantation.d.ts","sourceRoot":"","sources":["../../src/magic/incantation.ts"],"names":[],"mappings":"AAEA,OAAO,EAAsB,KAAK,aAAa,EAAE,MAAM,WAAW,CAAC;AAgBnE,8BAAsB,WAAW,CAChC,MAAM,SAAS,WAAW,CAAC,MAAM,GAAG,WAAW,CAAC,MAAM;IAItD,kBAAyB,WAAW,EAAE,MAAM,CAAA;IAG5C,kBAAyB,UAAU,EAAE,MAAM,CAAA;IAG3C,SAAgB,KAAK,CAAC,EAAE,MAAM,CAAA;aAId,KAAK,CACpB,MAAM,EAAE,MAAM,SAAS,MAAM,GAAG,MAAM,CAAC,UAAU,GAAG,MAAM,CAAC,eAAe,EAC1E,IAAI,CAAC,EAAE,OAAO,GACZ,IAAI;IAGP,SAAS,CAAC,iBAA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C5E,MAAM,MAAM,IAAI,GAAG,WAAW,CAAC,MAAM,CAAC,IAAI,CAAC"}
@@ -1,15 +1,43 @@
1
1
  import Json5 from "json5";
2
2
  import { UnrecoverableError } from "../errors.js";
3
+ /**
4
+ * An *Incantation* is like a slash command that tells Desmost to do something - like changing the properties of an expression, or applying some settings to the calculator as a whole.
5
+ *
6
+ * Incantations must be prefixed by a `/`. They look like this:
7
+ *
8
+ * ```math
9
+ * /viewport{ left: -1, right: 1 }
10
+ * /hidden :: x = 69
11
+ * /text :: Never gonna give you up
12
+ * ```
13
+ *
14
+ * Incantations that accept an argument derive from `ArgIncantation`.
15
+ */
3
16
  export class Incantation {
17
+ /** An alternative `.identifier`, strictly for localisation purposes only. */
4
18
  alias;
19
+ /** Error if the `actual` type of the given expression is not `required`. */
5
20
  require_expr_type(actual, required) {
6
21
  if ((actual ?? "expression") !== required) {
7
22
  throw new UnrecoverableError.IllegalIncantation(`/${this.identifier} can only applied to ${required === "expression" ? "latex" : required} expressions, but target block has type: ${actual}`);
8
23
  }
9
24
  }
10
25
  }
26
+ /**
27
+ * An incantation that accepts an argument.
28
+ */
11
29
  export class ArgIncantation extends Incantation {
30
+ /** Does this incantation always require an argument to be passed? */
12
31
  requires_arg = true;
32
+ /**
33
+ * Evaluate the argument provided to this incantation, throwing if an error is encountered.
34
+ *
35
+ * For instance, for `/viewport{ left: -1, right: 1 }`, this returns the POJO `{ left: -1, right: 1 }`.
36
+ *
37
+ * ## Notes
38
+ *
39
+ * Child incantation classes should override this method, though the defaults should cover most cases (except `ArgType.ENUM`).
40
+ */
13
41
  evaluate_arg(raw) {
14
42
  switch (this.arg_type) {
15
43
  case Incantation.ArgType.STRING: return raw;
@@ -20,6 +48,7 @@ export class ArgIncantation extends Incantation {
20
48
  return Json5.parse(`{${raw}}`);
21
49
  }
22
50
  catch (e) {
51
+ // @ts-expect-error: fine
23
52
  throw new UnrecoverableError.InvalidArgument(e.message);
24
53
  }
25
54
  }
@@ -27,17 +56,26 @@ export class ArgIncantation extends Incantation {
27
56
  }
28
57
  }
29
58
  (function (Incantation) {
59
+ /** The kind of effect an incantation produces - it either modifies only one block, or modifies the calculator as a whole. */
30
60
  let Effect;
31
61
  (function (Effect) {
62
+ /** An incantation that affects the entire Desmos calculator state, like `/desmos` or `/viewport`. */
32
63
  Effect[Effect["GLOBAL"] = 0] = "GLOBAL";
64
+ /** An incantation that affects only the expression immediately following it, like `/hide` or `/slider`. */
33
65
  Effect[Effect["LOCAL"] = 1] = "LOCAL";
66
+ /** An incantation that produces an expression, like `/latex` or `/text`. */
34
67
  Effect[Effect["EXPR"] = 2] = "EXPR";
35
68
  })(Effect = Incantation.Effect || (Incantation.Effect = {}));
69
+ /** The type of argument an incantation accepts, which affects how it is parsed. */
36
70
  let ArgType;
37
71
  (function (ArgType) {
72
+ /** Any arbitrary user text content, where characters like `"` and `'` don't have semantic meaning and can be ignored. */
38
73
  ArgType["STRING"] = "String";
74
+ /** LaTeX, which should have balanced `{}` braces. */
39
75
  ArgType["LATEX"] = "LaTeX";
76
+ /** Specific value from an allowed set of values, which will map to an enum value in the Desmos API. */
40
77
  ArgType["ENUM"] = "Enum";
78
+ /** JavaScript object fields, where characters like `{}` and `"` all have semantic meaning, and must be balanced. */
41
79
  ArgType["OBJECT"] = "Object";
42
80
  })(ArgType = Incantation.ArgType || (Incantation.ArgType = {}));
43
81
  })(Incantation || (Incantation = {}));
@@ -1 +1 @@
1
- {"version":3,"file":"incantation.js","sourceRoot":"","sources":["../../src/magic/incantation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,kBAAkB,EAAsB,MAAM,WAAW,CAAC;AAgBnE,MAAM,OAAgB,WAAW;IAWhB,KAAK,CAAS;IAUpB,iBAAiB,CAC1B,MAAe,EACf,QAAW;QAGX,IAAI,CAAC,MAAM,IAAI,YAAY,CAAC,KAAK,QAAQ,EACzC,CAAC;YACA,MAAM,IAAI,kBAAkB,CAAC,kBAA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C,eAAe,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;gBACzD,CAAC;YACF,CAAC;QACF,CAAC;IACF,CAAC;CACD;AAGD,WAAiB,WAAW;IAE3B,6HAA6H;IAC7H,IAAY,MAUX;IAVD,WAAY,MAAM;QAEjB,qGAAqG;QACrG,uCAAM,CAAA;QAEN,2GAA2G;QAC3G,qCAAK,CAAA;QAEL,4EAA4E;QAC5E,mCAAI,CAAA;IACL,CAAC,EAVW,MAAM,GAAN,kBAAM,KAAN,kBAAM,QAUjB;IAED,mFAAmF;IACnF,IAAY,OAaX;IAbD,WAAY,OAAO;QAElB,yHAAyH;QACzH,4BAAiB,CAAA;QAEjB,qDAAqD;QACrD,0BAAe,CAAA;QAEf,uGAAuG;QACvG,wBAAa,CAAA;QAEb,oHAAoH;QACpH,4BAAiB,CAAA;IAClB,CAAC,EAbW,OAAO,GAAP,mBAAO,KAAP,mBAAO,QAalB;AACF,CAAC,EA9BgB,WAAW,KAAX,WAAW,QA8B3B"}
@@ -1,3 +1,10 @@
1
+ /**
2
+ * Implements incantations logic.
3
+ *
4
+ * Incantations are represented with `Incantation` and `ArgIncantation` objects. Individual incantations derive from one of these classes, defining their own evaluation and application logic.
5
+ *
6
+ * Defined incantations are listed under `*_INCANTATIONS` lists.
7
+ */
1
8
  export { Incantation, ArgIncantation } from "./incantation.js";
2
9
  export type { GLOBAL, LOCAL, EXPR } from "./incantation.js";
3
10
  export { GLOBAL_INCANTATIONS } from "./global/index.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/magic/index.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC5D,YAAY,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAEzD,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAC/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAC7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,QAAQ,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/magic/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC5D,YAAY,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAEzD,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAC/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAC7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,QAAQ,CAAC"}
@@ -1,3 +1,10 @@
1
+ /**
2
+ * Implements incantations logic.
3
+ *
4
+ * Incantations are represented with `Incantation` and `ArgIncantation` objects. Individual incantations derive from one of these classes, defining their own evaluation and application logic.
5
+ *
6
+ * Defined incantations are listed under `*_INCANTATIONS` lists.
7
+ */
1
8
  export { Incantation, ArgIncantation } from "./incantation.js";
2
9
  export { GLOBAL_INCANTATIONS } from "./global/index.js";
3
10
  export { LOCAL_INCANTATIONS } from "./local/index.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/magic/index.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAG5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAC/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAC7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,QAAQ,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/magic/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAG5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAC/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAC7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,QAAQ,CAAC"}
@@ -4,6 +4,7 @@ export class AnimIncantation extends Incantation {
4
4
  identifier = "anim";
5
5
  apply(target) {
6
6
  super.require_expr_type(target.type, "expression");
7
+ // @ts-expect-error: outdated types
7
8
  target.playing = true;
8
9
  }
9
10
  }
@@ -1 +1 @@
1
- {"version":3,"file":"anim.js","sourceRoot":"","sources":["../../../src/magic/local/anim.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAc,MAAM,gBAAgB,CAAC;AAGzD,MAAM,OAAO,eAAgB,SAAQ,WAAkB;IAEpC,WAAW,GAC1B,gCAAgC,CAAA;IAEjB,UAAU,GAAG,MAAM,CAAA;IAE5B,KAAK,CAAC,MAA8B;QAE5C,KAAK,CAAC,iBAAiB,CAAC,MAAM,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC;QAEnD,MAAM,CAAC,OAAO,GAAG,IAAI,CAAC;IACvB,CAAC;CACD"}
1
+ {"version":3,"file":"anim.js","sourceRoot":"","sources":["../../../src/magic/local/anim.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAc,MAAM,gBAAgB,CAAC;AAGzD,MAAM,OAAO,eAAgB,SAAQ,WAAkB;IAEpC,WAAW,GAC1B,gCAAgC,CAAA;IAEjB,UAAU,GAAG,MAAM,CAAA;IAE5B,KAAK,CAAC,MAA8B;QAE5C,KAAK,CAAC,iBAAiB,CAAC,MAAM,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC;QACnD,mCAAmC;QACnC,MAAM,CAAC,OAAO,GAAG,IAAI,CAAC;IACvB,CAAC;CACD"}
@@ -9,6 +9,7 @@ export class LabelIncantation extends ArgIncantation {
9
9
  super.require_expr_type(target.type, "expression");
10
10
  target.label = data.text;
11
11
  target.showLabel = data.show ?? true;
12
+ // @ts-expect-error: outdated types TODO check
12
13
  if (data.size != undefined)
13
14
  target.labelSize = data.size;
14
15
  if (data.pos != undefined)
@@ -1 +1 @@
1
- {"version":3,"file":"label.js","sourceRoot":"","sources":["../../../src/magic/local/label.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,cAAc,EAAc,MAAM,gBAAgB,CAAC;AAYzE,MAAM,OAAO,gBAAiB,SAAQ,cAAqB;IAExC,WAAW,GAC1B,6CAA6C,CAAA;IAE9B,UAAU,GAAK,OAAO,CAAA;IACtB,YAAY,GAAG,IAAI,CAAA;IACnB,QAAQ,GAAO,WAAW,CAAC,OAAO,CAAC,MAAM,CAAA;IAElD,KAAK,CAAC,MAA8B,EAAE,IAAkB;QAEhE,KAAK,CAAC,iBAAiB,CAAC,MAAM,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC;QACnD,MAAM,CAAC,KAAK,GAAG,IAAI,CAAC,IAAI,CAAC;QACzB,MAAM,CAAC,SAAS,GAAG,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC;QAErC,IAAI,IAAI,CAAC,IAAI,IAAI,SAAS;YAAE,MAAM,CAAC,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC;QACzD,IAAI,IAAI,CAAC,GAAG,IAAK,SAAS;YAAE,MAAM,CAAC,gBAAgB,GAAG,IAAI,CAAC,GAAG,CAAC;IAChE,CAAC;IAEQ,YAAY,CAAC,GAAW;QAEhC,IAAI,GAAG,GAAG,KAAK,CAAC,YAAY,CAAC,GAAG,CAAiB,CAAC;QAElD,IAAI,CAAC,CAAC,MAAM,IAAI,GAAG,CAAC,EAAE,CAAC;YACtB,MAAM,IAAI,kBAAkB,CAAC,eAAe,CAC3C,gFAAgF,CAChF,CAAC;QACH,CAAC;QAED,IAAI,OAAO,GAAG,CAAC,GAAG,IAAI,WAAW,EAAE,CAAC;YACnC,IAAI,GAAG,GAAG,GAAG,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,WAA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CAAC,YAAY,CAAC,GAAG,CAAiB,CAAC;QAElD,IAAI,CAAC,CAAC,MAAM,IAAI,GAAG,CAAC,EAAE,CAAC;YACtB,MAAM,IAAI,kBAAkB,CAAC,eAAe,CAC3C,gFAAgF,CAChF,CAAC;QACH,CAAC;QAED,IAAI,OAAO,GAAG,CAAC,GAAG,IAAI,WAAW,EAAE,CAAC;YACnC,IAAI,GAAG,GAAG,GAAG,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;YAEvC,QAAQ,GAAG,EAAE,CAAC;gBACb,KAAK,OAAO,CAAC;gBACb,KAAK,OAAO,CAAC;gBACb,KAAK,MAAM,CAAC;gBACZ,KAAK,OAAO;oBACX,GAAG,CAAC,GAAG,GAAG,GAAG,CAAC;oBACd,MAAM;gBAEP;oBACC,MAAM,IAAI,kBAAkB,CAAC,eAAe,CAC3C,mCAAmC,GAAG,EAAE,CACxC,CAAC;YACJ,CAAC;QACF,CAAC;QAED,OAAO,GAAG,CAAC;IACZ,CAAC;CACD"}
@@ -6,6 +6,7 @@ export class SliderIncantation extends ArgIncantation {
6
6
  arg_type = Incantation.ArgType.OBJECT;
7
7
  apply(target, data) {
8
8
  super.require_expr_type(target.type, "expression");
9
+ // @ts-expect-error: outdated types
9
10
  target.sliderBounds = data;
10
11
  }
11
12
  }
@@ -1 +1 @@
1
- {"version":3,"file":"slider.js","sourceRoot":"","sources":["../../../src/magic/local/slider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,cAAc,EAAc,MAAM,gBAAgB,CAAC;AAWzE,MAAM,OAAO,iBAAkB,SAAQ,cAAqB;IAEzC,WAAW,GAC1B,8CAA8C,CAAA;IAE/B,UAAU,GAAK,QAAQ,CAAA;IACvB,YAAY,GAAG,IAAI,CAAA;IACnB,QAAQ,GAAO,WAAW,CAAC,OAAO,CAAC,MAAM,CAAA;IAElD,KAAK,CAAC,MAA8B,EAAE,IAAkB;QAEhE,KAAK,CAAC,iBAAiB,CAAC,MAAM,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC;QAEnD,MAAM,CAAC,YAAY,GAAG,IAAI,CAAC;IAC5B,CAAC;CACD"}
1
+ {"version":3,"file":"slider.js","sourceRoot":"","sources":["../../../src/magic/local/slider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,cAAc,EAAc,MAAM,gBAAgB,CAAC;AAWzE,MAAM,OAAO,iBAAkB,SAAQ,cAAqB;IAEzC,WAAW,GAC1B,8CAA8C,CAAA;IAE/B,UAAU,GAAK,QAAQ,CAAA;IACvB,YAAY,GAAG,IAAI,CAAA;IACnB,QAAQ,GAAO,WAAW,CAAC,OAAO,CAAC,MAAM,CAAA;IAElD,KAAK,CAAC,MAA8B,EAAE,IAAkB;QAEhE,KAAK,CAAC,iBAAiB,CAAC,MAAM,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC;QACnD,mCAAmC;QACnC,MAAM,CAAC,YAAY,GAAG,IAAI,CAAC;IAC5B,CAAC;CACD"}
@@ -1,16 +1,19 @@
1
1
  import { UnrecoverableError } from "../errors.js";
2
2
  import { Incantation, ArgIncantation } from "../magic/index.js";
3
3
  export declare namespace Ast {
4
+ /** What kind of AST node this is. */
4
5
  enum Kind {
5
6
  EXPRESSION = "Expression",
6
7
  INCANTATION_INVOCATION = "Incantation-Invocation",
7
8
  INVALID_INCANTATION = "Invalid-Incantation"
8
9
  }
10
+ /** A Desmos expression to add to the calculator. */
9
11
  interface Expression {
10
12
  kind: Kind.EXPRESSION;
11
13
  data: Desmos.ExpressionState;
12
14
  incantations: Array<IncantationInvocation<Incantation.Effect.LOCAL> | InvalidInvocation>;
13
15
  }
16
+ /** A pending incantation invocation that requires applying its argument (if any), then applying its effect. */
14
17
  type IncantationInvocation<Effect extends Incantation.Effect = Incantation.Effect> = {
15
18
  kind: Kind.INCANTATION_INVOCATION;
16
19
  incantation: Incantation<Effect>;
@@ -20,6 +23,11 @@ export declare namespace Ast {
20
23
  incantation: ArgIncantation<Effect>;
21
24
  arg_raw: string | undefined;
22
25
  };
26
+ /**
27
+ * An invalid invantation invocation that raised an error when parsed.
28
+ *
29
+ * This will be propogated to the user as an extra Desmos text expression (unless they have `errors: "suppress"` configured).
30
+ */
23
31
  interface InvalidInvocation {
24
32
  kind: Kind.INVALID_INCANTATION;
25
33
  incantation: Incantation;
@@ -27,5 +35,6 @@ export declare namespace Ast {
27
35
  error: UnrecoverableError;
28
36
  }
29
37
  }
38
+ /** An abstract object produced by the parser. */
30
39
  export type Ast = Ast.Expression | Ast.IncantationInvocation | Ast.InvalidInvocation;
31
40
  //# sourceMappingURL=ast.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ast.d.ts","sourceRoot":"","sources":["../../src/parser/ast.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAGvD,yBAAiB,GAAG,CACpB;IAEC,KAAY,IAAI;QAEf,UAAU,eAA2B;QACrC,sBAAsB,2BAA2B;QACjD,mBAAmB,wBAA2B;KAC9C;IAID,UAAiB,UAAU;QAE1B,IAAI,EAAE,IAAI,CAAC,UAAU,CAAA;QACrB,IAAI,EAAE,MAAM,CAAC,eAAe,CAAA;QAC5B,YAAY,EAAE,KAAK,CAChB,qBAAqB,CAAC,WAAW,CAAC,MAAM,CAAC,KAAK,CAAC,GAC/C,iBAAiB,CAClB,CAAA;KACF;IAID,KAAY,qBAAqB,CAAC,MAAM,SAAS,WAAW,CAAC,MAAM,GAAG,WAAW,CAAC,MAAM,IACrF;QACD,IAAI,EAAE,IAAI,CAAC,sBAAsB,CAAA;QACjC,WAAW,EAAE,WAAW,CAAC,MAAM,CAAC,CAAA;QAChC,OAAO,EAAE,SAAS,CAAA;KAClB,GACC;QACD,IAAI,EAAE,IAAI,CAAC,sBAAsB,CAAA;QACjC,WAAW,EAAE,cAAc,CAAC,MAAM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nC,OAAO,EAAE,MAAM,GAAG,SAAS,CAAA;KAC3B,CAAC;IAEH;;;;OAIG;IACH,UAAiB,iBAAiB;QAEjC,IAAI,EAAE,IAAI,CAAC,mBAAmB,CAAA;QAC9B,WAAW,EAAE,WAAW,CAAA;QACxB,OAAO,CAAC,EAAE,MAAM,CAAA;QAChB,KAAK,EAAE,kBAAkB,CAAA;KACzB;CACD;AAED,iDAAiD;AACjD,MAAM,MAAM,GAAG,GACZ,GAAG,CAAC,UAAU,GACd,GAAG,CAAC,qBAAqB,GACzB,GAAG,CAAC,iBAAiB,CACvB"}
@@ -2,6 +2,7 @@ import { UnrecoverableError } from "../errors.js";
2
2
  import { Incantation, ArgIncantation } from "../magic/index.js";
3
3
  export var Ast;
4
4
  (function (Ast) {
5
+ /** What kind of AST node this is. */
5
6
  let Kind;
6
7
  (function (Kind) {
7
8
  Kind["EXPRESSION"] = "Expression";
@@ -1 +1 @@
1
- {"version":3,"file":"ast.js","sourceRoot":"","sources":["../../src/parser/ast.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAGvD,MAAM,KAAW,GAAG,CAgDnB;AAhDD,WAAiB,GAAG;IAGnB,IAAY,IAKX;IALD,WAAY,IAAI;QAEf,iCAAqC,CAAA;QACrC,yDAAiD,CAAA;QACjD,mDAA8C,CAAA;IAC/C,CAAC,EALW,IAAI,GAAJ,QAAI,KAAJ,QAAI,QAKf;AAwCF,CAAC,EAhDgB,GAAG,KAAH,GAAG,QAgDnB"}
1
+ {"version":3,"file":"ast.js","sourceRoot":"","sources":["../../src/parser/ast.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAGvD,MAAM,KAAW,GAAG,CAgDnB;AAhDD,WAAiB,GAAG;IAEnB,qCAAqC;IACrC,IAAY,IAKX;IALD,WAAY,IAAI;QAEf,iCAAqC,CAAA;QACrC,yDAAiD,CAAA;QACjD,mDAA8C,CAAA;IAC/C,CAAC,EALW,IAAI,GAAJ,QAAI,KAAJ,QAAI,QAKf;AAwCF,CAAC,EAhDgB,GAAG,KAAH,GAAG,QAgDnB"}