@samva/markup 0.1.0 → 0.1.2

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 (74) hide show
  1. package/dist/ast.js +1 -1
  2. package/dist/{checks-CW0nFj5n.js → checks-D-zFQt5R.js} +2 -2
  3. package/dist/checks.js +1 -1
  4. package/dist/compile-sms.d.ts +1 -1
  5. package/dist/compile-whatsapp.d.ts +1 -1
  6. package/dist/components.d.ts +3 -3
  7. package/dist/conditionals.js +1 -1
  8. package/dist/diagnostics.js +2 -2
  9. package/dist/jsx-dev-runtime.d.ts +1 -1
  10. package/dist/{jsx-runtime-fSxcvlx4.d.ts → jsx-runtime-eNIMY87F.d.ts} +2 -2
  11. package/dist/jsx-runtime.d.ts +1 -1
  12. package/dist/ops.js +2 -2
  13. package/dist/{parser-yzjUOGhc.d.ts → parser-DkQKIjDa.d.ts} +11 -2
  14. package/dist/parser.d.ts +2 -2
  15. package/dist/parser.js +48 -9
  16. package/dist/predicate-CvkzT-a2.js +539 -0
  17. package/dist/{predicate-DTtVtLK7.d.ts → predicate-G2SeSvoN.d.ts} +9 -2
  18. package/dist/predicate.d.ts +2 -2
  19. package/dist/predicate.js +2 -417
  20. package/dist/presets/category-mapping.d.ts +1 -1
  21. package/dist/presets/public-gallery.d.ts +2 -490
  22. package/dist/presets/public-gallery.js +2 -1
  23. package/dist/presets/public-handoff.d.ts +2 -68
  24. package/dist/presets/public-handoff.js +110 -24
  25. package/dist/presets/public-preview-artifacts.d.ts +2 -2
  26. package/dist/presets/public-preview.d.ts +2 -1168
  27. package/dist/presets/public-preview.js +17 -17
  28. package/dist/presets/sources.js +17 -17
  29. package/dist/public-gallery-D0Zv0pZE.d.ts +611 -0
  30. package/dist/public-preview-u1Z9aaGq.d.ts +1168 -0
  31. package/dist/render-template.d.ts +2 -2
  32. package/dist/render-template.js +1 -1
  33. package/dist/{variables-3NGLpNTB.d.ts → variables-if1VrV34.d.ts} +2 -2
  34. package/dist/variables.d.ts +1 -1
  35. package/dist/variables.js +1 -1
  36. package/generated/sml-email-language-reference.md +1 -1
  37. package/generated/sml-language-reference.md +1 -1
  38. package/package.json +6 -3
  39. package/dist/ast.js.map +0 -1
  40. package/dist/candidate.js.map +0 -1
  41. package/dist/checks-CW0nFj5n.js.map +0 -1
  42. package/dist/classes.js.map +0 -1
  43. package/dist/compile-sms.js.map +0 -1
  44. package/dist/compile-whatsapp.js.map +0 -1
  45. package/dist/compile.js.map +0 -1
  46. package/dist/components.js.map +0 -1
  47. package/dist/conditionals.js.map +0 -1
  48. package/dist/diagnostics.js.map +0 -1
  49. package/dist/emit.js.map +0 -1
  50. package/dist/footer.js.map +0 -1
  51. package/dist/interpolate.js.map +0 -1
  52. package/dist/jsx-dev-runtime.js.map +0 -1
  53. package/dist/jsx-runtime.js.map +0 -1
  54. package/dist/lexer.js.map +0 -1
  55. package/dist/model.js.map +0 -1
  56. package/dist/ops.js.map +0 -1
  57. package/dist/parser.js.map +0 -1
  58. package/dist/predicate.js.map +0 -1
  59. package/dist/presets/category-mapping.js.map +0 -1
  60. package/dist/presets/public-gallery.js.map +0 -1
  61. package/dist/presets/public-handoff.js.map +0 -1
  62. package/dist/presets/public-preview-artifacts.js.map +0 -1
  63. package/dist/presets/public-preview.js.map +0 -1
  64. package/dist/presets/sources.js.map +0 -1
  65. package/dist/presets.js.map +0 -1
  66. package/dist/printer.js.map +0 -1
  67. package/dist/registry.js.map +0 -1
  68. package/dist/render-template.js.map +0 -1
  69. package/dist/sms-segments.js.map +0 -1
  70. package/dist/theme-css.js.map +0 -1
  71. package/dist/theme.js.map +0 -1
  72. package/dist/tokens.js.map +0 -1
  73. package/dist/variables.js.map +0 -1
  74. package/dist/version-BITr58kk.js.map +0 -1
@@ -0,0 +1,539 @@
1
+ import { Result } from "effect";
2
+ //#region src/limits.ts
3
+ /** Hard ceilings shared by SML documents and standalone predicate parsing. */
4
+ const SML_PARSER_LIMITS = {
5
+ maxCharacters: 5e5,
6
+ maxUtf8Bytes: 1048576,
7
+ maxDepth: 64,
8
+ maxNodes: 25e3
9
+ };
10
+ //#endregion
11
+ //#region src/predicate.ts
12
+ /** Standalone predicates inherit the same source, nesting, and node ceilings as SML. */
13
+ const PREDICATE_PARSER_LIMITS = SML_PARSER_LIMITS;
14
+ const CHAR_TAB = 9;
15
+ const CHAR_LINE_FEED = 10;
16
+ const CHAR_CARRIAGE_RETURN = 13;
17
+ const CHAR_SPACE = 32;
18
+ const CHAR_BANG = 33;
19
+ const CHAR_SINGLE_QUOTE = 39;
20
+ const CHAR_OPEN_PAREN = 40;
21
+ const CHAR_CLOSE_PAREN = 41;
22
+ const CHAR_MINUS = 45;
23
+ const CHAR_DOT = 46;
24
+ const CHAR_LESS_THAN = 60;
25
+ const CHAR_EQUALS = 61;
26
+ const CHAR_GREATER_THAN = 62;
27
+ const CHAR_UNDERSCORE = 95;
28
+ const CHAR_0 = 48;
29
+ const CHAR_9 = 57;
30
+ const CHAR_UPPER_A = 65;
31
+ const CHAR_UPPER_Z = 90;
32
+ const CHAR_LOWER_A = 97;
33
+ const CHAR_LOWER_Z = 122;
34
+ const isWhitespace = (code) => code === CHAR_SPACE || code === CHAR_TAB || code === CHAR_LINE_FEED || code === CHAR_CARRIAGE_RETURN;
35
+ const isDigit = (code) => code >= CHAR_0 && code <= CHAR_9;
36
+ const isLetter = (code) => code >= CHAR_UPPER_A && code <= CHAR_UPPER_Z || code >= CHAR_LOWER_A && code <= CHAR_LOWER_Z;
37
+ const isNameStart = (code) => isLetter(code) || code === CHAR_UNDERSCORE;
38
+ const isNameChar = (code) => isNameStart(code) || isDigit(code);
39
+ const KEYWORDS = [
40
+ "and",
41
+ "or",
42
+ "not"
43
+ ];
44
+ const isKeyword = (text) => KEYWORDS.includes(text);
45
+ const tokenize = (source, baseOffset) => {
46
+ const tokens = [];
47
+ let index = 0;
48
+ const length = source.length;
49
+ const failAt = (code, message, start, end) => Result.fail({ diagnostic: {
50
+ code,
51
+ message,
52
+ span: {
53
+ start: baseOffset + start,
54
+ end: baseOffset + end
55
+ }
56
+ } });
57
+ while (index < length) {
58
+ const code = source.charCodeAt(index);
59
+ if (isWhitespace(code)) {
60
+ index++;
61
+ continue;
62
+ }
63
+ const start = index;
64
+ if (code === CHAR_OPEN_PAREN) {
65
+ index++;
66
+ tokens.push({
67
+ kind: "lparen",
68
+ text: "(",
69
+ span: {
70
+ start: baseOffset + start,
71
+ end: baseOffset + index
72
+ }
73
+ });
74
+ continue;
75
+ }
76
+ if (code === CHAR_CLOSE_PAREN) {
77
+ index++;
78
+ tokens.push({
79
+ kind: "rparen",
80
+ text: ")",
81
+ span: {
82
+ start: baseOffset + start,
83
+ end: baseOffset + index
84
+ }
85
+ });
86
+ continue;
87
+ }
88
+ if (code === CHAR_EQUALS || code === CHAR_BANG) {
89
+ if (source.charCodeAt(index + 1) === CHAR_EQUALS) {
90
+ index += 2;
91
+ tokens.push({
92
+ kind: "op",
93
+ text: code === CHAR_EQUALS ? "==" : "!=",
94
+ span: {
95
+ start: baseOffset + start,
96
+ end: baseOffset + index
97
+ }
98
+ });
99
+ continue;
100
+ }
101
+ return failAt("predicate-invalid-operator", `unexpected ${String.fromCharCode(code)} — ${code === CHAR_EQUALS ? "write == to compare" : "write != to compare"}`, start, start + 1);
102
+ }
103
+ if (code === CHAR_GREATER_THAN || code === CHAR_LESS_THAN) {
104
+ index++;
105
+ if (source.charCodeAt(index) === CHAR_EQUALS) index++;
106
+ tokens.push({
107
+ kind: "op",
108
+ text: source.slice(start, index),
109
+ span: {
110
+ start: baseOffset + start,
111
+ end: baseOffset + index
112
+ }
113
+ });
114
+ continue;
115
+ }
116
+ if (code === CHAR_SINGLE_QUOTE) {
117
+ index++;
118
+ const contentStart = index;
119
+ while (index < length && source.charCodeAt(index) !== CHAR_SINGLE_QUOTE) index++;
120
+ if (index >= length) return failAt("predicate-unterminated-string", "unterminated string — add a closing '", start, length);
121
+ const value = source.slice(contentStart, index);
122
+ index++;
123
+ if (value.includes("--")) return failAt("predicate-string-double-dash", "string literals cannot contain -- (predicates are embedded in HTML comment markers)", start, index);
124
+ tokens.push({
125
+ kind: "string",
126
+ text: source.slice(start, index),
127
+ string: value,
128
+ span: {
129
+ start: baseOffset + start,
130
+ end: baseOffset + index
131
+ }
132
+ });
133
+ continue;
134
+ }
135
+ if (isDigit(code) || code === CHAR_MINUS && isDigit(source.charCodeAt(index + 1))) {
136
+ index++;
137
+ while (index < length && isDigit(source.charCodeAt(index))) index++;
138
+ if (source.charCodeAt(index) === CHAR_DOT && isDigit(source.charCodeAt(index + 1))) {
139
+ index++;
140
+ while (index < length && isDigit(source.charCodeAt(index))) index++;
141
+ }
142
+ tokens.push({
143
+ kind: "number",
144
+ text: source.slice(start, index),
145
+ number: Number.parseFloat(source.slice(start, index)),
146
+ span: {
147
+ start: baseOffset + start,
148
+ end: baseOffset + index
149
+ }
150
+ });
151
+ continue;
152
+ }
153
+ if (isNameStart(code)) {
154
+ index++;
155
+ while (index < length && isNameChar(source.charCodeAt(index))) index++;
156
+ if (source.charCodeAt(index) === CHAR_DOT) return failAt("predicate-path-not-supported", `unexpected . after "${source.slice(start, index)}" — predicates use flat variable names, not paths`, start, index + 1);
157
+ tokens.push({
158
+ kind: "name",
159
+ text: source.slice(start, index),
160
+ span: {
161
+ start: baseOffset + start,
162
+ end: baseOffset + index
163
+ }
164
+ });
165
+ continue;
166
+ }
167
+ if (code === CHAR_DOT) return failAt("predicate-path-not-supported", "unexpected . — predicates use flat variable names, not paths", start, start + 1);
168
+ return failAt("predicate-unexpected-character", `unexpected character ${JSON.stringify(String.fromCharCode(code))} in predicate`, start, start + 1);
169
+ }
170
+ tokens.push({
171
+ kind: "eof",
172
+ text: "",
173
+ span: {
174
+ start: baseOffset + length,
175
+ end: baseOffset + length
176
+ }
177
+ });
178
+ return Result.succeed(tokens);
179
+ };
180
+ const COMPARISON_OPS = [
181
+ "==",
182
+ "!=",
183
+ ">",
184
+ ">=",
185
+ "<",
186
+ "<="
187
+ ];
188
+ /**
189
+ * Parses a predicate. `baseOffset` is the absolute source offset of the
190
+ * predicate's first character (an <If> test attribute passes valueSpan.start),
191
+ * so diagnostic and node spans point into the containing document.
192
+ */
193
+ const parsePredicate = (source, baseOffset = 0) => {
194
+ if (source.length > SML_PARSER_LIMITS.maxCharacters) return Result.fail([{
195
+ code: "predicate-character-limit",
196
+ message: `predicate exceeds the ${SML_PARSER_LIMITS.maxCharacters} character limit`,
197
+ span: {
198
+ start: baseOffset,
199
+ end: baseOffset + source.length
200
+ }
201
+ }]);
202
+ if (new TextEncoder().encode(source).byteLength > SML_PARSER_LIMITS.maxUtf8Bytes) return Result.fail([{
203
+ code: "predicate-byte-limit",
204
+ message: `predicate exceeds the ${SML_PARSER_LIMITS.maxUtf8Bytes} byte UTF-8 limit`,
205
+ span: {
206
+ start: baseOffset,
207
+ end: baseOffset + source.length
208
+ }
209
+ }]);
210
+ const lexed = tokenize(source, baseOffset);
211
+ if (Result.isFailure(lexed)) return Result.fail([lexed.failure.diagnostic]);
212
+ const tokens = lexed.success;
213
+ let index = 0;
214
+ let diagnostic;
215
+ let nodeCount = 0;
216
+ const fail = (code, message, span) => {
217
+ diagnostic ??= {
218
+ code,
219
+ message,
220
+ span
221
+ };
222
+ return null;
223
+ };
224
+ const peek = () => tokens[index];
225
+ const advance = () => tokens[index++];
226
+ const isKeywordToken = (token, keyword) => token.kind === "name" && token.text === keyword;
227
+ const countNode = (node) => {
228
+ nodeCount += 1;
229
+ return nodeCount > SML_PARSER_LIMITS.maxNodes ? fail("predicate-node-limit", `predicate exceeds the ${SML_PARSER_LIMITS.maxNodes} node limit`, node.span) : node;
230
+ };
231
+ const parsePrimary = (depth) => {
232
+ const token = advance();
233
+ if (token.kind === "lparen") {
234
+ if (depth >= SML_PARSER_LIMITS.maxDepth) return fail("predicate-depth-limit", `predicate nesting exceeds the maximum depth of ${SML_PARSER_LIMITS.maxDepth}`, token.span);
235
+ const inner = parseOr(depth + 1);
236
+ if (inner === null) return null;
237
+ const close = advance();
238
+ if (close.kind !== "rparen") return fail("predicate-missing-paren", "missing ) — close the group", close.span);
239
+ return inner;
240
+ }
241
+ if (token.kind === "name") {
242
+ if (isKeyword(token.text)) return fail("predicate-unexpected-token", `unexpected "${token.text}" — expected a variable name, comparison, or ( group )`, token.span);
243
+ const opToken = peek();
244
+ if (opToken.kind !== "op") return countNode({
245
+ kind: "name",
246
+ name: token.text,
247
+ span: token.span
248
+ });
249
+ advance();
250
+ const op = COMPARISON_OPS.find((candidate) => candidate === opToken.text);
251
+ if (op === void 0) return fail("predicate-invalid-operator", `unknown operator ${opToken.text} — use ==, !=, >, >=, <, or <=`, opToken.span);
252
+ const literalToken = advance();
253
+ if (literalToken.kind === "string") return countNode({
254
+ kind: "comparison",
255
+ name: token.text,
256
+ op,
257
+ literal: {
258
+ kind: "string",
259
+ value: literalToken.string
260
+ },
261
+ span: {
262
+ start: token.span.start,
263
+ end: literalToken.span.end
264
+ }
265
+ });
266
+ if (literalToken.kind === "number") return countNode({
267
+ kind: "comparison",
268
+ name: token.text,
269
+ op,
270
+ literal: {
271
+ kind: "number",
272
+ value: literalToken.number
273
+ },
274
+ span: {
275
+ start: token.span.start,
276
+ end: literalToken.span.end
277
+ }
278
+ });
279
+ return fail("predicate-expected-literal", `expected a literal after ${op} — write ${token.text} ${op} 'value' or ${token.text} ${op} 5`, literalToken.span);
280
+ }
281
+ if (token.kind === "eof") return fail("predicate-unexpected-end", "unexpected end of predicate — expected a variable name, comparison, or ( group )", token.span);
282
+ return fail("predicate-unexpected-token", `unexpected ${token.text} — comparisons put the variable first: name == 'value'`, token.span);
283
+ };
284
+ const parseUnary = (depth) => {
285
+ const token = peek();
286
+ if (isKeywordToken(token, "not")) {
287
+ advance();
288
+ const operand = parsePrimary(depth);
289
+ if (operand === null) return null;
290
+ return countNode({
291
+ kind: "not",
292
+ operand,
293
+ span: {
294
+ start: token.span.start,
295
+ end: operand.span.end
296
+ }
297
+ });
298
+ }
299
+ return parsePrimary(depth);
300
+ };
301
+ const parseAnd = (depth) => {
302
+ let left = parseUnary(depth);
303
+ while (left !== null && isKeywordToken(peek(), "and")) {
304
+ advance();
305
+ const right = parseUnary(depth);
306
+ if (right === null) return null;
307
+ left = countNode({
308
+ kind: "and",
309
+ left,
310
+ right,
311
+ span: {
312
+ start: left.span.start,
313
+ end: right.span.end
314
+ }
315
+ });
316
+ }
317
+ return left;
318
+ };
319
+ const parseOr = (depth) => {
320
+ let left = parseAnd(depth);
321
+ while (left !== null && isKeywordToken(peek(), "or")) {
322
+ advance();
323
+ const right = parseAnd(depth);
324
+ if (right === null) return null;
325
+ left = countNode({
326
+ kind: "or",
327
+ left,
328
+ right,
329
+ span: {
330
+ start: left.span.start,
331
+ end: right.span.end
332
+ }
333
+ });
334
+ }
335
+ return left;
336
+ };
337
+ if (source.trim().length === 0) return Result.fail([{
338
+ code: "predicate-empty",
339
+ message: "empty predicate — write e.g. plan == 'pro'",
340
+ span: {
341
+ start: baseOffset,
342
+ end: baseOffset + source.length
343
+ }
344
+ }]);
345
+ const ast = parseOr(0);
346
+ if (ast !== null && diagnostic === void 0) {
347
+ const trailing = peek();
348
+ if (trailing.kind !== "eof") fail("predicate-trailing-input", `unexpected ${JSON.stringify(trailing.text)} after the predicate — join clauses with "and" or "or"`, trailing.span);
349
+ }
350
+ if (ast === null || diagnostic !== void 0) return Result.fail([diagnostic ?? {
351
+ code: "predicate-parse-failed",
352
+ message: "predicate parse failed",
353
+ span: {
354
+ start: baseOffset,
355
+ end: baseOffset + source.length
356
+ }
357
+ }]);
358
+ return Result.succeed(ast);
359
+ };
360
+ const toNumber = (value) => {
361
+ if (typeof value === "number") return value;
362
+ if (typeof value === "string" && value.trim() !== "") return Number(value);
363
+ return NaN;
364
+ };
365
+ const compareNumbers = (op, left, right) => {
366
+ switch (op) {
367
+ case "==": return left === right;
368
+ case "!=": return left !== right;
369
+ case ">": return left > right;
370
+ case ">=": return left >= right;
371
+ case "<": return left < right;
372
+ case "<=": return left <= right;
373
+ }
374
+ };
375
+ const evaluateComparison = (node, variables) => {
376
+ const value = variables[node.name];
377
+ if (value === void 0 || value === null) return false;
378
+ if (node.literal.kind === "number") {
379
+ const left = toNumber(value);
380
+ if (Number.isNaN(left)) return false;
381
+ return compareNumbers(node.op, left, node.literal.value);
382
+ }
383
+ if (node.op === "==" || node.op === "!=") {
384
+ if (typeof value !== "string") return false;
385
+ return node.op === "==" ? value === node.literal.value : value !== node.literal.value;
386
+ }
387
+ const left = toNumber(value);
388
+ const right = toNumber(node.literal.value);
389
+ if (Number.isNaN(left) || Number.isNaN(right)) return false;
390
+ return compareNumbers(node.op, left, right);
391
+ };
392
+ const evaluatePredicate = (ast, variables) => {
393
+ const tasks = [{
394
+ kind: "node",
395
+ node: ast
396
+ }];
397
+ const values = [];
398
+ while (tasks.length > 0) {
399
+ const task = tasks.pop();
400
+ if (task.kind === "not") {
401
+ values.push(!values.pop());
402
+ continue;
403
+ }
404
+ if (task.kind === "and" || task.kind === "or") {
405
+ const left = values.pop();
406
+ if (task.kind === "and" && !left || task.kind === "or" && left) values.push(left);
407
+ else tasks.push({
408
+ kind: "node",
409
+ node: task.right
410
+ });
411
+ continue;
412
+ }
413
+ const node = task.node;
414
+ switch (node.kind) {
415
+ case "or":
416
+ case "and":
417
+ tasks.push({
418
+ kind: node.kind,
419
+ right: node.right
420
+ }, {
421
+ kind: "node",
422
+ node: node.left
423
+ });
424
+ break;
425
+ case "not":
426
+ tasks.push({ kind: "not" }, {
427
+ kind: "node",
428
+ node: node.operand
429
+ });
430
+ break;
431
+ case "comparison":
432
+ values.push(evaluateComparison(node, variables));
433
+ break;
434
+ case "name": {
435
+ const value = variables[node.name];
436
+ values.push(value !== void 0 && value !== null && value !== "");
437
+ break;
438
+ }
439
+ }
440
+ }
441
+ return values[0];
442
+ };
443
+ const precedence = (node) => {
444
+ switch (node.kind) {
445
+ case "or": return 1;
446
+ case "and": return 2;
447
+ case "not": return 3;
448
+ case "comparison":
449
+ case "name": return 4;
450
+ }
451
+ };
452
+ const printLiteral = (literal) => literal.kind === "string" ? `'${literal.value}'` : String(literal.value);
453
+ /** Canonical form: single space around operators/keywords, minimal parens. */
454
+ const printPredicate = (ast) => {
455
+ const frames = [{
456
+ kind: "node",
457
+ node: ast,
458
+ minPrecedence: 0
459
+ }];
460
+ const output = [];
461
+ while (frames.length > 0) {
462
+ const frame = frames.pop();
463
+ if (frame.kind === "text") {
464
+ output.push(frame.value);
465
+ continue;
466
+ }
467
+ const { node, minPrecedence } = frame;
468
+ const wrapped = precedence(node) < minPrecedence;
469
+ if (wrapped) frames.push({
470
+ kind: "text",
471
+ value: ")"
472
+ });
473
+ switch (node.kind) {
474
+ case "or":
475
+ case "and": {
476
+ const operator = node.kind === "or" ? " or " : " and ";
477
+ const childPrecedence = node.kind === "or" ? 1 : 2;
478
+ frames.push({
479
+ kind: "node",
480
+ node: node.right,
481
+ minPrecedence: childPrecedence
482
+ }, {
483
+ kind: "text",
484
+ value: operator
485
+ }, {
486
+ kind: "node",
487
+ node: node.left,
488
+ minPrecedence: childPrecedence
489
+ });
490
+ break;
491
+ }
492
+ case "not":
493
+ frames.push({
494
+ kind: "node",
495
+ node: node.operand,
496
+ minPrecedence: 4
497
+ }, {
498
+ kind: "text",
499
+ value: "not "
500
+ });
501
+ break;
502
+ case "comparison":
503
+ frames.push({
504
+ kind: "text",
505
+ value: `${node.name} ${node.op} ${printLiteral(node.literal)}`
506
+ });
507
+ break;
508
+ case "name": frames.push({
509
+ kind: "text",
510
+ value: node.name
511
+ });
512
+ }
513
+ if (wrapped) output.push("(");
514
+ }
515
+ return output.join("");
516
+ };
517
+ const collectPredicateVariables = (ast) => {
518
+ const names = /* @__PURE__ */ new Set();
519
+ const pending = [ast];
520
+ while (pending.length > 0) {
521
+ const node = pending.pop();
522
+ switch (node.kind) {
523
+ case "or":
524
+ case "and":
525
+ pending.push(node.right, node.left);
526
+ break;
527
+ case "not":
528
+ pending.push(node.operand);
529
+ break;
530
+ case "comparison":
531
+ case "name": names.add(node.name);
532
+ }
533
+ }
534
+ return names;
535
+ };
536
+ //#endregion
537
+ export { printPredicate as a, parsePredicate as i, collectPredicateVariables as n, SML_PARSER_LIMITS as o, evaluatePredicate as r, PREDICATE_PARSER_LIMITS as t };
538
+
539
+ //# sourceMappingURL=predicate-CvkzT-a2.js.map
@@ -1,6 +1,13 @@
1
1
  import { s as Span, t as Diagnostic } from "./diagnostics-oveE-laV.js";
2
2
  import { Result } from "effect";
3
3
  //#region src/predicate.d.ts
4
+ /** Standalone predicates inherit the same source, nesting, and node ceilings as SML. */
5
+ declare const PREDICATE_PARSER_LIMITS: {
6
+ readonly maxCharacters: 500000;
7
+ readonly maxUtf8Bytes: number;
8
+ readonly maxDepth: 64;
9
+ readonly maxNodes: 25000;
10
+ };
4
11
  type ComparisonOp = "==" | "!=" | ">" | ">=" | "<" | "<=";
5
12
  type PredicateLiteral = {
6
13
  readonly kind: "string";
@@ -45,5 +52,5 @@ declare const evaluatePredicate: (ast: PredicateAst, variables: Record<string, u
45
52
  declare const printPredicate: (ast: PredicateAst) => string;
46
53
  declare const collectPredicateVariables: (ast: PredicateAst) => Set<string>;
47
54
  //#endregion
48
- export { evaluatePredicate as a, collectPredicateVariables as i, PredicateAst as n, parsePredicate as o, PredicateLiteral as r, printPredicate as s, ComparisonOp as t };
49
- //# sourceMappingURL=predicate-DTtVtLK7.d.ts.map
55
+ export { collectPredicateVariables as a, printPredicate as c, PredicateLiteral as i, PREDICATE_PARSER_LIMITS as n, evaluatePredicate as o, PredicateAst as r, parsePredicate as s, ComparisonOp as t };
56
+ //# sourceMappingURL=predicate-G2SeSvoN.d.ts.map
@@ -1,2 +1,2 @@
1
- import { a as evaluatePredicate, i as collectPredicateVariables, n as PredicateAst, o as parsePredicate, r as PredicateLiteral, s as printPredicate, t as ComparisonOp } from "./predicate-DTtVtLK7.js";
2
- export { ComparisonOp, PredicateAst, PredicateLiteral, collectPredicateVariables, evaluatePredicate, parsePredicate, printPredicate };
1
+ import { a as collectPredicateVariables, c as printPredicate, i as PredicateLiteral, n as PREDICATE_PARSER_LIMITS, o as evaluatePredicate, r as PredicateAst, s as parsePredicate, t as ComparisonOp } from "./predicate-G2SeSvoN.js";
2
+ export { ComparisonOp, PREDICATE_PARSER_LIMITS, PredicateAst, PredicateLiteral, collectPredicateVariables, evaluatePredicate, parsePredicate, printPredicate };