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 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/format/FormattingSettings.ts","../src/format/FormatEngine.ts"],"names":["formatted","autoFormatIntegerOrFloat","CURRENCY_DISPLAY","decimalToFixed","formatSymbolic","columnMajorToRowMajor","getLocale","formatColour"],"mappings":";;;;;;;;AAyBO,IAAM,2BAAA,GAAkD;AA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AAU,MAAM,KAAA,EAAiB,KAAA,CAAM,MAAM,MAAA,EAAQ,EAAA,EAAI,MAAM,KAAK,CAAA;AAAA,IAC7E,KAAA,CAAA;AACE,MAAA,OAAO,YAAA,CAAa,KAAA,CAAM,KAAA,EAAqB,MAAA,EAAQ,EAAE,CAAA;AAAA,IAC3D,KAAA,CAAA,cAAsB;AACpB,MAAA,MAAM,IAAI,KAAA,CAAM,KAAA;AAChB,MAAA,OAAO,WAAA,CAAY,CAAA,CAAE,GAAA,EAAK,CAAA,CAAE,KAAK,MAAM,CAAA;AAAA,IACzC;AAAA,IACA,KAAA,EAAA;AACE,MAAA,OAAO,CAAA,EAAG,OAAO,OAAA,CAAQ,YAAY,GAAGC,8BAAA,CAAa,KAAA,CAAM,KAAmB,CAAC,CAAA,CAAA;AAAA,IACjF,KAAA,CAAA;AACE,MAAA,OAAOH,gCAAA,CAAe,MAAM,KAAqB,CAAA;AAAA,IACnD,KAAA,CAAA;AACE,MAAA,OAAO,gBAAA,CAAiB,KAAA,CAAM,KAAA,EAAiB,MAAA,EAAQ,EAAE,CAAA;AAAA,IAC3D,KAAA,EAAA;AACE,MAAA,OAAO,UAAA,CAAW,KAAA,CAAM,KAAA,EAAiB,KAAA,CAAM,IAAI,CAAA;AAAA,IACrD,KAAA,EAAA;AAKE,MAAA,OAAO,KAAA,CAAM,IAAA,IAAQ,MAAA,CAAO,KAAA,CAAM,KAAK,CAAA;AAAA,IACzC;AACE,MAAA,OAAO,CAAA,EAAA,EAAK,MAAA,CAAO,KAAA,CAAM,KAAK,CAAC,CAAA,CAAA;AAAA;AAErC","file":"chunk-CKQMXMHR.cjs","sourcesContent":["/**\n * Minimal formatting settings interface for the engine\n * This allows the engine to format values without depending on app-specific settings\n */\nexport interface FormattingSettings {\n floatResult: {\n decimalPlaces: number;\n enableSeperator: boolean;\n };\n numberResult: {\n decimalSeparatorLocale: string;\n };\n hexResult: {\n enablePadding: boolean;\n paddingZeros: number;\n };\n unitOfMeasurementResult: {\n decimalPlaces: number;\n };\n percentageResult: {\n decimalPlaces: number;\n };\n}\n\n/** Formatting used when a host supplies none. */\nexport const DEFAULT_FORMATTING_SETTINGS: FormattingSettings = {\n floatResult: {\n decimalPlaces: 2,\n enableSeperator: true,\n },\n numberResult: {\n decimalSeparatorLocale: \"en-US\",\n },\n hexResult: {\n enablePadding: false,\n paddingZeros: 0,\n },\n unitOfMeasurementResult: {\n decimalPlaces: 2,\n },\n percentageResult: {\n decimalPlaces: 2,\n },\n};\n","import { Value, ValueType, type MatrixData, type MatrixEntry, type RangeData, type ColourData } from \"@solve-js/vm/Value\";\nimport { formatColour } from \"@solve-js/packages/colour/ColourMath\";\nimport { decimalToFixed, type DecimalData } from \"@solve-js/decimal\";\nimport { getLocale, type ILocale } from \"@solve-js/constants/locales\";\nimport { autoFormatIntegerOrFloat } from \"@solve-js/utilities/Number\";\nimport { FormattingSettings, DEFAULT_FORMATTING_SETTINGS } from \"./FormattingSettings\";\nimport { CURRENCY_DISPLAY } from \"@solve-js/uom/CurrencyAliases\";\nimport { columnMajorToRowMajor } from \"@solve-js/vm/MatrixOps\";\nimport { formatSymbolic, type SymbolicNode } from \"@solve-js/symbolic\";\n\nfunction formatNumber(value: number, locale: ILocale, settings: FormattingSettings, decimalPlaces?: number): string {\n const sep = settings.floatResult.enableSeperator;\n const loc = settings.numberResult.decimalSeparatorLocale;\n // An explicit precision (`3.14159 to 4 dp`, `round(1.5, 2)`) shows EXACTLY that\n // many places with trailing zeros kept, where the default trims them and shows\n // an integer with none. The value was already rounded to this precision when\n // it was set (see VMBuiltins' roundToPlaces, exact where an exact decimal was\n // there), so rendering it to the same place count reproduces that rounding.\n if (decimalPlaces !== undefined && Number.isFinite(value)) {\n const formatted = value.toLocaleString(loc || \"en-US\", {\n minimumFractionDigits: decimalPlaces,\n maximumFractionDigits: decimalPlaces,\n useGrouping: sep,\n });\n return `${locale.display.resultPrefix}${formatted}`;\n }\n const dp = settings.floatResult.decimalPlaces;\n const formatted = autoFormatIntegerOrFloat(value, dp, sep, loc);\n return `${locale.display.resultPrefix}${formatted}`;\n}\n\n/**\n * Renders a measurement that carries a one-sigma uncertainty as\n * `center ± spread`, e.g. `49.2 ± 2.0`.\n *\n * The center is shown the way any number is, whole numbers as integers and\n * trailing zeros trimmed, so a tolerance-free-looking center still reads\n * cleanly (\"30 ± 2.24\", not \"30.00 ± 2.24\"). The spread is shown to the same\n * decimal-place budget but always keeps at least one fractional digit, which is\n * what distinguishes it as a tolerance and gives \"± 2.0\" rather than \"± 2\".\n * Both use `Intl` with `maximumFractionDigits`, so the trailing-zero trimming is\n * locale-correct (a comma-decimal locale is not string-sliced on \".\").\n *\n * The symbol is always the `±` glyph on output, even when the input was the\n * ASCII `+/-`, since the glyph is the conventional notation and unambiguous to\n * read back.\n */\nfunction formatUncertain(center: number, uncertainty: number, locale: ILocale, settings: FormattingSettings): string {\n const dp = settings.floatResult.decimalPlaces;\n const useGrouping = settings.floatResult.enableSeperator;\n const loc = settings.numberResult.decimalSeparatorLocale || \"en-US\";\n // The spread needs room for at least one fractional digit, so a zero-decimal\n // budget cannot leave minimumFractionDigits above maximumFractionDigits.\n const spreadMax = Math.max(dp, 1);\n const centerText = center.toLocaleString(loc, { useGrouping, minimumFractionDigits: 0, maximumFractionDigits: dp });\n const spreadText = Math.abs(uncertainty).toLocaleString(loc, { useGrouping, minimumFractionDigits: 1, maximumFractionDigits: spreadMax });\n return `${locale.display.resultPrefix}${centerText} ± ${spreadText}`;\n}\n\n/**\n * Renders a number in whichever base it is tagged with.\n *\n * The zero padding is a hexadecimal setting and stays one. Applying it to a\n * binary rendering would pad `0b101` out to the same digit count as a hex\n * value, which is a different quantity of zeros and not what the setting asks\n * for.\n */\nfunction formatHex(value: number | bigint, settings: FormattingSettings, base?: string): string {\n // An infinity or a NaN has no digits in any base, and asking for them\n // produced `0xINFINITY`, a literal that reads back as nothing at all. Render\n // the value itself, which is what every other non-finite result shows.\n if (typeof value === \"number\" && !Number.isFinite(value)) return `= ${value}`;\n\n // Truncate and take the sign off before converting. `Number.toString(radix)`\n // does neither: it renders -255 as \"-ff\", which lands the minus inside the\n // literal as `0x-FF`, and it renders 255.7 as \"ff.b3333333333\", inventing\n // fractional hex digits for a notation that has no use for them. Both were\n // visible on `as hex` until the builtins started sharing this path.\n //\n // A bigint needs neither truncation nor a Math call, and must not be routed\n // through one: passing it to Math.trunc() throws, and converting it to a\n // double first is exactly the precision loss it is carried as a bigint to\n // avoid.\n const negative = typeof value === \"bigint\" ? value < 0n : value < 0;\n const sign = negative ? \"-\" : \"\";\n const digits = (radix: number): string =>\n typeof value === \"bigint\"\n ? (negative ? -value : value).toString(radix)\n : Math.abs(Math.trunc(value)).toString(radix);\n\n if (base === \"bin\") return `= ${sign}0b${digits(2)}`;\n if (base === \"oct\") return `= ${sign}0o${digits(8)}`;\n const padding = settings.hexResult.enablePadding ? settings.hexResult.paddingZeros : 0;\n const hex = digits(16).toUpperCase().padStart(padding, \"0\");\n return `= ${sign}0x${hex}`;\n}\n\n/**\n * How many decimal digits of an exact integer this will render in full.\n *\n * A little above the ~19,729 digits of the largest bigint the VM will build\n * (`vm/VM.ts`'s MAX_EXACT_POW_BITS / MAX_EXACT_SHIFT_BITS, 65,536 bits), so\n * every value the engine can produce through `^` or `<<` still prints exactly\n * and this ceiling only ever meets a value that came from somewhere else.\n */\nconst MAX_DISPLAYED_BIGINT_DIGITS = 20000;\n\n/**\n * Renders an exact integer, or describes it when writing it out is itself the\n * expensive operation.\n *\n * This used to be a bare `= ${value}` template, which renders whatever it is\n * handed: `1n << 100000000` took 8.5 seconds here turning a 12.5MB integer\n * into a thirty-million-character string, and a host has no way to opt out,\n * since displaying the answer is what it asked the engine for. The VM's own\n * ceiling on `<<` and `^` now stops that value existing, so this is the\n * backstop for every other way a large bigint can arrive (repeated `x * x`,\n * a Value a host built itself), and it costs one comparison for every value\n * that is not absurd.\n *\n * The digit count is estimated from the bit length rather than measured, since\n * measuring means doing the conversion this exists to avoid. Bit length comes\n * off the hexadecimal form, which is linear in the size of the value where the\n * decimal form is not.\n */\nfunction formatBigInt(value: bigint): string {\n const magnitude = value < 0n ? -value : value;\n // Every bigint a person actually reads takes this line and nothing else:\n // anything a double can hold is at most 309 digits, so it is printable\n // without measuring it at all.\n if (Number.isFinite(Number(magnitude))) return `= ${value}`;\n const bits = magnitude.toString(16).length * 4;\n if (bits * Math.LN2 / Math.LN10 <= MAX_DISPLAYED_BIGINT_DIGITS) return `= ${value}`;\n const log10 = bits * Math.LN2 / Math.LN10;\n const exponent = Math.floor(log10);\n const mantissa = Math.pow(10, log10 - exponent);\n const sign = value < 0n ? \"-\" : \"\";\n return `= ${sign}~${mantissa.toFixed(3)}e+${exponent} (an exact integer of about ${(exponent + 1).toLocaleString(\"en-US\")} digits, too large to print)`;\n}\n\nfunction formatString(value: string): string {\n return `= ${value}`;\n}\n\nfunction formatBoolean(value: boolean): string {\n return `= ${value}`;\n}\n\n/**\n * Renders a Datetime value locale-aware, the previous implementation\n * called `d.toLocaleString()` with no arguments, which always uses the JS\n * runtime's own default locale and never actually consulted `locale.code`\n * despite receiving it as a parameter (both branches of its old\n * `dateFormat === \"default\"` check were byte-for-byte identical, dead\n * groundwork for a distinction that was never implemented). Concretely,\n * this meant every configured locale (including the shipped German one)\n * always displayed weekday/month names in English. See GitHub issue #77.\n *\n * Uses `weekday`/`month`: \"long\" for a spelled-out date (\"Monday,\n * November 17, 2025\" / \"lundi 17 novembre 2025\") since that's what a\n * literal weekday name is for; a bare numeric date doesn't need\n * localizing beyond the decimal/thousands separators `formatNumber()`\n * already handles. The time-of-day portion is only appended when it's\n * not exactly local midnight, bare date literals (\"today\", \"17/11/2025\")\n * always anchor to local midnight, and showing \"00:00:00\" on every one of\n * those would be noise, not information.\n */\nfunction formatDatetime(value: number, locale: ILocale): string {\n const d = new Date(value);\n const dateStr = d.toLocaleDateString(locale.code, { weekday: \"long\", year: \"numeric\", month: \"long\", day: \"numeric\" });\n const isMidnight = d.getHours() === 0 && d.getMinutes() === 0 && d.getSeconds() === 0 && d.getMilliseconds() === 0;\n if (isMidnight) return `= ${dateStr}`;\n return `= ${dateStr}, ${d.toLocaleTimeString(locale.code)}`;\n}\n\n/**\n * Renders a millisecond duration as clock-style `H:MM` (or `H:MM:SS` when\n * there's a non-zero seconds component). `ms` is never a user-typeable\n * unit (confirmed: it appears nowhere in `lexer/units.ts`), it's only\n * ever produced by subtracting two clock times/datetimes (`9:30 - 8:30`,\n * `VM.ts`'s Datetime SUB case), so this is a safe, narrow special case,\n * not a general change to how durations display.\n */\nfunction formatMsDuration(ms: number): string {\n const sign = ms < 0 ? \"-\" : \"\";\n const totalSeconds = Math.round(Math.abs(ms) / 1000);\n const hours = Math.floor(totalSeconds / 3600);\n const minutes = Math.floor((totalSeconds % 3600) / 60);\n const seconds = totalSeconds % 60;\n const mm = String(minutes).padStart(2, \"0\");\n if (seconds === 0) return `${sign}${hours}:${mm}`;\n const ss = String(seconds).padStart(2, \"0\");\n return `${sign}${hours}:${mm}:${ss}`;\n}\n\nfunction formatUom(value: number, unit: string | undefined, locale: ILocale, settings: FormattingSettings, exact?: DecimalData): string {\n if (unit === \"ms\") return `= ${formatMsDuration(value)}`;\n\n const dp = settings.unitOfMeasurementResult.decimalPlaces;\n\n // For TimeSpan values (days, weeks, hours, etc.), format as integer if the value is a whole number\n const timeSpanUnits = [\"days\", \"weeks\", \"hours\", \"minutes\", \"seconds\", \"day\", \"week\", \"hour\", \"minute\", \"second\"];\n const isTimeSpan = unit && timeSpanUnits.includes(unit);\n\n let formatted: string;\n if (isTimeSpan && value === Math.floor(value)) {\n // For whole number TimeSpan values, format as integer\n formatted = value.toString();\n } else {\n // For other values, use the configured decimal places\n formatted = value.toFixed(dp);\n }\n\n // Currency display: symbol + culturally-conventional placement (e.g.\n // \"$100.00\" prefix vs \"100.00 kr\" suffix) instead of the generic\n // \"amount CODE\" fallback below. See uom/CurrencyAliases.ts's\n // CURRENCY_DISPLAY table for the exact set covered and the reasoning\n // behind each placement choice. Any currency code NOT in that table\n // (most of the ~150 `CurrencyExchange.isCurrency()` recognizes) falls\n // through to the unchanged \"amount CODE\" format below.\n const currencyDisplay = unit ? CURRENCY_DISPLAY[unit.toUpperCase()] : undefined;\n if (currencyDisplay) {\n // An exact money amount rounds from its decimal, not from the double: a\n // half-cent like \"$1.005\" reads as \"$1.01\" here, where \"(1.005).toFixed(2)\"\n // answers \"1.00\" because the double it is handed already sits below the\n // value the user typed. Amounts with no exact decimal (a currency\n // conversion, whose rate is a double) keep the toFixed rendering above.\n const moneyText = exact ? decimalToFixed(exact, dp) : formatted;\n const sep = currencyDisplay.spaced ? \" \" : \"\";\n const withSymbol = currencyDisplay.position === \"prefix\"\n ? `${currencyDisplay.symbol}${sep}${moneyText}`\n : `${moneyText}${sep}${currencyDisplay.symbol}`;\n return `= ${withSymbol}`;\n }\n\n // The unit is written as the symbol the value carries. There used to be a\n // `unitOfMeasurementResult.unitNames` setting here whose two branches were\n // the same expression, so it never changed anything, and it was removed\n // rather than implemented: the engine has no unit-name data to render from.\n // The generated unit table maps a spelling to [measure, ratio] only, and\n // names cannot be recovered from it, because units that differ by an OFFSET\n // share a ratio, so \"20 C\" would come back as \"20 kelvins\". A real\n // implementation needs a hand-authored name per unit plus pluralization and\n // per-locale spelling (metre against meter), which is a feature rather than\n // the repair of a dead ternary.\n //\n // An exact currency with no symbol in the display table above (one of the\n // less common ISO codes) still rounds from its decimal here, so \"1.005 UYW\"\n // reads the same way \"$1.005\" does. Non-currency Uoms never carry an exact,\n // so this leaves \"1.50 kg\" exactly as it was.\n const genericText = exact ? decimalToFixed(exact, dp) : formatted;\n return `= ${genericText} ${unit || \"\"}`.trim();\n}\n\nfunction formatMatrixEntry(entry: MatrixEntry, settings: FormattingSettings): string {\n if (typeof entry === \"boolean\") return entry ? \"true\" : \"false\";\n if (typeof entry === \"object\" && entry !== null) return formatSymbolic(entry);\n const dp = settings.floatResult.decimalPlaces;\n const sep = settings.floatResult.enableSeperator;\n const loc = settings.numberResult.decimalSeparatorLocale;\n return autoFormatIntegerOrFloat(entry, dp, sep, loc);\n}\n\n/**\n * Renders a Matrix matching its own literal syntax: a single row (1xN,\n * including plain vectors) as `[a, b, c]`, a single column (Nx1) as\n * `[a; b; c]`, and a general shape as `[r0c0, r0c1; r1c0, r1c1]`, row-major\n * textual output read back out of the column-major storage\n * (`columnMajorToRowMajor()`), matching how `[1,2;3,4]` is written.\n */\nfunction formatMatrix(m: MatrixData, locale: ILocale, settings: FormattingSettings): string {\n const rowMajor = columnMajorToRowMajor(m);\n const rows: string[] = [];\n for (let r = 0; r < m.rows; r++) {\n const cells: string[] = [];\n for (let c = 0; c < m.cols; c++) {\n cells.push(formatMatrixEntry(rowMajor[r * m.cols + c], settings));\n }\n rows.push(cells.join(\", \"));\n }\n return `${locale.display.resultPrefix}[${rows.join(\"; \")}]`;\n}\n\n/**\n * Render a matrix as a multi-line, column-aligned block: one row per line (the\n * newline is where {@link formatValue}'s compact form writes `;`), each column\n * right-padded to its widest cell, and every row wrapped in `[ ... ]`. For\n * display where a grid reads better than a line, e.g. a docs notepad or a REPL:\n *\n * ```text\n * [ 1 2 ]\n * [ 30 4 ]\n * ```\n *\n * This is deliberately separate from {@link formatValue}, whose single-line\n * matrix form stays the stable, assertable text the API and the worker DTO use.\n * A 1xN row vector is one line; an Nx1 column vector is N lines.\n */\nexport function formatMatrixAligned(m: MatrixData, settings?: FormattingSettings): string {\n const us = settings || DEFAULT_FORMATTING_SETTINGS;\n const rowMajor = columnMajorToRowMajor(m);\n const cells: string[][] = [];\n for (let r = 0; r < m.rows; r++) {\n const row: string[] = [];\n for (let c = 0; c < m.cols; c++) {\n row.push(formatMatrixEntry(rowMajor[r * m.cols + c], us));\n }\n cells.push(row);\n }\n const colWidth: number[] = [];\n for (let c = 0; c < m.cols; c++) {\n let width = 0;\n for (let r = 0; r < m.rows; r++) width = Math.max(width, cells[r][c].length);\n colWidth.push(width);\n }\n return cells\n .map((row) => `[ ${row.map((cell, c) => cell.padStart(colWidth[c])).join(\" \")} ]`)\n .join(\"\\n\");\n}\n\nfunction formatRange(min: number, max: number, locale: ILocale): string {\n return `${locale.display.resultPrefix}${min}:${max}`;\n}\n\nfunction formatPercentage(value: number, locale: ILocale, settings: FormattingSettings): string {\n // ValueType.Percentage stores a fraction (0.25 for 25%). See Value.ts's\n // documented contract and the sole producer, VM.ts's TO_PERCENTAGE opcode\n // (`right/left - 1`, e.g. 0.25 for \"800 to 1000\"). Multiply by 100 before\n // formatting; without this every percentage-change result displayed as\n // e.g. \"0.25%\" instead of \"25.00%\".\n const dp = settings.percentageResult.decimalPlaces;\n const formatted = (value * 100).toFixed(dp);\n return `= ${formatted}${locale.display.percentageSuffix}`;\n}\n\nfunction formatUnit(value: number, unit: string | undefined): string {\n return `= ${value} ${unit || \"\"}`.trim();\n}\n\n/**\n * Render an evaluated {@link Value} as a display string, dispatching on\n * `value.type` to the type-specific formatter (number, hex, datetime, unit\n * of measurement, matrix, range, percentage, ...).\n *\n * Most branches produce a `\"= \"`-prefixed result string (matching the\n * plugin's inline-result convention); `ValueType.Error` is the one\n * exception, it returns the human-readable error message directly\n * (stored in `value.unit`), not an `\"= \"`-prefixed string.\n *\n * @param value - The evaluated value to format.\n * @param settings - Locale/precision/separator options; defaults to\n * {@link DEFAULT_FORMATTING_SETTINGS} when omitted.\n * @example\n * ```typescript\n * const [value] = engine.evaluateExpression(\"10 USD to GBP\");\n * formatValue(value); // \"= £7.85\" (exact output depends on live exchange rates)\n * ```\n */\nexport function formatValue(value: Value, settings?: FormattingSettings): string {\n const us = settings || DEFAULT_FORMATTING_SETTINGS;\n const localeCode = us.numberResult.decimalSeparatorLocale || \"en\";\n const locale = getLocale(localeCode);\n\n switch (value.type) {\n case ValueType.Number:\n // A measurement with a tolerance renders as \"center ± spread\"; every\n // other number is unchanged, so a plain value is byte-for-byte what it was.\n if (value.uncertainty !== undefined) {\n return formatUncertain(value.value as number, value.uncertainty, locale, us);\n }\n return formatNumber(value.value as number, locale, us, value.decimalPlaces);\n case ValueType.Hex:\n return formatHex(value.value as number | bigint, us, value.unit);\n case ValueType.BigInt:\n return formatBigInt(value.value as bigint);\n case ValueType.String:\n return formatString(value.value as string);\n case ValueType.Boolean:\n return formatBoolean(value.value as boolean);\n case ValueType.Datetime:\n return formatDatetime(value.value as number, locale);\n case ValueType.Uom:\n return formatUom(value.value as number, value.unit, locale, us, value.exact);\n case ValueType.Matrix:\n return formatMatrix(value.value as MatrixData, locale, us);\n case ValueType.Range: {\n const r = value.value as RangeData;\n return formatRange(r.min, r.max, locale);\n }\n case ValueType.Colour:\n return `${locale.display.resultPrefix}${formatColour(value.value as ColourData)}`;\n case ValueType.Symbolic:\n return formatSymbolic(value.value as SymbolicNode);\n case ValueType.Percentage:\n return formatPercentage(value.value as number, locale, us);\n case ValueType.Unit:\n return formatUnit(value.value as number, value.unit);\n case ValueType.Error:\n // errorValue(code, message) stores the human-readable message in\n // `.unit` (code goes in `.value`), falling through to the default\n // case here previously displayed the raw code (e.g.\n // \"CURRENCY_RATE_UNAVAILABLE\") instead of the actual message.\n return value.unit ?? String(value.value);\n default:\n return `= ${String(value.value)}`;\n }\n}\n"]}
|
package/dist/chunk-CUR2WLI4.cjs
DELETED
|
@@ -1,507 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var chunkZMW6NU2K_cjs = require('./chunk-ZMW6NU2K.cjs');
|
|
4
|
-
var chunkQFTDTX6K_cjs = require('./chunk-QFTDTX6K.cjs');
|
|
5
|
-
var chunkB4HBEFTB_cjs = require('./chunk-B4HBEFTB.cjs');
|
|
6
|
-
|
|
7
|
-
// src/normalizer/TokenNormalizer.ts
|
|
8
|
-
var DEFAULT_OPTIONS = {
|
|
9
|
-
maxPasses: 100,
|
|
10
|
-
maxTokens: 1e4,
|
|
11
|
-
onFusion: () => {
|
|
12
|
-
}
|
|
13
|
-
};
|
|
14
|
-
function createFusedToken(type, text, sourceTokens) {
|
|
15
|
-
const first = sourceTokens[0];
|
|
16
|
-
const last = sourceTokens[sourceTokens.length - 1];
|
|
17
|
-
const token = new chunkZMW6NU2K_cjs.LexerToken(
|
|
18
|
-
type,
|
|
19
|
-
chunkQFTDTX6K_cjs.tokenTypeId(type),
|
|
20
|
-
text,
|
|
21
|
-
text,
|
|
22
|
-
first.offset,
|
|
23
|
-
first.lineBreaks ?? 0,
|
|
24
|
-
first.line,
|
|
25
|
-
first.col
|
|
26
|
-
);
|
|
27
|
-
token.sourceEnd = last.sourceEnd ?? last.offset + last.text.length;
|
|
28
|
-
return token;
|
|
29
|
-
}
|
|
30
|
-
function recordSourceSpan(fused, sourceTokens) {
|
|
31
|
-
const last = sourceTokens[sourceTokens.length - 1];
|
|
32
|
-
if (!last) return;
|
|
33
|
-
fused.sourceEnd = last.sourceEnd ?? last.offset + last.text.length;
|
|
34
|
-
}
|
|
35
|
-
var NON_WORD_NAMES = [
|
|
36
|
-
"NUMBER",
|
|
37
|
-
"HEX",
|
|
38
|
-
"BIGINT",
|
|
39
|
-
"FLOAT",
|
|
40
|
-
"LSHIFT",
|
|
41
|
-
"RSHIFT",
|
|
42
|
-
"BIT_AND",
|
|
43
|
-
"BIT_OR",
|
|
44
|
-
"BIT_XOR",
|
|
45
|
-
"LPAREN",
|
|
46
|
-
"RPAREN",
|
|
47
|
-
"LBRACKET",
|
|
48
|
-
"RBRACKET",
|
|
49
|
-
"COMMA",
|
|
50
|
-
"COLON",
|
|
51
|
-
"EQUALS",
|
|
52
|
-
"THEREFORE",
|
|
53
|
-
"PIPE",
|
|
54
|
-
"AMPERSAND",
|
|
55
|
-
"AT",
|
|
56
|
-
"SEMICOLON",
|
|
57
|
-
"QUESTION",
|
|
58
|
-
"EXCLAMATION",
|
|
59
|
-
"EOF",
|
|
60
|
-
"WS",
|
|
61
|
-
"NEWLINE"
|
|
62
|
-
];
|
|
63
|
-
var NON_WORD_TABLE = (() => {
|
|
64
|
-
const ids = NON_WORD_NAMES.map((n) => chunkQFTDTX6K_cjs.tokenTypeId(n));
|
|
65
|
-
const len = Math.max(...ids) + 1;
|
|
66
|
-
const table = new Uint8Array(len);
|
|
67
|
-
for (const id of ids) table[id] = 1;
|
|
68
|
-
return table;
|
|
69
|
-
})();
|
|
70
|
-
var TokenNormalizer = class {
|
|
71
|
-
// ── Constructor ──────────────────────────────────────────────────────────
|
|
72
|
-
/**
|
|
73
|
-
* @param options - Configuration overrides for safety limits and diagnostic callbacks
|
|
74
|
-
*/
|
|
75
|
-
constructor(options = {}) {
|
|
76
|
-
/** Registered rules, unsorted, the source of truth. */
|
|
77
|
-
this.rules = [];
|
|
78
|
-
/**
|
|
79
|
-
* Priority-sorted copy of {@link rules}, rebuilt lazily on the next
|
|
80
|
-
* {@link normalize} call after a mutation. Rules are registered once at
|
|
81
|
-
* engine/package-registration time and essentially never change during a
|
|
82
|
-
* session, but normalize() runs on every keystroke-driven evaluation, an
|
|
83
|
-
* earlier version re-sorted a fresh copy of `rules` on every single call,
|
|
84
|
-
* which meant every keystroke paid for an allocation + sort of a list that
|
|
85
|
-
* had usually not changed since the last one. `null` means "stale, rebuild
|
|
86
|
-
* on next use"; {@link register}/{@link unregister}/{@link clear} all
|
|
87
|
-
* invalidate it.
|
|
88
|
-
*/
|
|
89
|
-
this.sortedRulesCache = null;
|
|
90
|
-
/**
|
|
91
|
-
* Phrase trie for single-pass multi-word phrase fusion.
|
|
92
|
-
* Tried at each token position BEFORE other rules, the trie walk
|
|
93
|
-
* is O(depth) vs O(R × W) for separate rule matching.
|
|
94
|
-
*/
|
|
95
|
-
this.phraseTrie = new PhraseTrie();
|
|
96
|
-
this.options = { ...DEFAULT_OPTIONS, ...options };
|
|
97
|
-
}
|
|
98
|
-
// ── Rule Management ──────────────────────────────────────────────────────
|
|
99
|
-
/**
|
|
100
|
-
* Register a normalization rule.
|
|
101
|
-
*
|
|
102
|
-
* Rules are sorted by priority (descending) on each {@link normalize} call.
|
|
103
|
-
* Multiple rules can share the same priority, they are tried in registration
|
|
104
|
-
* order when priorities are equal.
|
|
105
|
-
*
|
|
106
|
-
* @param rule - The rule to register
|
|
107
|
-
*/
|
|
108
|
-
register(rule) {
|
|
109
|
-
this.rules.push(rule);
|
|
110
|
-
this.sortedRulesCache = null;
|
|
111
|
-
}
|
|
112
|
-
/**
|
|
113
|
-
* Unregister a normalization rule by its {@link NormalizerRule.name | name}.
|
|
114
|
-
*
|
|
115
|
-
* If multiple rules share the same name, all are removed. This is safe to
|
|
116
|
-
* call with a name that doesn't match any rule, it simply has no effect.
|
|
117
|
-
*
|
|
118
|
-
* @param ruleName - The name of the rule to remove
|
|
119
|
-
*/
|
|
120
|
-
unregister(ruleName) {
|
|
121
|
-
this.rules = this.rules.filter((r) => r.name !== ruleName);
|
|
122
|
-
this.sortedRulesCache = null;
|
|
123
|
-
}
|
|
124
|
-
/**
|
|
125
|
-
* Remove all registered rules, resetting the normalizer to its initial state.
|
|
126
|
-
* Also clears the phrase trie.
|
|
127
|
-
*/
|
|
128
|
-
clear() {
|
|
129
|
-
this.rules = [];
|
|
130
|
-
this.sortedRulesCache = null;
|
|
131
|
-
this.phraseTrie = new PhraseTrie();
|
|
132
|
-
}
|
|
133
|
-
/**
|
|
134
|
-
* Priority-sorted view of {@link rules} (descending priority; registration
|
|
135
|
-
* order preserved for ties, since {@link Array.prototype.sort} is stable).
|
|
136
|
-
* Cached until the next mutation. See {@link sortedRulesCache}.
|
|
137
|
-
*/
|
|
138
|
-
getSortedRules() {
|
|
139
|
-
if (this.sortedRulesCache === null) {
|
|
140
|
-
this.sortedRulesCache = [...this.rules].sort((a, b) => b.priority - a.priority);
|
|
141
|
-
}
|
|
142
|
-
return this.sortedRulesCache;
|
|
143
|
-
}
|
|
144
|
-
/**
|
|
145
|
-
* Get the number of currently registered rules (excludes phrase trie entries).
|
|
146
|
-
*/
|
|
147
|
-
get ruleCount() {
|
|
148
|
-
return this.rules.length;
|
|
149
|
-
}
|
|
150
|
-
// ── Phrase Registration ────────────────────────────────────────────────
|
|
151
|
-
/**
|
|
152
|
-
* Register a multi-word phrase for fusion into a single compound token.
|
|
153
|
-
*
|
|
154
|
-
* This is the preferred way to add phrase patterns. It inserts into the
|
|
155
|
-
* internal {@link PhraseTrie}, which collapses all phrase rules into a
|
|
156
|
-
* single O(depth) trie walk per position, no separate rule scanning.
|
|
157
|
-
*
|
|
158
|
-
* @param phrase - Multi-word phrase (e.g., "to the power of", "abyssal whip")
|
|
159
|
-
* @param tokenType - Target token type after fusion (e.g., "CARET", "ITEM")
|
|
160
|
-
*/
|
|
161
|
-
addPhrase(phrase, tokenType) {
|
|
162
|
-
this.phraseTrie.addPhrase(phrase, tokenType);
|
|
163
|
-
}
|
|
164
|
-
/**
|
|
165
|
-
* Check whether a word can start any registered phrase.
|
|
166
|
-
*
|
|
167
|
-
* Used by {@link implicitMultiplyRule} to suppress `*` insertion
|
|
168
|
-
* before phrase-starting identifiers (e.g., "2 power of 3" → `2 ^ 3`,
|
|
169
|
-
* not `2 * power of 3`). Delegates to {@link PhraseTrie.canStart}.
|
|
170
|
-
*/
|
|
171
|
-
/**
|
|
172
|
-
* Get all registered phrases and their target token types.
|
|
173
|
-
*
|
|
174
|
-
* Exposes the full phrase trie structure for diagnostic rendering
|
|
175
|
-
* in the playground's NormalizerTab. Returns ALL registered phrases,
|
|
176
|
-
* not just the ones that matched in the last evaluation.
|
|
177
|
-
*/
|
|
178
|
-
getPhrases() {
|
|
179
|
-
return this.phraseTrie.getAllPhrases();
|
|
180
|
-
}
|
|
181
|
-
canStartPhrase(word) {
|
|
182
|
-
return this.phraseTrie.canStart(word);
|
|
183
|
-
}
|
|
184
|
-
// ── Normalization ────────────────────────────────────────────────────────
|
|
185
|
-
/**
|
|
186
|
-
* Normalize a token stream by applying all registered rules.
|
|
187
|
-
*
|
|
188
|
-
* ## Algorithm
|
|
189
|
-
* Applies rules greedily left-to-right in multiple passes:
|
|
190
|
-
* 1. Sort rules by priority (descending)
|
|
191
|
-
* 2. Walk the token stream left to right
|
|
192
|
-
* 3. At each position, try rules in priority order
|
|
193
|
-
* 4. On match: consume matched tokens, insert replacements, restart from insert point
|
|
194
|
-
* 5. On no match: pass token through unchanged
|
|
195
|
-
* 6. Repeat until a full pass produces no changes, or maxPasses is reached
|
|
196
|
-
*
|
|
197
|
-
* ## Fusion tracking
|
|
198
|
-
* When a rule consumes more tokens than it produces, the normalizer calls
|
|
199
|
-
* `onFusion` with a {@link TokenFusion} record for diagnostic collection.
|
|
200
|
-
* This populates {@link NormalizerOutput.fusions} in the playground pipeline view.
|
|
201
|
-
*
|
|
202
|
-
* ## Safety
|
|
203
|
-
* If the normalized token count exceeds {@link NormalizerOptions.maxTokens},
|
|
204
|
-
* an Error is thrown to prevent memory exhaustion from runaway rule expansion.
|
|
205
|
-
*
|
|
206
|
-
* @param tokens - Raw tokens from the lexer
|
|
207
|
-
* @param onFusion - Optional fusion callback (overrides {@link NormalizerOptions.onFusion})
|
|
208
|
-
* @returns Normalized tokens ready for parsing
|
|
209
|
-
* @throws {Error} If the normalized token count exceeds maxTokens
|
|
210
|
-
*/
|
|
211
|
-
normalize(tokens, onFusion) {
|
|
212
|
-
if (tokens.length === 0) return tokens;
|
|
213
|
-
const sorted = this.getSortedRules();
|
|
214
|
-
const fusionHandler = onFusion ?? this.options.onFusion;
|
|
215
|
-
const maxPasses = this.options.maxPasses;
|
|
216
|
-
const maxTokens = this.options.maxTokens;
|
|
217
|
-
let current = tokens;
|
|
218
|
-
let changed = true;
|
|
219
|
-
let passCount = 0;
|
|
220
|
-
while (changed && passCount < maxPasses) {
|
|
221
|
-
changed = false;
|
|
222
|
-
passCount++;
|
|
223
|
-
const result = [];
|
|
224
|
-
let pos = 0;
|
|
225
|
-
while (pos < current.length) {
|
|
226
|
-
let matched = false;
|
|
227
|
-
const tid = current[pos].typeId;
|
|
228
|
-
if (tid >= NON_WORD_TABLE.length || NON_WORD_TABLE[tid] === 0) {
|
|
229
|
-
const trieMatch = this.phraseTrie.matchAt(current, pos);
|
|
230
|
-
if (trieMatch) {
|
|
231
|
-
const sourceTokens = current.slice(pos, pos + trieMatch.consumed);
|
|
232
|
-
for (const rt of trieMatch.replacement) {
|
|
233
|
-
result.push(rt);
|
|
234
|
-
}
|
|
235
|
-
if (trieMatch.consumed > 1 && trieMatch.replacement.length === 1) {
|
|
236
|
-
recordSourceSpan(trieMatch.replacement[0], sourceTokens);
|
|
237
|
-
fusionHandler({
|
|
238
|
-
rule: trieMatch.ruleName ?? "phrase-trie",
|
|
239
|
-
sourceTokens,
|
|
240
|
-
fusedToken: trieMatch.replacement[0]
|
|
241
|
-
});
|
|
242
|
-
}
|
|
243
|
-
pos += trieMatch.consumed;
|
|
244
|
-
changed = true;
|
|
245
|
-
continue;
|
|
246
|
-
}
|
|
247
|
-
}
|
|
248
|
-
for (const rule of sorted) {
|
|
249
|
-
const match = rule.match(current, pos);
|
|
250
|
-
if (match) {
|
|
251
|
-
const sourceTokens = current.slice(pos, pos + match.consumed);
|
|
252
|
-
for (const rt of match.replacement) {
|
|
253
|
-
result.push(rt);
|
|
254
|
-
}
|
|
255
|
-
if (match.consumed > 1 && match.replacement.length === 1) {
|
|
256
|
-
recordSourceSpan(match.replacement[0], sourceTokens);
|
|
257
|
-
fusionHandler({
|
|
258
|
-
rule: rule.name,
|
|
259
|
-
sourceTokens,
|
|
260
|
-
fusedToken: match.replacement[0]
|
|
261
|
-
});
|
|
262
|
-
} else if (match.consumed > 1 && match.replacement.length < match.consumed) {
|
|
263
|
-
for (const rt of match.replacement) {
|
|
264
|
-
fusionHandler({
|
|
265
|
-
rule: rule.name,
|
|
266
|
-
sourceTokens,
|
|
267
|
-
fusedToken: rt
|
|
268
|
-
});
|
|
269
|
-
}
|
|
270
|
-
}
|
|
271
|
-
pos += match.consumed;
|
|
272
|
-
changed = true;
|
|
273
|
-
matched = true;
|
|
274
|
-
break;
|
|
275
|
-
}
|
|
276
|
-
}
|
|
277
|
-
if (!matched) {
|
|
278
|
-
result.push(current[pos]);
|
|
279
|
-
pos++;
|
|
280
|
-
}
|
|
281
|
-
}
|
|
282
|
-
if (result.length > maxTokens) {
|
|
283
|
-
throw chunkB4HBEFTB_cjs.ErrorFactory.validation(
|
|
284
|
-
"NORMALIZED_TOKEN_LIMIT_EXCEEDED",
|
|
285
|
-
`Normalized token count (${result.length}) exceeds safety limit (${maxTokens})`,
|
|
286
|
-
{ tokenCount: result.length, maxTokens }
|
|
287
|
-
);
|
|
288
|
-
}
|
|
289
|
-
current = result;
|
|
290
|
-
}
|
|
291
|
-
return current;
|
|
292
|
-
}
|
|
293
|
-
};
|
|
294
|
-
|
|
295
|
-
// src/normalizer/PhraseTrie.ts
|
|
296
|
-
var PhraseTrie = class {
|
|
297
|
-
constructor() {
|
|
298
|
-
/**
|
|
299
|
-
* First words that can start any registered phrase (all lowercase).
|
|
300
|
-
* O(1) quick-reject: if `tokens[pos].value.toLowerCase()` isn't here,
|
|
301
|
-
* no phrase can match at this position.
|
|
302
|
-
*/
|
|
303
|
-
this.startWords = /* @__PURE__ */ new Set();
|
|
304
|
-
/**
|
|
305
|
-
* Root maps first word → child node.
|
|
306
|
-
* Two-level root avoids an unnecessary intermediate TrieNode.
|
|
307
|
-
*/
|
|
308
|
-
this.root = /* @__PURE__ */ new Map();
|
|
309
|
-
}
|
|
310
|
-
// ── Registration ──────────────────────────────────────────────────────
|
|
311
|
-
/**
|
|
312
|
-
* Register a phrase for fusion into a single compound token.
|
|
313
|
-
*
|
|
314
|
-
* @param phrase - Multi-word phrase (e.g., "to the power of")
|
|
315
|
-
* @param tokenType - Target token type after fusion (e.g., "CARET")
|
|
316
|
-
*/
|
|
317
|
-
addPhrase(phrase, tokenType) {
|
|
318
|
-
const words = phrase.toLowerCase().trim().split(/\s+/);
|
|
319
|
-
if (words.length === 0 || words[0] === "") return;
|
|
320
|
-
this.startWords.add(words[0]);
|
|
321
|
-
const firstWord = words[0];
|
|
322
|
-
let node;
|
|
323
|
-
if (this.root.has(firstWord)) {
|
|
324
|
-
node = this.root.get(firstWord);
|
|
325
|
-
} else {
|
|
326
|
-
node = { children: /* @__PURE__ */ new Map(), terminal: null };
|
|
327
|
-
this.root.set(firstWord, node);
|
|
328
|
-
}
|
|
329
|
-
if (words.length === 1) {
|
|
330
|
-
node.terminal = { tokenType, phrase, consumed: 1 };
|
|
331
|
-
return;
|
|
332
|
-
}
|
|
333
|
-
for (let i = 1; i < words.length; i++) {
|
|
334
|
-
const word = words[i];
|
|
335
|
-
if (!node.children.has(word)) {
|
|
336
|
-
node.children.set(word, { children: /* @__PURE__ */ new Map(), terminal: null });
|
|
337
|
-
}
|
|
338
|
-
node = node.children.get(word);
|
|
339
|
-
}
|
|
340
|
-
node.terminal = { tokenType, phrase, consumed: words.length };
|
|
341
|
-
}
|
|
342
|
-
// ── Matching ──────────────────────────────────────────────────────────
|
|
343
|
-
/**
|
|
344
|
-
* Attempt to match a phrase starting at `pos` in the token stream.
|
|
345
|
-
*
|
|
346
|
-
* Walks the trie one token at a time, tracking the deepest terminal
|
|
347
|
-
* node reached. Returns the longest match found, or `null` if no
|
|
348
|
-
* phrase starts at this position.
|
|
349
|
-
*
|
|
350
|
-
* @param tokens - The current token stream
|
|
351
|
-
* @param pos - Position to attempt matching from
|
|
352
|
-
* @returns The longest {@link NormalizerMatch}, or `null` on no match
|
|
353
|
-
*/
|
|
354
|
-
matchAt(tokens, pos) {
|
|
355
|
-
if (pos >= tokens.length) return null;
|
|
356
|
-
const firstWord = tokens[pos].value.toLowerCase();
|
|
357
|
-
if (!this.startWords.has(firstWord)) return null;
|
|
358
|
-
let node = this.root.get(firstWord);
|
|
359
|
-
if (!node) return null;
|
|
360
|
-
let best = null;
|
|
361
|
-
let depth = 1;
|
|
362
|
-
if (node.terminal) {
|
|
363
|
-
const sourceTokens = tokens.slice(pos, pos + 1);
|
|
364
|
-
best = {
|
|
365
|
-
consumed: 1,
|
|
366
|
-
replacement: [createFusedToken(node.terminal.tokenType, node.terminal.phrase, sourceTokens)],
|
|
367
|
-
ruleName: node.terminal.phrase
|
|
368
|
-
};
|
|
369
|
-
}
|
|
370
|
-
for (let i = pos + 1; i < tokens.length && node?.children; i++) {
|
|
371
|
-
const word = tokens[i].value.toLowerCase();
|
|
372
|
-
node = node.children.get(word);
|
|
373
|
-
if (!node) break;
|
|
374
|
-
depth++;
|
|
375
|
-
if (node.terminal) {
|
|
376
|
-
const sourceTokens = tokens.slice(pos, pos + depth);
|
|
377
|
-
best = {
|
|
378
|
-
consumed: depth,
|
|
379
|
-
replacement: [
|
|
380
|
-
createFusedToken(node.terminal.tokenType, node.terminal.phrase, sourceTokens)
|
|
381
|
-
],
|
|
382
|
-
ruleName: node.terminal.phrase
|
|
383
|
-
};
|
|
384
|
-
}
|
|
385
|
-
}
|
|
386
|
-
return best;
|
|
387
|
-
}
|
|
388
|
-
// ── Introspection ─────────────────────────────────────────────────────
|
|
389
|
-
/** Number of unique first words (not total phrases). */
|
|
390
|
-
get size() {
|
|
391
|
-
return this.root.size;
|
|
392
|
-
}
|
|
393
|
-
/**
|
|
394
|
-
* Return all registered phrases and their target token types.
|
|
395
|
-
*
|
|
396
|
-
* Used by diagnostic mode to expose the complete trie structure to the
|
|
397
|
-
* playground's NormalizerTab for rendering ALL registered phrases
|
|
398
|
-
* (not just the ones that matched in this evaluation).
|
|
399
|
-
*/
|
|
400
|
-
getAllPhrases() {
|
|
401
|
-
const result = {};
|
|
402
|
-
const collect = (node, path) => {
|
|
403
|
-
if (node.terminal) {
|
|
404
|
-
result[path.join(" ")] = node.terminal.tokenType;
|
|
405
|
-
}
|
|
406
|
-
for (const [word, child] of node.children) {
|
|
407
|
-
collect(child, [...path, word]);
|
|
408
|
-
}
|
|
409
|
-
};
|
|
410
|
-
for (const [firstWord, node] of this.root) {
|
|
411
|
-
collect(node, [firstWord]);
|
|
412
|
-
}
|
|
413
|
-
return result;
|
|
414
|
-
}
|
|
415
|
-
/** Check if any phrase starts with this word (case-insensitive). */
|
|
416
|
-
canStart(word) {
|
|
417
|
-
return this.startWords.has(word.toLowerCase());
|
|
418
|
-
}
|
|
419
|
-
};
|
|
420
|
-
|
|
421
|
-
// src/normalizer/BuiltinNormalizerRules.ts
|
|
422
|
-
var RATE_DENOMINATOR_WORDS = /* @__PURE__ */ new Set(["per", "a", "an", "each", "every"]);
|
|
423
|
-
var PHRASE_START_WORDS = /* @__PURE__ */ new Set([
|
|
424
|
-
"to",
|
|
425
|
-
"power",
|
|
426
|
-
"increase",
|
|
427
|
-
"decrease",
|
|
428
|
-
"times",
|
|
429
|
-
"multiply",
|
|
430
|
-
"divide",
|
|
431
|
-
"by"
|
|
432
|
-
]);
|
|
433
|
-
function implicitMultiplyRule(priority = 50, canStart) {
|
|
434
|
-
const phraseGuard = canStart ?? ((word) => PHRASE_START_WORDS.has(word.toLowerCase()));
|
|
435
|
-
return {
|
|
436
|
-
name: "implicit:multiply",
|
|
437
|
-
priority,
|
|
438
|
-
match(tokens, pos) {
|
|
439
|
-
if (pos + 1 >= tokens.length) return null;
|
|
440
|
-
const t = tokens[pos];
|
|
441
|
-
const next = tokens[pos + 1];
|
|
442
|
-
const nextValue = next.value.toLowerCase();
|
|
443
|
-
if (phraseGuard(nextValue)) return null;
|
|
444
|
-
if (RATE_DENOMINATOR_WORDS.has(nextValue) && tokens[pos + 2]?.type === "UNIT") return null;
|
|
445
|
-
const triggers = (t.type === "NUMBER" || t.type === "RPAREN") && (next.type === "IDENT" || next.type === "LPAREN" || next.type === "PI" || next.type === "E");
|
|
446
|
-
if (!triggers) return null;
|
|
447
|
-
const starToken = new chunkZMW6NU2K_cjs.LexerToken(
|
|
448
|
-
"STAR",
|
|
449
|
-
chunkQFTDTX6K_cjs.tokenTypeId("STAR"),
|
|
450
|
-
"*",
|
|
451
|
-
"*",
|
|
452
|
-
next.offset,
|
|
453
|
-
0,
|
|
454
|
-
next.line,
|
|
455
|
-
next.col
|
|
456
|
-
);
|
|
457
|
-
return { consumed: 1, replacement: [t, starToken] };
|
|
458
|
-
}
|
|
459
|
-
};
|
|
460
|
-
}
|
|
461
|
-
function isInsideRangeContext(tokens, pos) {
|
|
462
|
-
const safeStack = [];
|
|
463
|
-
for (let i = 0; i < pos; i++) {
|
|
464
|
-
const t = tokens[i];
|
|
465
|
-
if (t.type === "LBRACKET") {
|
|
466
|
-
safeStack.push(true);
|
|
467
|
-
} else if (t.type === "LPAREN") {
|
|
468
|
-
const prev = tokens[i - 1];
|
|
469
|
-
const opensMapReduceCall = !!prev && (prev.type === "MAP" || prev.type === "REDUCE" || prev.type === "SUM_FN" || prev.type === "PROD_FN" || prev.type === "IDENT" && (prev.value.toLowerCase() === "map" || prev.value.toLowerCase() === "reduce" || prev.value.toLowerCase() === "sum" || prev.value.toLowerCase() === "prod"));
|
|
470
|
-
safeStack.push(opensMapReduceCall);
|
|
471
|
-
} else if (t.type === "RBRACKET" || t.type === "RPAREN") {
|
|
472
|
-
safeStack.pop();
|
|
473
|
-
}
|
|
474
|
-
}
|
|
475
|
-
return safeStack.length > 0 && safeStack[safeStack.length - 1];
|
|
476
|
-
}
|
|
477
|
-
function createBuiltinNormalizerRules() {
|
|
478
|
-
return [
|
|
479
|
-
// ── Implicit operator insertion (priority 50) ──
|
|
480
|
-
implicitMultiplyRule()
|
|
481
|
-
];
|
|
482
|
-
}
|
|
483
|
-
var BUILTIN_PHRASES = {
|
|
484
|
-
"to the power of": "CARET",
|
|
485
|
-
"power of": "CARET",
|
|
486
|
-
"increase by": "INCREASE_BY",
|
|
487
|
-
"decrease by": "DECREASE_BY",
|
|
488
|
-
"times by": "TIMES_BY",
|
|
489
|
-
"multiply by": "MULTIPLY_BY",
|
|
490
|
-
"divide by": "DIVIDE_BY",
|
|
491
|
-
// The past-tense spellings, which is how the operation is usually written
|
|
492
|
-
// out: "3 multiplied by 4". Same tokens, so no new parselets. Both this
|
|
493
|
-
// branch and the parity branch added "multiplied by" independently; the
|
|
494
|
-
// merge kept both copies and the locale table rejected the duplicate key.
|
|
495
|
-
"multiplied by": "MULTIPLY_BY",
|
|
496
|
-
"divided by": "DIVIDE_BY"
|
|
497
|
-
};
|
|
498
|
-
|
|
499
|
-
exports.BUILTIN_PHRASES = BUILTIN_PHRASES;
|
|
500
|
-
exports.PhraseTrie = PhraseTrie;
|
|
501
|
-
exports.TokenNormalizer = TokenNormalizer;
|
|
502
|
-
exports.createBuiltinNormalizerRules = createBuiltinNormalizerRules;
|
|
503
|
-
exports.createFusedToken = createFusedToken;
|
|
504
|
-
exports.implicitMultiplyRule = implicitMultiplyRule;
|
|
505
|
-
exports.isInsideRangeContext = isInsideRangeContext;
|
|
506
|
-
//# sourceMappingURL=chunk-CUR2WLI4.cjs.map
|
|
507
|
-
//# sourceMappingURL=chunk-CUR2WLI4.cjs.map
|