solve-engine 2.24.0 → 2.26.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.
Files changed (258) hide show
  1. package/dist/{BytecodeBuilder-aqVa7Plx.d.cts → BytecodeBuilder-DSWKZi4f.d.cts} +11 -9
  2. package/dist/{BytecodeBuilder-aqVa7Plx.d.ts → BytecodeBuilder-DSWKZi4f.d.ts} +11 -9
  3. package/dist/CalendarBackend-MdS3Bb4P.d.cts +181 -0
  4. package/dist/CalendarBackend-MdS3Bb4P.d.ts +181 -0
  5. package/dist/{Configuration-DnzYPmoK.d.cts → Configuration-BxriK9Kw.d.cts} +63 -4
  6. package/dist/{Configuration-DnzYPmoK.d.ts → Configuration-BxriK9Kw.d.ts} +63 -4
  7. package/dist/DateCalendar-B85t6Vk6.d.ts +90 -0
  8. package/dist/DateCalendar-CUGI1fT4.d.cts +90 -0
  9. package/dist/{EngineError-D1kXsjIj.d.cts → EngineError-C-kBwYlN.d.cts} +33 -4
  10. package/dist/{EngineError-D1kXsjIj.d.ts → EngineError-C-kBwYlN.d.ts} +33 -4
  11. package/dist/{FormattingSettings-bRKjU7wI.d.ts → FormattingSettings-ByO-4wiM.d.cts} +14 -0
  12. package/dist/{FormattingSettings-bRKjU7wI.d.cts → FormattingSettings-CvCzAfsz.d.ts} +14 -0
  13. package/dist/{Lexer-CqagTewQ.d.ts → Lexer-DhGhoAa2.d.cts} +96 -37
  14. package/dist/{Lexer-CCHFDcgP.d.cts → Lexer-DqtnZMC5.d.ts} +96 -37
  15. package/dist/{PackageCompatibility-CeAPVHZr.d.cts → PackageCompatibility-CNiTtC6S.d.cts} +1 -1
  16. package/dist/{PackageCompatibility-Bq82y0ZN.d.ts → PackageCompatibility-fj_f7uqC.d.ts} +1 -1
  17. package/dist/{PackageRegistry-B9-7fJGH.d.cts → PackageRegistry-BHBCFswo.d.cts} +377 -15
  18. package/dist/{PackageRegistry-CDEgfhT_.d.ts → PackageRegistry-CNZUwWHJ.d.ts} +377 -15
  19. package/dist/{Parselet-4oH5OuRt.d.cts → Parselet-DF3864la.d.cts} +26 -4
  20. package/dist/{Parselet-BwDqKFfK.d.ts → Parselet-Dgymjxzd.d.ts} +26 -4
  21. package/dist/{Token-CbP_OutD.d.cts → Token-D8f7yaz1.d.cts} +17 -0
  22. package/dist/{Token-CbP_OutD.d.ts → Token-D8f7yaz1.d.ts} +17 -0
  23. package/dist/{TokenNormalizer-OTPS0Otq.d.ts → TokenNormalizer-IF7nPRMp.d.ts} +46 -27
  24. package/dist/{TokenNormalizer-MXaKLJ_m.d.cts → TokenNormalizer-Pe3_390t.d.cts} +46 -27
  25. package/dist/{ScopeManager-BQBhlDAu.d.ts → VMBuiltins-CZiZRKn-.d.ts} +92 -10
  26. package/dist/{ScopeManager-DrXB3Nvm.d.cts → VMBuiltins-kv4rr0y5.d.cts} +92 -10
  27. package/dist/{VMCheckpoints-C5jC92o3.d.ts → VMCheckpoints-DXze6ypg.d.ts} +3 -3
  28. package/dist/{VMCheckpoints-BK32PTl2.d.cts → VMCheckpoints-yun4ocSv.d.cts} +3 -3
  29. package/dist/{Value-Ds3Gy07C.d.cts → Value-BYHw-x7q.d.cts} +57 -1
  30. package/dist/{Value-Ds3Gy07C.d.ts → Value-BYHw-x7q.d.ts} +57 -1
  31. package/dist/{WorkerError-DaNWQFp1.d.cts → WorkerError-BLZyNq6M.d.cts} +1 -1
  32. package/dist/{WorkerError-CVQbs6_D.d.ts → WorkerError-CfBJYueR.d.ts} +1 -1
  33. package/dist/chunk-2SYYKQ4Q.cjs +2 -0
  34. package/dist/chunk-2SYYKQ4Q.cjs.map +1 -0
  35. package/dist/chunk-6EYKVQT3.cjs +2 -0
  36. package/dist/chunk-6EYKVQT3.cjs.map +1 -0
  37. package/dist/chunk-7RC6RBS6.cjs +2 -0
  38. package/dist/chunk-7RC6RBS6.cjs.map +1 -0
  39. package/dist/chunk-AZX4NTYN.cjs +3 -0
  40. package/dist/chunk-AZX4NTYN.cjs.map +1 -0
  41. package/dist/{chunk-PTQCHMYA.js → chunk-BCR53EIL.js} +2 -2
  42. package/dist/{chunk-PTQCHMYA.js.map → chunk-BCR53EIL.js.map} +1 -1
  43. package/dist/chunk-BLJ6E577.js +2 -0
  44. package/dist/chunk-BLJ6E577.js.map +1 -0
  45. package/dist/{chunk-CMZSK6FY.cjs → chunk-C5GEMKUY.cjs} +3 -3
  46. package/dist/{chunk-CMZSK6FY.cjs.map → chunk-C5GEMKUY.cjs.map} +1 -1
  47. package/dist/chunk-CL7DM2FX.js +2 -0
  48. package/dist/chunk-CL7DM2FX.js.map +1 -0
  49. package/dist/chunk-CQLCTKMX.cjs +2 -0
  50. package/dist/chunk-CQLCTKMX.cjs.map +1 -0
  51. package/dist/chunk-CQY23OF5.cjs +5 -0
  52. package/dist/chunk-CQY23OF5.cjs.map +1 -0
  53. package/dist/chunk-D4VBWPWN.js +2 -0
  54. package/dist/chunk-D4VBWPWN.js.map +1 -0
  55. package/dist/chunk-E4HAKNBQ.cjs +2 -0
  56. package/dist/chunk-E4HAKNBQ.cjs.map +1 -0
  57. package/dist/{chunk-GP4H5OIT.js → chunk-ESZNJQ2C.js} +3 -3
  58. package/dist/{chunk-GP4H5OIT.js.map → chunk-ESZNJQ2C.js.map} +1 -1
  59. package/dist/{chunk-IJMNVBIS.js → chunk-FAO6DQ74.js} +2 -2
  60. package/dist/chunk-FAO6DQ74.js.map +1 -0
  61. package/dist/{chunk-2VE4OW4A.cjs → chunk-FDKTESBC.cjs} +2 -2
  62. package/dist/{chunk-2VE4OW4A.cjs.map → chunk-FDKTESBC.cjs.map} +1 -1
  63. package/dist/{chunk-RN3ISTM3.cjs → chunk-G2V33LFM.cjs} +2 -2
  64. package/dist/{chunk-RN3ISTM3.cjs.map → chunk-G2V33LFM.cjs.map} +1 -1
  65. package/dist/chunk-GJZIJK2Q.cjs +2 -0
  66. package/dist/chunk-GJZIJK2Q.cjs.map +1 -0
  67. package/dist/chunk-GQM6ICDM.js +2 -0
  68. package/dist/chunk-GQM6ICDM.js.map +1 -0
  69. package/dist/chunk-GVL3ZMS7.cjs +2 -0
  70. package/dist/chunk-GVL3ZMS7.cjs.map +1 -0
  71. package/dist/chunk-GXO7TSXQ.cjs +3 -0
  72. package/dist/chunk-GXO7TSXQ.cjs.map +1 -0
  73. package/dist/{chunk-OMHRBKAT.js → chunk-HANGBVEE.js} +2 -2
  74. package/dist/{chunk-OMHRBKAT.js.map → chunk-HANGBVEE.js.map} +1 -1
  75. package/dist/chunk-J4K72CQN.js +2 -0
  76. package/dist/chunk-J4K72CQN.js.map +1 -0
  77. package/dist/chunk-LE6WZLJ4.js +2 -0
  78. package/dist/chunk-LE6WZLJ4.js.map +1 -0
  79. package/dist/chunk-LMZDTQS5.js +3 -0
  80. package/dist/chunk-LMZDTQS5.js.map +1 -0
  81. package/dist/chunk-LQIRBP4Q.js +2 -0
  82. package/dist/chunk-LQIRBP4Q.js.map +1 -0
  83. package/dist/{chunk-UXR7JIPX.js → chunk-LTUYWJGO.js} +2 -2
  84. package/dist/{chunk-UXR7JIPX.js.map → chunk-LTUYWJGO.js.map} +1 -1
  85. package/dist/chunk-MCU7UYKG.js +3 -0
  86. package/dist/{chunk-7EP36NXE.js.map → chunk-MCU7UYKG.js.map} +1 -1
  87. package/dist/chunk-MTN53APQ.js +5 -0
  88. package/dist/chunk-MTN53APQ.js.map +1 -0
  89. package/dist/chunk-OPKJ2WWB.cjs +3 -0
  90. package/dist/chunk-OPKJ2WWB.cjs.map +1 -0
  91. package/dist/chunk-QQHHZPEW.cjs +2 -0
  92. package/dist/chunk-QQHHZPEW.cjs.map +1 -0
  93. package/dist/chunk-RRUGQ6DM.js +2 -0
  94. package/dist/chunk-RRUGQ6DM.js.map +1 -0
  95. package/dist/chunk-S3ODNMJS.js +2 -0
  96. package/dist/chunk-S3ODNMJS.js.map +1 -0
  97. package/dist/{chunk-CDNJZBM3.cjs → chunk-SE6ZCGZ5.cjs} +2 -2
  98. package/dist/{chunk-CDNJZBM3.cjs.map → chunk-SE6ZCGZ5.cjs.map} +1 -1
  99. package/dist/chunk-TC23XEAV.js +2 -0
  100. package/dist/chunk-TC23XEAV.js.map +1 -0
  101. package/dist/{chunk-MWWAKZOD.cjs → chunk-TMQ37JQY.cjs} +3 -3
  102. package/dist/{chunk-MWWAKZOD.cjs.map → chunk-TMQ37JQY.cjs.map} +1 -1
  103. package/dist/chunk-TPPM4QSS.cjs +2 -0
  104. package/dist/chunk-TPPM4QSS.cjs.map +1 -0
  105. package/dist/chunk-VB6QMU2W.js +3 -0
  106. package/dist/chunk-VB6QMU2W.js.map +1 -0
  107. package/dist/chunk-VQO54ZMA.js +2 -0
  108. package/dist/chunk-VQO54ZMA.js.map +1 -0
  109. package/dist/chunk-Y7XRA2EV.js +2 -0
  110. package/dist/chunk-Y7XRA2EV.js.map +1 -0
  111. package/dist/{chunk-5IJD5L3O.cjs → chunk-YBQOQTVL.cjs} +2 -2
  112. package/dist/chunk-YBQOQTVL.cjs.map +1 -0
  113. package/dist/chunk-YG7UWQFV.js +2 -0
  114. package/dist/chunk-YG7UWQFV.js.map +1 -0
  115. package/dist/chunk-YS2OW75C.cjs +2 -0
  116. package/dist/chunk-YS2OW75C.cjs.map +1 -0
  117. package/dist/chunk-ZC2NPRLO.js +3 -0
  118. package/dist/chunk-ZC2NPRLO.js.map +1 -0
  119. package/dist/chunk-ZDJTDFTR.cjs +2 -0
  120. package/dist/chunk-ZDJTDFTR.cjs.map +1 -0
  121. package/dist/chunk-ZE5KKMBV.cjs +2 -0
  122. package/dist/chunk-ZE5KKMBV.cjs.map +1 -0
  123. package/dist/chunk-ZSLVLMO5.cjs +2 -0
  124. package/dist/chunk-ZSLVLMO5.cjs.map +1 -0
  125. package/dist/constants.cjs +1 -1
  126. package/dist/constants.d.cts +1 -1
  127. package/dist/constants.d.ts +1 -1
  128. package/dist/constants.js +1 -1
  129. package/dist/engine.cjs +1 -1
  130. package/dist/engine.d.cts +15 -13
  131. package/dist/engine.d.ts +15 -13
  132. package/dist/engine.js +1 -1
  133. package/dist/errors.cjs +1 -1
  134. package/dist/errors.d.cts +3 -3
  135. package/dist/errors.d.ts +3 -3
  136. package/dist/errors.js +1 -1
  137. package/dist/format.cjs +1 -1
  138. package/dist/format.d.cts +4 -3
  139. package/dist/format.d.ts +4 -3
  140. package/dist/format.js +1 -1
  141. package/dist/index.cjs +1 -1
  142. package/dist/index.cjs.map +1 -1
  143. package/dist/index.d.cts +16 -14
  144. package/dist/index.d.ts +16 -14
  145. package/dist/index.js +1 -1
  146. package/dist/index.js.map +1 -1
  147. package/dist/language.d.cts +13 -12
  148. package/dist/language.d.ts +13 -12
  149. package/dist/lexer.cjs +1 -1
  150. package/dist/lexer.cjs.map +1 -1
  151. package/dist/lexer.d.cts +9 -8
  152. package/dist/lexer.d.ts +9 -8
  153. package/dist/lexer.js +1 -1
  154. package/dist/lexer.js.map +1 -1
  155. package/dist/normalizer.cjs +1 -1
  156. package/dist/normalizer.d.cts +3 -3
  157. package/dist/normalizer.d.ts +3 -3
  158. package/dist/normalizer.js +1 -1
  159. package/dist/packages.cjs +1 -1
  160. package/dist/packages.d.cts +12 -11
  161. package/dist/packages.d.ts +12 -11
  162. package/dist/packages.js +1 -1
  163. package/dist/parser.cjs +1 -1
  164. package/dist/parser.d.cts +6 -5
  165. package/dist/parser.d.ts +6 -5
  166. package/dist/parser.js +1 -1
  167. package/dist/{pipeline-69q2tsLE.d.cts → pipeline-BYkKNpql.d.cts} +1 -1
  168. package/dist/{pipeline-DTqGLPsV.d.ts → pipeline-Cl7KW8CB.d.ts} +1 -1
  169. package/dist/resolvers.d.cts +3 -3
  170. package/dist/resolvers.d.ts +3 -3
  171. package/dist/temporal.cjs +2 -0
  172. package/dist/temporal.cjs.map +1 -0
  173. package/dist/temporal.d.cts +201 -0
  174. package/dist/temporal.d.ts +201 -0
  175. package/dist/temporal.js +2 -0
  176. package/dist/temporal.js.map +1 -0
  177. package/dist/testing.cjs +2 -2
  178. package/dist/testing.cjs.map +1 -1
  179. package/dist/testing.d.cts +13 -12
  180. package/dist/testing.d.ts +13 -12
  181. package/dist/testing.js +1 -1
  182. package/dist/testing.js.map +1 -1
  183. package/dist/uom.cjs +1 -1
  184. package/dist/uom.d.cts +3 -3
  185. package/dist/uom.d.ts +3 -3
  186. package/dist/uom.js +1 -1
  187. package/dist/vm.cjs +1 -1
  188. package/dist/vm.cjs.map +1 -1
  189. package/dist/vm.d.cts +9 -57
  190. package/dist/vm.d.ts +9 -57
  191. package/dist/vm.js +1 -1
  192. package/dist/vm.js.map +1 -1
  193. package/dist/worker.cjs +2 -2
  194. package/dist/worker.cjs.map +1 -1
  195. package/dist/worker.d.cts +36 -14
  196. package/dist/worker.d.ts +36 -14
  197. package/dist/worker.js +2 -2
  198. package/dist/worker.js.map +1 -1
  199. package/package.json +16 -5
  200. package/dist/chunk-2BXNZM3G.js +0 -2
  201. package/dist/chunk-2BXNZM3G.js.map +0 -1
  202. package/dist/chunk-2JSNWYYA.cjs +0 -3
  203. package/dist/chunk-2JSNWYYA.cjs.map +0 -1
  204. package/dist/chunk-3SHWTGTP.js +0 -2
  205. package/dist/chunk-3SHWTGTP.js.map +0 -1
  206. package/dist/chunk-5GL4SAVH.cjs +0 -2
  207. package/dist/chunk-5GL4SAVH.cjs.map +0 -1
  208. package/dist/chunk-5IJD5L3O.cjs.map +0 -1
  209. package/dist/chunk-72N3ZRVE.cjs +0 -2
  210. package/dist/chunk-72N3ZRVE.cjs.map +0 -1
  211. package/dist/chunk-7EP36NXE.js +0 -3
  212. package/dist/chunk-A4JV7HRB.js +0 -3
  213. package/dist/chunk-A4JV7HRB.js.map +0 -1
  214. package/dist/chunk-AUOE7MFI.cjs +0 -2
  215. package/dist/chunk-AUOE7MFI.cjs.map +0 -1
  216. package/dist/chunk-BDF4VCQX.js +0 -3
  217. package/dist/chunk-BDF4VCQX.js.map +0 -1
  218. package/dist/chunk-D2Q2VFJ6.js +0 -2
  219. package/dist/chunk-D2Q2VFJ6.js.map +0 -1
  220. package/dist/chunk-DA7M6H63.cjs +0 -2
  221. package/dist/chunk-DA7M6H63.cjs.map +0 -1
  222. package/dist/chunk-ELQQKZN3.cjs +0 -3
  223. package/dist/chunk-ELQQKZN3.cjs.map +0 -1
  224. package/dist/chunk-F7QIBC4B.cjs +0 -3
  225. package/dist/chunk-F7QIBC4B.cjs.map +0 -1
  226. package/dist/chunk-HQ7BKXG7.js +0 -2
  227. package/dist/chunk-HQ7BKXG7.js.map +0 -1
  228. package/dist/chunk-IHAZL4EF.cjs +0 -2
  229. package/dist/chunk-IHAZL4EF.cjs.map +0 -1
  230. package/dist/chunk-IJMNVBIS.js.map +0 -1
  231. package/dist/chunk-IPSOWFCA.js +0 -2
  232. package/dist/chunk-IPSOWFCA.js.map +0 -1
  233. package/dist/chunk-LM6ZQUEU.js +0 -2
  234. package/dist/chunk-LM6ZQUEU.js.map +0 -1
  235. package/dist/chunk-LTJV3VJE.cjs +0 -2
  236. package/dist/chunk-LTJV3VJE.cjs.map +0 -1
  237. package/dist/chunk-NUF66H57.js +0 -5
  238. package/dist/chunk-NUF66H57.js.map +0 -1
  239. package/dist/chunk-PWWQZFAE.js +0 -2
  240. package/dist/chunk-PWWQZFAE.js.map +0 -1
  241. package/dist/chunk-RE6AIU6Y.js +0 -3
  242. package/dist/chunk-RE6AIU6Y.js.map +0 -1
  243. package/dist/chunk-RECRD45C.cjs +0 -5
  244. package/dist/chunk-RECRD45C.cjs.map +0 -1
  245. package/dist/chunk-RENO2AWO.js +0 -2
  246. package/dist/chunk-RENO2AWO.js.map +0 -1
  247. package/dist/chunk-RMCN5WFO.cjs +0 -2
  248. package/dist/chunk-RMCN5WFO.cjs.map +0 -1
  249. package/dist/chunk-S46R5QZP.cjs +0 -2
  250. package/dist/chunk-S46R5QZP.cjs.map +0 -1
  251. package/dist/chunk-UPH22K2T.cjs +0 -2
  252. package/dist/chunk-UPH22K2T.cjs.map +0 -1
  253. package/dist/chunk-UY3ID6JF.cjs +0 -2
  254. package/dist/chunk-UY3ID6JF.cjs.map +0 -1
  255. package/dist/chunk-WFOQRPA6.js +0 -2
  256. package/dist/chunk-WFOQRPA6.js.map +0 -1
  257. package/dist/chunk-XFJABR3B.js +0 -2
  258. package/dist/chunk-XFJABR3B.js.map +0 -1
@@ -1,4 +1,5 @@
1
- import { T as Token } from './Token-CbP_OutD.cjs';
1
+ import { T as Token } from './Token-D8f7yaz1.js';
2
+ import { E as EngineError } from './EngineError-C-kBwYlN.js';
2
3
 
3
4
  /** Trie node for multi-word phrase matching. */
4
5
  interface PhraseNode {
@@ -101,6 +102,14 @@ interface ScanLineResult {
101
102
  tokens: Token[];
102
103
  /** Inline solve spans found in this line (empty if none). */
103
104
  inlineSolves: InlineSolveSpan[];
105
+ /**
106
+ * The structured error the tokeniser raised on this line, if it raised one
107
+ * (an unterminated string literal is the one it can raise today). The line
108
+ * carries no tokens then, and the rest of the document is unaffected: a
109
+ * half-typed quote used to escape {@link ExpressionLexer.scanDocument} as
110
+ * a throw and take every other line's result down with it.
111
+ */
112
+ error?: EngineError;
104
113
  }
105
114
  /**
106
115
  * A token, as the lexer produces it.
@@ -120,9 +129,19 @@ declare class LexerToken implements Token {
120
129
  col: number;
121
130
  /** See {@link Token.sourceEnd}. Set only on normalizer-fused tokens. */
122
131
  sourceEnd?: number | undefined;
132
+ /** See {@link Token.fault}. Set only on a fused token standing for a run the engine refuses to read. */
133
+ fault?: {
134
+ readonly code: string;
135
+ readonly message: string;
136
+ } | undefined;
123
137
  constructor(type: string, typeId: number, value: string, text: string, offset: number, lineBreaks: number, line: number, col: number,
124
138
  /** See {@link Token.sourceEnd}. Set only on normalizer-fused tokens. */
125
- sourceEnd?: number | undefined);
139
+ sourceEnd?: number | undefined,
140
+ /** See {@link Token.fault}. Set only on a fused token standing for a run the engine refuses to read. */
141
+ fault?: {
142
+ readonly code: string;
143
+ readonly message: string;
144
+ } | undefined);
126
145
  }
127
146
  /**
128
147
  * Plugin interface for extending the ExpressionLexer with custom tokens.
@@ -208,16 +227,6 @@ interface LexerVocabulary {
208
227
  */
209
228
  declare class ExpressionLexer {
210
229
  private static readonly CHAR_CLASS;
211
- /**
212
- * Configured TokenLookup from TokenClassRegistry. When set, replaces
213
- * the internal keyword map and unit set with registry-built equivalents.
214
- * Enables data-driven keyword/unit registration across locale keywords,
215
- * provider keywords, and plugins.
216
- *
217
- * Set at construction time via the constructor parameter. Plugin-registered
218
- * keywords/units (via registerVocabulary()) are checked alongside
219
- * the configuredLookup, neither source is bypassed.
220
- */ private configuredLookup;
221
230
  private input;
222
231
  private pos;
223
232
  private len;
@@ -227,7 +236,16 @@ declare class ExpressionLexer {
227
236
  private keywordMap;
228
237
  private mergedKeywords;
229
238
  private mergedUnits;
230
- private pluginKeywordMap;
239
+ /**
240
+ * Who registered each plugin keyword, unit and two-character operator, in
241
+ * registration order. Two packages may claim the same word (the
242
+ * compatibility index warns, and the last registered wins, as before); the
243
+ * owner lists make unregistration exact, so removing one package hands the
244
+ * word back to the other rather than deleting it for both.
245
+ */
246
+ private pluginKeywordOwners;
247
+ private pluginUnitOwners;
248
+ private pluginOperatorOwners;
231
249
  private pluginOperators;
232
250
  private pluginUnits;
233
251
  private hasPluginOps;
@@ -235,7 +253,7 @@ declare class ExpressionLexer {
235
253
  private locale;
236
254
  /**
237
255
  * Inline solve spans collected during the most recent tokenization pass.
238
- * Populated by [Symbol.iterator]() and consumed by scanDocument().
256
+ * Populated by tokenizeInto() and consumed by scanDocument().
239
257
  */
240
258
  _inlineSolveSpans: InlineSolveSpan[];
241
259
  private pluginRawLinePatterns;
@@ -260,7 +278,14 @@ declare class ExpressionLexer {
260
278
  private matchRawLine;
261
279
  /** Rebuild merged keyword and unit collections after plugin registration. */
262
280
  private rebuildMergedUnits;
263
- constructor(localeCode?: string, lookup?: TokenLookup);
281
+ /**
282
+ * @param localeCode - Locale whose keyword table seeds the lexer.
283
+ * @param _lookup - Ignored. The lexer built its keyword, unit and phrase
284
+ * tables from the locale and the registered packages and never read the
285
+ * lookup it was handed; the parameter stays so existing callers compile.
286
+ * @deprecated Removed in 3.0.
287
+ */
288
+ constructor(localeCode?: string, _lookup?: TokenLookup);
264
289
  /**
265
290
  * Register a plugin to extend the lexer with custom tokens.
266
291
  *
@@ -276,6 +301,10 @@ declare class ExpressionLexer {
276
301
  * that conflicts with a built-in one.
277
302
  */
278
303
  registerVocabulary(plugin: LexerVocabulary): void;
304
+ /** Record `owner`'s claim on `key`. The newest claim is the one in force. */
305
+ private claim;
306
+ /** Drop `owner`'s claim on `key`, and return the claim now in force, if any is left. */
307
+ private release;
279
308
  /**
280
309
  * Unregister a plugin, removing its custom tokens from the lexer.
281
310
  *
@@ -307,9 +336,9 @@ declare class ExpressionLexer {
307
336
  * lines that classifyLine() marks as having inline solves.
308
337
  *
309
338
  * Tokenization is scoped to each line by temporarily restricting
310
- * `this.len` to the line end position, so the [Symbol.iterator]
311
- * generator naturally stops at the line boundary. After tokenization,
312
- * `this.len` is restored and `this.pos` advances past the newline.
339
+ * `this.len` to the line end position, so tokenizeInto() naturally
340
+ * stops at the line boundary. After tokenization, `this.len` is
341
+ * restored and `this.pos` advances past the newline.
313
342
  *
314
343
  * @param text The full document text (with newlines).
315
344
  * @returns Array of ScanLineResult, one per line, in document order.
@@ -318,9 +347,7 @@ declare class ExpressionLexer {
318
347
  /**
319
348
  * Tokenize an expression string into an array of Tokens.
320
349
  *
321
- * Delegates to the lazy [Symbol.iterator]() generator and collects all
322
- * yielded tokens via Array.from(). For memory-sensitive use cases, prefer
323
- * iterating the lexer directly with for...of to avoid array allocation.
350
+ * Runs {@link tokenizeInto} into a fresh array.
324
351
  *
325
352
  * Optimizations:
326
353
  * - CHAR_CLASS jump table (Uint8Array) → switch on small integers
@@ -332,20 +359,31 @@ declare class ExpressionLexer {
332
359
  */
333
360
  tokenizeAll(): Token[];
334
361
  /**
335
- * Lazy token-by-token generator. Yields each token without allocating an
336
- * intermediate Token[] array. Supports for...of and spread usage.
362
+ * Scan the current input and append every token to `out`.
363
+ *
364
+ * This is the scanner itself: {@link tokenizeAll} and the iterator are
365
+ * thin wrappers over it. It pushes into an array the caller owns rather
366
+ * than yielding, because a generator paid a resume per token and
367
+ * `Array.from` a second pass on top, and because a caller that catches a
368
+ * tokeniser fault (highlighting a line with an unterminated quote) still
369
+ * holds the tokens read before it.
337
370
  *
338
- * Usage:
339
- * for (const t of lexer) { ... } // lazy, no array allocation
340
- * const tokens = [...lexer]; // materializes via spread
341
- * const tokens = lexer.tokenizeAll(); // materializes via Array.from()
371
+ * IMPORTANT: `this.len` is read ONCE on entry (const len = this.len).
372
+ * `scanDocument()` relies on this to scope a pass to a single line by
373
+ * restricting `this.len` to the line end before calling. Do not re-read
374
+ * `this.len` mid-loop without also updating `scanDocument()`.
342
375
  *
343
- * IMPORTANT: This generator captures `this.len` ONCE at creation time
344
- * (const len = this.len). `scanDocument()` relies on this behavior to
345
- * scope tokenization to a single line by temporarily restricting
346
- * `this.len` to the line end position before creating the iterator.
347
- * Do NOT refactor to re-read `this.len` mid-loop without also updating
348
- * `scanDocument()`.
376
+ * @param out - The array to append to. Left as it was if the input is empty.
377
+ */
378
+ tokenizeInto(out: Token[]): void;
379
+ /**
380
+ * Iterate the tokens of the current input.
381
+ *
382
+ * Runs {@link tokenizeInto} first, so the tokens are the same as before,
383
+ * but a fault part way through the line is thrown from the first
384
+ * `next()` rather than at the token it occurred on. A caller that wants
385
+ * the tokens read before a fault calls {@link tokenizeInto} with its own
386
+ * array.
349
387
  */
350
388
  [Symbol.iterator](): Generator<Token, void, undefined>;
351
389
  /**
@@ -456,6 +494,27 @@ declare class ExpressionLexer {
456
494
  * `#12345` (length 5), `#ff0000zz` (trailing word) do not.
457
495
  */
458
496
  private matchHexColourEnd;
497
+ /**
498
+ * Whether an inline-solve opener (`s` + backtick) occurs in `[from, end)`.
499
+ *
500
+ * Bounded by hand rather than written as `input.indexOf("s\`", from)`. This
501
+ * used to be the `indexOf` form with an `idx < end` check afterwards, which
502
+ * is correct but not bounded: when {@link scanDocument} is classifying,
503
+ * `this.input` is the whole document, so a line with no marker scanned to
504
+ * the END OF THE DOCUMENT before the check could reject the hit. Every line
505
+ * paid for every line after it, and a whole-document parse was quadratic in
506
+ * line count (measured at 28.9 us per line at 10,000 lines against 10.1 us
507
+ * at 1,000, and two thirds of the parse's self time in a profile). A prose
508
+ * document with many candidate `s` characters was worse still. The
509
+ * wikilink close in {@link indexOfWithin} had the same shape.
510
+ */
511
+ private hasInlineSolveWithin;
512
+ /**
513
+ * `input.indexOf(needle, from)` restricted to `[from, end)`, returning -1
514
+ * when the needle does not occur wholly before `end`. See
515
+ * {@link hasInlineSolveWithin} for why the plain `indexOf` was not enough.
516
+ */
517
+ private indexOfWithin;
459
518
  private classifyFromPositions;
460
519
  /**
461
520
  * Classify a single line of markdown text.
@@ -530,11 +589,11 @@ declare class Lexer {
530
589
  private tokenIdx;
531
590
  /**
532
591
  * @param localeCode - Locale code (e.g., "en", "de"). Defaults to "en".
533
- * @param tokenLookup - Optional TokenLookup from TokenClassRegistry.
534
- * When provided, configures ExpressionLexer to use registry-built
535
- * keyword/unit/phrase lookups instead of internal instance maps.
592
+ * @param _tokenLookup - Ignored. The lexer never read the lookup it was
593
+ * handed; the parameter stays so existing callers compile.
594
+ * @deprecated Removed in 3.0.
536
595
  */
537
- constructor(localeCode?: string, tokenLookup?: TokenLookup);
596
+ constructor(localeCode?: string, _tokenLookup?: TokenLookup);
538
597
  reset(input: string, state?: LexerState): void;
539
598
  /**
540
599
  * Classify a single line of markdown text (Phase B).
@@ -1,4 +1,4 @@
1
- import { I as IEnginePackage } from './PackageRegistry-B9-7fJGH.cjs';
1
+ import { I as IEnginePackage } from './PackageRegistry-BHBCFswo.cjs';
2
2
 
3
3
  /**
4
4
  * Package load-time compatibility checking, the "detect overlapping
@@ -1,4 +1,4 @@
1
- import { I as IEnginePackage } from './PackageRegistry-CDEgfhT_.js';
1
+ import { I as IEnginePackage } from './PackageRegistry-CNZUwWHJ.js';
2
2
 
3
3
  /**
4
4
  * Package load-time compatibility checking, the "detect overlapping