solve-engine 1.0.0-beta.0 → 1.0.0-beta.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.
- package/dist/BytecodeBuilder-3egMyuDi.d.cts +274 -0
- package/dist/BytecodeBuilder-3egMyuDi.d.ts +274 -0
- package/dist/Configuration-fVpd-HC-.d.cts +228 -0
- package/dist/Configuration-fVpd-HC-.d.ts +228 -0
- package/dist/EngineError-DvPSnhZi.d.cts +304 -0
- package/dist/EngineError-DvPSnhZi.d.ts +304 -0
- package/dist/Lexer-BJdhlnej.d.cts +531 -0
- package/dist/Lexer-D9l4Yrk2.d.ts +531 -0
- package/dist/NormalizerRule-BrVoVjmP.d.cts +163 -0
- package/dist/NormalizerRule-CEjf1FyD.d.ts +163 -0
- package/dist/PackageRegistry-D-Tv_7ca.d.cts +2572 -0
- package/dist/PackageRegistry-DaH4aIKP.d.ts +2572 -0
- package/dist/Parselet-CK8cQu2a.d.cts +299 -0
- package/dist/Parselet-ConOIdRO.d.ts +299 -0
- package/dist/ScopeManager-B5k0nk05.d.ts +559 -0
- package/dist/ScopeManager-CKfQtl7l.d.cts +559 -0
- package/dist/Token-0jpvUdPY.d.cts +245 -0
- package/dist/Token-0jpvUdPY.d.ts +245 -0
- package/dist/VMCheckpoints-BmDwIXgK.d.ts +171 -0
- package/dist/VMCheckpoints-CqFuLwrT.d.cts +171 -0
- package/dist/Value-KtAQNHur.d.cts +295 -0
- package/dist/Value-KtAQNHur.d.ts +295 -0
- package/dist/chunk-2RWAXT6O.js +3 -0
- package/dist/chunk-2RWAXT6O.js.map +1 -0
- package/dist/chunk-34RRD7PC.js +1492 -0
- package/dist/chunk-34RRD7PC.js.map +1 -0
- package/dist/chunk-3PPFLFH4.js +5097 -0
- package/dist/chunk-3PPFLFH4.js.map +1 -0
- package/dist/chunk-3VGDNEE3.js +84 -0
- package/dist/chunk-3VGDNEE3.js.map +1 -0
- package/dist/chunk-3YNVWKR2.cjs +370 -0
- package/dist/chunk-3YNVWKR2.cjs.map +1 -0
- package/dist/chunk-47LRVGOT.cjs +316 -0
- package/dist/chunk-47LRVGOT.cjs.map +1 -0
- package/dist/chunk-4MG4XKO2.js +1644 -0
- package/dist/chunk-4MG4XKO2.js.map +1 -0
- package/dist/chunk-4QADQTWS.js +2392 -0
- package/dist/chunk-4QADQTWS.js.map +1 -0
- package/dist/chunk-53B6KDDJ.cjs +1651 -0
- package/dist/chunk-53B6KDDJ.cjs.map +1 -0
- package/dist/chunk-5X2PTP6F.cjs +104 -0
- package/dist/chunk-5X2PTP6F.cjs.map +1 -0
- package/dist/chunk-5YEMOYSE.js +264 -0
- package/dist/chunk-5YEMOYSE.js.map +1 -0
- package/dist/chunk-64W6GLLZ.js +481 -0
- package/dist/chunk-64W6GLLZ.js.map +1 -0
- package/dist/chunk-6BKTCEUP.cjs +233 -0
- package/dist/chunk-6BKTCEUP.cjs.map +1 -0
- package/dist/chunk-6NTVRDQV.cjs +1642 -0
- package/dist/chunk-6NTVRDQV.cjs.map +1 -0
- package/dist/chunk-6RDSQURE.js +290 -0
- package/dist/chunk-6RDSQURE.js.map +1 -0
- package/dist/chunk-75JP4BZX.js +93 -0
- package/dist/chunk-75JP4BZX.js.map +1 -0
- package/dist/chunk-B7LXJ6LC.cjs +36 -0
- package/dist/chunk-B7LXJ6LC.cjs.map +1 -0
- package/dist/chunk-BVAR5J2F.js +257 -0
- package/dist/chunk-BVAR5J2F.js.map +1 -0
- package/dist/chunk-C4XZV6E7.cjs +269 -0
- package/dist/chunk-C4XZV6E7.cjs.map +1 -0
- package/dist/chunk-CCJPSHGI.cjs +40 -0
- package/dist/chunk-CCJPSHGI.cjs.map +1 -0
- package/dist/chunk-CLL7RUQV.cjs +316 -0
- package/dist/chunk-CLL7RUQV.cjs.map +1 -0
- package/dist/chunk-DM3LMRBC.js +329 -0
- package/dist/chunk-DM3LMRBC.js.map +1 -0
- package/dist/chunk-DUEZFTK2.js +38 -0
- package/dist/chunk-DUEZFTK2.js.map +1 -0
- package/dist/chunk-EBSPLUW4.cjs +489 -0
- package/dist/chunk-EBSPLUW4.cjs.map +1 -0
- package/dist/chunk-EHAHVROS.cjs +261 -0
- package/dist/chunk-EHAHVROS.cjs.map +1 -0
- package/dist/chunk-EIGTWK5N.js +167 -0
- package/dist/chunk-EIGTWK5N.js.map +1 -0
- package/dist/chunk-EPOXXJBK.js +96 -0
- package/dist/chunk-EPOXXJBK.js.map +1 -0
- package/dist/chunk-FEAIOR7N.cjs +91 -0
- package/dist/chunk-FEAIOR7N.cjs.map +1 -0
- package/dist/chunk-G535KJEG.js +312 -0
- package/dist/chunk-G535KJEG.js.map +1 -0
- package/dist/chunk-GCM5JHMX.js +88 -0
- package/dist/chunk-GCM5JHMX.js.map +1 -0
- package/dist/chunk-GOLDJNMZ.js +368 -0
- package/dist/chunk-GOLDJNMZ.js.map +1 -0
- package/dist/chunk-GW32KPCU.cjs +360 -0
- package/dist/chunk-GW32KPCU.cjs.map +1 -0
- package/dist/chunk-HTXVVJRA.cjs +1549 -0
- package/dist/chunk-HTXVVJRA.cjs.map +1 -0
- package/dist/chunk-HWSZJQCI.js +311 -0
- package/dist/chunk-HWSZJQCI.js.map +1 -0
- package/dist/chunk-IF532O7C.js +101 -0
- package/dist/chunk-IF532O7C.js.map +1 -0
- package/dist/chunk-J73SJHR3.cjs +2415 -0
- package/dist/chunk-J73SJHR3.cjs.map +1 -0
- package/dist/chunk-JBSYC7BB.cjs +7473 -0
- package/dist/chunk-JBSYC7BB.cjs.map +1 -0
- package/dist/chunk-KVILKGMS.js +228 -0
- package/dist/chunk-KVILKGMS.js.map +1 -0
- package/dist/chunk-LIPPNDBE.js +258 -0
- package/dist/chunk-LIPPNDBE.js.map +1 -0
- package/dist/chunk-LR7YASZF.cjs +172 -0
- package/dist/chunk-LR7YASZF.cjs.map +1 -0
- package/dist/chunk-M4N5GA5Z.cjs +309 -0
- package/dist/chunk-M4N5GA5Z.cjs.map +1 -0
- package/dist/chunk-M5LX5AOO.js +7459 -0
- package/dist/chunk-M5LX5AOO.js.map +1 -0
- package/dist/chunk-MZOVP3WI.cjs +96 -0
- package/dist/chunk-MZOVP3WI.cjs.map +1 -0
- package/dist/chunk-N5YFR4UP.cjs +10 -0
- package/dist/chunk-N5YFR4UP.cjs.map +1 -0
- package/dist/chunk-NGBBNL4K.cjs +4 -0
- package/dist/chunk-NGBBNL4K.cjs.map +1 -0
- package/dist/chunk-NH2O2AUR.js +146 -0
- package/dist/chunk-NH2O2AUR.js.map +1 -0
- package/dist/chunk-NLNDMWZC.js +31 -0
- package/dist/chunk-NLNDMWZC.js.map +1 -0
- package/dist/chunk-NMCRQP3Z.cjs +778 -0
- package/dist/chunk-NMCRQP3Z.cjs.map +1 -0
- package/dist/chunk-NMD5VRN4.cjs +1327 -0
- package/dist/chunk-NMD5VRN4.cjs.map +1 -0
- package/dist/chunk-OC6LTXYS.cjs +286 -0
- package/dist/chunk-OC6LTXYS.cjs.map +1 -0
- package/dist/chunk-OT6OJY7C.cjs +114 -0
- package/dist/chunk-OT6OJY7C.cjs.map +1 -0
- package/dist/chunk-PFSDGGYL.js +8 -0
- package/dist/chunk-PFSDGGYL.js.map +1 -0
- package/dist/chunk-QNJ4ACRT.cjs +155 -0
- package/dist/chunk-QNJ4ACRT.cjs.map +1 -0
- package/dist/chunk-QWY3VEZN.js +1637 -0
- package/dist/chunk-QWY3VEZN.js.map +1 -0
- package/dist/chunk-RFYD5TJE.js +111 -0
- package/dist/chunk-RFYD5TJE.js.map +1 -0
- package/dist/chunk-RIN643A3.js +354 -0
- package/dist/chunk-RIN643A3.js.map +1 -0
- package/dist/chunk-RZCWSXTA.cjs +5122 -0
- package/dist/chunk-RZCWSXTA.cjs.map +1 -0
- package/dist/chunk-SDGRK7EP.js +774 -0
- package/dist/chunk-SDGRK7EP.js.map +1 -0
- package/dist/chunk-VEKIWQ3F.cjs +39 -0
- package/dist/chunk-VEKIWQ3F.cjs.map +1 -0
- package/dist/chunk-WQTTOGXC.cjs +99 -0
- package/dist/chunk-WQTTOGXC.cjs.map +1 -0
- package/dist/chunk-X6K3HUOY.cjs +86 -0
- package/dist/chunk-X6K3HUOY.cjs.map +1 -0
- package/dist/chunk-XJCMXB2E.cjs +333 -0
- package/dist/chunk-XJCMXB2E.cjs.map +1 -0
- package/dist/chunk-XVWCOTR6.js +1324 -0
- package/dist/chunk-XVWCOTR6.js.map +1 -0
- package/dist/chunk-YLJ4XMA6.js +33 -0
- package/dist/chunk-YLJ4XMA6.js.map +1 -0
- package/dist/chunk-Z2XP767T.cjs +35 -0
- package/dist/chunk-Z2XP767T.cjs.map +1 -0
- package/dist/chunk-Z4X2RWOF.js +37 -0
- package/dist/chunk-Z4X2RWOF.js.map +1 -0
- package/dist/constants.cjs +22 -0
- package/dist/constants.cjs.map +1 -0
- package/dist/constants.d.cts +12 -0
- package/dist/constants.d.ts +12 -0
- package/dist/constants.js +5 -0
- package/dist/constants.js.map +1 -0
- package/dist/engine.cjs +79 -0
- package/dist/engine.cjs.map +1 -0
- package/dist/engine.d.cts +587 -0
- package/dist/engine.d.ts +587 -0
- package/dist/engine.js +34 -0
- package/dist/engine.js.map +1 -0
- package/dist/errors.cjs +81 -0
- package/dist/errors.cjs.map +1 -0
- package/dist/errors.d.cts +95 -0
- package/dist/errors.d.ts +95 -0
- package/dist/errors.js +4 -0
- package/dist/errors.js.map +1 -0
- package/dist/format.cjs +171 -0
- package/dist/format.cjs.map +1 -0
- package/dist/format.d.cts +51 -0
- package/dist/format.d.ts +51 -0
- package/dist/format.js +168 -0
- package/dist/format.js.map +1 -0
- package/dist/index.cjs +97 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +152 -0
- package/dist/index.d.ts +152 -0
- package/dist/index.js +75 -0
- package/dist/index.js.map +1 -0
- package/dist/language.cjs +308 -0
- package/dist/language.cjs.map +1 -0
- package/dist/language.d.cts +110 -0
- package/dist/language.d.ts +110 -0
- package/dist/language.js +287 -0
- package/dist/language.js.map +1 -0
- package/dist/lexer.cjs +64 -0
- package/dist/lexer.cjs.map +1 -0
- package/dist/lexer.d.cts +56 -0
- package/dist/lexer.d.ts +56 -0
- package/dist/lexer.js +11 -0
- package/dist/lexer.js.map +1 -0
- package/dist/normalizer.cjs +40 -0
- package/dist/normalizer.cjs.map +1 -0
- package/dist/normalizer.d.cts +364 -0
- package/dist/normalizer.d.ts +364 -0
- package/dist/normalizer.js +11 -0
- package/dist/normalizer.js.map +1 -0
- package/dist/packages.cjs +121 -0
- package/dist/packages.cjs.map +1 -0
- package/dist/packages.d.cts +691 -0
- package/dist/packages.d.ts +691 -0
- package/dist/packages.js +24 -0
- package/dist/packages.js.map +1 -0
- package/dist/parser.cjs +55 -0
- package/dist/parser.cjs.map +1 -0
- package/dist/parser.d.cts +46 -0
- package/dist/parser.d.ts +46 -0
- package/dist/parser.js +10 -0
- package/dist/parser.js.map +1 -0
- package/dist/pipeline-CrsRPmsv.d.ts +285 -0
- package/dist/pipeline-DPUQt7yL.d.cts +285 -0
- package/dist/resolvers.cjs +13 -0
- package/dist/resolvers.cjs.map +1 -0
- package/dist/resolvers.d.cts +111 -0
- package/dist/resolvers.d.ts +111 -0
- package/dist/resolvers.js +4 -0
- package/dist/resolvers.js.map +1 -0
- package/dist/services.cjs +21 -0
- package/dist/services.cjs.map +1 -0
- package/dist/services.d.cts +30 -0
- package/dist/services.d.ts +30 -0
- package/dist/services.js +4 -0
- package/dist/services.js.map +1 -0
- package/dist/uom.cjs +56 -0
- package/dist/uom.cjs.map +1 -0
- package/dist/uom.d.cts +224 -0
- package/dist/uom.d.ts +224 -0
- package/dist/uom.js +11 -0
- package/dist/uom.js.map +1 -0
- package/dist/utilities.cjs +32 -0
- package/dist/utilities.cjs.map +1 -0
- package/dist/utilities.d.cts +113 -0
- package/dist/utilities.d.ts +113 -0
- package/dist/utilities.js +7 -0
- package/dist/utilities.js.map +1 -0
- package/dist/variables.cjs +17 -0
- package/dist/variables.cjs.map +1 -0
- package/dist/variables.d.cts +87 -0
- package/dist/variables.d.ts +87 -0
- package/dist/variables.js +4 -0
- package/dist/variables.js.map +1 -0
- package/dist/vm.cjs +284 -0
- package/dist/vm.cjs.map +1 -0
- package/dist/vm.d.cts +68 -0
- package/dist/vm.d.ts +68 -0
- package/dist/vm.js +194 -0
- package/dist/vm.js.map +1 -0
- package/package.json +4 -4
package/dist/packages.js
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export { ARITHMETIC_PACKAGE, BIGINT_PACKAGE, BUILTIN_PACKAGES, CONDITIONALS_PACKAGE, CONVERTERS_PACKAGE, CURRENCY_PACKAGE, DATETIME_PACKAGE, DICE_PACKAGE, FINANCE_PACKAGE, FUNCTION_PACKAGE, LINES_PACKAGE, MAPREDUCE_PACKAGE, MATHPHRASES_PACKAGE, MATRIX_PACKAGE, PERCENTAGE_PACKAGE, SYMBOLIC_PACKAGE, TIME_PACKAGE, UOM_PACKAGE, VARIABLES_PACKAGE, VECTOR_PACKAGE, WEATHER_PACKAGE, createKnowledgePackage, createStocksPackage } from './chunk-3PPFLFH4.js';
|
|
2
|
+
import './chunk-5YEMOYSE.js';
|
|
3
|
+
import './chunk-64W6GLLZ.js';
|
|
4
|
+
import './chunk-PFSDGGYL.js';
|
|
5
|
+
import './chunk-EPOXXJBK.js';
|
|
6
|
+
import './chunk-NLNDMWZC.js';
|
|
7
|
+
import './chunk-4QADQTWS.js';
|
|
8
|
+
import './chunk-GCM5JHMX.js';
|
|
9
|
+
import './chunk-DM3LMRBC.js';
|
|
10
|
+
import './chunk-75JP4BZX.js';
|
|
11
|
+
import './chunk-Z4X2RWOF.js';
|
|
12
|
+
import './chunk-RFYD5TJE.js';
|
|
13
|
+
import './chunk-34RRD7PC.js';
|
|
14
|
+
import './chunk-BVAR5J2F.js';
|
|
15
|
+
import './chunk-NH2O2AUR.js';
|
|
16
|
+
import './chunk-XVWCOTR6.js';
|
|
17
|
+
import './chunk-RIN643A3.js';
|
|
18
|
+
import './chunk-GOLDJNMZ.js';
|
|
19
|
+
import './chunk-LIPPNDBE.js';
|
|
20
|
+
import './chunk-4MG4XKO2.js';
|
|
21
|
+
import './chunk-6RDSQURE.js';
|
|
22
|
+
import './chunk-YLJ4XMA6.js';
|
|
23
|
+
//# sourceMappingURL=packages.js.map
|
|
24
|
+
//# sourceMappingURL=packages.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"packages.js"}
|
package/dist/parser.cjs
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkNMCRQP3Z_cjs = require('./chunk-NMCRQP3Z.cjs');
|
|
4
|
+
require('./chunk-47LRVGOT.cjs');
|
|
5
|
+
var chunkC4XZV6E7_cjs = require('./chunk-C4XZV6E7.cjs');
|
|
6
|
+
var chunkMZOVP3WI_cjs = require('./chunk-MZOVP3WI.cjs');
|
|
7
|
+
require('./chunk-GW32KPCU.cjs');
|
|
8
|
+
require('./chunk-3YNVWKR2.cjs');
|
|
9
|
+
require('./chunk-M4N5GA5Z.cjs');
|
|
10
|
+
require('./chunk-B7LXJ6LC.cjs');
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
Object.defineProperty(exports, "ParseletRegistry", {
|
|
15
|
+
enumerable: true,
|
|
16
|
+
get: function () { return chunkNMCRQP3Z_cjs.ParseletRegistry; }
|
|
17
|
+
});
|
|
18
|
+
Object.defineProperty(exports, "Parser", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function () { return chunkNMCRQP3Z_cjs.PrecedenceParser; }
|
|
21
|
+
});
|
|
22
|
+
Object.defineProperty(exports, "PrecedenceParser", {
|
|
23
|
+
enumerable: true,
|
|
24
|
+
get: function () { return chunkNMCRQP3Z_cjs.PrecedenceParser; }
|
|
25
|
+
});
|
|
26
|
+
Object.defineProperty(exports, "sharedParseletRegistry", {
|
|
27
|
+
enumerable: true,
|
|
28
|
+
get: function () { return chunkNMCRQP3Z_cjs.sharedParseletRegistry; }
|
|
29
|
+
});
|
|
30
|
+
Object.defineProperty(exports, "BindingPower", {
|
|
31
|
+
enumerable: true,
|
|
32
|
+
get: function () { return chunkC4XZV6E7_cjs.BindingPower; }
|
|
33
|
+
});
|
|
34
|
+
Object.defineProperty(exports, "BytecodeBuilder", {
|
|
35
|
+
enumerable: true,
|
|
36
|
+
get: function () { return chunkC4XZV6E7_cjs.BytecodeBuilder; }
|
|
37
|
+
});
|
|
38
|
+
Object.defineProperty(exports, "buildBindingPowerTable", {
|
|
39
|
+
enumerable: true,
|
|
40
|
+
get: function () { return chunkC4XZV6E7_cjs.buildBindingPowerTable; }
|
|
41
|
+
});
|
|
42
|
+
Object.defineProperty(exports, "invalidateBindingPowerTable", {
|
|
43
|
+
enumerable: true,
|
|
44
|
+
get: function () { return chunkC4XZV6E7_cjs.invalidateBindingPowerTable; }
|
|
45
|
+
});
|
|
46
|
+
Object.defineProperty(exports, "OpCode", {
|
|
47
|
+
enumerable: true,
|
|
48
|
+
get: function () { return chunkMZOVP3WI_cjs.OpCode; }
|
|
49
|
+
});
|
|
50
|
+
Object.defineProperty(exports, "getOpCodeName", {
|
|
51
|
+
enumerable: true,
|
|
52
|
+
get: function () { return chunkMZOVP3WI_cjs.getOpCodeName; }
|
|
53
|
+
});
|
|
54
|
+
//# sourceMappingURL=parser.cjs.map
|
|
55
|
+
//# sourceMappingURL=parser.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"parser.cjs"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
export { I as InfixParselet, P as ParseletRegistry, a as Parser, a as PrecedenceParser, b as PrefixParselet, s as sharedParseletRegistry } from './Parselet-CK8cQu2a.cjs';
|
|
2
|
+
export { B as BytecodeBuilder, a as BytecodeProgram, O as OpCode, g as getOpCodeName } from './BytecodeBuilder-3egMyuDi.cjs';
|
|
3
|
+
import './Token-0jpvUdPY.cjs';
|
|
4
|
+
import './pipeline-DPUQt7yL.cjs';
|
|
5
|
+
import './Value-KtAQNHur.cjs';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Named precedence levels for the Pratt parser, from loosest (`Lowest`) to
|
|
9
|
+
* tightest (`Call`) binding. A custom infix parselet compares its own
|
|
10
|
+
* binding power against the current expression's to decide whether to
|
|
11
|
+
* consume the next operator (higher power binds tighter, e.g. `*` over `+`).
|
|
12
|
+
*
|
|
13
|
+
* Package authors reference these when registering an infix parselet via
|
|
14
|
+
* `IPackageRegistry.registerInfixParselet`. See the built-in packages for
|
|
15
|
+
* examples of picking an appropriate level (e.g. arithmetic `+`/`-` use
|
|
16
|
+
* `Sum`, `*`/`/` use `Product`).
|
|
17
|
+
*/
|
|
18
|
+
declare const BindingPower: {
|
|
19
|
+
readonly Lowest: 0;
|
|
20
|
+
readonly Assignment: 10;
|
|
21
|
+
readonly LogicalOr: 12;
|
|
22
|
+
readonly LogicalAnd: 14;
|
|
23
|
+
readonly Conditional: 20;
|
|
24
|
+
readonly Sum: 30;
|
|
25
|
+
readonly BitwiseXor: 35;
|
|
26
|
+
readonly Product: 40;
|
|
27
|
+
readonly Exponent: 50;
|
|
28
|
+
readonly Prefix: 60;
|
|
29
|
+
readonly Postfix: 70;
|
|
30
|
+
readonly Call: 80;
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* Build the Uint8Array binding power table indexed by token typeId.
|
|
34
|
+
* Idempotent, returns cached table on subsequent calls.
|
|
35
|
+
*
|
|
36
|
+
* Must be called after all token types are registered (via registerAllTokenTypes())
|
|
37
|
+
* and after plugin providers have registered their token types.
|
|
38
|
+
*/
|
|
39
|
+
declare function buildBindingPowerTable(): Uint8Array;
|
|
40
|
+
/**
|
|
41
|
+
* Invalidate the cached BP table, call when plugins register new token types
|
|
42
|
+
* that should participate in the built-in fast path.
|
|
43
|
+
*/
|
|
44
|
+
declare function invalidateBindingPowerTable(): void;
|
|
45
|
+
|
|
46
|
+
export { BindingPower, buildBindingPowerTable, invalidateBindingPowerTable };
|
package/dist/parser.d.ts
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
export { I as InfixParselet, P as ParseletRegistry, a as Parser, a as PrecedenceParser, b as PrefixParselet, s as sharedParseletRegistry } from './Parselet-ConOIdRO.js';
|
|
2
|
+
export { B as BytecodeBuilder, a as BytecodeProgram, O as OpCode, g as getOpCodeName } from './BytecodeBuilder-3egMyuDi.js';
|
|
3
|
+
import './Token-0jpvUdPY.js';
|
|
4
|
+
import './pipeline-CrsRPmsv.js';
|
|
5
|
+
import './Value-KtAQNHur.js';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Named precedence levels for the Pratt parser, from loosest (`Lowest`) to
|
|
9
|
+
* tightest (`Call`) binding. A custom infix parselet compares its own
|
|
10
|
+
* binding power against the current expression's to decide whether to
|
|
11
|
+
* consume the next operator (higher power binds tighter, e.g. `*` over `+`).
|
|
12
|
+
*
|
|
13
|
+
* Package authors reference these when registering an infix parselet via
|
|
14
|
+
* `IPackageRegistry.registerInfixParselet`. See the built-in packages for
|
|
15
|
+
* examples of picking an appropriate level (e.g. arithmetic `+`/`-` use
|
|
16
|
+
* `Sum`, `*`/`/` use `Product`).
|
|
17
|
+
*/
|
|
18
|
+
declare const BindingPower: {
|
|
19
|
+
readonly Lowest: 0;
|
|
20
|
+
readonly Assignment: 10;
|
|
21
|
+
readonly LogicalOr: 12;
|
|
22
|
+
readonly LogicalAnd: 14;
|
|
23
|
+
readonly Conditional: 20;
|
|
24
|
+
readonly Sum: 30;
|
|
25
|
+
readonly BitwiseXor: 35;
|
|
26
|
+
readonly Product: 40;
|
|
27
|
+
readonly Exponent: 50;
|
|
28
|
+
readonly Prefix: 60;
|
|
29
|
+
readonly Postfix: 70;
|
|
30
|
+
readonly Call: 80;
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* Build the Uint8Array binding power table indexed by token typeId.
|
|
34
|
+
* Idempotent, returns cached table on subsequent calls.
|
|
35
|
+
*
|
|
36
|
+
* Must be called after all token types are registered (via registerAllTokenTypes())
|
|
37
|
+
* and after plugin providers have registered their token types.
|
|
38
|
+
*/
|
|
39
|
+
declare function buildBindingPowerTable(): Uint8Array;
|
|
40
|
+
/**
|
|
41
|
+
* Invalidate the cached BP table, call when plugins register new token types
|
|
42
|
+
* that should participate in the built-in fast path.
|
|
43
|
+
*/
|
|
44
|
+
declare function invalidateBindingPowerTable(): void;
|
|
45
|
+
|
|
46
|
+
export { BindingPower, buildBindingPowerTable, invalidateBindingPowerTable };
|
package/dist/parser.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export { ParseletRegistry, PrecedenceParser as Parser, PrecedenceParser, sharedParseletRegistry } from './chunk-SDGRK7EP.js';
|
|
2
|
+
import './chunk-G535KJEG.js';
|
|
3
|
+
export { BindingPower, BytecodeBuilder, buildBindingPowerTable, invalidateBindingPowerTable } from './chunk-5YEMOYSE.js';
|
|
4
|
+
export { OpCode, getOpCodeName } from './chunk-75JP4BZX.js';
|
|
5
|
+
import './chunk-RIN643A3.js';
|
|
6
|
+
import './chunk-GOLDJNMZ.js';
|
|
7
|
+
import './chunk-6RDSQURE.js';
|
|
8
|
+
import './chunk-YLJ4XMA6.js';
|
|
9
|
+
//# sourceMappingURL=parser.js.map
|
|
10
|
+
//# sourceMappingURL=parser.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"parser.js"}
|
|
@@ -0,0 +1,285 @@
|
|
|
1
|
+
import { M as MatrixData, R as RangeData, S as SymbolicNode } from './Value-KtAQNHur.js';
|
|
2
|
+
|
|
3
|
+
/** Base event, all events include a timestamp relative to pipeline start */
|
|
4
|
+
interface BaseEvent {
|
|
5
|
+
readonly type: string;
|
|
6
|
+
readonly elapsedNs: number;
|
|
7
|
+
readonly expression: string;
|
|
8
|
+
}
|
|
9
|
+
/** Emitted after each token is produced by the lexer */
|
|
10
|
+
interface TokenEmittedEvent extends BaseEvent {
|
|
11
|
+
readonly type: "token_emitted";
|
|
12
|
+
readonly token: {
|
|
13
|
+
readonly type: string;
|
|
14
|
+
readonly value: string;
|
|
15
|
+
readonly offset: number;
|
|
16
|
+
readonly line: number;
|
|
17
|
+
readonly col: number;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
/** Emitted when the parser resolves a parselet for a token */
|
|
21
|
+
interface ParseletMatchedEvent extends BaseEvent {
|
|
22
|
+
readonly type: "parselet_matched";
|
|
23
|
+
readonly tokenType: string;
|
|
24
|
+
readonly tokenValue: string;
|
|
25
|
+
readonly parseletCategory: string;
|
|
26
|
+
readonly parseletType: string;
|
|
27
|
+
readonly isPrefix: boolean;
|
|
28
|
+
readonly bindingPower?: number;
|
|
29
|
+
readonly tokenOffset: number;
|
|
30
|
+
}
|
|
31
|
+
/** Emitted after bytecode is built */
|
|
32
|
+
interface BytecodeBuiltEvent extends BaseEvent {
|
|
33
|
+
readonly type: "bytecode_built";
|
|
34
|
+
readonly opcodesLength: number;
|
|
35
|
+
readonly numbersLength: number;
|
|
36
|
+
readonly stringsLength: number;
|
|
37
|
+
readonly isCached: boolean;
|
|
38
|
+
}
|
|
39
|
+
/** Emitted after each VM opcode execution (only when vmTrace is enabled) */
|
|
40
|
+
interface VmStepEvent extends BaseEvent {
|
|
41
|
+
readonly type: "vm_step";
|
|
42
|
+
readonly opcode: number;
|
|
43
|
+
readonly opcodeName: string;
|
|
44
|
+
readonly ip: number;
|
|
45
|
+
readonly stackDepth: number;
|
|
46
|
+
readonly instructionNumber: number;
|
|
47
|
+
readonly stack: ReadonlyArray<{
|
|
48
|
+
readonly type: number;
|
|
49
|
+
readonly value: number | bigint | string | boolean | MatrixData | RangeData | SymbolicNode;
|
|
50
|
+
readonly unit?: string;
|
|
51
|
+
}>;
|
|
52
|
+
}
|
|
53
|
+
/** Emitted when the VM halts with a result */
|
|
54
|
+
interface VmHaltEvent extends BaseEvent {
|
|
55
|
+
readonly type: "vm_halt";
|
|
56
|
+
readonly result?: {
|
|
57
|
+
readonly type: number;
|
|
58
|
+
readonly value: number | bigint | string | boolean | MatrixData | RangeData | SymbolicNode;
|
|
59
|
+
readonly unit?: string;
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
/** Emitted on cache hit */
|
|
63
|
+
interface CacheHitEvent extends BaseEvent {
|
|
64
|
+
readonly type: "cache_hit";
|
|
65
|
+
readonly cache: "bytecode" | "line";
|
|
66
|
+
readonly key: string;
|
|
67
|
+
}
|
|
68
|
+
/** Emitted on cache miss */
|
|
69
|
+
interface CacheMissEvent extends BaseEvent {
|
|
70
|
+
readonly type: "cache_miss";
|
|
71
|
+
readonly cache: "bytecode" | "line";
|
|
72
|
+
readonly key: string;
|
|
73
|
+
}
|
|
74
|
+
/** Emitted when a pipeline evaluation begins */
|
|
75
|
+
interface PipelineStartEvent extends BaseEvent {
|
|
76
|
+
readonly type: "pipeline_start";
|
|
77
|
+
readonly inputType: string;
|
|
78
|
+
}
|
|
79
|
+
/** Emitted when a pipeline evaluation completes */
|
|
80
|
+
interface PipelineEndEvent extends BaseEvent {
|
|
81
|
+
readonly type: "pipeline_end";
|
|
82
|
+
readonly success: boolean;
|
|
83
|
+
readonly error?: string;
|
|
84
|
+
readonly totalTokens: number;
|
|
85
|
+
readonly totalOpcodes: number;
|
|
86
|
+
}
|
|
87
|
+
/** Emitted when the normalizer begins its pass */
|
|
88
|
+
interface NormalizerStartEvent extends BaseEvent {
|
|
89
|
+
readonly type: "normalizer_start";
|
|
90
|
+
readonly inputTokenCount: number;
|
|
91
|
+
}
|
|
92
|
+
/** Emitted when the normalizer fuses tokens */
|
|
93
|
+
interface TokenFusedEvent extends BaseEvent {
|
|
94
|
+
readonly type: "token_fused";
|
|
95
|
+
readonly ruleName: string;
|
|
96
|
+
readonly sourceTokenCount: number;
|
|
97
|
+
readonly fusedTokenType: string;
|
|
98
|
+
readonly fusedTokenValue: string;
|
|
99
|
+
}
|
|
100
|
+
/** Emitted when the normalizer completes its pass */
|
|
101
|
+
interface NormalizerEndEvent extends BaseEvent {
|
|
102
|
+
readonly type: "normalizer_end";
|
|
103
|
+
readonly outputTokenCount: number;
|
|
104
|
+
readonly fusionsCount: number;
|
|
105
|
+
}
|
|
106
|
+
/** Union of all event types */
|
|
107
|
+
type DiagnosticEvent = TokenEmittedEvent | NormalizerStartEvent | TokenFusedEvent | NormalizerEndEvent | ParseletMatchedEvent | BytecodeBuiltEvent | VmStepEvent | VmHaltEvent | CacheHitEvent | CacheMissEvent | PipelineStartEvent | PipelineEndEvent;
|
|
108
|
+
/** Categorized parselet info */
|
|
109
|
+
interface CategorizedParselet {
|
|
110
|
+
readonly tokenType: string;
|
|
111
|
+
readonly tokenValue: string;
|
|
112
|
+
readonly parseletCategory: string;
|
|
113
|
+
readonly parseletType: string;
|
|
114
|
+
readonly isPrefix: boolean;
|
|
115
|
+
readonly bindingPower?: number;
|
|
116
|
+
readonly tokenOffset: number;
|
|
117
|
+
}
|
|
118
|
+
/** Structured diagnostic report */
|
|
119
|
+
interface DiagnosticReport {
|
|
120
|
+
readonly events: readonly DiagnosticEvent[];
|
|
121
|
+
readonly parselets: readonly CategorizedParselet[];
|
|
122
|
+
readonly summary: {
|
|
123
|
+
readonly totalTokens: number;
|
|
124
|
+
readonly totalParselets: number;
|
|
125
|
+
readonly totalOpcodes: number;
|
|
126
|
+
readonly cacheHit: boolean;
|
|
127
|
+
readonly elapsedNs: number;
|
|
128
|
+
readonly parseCategories: ReadonlyMap<string, number>;
|
|
129
|
+
};
|
|
130
|
+
readonly metadata: {
|
|
131
|
+
readonly expression: string;
|
|
132
|
+
readonly inputType: string;
|
|
133
|
+
readonly timestamp: number;
|
|
134
|
+
readonly vmTraceEnabled: boolean;
|
|
135
|
+
};
|
|
136
|
+
/** Serialize to a JSON-safe plain object */
|
|
137
|
+
toJSON(): DiagnosticReportJSON;
|
|
138
|
+
}
|
|
139
|
+
/** JSON-serializable representation of a DiagnosticReport */
|
|
140
|
+
interface DiagnosticReportJSON {
|
|
141
|
+
readonly events: readonly DiagnosticEvent[];
|
|
142
|
+
readonly parselets: readonly CategorizedParselet[];
|
|
143
|
+
readonly summary: {
|
|
144
|
+
readonly totalTokens: number;
|
|
145
|
+
readonly totalParselets: number;
|
|
146
|
+
readonly totalOpcodes: number;
|
|
147
|
+
readonly cacheHit: boolean;
|
|
148
|
+
readonly elapsedNs: number;
|
|
149
|
+
readonly parseCategories: Record<string, number>;
|
|
150
|
+
};
|
|
151
|
+
readonly metadata: {
|
|
152
|
+
readonly expression: string;
|
|
153
|
+
readonly inputType: string;
|
|
154
|
+
readonly timestamp: number;
|
|
155
|
+
readonly vmTraceEnabled: boolean;
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
/** JSON-serializable representation of a DiagnosticReport */
|
|
159
|
+
interface DiagnosticReportJSON {
|
|
160
|
+
readonly events: readonly DiagnosticEvent[];
|
|
161
|
+
readonly parselets: readonly CategorizedParselet[];
|
|
162
|
+
readonly summary: {
|
|
163
|
+
readonly totalTokens: number;
|
|
164
|
+
readonly totalParselets: number;
|
|
165
|
+
readonly totalOpcodes: number;
|
|
166
|
+
readonly cacheHit: boolean;
|
|
167
|
+
readonly elapsedNs: number;
|
|
168
|
+
readonly parseCategories: Record<string, number>;
|
|
169
|
+
};
|
|
170
|
+
readonly metadata: {
|
|
171
|
+
readonly expression: string;
|
|
172
|
+
readonly inputType: string;
|
|
173
|
+
readonly timestamp: number;
|
|
174
|
+
readonly vmTraceEnabled: boolean;
|
|
175
|
+
};
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* Interface for collecting diagnostic data during pipeline execution.
|
|
180
|
+
*
|
|
181
|
+
* All methods are implemented as concrete no-ops so subclasses only
|
|
182
|
+
* need to override the ones they care about. This avoids optional
|
|
183
|
+
* method issues with TypeScript's strict mode.
|
|
184
|
+
*
|
|
185
|
+
* The parameters are named `_event` because these base implementations
|
|
186
|
+
* deliberately ignore them. Overrides are free to name theirs `event` and use
|
|
187
|
+
* it; TypeScript does not match parameter names when checking overrides.
|
|
188
|
+
*/
|
|
189
|
+
declare abstract class DiagnosticCollector {
|
|
190
|
+
onPipelineStart(_event: DiagnosticEvent & {
|
|
191
|
+
type: "pipeline_start";
|
|
192
|
+
}): void;
|
|
193
|
+
onTokenEmitted(_event: DiagnosticEvent & {
|
|
194
|
+
type: "token_emitted";
|
|
195
|
+
}): void;
|
|
196
|
+
onNormalizerStart(_event: DiagnosticEvent & {
|
|
197
|
+
type: "normalizer_start";
|
|
198
|
+
}): void;
|
|
199
|
+
onTokenFused(_event: DiagnosticEvent & {
|
|
200
|
+
type: "token_fused";
|
|
201
|
+
}): void;
|
|
202
|
+
onNormalizerEnd(_event: DiagnosticEvent & {
|
|
203
|
+
type: "normalizer_end";
|
|
204
|
+
}): void;
|
|
205
|
+
onParseletMatched(_event: DiagnosticEvent & {
|
|
206
|
+
type: "parselet_matched";
|
|
207
|
+
}): void;
|
|
208
|
+
onBytecodeBuilt(_event: DiagnosticEvent & {
|
|
209
|
+
type: "bytecode_built";
|
|
210
|
+
}): void;
|
|
211
|
+
onVmStep(_event: DiagnosticEvent & {
|
|
212
|
+
type: "vm_step";
|
|
213
|
+
}): void;
|
|
214
|
+
onVmHalt(_event: DiagnosticEvent & {
|
|
215
|
+
type: "vm_halt";
|
|
216
|
+
}): void;
|
|
217
|
+
onCacheHit(_event: DiagnosticEvent & {
|
|
218
|
+
type: "cache_hit";
|
|
219
|
+
}): void;
|
|
220
|
+
onCacheMiss(_event: DiagnosticEvent & {
|
|
221
|
+
type: "cache_miss";
|
|
222
|
+
}): void;
|
|
223
|
+
onPipelineEnd(_event: DiagnosticEvent & {
|
|
224
|
+
type: "pipeline_end";
|
|
225
|
+
}): void;
|
|
226
|
+
abstract getReport(): DiagnosticReport | undefined;
|
|
227
|
+
abstract reset(): void;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
/**
|
|
231
|
+
* Dispatches diagnostic events to all registered collectors.
|
|
232
|
+
*
|
|
233
|
+
* Performance guarantee: when no collectors are registered (production mode),
|
|
234
|
+
* every dispatch method is a branch on `this.collectors.length === 0` which
|
|
235
|
+
* modern JS engines will predict and eliminate. The overhead is a single
|
|
236
|
+
* comparison per call, effectively zero.
|
|
237
|
+
*/
|
|
238
|
+
declare class DiagnosticPipeline {
|
|
239
|
+
private collectors;
|
|
240
|
+
register(collector: DiagnosticCollector): void;
|
|
241
|
+
unregister(collector: DiagnosticCollector): void;
|
|
242
|
+
clear(): void;
|
|
243
|
+
get hasCollectors(): boolean;
|
|
244
|
+
get collectorCount(): number;
|
|
245
|
+
firePipelineStart(event: DiagnosticEvent & {
|
|
246
|
+
type: "pipeline_start";
|
|
247
|
+
}): void;
|
|
248
|
+
fireTokenEmitted(event: DiagnosticEvent & {
|
|
249
|
+
type: "token_emitted";
|
|
250
|
+
}): void;
|
|
251
|
+
fireNormalizerStart(event: DiagnosticEvent & {
|
|
252
|
+
type: "normalizer_start";
|
|
253
|
+
}): void;
|
|
254
|
+
fireTokenFused(event: DiagnosticEvent & {
|
|
255
|
+
type: "token_fused";
|
|
256
|
+
}): void;
|
|
257
|
+
fireNormalizerEnd(event: DiagnosticEvent & {
|
|
258
|
+
type: "normalizer_end";
|
|
259
|
+
}): void;
|
|
260
|
+
fireParseletMatched(event: DiagnosticEvent & {
|
|
261
|
+
type: "parselet_matched";
|
|
262
|
+
}): void;
|
|
263
|
+
fireBytecodeBuilt(event: DiagnosticEvent & {
|
|
264
|
+
type: "bytecode_built";
|
|
265
|
+
}): void;
|
|
266
|
+
fireVmStep(event: DiagnosticEvent & {
|
|
267
|
+
type: "vm_step";
|
|
268
|
+
}): void;
|
|
269
|
+
fireVmHalt(event: DiagnosticEvent & {
|
|
270
|
+
type: "vm_halt";
|
|
271
|
+
}): void;
|
|
272
|
+
fireCacheHit(event: DiagnosticEvent & {
|
|
273
|
+
type: "cache_hit";
|
|
274
|
+
}): void;
|
|
275
|
+
fireCacheMiss(event: DiagnosticEvent & {
|
|
276
|
+
type: "cache_miss";
|
|
277
|
+
}): void;
|
|
278
|
+
firePipelineEnd(event: DiagnosticEvent & {
|
|
279
|
+
type: "pipeline_end";
|
|
280
|
+
}): void;
|
|
281
|
+
collectReports(): DiagnosticReport[];
|
|
282
|
+
reset(): void;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
export { DiagnosticPipeline as D, type DiagnosticReportJSON as a };
|