solve-engine 1.0.0-beta.3 → 1.0.0-beta.5
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-y8uY6n6t.d.cts → Lexer-Cfm79Dak.d.cts} +1 -1
- package/dist/{Lexer-Dkt7KGaU.d.ts → Lexer-W9MBOP0V.d.ts} +1 -1
- package/dist/{PackageRegistry-wUQyVEyw.d.ts → PackageRegistry-CjDt-Jy_.d.ts} +4 -4
- package/dist/{PackageRegistry-CblRmrHc.d.cts → PackageRegistry-pHtKythi.d.cts} +4 -4
- package/dist/{Parselet-C974vhZG.d.cts → Parselet-Cu0bLSis.d.cts} +1 -1
- package/dist/{Parselet-CsmtM3It.d.ts → Parselet-DEdF9I7n.d.ts} +1 -1
- package/dist/{Token-DnU2hwFY.d.cts → Token-BzG5G4ja.d.cts} +30 -0
- package/dist/{Token-DnU2hwFY.d.ts → Token-BzG5G4ja.d.ts} +30 -0
- package/dist/{TokenNormalizer-CqBCrYkR.d.cts → TokenNormalizer-DGVa24Q-.d.cts} +1 -1
- package/dist/{TokenNormalizer-B8zmhO5X.d.ts → TokenNormalizer-t_GotBxr.d.ts} +1 -1
- package/dist/{chunk-AF5AE52C.js → chunk-2CS6OMZK.js} +7 -6
- package/dist/chunk-2CS6OMZK.js.map +1 -0
- package/dist/{chunk-XJCMXB2E.cjs → chunk-2MV4HBKC.cjs} +187 -61
- package/dist/chunk-2MV4HBKC.cjs.map +1 -0
- package/dist/{chunk-WQTTOGXC.cjs → chunk-4AVD7NZW.cjs} +4 -4
- package/dist/{chunk-WQTTOGXC.cjs.map → chunk-4AVD7NZW.cjs.map} +1 -1
- package/dist/{chunk-HTXVVJRA.cjs → chunk-4CVLFLOB.cjs} +112 -2
- package/dist/chunk-4CVLFLOB.cjs.map +1 -0
- package/dist/{chunk-ZS6CRJZP.js → chunk-6GCKCWLB.js} +9 -3
- package/dist/chunk-6GCKCWLB.js.map +1 -0
- package/dist/{chunk-PG2K5BL6.cjs → chunk-73GSBGUU.cjs} +53 -53
- package/dist/{chunk-PG2K5BL6.cjs.map → chunk-73GSBGUU.cjs.map} +1 -1
- package/dist/{chunk-CGIDYRAX.cjs → chunk-AHCLWAM5.cjs} +18 -10
- package/dist/chunk-AHCLWAM5.cjs.map +1 -0
- package/dist/{chunk-KVILKGMS.js → chunk-AJA6LUI7.js} +36 -2
- package/dist/chunk-AJA6LUI7.js.map +1 -0
- package/dist/{chunk-F7G7ZFIZ.cjs → chunk-AZUA3F4I.cjs} +3 -3
- package/dist/{chunk-F7G7ZFIZ.cjs.map → chunk-AZUA3F4I.cjs.map} +1 -1
- package/dist/{chunk-QWY3VEZN.js → chunk-BAMZT3GL.js} +65 -12
- package/dist/chunk-BAMZT3GL.js.map +1 -0
- package/dist/{chunk-J73SJHR3.cjs → chunk-BXKJLM5R.cjs} +569 -344
- package/dist/chunk-BXKJLM5R.cjs.map +1 -0
- package/dist/{chunk-EHAHVROS.cjs → chunk-CLVQBF5C.cjs} +5 -5
- package/dist/{chunk-EHAHVROS.cjs.map → chunk-CLVQBF5C.cjs.map} +1 -1
- package/dist/{chunk-BOAVE4FC.cjs → chunk-CSG5XVNJ.cjs} +1491 -218
- package/dist/chunk-CSG5XVNJ.cjs.map +1 -0
- package/dist/{chunk-34RRD7PC.js → chunk-CYFK5SY2.js} +111 -3
- package/dist/chunk-CYFK5SY2.js.map +1 -0
- package/dist/{chunk-626UW5RU.js → chunk-GPPLSM2Z.js} +61 -2
- package/dist/chunk-GPPLSM2Z.js.map +1 -0
- package/dist/{chunk-OWXIOHQB.js → chunk-GVWHCL2N.js} +1417 -144
- package/dist/chunk-GVWHCL2N.js.map +1 -0
- package/dist/{chunk-2R7SVDDB.cjs → chunk-M4F66R4O.cjs} +72 -72
- package/dist/{chunk-2R7SVDDB.cjs.map → chunk-M4F66R4O.cjs.map} +1 -1
- package/dist/{chunk-LIPPNDBE.js → chunk-M5E34VG5.js} +3 -3
- package/dist/{chunk-LIPPNDBE.js.map → chunk-M5E34VG5.js.map} +1 -1
- package/dist/{chunk-53B6KDDJ.cjs → chunk-MBNQVDVC.cjs} +38 -3
- package/dist/{chunk-53B6KDDJ.cjs.map → chunk-MBNQVDVC.cjs.map} +1 -1
- package/dist/{chunk-2A3VOGVG.js → chunk-MEOHSQEH.js} +6 -5
- package/dist/chunk-MEOHSQEH.js.map +1 -0
- package/dist/{chunk-ZH2PCJ4V.cjs → chunk-MTX2KVU7.cjs} +71 -70
- package/dist/chunk-MTX2KVU7.cjs.map +1 -0
- package/dist/{chunk-4QADQTWS.js → chunk-MVBEL57Q.js} +242 -17
- package/dist/chunk-MVBEL57Q.js.map +1 -0
- package/dist/{chunk-QNJ4ACRT.cjs → chunk-NJTXJ5AG.cjs} +37 -15
- package/dist/chunk-NJTXJ5AG.cjs.map +1 -0
- package/dist/{chunk-EEJSQEHC.cjs → chunk-NZFKROS7.cjs} +26 -20
- package/dist/chunk-NZFKROS7.cjs.map +1 -0
- package/dist/{chunk-OJ6LW7VQ.js → chunk-OFXOTECC.js} +13 -5
- package/dist/chunk-OFXOTECC.js.map +1 -0
- package/dist/{chunk-3YNVWKR2.cjs → chunk-OUHT5Z36.cjs} +28 -5
- package/dist/chunk-OUHT5Z36.cjs.map +1 -0
- package/dist/{chunk-4MG4XKO2.js → chunk-PCPX42KL.js} +38 -3
- package/dist/{chunk-4MG4XKO2.js.map → chunk-PCPX42KL.js.map} +1 -1
- package/dist/{chunk-6NTVRDQV.cjs → chunk-QDMPOAI7.cjs} +126 -73
- package/dist/chunk-QDMPOAI7.cjs.map +1 -0
- package/dist/{chunk-FI4WDYSL.cjs → chunk-R24DI24X.cjs} +61 -2
- package/dist/chunk-R24DI24X.cjs.map +1 -0
- package/dist/{chunk-VM5ZKDLH.js → chunk-SFQWJMKT.js} +5 -5
- package/dist/{chunk-VM5ZKDLH.js.map → chunk-SFQWJMKT.js.map} +1 -1
- package/dist/{chunk-6BKTCEUP.cjs → chunk-TY3TLZAW.cjs} +36 -2
- package/dist/chunk-TY3TLZAW.cjs.map +1 -0
- package/dist/{chunk-23MFG6GG.js → chunk-TZLCIJWP.js} +12 -12
- package/dist/{chunk-23MFG6GG.js.map → chunk-TZLCIJWP.js.map} +1 -1
- package/dist/{chunk-DM3LMRBC.js → chunk-UKPGSAZW.js} +187 -61
- package/dist/chunk-UKPGSAZW.js.map +1 -0
- package/dist/{chunk-KFRBAXKW.js → chunk-VZH3NOLP.js} +3 -3
- package/dist/{chunk-KFRBAXKW.js.map → chunk-VZH3NOLP.js.map} +1 -1
- package/dist/{chunk-NH2O2AUR.js → chunk-WC5FFSHB.js} +26 -4
- package/dist/chunk-WC5FFSHB.js.map +1 -0
- package/dist/{chunk-7J2Q77OH.cjs → chunk-WWOLFXTX.cjs} +11 -10
- package/dist/chunk-WWOLFXTX.cjs.map +1 -0
- package/dist/{chunk-GOLDJNMZ.js → chunk-XBTEO4OB.js} +28 -5
- package/dist/chunk-XBTEO4OB.js.map +1 -0
- package/dist/{chunk-EPOXXJBK.js → chunk-YU2CUNFO.js} +3 -3
- package/dist/{chunk-EPOXXJBK.js.map → chunk-YU2CUNFO.js.map} +1 -1
- package/dist/constants.cjs +4 -4
- package/dist/constants.js +1 -1
- package/dist/engine.cjs +29 -30
- package/dist/engine.d.cts +6 -6
- package/dist/engine.d.ts +6 -6
- package/dist/engine.js +19 -20
- package/dist/format.cjs +7 -8
- package/dist/format.cjs.map +1 -1
- package/dist/format.js +2 -3
- package/dist/format.js.map +1 -1
- package/dist/index.cjs +28 -29
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -6
- package/dist/index.d.ts +6 -6
- package/dist/index.js +20 -21
- package/dist/index.js.map +1 -1
- package/dist/language.cjs +12 -12
- package/dist/language.d.cts +6 -6
- package/dist/language.d.ts +6 -6
- package/dist/language.js +5 -5
- package/dist/lexer.cjs +19 -19
- package/dist/lexer.d.cts +3 -3
- package/dist/lexer.d.ts +3 -3
- package/dist/lexer.js +7 -7
- package/dist/normalizer.cjs +12 -12
- package/dist/normalizer.d.cts +3 -3
- package/dist/normalizer.d.ts +3 -3
- package/dist/normalizer.js +6 -6
- package/dist/packages.cjs +36 -37
- package/dist/packages.d.cts +5 -5
- package/dist/packages.d.ts +5 -5
- package/dist/packages.js +13 -14
- package/dist/parser.cjs +12 -12
- package/dist/parser.d.cts +3 -2
- package/dist/parser.d.ts +3 -2
- package/dist/parser.js +4 -4
- package/dist/resolvers.d.cts +1 -1
- package/dist/resolvers.d.ts +1 -1
- package/dist/uom.cjs +14 -14
- package/dist/uom.d.cts +12 -4
- package/dist/uom.d.ts +12 -4
- package/dist/uom.js +4 -4
- package/dist/vm.cjs +17 -17
- package/dist/vm.js +6 -6
- package/package.json +1 -1
- package/dist/chunk-2A3VOGVG.js.map +0 -1
- package/dist/chunk-34RRD7PC.js.map +0 -1
- package/dist/chunk-3YNVWKR2.cjs.map +0 -1
- package/dist/chunk-4QADQTWS.js.map +0 -1
- package/dist/chunk-626UW5RU.js.map +0 -1
- package/dist/chunk-6BKTCEUP.cjs.map +0 -1
- package/dist/chunk-6NTVRDQV.cjs.map +0 -1
- package/dist/chunk-7J2Q77OH.cjs.map +0 -1
- package/dist/chunk-AF5AE52C.js.map +0 -1
- package/dist/chunk-BOAVE4FC.cjs.map +0 -1
- package/dist/chunk-CGIDYRAX.cjs.map +0 -1
- package/dist/chunk-DM3LMRBC.js.map +0 -1
- package/dist/chunk-EEJSQEHC.cjs.map +0 -1
- package/dist/chunk-FI4WDYSL.cjs.map +0 -1
- package/dist/chunk-GOLDJNMZ.js.map +0 -1
- package/dist/chunk-HTXVVJRA.cjs.map +0 -1
- package/dist/chunk-J73SJHR3.cjs.map +0 -1
- package/dist/chunk-KVILKGMS.js.map +0 -1
- package/dist/chunk-NH2O2AUR.js.map +0 -1
- package/dist/chunk-OJ6LW7VQ.js.map +0 -1
- package/dist/chunk-OT6OJY7C.cjs +0 -114
- package/dist/chunk-OT6OJY7C.cjs.map +0 -1
- package/dist/chunk-OWXIOHQB.js.map +0 -1
- package/dist/chunk-QNJ4ACRT.cjs.map +0 -1
- package/dist/chunk-QWY3VEZN.js.map +0 -1
- package/dist/chunk-RFYD5TJE.js +0 -111
- package/dist/chunk-RFYD5TJE.js.map +0 -1
- package/dist/chunk-XJCMXB2E.cjs.map +0 -1
- package/dist/chunk-ZH2PCJ4V.cjs.map +0 -1
- package/dist/chunk-ZS6CRJZP.js.map +0 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
var
|
|
3
|
+
var chunkTY3TLZAW_cjs = require('./chunk-TY3TLZAW.cjs');
|
|
4
|
+
var chunkM4F66R4O_cjs = require('./chunk-M4F66R4O.cjs');
|
|
5
|
+
var chunkOUHT5Z36_cjs = require('./chunk-OUHT5Z36.cjs');
|
|
6
|
+
var chunkCLVQBF5C_cjs = require('./chunk-CLVQBF5C.cjs');
|
|
7
7
|
|
|
8
8
|
// src/lexer/LexerState.ts
|
|
9
9
|
var LexerState = /* @__PURE__ */ ((LexerState2) => {
|
|
@@ -28,7 +28,7 @@ var Lexer = class {
|
|
|
28
28
|
// next()/peek() streaming access.
|
|
29
29
|
this.tokens = [];
|
|
30
30
|
this.tokenIdx = 0;
|
|
31
|
-
this.expressionLexer = new
|
|
31
|
+
this.expressionLexer = new chunkM4F66R4O_cjs.ExpressionLexer(localeCode, tokenLookup);
|
|
32
32
|
}
|
|
33
33
|
reset(input, state) {
|
|
34
34
|
const newState = state ?? "main" /* Main */;
|
|
@@ -181,7 +181,7 @@ var Lexer = class {
|
|
|
181
181
|
offset: token.offset,
|
|
182
182
|
col: token.col,
|
|
183
183
|
length: token.value.length,
|
|
184
|
-
category:
|
|
184
|
+
category: chunkTY3TLZAW_cjs.getTokenCategory(token.type)
|
|
185
185
|
}));
|
|
186
186
|
}
|
|
187
187
|
};
|
|
@@ -319,13 +319,14 @@ var BUILTIN_PHRASES = {
|
|
|
319
319
|
"decrease by": "DECREASE_BY",
|
|
320
320
|
"times by": "TIMES_BY",
|
|
321
321
|
"multiply by": "MULTIPLY_BY",
|
|
322
|
+
"multiplied by": "MULTIPLY_BY",
|
|
322
323
|
"divide by": "DIVIDE_BY"
|
|
323
324
|
};
|
|
324
325
|
function buildTokenLookup(localeCode = "en") {
|
|
325
|
-
const locale =
|
|
326
|
+
const locale = chunkOUHT5Z36_cjs.getLocale(localeCode);
|
|
326
327
|
const registry = new TokenClassRegistry();
|
|
327
328
|
registry.setLocale(locale.keywordMap, BUILTIN_PHRASES);
|
|
328
|
-
registry.setUnits(
|
|
329
|
+
registry.setUnits(chunkCLVQBF5C_cjs.knownUnits);
|
|
329
330
|
return registry.build();
|
|
330
331
|
}
|
|
331
332
|
|
|
@@ -333,5 +334,5 @@ exports.Lexer = Lexer;
|
|
|
333
334
|
exports.LexerState = LexerState;
|
|
334
335
|
exports.buildTokenLookup = buildTokenLookup;
|
|
335
336
|
exports.sharedLexer = sharedLexer;
|
|
336
|
-
//# sourceMappingURL=chunk-
|
|
337
|
-
//# sourceMappingURL=chunk-
|
|
337
|
+
//# sourceMappingURL=chunk-WWOLFXTX.cjs.map
|
|
338
|
+
//# sourceMappingURL=chunk-WWOLFXTX.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/lexer/LexerState.ts","../src/lexer/Lexer.ts","../src/lexer/TokenClassRegistry.ts","../src/lexer/tokenRegistration.ts"],"names":["LexerState","ExpressionLexer","getTokenCategory","getLocale","knownUnits"],"mappings":";;;;;;;;AAMO,IAAK,UAAA,qBAAAA,WAAAA,KAAL;AACN,EAAAA,YAAA,MAAA,CAAA,GAAO,MAAA;AACP,EAAAA,YAAA,QAAA,CAAA,GAAS,QAAA;AACT,EAAAA,YAAA,QAAA,CAAA,GAAS,QAAA;AAHE,EAAA,OAAAA,WAAAA;AAAA,CAAA,EAAA,UAAA,IAAA,EAAA;;;ACaL,IAAM,QAAN,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* - Main: document-level scanning with markdown classification\n * - Inline: expression embedded in markdown inline solve (`s\\`...\\``)\n * - String: inside a double-quoted string literal\n */\nexport enum LexerState {\n\tMain = \"main\",\n\tInline = \"inline\",\n\tString = \"string\",\n}\n","import { ExpressionLexer, LineClassification, LexerVocabulary, type ScanLineResult } from \"./ExpressionLexer\";\nimport { Token } from \"@solve-js/lexer/Token\";\nimport { LexerState } from \"@solve-js/lexer/LexerState\";\nimport { getTokenCategory } from \"@solve-js/language/TokenCategoryMap\";\nimport type { TokenCategory } from \"@solve-js/language/TokenCategory\";\nimport type { TokenLookup } from \"@solve-js/lexer/TokenClassRegistry\";\n\n/**\n * Public tokenizer wrapper around {@link ExpressionLexer}.\n *\n * `ExpressionLexer` does the actual character-by-character scanning;\n * `Lexer` adds a materialized-token-array streaming interface\n * (`next()`/`peek()`) plus line-classification state (`reset()`) so\n * callers can iterate a line's tokens without re-scanning on each peek.\n *\n * Each `ExpressionEngine` instance owns its own `Lexer`, and packages\n * extend it via {@link registerVocabulary} (keywords, operators, units)\n * see `IEnginePackage.lexerVocabulary`.\n */\nexport class Lexer {\n /** Expression-mode lexer (Phase A: V8-optimized, replaces moo) */\n private expressionLexer: ExpressionLexer;\n private currentState: LexerState = LexerState.Main;\n private peekedToken: Token | undefined;\n private hasPeeked = false;\n\n // Materialized token array from the last reset() call, used for\n // next()/peek() streaming access.\n private tokens: Token[] = [];\n private tokenIdx: number = 0;\n\n /**\n * @param localeCode - Locale code (e.g., \"en\", \"de\"). Defaults to \"en\".\n * @param tokenLookup - Optional TokenLookup from TokenClassRegistry.\n * When provided, configures ExpressionLexer to use registry-built\n * keyword/unit/phrase lookups instead of internal instance maps.\n */\n constructor(localeCode = \"en\", tokenLookup?: TokenLookup) {\n // Pass the lookup directly to ExpressionLexer's constructor, it's an\n // instance field now, not a static. Each Lexer instance gets its own\n // isolated lookup, preventing cross-instance corruption.\n this.expressionLexer = new ExpressionLexer(localeCode, tokenLookup);\n }\n\n reset(input: string, state?: LexerState): void {\n const newState = state ?? LexerState.Main;\n this.currentState = newState;\n this.hasPeeked = false;\n this.peekedToken = undefined;\n\n // Phase B: Main state classifies the line with the markdown scanner.\n // Skip lines (headings, fences, HRs, etc.) produce empty token arrays.\n // Expression lines and lines with inline solves are tokenized normally.\n if (newState === LexerState.Main) {\n const classification = this.expressionLexer.classifyLine(input);\n if (classification.skip) {\n this.tokens = [];\n this.tokenIdx = 0;\n return;\n }\n // Expression line or markdown line with inline solves, tokenize.\n this.expressionLexer.reset(input);\n this.tokens = this.expressionLexer.tokenizeAll();\n this.tokenIdx = 0;\n } else {\n // Non-main states (Inline, String), expression tokenization.\n this.expressionLexer.reset(input);\n this.tokens = this.expressionLexer.tokenizeAll();\n this.tokenIdx = 0;\n }\n }\n\n /**\n * Classify a single line of markdown text (Phase B).\n * Delegates to the ExpressionLexer's character-by-character scanner.\n */\n classifyLine(lineText: string): LineClassification {\n return this.expressionLexer.classifyLine(lineText);\n }\n\n /**\n * Find all inline solve markers in a line (Phase B).\n * Delegates to the ExpressionLexer's character-by-character scanner.\n */\n findInlineSolves(lineText: string) {\n return this.expressionLexer.findInlineSolves(lineText);\n }\n\n /**\n * Every keyword this lexer currently recognizes (locale + plugin-contributed),\n * mapped to the token type it lexes to. Delegates to the ExpressionLexer.\n */\n getKeywords(): Record<string, string> {\n return this.expressionLexer.getKeywords();\n }\n\n next(): Token | undefined {\n if (this.hasPeeked) {\n this.hasPeeked = false;\n return this.peekedToken;\n }\n // Materialized token array (ExpressionLexer path).\n if (this.tokenIdx < this.tokens.length) {\n return this.tokens[this.tokenIdx++];\n }\n return undefined;\n }\n\n peek(): Token | undefined {\n if (this.hasPeeked) return this.peekedToken;\n this.peekedToken = this.next();\n this.hasPeeked = true;\n return this.peekedToken;\n }\n\n [Symbol.iterator](): Iterator<Token> {\n return this.tokens[Symbol.iterator]();\n }\n\n /**\n * Register a plugin to extend the lexer with custom tokens.\n * Delegates to the underlying ExpressionLexer.\n *\n * @see LexerVocabulary for the supported extension points.\n */\n registerVocabulary(plugin: LexerVocabulary): void {\n this.expressionLexer.registerVocabulary(plugin);\n }\n\n /**\n * Unregister a plugin, removing its custom tokens from the lexer.\n * Delegates to the underlying ExpressionLexer.\n */\n unregisterVocabulary(plugin: LexerVocabulary): void {\n this.expressionLexer.unregisterVocabulary(plugin);\n }\n\n /**\n * Reset the lexer for expression-only text, skips the classifyLine()\n * overhead in reset() for callers that already know the input is an\n * evaluable expression (e.g., after isEmptyLine() confirmed non-skip).\n */\n resetExpression(input: string): void {\n this.currentState = LexerState.Main;\n this.hasPeeked = false;\n this.peekedToken = undefined;\n this.expressionLexer.reset(input);\n this.tokens = this.expressionLexer.tokenizeAll();\n this.tokenIdx = 0;\n }\n\n /**\n * Scan a full document in one pass, classifying each line and\n * tokenizing non-skipped lines. Delegates to ExpressionLexer.\n *\n * @returns ScanLineResult[], one per line, with classification + tokens.\n */\n scanDocument(text: string): ScanLineResult[] {\n return this.expressionLexer.scanDocument(text);\n }\n\n getState(): LexerState {\n return this.currentState;\n }\n\n setState(state: LexerState): void {\n this.currentState = state;\n }\n\n getHighlightTokens(lineText: string): {type: string; value: string; offset: number; col: number; length: number; category: TokenCategory | undefined}[] {\n const classification = this.expressionLexer.classifyLine(lineText);\n\n // For blockquote lines, strip the \"> \" prefix and tokenize the expression content.\n // This lets expressions inside blockquotes (e.g., \"> 1 + 2\") get syntax highlighted\n // while pure structural lines (headings, code fences) remain unhighlighted.\n if (classification.skip && lineText.startsWith(\"> \")) {\n return this.collectHighlightTokens(lineText.slice(2));\n }\n\n if (classification.skip) {\n return [];\n }\n\n return this.collectHighlightTokens(lineText);\n }\n\n /**\n * The same tokens {@link getHighlightTokens} reduces, before reduction.\n *\n * Exists because normalization operates on tokens, not on the flattened\n * shape, and a consumer that wants phrase-fused highlighting has to run the\n * normalizer between the two. See `LanguageService.getSemanticTokens`.\n *\n * @param lineText - One line of source.\n * @returns Every token on the line that is worth painting, unreduced.\n */\n getHighlightTokenObjects(lineText: string): Token[] {\n const classification = this.expressionLexer.classifyLine(lineText);\n if (classification.skip && lineText.startsWith(\"> \")) {\n return this.collectTokenObjects(lineText.slice(2));\n }\n if (classification.skip) return [];\n return this.collectTokenObjects(lineText);\n }\n\n private collectTokenObjects(lineText: string): Token[] {\n this.resetExpression(lineText);\n const result: Token[] = [];\n for (const token of this) {\n if (token.type === \"WS\" || token.type === \"NEWLINE\") continue;\n if (token.type.startsWith(\"MD_\")) continue;\n if (token.type === \"INLINE_SOLVE_START\" || token.type === \"BACKTICK_CLOSE\") continue;\n result.push(token);\n }\n return result;\n }\n\n private collectHighlightTokens(lineText: string): {type: string; value: string; offset: number; col: number; length: number; category: TokenCategory | undefined}[] {\n return this.collectTokenObjects(lineText).map(token => ({\n type: token.type,\n value: token.value,\n offset: token.offset,\n col: token.col,\n length: token.value.length,\n category: getTokenCategory(token.type),\n }));\n }\n}\n\n/**\n * A lexer for operations that do not depend on registered vocabulary.\n *\n * Line classification and inline-solve detection read characters looking for\n * headings, comment markers, fences and backtick spans, and never consult the\n * keyword, unit or operator tables. Every lexer therefore returns the same\n * answer, so the callers that have no engine to ask can use this one. Checked\n * by `__tests__/lexer/LineClassificationIsVocabularyIndependent.spec.ts`.\n *\n * Do not tokenize with this. An engine's own lexer carries the vocabulary its\n * packages registered; this one carries none.\n */\nexport const sharedLexer = new Lexer(\"en\", undefined);","/**\n * TokenClass, Plugin-extensible keyword registration for the Lexer.\n *\n * Providers call `registry.register(tokenClass)` to teach the lexer about\n * their keywords. The registry merges locale keywords, provider keywords,\n * phrase mappings, and unit names into an optimized TokenLookup structure\n * consumed by the Lexer.\n *\n * @example\n * registry.register({\n * tokenType: 'CARET',\n * keywords: {},\n * phrases: { 'to the power of': true, 'power of': true },\n * priority: 10,\n * description: 'Exponentiation operators (x^y)',\n * });\n */\nexport interface TokenClass {\n /** The token type string produced by the lexer (e.g., \"FUNC\", \"PI\", \"CARET\").\n * Must match a token type that a ParseletRegistry has a parselet for. */\n tokenType: string;\n\n /** Single-word keywords (case-insensitive). The lexer lowercases input\n * before lookup, so these should be lowercase. Example:\n * { sqrt: true, abs: true, sin: true, cos: true } for tokenType \"FUNC\" */\n keywords: Record<string, boolean>;\n\n /** Multi-word phrases (case-insensitive). Matched by the built-in PhraseMatcher\n * via the phrase trie. Example:\n * { \"to the power of\": true, \"power of\": true } for tokenType \"CARET\" */\n phrases?: Record<string, boolean>;\n\n /** Priority for conflict resolution. When two TokenClasses register\n * the same keyword, the higher-priority class wins. Locale keywords\n * have priority 0 (set via setLocale). Providers should use\n * priority >= 10 to override locale defaults. Default: 0 */\n priority?: number;\n\n /** Human-readable description for debugging and introspection */\n description?: string;\n}\n\n// ── Phrase Trie ──────────────────────────────────────────────────────────────\n\n/** Trie node for multi-word phrase matching. */\nexport interface PhraseNode {\n /** Complete phrase token type (null = intermediate node) */\n type?: string;\n children: Map<string, PhraseNode>;\n}\n\n// ── TokenLookup, Optimized lookup structure for the Lexer ──────────────────\n\n/**\n * The optimized lookup structure built by TokenClassRegistry.build().\n * Consumed by the Lexer for O(1) keyword → token type lookups and\n * O(word-count) phrase matching.\n */\nexport interface TokenLookup {\n /** Lowercase keyword → token type. O(1) Map lookup. */\n keywordToType: Map<string, string>;\n\n /** Phrase trie for multi-word matching. Root node with children maps.\n * Null if no phrases registered. */\n phraseTrie: PhraseNode | null;\n\n /** Set of lowercase first-words of all registered phrases.\n * Used by the lexer to emit IDENT (not a phrase keyword) for words\n * that start multi-word phrases, deferring to the PhraseMatcher.\n *\n * Example: \"to\" is in phraseStartWords because \"to the power of\" is a phrase.\n * When the lexer sees \"to\", it emits IDENT and lets the phrase matcher\n * combine \"to the power of\" into a single CARET token.\n *\n * This prevents plugins from accidentally overriding phrase-start words.\n */\n phraseStartWords: Set<string>;\n\n /** Case-sensitive unit names for UNIT fallback after keyword lookup fails. */\n unitNames: ReadonlySet<string>;\n}\n\n// ── TokenClassRegistry ───────────────────────────────────────────────────────\n\n/**\n * Central registry for keyword→token-type mappings.\n *\n * Providers register TokenClasses; locales provide keyword maps;\n * units provide a name set. `build()` merges all sources into an\n * optimized TokenLookup consumed by the Lexer.\n *\n * Merge order (later overrides earlier):\n * 1. Locale keywords (priority 0)\n * 2. Provider keywords (sorted by priority ascending, higher priority wins)\n *\n * Unit names are stored separately (checked AFTER keyword lookup fails).\n * Phrases are stored in a trie for O(phrase-length) matching.\n */\nexport class TokenClassRegistry {\n private classes: TokenClass[] = [];\n private localeKeywordMap: Record<string, string> | null = null;\n private localePhraseMap: Record<string, string> | null = null;\n private unitNames: ReadonlySet<string> | null = null;\n\n /**\n * Register a provider's TokenClass. Must be called BEFORE build().\n * Can be called multiple times to add more entries.\n *\n * Built-in token types CANNOT be overridden, throws a EngineError\n * if the TokenClass attempts to register a keyword that conflicts\n * with an already-registered token type.\n */\n register(tokenClass: TokenClass): void {\n this.classes.push(tokenClass);\n }\n\n /**\n * Unregister all TokenClasses for a given token type.\n * Useful for plugin unload. Requires rebuild() to take effect.\n */\n unregister(tokenType: string): void {\n this.classes = this.classes.filter(c => c.tokenType !== tokenType);\n }\n\n /**\n * Set the locale's keyword→type map and optional phrase map.\n * Called on locale change. Priority 0 (cannot override providers with higher priority).\n */\n setLocale(keywordMap: Record<string, string>, phraseMap?: Record<string, string>): void {\n this.localeKeywordMap = keywordMap;\n this.localePhraseMap = phraseMap ?? null;\n }\n\n /**\n * Set the unit name set. Called when unit list changes.\n * Units are stored separately (checked AFTER keyword lookup fails).\n *\n * Takes a ReadonlySet because the caller's set is derived from the\n * conversion tables and must not be mutated; this class only ever reads it.\n */\n setUnits(unitNames: ReadonlySet<string>): void {\n this.unitNames = unitNames;\n }\n\n /**\n * Build the optimized TokenLookup from all registered sources.\n *\n * Merge order (later overrides earlier):\n * 1. Locale keywords (priority 0)\n * 2. Provider classes (sorted by priority ascending)\n *\n * Returns a frozen TokenLookup that the Lexer consumes.\n * Call build() again after register()/setLocale()/setUnits() changes.\n */\n build(): TokenLookup {\n const keywordToType = new Map<string, string>();\n\n // Layer 1: Locale keywords (priority 0, lowest)\n if (this.localeKeywordMap) {\n for (const [keyword, tokenType] of Object.entries(this.localeKeywordMap)) {\n keywordToType.set(keyword.toLowerCase(), tokenType);\n }\n }\n\n // Layer 2: Provider keywords (sorted by priority ascending, higher wins)\n const sorted = [...this.classes].sort((a, b) => (a.priority ?? 0) - (b.priority ?? 0));\n for (const tc of sorted) {\n for (const keyword of Object.keys(tc.keywords)) {\n keywordToType.set(keyword.toLowerCase(), tc.tokenType);\n }\n }\n\n // Build phrase trie from locale + provider phrases\n const phraseTrie = this.buildPhraseTrie();\n\n // Build phraseStartWords set (first word of every phrase)\n const phraseStartWords = this.buildPhraseStartWords();\n\n return {\n keywordToType,\n phraseTrie,\n phraseStartWords,\n unitNames: this.unitNames ?? new Set(),\n };\n }\n\n // ── Private helpers ─────────────────────────────────────────────────────\n\n private buildPhraseTrie(): PhraseNode | null {\n const root: PhraseNode = { children: new Map() };\n\n // Layer 1: Locale phrases\n if (this.localePhraseMap) {\n for (const [phrase, tokenType] of Object.entries(this.localePhraseMap)) {\n this.insertPhrase(root, phrase.toLowerCase(), tokenType);\n }\n }\n\n // Layer 2: Provider phrases\n for (const tc of this.classes) {\n if (!tc.phrases) continue;\n for (const phrase of Object.keys(tc.phrases)) {\n this.insertPhrase(root, phrase.toLowerCase(), tc.tokenType);\n }\n }\n\n return root.children.size > 0 ? root : null;\n }\n\n private insertPhrase(root: PhraseNode, phrase: string, tokenType: string): void {\n const words = phrase.split(' ');\n let node = root;\n for (const word of words) {\n if (!node.children.has(word)) {\n node.children.set(word, { children: new Map() });\n }\n node = node.children.get(word)!;\n }\n // Only set type if not already set, first-registered (locale) wins\n if (!node.type) {\n node.type = tokenType;\n }\n }\n\n private buildPhraseStartWords(): Set<string> {\n const startWords = new Set<string>();\n\n // Locale phrase first words\n if (this.localePhraseMap) {\n for (const phrase of Object.keys(this.localePhraseMap)) {\n const first = phrase.split(' ')[0].toLowerCase();\n startWords.add(first);\n }\n }\n\n // Provider phrase first words\n for (const tc of this.classes) {\n if (!tc.phrases) continue;\n for (const phrase of Object.keys(tc.phrases)) {\n const first = phrase.split(' ')[0].toLowerCase();\n startWords.add(first);\n }\n }\n\n return startWords;\n }\n}","/**\n * tokenRegistration.ts, Bootstrap for building TokenLookup from locale, units, and phrases.\n *\n * This module centralizes the assembly of the TokenLookup consumed by ExpressionLexer.\n * It merges:\n * 1. Locale keywords (from ILocale.keywordMap)\n * 2. Built-in phrase patterns (to the power of, increase by, etc.)\n * 3. Known unit names (from units.ts)\n *\n * The resulting TokenLookup is frozen and passed to ExpressionLexer.configuredLookup\n * at construction time, enabling data-driven keyword/unit/phrase resolution.\n */\nimport { TokenClassRegistry } from '@solve-js/lexer/TokenClassRegistry';\nimport type { TokenLookup } from '@solve-js/lexer/TokenClassRegistry';\nimport { getLocale, type ILocale } from '@solve-js/constants/locales';\nimport { knownUnits } from '@solve-js/lexer/units';\n\n// ── Built-in phrase map ───────────────────────────────────────────────────\n// These are the multi-word expressions handled as compound tokens.\n// Matched by the PhraseMatcher (trie-based) in ExpressionLexer.tryMatchPhrase().\nconst BUILTIN_PHRASES: Record<string, string> = {\n 'to the power of': 'CARET',\n 'power of': 'CARET',\n 'increase by': 'INCREASE_BY',\n 'decrease by': 'DECREASE_BY',\n 'times by': 'TIMES_BY',\n 'multiply by': 'MULTIPLY_BY',\n 'multiplied by': 'MULTIPLY_BY',\n 'divide by': 'DIVIDE_BY',\n};\n\n/**\n * Build a TokenLookup from locale keywords, known units, and built-in phrases.\n *\n * Merge order (later overrides earlier):\n * 1. Locale keywords (priority 0, lowest, can be overridden by providers)\n * 2. Built-in phrases (via locale phraseMap)\n * 3. Known units (checked AFTER keyword lookup fails, via unitNames set)\n *\n * The resulting TokenLookup replaces the internal keyword map, unit set,\n * phrase trie, and phraseStartWords in ExpressionLexer when set via\n * ExpressionLexer.configuredLookup.\n *\n * @param localeCode - The locale code (e.g., \"en\", \"de\"). Defaults to \"en\".\n * @returns A frozen TokenLookup ready for consumption by the lexer.\n */\nexport function buildTokenLookup(localeCode = 'en'): TokenLookup {\n const locale: ILocale = getLocale(localeCode);\n const registry = new TokenClassRegistry();\n\n // Layer 1: Locale keywords (priority 0, lowest)\n registry.setLocale(locale.keywordMap, BUILTIN_PHRASES);\n\n // Layer 2: Known units (checked after keyword lookup)\n registry.setUnits(knownUnits);\n\n // Build and return the lookup\n return registry.build();\n}\n"]}
|
|
@@ -7,13 +7,16 @@ var enLocale = {
|
|
|
7
7
|
e: "E",
|
|
8
8
|
plus: "PLUS",
|
|
9
9
|
add: "PLUS",
|
|
10
|
-
and: "
|
|
10
|
+
and: "AND_CONJ",
|
|
11
|
+
with: "PLUS",
|
|
11
12
|
minus: "MINUS",
|
|
12
13
|
subtract: "MINUS",
|
|
13
14
|
remove: "MINUS",
|
|
14
15
|
take: "MINUS",
|
|
16
|
+
without: "MINUS",
|
|
15
17
|
times: "STAR",
|
|
16
18
|
multiply: "STAR",
|
|
19
|
+
mul: "STAR",
|
|
17
20
|
divide: "SLASH",
|
|
18
21
|
modulo: "MOD",
|
|
19
22
|
mod: "MOD",
|
|
@@ -65,6 +68,12 @@ var enLocale = {
|
|
|
65
68
|
fround: "FUNC",
|
|
66
69
|
hypot: "FUNC",
|
|
67
70
|
imul: "FUNC",
|
|
71
|
+
sind: "FUNC",
|
|
72
|
+
cosd: "FUNC",
|
|
73
|
+
tand: "FUNC",
|
|
74
|
+
asind: "FUNC",
|
|
75
|
+
acosd: "FUNC",
|
|
76
|
+
atand: "FUNC",
|
|
68
77
|
log10: "FUNC",
|
|
69
78
|
log1p: "FUNC",
|
|
70
79
|
log2: "FUNC",
|
|
@@ -119,10 +128,15 @@ var enLocale = {
|
|
|
119
128
|
// sum(/total(/average( fusion), so `:map = [...]`/`:sum = 100`/etc.
|
|
120
129
|
// keep working as ordinary variable names.
|
|
121
130
|
clamp: "CLAMP",
|
|
131
|
+
// `into` is a third spelling of the conversion operator, alongside `to` and
|
|
132
|
+
// `in`. It reads better before a unit than either ("300 cm into m"), and
|
|
133
|
+
// costs nothing: it is not a plausible variable name and has no other
|
|
134
|
+
// meaning in the grammar.
|
|
122
135
|
convert: "CONVERT",
|
|
123
136
|
to: "TO",
|
|
124
137
|
best: "BEST",
|
|
125
138
|
in: "IN",
|
|
139
|
+
into: "IN",
|
|
126
140
|
next: "NEXT",
|
|
127
141
|
last: "LAST",
|
|
128
142
|
until: "UNTIL",
|
|
@@ -143,6 +157,15 @@ var enLocale = {
|
|
|
143
157
|
// see Token.ts's OVER/RATE_AT doc comment.
|
|
144
158
|
over: "OVER",
|
|
145
159
|
at: "RATE_AT",
|
|
160
|
+
// Only "rounded". Bare "round" is already the round(x) function above.
|
|
161
|
+
rounded: "ROUNDED",
|
|
162
|
+
is: "IS",
|
|
163
|
+
// The investment grammar (packages/finance/). See Token.ts.
|
|
164
|
+
after: "AFTER",
|
|
165
|
+
for: "FOR_DURATION",
|
|
166
|
+
compounding: "COMPOUNDING",
|
|
167
|
+
invested: "INVESTED",
|
|
168
|
+
returned: "RETURNED",
|
|
146
169
|
by: "BY",
|
|
147
170
|
vec2: "VEC2",
|
|
148
171
|
vec3: "VEC3",
|
|
@@ -190,7 +213,7 @@ var deLocale = {
|
|
|
190
213
|
e: "E",
|
|
191
214
|
plus: "PLUS",
|
|
192
215
|
add: "PLUS",
|
|
193
|
-
und: "
|
|
216
|
+
und: "AND_CONJ",
|
|
194
217
|
minus: "MINUS",
|
|
195
218
|
subtract: "MINUS",
|
|
196
219
|
entfernen: "MINUS",
|
|
@@ -286,7 +309,7 @@ var frLocale = {
|
|
|
286
309
|
e: "E",
|
|
287
310
|
plus: "PLUS",
|
|
288
311
|
ajouter: "PLUS",
|
|
289
|
-
et: "
|
|
312
|
+
et: "AND_CONJ",
|
|
290
313
|
moins: "MINUS",
|
|
291
314
|
soustraire: "MINUS",
|
|
292
315
|
enlever: "MINUS",
|
|
@@ -364,5 +387,5 @@ function getLocale(code) {
|
|
|
364
387
|
}
|
|
365
388
|
|
|
366
389
|
export { getLocale };
|
|
367
|
-
//# sourceMappingURL=chunk-
|
|
368
|
-
//# sourceMappingURL=chunk-
|
|
390
|
+
//# sourceMappingURL=chunk-XBTEO4OB.js.map
|
|
391
|
+
//# sourceMappingURL=chunk-XBTEO4OB.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/constants/locales/en.ts","../src/constants/locales/de.ts","../src/constants/locales/fr.ts","../src/constants/locales/index.ts"],"names":[],"mappings":";AAgBO,IAAM,QAAA,GAAoB;AAAA,EAC/B,IAAA,EAAM,IAAA;AAAA,EACN,KAAA,EAAO,SAAA;AAAA,EACP,UAAA,EAAY;AAAA,IACV,EAAA,EAAI,IAAA;AAAA,IAAM,CAAA,EAAG,GAAA;AAAA,IACb,IAAA,EAAM,MAAA;AAAA,IAAQ,GAAA,EAAK,MAAA;AAAA,IAAQ,GAAA,EAAK,UAAA;AAAA,IAAY,IAAA,EAAM,MAAA;AAAA,IAClD,KAAA,EAAO,OAAA;AAAA,IAAS,QAAA,EAAU,OAAA;AAAA,IAAS,MAAA,EAAQ,OAAA;AAAA,IAAS,IAAA,EAAM,OAAA;AAAA,IAC1D,OAAA,EAAS,OAAA;AAAA,IACT,KAAA,EAAO,MAAA;AAAA,IAAQ,QAAA,EAAU,MAAA;AAAA,IAAQ,GAAA,EAAK,MAAA;AAAA,IACtC,MAAA,EAAQ,OAAA;AAAA,IACR,MAAA,EAAQ,KAAA;AAAA,IAAO,GAAA,EAAK,KAAA;AAAA,IACpB,QAAA,EAAU,OAAA;AAAA,IAAS,KAAA,EAAO,OAAA;AAAA,IAC1B,GAAA,EAAK,SAAA;AAAA,IACL,EAAA,EAAI,IAAA;AAAA,IACJ,GAAA,EAAK,KAAA;AAAA,IAAO,KAAA,EAAO,OAAA;AAAA,IAAS,QAAA,EAAU,UAAA;AAAA,IAAY,SAAA,EAAW,WAAA;AAAA,IAC7D,IAAA,EAAM,MAAA;AAAA,IACN,IAAA,EAAM,MAAA;AAAA,IAAQ,GAAA,E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A;AAAA,IAClC,IAAA,EAAM,MAAA;AAAA,IAAQ,IAAA,EAAM,OAAA;AAAA,IACpB,EAAA,EAAI,IAAA;AAAA,IAAM,KAAA,EAAO,MAAA;AAAA,IAAQ,KAAA,EAAO;AAAA,GAClC;AAAA,EACA,OAAA,EAAS;AAAA,IACP,YAAA,EAAc,IAAA;AAAA,IACd,UAAA,EAAY,SAAA;AAAA,IACZ,gBAAA,EAAkB,GAAA;AAAA,IAClB,kBAAA,EAAoB,GAAA;AAAA,IACpB,YAAA,EAAc,YAAA;AAAA,IACd,gBAAA,EAAkB;AAAA;AAEtB,CAAA;;;AC7DA,IAAM,OAAA,GAAmC;AAAA,EACvC,EAAA,EAAI,QAAA;AAAA,EACJ,EAAA,EAAI,QAAA;AAAA,EACJ,EAAA,EAAI;AACN,CAAA;AAUO,SAAS,UAAU,IAAA,EAAuB;AAC/C,EAAA,OAAO,OAAA,CAAQ,IAAI,CAAA,IAAK,QAAA;AAC1B","file":"chunk-XBTEO4OB.js","sourcesContent":["/** What a locale supplies: keywords, units, and number formatting conventions. */\nexport interface ILocale {\n code: string;\n label: string;\n keywordMap: Record<string, string>;\n display: {\n resultPrefix: string;\n dateFormat: string;\n decimalSeparator: string;\n thousandsSeparator: string;\n vectorFormat: string;\n percentageSuffix: string;\n };\n}\n\n/** English keywords, units and number formatting. The default and the fallback. */\nexport const enLocale: ILocale = {\n code: \"en\",\n label: \"English\",\n keywordMap: {\n pi: \"PI\", e: \"E\",\n plus: \"PLUS\", add: \"PLUS\", and: \"AND_CONJ\", with: \"PLUS\",\n minus: \"MINUS\", subtract: \"MINUS\", remove: \"MINUS\", take: \"MINUS\",\n without: \"MINUS\",\n times: \"STAR\", multiply: \"STAR\", mul: \"STAR\",\n divide: \"SLASH\",\n modulo: \"MOD\", mod: \"MOD\",\n exponent: \"CARET\", prime: \"CARET\",\n xor: \"BIT_XOR\",\n of: \"OF\",\n now: \"NOW\", today: \"TODAY\", tomorrow: \"TOMORROW\", yesterday: \"YESTERDAY\",\n roll: \"ROLL\",\n sqrt: \"FUNC\", abs: \"FUNC\", sin: \"FUNC\", cos: \"FUNC\", tan: \"FUNC\",\n log: \"FUNC\", ceil: \"FUNC\", floor: \"FUNC\", round: \"FUNC\", min: \"FUNC\", max: \"FUNC\",\n asin: \"FUNC\", acos: \"FUNC\", atan: \"FUNC\", atan2: \"FUNC\",\n // Long-form aliases for asin/acos/atan (Numi/older-calculator naming\n // convention). Same FunctionCallParselet indices, not new behavior.\n arcsin: \"FUNC\", arccos: \"FUNC\", arctan: \"FUNC\",\n sinh: \"FUNC\", cosh: \"FUNC\", tanh: \"FUNC\",\n asinh: \"FUNC\", acosh: \"FUNC\", atanh: \"FUNC\",\n cbrt: \"FUNC\", clz32: \"FUNC\", expm1: \"FUNC\", exp: \"FUNC\",\n // root(n, x) -- n-th root; fact/factorial(n) -- factorial. Bare FUNC\n // keywords, matching gcd/lcm/cbrt's precedent above (technical,\n // call-syntax-only names, not plausible :variableName choices).\n root: \"FUNC\", fact: \"FUNC\", factorial: \"FUNC\",\n fround: \"FUNC\", hypot: \"FUNC\", imul: \"FUNC\",\n sind: \"FUNC\", cosd: \"FUNC\", tand: \"FUNC\",\n asind: \"FUNC\", acosd: \"FUNC\", atand: \"FUNC\",\n log10: \"FUNC\", log1p: \"FUNC\", log2: \"FUNC\",\n pow: \"FUNC\", random: \"FUNC\", sign: \"FUNC\", trunc: \"FUNC\",\n degtorad: \"FUNC\", radtodeg: \"FUNC\",\n gcd: \"FUNC\", lcm: \"FUNC\", permutation: \"FUNC\", combination: \"FUNC\",\n // hex/bin double as CONVERTER_NAME below (\"255 as hex\") AND as FUNC\n // call-syntax (\"hex(255)\"), a word can only have one lexer token\n // type, so these win FUNC (removed from the CONVERTER_NAME list\n // below) and AsConverterParselet.ts's \"as <name>\" check was widened\n // to also accept a FUNC-typed token, preserving \"as hex\"/\"as bin\"\n // unchanged. See AsConverterParselet.ts's class doc for the full\n // reasoning.\n hex: \"FUNC\", bin: \"FUNC\", int: \"FUNC\",\n // Finance (packages/finance/) function-call forms. Bare keywords, not\n // phrase-fused, these are camelCase call-only names (e.g.\n // \"compoundInterest(...)\"), not natural-language words a user would\n // plausibly choose as a variable name, so the bare-keyword collision\n // risk that blocks \"interest\"/\"tax\"/\"principal\" etc. doesn't apply here\n // (matches \"gcd\"/\"lcm\"/... above, not \"clamp\" below).\n compoundinterest: \"FUNC\", interestearned: \"FUNC\",\n compoundinterestrate: \"FUNC\", compoundinterestyears: \"FUNC\",\n loanrepayment: \"FUNC\", loaninterest: \"FUNC\", monthlypayment: \"FUNC\",\n taxadd: \"FUNC\", taxremove: \"FUNC\",\n // Inflation-adjusted value function-call form (packages/finance/).\n inflationadjust: \"FUNC\",\n // Matrix (packages/matrix/) function-call forms -- also reachable via\n // `^T`/`^-1` operator syntax and `|a|` (see FunctionCallParselet.ts's\n // builtinNameToIndex comment for indices 63-66).\n transpose: \"FUNC\", det: \"FUNC\", inv: \"FUNC\", dot: \"FUNC\",\n // map/reduce/sum/prod (packages/mapreduce/) are NOT bare keywordMap\n // entries. See packages/mapreduce/normalizer/MapReduceCallNormalizerRule.ts\n // which fuses them ONLY when immediately followed by \"(\" (same\n // \"conditional-on-LPAREN\" pattern as packages/lines/'s own\n // sum(/total(/average( fusion), so `:map = [...]`/`:sum = 100`/etc.\n // keep working as ordinary variable names.\n clamp: \"CLAMP\",\n // `into` is a third spelling of the conversion operator, alongside `to` and\n // `in`. It reads better before a unit than either (\"300 cm into m\"), and\n // costs nothing: it is not a plausible variable name and has no other\n // meaning in the grammar.\n convert: \"CONVERT\", to: \"TO\", best: \"BEST\", in: \"IN\", into: \"IN\",\n next: \"NEXT\", last: \"LAST\", until: \"UNTIL\", since: \"SINCE\",\n sunday: \"SUNDAY\", monday: \"MONDAY\", tuesday: \"TUESDAY\", wednesday: \"WEDNESDAY\",\n thursday: \"THURSDAY\", friday: \"FRIDAY\", saturday: \"SATURDAY\",\n between: \"BETWEEN\", from: \"FROM\",\n increase: \"INCREASE\", decrease: \"DECREASE\",\n // Finance (packages/finance/) phrase-grammar connectors. Bare\n // prepositions, same accepted-risk category as \"between\"/\"from\" above\n // see Token.ts's OVER/RATE_AT doc comment.\n over: \"OVER\", at: \"RATE_AT\",\n // Only \"rounded\". Bare \"round\" is already the round(x) function above.\n rounded: \"ROUNDED\",\n is: \"IS\",\n // The investment grammar (packages/finance/). See Token.ts.\n after: \"AFTER\", for: \"FOR_DURATION\", compounding: \"COMPOUNDING\",\n invested: \"INVESTED\", returned: \"RETURNED\",\n by: \"BY\",\n vec2: \"VEC2\", vec3: \"VEC3\", vec4: \"VEC4\",\n float: \"FLOAT\",\n global: \"GLOBAL\",\n or: \"OR\",\n true: \"TRUE\", false: \"FALSE\",\n if: \"IF\", then: \"THEN\", else: \"ELSE\",\n as: \"AS\",\n percent: \"CONVERTER_NAME\", percentage: \"CONVERTER_NAME\",\n decimal: \"CONVERTER_NAME\", dec: \"CONVERTER_NAME\", number: \"CONVERTER_NAME\",\n fraction: \"CONVERTER_NAME\",\n multiplier: \"CONVERTER_NAME\",\n sci: \"CONVERTER_NAME\", scientific: \"CONVERTER_NAME\",\n // hex/bin are FUNC (see above), not CONVERTER_NAME, \"as hex\"/\"as bin\"\n // still work via AsConverterParselet.ts's widened token-type check.\n binary: \"CONVERTER_NAME\",\n octal: \"CONVERTER_NAME\", oct: \"CONVERTER_NAME\",\n },\n display: {\n resultPrefix: \"= \",\n dateFormat: \"default\",\n decimalSeparator: \".\",\n thousandsSeparator: \",\",\n vectorFormat: \"[{values}]\",\n percentageSuffix: \"%\",\n },\n};\n","import { ILocale } from \"./en\";\n\n/** German keywords, units and number formatting. */\nexport const deLocale: ILocale = {\n code: \"de\",\n label: \"Deutsch\",\n keywordMap: {\n pi: \"PI\", e: \"E\",\n plus: \"PLUS\", add: \"PLUS\", und: \"AND_CONJ\",\n minus: \"MINUS\", subtract: \"MINUS\", entfernen: \"MINUS\", nehmen: \"MINUS\",\n mal: \"STAR\", multiplizieren: \"STAR\",\n teilen: \"SLASH\",\n modulo: \"MOD\", mod: \"MOD\",\n exponent: \"CARET\", potenz: \"CARET\",\n von: \"OF\",\n jetzt: \"NOW\", heute: \"TODAY\", morgen: \"TOMORROW\", gestern: \"YESTERDAY\",\n rollen: \"ROLL\",\n wurzel: \"FUNC\", abs: \"FUNC\", sin: \"FUNC\", cos: \"FUNC\", tan: \"FUNC\",\n log: \"FUNC\", aufrunden: \"FUNC\", abrunden: \"FUNC\", runden: \"FUNC\", min: \"FUNC\", max: \"FUNC\",\n asin: \"FUNC\", acos: \"FUNC\", atan: \"FUNC\", atan2: \"FUNC\",\n sinh: \"FUNC\", cosh: \"FUNC\", tanh: \"FUNC\",\n asinh: \"FUNC\", acosh: \"FUNC\", atanh: \"FUNC\",\n kubikwurzel: \"FUNC\", clz32: \"FUNC\", expm1: \"FUNC\", exp: \"FUNC\",\n fround: \"FUNC\", hypot: \"FUNC\", imul: \"FUNC\",\n log10: \"FUNC\", log1p: \"FUNC\", log2: \"FUNC\",\n pow: \"FUNC\", zufall: \"FUNC\", zeichen: \"FUNC\", ganzzahl: \"FUNC\",\n degtorad: \"FUNC\", radtodeg: \"FUNC\",\n konvertieren: \"CONVERT\", in: \"TO\", amBesten: \"BEST\",\n naechste: \"NEXT\", letzte: \"LAST\", bis: \"UNTIL\", seit: \"SINCE\",\n sonntag: \"SUNDAY\", montag: \"MONDAY\", dienstag: \"TUESDAY\", mittwoch: \"WEDNESDAY\",\n donnerstag: \"THURSDAY\", freitag: \"FRIDAY\", samstag: \"SATURDAY\",\n zwischen: \"BETWEEN\",\n von_ab: \"FROM\",\n erhoehen: \"INCREASE\", verringern: \"DECREASE\",\n vec2: \"VEC2\", vec3: \"VEC3\", vec4: \"VEC4\",\n },\n display: {\n resultPrefix: \"= \",\n dateFormat: \"default\",\n decimalSeparator: \",\",\n thousandsSeparator: \".\",\n vectorFormat: \"[{values}]\",\n percentageSuffix: \"%\",\n },\n};","import { ILocale } from \"./en\";\n\n/**\n * French locale. See GitHub issue #77 (\"Please allow for localized day\n * of the week\"). Matches `de.ts`'s scope, not `en.ts`'s full coverage: a\n * confident, reviewed core set (arithmetic words, date keywords, weekday\n * names, a handful of common functions), not a guess at every FUNC/phrase\n * keyword across every package. Widening this is a good first issue for\n * a native French speaker, PRs welcome, same as this project's existing\n * convention for locale gaps.\n *\n * \"aujourd'hui\" (today) is deliberately spelled without its apostrophe\n * here (`aujourdhui`), `ExpressionLexer`'s identifier reader only\n * accepts `[a-zA-Z_][a-zA-Z0-9_]*` plus Unicode, so the standard spelling\n * can't lex as a single IDENT token at all. This is a real, disclosed\n * limitation, not a translation choice, anyone typing the standard\n * apostrophed spelling won't get a match today.\n */\nexport const frLocale: ILocale = {\n code: \"fr\",\n label: \"Français\",\n keywordMap: {\n pi: \"PI\", e: \"E\",\n plus: \"PLUS\", ajouter: \"PLUS\", et: \"AND_CONJ\",\n moins: \"MINUS\", soustraire: \"MINUS\", enlever: \"MINUS\",\n fois: \"STAR\", multiplier: \"STAR\",\n diviser: \"SLASH\",\n modulo: \"MOD\", mod: \"MOD\",\n exposant: \"CARET\", puissance: \"CARET\",\n xor: \"BIT_XOR\",\n maintenant: \"NOW\",\n // \"aujourd'hui\". See this file's own doc comment for why the\n // apostrophe is dropped here.\n aujourdhui: \"TODAY\",\n demain: \"TOMORROW\", hier: \"YESTERDAY\",\n lancer: \"ROLL\",\n // Same spellings as English on purpose, not a translation gap: the\n // FUNC token's NAME is looked up in a separate, locale-independent\n // dispatch table (FunctionCallParselet.ts's builtinNameToIndex) that\n // only knows English names, \"racine\" (root) would lex fine as a\n // FUNC token via this keywordMap but then fail at call time with\n // \"Unknown function\", so it's deliberately left out rather than\n // shipped half-working. Widening that dispatch table to be\n // locale-aware is a separate, larger change (it would need the same\n // fix for German too, \"wurzel\" has this identical problem today).\n abs: \"FUNC\", sin: \"FUNC\", cos: \"FUNC\", tan: \"FUNC\",\n log: \"FUNC\", min: \"FUNC\", max: \"FUNC\",\n convertir: \"CONVERT\",\n prochain: \"NEXT\", dernier: \"LAST\",\n dimanche: \"SUNDAY\", lundi: \"MONDAY\", mardi: \"TUESDAY\", mercredi: \"WEDNESDAY\",\n jeudi: \"THURSDAY\", vendredi: \"FRIDAY\", samedi: \"SATURDAY\",\n entre: \"BETWEEN\",\n augmenter: \"INCREASE\", diminuer: \"DECREASE\",\n vec2: \"VEC2\", vec3: \"VEC3\", vec4: \"VEC4\",\n vrai: \"TRUE\", faux: \"FALSE\",\n si: \"IF\", alors: \"THEN\", sinon: \"ELSE\",\n },\n display: {\n resultPrefix: \"= \",\n dateFormat: \"default\",\n decimalSeparator: \",\",\n thousandsSeparator: \" \",\n vectorFormat: \"[{values}]\",\n percentageSuffix: \"%\",\n },\n};\n","import { enLocale, type ILocale } from \"./en\";\nimport { deLocale } from \"./de\";\nimport { frLocale } from \"./fr\";\n\nconst locales: Record<string, ILocale> = {\n en: enLocale,\n de: deLocale,\n fr: frLocale,\n};\n\n/**\n * Look up a locale by code.\n *\n * @param code - Locale code, for example `\"en\"` or `\"de\"`.\n * @returns The locale, or English when the code is unknown. Falling back\n * rather than throwing means an unrecognised code degrades to a working engine\n * instead of a dead one.\n */\nexport function getLocale(code: string): ILocale {\n return locales[code] || enLocale;\n}\n\n/**\n * Add a locale, or replace one already registered under the same code.\n *\n * @param code - Locale code to register under.\n * @param locale - Keywords, units and formatting for that locale.\n */\nexport function registerLocale(code: string, locale: ILocale): void {\n locales[code] = locale;\n}\n\nexport { enLocale, deLocale, frLocale, type ILocale };"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { currencyExchangeService } from './chunk-
|
|
1
|
+
import { currencyExchangeService } from './chunk-UKPGSAZW.js';
|
|
2
2
|
import { numberValue } from './chunk-BVAR5J2F.js';
|
|
3
3
|
|
|
4
4
|
// src/parser/OperandWidth.ts
|
|
@@ -92,5 +92,5 @@ var CurrencyAsyncResolver = class {
|
|
|
92
92
|
};
|
|
93
93
|
|
|
94
94
|
export { CurrencyAsyncResolver, nextInstruction };
|
|
95
|
-
//# sourceMappingURL=chunk-
|
|
96
|
-
//# sourceMappingURL=chunk-
|
|
95
|
+
//# sourceMappingURL=chunk-YU2CUNFO.js.map
|
|
96
|
+
//# sourceMappingURL=chunk-YU2CUNFO.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/parser/OperandWidth.ts","../src/uom/CurrencyResolver.ts"],"names":[],"mappings":";;;;AAwBA,IAAM,WAAA,GAAiC;AAAA,EAAA,EAAA;AAAA,EAAA,EAAA;AAAA,EAAA,EAAA;AAAA,EAAA,EAAA;AAAA,EAAA,EAAA;AAAA,EAAA,EAAA;AAAA,EAAA,EAAA;AAAA,EAAA,EAAA;AAAA,EAAA,EAAA;AAAA,EAAA,GAAA;AAWvC,CAAA;AAOA,IAAM,YAAA,GAAkC;AAAA,EAAA,EAAA;AAAA,EAAA,EAAA;AAAA,EAAA,GAAA;AAAA,EAAA,GAAA;AAKxC,CAAA;AAQA,IAAM,iBAAoC,CAAA,GAAA,mBAAA,GAAA,qBAAwC;AAQ3E,IAAM,iBAAoC,MAAM;AACtD,EAAA,MAAM,SAAS,IAAI,KAAA,CAAc,GAAG,CAAA,CAAE,KAAK,CAAC,CAAA;AAC5C,EAAA,KAAA,MAAW,EAAA,IAAM,WAAA,EAAa,MAAA,CAAO,EAAE,CAAA,GAAI,CAAA;AAC3C,EAAA,KAAA,MAAW,EAAA,IAAM,YAAA,EAAc,MAAA,CAAO,EAAE,CAAA,GAAI,CAAA;AAC5C,EAAA,KAAA,MAAW,EAAA,IAAM,cAAA,EAAgB,MAAA,CAAO,EAAE,CAAA,GAAI,CAAA;AAC9C,EAAA,OAAO,MAAA;AACR,CAAA,GAAG;AAOqD;AAAA,EACvD,GAAG,WAAA;AAAA,EACH,GAAG,YAAA;AAAA,EACH,GAAG;AACJ;AAaO,SAAS,eAAA,CAAgB,SAAqB,KAAA,EAAuB;AAC3E,EAAA,OAAO,QAAQ,CAAA,IAAK,aAAA,CAAc,OA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XJBK.js","sourcesContent":["/**\n * How many operand bytes follow each opcode, and how to step over one.\n *\n * Anything walking a bytecode stream without executing it needs this: the\n * resolver preflight scanners look for specific opcodes and must skip past\n * everything else without mistaking an operand byte for an instruction.\n *\n * It used to be a hand-copied switch in each of those scanners. They had\n * already drifted: two counted `CALL_PLUGIN` as three bytes wide and the third\n * omitted it from that arm, so a stream containing one desynchronised there and\n * every opcode after it was read at the wrong offset. Adding an opcode meant\n * remembering every copy, and nothing checked that you had.\n *\n * `__tests__/parser/OperandWidth.spec.ts` asserts every opcode has a width, so\n * a new one fails a test rather than silently defaulting to zero operands.\n */\n\nimport { OpCode } from \"@solve-js/parser/OpCode\";\n\n/**\n * Opcodes taking one operand byte.\n *\n * A constant-pool index, or a variable-name index.\n */\nconst ONE_OPERAND: readonly OpCode[] = [\n\tOpCode.PUSH_NUMBER,\n\tOpCode.PUSH_BIGINT,\n\tOpCode.PUSH_HEX,\n\tOpCode.PUSH_STRING,\n\tOpCode.PUSH_BOOLEAN,\n\tOpCode.LOAD_VAR,\n\tOpCode.STORE_VAR,\n\tOpCode.LOAD_GLOBAL_VAR,\n\tOpCode.STORE_GLOBAL_VAR,\n\tOpCode.DEFINE_USER_FUNCTION,\n];\n\n/**\n * Opcodes taking two operand bytes.\n *\n * A callable index plus an argument count, or a matrix's row and column counts.\n */\nconst TWO_OPERANDS: readonly OpCode[] = [\n\tOpCode.CALL_PLUGIN,\n\tOpCode.CALL_BUILTIN,\n\tOpCode.CALL_USER_FUNCTION,\n\tOpCode.MAT_NEW,\n];\n\n/**\n * Opcodes taking three operand bytes.\n *\n * The map and reduce invocations, which carry a body index alongside their\n * other operands.\n */\nconst THREE_OPERANDS: readonly OpCode[] = [OpCode.MAP_INVOKE, OpCode.REDUCE_INVOKE];\n\n/**\n * Operand byte count for every opcode, indexed by opcode value.\n *\n * A dense array rather than a map, because the preflight scanners run on every\n * keystroke and this is read once per instruction.\n */\nexport const OPERAND_BYTES: readonly number[] = (() => {\n\tconst widths = new Array<number>(256).fill(0);\n\tfor (const op of ONE_OPERAND) widths[op] = 1;\n\tfor (const op of TWO_OPERANDS) widths[op] = 2;\n\tfor (const op of THREE_OPERANDS) widths[op] = 3;\n\treturn widths;\n})();\n\n/**\n * Every opcode that takes at least one operand.\n *\n * Exported so a test can assert the table stays complete as opcodes are added.\n */\nexport const OPCODES_WITH_OPERANDS: readonly OpCode[] = [\n\t...ONE_OPERAND,\n\t...TWO_OPERANDS,\n\t...THREE_OPERANDS,\n];\n\n/**\n * Offset of the instruction after the one at `index`.\n *\n * @param opcodes - The bytecode stream.\n * @param index - Offset of an opcode, not of an operand byte. Passing an\n * operand offset yields nonsense, which is the failure mode this exists to\n * prevent: a caller stepping by hand and getting one width wrong reads the rest\n * of the stream misaligned.\n * @returns Offset of the next opcode. May be past the end when the instruction\n * at `index` is the last one, so callers loop while it is under `opcodes.length`.\n */\nexport function nextInstruction(opcodes: Uint8Array, index: number): number {\n\treturn index + 1 + (OPERAND_BYTES[opcodes[index]] ?? 0);\n}\n","/**\n * Currency async resolver, bridges CurrencyExchangeService to the\n * IAsyncResolver interface for the Suspense architecture.\n *\n * Uses TanStack Query (injected via queryClient) as the single cache layer.\n */\nimport type { QueryClient } from \"@tanstack/query-core\";\nimport type { Token } from \"@solve-js/lexer\";\nimport type { BytecodeProgram } from \"@solve-js/parser/BytecodeBuilder\";\nimport { OpCode } from \"@solve-js/parser/OpCode\";\nimport { numberValue } from \"@solve-js/vm/Value\";\nimport {\n\tcurrencyExchangeService,\n\tCurrencyExchangeService,\n} from \"@solve-js/uom/CurrencyExchange\";\nimport type { IAsyncResolver, AsyncCheckResult } from \"@solve-js/resolvers/ResolverRegistry\";\nimport { nextInstruction } from \"@solve-js/parser/OperandWidth\";\n\nconst CURRENCY_NS = \"currency\";\n\n/**\n * Fetches exchange rates before the VM runs, so a conversion has real numbers.\n *\n * Until rates arrive the line evaluates to a pending value rather than a\n * guessed one, and re-evaluates when they land.\n */\nexport class CurrencyAsyncResolver implements IAsyncResolver {\n\treadonly namespace = CURRENCY_NS;\n\n\tprivate exchange: CurrencyExchangeService;\n\n\tconstructor(exchange?: CurrencyExchangeService) {\n\t\tthis.exchange = exchange ?? currencyExchangeService;\n\t}\n\n\tpreflight(_tokens: Token[], bytecode: BytecodeProgram, packageId: string, signal: AbortSignal, queryClient: QueryClient): AsyncCheckResult | null {\n\t\tconst { opcodes, strings } = bytecode;\n\t\tconst len = opcodes.length;\n\t\tlet i = 0;\n\n\t\tlet lastStrIdx = -1;\n\t\tlet prevStrIdx = -1;\n\n\t\twhile (i < len) {\n\t\t\tconst op = opcodes[i] as OpCode;\n\n\t\t\tif (op === OpCode.PUSH_STRING) {\n\t\t\t\tprevStrIdx = lastStrIdx;\n\t\t\t\tlastStrIdx = opcodes[i + 1];\n\t\t\t}\n\n\t\t\t// Explicit \"X to Y\"/\"X in Y\" conversions (UOM_CONVERT_IN/_TO) are\n\t\t\t// the obvious case, but arithmetic directly on two differently-\n\t\t\t// denominated currency literals, \"0.01 BTC + 1 ETH\", needs the\n\t\t\t// exact same preflight fetch and previously never got it: this\n\t\t\t// scanner only looked for the CONVERT opcodes, so ADD/SUB/MUL/DIV\n\t\t\t// between two currency UOMs skipped preflight entirely, ran with\n\t\t\t// no cached rate, and fell through to the VM's silent-wrong-math\n\t\t\t// fallback instead of ever reaching a network fetch.\n\t\t\tconst isCurrencyCombiningOp =\n\t\t\t\top === OpCode.UOM_CONVERT_IN || op === OpCode.UOM_CONVERT_TO ||\n\t\t\t\top === OpCode.ADD || op === OpCode.SUB || op === OpCode.MUL || op === OpCode.DIV;\n\t\t\tif (isCurrencyCombiningOp) {\n\t\t\t\tif (prevStrIdx >= 0 && lastStrIdx >= 0) {\n\t\t\t\t\tconst fromUnit = strings[prevStrIdx];\n\t\t\t\t\tconst toUnit = strings[lastStrIdx];\n\n\t\t\t\t\tif (\n\t\t\t\t\t\tthis.exchange.isCurrency(fromUnit) &&\n\t\t\t\t\t\tthis.exchange.isCurrency(toUnit) &&\n\t\t\t\t\t\tfromUnit.toUpperCase() !== toUnit.toUpperCase()\n\t\t\t\t\t) {\n\t\t\t\t\t\tconst syncRate = this.exchange.getRateSync(fromUnit, toUnit);\n\t\t\t\t\t\tif (syncRate === null) {\n\t\t\t\t\t\t\tconst fromUpper = fromUnit.toUpperCase();\n\t\t\t\t\t\t\tconst toUpper = toUnit.toUpperCase();\n\n\t\t\t\t\t\t\t// Check TanStack Query cache\n\t\t\t\t\t\t\tconst cacheKey = [CURRENCY_NS, fromUpper, toUpper];\n\t\t\t\t\t\t\tif (queryClient.getQueryData(cacheKey) !== undefined) {\n\t\t\t\t\t\t\t\ti++;\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Fetch via TanStack Query (dedup + retry automatic)\n\t\t\t\t\t\t\tconst resolver = queryClient.fetchQuery({\n\t\t\t\t\t\t\t\tqueryKey: cacheKey,\n\t\t\t\t\t\t\t\tqueryFn: ({ signal: qSignal }) => {\n\t\t\t\t\t\t\t\t\treturn this.exchange.getRate(fromUnit, toUnit, qSignal).then((rate) => numberValue(rate));\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tstaleTime: 5 * 60 * 1000,\n\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\treturn { queryKey: cacheKey.join(\":\"), resolver, packageId, signal, metadata: { fromUnit, toUnit } };\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Step over this instruction and its operands. Shared table, because\n\t\t\t// three hand-copied versions of this had already drifted.\n\t\t\ti = nextInstruction(opcodes, i);\n\t\t}\n\n\t\treturn null;\n\t}\n\n\tdestroy(): void {\n\t\t// Cache cleared by ResolverRegistry.unregister() via removeQueries({ queryKey: [\"currency\"] })\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/parser/OperandWidth.ts","../src/uom/CurrencyResolver.ts"],"names":[],"mappings":";;;;AAwBA,IAAM,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AAO,WAAA,EAAY;AAGnC,cAAA,MAAM,QAAA,GAAW,CAAC,WAAA,EAAa,SAAA,EAAW,OAAO,CAAA;AACjD,cAAA,IAAI,WAAA,CAAY,YAAA,CAAa,QAAQ,CAAA,KAAM,MAAA,EAAW;AACrD,gBAAA,CAAA,EAAA;AACA,gBAAA;AAAA,cACD;AAGA,cAAA,MAAM,QAAA,GAAW,YAAY,UAAA,CAAW;AAAA,gBACvC,QAAA,EAAU,QAAA;AAAA,gBACV,OAAA,EAAS,CAAC,EAAE,MAAA,EAAQ,SAAQ,KAAM;AACjC,kBAAA,OAAO,IAAA,CAAK,QAAA,CAAS,OAAA,CAAQ,QAAA,EAAU,MAAA,EAAQ,OAAO,CAAA,CAAE,IAAA,CAAK,CAAC,IAAA,KAAS,WAAA,CAAY,IAAI,CAAC,CAAA;AAAA,gBACzF,CAAA;AAAA,gBACA,SAAA,EAAW,IAAI,EAAA,GAAK;AAAA,eACpB,CAAA;AAED,cAAA,OAAO,EAAE,QAAA,EAAU,QAAA,CAAS,IAAA,CAAK,GAAG,CAAA,EAAG,QAAA,EAAU,SAAA,EAAW,MAAA,EAAQ,QAAA,EAAU,EAAE,QAAA,EAAU,QAAO,EAAE;AAAA,YACpG;AAAA,UACD;AAAA,QACD;AAAA,MACD;AAIA,MAAA,CAAA,GAAI,eAAA,CAAgB,SAAS,CAAC,CAAA;AAAA,IAC/B;AAEA,IAAA,OAAO,IAAA;AAAA,EACR;AAAA,EAEA,OAAA,GAAgB;AAAA,EAEhB;AACD","file":"chunk-YU2CUNFO.js","sourcesContent":["/**\n * How many operand bytes follow each opcode, and how to step over one.\n *\n * Anything walking a bytecode stream without executing it needs this: the\n * resolver preflight scanners look for specific opcodes and must skip past\n * everything else without mistaking an operand byte for an instruction.\n *\n * It used to be a hand-copied switch in each of those scanners. They had\n * already drifted: two counted `CALL_PLUGIN` as three bytes wide and the third\n * omitted it from that arm, so a stream containing one desynchronised there and\n * every opcode after it was read at the wrong offset. Adding an opcode meant\n * remembering every copy, and nothing checked that you had.\n *\n * `__tests__/parser/OperandWidth.spec.ts` asserts every opcode has a width, so\n * a new one fails a test rather than silently defaulting to zero operands.\n */\n\nimport { OpCode } from \"@solve-js/parser/OpCode\";\n\n/**\n * Opcodes taking one operand byte.\n *\n * A constant-pool index, or a variable-name index.\n */\nconst ONE_OPERAND: readonly OpCode[] = [\n\tOpCode.PUSH_NUMBER,\n\tOpCode.PUSH_BIGINT,\n\tOpCode.PUSH_HEX,\n\tOpCode.PUSH_STRING,\n\tOpCode.PUSH_BOOLEAN,\n\tOpCode.LOAD_VAR,\n\tOpCode.STORE_VAR,\n\tOpCode.LOAD_GLOBAL_VAR,\n\tOpCode.STORE_GLOBAL_VAR,\n\tOpCode.DEFINE_USER_FUNCTION,\n];\n\n/**\n * Opcodes taking two operand bytes.\n *\n * A callable index plus an argument count, or a matrix's row and column counts.\n */\nconst TWO_OPERANDS: readonly OpCode[] = [\n\tOpCode.CALL_PLUGIN,\n\tOpCode.CALL_BUILTIN,\n\tOpCode.CALL_USER_FUNCTION,\n\tOpCode.MAT_NEW,\n];\n\n/**\n * Opcodes taking three operand bytes.\n *\n * The map and reduce invocations, which carry a body index alongside their\n * other operands.\n */\nconst THREE_OPERANDS: readonly OpCode[] = [OpCode.MAP_INVOKE, OpCode.REDUCE_INVOKE];\n\n/**\n * Operand byte count for every opcode, indexed by opcode value.\n *\n * A dense array rather than a map, because the preflight scanners run on every\n * keystroke and this is read once per instruction.\n */\nexport const OPERAND_BYTES: readonly number[] = (() => {\n\tconst widths = new Array<number>(256).fill(0);\n\tfor (const op of ONE_OPERAND) widths[op] = 1;\n\tfor (const op of TWO_OPERANDS) widths[op] = 2;\n\tfor (const op of THREE_OPERANDS) widths[op] = 3;\n\treturn widths;\n})();\n\n/**\n * Every opcode that takes at least one operand.\n *\n * Exported so a test can assert the table stays complete as opcodes are added.\n */\nexport const OPCODES_WITH_OPERANDS: readonly OpCode[] = [\n\t...ONE_OPERAND,\n\t...TWO_OPERANDS,\n\t...THREE_OPERANDS,\n];\n\n/**\n * Offset of the instruction after the one at `index`.\n *\n * @param opcodes - The bytecode stream.\n * @param index - Offset of an opcode, not of an operand byte. Passing an\n * operand offset yields nonsense, which is the failure mode this exists to\n * prevent: a caller stepping by hand and getting one width wrong reads the rest\n * of the stream misaligned.\n * @returns Offset of the next opcode. May be past the end when the instruction\n * at `index` is the last one, so callers loop while it is under `opcodes.length`.\n */\nexport function nextInstruction(opcodes: Uint8Array, index: number): number {\n\treturn index + 1 + (OPERAND_BYTES[opcodes[index]] ?? 0);\n}\n","/**\n * Currency async resolver, bridges CurrencyExchangeService to the\n * IAsyncResolver interface for the Suspense architecture.\n *\n * Uses TanStack Query (injected via queryClient) as the single cache layer.\n */\nimport type { QueryClient } from \"@tanstack/query-core\";\nimport type { Token } from \"@solve-js/lexer\";\nimport type { BytecodeProgram } from \"@solve-js/parser/BytecodeBuilder\";\nimport { OpCode } from \"@solve-js/parser/OpCode\";\nimport { numberValue } from \"@solve-js/vm/Value\";\nimport {\n\tcurrencyExchangeService,\n\tCurrencyExchangeService,\n} from \"@solve-js/uom/CurrencyExchange\";\nimport type { IAsyncResolver, AsyncCheckResult } from \"@solve-js/resolvers/ResolverRegistry\";\nimport { nextInstruction } from \"@solve-js/parser/OperandWidth\";\n\nconst CURRENCY_NS = \"currency\";\n\n/**\n * Fetches exchange rates before the VM runs, so a conversion has real numbers.\n *\n * Until rates arrive the line evaluates to a pending value rather than a\n * guessed one, and re-evaluates when they land.\n */\nexport class CurrencyAsyncResolver implements IAsyncResolver {\n\treadonly namespace = CURRENCY_NS;\n\n\tprivate exchange: CurrencyExchangeService;\n\n\tconstructor(exchange?: CurrencyExchangeService) {\n\t\tthis.exchange = exchange ?? currencyExchangeService;\n\t}\n\n\tpreflight(_tokens: Token[], bytecode: BytecodeProgram, packageId: string, signal: AbortSignal, queryClient: QueryClient): AsyncCheckResult | null {\n\t\tconst { opcodes, strings } = bytecode;\n\t\tconst len = opcodes.length;\n\t\tlet i = 0;\n\n\t\tlet lastStrIdx = -1;\n\t\tlet prevStrIdx = -1;\n\n\t\twhile (i < len) {\n\t\t\tconst op = opcodes[i] as OpCode;\n\n\t\t\tif (op === OpCode.PUSH_STRING) {\n\t\t\t\tprevStrIdx = lastStrIdx;\n\t\t\t\tlastStrIdx = opcodes[i + 1];\n\t\t\t}\n\n\t\t\t// Explicit \"X to Y\"/\"X in Y\" conversions (UOM_CONVERT_IN/_TO) are\n\t\t\t// the obvious case, but arithmetic directly on two differently-\n\t\t\t// denominated currency literals, \"0.01 BTC + 1 ETH\", needs the\n\t\t\t// exact same preflight fetch and previously never got it: this\n\t\t\t// scanner only looked for the CONVERT opcodes, so ADD/SUB/MUL/DIV\n\t\t\t// between two currency UOMs skipped preflight entirely, ran with\n\t\t\t// no cached rate, and fell through to the VM's silent-wrong-math\n\t\t\t// fallback instead of ever reaching a network fetch.\n\t\t\tconst isCurrencyCombiningOp =\n\t\t\t\top === OpCode.UOM_CONVERT_IN || op === OpCode.UOM_CONVERT_TO ||\n\t\t\t\top === OpCode.ADD || op === OpCode.SUB || op === OpCode.MUL || op === OpCode.DIV;\n\t\t\tif (isCurrencyCombiningOp) {\n\t\t\t\tif (prevStrIdx >= 0 && lastStrIdx >= 0) {\n\t\t\t\t\tconst fromUnit = strings[prevStrIdx];\n\t\t\t\t\tconst toUnit = strings[lastStrIdx];\n\n\t\t\t\t\tif (\n\t\t\t\t\t\tthis.exchange.isCurrency(fromUnit) &&\n\t\t\t\t\t\tthis.exchange.isCurrency(toUnit) &&\n\t\t\t\t\t\tfromUnit.toUpperCase() !== toUnit.toUpperCase()\n\t\t\t\t\t) {\n\t\t\t\t\t\tconst syncRate = this.exchange.getRateSync(fromUnit, toUnit);\n\t\t\t\t\t\tif (syncRate === null) {\n\t\t\t\t\t\t\tconst fromUpper = fromUnit.toUpperCase();\n\t\t\t\t\t\t\tconst toUpper = toUnit.toUpperCase();\n\n\t\t\t\t\t\t\t// Check TanStack Query cache\n\t\t\t\t\t\t\tconst cacheKey = [CURRENCY_NS, fromUpper, toUpper];\n\t\t\t\t\t\t\tif (queryClient.getQueryData(cacheKey) !== undefined) {\n\t\t\t\t\t\t\t\ti++;\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Fetch via TanStack Query (dedup + retry automatic)\n\t\t\t\t\t\t\tconst resolver = queryClient.fetchQuery({\n\t\t\t\t\t\t\t\tqueryKey: cacheKey,\n\t\t\t\t\t\t\t\tqueryFn: ({ signal: qSignal }) => {\n\t\t\t\t\t\t\t\t\treturn this.exchange.getRate(fromUnit, toUnit, qSignal).then((rate) => numberValue(rate));\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tstaleTime: 5 * 60 * 1000,\n\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\treturn { queryKey: cacheKey.join(\":\"), resolver, packageId, signal, metadata: { fromUnit, toUnit } };\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Step over this instruction and its operands. Shared table, because\n\t\t\t// three hand-copied versions of this had already drifted.\n\t\t\ti = nextInstruction(opcodes, i);\n\t\t}\n\n\t\treturn null;\n\t}\n\n\tdestroy(): void {\n\t\t// Cache cleared by ResolverRegistry.unregister() via removeQueries({ queryKey: [\"currency\"] })\n\t}\n}\n"]}
|
package/dist/constants.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkAZUA3F4I_cjs = require('./chunk-AZUA3F4I.cjs');
|
|
4
4
|
require('./chunk-M4N5GA5Z.cjs');
|
|
5
5
|
require('./chunk-B7LXJ6LC.cjs');
|
|
6
6
|
|
|
@@ -8,15 +8,15 @@ require('./chunk-B7LXJ6LC.cjs');
|
|
|
8
8
|
|
|
9
9
|
Object.defineProperty(exports, "ConfigManager", {
|
|
10
10
|
enumerable: true,
|
|
11
|
-
get: function () { return
|
|
11
|
+
get: function () { return chunkAZUA3F4I_cjs.ConfigManager; }
|
|
12
12
|
});
|
|
13
13
|
Object.defineProperty(exports, "DEFAULT_CONFIG", {
|
|
14
14
|
enumerable: true,
|
|
15
|
-
get: function () { return
|
|
15
|
+
get: function () { return chunkAZUA3F4I_cjs.DEFAULT_CONFIG; }
|
|
16
16
|
});
|
|
17
17
|
Object.defineProperty(exports, "ENGINE_VERSION", {
|
|
18
18
|
enumerable: true,
|
|
19
|
-
get: function () { return
|
|
19
|
+
get: function () { return chunkAZUA3F4I_cjs.ENGINE_VERSION; }
|
|
20
20
|
});
|
|
21
21
|
//# sourceMappingURL=constants.cjs.map
|
|
22
22
|
//# sourceMappingURL=constants.cjs.map
|
package/dist/constants.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { ConfigManager, DEFAULT_CONFIG, ENGINE_VERSION } from './chunk-
|
|
1
|
+
export { ConfigManager, DEFAULT_CONFIG, ENGINE_VERSION } from './chunk-VZH3NOLP.js';
|
|
2
2
|
import './chunk-6RDSQURE.js';
|
|
3
3
|
import './chunk-YLJ4XMA6.js';
|
|
4
4
|
//# sourceMappingURL=constants.js.map
|
package/dist/engine.cjs
CHANGED
|
@@ -1,35 +1,34 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('./chunk-
|
|
3
|
+
var chunk73GSBGUU_cjs = require('./chunk-73GSBGUU.cjs');
|
|
4
|
+
require('./chunk-MTX2KVU7.cjs');
|
|
5
5
|
require('./chunk-NGBBNL4K.cjs');
|
|
6
6
|
require('./chunk-X6K3HUOY.cjs');
|
|
7
7
|
require('./chunk-5X2PTP6F.cjs');
|
|
8
|
-
require('./chunk-
|
|
8
|
+
require('./chunk-QDMPOAI7.cjs');
|
|
9
9
|
require('./chunk-47LRVGOT.cjs');
|
|
10
|
-
require('./chunk-
|
|
11
|
-
require('./chunk-
|
|
12
|
-
require('./chunk-
|
|
10
|
+
require('./chunk-CSG5XVNJ.cjs');
|
|
11
|
+
require('./chunk-NZFKROS7.cjs');
|
|
12
|
+
require('./chunk-AHCLWAM5.cjs');
|
|
13
13
|
require('./chunk-N5YFR4UP.cjs');
|
|
14
|
-
require('./chunk-
|
|
14
|
+
require('./chunk-4AVD7NZW.cjs');
|
|
15
15
|
require('./chunk-Z2XP767T.cjs');
|
|
16
|
-
require('./chunk-
|
|
16
|
+
require('./chunk-BXKJLM5R.cjs');
|
|
17
17
|
require('./chunk-FEAIOR7N.cjs');
|
|
18
|
-
require('./chunk-
|
|
18
|
+
require('./chunk-2MV4HBKC.cjs');
|
|
19
19
|
require('./chunk-MZOVP3WI.cjs');
|
|
20
20
|
require('./chunk-VEKIWQ3F.cjs');
|
|
21
|
-
require('./chunk-
|
|
22
|
-
require('./chunk-HTXVVJRA.cjs');
|
|
21
|
+
require('./chunk-4CVLFLOB.cjs');
|
|
23
22
|
require('./chunk-OC6LTXYS.cjs');
|
|
24
|
-
require('./chunk-
|
|
25
|
-
require('./chunk-
|
|
26
|
-
require('./chunk-
|
|
27
|
-
require('./chunk-
|
|
28
|
-
require('./chunk-
|
|
29
|
-
require('./chunk-
|
|
30
|
-
require('./chunk-
|
|
31
|
-
require('./chunk-
|
|
32
|
-
require('./chunk-
|
|
23
|
+
require('./chunk-NJTXJ5AG.cjs');
|
|
24
|
+
require('./chunk-AZUA3F4I.cjs');
|
|
25
|
+
require('./chunk-WWOLFXTX.cjs');
|
|
26
|
+
require('./chunk-TY3TLZAW.cjs');
|
|
27
|
+
require('./chunk-M4F66R4O.cjs');
|
|
28
|
+
require('./chunk-R24DI24X.cjs');
|
|
29
|
+
require('./chunk-OUHT5Z36.cjs');
|
|
30
|
+
require('./chunk-CLVQBF5C.cjs');
|
|
31
|
+
require('./chunk-MBNQVDVC.cjs');
|
|
33
32
|
require('./chunk-M4N5GA5Z.cjs');
|
|
34
33
|
require('./chunk-B7LXJ6LC.cjs');
|
|
35
34
|
|
|
@@ -37,43 +36,43 @@ require('./chunk-B7LXJ6LC.cjs');
|
|
|
37
36
|
|
|
38
37
|
Object.defineProperty(exports, "AsyncResolutionBatcher", {
|
|
39
38
|
enumerable: true,
|
|
40
|
-
get: function () { return
|
|
39
|
+
get: function () { return chunk73GSBGUU_cjs.AsyncResolutionBatcher; }
|
|
41
40
|
});
|
|
42
41
|
Object.defineProperty(exports, "DocumentModel", {
|
|
43
42
|
enumerable: true,
|
|
44
|
-
get: function () { return
|
|
43
|
+
get: function () { return chunk73GSBGUU_cjs.DocumentModel; }
|
|
45
44
|
});
|
|
46
45
|
Object.defineProperty(exports, "EvalTier", {
|
|
47
46
|
enumerable: true,
|
|
48
|
-
get: function () { return
|
|
47
|
+
get: function () { return chunk73GSBGUU_cjs.EvalTier; }
|
|
49
48
|
});
|
|
50
49
|
Object.defineProperty(exports, "ExpressionEngine", {
|
|
51
50
|
enumerable: true,
|
|
52
|
-
get: function () { return
|
|
51
|
+
get: function () { return chunk73GSBGUU_cjs.ExpressionEngine; }
|
|
53
52
|
});
|
|
54
53
|
Object.defineProperty(exports, "ThreeTierEvaluator", {
|
|
55
54
|
enumerable: true,
|
|
56
|
-
get: function () { return
|
|
55
|
+
get: function () { return chunk73GSBGUU_cjs.ThreeTierEvaluator; }
|
|
57
56
|
});
|
|
58
57
|
Object.defineProperty(exports, "checkExpressionComplexity", {
|
|
59
58
|
enumerable: true,
|
|
60
|
-
get: function () { return
|
|
59
|
+
get: function () { return chunk73GSBGUU_cjs.checkExpressionComplexity; }
|
|
61
60
|
});
|
|
62
61
|
Object.defineProperty(exports, "checkExpressionLength", {
|
|
63
62
|
enumerable: true,
|
|
64
|
-
get: function () { return
|
|
63
|
+
get: function () { return chunk73GSBGUU_cjs.checkExpressionLength; }
|
|
65
64
|
});
|
|
66
65
|
Object.defineProperty(exports, "extractReadsAndWrites", {
|
|
67
66
|
enumerable: true,
|
|
68
|
-
get: function () { return
|
|
67
|
+
get: function () { return chunk73GSBGUU_cjs.extractReadsAndWrites; }
|
|
69
68
|
});
|
|
70
69
|
Object.defineProperty(exports, "findInlineSolvesInLine", {
|
|
71
70
|
enumerable: true,
|
|
72
|
-
get: function () { return
|
|
71
|
+
get: function () { return chunk73GSBGUU_cjs.findInlineSolvesInLine; }
|
|
73
72
|
});
|
|
74
73
|
Object.defineProperty(exports, "isEmptyLine", {
|
|
75
74
|
enumerable: true,
|
|
76
|
-
get: function () { return
|
|
75
|
+
get: function () { return chunk73GSBGUU_cjs.isEmptyLine; }
|
|
77
76
|
});
|
|
78
77
|
//# sourceMappingURL=engine.cjs.map
|
|
79
78
|
//# sourceMappingURL=engine.cjs.map
|
package/dist/engine.d.cts
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { D as DocumentModel, a as ExpressionEngine, V as ViewportRange, c as LineChange, d as InlineSolvePosition } from './PackageRegistry-
|
|
2
|
-
export { A as ApplyChangesResult, e as AsyncCachePackageInfo, f as AsyncErrorEvent, g as AsyncResolutionBatcher, h as AsyncResolutionEvent, B as BatcherMetrics, i as BytecodeCacheEntry, C as CacheSnapshot, j as CheckpointSnapshot, E as EvalResults, k as LineCacheEntryInfo, L as LineEvaluation, l as LineState, m as LinesUpdatedEvent } from './PackageRegistry-
|
|
1
|
+
import { D as DocumentModel, a as ExpressionEngine, V as ViewportRange, c as LineChange, d as InlineSolvePosition } from './PackageRegistry-pHtKythi.cjs';
|
|
2
|
+
export { A as ApplyChangesResult, e as AsyncCachePackageInfo, f as AsyncErrorEvent, g as AsyncResolutionBatcher, h as AsyncResolutionEvent, B as BatcherMetrics, i as BytecodeCacheEntry, C as CacheSnapshot, j as CheckpointSnapshot, E as EvalResults, k as LineCacheEntryInfo, L as LineEvaluation, l as LineState, m as LinesUpdatedEvent } from './PackageRegistry-pHtKythi.cjs';
|
|
3
3
|
import { V as Value } from './Value-KtAQNHur.cjs';
|
|
4
4
|
import { a as VMCheckpointer } from './VMCheckpoints-CqFuLwrT.cjs';
|
|
5
|
-
import { T as Token } from './Token-
|
|
5
|
+
import { T as Token } from './Token-BzG5G4ja.cjs';
|
|
6
6
|
import { E as EngineError } from './EngineError-DvPSnhZi.cjs';
|
|
7
7
|
import { a as BytecodeProgram } from './BytecodeBuilder-3egMyuDi.cjs';
|
|
8
8
|
export { a as DagSnapshot } from './ScopeManager-CKfQtl7l.cjs';
|
|
9
|
-
import './Parselet-
|
|
9
|
+
import './Parselet-Cu0bLSis.cjs';
|
|
10
10
|
import './pipeline-DPUQt7yL.cjs';
|
|
11
11
|
import './variables.cjs';
|
|
12
|
-
import './Lexer-
|
|
12
|
+
import './Lexer-Cfm79Dak.cjs';
|
|
13
13
|
import './resolvers.cjs';
|
|
14
14
|
import '@tanstack/query-core';
|
|
15
|
-
import './TokenNormalizer-
|
|
15
|
+
import './TokenNormalizer-DGVa24Q-.cjs';
|
|
16
16
|
import './Configuration-fVpd-HC-.cjs';
|
|
17
17
|
|
|
18
18
|
/**
|
package/dist/engine.d.ts
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { D as DocumentModel, a as ExpressionEngine, V as ViewportRange, c as LineChange, d as InlineSolvePosition } from './PackageRegistry-
|
|
2
|
-
export { A as ApplyChangesResult, e as AsyncCachePackageInfo, f as AsyncErrorEvent, g as AsyncResolutionBatcher, h as AsyncResolutionEvent, B as BatcherMetrics, i as BytecodeCacheEntry, C as CacheSnapshot, j as CheckpointSnapshot, E as EvalResults, k as LineCacheEntryInfo, L as LineEvaluation, l as LineState, m as LinesUpdatedEvent } from './PackageRegistry-
|
|
1
|
+
import { D as DocumentModel, a as ExpressionEngine, V as ViewportRange, c as LineChange, d as InlineSolvePosition } from './PackageRegistry-CjDt-Jy_.js';
|
|
2
|
+
export { A as ApplyChangesResult, e as AsyncCachePackageInfo, f as AsyncErrorEvent, g as AsyncResolutionBatcher, h as AsyncResolutionEvent, B as BatcherMetrics, i as BytecodeCacheEntry, C as CacheSnapshot, j as CheckpointSnapshot, E as EvalResults, k as LineCacheEntryInfo, L as LineEvaluation, l as LineState, m as LinesUpdatedEvent } from './PackageRegistry-CjDt-Jy_.js';
|
|
3
3
|
import { V as Value } from './Value-KtAQNHur.js';
|
|
4
4
|
import { a as VMCheckpointer } from './VMCheckpoints-BmDwIXgK.js';
|
|
5
|
-
import { T as Token } from './Token-
|
|
5
|
+
import { T as Token } from './Token-BzG5G4ja.js';
|
|
6
6
|
import { E as EngineError } from './EngineError-DvPSnhZi.js';
|
|
7
7
|
import { a as BytecodeProgram } from './BytecodeBuilder-3egMyuDi.js';
|
|
8
8
|
export { a as DagSnapshot } from './ScopeManager-B5k0nk05.js';
|
|
9
|
-
import './Parselet-
|
|
9
|
+
import './Parselet-DEdF9I7n.js';
|
|
10
10
|
import './pipeline-CrsRPmsv.js';
|
|
11
11
|
import './variables.js';
|
|
12
|
-
import './Lexer-
|
|
12
|
+
import './Lexer-W9MBOP0V.js';
|
|
13
13
|
import './resolvers.js';
|
|
14
14
|
import '@tanstack/query-core';
|
|
15
|
-
import './TokenNormalizer-
|
|
15
|
+
import './TokenNormalizer-t_GotBxr.js';
|
|
16
16
|
import './Configuration-fVpd-HC-.js';
|
|
17
17
|
|
|
18
18
|
/**
|
package/dist/engine.js
CHANGED
|
@@ -1,33 +1,32 @@
|
|
|
1
|
-
export { AsyncResolutionBatcher, DocumentModel, EvalTier, ExpressionEngine, ThreeTierEvaluator, checkExpressionComplexity, checkExpressionLength, extractReadsAndWrites, findInlineSolvesInLine, isEmptyLine } from './chunk-
|
|
2
|
-
import './chunk-
|
|
1
|
+
export { AsyncResolutionBatcher, DocumentModel, EvalTier, ExpressionEngine, ThreeTierEvaluator, checkExpressionComplexity, checkExpressionLength, extractReadsAndWrites, findInlineSolvesInLine, isEmptyLine } from './chunk-TZLCIJWP.js';
|
|
2
|
+
import './chunk-MEOHSQEH.js';
|
|
3
3
|
import './chunk-2RWAXT6O.js';
|
|
4
4
|
import './chunk-3VGDNEE3.js';
|
|
5
5
|
import './chunk-IF532O7C.js';
|
|
6
|
-
import './chunk-
|
|
6
|
+
import './chunk-BAMZT3GL.js';
|
|
7
7
|
import './chunk-G535KJEG.js';
|
|
8
|
-
import './chunk-
|
|
9
|
-
import './chunk-
|
|
10
|
-
import './chunk-
|
|
8
|
+
import './chunk-GVWHCL2N.js';
|
|
9
|
+
import './chunk-6GCKCWLB.js';
|
|
10
|
+
import './chunk-OFXOTECC.js';
|
|
11
11
|
import './chunk-PFSDGGYL.js';
|
|
12
|
-
import './chunk-
|
|
12
|
+
import './chunk-YU2CUNFO.js';
|
|
13
13
|
import './chunk-NLNDMWZC.js';
|
|
14
|
-
import './chunk-
|
|
14
|
+
import './chunk-MVBEL57Q.js';
|
|
15
15
|
import './chunk-GCM5JHMX.js';
|
|
16
|
-
import './chunk-
|
|
16
|
+
import './chunk-UKPGSAZW.js';
|
|
17
17
|
import './chunk-75JP4BZX.js';
|
|
18
18
|
import './chunk-Z4X2RWOF.js';
|
|
19
|
-
import './chunk-
|
|
20
|
-
import './chunk-34RRD7PC.js';
|
|
19
|
+
import './chunk-CYFK5SY2.js';
|
|
21
20
|
import './chunk-BVAR5J2F.js';
|
|
22
|
-
import './chunk-
|
|
23
|
-
import './chunk-
|
|
24
|
-
import './chunk-
|
|
25
|
-
import './chunk-
|
|
26
|
-
import './chunk-
|
|
27
|
-
import './chunk-
|
|
28
|
-
import './chunk-
|
|
29
|
-
import './chunk-
|
|
30
|
-
import './chunk-
|
|
21
|
+
import './chunk-WC5FFSHB.js';
|
|
22
|
+
import './chunk-VZH3NOLP.js';
|
|
23
|
+
import './chunk-2CS6OMZK.js';
|
|
24
|
+
import './chunk-AJA6LUI7.js';
|
|
25
|
+
import './chunk-SFQWJMKT.js';
|
|
26
|
+
import './chunk-GPPLSM2Z.js';
|
|
27
|
+
import './chunk-XBTEO4OB.js';
|
|
28
|
+
import './chunk-M5E34VG5.js';
|
|
29
|
+
import './chunk-PCPX42KL.js';
|
|
31
30
|
import './chunk-6RDSQURE.js';
|
|
32
31
|
import './chunk-YLJ4XMA6.js';
|
|
33
32
|
//# sourceMappingURL=engine.js.map
|