solve-engine 1.1.1 → 2.0.0
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/README.md +12 -17
- package/dist/{BytecodeBuilder-Bp9xeTmX.d.cts → BytecodeBuilder-DGGeByAP.d.cts} +18 -0
- package/dist/{BytecodeBuilder-Bp9xeTmX.d.ts → BytecodeBuilder-DGGeByAP.d.ts} +18 -0
- package/dist/{Configuration-C9W8tJv_.d.cts → Configuration-B6W0-T67.d.cts} +17 -4
- package/dist/{Configuration-C9W8tJv_.d.ts → Configuration-B6W0-T67.d.ts} +17 -4
- package/dist/{EngineError-B61GS1jp.d.cts → EngineError-Ce1lPkjZ.d.cts} +8 -0
- package/dist/{EngineError-B61GS1jp.d.ts → EngineError-Ce1lPkjZ.d.ts} +8 -0
- package/dist/{Lexer-BOs7euZe.d.cts → Lexer-B4C1qHXu.d.cts} +1 -1
- package/dist/{Lexer-CSI_lwbW.d.ts → Lexer-DKMlj7Sy.d.ts} +1 -1
- package/dist/{PackageCompatibility-B-7rK1TD.d.cts → PackageCompatibility-Bn5jnBtA.d.cts} +2 -2
- package/dist/{PackageCompatibility-Dh59eF-X.d.ts → PackageCompatibility-CIvq2MP5.d.ts} +2 -2
- package/dist/{PackageRegistry-_8rDlvxI.d.ts → PackageRegistry-DzeiWcv4.d.ts} +143 -175
- package/dist/{PackageRegistry-BHWJP83F.d.cts → PackageRegistry-dpdurBVO.d.cts} +143 -175
- package/dist/{Parselet-BBT8riYh.d.ts → Parselet-B-zoPrTa.d.ts} +9 -6
- package/dist/{Parselet-BHcgK9S7.d.cts → Parselet-C4Wu055_.d.cts} +9 -6
- package/dist/{ScopeManager-CxA24W5n.d.ts → ScopeManager-C2LDOrDx.d.ts} +14 -16
- package/dist/{ScopeManager-8vf02dwj.d.cts → ScopeManager-D7uMXbhS.d.cts} +14 -16
- package/dist/{Token-B1hdkedD.d.cts → Token-CbP_OutD.d.cts} +9 -0
- package/dist/{Token-B1hdkedD.d.ts → Token-CbP_OutD.d.ts} +9 -0
- package/dist/{TokenNormalizer-C6VzZgHa.d.ts → TokenNormalizer-DCWdZjGz.d.ts} +1 -1
- package/dist/{TokenNormalizer-DRc1Js1V.d.cts → TokenNormalizer-DnlL7_8c.d.cts} +1 -1
- package/dist/{VMCheckpoints-MK--EBH2.d.ts → VMCheckpoints-CGyFhivM.d.ts} +3 -3
- package/dist/{VMCheckpoints-ELYqITdF.d.cts → VMCheckpoints-I9jg3jWR.d.cts} +3 -3
- package/dist/{Value-BUi1RA3S.d.cts → Value-CCi_Eecs.d.cts} +72 -5
- package/dist/{Value-BUi1RA3S.d.ts → Value-CCi_Eecs.d.ts} +72 -5
- package/dist/{WorkerError-gzmaopj2.d.cts → WorkerError-B4p6PNfx.d.cts} +1 -1
- package/dist/{WorkerError-_-RkoQ5P.d.ts → WorkerError-Dhj9BQ_A.d.ts} +1 -1
- package/dist/chunk-2JMFUQZH.js +2 -0
- package/dist/chunk-2JMFUQZH.js.map +1 -0
- package/dist/chunk-2RWAXT6O.js +0 -1
- package/dist/chunk-4BZIYU7S.cjs +3 -0
- package/dist/chunk-4BZIYU7S.cjs.map +1 -0
- package/dist/chunk-4J7XZSZJ.cjs +5 -0
- package/dist/chunk-4J7XZSZJ.cjs.map +1 -0
- package/dist/chunk-4QVBSG6B.cjs +2 -0
- package/dist/chunk-4QVBSG6B.cjs.map +1 -0
- package/dist/chunk-5IJD5L3O.cjs +2 -0
- package/dist/chunk-5IJD5L3O.cjs.map +1 -0
- package/dist/chunk-62LMTO4F.js +2 -0
- package/dist/chunk-62LMTO4F.js.map +1 -0
- package/dist/chunk-6CY44ZPG.js +2 -0
- package/dist/chunk-6CY44ZPG.js.map +1 -0
- package/dist/chunk-6G3PMEPA.js +2 -0
- package/dist/chunk-6G3PMEPA.js.map +1 -0
- package/dist/chunk-6INX773F.cjs +2 -0
- package/dist/chunk-6INX773F.cjs.map +1 -0
- package/dist/chunk-6KFVG6UY.cjs +2 -0
- package/dist/chunk-6KFVG6UY.cjs.map +1 -0
- package/dist/chunk-76F3LCIL.js +4 -0
- package/dist/chunk-76F3LCIL.js.map +1 -0
- package/dist/chunk-7GK3XEZF.js +2 -0
- package/dist/chunk-7GK3XEZF.js.map +1 -0
- package/dist/chunk-APN442VD.cjs +2 -0
- package/dist/chunk-APN442VD.cjs.map +1 -0
- package/dist/chunk-AXMQG5TS.cjs +2 -0
- package/dist/chunk-AXMQG5TS.cjs.map +1 -0
- package/dist/chunk-CIQOK7Q4.cjs +2 -0
- package/dist/chunk-CIQOK7Q4.cjs.map +1 -0
- package/dist/chunk-E6Z4NQAS.js +2 -0
- package/dist/chunk-E6Z4NQAS.js.map +1 -0
- package/dist/chunk-EFJCC6FJ.cjs +2 -0
- package/dist/chunk-EFJCC6FJ.cjs.map +1 -0
- package/dist/chunk-ESUN2THE.cjs +2 -0
- package/dist/chunk-ESUN2THE.cjs.map +1 -0
- package/dist/chunk-EVAOPEO4.js +2 -0
- package/dist/chunk-EVAOPEO4.js.map +1 -0
- package/dist/chunk-EYRBENHC.js +3 -0
- package/dist/chunk-EYRBENHC.js.map +1 -0
- package/dist/chunk-FDE5HWDI.cjs +2 -0
- package/dist/chunk-FDE5HWDI.cjs.map +1 -0
- package/dist/chunk-FWW3M36J.cjs +2 -0
- package/dist/chunk-FWW3M36J.cjs.map +1 -0
- package/dist/chunk-GOIQYUWV.js +2 -0
- package/dist/chunk-GOIQYUWV.js.map +1 -0
- package/dist/chunk-HFKDWQUL.js +2 -0
- package/dist/chunk-HFKDWQUL.js.map +1 -0
- package/dist/chunk-HLBYHXQD.cjs +3 -0
- package/dist/chunk-HLBYHXQD.cjs.map +1 -0
- package/dist/chunk-IANAMBJQ.cjs +2 -0
- package/dist/chunk-IANAMBJQ.cjs.map +1 -0
- package/dist/chunk-IJMNVBIS.js +2 -0
- package/dist/chunk-IJMNVBIS.js.map +1 -0
- package/dist/chunk-J4LZD4ZY.js +3 -0
- package/dist/chunk-J4LZD4ZY.js.map +1 -0
- package/dist/chunk-JAK3RAFA.cjs +2 -0
- package/dist/chunk-JAK3RAFA.cjs.map +1 -0
- package/dist/chunk-JFAJN3C2.cjs +2 -0
- package/dist/chunk-JFAJN3C2.cjs.map +1 -0
- package/dist/chunk-JPFCXLJV.js +2 -0
- package/dist/chunk-JPFCXLJV.js.map +1 -0
- package/dist/chunk-JSPKKNPQ.js +3 -0
- package/dist/chunk-JSPKKNPQ.js.map +1 -0
- package/dist/chunk-L3FPQSGN.js +2 -0
- package/dist/chunk-L3FPQSGN.js.map +1 -0
- package/dist/chunk-LR4E4A4W.cjs +2 -0
- package/dist/chunk-LR4E4A4W.cjs.map +1 -0
- package/dist/chunk-MIQBJGGR.js +2 -0
- package/dist/chunk-MIQBJGGR.js.map +1 -0
- package/dist/chunk-MPB7KUN5.js +3 -0
- package/dist/chunk-MPB7KUN5.js.map +1 -0
- package/dist/chunk-MSYX32PF.cjs +2 -0
- package/dist/chunk-MSYX32PF.cjs.map +1 -0
- package/dist/chunk-MVZUTETT.js +2 -0
- package/dist/chunk-MVZUTETT.js.map +1 -0
- package/dist/chunk-N7N7MPMK.cjs +2 -0
- package/dist/chunk-N7N7MPMK.cjs.map +1 -0
- package/dist/chunk-NGBBNL4K.cjs +1 -3
- package/dist/chunk-P6WPEUAJ.cjs +2 -0
- package/dist/chunk-P6WPEUAJ.cjs.map +1 -0
- package/dist/chunk-PS272DZJ.cjs +2 -0
- package/dist/chunk-PS272DZJ.cjs.map +1 -0
- package/dist/chunk-QXQE7X4S.js +2 -0
- package/dist/chunk-QXQE7X4S.js.map +1 -0
- package/dist/chunk-R2ENWQ76.js +2 -0
- package/dist/chunk-R2ENWQ76.js.map +1 -0
- package/dist/chunk-R2SZFJTT.cjs +2 -0
- package/dist/chunk-R2SZFJTT.cjs.map +1 -0
- package/dist/chunk-RAF57WYO.js +2 -0
- package/dist/chunk-RAF57WYO.js.map +1 -0
- package/dist/chunk-RSF25YSJ.js +2 -0
- package/dist/chunk-RSF25YSJ.js.map +1 -0
- package/dist/chunk-SOMGSIO4.cjs +3 -0
- package/dist/chunk-SOMGSIO4.cjs.map +1 -0
- package/dist/chunk-SUXRZWH2.cjs +3 -0
- package/dist/chunk-SUXRZWH2.cjs.map +1 -0
- package/dist/chunk-SYYE3QAX.cjs +2 -0
- package/dist/chunk-SYYE3QAX.cjs.map +1 -0
- package/dist/chunk-SZGK6RIP.cjs +2 -0
- package/dist/chunk-SZGK6RIP.cjs.map +1 -0
- package/dist/chunk-TCZSPH4A.js +2 -0
- package/dist/chunk-TCZSPH4A.js.map +1 -0
- package/dist/chunk-TLG7VZRX.cjs +2 -0
- package/dist/chunk-TLG7VZRX.cjs.map +1 -0
- package/dist/chunk-TRBXW6HW.js +2 -0
- package/dist/{chunk-AQNHHJMJ.cjs.map → chunk-TRBXW6HW.js.map} +1 -1
- package/dist/chunk-TTFO4YDP.cjs +2 -0
- package/dist/chunk-TTFO4YDP.cjs.map +1 -0
- package/dist/chunk-TWC7K3ZX.js +2 -0
- package/dist/chunk-TWC7K3ZX.js.map +1 -0
- package/dist/chunk-UDQ57ZRX.cjs +2 -0
- package/dist/chunk-UDQ57ZRX.cjs.map +1 -0
- package/dist/chunk-UI6IFGBT.js +2 -0
- package/dist/chunk-UI6IFGBT.js.map +1 -0
- package/dist/chunk-UURM7P3P.cjs +4 -0
- package/dist/chunk-UURM7P3P.cjs.map +1 -0
- package/dist/chunk-W2JAR233.js +2 -0
- package/dist/chunk-W2JAR233.js.map +1 -0
- package/dist/chunk-WGZ3FNHI.js +2 -0
- package/dist/chunk-WGZ3FNHI.js.map +1 -0
- package/dist/chunk-WN5CMP4T.cjs +3 -0
- package/dist/chunk-WN5CMP4T.cjs.map +1 -0
- package/dist/chunk-XEIDV5JP.js +2 -0
- package/dist/chunk-XEIDV5JP.js.map +1 -0
- package/dist/chunk-XNIWQHXY.js +2 -0
- package/dist/chunk-XNIWQHXY.js.map +1 -0
- package/dist/chunk-XR7HEC7B.js +5 -0
- package/dist/chunk-XR7HEC7B.js.map +1 -0
- package/dist/chunk-Y7O4D3BJ.cjs +2 -0
- package/dist/chunk-Y7O4D3BJ.cjs.map +1 -0
- package/dist/chunk-YAYBVVG2.js +3 -0
- package/dist/chunk-YAYBVVG2.js.map +1 -0
- package/dist/chunk-YJ2OPULK.js +2 -0
- package/dist/chunk-YJ2OPULK.js.map +1 -0
- package/dist/chunk-YVKHEAFT.js +2 -0
- package/dist/chunk-YVKHEAFT.js.map +1 -0
- package/dist/chunk-ZCNBT44X.cjs +2 -0
- package/dist/chunk-ZCNBT44X.cjs.map +1 -0
- package/dist/chunk-ZLRJ7TDP.cjs +2 -0
- package/dist/chunk-ZLRJ7TDP.cjs.map +1 -0
- package/dist/constants.cjs +1 -21
- package/dist/constants.d.cts +1 -1
- package/dist/constants.d.ts +1 -1
- package/dist/constants.js +1 -4
- package/dist/engine.cjs +1 -94
- package/dist/engine.d.cts +29 -14
- package/dist/engine.d.ts +29 -14
- package/dist/engine.js +1 -37
- package/dist/errors.cjs +1 -105
- package/dist/errors.d.cts +3 -3
- package/dist/errors.d.ts +3 -3
- package/dist/errors.js +1 -4
- package/dist/format.cjs +1 -26
- package/dist/format.d.cts +2 -2
- package/dist/format.d.ts +2 -2
- package/dist/format.js +1 -9
- package/dist/index.cjs +1 -314
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +55 -23
- package/dist/index.d.ts +55 -23
- package/dist/index.js +1 -278
- package/dist/index.js.map +1 -1
- package/dist/language.cjs +1 -369
- package/dist/language.cjs.map +1 -1
- package/dist/language.d.cts +12 -13
- package/dist/language.d.ts +12 -13
- package/dist/language.js +1 -348
- package/dist/language.js.map +1 -1
- package/dist/lexer.cjs +1 -63
- package/dist/lexer.d.cts +3 -3
- package/dist/lexer.d.ts +3 -3
- package/dist/lexer.js +1 -10
- package/dist/normalizer.cjs +1 -39
- package/dist/normalizer.d.cts +3 -3
- package/dist/normalizer.d.ts +3 -3
- package/dist/normalizer.js +1 -10
- package/dist/packages.cjs +1 -128
- package/dist/packages.d.cts +39 -14
- package/dist/packages.d.ts +39 -14
- package/dist/packages.js +1 -23
- package/dist/parser.cjs +1 -54
- package/dist/parser.d.cts +9 -9
- package/dist/parser.d.ts +9 -9
- package/dist/parser.js +1 -9
- package/dist/{pipeline-CtfJtPQc.d.cts → pipeline-72QmQlGx.d.ts} +3 -3
- package/dist/{pipeline-DCd5M6Gk.d.ts → pipeline-DCQicwWX.d.cts} +3 -3
- package/dist/resolvers.cjs +1 -12
- package/dist/resolvers.d.cts +3 -3
- package/dist/resolvers.d.ts +3 -3
- package/dist/resolvers.js +1 -3
- package/dist/services.cjs +1 -20
- package/dist/services.js +1 -3
- package/dist/testing.cjs +3 -477
- package/dist/testing.cjs.map +1 -1
- package/dist/testing.d.cts +12 -13
- package/dist/testing.d.ts +12 -13
- package/dist/testing.js +3 -469
- package/dist/testing.js.map +1 -1
- package/dist/uom.cjs +1 -55
- package/dist/uom.d.cts +3 -3
- package/dist/uom.d.ts +3 -3
- package/dist/uom.js +1 -10
- package/dist/utilities.cjs +1 -36
- package/dist/utilities.js +1 -7
- package/dist/vm.cjs +1 -295
- package/dist/vm.cjs.map +1 -1
- package/dist/vm.d.cts +22 -10
- package/dist/vm.d.ts +22 -10
- package/dist/vm.js +1 -193
- package/dist/vm.js.map +1 -1
- package/dist/worker.cjs +2 -492
- package/dist/worker.cjs.map +1 -1
- package/dist/worker.d.cts +19 -20
- package/dist/worker.d.ts +19 -20
- package/dist/worker.js +2 -483
- package/dist/worker.js.map +1 -1
- package/package.json +1 -13
- package/dist/chunk-267JPOTF.js +0 -406
- package/dist/chunk-267JPOTF.js.map +0 -1
- package/dist/chunk-2TZKENDH.cjs +0 -448
- package/dist/chunk-2TZKENDH.cjs.map +0 -1
- package/dist/chunk-3BOK2LDK.js +0 -17
- package/dist/chunk-3BOK2LDK.js.map +0 -1
- package/dist/chunk-3OWCDIPN.js +0 -215
- package/dist/chunk-3OWCDIPN.js.map +0 -1
- package/dist/chunk-3VGDNEE3.js +0 -84
- package/dist/chunk-3VGDNEE3.js.map +0 -1
- package/dist/chunk-4D6NIHE2.js +0 -451
- package/dist/chunk-4D6NIHE2.js.map +0 -1
- package/dist/chunk-4HQKTMWG.js +0 -7985
- package/dist/chunk-4HQKTMWG.js.map +0 -1
- package/dist/chunk-536WPM2V.cjs +0 -283
- package/dist/chunk-536WPM2V.cjs.map +0 -1
- package/dist/chunk-5HRB36DK.js +0 -405
- package/dist/chunk-5HRB36DK.js.map +0 -1
- package/dist/chunk-5ON7PUAZ.js +0 -12
- package/dist/chunk-5ON7PUAZ.js.map +0 -1
- package/dist/chunk-7KYSUDQO.js +0 -109
- package/dist/chunk-7KYSUDQO.js.map +0 -1
- package/dist/chunk-7ZX6B7SY.cjs +0 -3222
- package/dist/chunk-7ZX6B7SY.cjs.map +0 -1
- package/dist/chunk-ADBA3XBE.cjs +0 -20
- package/dist/chunk-ADBA3XBE.cjs.map +0 -1
- package/dist/chunk-ALYRJ72W.cjs +0 -434
- package/dist/chunk-ALYRJ72W.cjs.map +0 -1
- package/dist/chunk-AMOJYLG2.cjs +0 -1692
- package/dist/chunk-AMOJYLG2.cjs.map +0 -1
- package/dist/chunk-AQNHHJMJ.cjs +0 -261
- package/dist/chunk-B4HBEFTB.cjs +0 -375
- package/dist/chunk-B4HBEFTB.cjs.map +0 -1
- package/dist/chunk-B7LXJ6LC.cjs +0 -36
- package/dist/chunk-B7LXJ6LC.cjs.map +0 -1
- package/dist/chunk-B7NLZMQ3.cjs +0 -74
- package/dist/chunk-B7NLZMQ3.cjs.map +0 -1
- package/dist/chunk-BLI4NIQY.js +0 -98
- package/dist/chunk-BLI4NIQY.js.map +0 -1
- package/dist/chunk-BYJBUL7U.js +0 -499
- package/dist/chunk-BYJBUL7U.js.map +0 -1
- package/dist/chunk-CCBZZQAE.js +0 -312
- package/dist/chunk-CCBZZQAE.js.map +0 -1
- package/dist/chunk-CKQMXMHR.cjs +0 -219
- package/dist/chunk-CKQMXMHR.cjs.map +0 -1
- package/dist/chunk-CUR2WLI4.cjs +0 -507
- package/dist/chunk-CUR2WLI4.cjs.map +0 -1
- package/dist/chunk-DLEBSLF4.js +0 -336
- package/dist/chunk-DLEBSLF4.js.map +0 -1
- package/dist/chunk-E23GZEWL.cjs +0 -209
- package/dist/chunk-E23GZEWL.cjs.map +0 -1
- package/dist/chunk-EJ3ILXX6.cjs +0 -223
- package/dist/chunk-EJ3ILXX6.cjs.map +0 -1
- package/dist/chunk-ENKKJYD3.js +0 -333
- package/dist/chunk-ENKKJYD3.js.map +0 -1
- package/dist/chunk-ENRIK36Q.cjs +0 -94
- package/dist/chunk-ENRIK36Q.cjs.map +0 -1
- package/dist/chunk-ERCOHGXD.js +0 -356
- package/dist/chunk-ERCOHGXD.js.map +0 -1
- package/dist/chunk-FD5ZZHEU.js +0 -92
- package/dist/chunk-FD5ZZHEU.js.map +0 -1
- package/dist/chunk-FEAIOR7N.cjs +0 -91
- package/dist/chunk-FEAIOR7N.cjs.map +0 -1
- package/dist/chunk-GCM5JHMX.js +0 -88
- package/dist/chunk-GCM5JHMX.js.map +0 -1
- package/dist/chunk-GLA4JXBO.js +0 -204
- package/dist/chunk-GLA4JXBO.js.map +0 -1
- package/dist/chunk-HIQ5HSZL.cjs +0 -1923
- package/dist/chunk-HIQ5HSZL.cjs.map +0 -1
- package/dist/chunk-HVRVSI2Z.cjs +0 -829
- package/dist/chunk-HVRVSI2Z.cjs.map +0 -1
- package/dist/chunk-I4GAWIPW.js +0 -825
- package/dist/chunk-I4GAWIPW.js.map +0 -1
- package/dist/chunk-J45BCEZ4.cjs +0 -339
- package/dist/chunk-J45BCEZ4.cjs.map +0 -1
- package/dist/chunk-JG6ZJ2WU.js +0 -1513
- package/dist/chunk-JG6ZJ2WU.js.map +0 -1
- package/dist/chunk-L2TE7PMO.cjs +0 -14
- package/dist/chunk-L2TE7PMO.cjs.map +0 -1
- package/dist/chunk-LHZ6VOA7.js +0 -1764
- package/dist/chunk-LHZ6VOA7.js.map +0 -1
- package/dist/chunk-MN3LHRGV.cjs +0 -8012
- package/dist/chunk-MN3LHRGV.cjs.map +0 -1
- package/dist/chunk-MVTOCRV2.js +0 -213
- package/dist/chunk-MVTOCRV2.js.map +0 -1
- package/dist/chunk-N5NNW4VG.cjs +0 -341
- package/dist/chunk-N5NNW4VG.cjs.map +0 -1
- package/dist/chunk-N7FNVFXW.cjs +0 -32
- package/dist/chunk-N7FNVFXW.cjs.map +0 -1
- package/dist/chunk-NKW7LKYU.js +0 -3185
- package/dist/chunk-NKW7LKYU.js.map +0 -1
- package/dist/chunk-NLNDMWZC.js +0 -31
- package/dist/chunk-NLNDMWZC.js.map +0 -1
- package/dist/chunk-NNQ2TYDF.js +0 -1848
- package/dist/chunk-NNQ2TYDF.js.map +0 -1
- package/dist/chunk-NNZAEUDW.js +0 -6792
- package/dist/chunk-NNZAEUDW.js.map +0 -1
- package/dist/chunk-OUHT5Z36.cjs +0 -393
- package/dist/chunk-OUHT5Z36.cjs.map +0 -1
- package/dist/chunk-QFTDTX6K.cjs +0 -457
- package/dist/chunk-QFTDTX6K.cjs.map +0 -1
- package/dist/chunk-SBUFNJVE.js +0 -258
- package/dist/chunk-SBUFNJVE.js.map +0 -1
- package/dist/chunk-SRGQ72IR.cjs +0 -2800
- package/dist/chunk-SRGQ72IR.cjs.map +0 -1
- package/dist/chunk-SSV46KFA.cjs +0 -112
- package/dist/chunk-SSV46KFA.cjs.map +0 -1
- package/dist/chunk-T6ZYQJ63.cjs +0 -6807
- package/dist/chunk-T6ZYQJ63.cjs.map +0 -1
- package/dist/chunk-UKQHXPGW.js +0 -30
- package/dist/chunk-UKQHXPGW.js.map +0 -1
- package/dist/chunk-UO6BUV6K.js +0 -278
- package/dist/chunk-UO6BUV6K.js.map +0 -1
- package/dist/chunk-V4XG5QF6.js +0 -1685
- package/dist/chunk-V4XG5QF6.js.map +0 -1
- package/dist/chunk-VEKIWQ3F.cjs +0 -39
- package/dist/chunk-VEKIWQ3F.cjs.map +0 -1
- package/dist/chunk-WWQEY7BV.js +0 -67
- package/dist/chunk-WWQEY7BV.js.map +0 -1
- package/dist/chunk-WXEHD6TT.js +0 -2795
- package/dist/chunk-WXEHD6TT.js.map +0 -1
- package/dist/chunk-X6K3HUOY.cjs +0 -86
- package/dist/chunk-X6K3HUOY.cjs.map +0 -1
- package/dist/chunk-XA4CKRML.cjs +0 -316
- package/dist/chunk-XA4CKRML.cjs.map +0 -1
- package/dist/chunk-XBTEO4OB.js +0 -391
- package/dist/chunk-XBTEO4OB.js.map +0 -1
- package/dist/chunk-XIYYHA65.cjs +0 -101
- package/dist/chunk-XIYYHA65.cjs.map +0 -1
- package/dist/chunk-YLJ4XMA6.js +0 -33
- package/dist/chunk-YLJ4XMA6.js.map +0 -1
- package/dist/chunk-YRIKITGF.cjs +0 -1768
- package/dist/chunk-YRIKITGF.cjs.map +0 -1
- package/dist/chunk-Z2XP767T.cjs +0 -35
- package/dist/chunk-Z2XP767T.cjs.map +0 -1
- package/dist/chunk-Z4X2RWOF.js +0 -37
- package/dist/chunk-Z4X2RWOF.js.map +0 -1
- package/dist/chunk-Z7XGGLI2.js +0 -455
- package/dist/chunk-Z7XGGLI2.js.map +0 -1
- package/dist/chunk-ZMW6NU2K.cjs +0 -1516
- package/dist/chunk-ZMW6NU2K.cjs.map +0 -1
- package/dist/chunk-ZVTWQLK4.cjs +0 -459
- package/dist/chunk-ZVTWQLK4.cjs.map +0 -1
- package/dist/variables.cjs +0 -17
- package/dist/variables.cjs.map +0 -1
- package/dist/variables.d.cts +0 -87
- package/dist/variables.d.ts +0 -87
- package/dist/variables.js +0 -4
- package/dist/variables.js.map +0 -1
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
import { a as PrecedenceParser, b as PrefixParselet, I as InfixParselet } from './Parselet-
|
|
2
|
-
import { V as Value, b as ValueType } from './Value-
|
|
3
|
-
import {
|
|
4
|
-
import { M as MarkdownLineType, L as Lexer, e as TokenCategory, c as LexerVocabulary } from './Lexer-CSI_lwbW.js';
|
|
1
|
+
import { a as PrecedenceParser, b as PrefixParselet, I as InfixParselet } from './Parselet-B-zoPrTa.js';
|
|
2
|
+
import { V as Value, b as ValueType } from './Value-CCi_Eecs.js';
|
|
3
|
+
import { M as MarkdownLineType, L as Lexer, e as TokenCategory, c as LexerVocabulary } from './Lexer-DKMlj7Sy.js';
|
|
5
4
|
import { IAsyncResolver } from './resolvers.js';
|
|
6
|
-
import { T as TokenFusion, c as TokenNormalizer, a as NormalizerRule } from './TokenNormalizer-
|
|
7
|
-
import { a as DependencyGraph, V as VM, D as DagSnapshot, b as EngineContext, S as ScopeManager,
|
|
8
|
-
import { a as BytecodeProgram } from './BytecodeBuilder-
|
|
5
|
+
import { T as TokenFusion, c as TokenNormalizer, a as NormalizerRule } from './TokenNormalizer-DCWdZjGz.js';
|
|
6
|
+
import { a as DependencyGraph, V as VM, D as DagSnapshot, b as EngineContext, S as ScopeManager, P as PluginFunctionHandler } from './ScopeManager-C2LDOrDx.js';
|
|
7
|
+
import { a as BytecodeProgram } from './BytecodeBuilder-DGGeByAP.js';
|
|
9
8
|
import { QueryClient } from '@tanstack/query-core';
|
|
10
|
-
import { E as EngineError } from './EngineError-
|
|
11
|
-
import { a as DiagnosticReportJSON, D as DiagnosticPipeline } from './pipeline-
|
|
12
|
-
import { T as Token } from './Token-
|
|
13
|
-
import {
|
|
9
|
+
import { E as EngineError } from './EngineError-Ce1lPkjZ.js';
|
|
10
|
+
import { a as DiagnosticReportJSON, D as DiagnosticPipeline } from './pipeline-72QmQlGx.js';
|
|
11
|
+
import { T as Token } from './Token-CbP_OutD.js';
|
|
12
|
+
import { E as EngineConfigOverride, a as EngineConfig } from './Configuration-B6W0-T67.js';
|
|
14
13
|
|
|
15
14
|
/**
|
|
16
15
|
* One line's compiled bytecode, plus the variables it reads and writes.
|
|
@@ -1444,15 +1443,16 @@ interface EngineRestoreOptions {
|
|
|
1444
1443
|
* Packages to register on the restored engine. This MUST be the same set
|
|
1445
1444
|
* the snapshot was taken with: a snapshot carries compiled bytecode whose
|
|
1446
1445
|
* plugin-function indices and parselet-produced opcodes only line up
|
|
1447
|
-
* against the packages that were present when it was written.
|
|
1448
|
-
*
|
|
1449
|
-
* parameter, so a host
|
|
1446
|
+
* against the packages that were present when it was written. Registers no
|
|
1447
|
+
* packages when omitted, exactly like the constructor's own `packages`
|
|
1448
|
+
* parameter, so a host that snapshotted a full engine passes the same
|
|
1449
|
+
* `BUILTIN_PACKAGES` here that it constructed with.
|
|
1450
1450
|
*/
|
|
1451
1451
|
packages?: IEnginePackage[];
|
|
1452
1452
|
/** Config overrides, merged over `DEFAULT_CONFIG`, as in the constructor. */
|
|
1453
|
-
config?:
|
|
1454
|
-
/** Turn on the diagnostic pipeline, as in the constructor's `
|
|
1455
|
-
|
|
1453
|
+
config?: EngineConfigOverride;
|
|
1454
|
+
/** Turn on the diagnostic pipeline, as in the constructor's `diagnostics`. */
|
|
1455
|
+
diagnostics?: boolean;
|
|
1456
1456
|
/**
|
|
1457
1457
|
* Override the locale the snapshot recorded. Rarely needed: the snapshot's
|
|
1458
1458
|
* own {@link EngineSnapshot.locale} is used by default, so a restored engine
|
|
@@ -1461,17 +1461,23 @@ interface EngineRestoreOptions {
|
|
|
1461
1461
|
locale?: string;
|
|
1462
1462
|
}
|
|
1463
1463
|
/**
|
|
1464
|
-
*
|
|
1464
|
+
* Options for constructing an {@link ExpressionEngine}. Every field is optional.
|
|
1465
1465
|
*
|
|
1466
|
-
*
|
|
1467
|
-
*
|
|
1466
|
+
* An engine registers exactly the {@link EngineOptions.packages} it is given, so
|
|
1467
|
+
* a bundler can tree-shake away every built-in a consumer never imports; pass
|
|
1468
|
+
* `BUILTIN_PACKAGES` (from `solve-engine/packages`) for the full set, a subset
|
|
1469
|
+
* for a slimmer engine, or use {@link createEngine} for the batteries-included
|
|
1470
|
+
* convenience.
|
|
1468
1471
|
*/
|
|
1469
|
-
interface
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1472
|
+
interface EngineOptions {
|
|
1473
|
+
/** BCP-47 locale. Defaults to `"en"`. */
|
|
1474
|
+
locale?: string;
|
|
1475
|
+
/** Packages to register. None when omitted, so nothing but what you pass is bundled. */
|
|
1476
|
+
packages?: IEnginePackage[];
|
|
1477
|
+
/** Config overrides, merged per section over {@link DEFAULT_CONFIG}. */
|
|
1478
|
+
config?: EngineConfigOverride;
|
|
1479
|
+
/** Turn on the diagnostic pipeline (per-stage timing and detail). Defaults to `false`. */
|
|
1480
|
+
diagnostics?: boolean;
|
|
1475
1481
|
}
|
|
1476
1482
|
/**
|
|
1477
1483
|
* Core expression evaluation engine, the top-level orchestrator.
|
|
@@ -1511,17 +1517,38 @@ interface LineEvaluation {
|
|
|
1511
1517
|
* is the intended usage. Reusing a single engine across documents is also fine:
|
|
1512
1518
|
* `clear()` resets it for the next one rather than consuming it.
|
|
1513
1519
|
*
|
|
1520
|
+
* The constructor registers only the packages it is given, so a consumer's
|
|
1521
|
+
* bundler can tree-shake away every built-in they do not use. For the common
|
|
1522
|
+
* "I want everything" case, {@link createEngine} registers the full built-in
|
|
1523
|
+
* set in one call; pass an explicit package list to the constructor when
|
|
1524
|
+
* bundle size matters.
|
|
1525
|
+
*
|
|
1514
1526
|
* @example
|
|
1515
1527
|
* ```typescript
|
|
1516
|
-
* import {
|
|
1517
|
-
* const engine =
|
|
1518
|
-
* const
|
|
1528
|
+
* import { createEngine } from "solve-engine";
|
|
1529
|
+
* const engine = createEngine(); // every built-in package
|
|
1530
|
+
* const value = engine.evaluateExpression("2 + 2 * 10");
|
|
1519
1531
|
* console.log(value.toNumber()); // 22
|
|
1520
1532
|
* ```
|
|
1533
|
+
* @example
|
|
1534
|
+
* ```typescript
|
|
1535
|
+
* // A slimmer engine: only arithmetic and units reach the bundle.
|
|
1536
|
+
* import { ExpressionEngine } from "solve-engine";
|
|
1537
|
+
* import { ARITHMETIC_PACKAGE, UOM_PACKAGE } from "solve-engine/packages";
|
|
1538
|
+
* const engine = new ExpressionEngine({ packages: [ARITHMETIC_PACKAGE, UOM_PACKAGE] });
|
|
1539
|
+
* ```
|
|
1521
1540
|
*/
|
|
1522
1541
|
declare class ExpressionEngine {
|
|
1523
1542
|
private dag;
|
|
1524
1543
|
private lineCache;
|
|
1544
|
+
/**
|
|
1545
|
+
* Names ever used as a running-total target (`total += 5`). A document is
|
|
1546
|
+
* re-parsed top-to-bottom on every keystroke, so each accumulator is reset
|
|
1547
|
+
* to undefined at the start of a batch pass and re-seeds from its opening
|
|
1548
|
+
* `+=`/`-=` this pass, rather than reading its own previous pass's value
|
|
1549
|
+
* (which grew the total without bound). See {@link tryCompoundAssignment}.
|
|
1550
|
+
*/
|
|
1551
|
+
private accumulatorNames;
|
|
1525
1552
|
private scopeManager;
|
|
1526
1553
|
private lexer;
|
|
1527
1554
|
private registry;
|
|
@@ -1549,8 +1576,8 @@ declare class ExpressionEngine {
|
|
|
1549
1576
|
/** Registry of async resolvers from registered packages. */
|
|
1550
1577
|
private resolverRegistry;
|
|
1551
1578
|
/**
|
|
1552
|
-
* Per-package record of contributions made to the
|
|
1553
|
-
* (
|
|
1579
|
+
* Per-package record of contributions made to the engine's registries
|
|
1580
|
+
* (plugin functions, resolver namespaces, token categories), so
|
|
1554
1581
|
* {@link unregisterPackage} can reverse them. Keyed by package name.
|
|
1555
1582
|
*/
|
|
1556
1583
|
private packageContributions;
|
|
@@ -1681,10 +1708,11 @@ declare class ExpressionEngine {
|
|
|
1681
1708
|
* the bytecode-cache benefit on re-evaluation regardless of config.
|
|
1682
1709
|
*/
|
|
1683
1710
|
private cacheBytecode;
|
|
1711
|
+
private pluginFunctionIndexByName;
|
|
1684
1712
|
private builderPool;
|
|
1685
1713
|
private builderPoolIndex;
|
|
1686
1714
|
private lastTelemetry;
|
|
1687
|
-
constructor(
|
|
1715
|
+
constructor(options?: EngineOptions);
|
|
1688
1716
|
/**
|
|
1689
1717
|
* Get the native event stream from the batcher for stream-based consumers.
|
|
1690
1718
|
*
|
|
@@ -1716,7 +1744,6 @@ declare class ExpressionEngine {
|
|
|
1716
1744
|
* - `lexerVocabulary` → engine's isolated lexer (via this.lexer.registerVocabulary)
|
|
1717
1745
|
* - `prefixParselets` → engine's isolated ParseletRegistry
|
|
1718
1746
|
* - `infixParselets` → engine's isolated ParseletRegistry
|
|
1719
|
-
* - `variableSources` → this engine's own variable resolver
|
|
1720
1747
|
*
|
|
1721
1748
|
* Built-in packages (ARITHMETIC, FUNCTION, UOM, etc.) are registered
|
|
1722
1749
|
* via this method during construction. External user packages can also
|
|
@@ -1993,6 +2020,45 @@ declare class ExpressionEngine {
|
|
|
1993
2020
|
* tolerated and skipped.
|
|
1994
2021
|
*/
|
|
1995
2022
|
private tryDefineUserUnit;
|
|
2023
|
+
/**
|
|
2024
|
+
* `name += expr` / `name -= expr`, a running total. The accumulator reads
|
|
2025
|
+
* its current value, adds or subtracts the right-hand side, stores the
|
|
2026
|
+
* result, and answers with the new value, so a note becomes a live ledger
|
|
2027
|
+
* where each line adjusts a balance in place. Returns null to decline
|
|
2028
|
+
* anything that is not the compound shape.
|
|
2029
|
+
*
|
|
2030
|
+
* Handled here, in the same effectful, cache-bypassing channel as
|
|
2031
|
+
* {@link tryDefineUserUnit} and the bare `count = 10` assignment (see
|
|
2032
|
+
* {@link trySymbolicGrammar}), rather than as a parselet: a bare identifier
|
|
2033
|
+
* is a Tier-1 prefix that emits `LOAD_VAR name` before any infix parselet on
|
|
2034
|
+
* `+=` could run, and that pre-emitted load throws UNDEFINED_VARIABLE for a
|
|
2035
|
+
* first-use accumulator. Seeding 0 for a first `+=`/`-=` is a one-line
|
|
2036
|
+
* `getVar`/`setVar` here where it cannot be from a parselet, a deliberate
|
|
2037
|
+
* departure from a plain reference, which still reports the undefined name.
|
|
2038
|
+
*
|
|
2039
|
+
* The right-hand side is parenthesised and run through the ORDINARY (not
|
|
2040
|
+
* symbolic-tolerant) path, so `bal += 3 * 4` is `bal + 12`, a genuine typo in
|
|
2041
|
+
* it (`total += nope`) is a real UNDEFINED_VARIABLE, and the accumulation
|
|
2042
|
+
* goes through the VM's own ADD/SUB: money stays money, a unit stays its
|
|
2043
|
+
* unit, and the seed 0 added to a typed right-hand side takes that type on
|
|
2044
|
+
* first use. The colon (`:name`) and `global :name` grammars are untouched:
|
|
2045
|
+
* they lex their own leading token, never IDENT/UNIT, so they decline here.
|
|
2046
|
+
*/
|
|
2047
|
+
private tryCompoundAssignment;
|
|
2048
|
+
/**
|
|
2049
|
+
* Reset every running-total accumulator (`total += 5`) to undefined, and
|
|
2050
|
+
* return their names.
|
|
2051
|
+
*
|
|
2052
|
+
* An accumulator seeds 0 only while its name is undefined, then reads that
|
|
2053
|
+
* value on each `+=`/`-=`. A document is re-evaluated top-to-bottom on
|
|
2054
|
+
* every keystroke, so unless the name is cleared first the total reads its
|
|
2055
|
+
* own previous evaluation's value and grows without bound. The batch
|
|
2056
|
+
* document pass (`parseDocument`/`evaluateLines`) calls this at the start
|
|
2057
|
+
* of each pass; the incremental {@link ThreeTierEvaluator} calls it and
|
|
2058
|
+
* then marks the lines that touch each name dirty, since it re-runs lines
|
|
2059
|
+
* selectively rather than replaying the whole document.
|
|
2060
|
+
*/
|
|
2061
|
+
resetAccumulators(): ReadonlySet<string>;
|
|
1996
2062
|
private trySymbolicGrammar;
|
|
1997
2063
|
/**
|
|
1998
2064
|
* Stores a general scalar equation (`x^2 - 4 = 0`) keyed by its unknown, or
|
|
@@ -2150,8 +2216,8 @@ declare class ExpressionEngine {
|
|
|
2150
2216
|
* compile-only callers. NOT used by `evaluateLine()`/
|
|
2151
2217
|
* `evaluateExpression()`, those route through
|
|
2152
2218
|
* {@link evaluateExpressionWithDiagnostic} instead (evaluateLine ->
|
|
2153
|
-
*
|
|
2154
|
-
*
|
|
2219
|
+
* evaluateLineWithDebug -> evaluateExpressionWithDiagnostic), which does
|
|
2220
|
+
* its own lexing and its
|
|
2155
2221
|
* own diagnostic-instrumented front-half, delegating to the SAME
|
|
2156
2222
|
* {@link prepareExpression} this method calls. Delegates the front-half
|
|
2157
2223
|
* to {@link prepareExpression}, then runs async preflight (via
|
|
@@ -2163,16 +2229,10 @@ declare class ExpressionEngine {
|
|
|
2163
2229
|
*
|
|
2164
2230
|
* @param lineNumber - 1-based line position in the document.
|
|
2165
2231
|
* @param lineText - The raw line text.
|
|
2166
|
-
* @returns The evaluated Value
|
|
2232
|
+
* @returns The evaluated {@link Value}.
|
|
2167
2233
|
* @throws {EngineError} On evaluation failure.
|
|
2168
2234
|
*/
|
|
2169
|
-
evaluateLine(lineNumber: number, lineText: string):
|
|
2170
|
-
/**
|
|
2171
|
-
* Evaluate a line and return an explicit `{ values }` object.
|
|
2172
|
-
*
|
|
2173
|
-
* @throws {EngineError} On evaluation failure.
|
|
2174
|
-
*/
|
|
2175
|
-
evaluateLineDetailed(lineNumber: number, lineText: string): LineEvaluation;
|
|
2235
|
+
evaluateLine(lineNumber: number, lineText: string): Value;
|
|
2176
2236
|
/**
|
|
2177
2237
|
* Evaluate a line with diagnostic information, supporting both regular expressions and inline solves.
|
|
2178
2238
|
*
|
|
@@ -2442,9 +2502,9 @@ declare class ExpressionEngine {
|
|
|
2442
2502
|
getLastTelemetry(): PipelineTelemetry | null;
|
|
2443
2503
|
/**
|
|
2444
2504
|
* Evaluate a raw expression string without line-number context.
|
|
2445
|
-
* Returns the Value result. Throws on error.
|
|
2505
|
+
* Returns the {@link Value} result. Throws on error.
|
|
2446
2506
|
*/
|
|
2447
|
-
evaluateExpression(expression: string):
|
|
2507
|
+
evaluateExpression(expression: string): Value;
|
|
2448
2508
|
/**
|
|
2449
2509
|
* Explain how a line reached its answer, as a readable derivation.
|
|
2450
2510
|
*
|
|
@@ -2562,15 +2622,25 @@ declare class ExpressionEngine {
|
|
|
2562
2622
|
* Fast path: evaluate an expression and return a number directly.
|
|
2563
2623
|
*
|
|
2564
2624
|
* Skips Value object allocation when only a numeric result is needed.
|
|
2565
|
-
* Returns NaN
|
|
2625
|
+
* Returns NaN whenever the expression has no numeric answer: a thrown
|
|
2626
|
+
* error, a bare undefined variable reference, or a faulted result (an
|
|
2627
|
+
* Error or a Pending value).
|
|
2566
2628
|
*
|
|
2567
2629
|
* Performs a pre-check for bare identifiers (single-token variable
|
|
2568
2630
|
* references). If the identifier is not a known variable, returns NaN
|
|
2569
2631
|
* immediately without attempting evaluation, avoids the ambiguity of
|
|
2570
2632
|
* "result === 0" when a variable might legitimately store the value 0.
|
|
2571
2633
|
*
|
|
2634
|
+
* A faulted result is treated the same way, and for the same reason: an
|
|
2635
|
+
* Error or Pending reads as 0 through {@link Value.toNumber}, so returning
|
|
2636
|
+
* that 0 would be indistinguishable from a real zero. NaN is this fast
|
|
2637
|
+
* path's established "no value" signal, so `evaluateNumber("5 kg to m")`
|
|
2638
|
+
* (an impossible conversion) is NaN rather than a silent `0`. A caller that
|
|
2639
|
+
* needs the fault's detail should use {@link evaluateExpression} and read
|
|
2640
|
+
* {@link Value.errorCode}/{@link Value.isPending} off the result.
|
|
2641
|
+
*
|
|
2572
2642
|
* @param expression - The raw expression string to evaluate.
|
|
2573
|
-
* @returns The numeric result, or NaN on error/undefined variable.
|
|
2643
|
+
* @returns The numeric result, or NaN on error / undefined variable / fault.
|
|
2574
2644
|
*/
|
|
2575
2645
|
evaluateNumber(expression: string): number;
|
|
2576
2646
|
clear(): void;
|
|
@@ -2856,50 +2926,25 @@ declare class LanguageService {
|
|
|
2856
2926
|
invalidateCache(): void;
|
|
2857
2927
|
}
|
|
2858
2928
|
|
|
2859
|
-
/**
|
|
2860
|
-
* Public API for registering plugins with the solve-js engine.
|
|
2861
|
-
*
|
|
2862
|
-
* All registration goes through this interface, parselets, variable
|
|
2863
|
-
* sources, and full packages. The default implementation is
|
|
2864
|
-
* {@link PackageRegistry} (singleton via {@link packageRegistry}).
|
|
2865
|
-
*
|
|
2866
|
-
* @example
|
|
2867
|
-
* ```typescript
|
|
2868
|
-
* import { packageRegistry } from "solve-engine";
|
|
2869
|
-
* packageRegistry.registerPackage(myCustomPackage);
|
|
2870
|
-
* ```
|
|
2871
|
-
*/
|
|
2872
|
-
interface IPackageRegistry {
|
|
2873
|
-
/** Register a prefix parselet (e.g., `GE`, `NOW`, `floor`). */
|
|
2874
|
-
registerPrefixParselet(tokenType: string, parselet: PrefixParselet): void;
|
|
2875
|
-
/** Register an infix parselet (e.g., `+`, `in`, `to`). */
|
|
2876
|
-
registerInfixParselet(tokenType: string, parselet: InfixParselet): void;
|
|
2877
|
-
/** @deprecated Has no effect. See {@link IEnginePackage.variableSources}. */
|
|
2878
|
-
registerVariableSource(source: IVariableSource): void;
|
|
2879
|
-
/** Register a complete package (parselets + variable sources). */
|
|
2880
|
-
registerPackage(pkg: IEnginePackage): void;
|
|
2881
|
-
/** Convenience reference to the Value class for creating typed values. */
|
|
2882
|
-
Value: typeof Value;
|
|
2883
|
-
}
|
|
2884
2929
|
/**
|
|
2885
2930
|
* Package descriptor for registering a complete provider with the engine.
|
|
2886
2931
|
*
|
|
2887
2932
|
* A package bundles all the pieces needed for a domain-specific provider:
|
|
2888
2933
|
* lexer plugins for custom token recognition, parselets for Pratt parsing,
|
|
2889
|
-
* plugin functions dispatched via CALL_PLUGIN bytecode,
|
|
2890
|
-
*
|
|
2891
|
-
*
|
|
2934
|
+
* plugin functions dispatched via CALL_PLUGIN bytecode, and optional async
|
|
2935
|
+
* resolvers for data that loads asynchronously (e.g., exchange rates, game
|
|
2936
|
+
* prices).
|
|
2892
2937
|
*
|
|
2893
2938
|
* @example
|
|
2894
2939
|
* ```typescript
|
|
2895
2940
|
* const myPackage: IEnginePackage = {
|
|
2896
2941
|
* name: "MyProvider",
|
|
2897
2942
|
* lexerVocabulary: myLexerVocabulary,
|
|
2898
|
-
* prefixParselets:
|
|
2899
|
-
* pluginFunctions:
|
|
2943
|
+
* prefixParselets: { MY_FUNC: new MyParselet() },
|
|
2944
|
+
* pluginFunctions: { myFn: myHandler },
|
|
2900
2945
|
* asyncResolvers: [myAsyncResolver],
|
|
2901
2946
|
* };
|
|
2902
|
-
*
|
|
2947
|
+
* const engine = createEngine({ extraPackages: [myPackage] });
|
|
2903
2948
|
* ```
|
|
2904
2949
|
*/
|
|
2905
2950
|
interface IEnginePackage {
|
|
@@ -2926,59 +2971,30 @@ interface IEnginePackage {
|
|
|
2926
2971
|
engineVersion?: string;
|
|
2927
2972
|
/** Optional lexer vocabulary (keywords/operators/units) for recognizing custom tokens (e.g., `GE`, `£`). */
|
|
2928
2973
|
lexerVocabulary?: LexerVocabulary;
|
|
2929
|
-
/** Prefix parselets for this package's custom functions/operators. */
|
|
2930
|
-
prefixParselets?:
|
|
2931
|
-
|
|
2932
|
-
|
|
2933
|
-
|
|
2934
|
-
|
|
2935
|
-
|
|
2936
|
-
|
|
2937
|
-
|
|
2938
|
-
|
|
2939
|
-
|
|
2940
|
-
*
|
|
2941
|
-
*
|
|
2942
|
-
*
|
|
2943
|
-
*
|
|
2944
|
-
*
|
|
2945
|
-
* independently picking the same index would silently overwrite each
|
|
2946
|
-
* other's handler in the shared registry.
|
|
2947
|
-
*
|
|
2948
|
-
* The handler's optional second parameter, `context`, carries the
|
|
2949
|
-
* current line's {@link LineExecutionContext} (line number, and, only
|
|
2950
|
-
* inside a real document, never `evaluateExpression()`'s single-shot
|
|
2951
|
-
* path, closures for reading another line's cached result). Every
|
|
2952
|
-
* handler that doesn't need cross-line data can ignore it entirely.
|
|
2974
|
+
/** Prefix parselets for this package's custom functions/operators, keyed by token type. */
|
|
2975
|
+
prefixParselets?: Record<string, PrefixParselet>;
|
|
2976
|
+
/** Infix parselets for this package's custom binary operators, keyed by token type. */
|
|
2977
|
+
infixParselets?: Record<string, InfixParselet>;
|
|
2978
|
+
/**
|
|
2979
|
+
* Functions dispatched via `CALL_PLUGIN` bytecode, keyed by a package-local
|
|
2980
|
+
* name. The engine assigns each a registry index at registration, so a
|
|
2981
|
+
* parselet emits the call by that name (`builder.emitPluginCall(name, argCount)`)
|
|
2982
|
+
* and never touches a numeric index. Two packages naming a function the same
|
|
2983
|
+
* is a `checkPackageCompatibility` warning, the later registration wins.
|
|
2984
|
+
*
|
|
2985
|
+
* The handler's optional second parameter, `context`, carries the current
|
|
2986
|
+
* line's `LineExecutionContext` (line number, and, only inside a real
|
|
2987
|
+
* document, never `evaluateExpression()`'s single-shot path, closures for
|
|
2988
|
+
* reading another line's cached result). Every handler that doesn't need
|
|
2989
|
+
* cross-line data can ignore it entirely.
|
|
2953
2990
|
*
|
|
2954
2991
|
* @example
|
|
2955
2992
|
* ```ts
|
|
2956
|
-
*
|
|
2957
|
-
*
|
|
2958
|
-
* pluginFunctions: [{ index: MY_FN_IDX, handler: myHandler }]
|
|
2993
|
+
* // In a parselet's parse(): builder.emitPluginCall("myFn", argCount);
|
|
2994
|
+
* pluginFunctions: { myFn: myHandler }
|
|
2959
2995
|
* ```
|
|
2960
2996
|
*/
|
|
2961
|
-
pluginFunctions?:
|
|
2962
|
-
index: number;
|
|
2963
|
-
handler: (args: Value[], context?: LineExecutionContext) => Value | Promise<Value>;
|
|
2964
|
-
}>;
|
|
2965
|
-
/**
|
|
2966
|
-
* Named-variable sources.
|
|
2967
|
-
*
|
|
2968
|
-
* @deprecated Currently has no effect. Sources declared here are registered
|
|
2969
|
-
* into the engine's {@link EngineContext} and unregistered again on package
|
|
2970
|
-
* removal, but no evaluation path ever calls `VariableResolver.resolve()`, so
|
|
2971
|
-
* a variable a source provides is never found. Verified by searching every
|
|
2972
|
-
* use of `IVariableSource` outside its own declaration: they are all
|
|
2973
|
-
* registration bookkeeping.
|
|
2974
|
-
*
|
|
2975
|
-
* Declared here rather than deleted because removing a public field is a
|
|
2976
|
-
* breaking change and the intended behaviour is worth keeping. Documented as
|
|
2977
|
-
* dead so a package author does not spend an afternoon working out why their
|
|
2978
|
-
* variables resolve to nothing. To expose a value today, contribute a plugin
|
|
2979
|
-
* function through {@link IEnginePackage.pluginFunctions}.
|
|
2980
|
-
*/
|
|
2981
|
-
variableSources?: IVariableSource[];
|
|
2997
|
+
pluginFunctions?: Record<string, PluginFunctionHandler>;
|
|
2982
2998
|
/**
|
|
2983
2999
|
* Async resolvers for this package's domain.
|
|
2984
3000
|
* When set, the ExpressionEngine runs preflight() before VM execution
|
|
@@ -3070,53 +3086,5 @@ interface IEnginePackage {
|
|
|
3070
3086
|
*/
|
|
3071
3087
|
asConverters?: Record<string, (value: Value) => Value>;
|
|
3072
3088
|
}
|
|
3073
|
-
/**
|
|
3074
|
-
* Default implementation of {@link IPackageRegistry}, the plugin registration API.
|
|
3075
|
-
*
|
|
3076
|
-
* All registrations delegate to shared singletons (parselet registry,
|
|
3077
|
-
* variable resolver, lexer). This ensures that packages registered through
|
|
3078
|
-
* any PackageRegistry instance are visible engine-wide.
|
|
3079
|
-
*
|
|
3080
|
-
* @example
|
|
3081
|
-
* ```typescript
|
|
3082
|
-
* import { packageRegistry } from "solve-engine";
|
|
3083
|
-
*
|
|
3084
|
-
* // Register a complete provider package
|
|
3085
|
-
* packageRegistry.registerPackage({
|
|
3086
|
-
* name: "MyProvider",
|
|
3087
|
-
* prefixParselets: [{ tokenType: "MY_FUNC", parselet: new MyParselet() }],
|
|
3088
|
-
* });
|
|
3089
|
-
* ```
|
|
3090
|
-
*
|
|
3091
|
-
* @deprecated Register on an engine instead:
|
|
3092
|
-
* `engine.registerPackage(pkg)`.
|
|
3093
|
-
*
|
|
3094
|
-
* This class writes into process-wide singletons, which is incompatible with an
|
|
3095
|
-
* engine owning its own registries. Since the introduction of
|
|
3096
|
-
* {@link EngineContext}, an engine reads plugin functions, opcode handlers and
|
|
3097
|
-
* variable sources from its own context, so a package registered here is not
|
|
3098
|
-
* visible to any engine. Parselets and lexer vocabulary registered here reach
|
|
3099
|
-
* the shared registries, which an engine also does not read: it builds its own
|
|
3100
|
-
* `ParseletRegistry` and its own `Lexer`.
|
|
3101
|
-
*
|
|
3102
|
-
* In other words this path registers into state nothing evaluates against. It
|
|
3103
|
-
* remains exported because removing it is a breaking change, and it is where
|
|
3104
|
-
* the singletons that survive are still written from, but it should not be used
|
|
3105
|
-
* in new code and will be removed before 1.0 proper.
|
|
3106
|
-
*/
|
|
3107
|
-
declare class PackageRegistry implements IPackageRegistry {
|
|
3108
|
-
Value: typeof Value;
|
|
3109
|
-
registerPrefixParselet(tokenType: string, parselet: PrefixParselet): void;
|
|
3110
|
-
registerInfixParselet(tokenType: string, parselet: InfixParselet): void;
|
|
3111
|
-
registerVariableSource(source: IVariableSource): void;
|
|
3112
|
-
registerPackage(pkg: IEnginePackage): void;
|
|
3113
|
-
}
|
|
3114
|
-
/**
|
|
3115
|
-
* Singleton PackageRegistry instance, the default plugin registration API.
|
|
3116
|
-
*
|
|
3117
|
-
* All packages should register through this instance. The underlying registries
|
|
3118
|
-
* are shared singletons, so multiple PackageRegistry instances would be redundant.
|
|
3119
|
-
*/
|
|
3120
|
-
declare const packageRegistry: PackageRegistry;
|
|
3121
3089
|
|
|
3122
|
-
export { type ApplyChangesResult as A, type BatcherMetrics as B, type CacheSnapshot as C, DocumentModel as D, ExpressionEngine as E,
|
|
3090
|
+
export { type ApplyChangesResult as A, type BatcherMetrics as B, type CacheSnapshot as C, DocumentModel as D, ExpressionEngine as E, LanguageService as F, type LanguageServiceOptions as G, type SemanticToken as H, type IEnginePackage as I, type ParsingResult as J, type LineChange as L, type ParsedLine as P, SNAPSHOT_FORMAT as S, type UnifiedParsingOptions as U, type ViewportRange as V, type EngineOptions as a, type EngineRestoreOptions as b, type EngineSnapshot as c, type Explanation as d, type ExplanationStep as e, SNAPSHOT_VERSION as f, type SerializedAnonymousBody as g, type SerializedBytecode as h, type SerializedDecimal as i, type SerializedLineCacheEntry as j, type SerializedNumber as k, type SerializedRational as l, type SerializedUserFunction as m, type SerializedValue as n, SnapshotErrorCodes as o, type InlineSolvePosition as p, type AsyncCachePackageInfo as q, type AsyncErrorEvent as r, AsyncResolutionBatcher as s, type AsyncResolutionEvent as t, type BytecodeCacheEntry as u, type CheckpointSnapshot as v, type LineCacheEntryInfo as w, type LineState as x, type LinesUpdatedEvent as y, type CompletionItem as z };
|