solve-engine 1.0.0-beta.2 → 1.0.0-beta.3
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/{Lexer-BJdhlnej.d.cts → Lexer-Dkt7KGaU.d.ts} +18 -2
- package/dist/{Lexer-D9l4Yrk2.d.ts → Lexer-y8uY6n6t.d.cts} +18 -2
- package/dist/{PackageRegistry-D-Tv_7ca.d.cts → PackageRegistry-CblRmrHc.d.cts} +60 -4
- package/dist/{PackageRegistry-DaH4aIKP.d.ts → PackageRegistry-wUQyVEyw.d.ts} +60 -4
- package/dist/{Parselet-CK8cQu2a.d.cts → Parselet-C974vhZG.d.cts} +1 -1
- package/dist/{Parselet-ConOIdRO.d.ts → Parselet-CsmtM3It.d.ts} +1 -1
- package/dist/{Token-0jpvUdPY.d.cts → Token-DnU2hwFY.d.cts} +14 -0
- package/dist/{Token-0jpvUdPY.d.ts → Token-DnU2hwFY.d.ts} +14 -0
- package/dist/TokenNormalizer-B8zmhO5X.d.ts +377 -0
- package/dist/TokenNormalizer-CqBCrYkR.d.cts +377 -0
- package/dist/{chunk-M5LX5AOO.js → chunk-23MFG6GG.js} +21 -8
- package/dist/chunk-23MFG6GG.js.map +1 -0
- package/dist/{chunk-SDGRK7EP.js → chunk-2A3VOGVG.js} +4 -4
- package/dist/{chunk-SDGRK7EP.js.map → chunk-2A3VOGVG.js.map} +1 -1
- package/dist/{chunk-NMD5VRN4.cjs → chunk-2R7SVDDB.cjs} +68 -67
- package/dist/chunk-2R7SVDDB.cjs.map +1 -0
- package/dist/{chunk-RIN643A3.js → chunk-626UW5RU.js} +2 -2
- package/dist/chunk-626UW5RU.js.map +1 -0
- package/dist/{chunk-CLL7RUQV.cjs → chunk-7J2Q77OH.cjs} +34 -13
- package/dist/chunk-7J2Q77OH.cjs.map +1 -0
- package/dist/{chunk-HWSZJQCI.js → chunk-AF5AE52C.js} +33 -12
- package/dist/chunk-AF5AE52C.js.map +1 -0
- package/dist/{chunk-RZCWSXTA.cjs → chunk-BOAVE4FC.cjs} +129 -129
- package/dist/{chunk-RZCWSXTA.cjs.map → chunk-BOAVE4FC.cjs.map} +1 -1
- package/dist/{chunk-EBSPLUW4.cjs → chunk-CGIDYRAX.cjs} +19 -9
- package/dist/chunk-CGIDYRAX.cjs.map +1 -0
- package/dist/{chunk-C4XZV6E7.cjs → chunk-EEJSQEHC.cjs} +20 -20
- package/dist/{chunk-C4XZV6E7.cjs.map → chunk-EEJSQEHC.cjs.map} +1 -1
- package/dist/{chunk-LR7YASZF.cjs → chunk-F7G7ZFIZ.cjs} +3 -3
- package/dist/chunk-F7G7ZFIZ.cjs.map +1 -0
- package/dist/{chunk-GW32KPCU.cjs → chunk-FI4WDYSL.cjs} +2 -2
- package/dist/chunk-FI4WDYSL.cjs.map +1 -0
- package/dist/{chunk-EIGTWK5N.js → chunk-KFRBAXKW.js} +3 -3
- package/dist/chunk-KFRBAXKW.js.map +1 -0
- package/dist/{chunk-64W6GLLZ.js → chunk-OJ6LW7VQ.js} +15 -5
- package/dist/chunk-OJ6LW7VQ.js.map +1 -0
- package/dist/{chunk-3PPFLFH4.js → chunk-OWXIOHQB.js} +6 -6
- package/dist/{chunk-3PPFLFH4.js.map → chunk-OWXIOHQB.js.map} +1 -1
- package/dist/{chunk-JBSYC7BB.cjs → chunk-PG2K5BL6.cjs} +41 -28
- package/dist/chunk-PG2K5BL6.cjs.map +1 -0
- package/dist/{chunk-XVWCOTR6.js → chunk-VM5ZKDLH.js} +5 -4
- package/dist/chunk-VM5ZKDLH.js.map +1 -0
- package/dist/{chunk-NMCRQP3Z.cjs → chunk-ZH2PCJ4V.cjs} +68 -68
- package/dist/{chunk-NMCRQP3Z.cjs.map → chunk-ZH2PCJ4V.cjs.map} +1 -1
- package/dist/{chunk-5YEMOYSE.js → chunk-ZS6CRJZP.js} +3 -3
- package/dist/{chunk-5YEMOYSE.js.map → chunk-ZS6CRJZP.js.map} +1 -1
- package/dist/constants.cjs +4 -4
- package/dist/constants.js +1 -1
- package/dist/engine.cjs +19 -19
- package/dist/engine.d.cts +6 -6
- package/dist/engine.d.ts +6 -6
- package/dist/engine.js +9 -9
- package/dist/index.cjs +18 -18
- package/dist/index.d.cts +6 -6
- package/dist/index.d.ts +6 -6
- package/dist/index.js +10 -10
- package/dist/language.cjs +63 -1
- package/dist/language.cjs.map +1 -1
- package/dist/language.d.cts +6 -6
- package/dist/language.d.ts +6 -6
- package/dist/language.js +63 -1
- package/dist/language.js.map +1 -1
- package/dist/lexer.cjs +14 -14
- package/dist/lexer.d.cts +3 -3
- package/dist/lexer.d.ts +3 -3
- package/dist/lexer.js +3 -3
- package/dist/normalizer.cjs +9 -9
- package/dist/normalizer.d.cts +4 -210
- package/dist/normalizer.d.ts +4 -210
- package/dist/normalizer.js +3 -3
- package/dist/packages.cjs +28 -28
- package/dist/packages.d.cts +5 -5
- package/dist/packages.d.ts +5 -5
- package/dist/packages.js +5 -5
- package/dist/parser.cjs +11 -11
- package/dist/parser.d.cts +2 -2
- package/dist/parser.d.ts +2 -2
- package/dist/parser.js +3 -3
- package/dist/resolvers.d.cts +1 -1
- package/dist/resolvers.d.ts +1 -1
- package/dist/uom.d.cts +1 -1
- package/dist/uom.d.ts +1 -1
- package/package.json +2 -1
- package/dist/NormalizerRule-BrVoVjmP.d.cts +0 -163
- package/dist/NormalizerRule-CEjf1FyD.d.ts +0 -163
- package/dist/chunk-64W6GLLZ.js.map +0 -1
- package/dist/chunk-CLL7RUQV.cjs.map +0 -1
- package/dist/chunk-EBSPLUW4.cjs.map +0 -1
- package/dist/chunk-EIGTWK5N.js.map +0 -1
- package/dist/chunk-GW32KPCU.cjs.map +0 -1
- package/dist/chunk-HWSZJQCI.js.map +0 -1
- package/dist/chunk-JBSYC7BB.cjs.map +0 -1
- package/dist/chunk-LR7YASZF.cjs.map +0 -1
- package/dist/chunk-M5LX5AOO.js.map +0 -1
- package/dist/chunk-NMD5VRN4.cjs.map +0 -1
- package/dist/chunk-RIN643A3.js.map +0 -1
- package/dist/chunk-XVWCOTR6.js.map +0 -1
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkZH2PCJ4V_cjs = require('./chunk-ZH2PCJ4V.cjs');
|
|
4
4
|
var chunkX6K3HUOY_cjs = require('./chunk-X6K3HUOY.cjs');
|
|
5
5
|
var chunk5X2PTP6F_cjs = require('./chunk-5X2PTP6F.cjs');
|
|
6
6
|
var chunk6NTVRDQV_cjs = require('./chunk-6NTVRDQV.cjs');
|
|
7
7
|
var chunk47LRVGOT_cjs = require('./chunk-47LRVGOT.cjs');
|
|
8
|
-
var
|
|
9
|
-
var
|
|
10
|
-
var
|
|
8
|
+
var chunkBOAVE4FC_cjs = require('./chunk-BOAVE4FC.cjs');
|
|
9
|
+
var chunkEEJSQEHC_cjs = require('./chunk-EEJSQEHC.cjs');
|
|
10
|
+
var chunkCGIDYRAX_cjs = require('./chunk-CGIDYRAX.cjs');
|
|
11
11
|
var chunkZ2XP767T_cjs = require('./chunk-Z2XP767T.cjs');
|
|
12
12
|
var chunkJ73SJHR3_cjs = require('./chunk-J73SJHR3.cjs');
|
|
13
13
|
var chunkHTXVVJRA_cjs = require('./chunk-HTXVVJRA.cjs');
|
|
14
14
|
var chunkOC6LTXYS_cjs = require('./chunk-OC6LTXYS.cjs');
|
|
15
|
-
var
|
|
16
|
-
var
|
|
15
|
+
var chunkF7G7ZFIZ_cjs = require('./chunk-F7G7ZFIZ.cjs');
|
|
16
|
+
var chunk7J2Q77OH_cjs = require('./chunk-7J2Q77OH.cjs');
|
|
17
17
|
var chunk6BKTCEUP_cjs = require('./chunk-6BKTCEUP.cjs');
|
|
18
18
|
var chunkM4N5GA5Z_cjs = require('./chunk-M4N5GA5Z.cjs');
|
|
19
19
|
var chunkB7LXJ6LC_cjs = require('./chunk-B7LXJ6LC.cjs');
|
|
@@ -2203,7 +2203,7 @@ function checkPackageCompatibility(candidate, existing) {
|
|
|
2203
2203
|
|
|
2204
2204
|
// src/api/EngineVersionCompatibility.ts
|
|
2205
2205
|
var import_semver = chunkB7LXJ6LC_cjs.__toESM(require_semver2(), 1);
|
|
2206
|
-
function checkEngineVersionCompatibility(pkg, engineVersion =
|
|
2206
|
+
function checkEngineVersionCompatibility(pkg, engineVersion = chunkF7G7ZFIZ_cjs.ENGINE_VERSION) {
|
|
2207
2207
|
if (!pkg.engineVersion) return { compatible: true };
|
|
2208
2208
|
if ((0, import_semver.validRange)(pkg.engineVersion) === null) {
|
|
2209
2209
|
return { compatible: false, reason: "invalid-range", declaredRange: pkg.engineVersion, engineVersion };
|
|
@@ -2214,7 +2214,7 @@ function checkEngineVersionCompatibility(pkg, engineVersion = chunkLR7YASZF_cjs.
|
|
|
2214
2214
|
}
|
|
2215
2215
|
return { compatible: true };
|
|
2216
2216
|
}
|
|
2217
|
-
function assertEngineVersionCompatible(pkg, engineVersion =
|
|
2217
|
+
function assertEngineVersionCompatible(pkg, engineVersion = chunkF7G7ZFIZ_cjs.ENGINE_VERSION) {
|
|
2218
2218
|
const result = checkEngineVersionCompatibility(pkg, engineVersion);
|
|
2219
2219
|
if (result.compatible) return;
|
|
2220
2220
|
if (result.reason === "invalid-range") {
|
|
@@ -3332,11 +3332,11 @@ function extractReadsAndWrites(tokens) {
|
|
|
3332
3332
|
return { reads, writes };
|
|
3333
3333
|
}
|
|
3334
3334
|
function isEmptyLine(lineText) {
|
|
3335
|
-
const classification =
|
|
3335
|
+
const classification = chunk7J2Q77OH_cjs.sharedLexer.classifyLine(lineText);
|
|
3336
3336
|
return classification.skip;
|
|
3337
3337
|
}
|
|
3338
3338
|
function findInlineSolvesInLine(lineText, lineNumber) {
|
|
3339
|
-
const spans =
|
|
3339
|
+
const spans = chunk7J2Q77OH_cjs.sharedLexer.findInlineSolves(lineText);
|
|
3340
3340
|
return spans.map((s) => ({
|
|
3341
3341
|
start: s.start,
|
|
3342
3342
|
end: s.end,
|
|
@@ -3410,19 +3410,19 @@ var ExpressionEngine = class {
|
|
|
3410
3410
|
this.bytecodeCache = /* @__PURE__ */ new Map();
|
|
3411
3411
|
// Pre-allocated BytecodeBuilder pool
|
|
3412
3412
|
this.builderPool = [
|
|
3413
|
-
new
|
|
3414
|
-
new
|
|
3415
|
-
new
|
|
3416
|
-
new
|
|
3413
|
+
new chunkEEJSQEHC_cjs.BytecodeBuilder(),
|
|
3414
|
+
new chunkEEJSQEHC_cjs.BytecodeBuilder(),
|
|
3415
|
+
new chunkEEJSQEHC_cjs.BytecodeBuilder(),
|
|
3416
|
+
new chunkEEJSQEHC_cjs.BytecodeBuilder()
|
|
3417
3417
|
];
|
|
3418
3418
|
// Index into the builder pool, incremented modulo pool size.
|
|
3419
3419
|
this.builderPoolIndex = 0;
|
|
3420
3420
|
// Most recent pipeline telemetry, populated when AllocationTracker.isEnabled().
|
|
3421
3421
|
this.lastTelemetry = null;
|
|
3422
3422
|
this.localeCode = localeCode;
|
|
3423
|
-
this.config =
|
|
3424
|
-
this.lexer = new
|
|
3425
|
-
this.registry = new
|
|
3423
|
+
this.config = chunkF7G7ZFIZ_cjs.mergeEngineConfig(chunkF7G7ZFIZ_cjs.DEFAULT_CONFIG, config ?? {});
|
|
3424
|
+
this.lexer = new chunk7J2Q77OH_cjs.Lexer(localeCode, chunk7J2Q77OH_cjs.buildTokenLookup(localeCode));
|
|
3425
|
+
this.registry = new chunkZH2PCJ4V_cjs.ParseletRegistry();
|
|
3426
3426
|
this.context = chunkJ73SJHR3_cjs.createEngineContext();
|
|
3427
3427
|
if (diagnosticPipeline) {
|
|
3428
3428
|
this.diagnosticPipeline = diagnosticPipeline;
|
|
@@ -3433,15 +3433,15 @@ var ExpressionEngine = class {
|
|
|
3433
3433
|
} else {
|
|
3434
3434
|
this.diagnosticPipeline = new chunk47LRVGOT_cjs.DiagnosticPipeline();
|
|
3435
3435
|
}
|
|
3436
|
-
this.normalizer = new
|
|
3437
|
-
for (const [phrase, tokenType] of Object.entries(
|
|
3436
|
+
this.normalizer = new chunkCGIDYRAX_cjs.TokenNormalizer();
|
|
3437
|
+
for (const [phrase, tokenType] of Object.entries(chunkCGIDYRAX_cjs.BUILTIN_PHRASES)) {
|
|
3438
3438
|
this.normalizer.addPhrase(phrase, tokenType);
|
|
3439
3439
|
}
|
|
3440
|
-
this.normalizer.register(
|
|
3440
|
+
this.normalizer.register(chunkCGIDYRAX_cjs.implicitMultiplyRule(
|
|
3441
3441
|
50,
|
|
3442
3442
|
(word) => this.normalizer.canStartPhrase(word)
|
|
3443
3443
|
));
|
|
3444
|
-
const pkgList = packages ??
|
|
3444
|
+
const pkgList = packages ?? chunkBOAVE4FC_cjs.BUILTIN_PACKAGES;
|
|
3445
3445
|
for (const pkg of pkgList) {
|
|
3446
3446
|
try {
|
|
3447
3447
|
this.registerPackage(pkg);
|
|
@@ -3452,7 +3452,7 @@ var ExpressionEngine = class {
|
|
|
3452
3452
|
);
|
|
3453
3453
|
}
|
|
3454
3454
|
}
|
|
3455
|
-
this.parser = new
|
|
3455
|
+
this.parser = new chunkZH2PCJ4V_cjs.PrecedenceParser(this.registry, this.config.validation.maxNestingDepth, localeCode);
|
|
3456
3456
|
this.vm = chunk6NTVRDQV_cjs.createVM(
|
|
3457
3457
|
this.context.opRegistry,
|
|
3458
3458
|
this.config.vm.maxStackDepth,
|
|
@@ -4048,7 +4048,7 @@ var ExpressionEngine = class {
|
|
|
4048
4048
|
* (this grammar is rare, a per-call allocation here is a non-issue).
|
|
4049
4049
|
*/
|
|
4050
4050
|
compileAdHoc(tokens) {
|
|
4051
|
-
const builder = new
|
|
4051
|
+
const builder = new chunkEEJSQEHC_cjs.BytecodeBuilder();
|
|
4052
4052
|
this.parseExpression(builder, tokens);
|
|
4053
4053
|
return builder.build();
|
|
4054
4054
|
}
|
|
@@ -4209,7 +4209,7 @@ var ExpressionEngine = class {
|
|
|
4209
4209
|
}
|
|
4210
4210
|
return this.simplifySymbolically(beforeTokens);
|
|
4211
4211
|
}
|
|
4212
|
-
if (
|
|
4212
|
+
if (chunkBOAVE4FC_cjs.containsSymbolicCall(normalizedTokens)) {
|
|
4213
4213
|
return this.simplifySymbolically(normalizedTokens);
|
|
4214
4214
|
}
|
|
4215
4215
|
if (normalizedTokens[0].type === "COLON" || normalizedTokens[0].type === "GLOBAL") return null;
|
|
@@ -5358,6 +5358,19 @@ var ExpressionEngine = class {
|
|
|
5358
5358
|
getLexer() {
|
|
5359
5359
|
return this.lexer;
|
|
5360
5360
|
}
|
|
5361
|
+
/**
|
|
5362
|
+
* This engine's token normalizer, with every phrase and rule its packages
|
|
5363
|
+
* registered.
|
|
5364
|
+
*
|
|
5365
|
+
* Exposed for the highlighting path. `LanguageService` classifies tokens
|
|
5366
|
+
* after the lexer but can only see phrase-fused types (a date literal, a
|
|
5367
|
+
* timecode, a package's own fused token) by running the same normalizer
|
|
5368
|
+
* evaluation runs. Sharing this instance rather than building a second one
|
|
5369
|
+
* is what keeps the two from disagreeing.
|
|
5370
|
+
*/
|
|
5371
|
+
getNormalizer() {
|
|
5372
|
+
return this.normalizer;
|
|
5373
|
+
}
|
|
5361
5374
|
/**
|
|
5362
5375
|
* Every completion candidate contributed by currently-registered
|
|
5363
5376
|
* packages (`IEnginePackage.completionItems`), flattened across all of
|
|
@@ -6679,7 +6692,7 @@ var PageManager = class _PageManager {
|
|
|
6679
6692
|
});
|
|
6680
6693
|
}
|
|
6681
6694
|
} else {
|
|
6682
|
-
const inlineSpans =
|
|
6695
|
+
const inlineSpans = chunk7J2Q77OH_cjs.sharedLexer.findInlineSolves(state.text);
|
|
6683
6696
|
if (inlineSpans.length > 0) {
|
|
6684
6697
|
for (const span of inlineSpans) {
|
|
6685
6698
|
if (!span.expression.trim()) continue;
|
|
@@ -7445,7 +7458,7 @@ var ThreeTierEvaluator = class {
|
|
|
7445
7458
|
}
|
|
7446
7459
|
const trimmed = state.text.trim();
|
|
7447
7460
|
if (trimmed.length === 0) return { expressions: [], inlineSolveCount: 0 };
|
|
7448
|
-
const inlineSpans =
|
|
7461
|
+
const inlineSpans = chunk7J2Q77OH_cjs.sharedLexer.findInlineSolves(state.text);
|
|
7449
7462
|
if (inlineSpans.length > 0) {
|
|
7450
7463
|
return {
|
|
7451
7464
|
expressions: inlineSpans.map((s) => s.expression),
|
|
@@ -7469,5 +7482,5 @@ exports.checkPackageCompatibility = checkPackageCompatibility;
|
|
|
7469
7482
|
exports.extractReadsAndWrites = extractReadsAndWrites;
|
|
7470
7483
|
exports.findInlineSolvesInLine = findInlineSolvesInLine;
|
|
7471
7484
|
exports.isEmptyLine = isEmptyLine;
|
|
7472
|
-
//# sourceMappingURL=chunk-
|
|
7473
|
-
//# sourceMappingURL=chunk-
|
|
7485
|
+
//# sourceMappingURL=chunk-PG2K5BL6.cjs.map
|
|
7486
|
+
//# sourceMappingURL=chunk-PG2K5BL6.cjs.map
|