@omgbase/oqx 0.10.2 → 0.13.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.
@@ -1 +1 @@
1
- {"version":3,"file":"semantics.js","sourceRoot":"","sources":["../src/semantics.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAC7E,2EAA2E;AAC3E,iFAAiF;AACjF,gFAAgF;AAChF,gFAAgF;AAChF,gFAAgF;AAChF,EAAE;AACF,8EAA8E;AAC9E,UAAU;AACV,iEAAiE;AACjE,wEAAwE;AACxE,wDAAwD;AACxD,gFAAgF;AAChF,iFAAiF;AACjF,yBAAyB;AACzB,sDAAsD;AACtD,6EAA6E;AAC7E,sEAAsE;AAEtE,gFAAgF;AAChF,MAAM,UAAU,MAAM,CAAC,CAAU,EAAE,CAAU;IAC3C,MAAM,CAAC,GAAG,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;IACrC,MAAM,CAAC,GAAG,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;IACrC,OAAO,CAAC,KAAK,CAAC,CAAC;AACjB,CAAC;AAED,oFAAoF;AACpF,MAAM,UAAU,MAAM,CAAC,EAAU,EAAE,CAAU,EAAE,CAAU;IACvD,IAAI,EAAE,KAAK,IAAI;QAAE,OAAO,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IACrC,IAAI,EAAE,KAAK,IAAI;QAAE,OAAO,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IACtC,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,IAAI;QAAE,OAAO,KAAK,CAAC;IACzC,QAAQ,EAAE,EAAE,CAAC;QACX,KAAK,GAAG,CAAC,CAAC,OAAQ,CAAW,GAAI,CAAW,CAAC;QAC7C,KAAK,IAAI,CAAC,CAAC,OAAQ,CAAW,IAAK,CAAW,CAA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E,IAAI,EAAE,KAAK,CAAC;IACxD,IAAI,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC;IAC5B,KAAK,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,WAAW,EAAE;IAChD,KAAK,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,WAAW,EAAE;CACjD,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@omgbase/oqx",
3
- "version": "0.10.2",
3
+ "version": "0.13.0",
4
4
  "description": "OQX (omgbase Query eXpressions): a composable query language and engine for JavaScript collections",
5
5
  "keywords": [
6
6
  "query",
package/src/context.ts CHANGED
@@ -8,7 +8,14 @@
8
8
  // (Performant execution over a real store is the tier-3 seam — see planner.ts —
9
9
  // which pushes work into the store instead of driving it row-by-row here.)
10
10
 
11
- import { coerceCollection, BUILTIN_FUNCTIONS, BUILTIN_METHODS } from "./semantics.ts";
11
+ import { coerceCollection, regexMatches, BUILTIN_FUNCTIONS, BUILTIN_METHODS } from "./semantics.ts";
12
+ import type { RegexDialect } from "./regex.ts";
13
+
14
+ // An array's only properties are its integer indices, spelled canonically
15
+ // (`"0"`, `"12"`; never `"01"`, `"length"`, or a method name).
16
+ function isIndexKey(key: string): boolean {
17
+ return /^(0|[1-9]\d*)$/.test(key);
18
+ }
12
19
 
13
20
  /** Result of a context-provided function/method call: `handled: false` tells the
14
21
  * engine to fall back to the builtin table (or error if none). */
@@ -23,7 +30,9 @@ export interface DataContext {
23
30
  /** Read a property/relation off a row: a bare identifier (`field`), a
24
31
  * `.field` segment, or a `^field` outer reference all come through here, each
25
32
  * against exactly the row of the scope it names. An absent property is
26
- * `undefined`; the engine never looks elsewhere for it. */
33
+ * `undefined`; the engine never looks elsewhere for it. A context may throw
34
+ * (an `OqxError` with stage `"eval"`, or any error) to reject a read — a
35
+ * reserved name, a failed store read — and the throw is the query's error. */
27
36
  get(row: unknown, key: string): unknown;
28
37
  /** Coerce a relation/source value into rows (may be lazy). */
29
38
  toRows(value: unknown): Iterable<unknown>;
@@ -33,25 +42,42 @@ export interface DataContext {
33
42
  callFunction?(name: string, args: unknown[]): CallResult;
34
43
  /** Optional custom method; return `{ handled: false }` to defer. */
35
44
  callMethod?(name: string, recv: unknown, args: unknown[]): CallResult;
45
+ /** The regex dialect `matches()` compiles against. `"oqx"` (the default when
46
+ * absent) is the portable baseline the spec tests; `"native"` hands the
47
+ * pattern to the host `RegExp` unvalidated — implementation-defined, not
48
+ * portable. Note the engine dispatches `matches` through `callMethod`, so
49
+ * this is read by the context's own `matches` (`DefaultContext` does;
50
+ * `regexMatches(recv, args, dialect)` is the helper). `BUILTIN_METHODS.matches`
51
+ * is always the baseline. */
52
+ readonly regexDialect?: RegexDialect;
53
+ }
54
+
55
+ export interface DefaultContextOptions {
56
+ /** See `DataContext.regexDialect`. Default `"oqx"`. */
57
+ regexDialect?: RegexDialect;
36
58
  }
37
59
 
38
60
  /** The default context: ordinary JavaScript objects. Named roots come from a
39
- * plain `{ name: collection }` map; properties are own/inherited keys; identity
40
- * is `.id` when present, else the object itself (reference identity). */
61
+ * plain `{ name: collection }` map; properties are OWN keys only (an array
62
+ * exposes only its integer indices, a primitive has none); identity is `.id`
63
+ * when present, else the row itself (the engine keys it structurally). */
41
64
  export class DefaultContext implements DataContext {
42
65
  private roots: Record<string, unknown>;
66
+ readonly regexDialect: RegexDialect;
43
67
 
44
- constructor(roots: Record<string, unknown> = {}) {
68
+ constructor(roots: Record<string, unknown> = {}, options: DefaultContextOptions = {}) {
45
69
  this.roots = roots;
70
+ this.regexDialect = options.regexDialect ?? "oqx";
46
71
  }
47
72
 
48
73
  root(name: string): unknown {
49
- return this.roots[name];
74
+ return Object.hasOwn(this.roots, name) ? this.roots[name] : undefined;
50
75
  }
51
76
 
52
77
  get(row: unknown, key: string): unknown {
53
- if (row == null) return undefined;
54
- return (Object(row) as Record<string, unknown>)[key];
78
+ if (row == null || typeof row !== "object") return undefined;
79
+ if (Array.isArray(row)) return isIndexKey(key) ? row[Number(key)] : undefined;
80
+ return Object.hasOwn(row, key) ? (row as Record<string, unknown>)[key] : undefined;
55
81
  }
56
82
 
57
83
  toRows(value: unknown): Iterable<unknown> {
@@ -64,12 +90,13 @@ export class DefaultContext implements DataContext {
64
90
  }
65
91
 
66
92
  callFunction(name: string, args: unknown[]): CallResult {
67
- const fn = BUILTIN_FUNCTIONS[name];
93
+ const fn = Object.hasOwn(BUILTIN_FUNCTIONS, name) ? BUILTIN_FUNCTIONS[name] : undefined;
68
94
  return fn ? { handled: true, value: fn(args) } : { handled: false };
69
95
  }
70
96
 
71
97
  callMethod(name: string, recv: unknown, args: unknown[]): CallResult {
72
- const fn = BUILTIN_METHODS[name];
98
+ if (name === "matches") return { handled: true, value: regexMatches(recv, args, this.regexDialect) };
99
+ const fn = Object.hasOwn(BUILTIN_METHODS, name) ? BUILTIN_METHODS[name] : undefined;
73
100
  return fn ? { handled: true, value: fn(recv, args) } : { handled: false };
74
101
  }
75
102
  }
package/src/engine.ts CHANGED
@@ -3,9 +3,10 @@
3
3
  // interface so a pushdown planner (tier 3, planner.ts) is a drop-in alternative.
4
4
  //
5
5
  // Optimizations over a naive walk: `exists` short-circuits at the first match;
6
- // `first`/`single` stop early when the result is unordered; `count` never
7
- // materializes rows; and within an `&&` the cheap scalar leaves are evaluated
8
- // before expensive consumer-op leaves (which each drive a nested traversal).
6
+ // `first` stops early when the result is unordered; `count` never materializes
7
+ // rows. (`single` always materializes, so its error reports the true row count,
8
+ // and `&&` evaluates strictly left to right — evaluation order is observable
9
+ // through errors, so the engine never reorders conjuncts.)
9
10
  //
10
11
  // Name resolution is strictly lexical and LOCAL: a bare identifier is read from
11
12
  // the current scope only, and an enclosing scope is reached solely through an
@@ -19,7 +20,7 @@ import type { DataContext } from "./context.ts";
19
20
  import { DefaultContext } from "./context.ts";
20
21
  import { OqxError } from "./errors.ts";
21
22
  import {
22
- relate, arith, membership, truthy, toNumber, compareForSort, makeRange, isEntry,
23
+ relate, arith, membership, truthy, compareForSort, compare, canonicalKey, makeRange, isEntry, isRange,
23
24
  } from "./semantics.ts";
24
25
 
25
26
  /** The shaped result of a top-level query, discriminated by consumer. */
@@ -95,11 +96,11 @@ export class InMemoryEngine implements Engine {
95
96
  return { consumer: "none", none: m === 0 };
96
97
  }
97
98
 
98
- // first/single over an unordered, non-distinct set need only the rows up to
99
- // the bound: offset + 1 (first) / offset + 2 (single, to detect a second).
100
- const want = query.consumer === "first" ? 1 : query.consumer === "single" ? 2 : Infinity;
101
- const cap = !query.orderBy && !query.distinct && want !== Infinity
102
- ? bound.offset + Math.min(want, bound.limit ?? want)
99
+ // first over an unordered, non-distinct set needs only the rows up to the
100
+ // bound (offset + 1). single materializes everything so its error can
101
+ // report how many rows actually matched.
102
+ const cap = query.consumer === "first" && !query.orderBy && !query.distinct
103
+ ? bound.offset + Math.min(1, bound.limit ?? 1)
103
104
  : Infinity;
104
105
  let kept: Scope[] = [];
105
106
  for (const r of rows) {
@@ -180,14 +181,16 @@ export class InMemoryEngine implements Engine {
180
181
 
181
182
  // Dedup scopes by their PROJECTED value (`distinct`): keep the first scope per
182
183
  // distinct projection, preserving order. An empty projection dedups by row
183
- // identity (so `count distinct { }` counts distinct rows).
184
+ // identity (so `count distinct { }` counts distinct rows). Both keys are
185
+ // structural (`canonicalKey`): absent ≡ null, key order ignored, types kept
186
+ // apart — never a host `String()`.
184
187
  private dedupByProjection(scopes: Scope[], proj: Projection): Scope[] {
185
188
  const seen = new Set<string>();
186
189
  const out: Scope[] = [];
187
190
  for (const s of scopes) {
188
191
  const key = proj.select.length === 0
189
- ? `i:${String(this.ctx.identity(s.row))}`
190
- : `p:${stableStringify(this.projectRow(proj, s))}`;
192
+ ? `i:${canonicalKey(this.ctx.identity(s.row))}`
193
+ : `p:${canonicalKey(this.projectRow(proj, s))}`;
191
194
  if (seen.has(key)) continue;
192
195
  seen.add(key);
193
196
  out.push(s);
@@ -207,12 +210,14 @@ export class InMemoryEngine implements Engine {
207
210
  // • `$leaf` = (stop == leaf); `$frontier` = (stop ∈ {frontier, depth}) — the
208
211
  // "there is unfollowed graph beyond me" signal;
209
212
  // • identity for cycle detection + `distinct` is `by <expr>` when given, else
210
- // `ctx.identity(row)`.
213
+ // `ctx.identity(row)` (an entry's identity is its value's); identities are
214
+ // compared structurally via `canonicalKey`, and `$ordinal` paths compare
215
+ // component-wise (`comparePath`), so `10` follows `9`.
211
216
  private followWalk(seedRows: unknown[], follow: Follow, parent: Scope): Occurrence[] {
212
217
  const cap = follow.depth ?? HARD_DEPTH_CAP;
213
218
  const scopeFor = (row: unknown): Scope => this.enter(row, parent);
214
- const keyOf = (row: unknown): string =>
215
- String(follow.by ? this.evalExpr(follow.by, scopeFor(row)) : this.ctx.identity(row));
219
+ const identityOf = (row: unknown): unknown =>
220
+ follow.by ? this.evalExpr(follow.by, scopeFor(row)) : this.ctx.identity(isEntry(row) ? row.value : row);
216
221
  const succOf = (row: unknown): unknown[] => {
217
222
  const raw = this.rowsOf(this.evalExpr(follow.receiver, scopeFor(row)));
218
223
  return follow.where ? raw.filter((x) => truthy(this.evalExpr(follow.where!, scopeFor(x)))) : raw;
@@ -220,12 +225,13 @@ export class InMemoryEngine implements Engine {
220
225
  const frontierHit = (row: unknown): boolean =>
221
226
  follow.frontier ? truthy(this.evalExpr(follow.frontier, scopeFor(row))) : false;
222
227
 
223
- interface Walked { row: unknown; depth: number; path: string; key: string; stop: string; }
228
+ interface Walked { row: unknown; depth: number; path: unknown[]; key: string; stop: string; }
224
229
  const walked: Walked[] = [];
225
230
 
226
- const visit = (row: unknown, depth: number, ancestors: string[]): void => {
227
- const key = keyOf(row);
228
- const path = `/${[...ancestors, key].join("/")}/`;
231
+ const visit = (row: unknown, depth: number, ancestors: string[], ancestorIds: unknown[]): void => {
232
+ const id = identityOf(row);
233
+ const key = canonicalKey(id);
234
+ const path = [...ancestorIds, id];
229
235
  let stop: string;
230
236
  if (ancestors.includes(key)) stop = "cycle";
231
237
  else if (frontierHit(row)) stop = "frontier";
@@ -235,13 +241,13 @@ export class InMemoryEngine implements Engine {
235
241
  if (succ.length === 0) stop = "leaf";
236
242
  else {
237
243
  walked.push({ row, depth, path, key, stop: "interior" });
238
- for (const s of succ) visit(s, depth + 1, [...ancestors, key]);
244
+ for (const s of succ) visit(s, depth + 1, [...ancestors, key], path);
239
245
  return;
240
246
  }
241
247
  }
242
248
  walked.push({ row, depth, path, key, stop });
243
249
  };
244
- for (const r of seedRows) visit(r, 1, []);
250
+ for (const r of seedRows) visit(r, 1, [], []);
245
251
 
246
252
  let rows = walked;
247
253
  if (follow.distinct) {
@@ -249,12 +255,12 @@ export class InMemoryEngine implements Engine {
249
255
  const best = new Map<string, Walked>();
250
256
  for (const w of rows) {
251
257
  const prev = best.get(w.key);
252
- if (!prev || w.depth < prev.depth || (w.depth === prev.depth && w.path < prev.path)) best.set(w.key, w);
258
+ if (!prev || w.depth < prev.depth || (w.depth === prev.depth && comparePath(w.path, prev.path) < 0)) best.set(w.key, w);
253
259
  }
254
260
  rows = [...best.values()];
255
261
  }
256
262
  // $ordinal: a deterministic 1..N rank over (depth, path).
257
- rows = rows.slice().sort((a, b) => a.depth - b.depth || (a.path < b.path ? -1 : a.path > b.path ? 1 : 0));
263
+ rows = rows.slice().sort((a, b) => a.depth - b.depth || comparePath(a.path, b.path));
258
264
  return rows.map((w, i) => ({
259
265
  row: w.row,
260
266
  meta: {
@@ -283,13 +289,14 @@ export class InMemoryEngine implements Engine {
283
289
  }
284
290
 
285
291
  // The per-row result: the raw row (empty projection), the single item's value
286
- // itself (`values` mode), or a `{ name: value }` record.
292
+ // itself (`values` mode), or a `{ name: value }` record. A range is an
293
+ // evaluation-time value only and never appears in a result.
287
294
  private projectRow(proj: Projection, scope: Scope): unknown {
288
295
  const { select } = proj;
289
- if (select.length === 0) return scope.row;
290
- if (proj.values) return this.itemValue(select[0]!, scope);
296
+ if (select.length === 0) return noRange(scope.row);
297
+ if (proj.values) return noRange(this.itemValue(select[0]!, scope));
291
298
  const out: Record<string, unknown> = {};
292
- for (const item of select) out[item.name] = this.itemValue(item, scope);
299
+ for (const item of select) out[item.name] = noRange(this.itemValue(item, scope));
293
300
  return out;
294
301
  }
295
302
 
@@ -301,11 +308,9 @@ export class InMemoryEngine implements Engine {
301
308
 
302
309
  private evalWhere(w: Where, scope: Scope): boolean {
303
310
  switch (w.kind) {
304
- case "and": {
305
- // Cheap scalar leaves before expensive consumer ops; `.every` short-circuits.
306
- for (const p of orderByCost(w.parts)) if (!this.evalWhere(p, scope)) return false;
307
- return true;
308
- }
311
+ // Strictly left to right, short-circuiting: `false && f()` never evaluates
312
+ // `f()`, so a query may guard an expensive or failing operand by position.
313
+ case "and": return w.parts.every((p) => this.evalWhere(p, scope));
309
314
  case "or": return w.parts.some((p) => this.evalWhere(p, scope));
310
315
  case "not": return !this.evalWhere(w.expr, scope);
311
316
  case "scalar": return truthy(this.evalExpr(w.expr, scope));
@@ -427,7 +432,11 @@ export class InMemoryEngine implements Engine {
427
432
  private evalExpr(e: Expr, scope: Scope): unknown {
428
433
  switch (e.kind) {
429
434
  case "lit": return e.value;
430
- case "binding": return scope.bindings[e.index];
435
+ case "binding":
436
+ if (e.index >= scope.bindings.length) {
437
+ throw new OqxError(`binding \${${e.index}} is out of range: the query references ${e.index + 1} value${e.index === 0 ? "" : "s"} but ${scope.bindings.length} ${scope.bindings.length === 1 ? "was" : "were"} given`, "eval");
438
+ }
439
+ return scope.bindings[e.index];
431
440
  case "ident": return this.resolveIn(e.name, scope);
432
441
  case "outer": {
433
442
  // `^name` reads from EXACTLY `levels` scopes out — the target scope is
@@ -446,8 +455,11 @@ export class InMemoryEngine implements Engine {
446
455
  return r == null ? undefined : this.ctx.get(r, String(i));
447
456
  }
448
457
  case "call": return this.evalCall(e, scope);
449
- case "unary":
450
- return e.op === "!" ? !truthy(this.evalExpr(e.expr, scope)) : -toNumber(this.evalExpr(e.expr, scope));
458
+ case "unary": {
459
+ const v = this.evalExpr(e.expr, scope);
460
+ if (e.op === "!") return !truthy(v);
461
+ return v == null ? undefined : -(v as number);
462
+ }
451
463
  case "binary": {
452
464
  const l = this.evalExpr(e.left, scope);
453
465
  const r = this.evalExpr(e.right, scope);
@@ -469,10 +481,17 @@ export class InMemoryEngine implements Engine {
469
481
  // Resolve a name against ONE scope — never its ancestors. A scope provides,
470
482
  // in order: `$value` (the scope's row itself — the current item, whatever its
471
483
  // type, so scalar collections are queryable; absent at the root, which has no
472
- // row); `$key` (the property key, for an entry scope only — see `enter`); the
473
- // recursion intrinsics (`$depth`, …) when it is a follow occurrence; values
474
- // lifted into it by `^name:` items; then either the row's own property or,
475
- // for the root scope (no row), the context's named roots.
484
+ // row); `$key` (the property key) when it is an entry scope — see `enter`;
485
+ // the recursion intrinsics (`$depth`, …) when it is a follow occurrence;
486
+ // values lifted into it by `^name:` items; then either the row's own property
487
+ // or, for the root scope (no row), the context's named roots.
488
+ //
489
+ // The two metadata steps apply only where the scope CARRIES that metadata
490
+ // (SEMANTICS §2, since 0.13). Anywhere else — `$key` on an ordinary row,
491
+ // `$depth` outside a follow or on the plain rows of a nested block inside
492
+ // one — the name is an ordinary property read, so a host whose rows own a
493
+ // `$depth`/`$ordinal` (omgbase's blocks do) exposes it. Where the metadata
494
+ // exists it wins over a same-named row property.
476
495
  //
477
496
  // A name the scope lacks is simply absent (undefined). It does NOT fall
478
497
  // through to an enclosing scope, so a query's meaning never depends on which
@@ -482,8 +501,8 @@ export class InMemoryEngine implements Engine {
482
501
  // 0, "") need no special case — there is no "absent, so look outward" rule.
483
502
  private resolveIn(name: string, scope: Scope): unknown {
484
503
  if (name === "$value") return scope.parent === null ? undefined : scope.row;
485
- if (name === KEY || RECUR.has(name)) return scope.meta ? scope.meta[name] : undefined;
486
- if (scope.lifts && name in scope.lifts) return scope.lifts[name];
504
+ if ((name === KEY || RECUR.has(name)) && scope.meta && Object.hasOwn(scope.meta, name)) return scope.meta[name];
505
+ if (scope.lifts && Object.hasOwn(scope.lifts, name)) return scope.lifts[name];
487
506
  if (scope.parent === null) return this.ctx.root(name);
488
507
  return this.ctx.get(scope.row, name);
489
508
  }
@@ -510,17 +529,40 @@ function isRelOp(op: string): boolean {
510
529
  return op === "==" || op === "!=" || op === "<" || op === "<=" || op === ">" || op === ">=";
511
530
  }
512
531
 
513
- // Deterministic stringify for `distinct` dedup keys: object keys are emitted in
514
- // sorted order so two projections that are equal-by-value collide regardless of
515
- // key insertion order. `undefined` normalizes to null (like an absent value).
516
- function stableStringify(v: unknown): string {
517
- if (v === undefined || v === null) return "null";
518
- if (Array.isArray(v)) return `[${v.map(stableStringify).join(",")}]`;
519
- if (typeof v === "object") {
520
- const o = v as Record<string, unknown>;
521
- return `{${Object.keys(o).sort().map((k) => `${JSON.stringify(k)}:${stableStringify(o[k])}`).join(",")}}`;
532
+ // Guard a value bound for a result: a range (`lo..hi`) exists only during
533
+ // evaluation. Checks the value itself and, for an array, its elements — deeper
534
+ // structure is host data (which cannot hold a range) or a nested block's
535
+ // result (already guarded when it was projected).
536
+ function noRange(v: unknown): unknown {
537
+ if (isRange(v) || (Array.isArray(v) && v.some(isRange))) {
538
+ throw new OqxError("a range (lo..hi) cannot appear in a result; test membership with `x in lo..hi` instead", "eval");
522
539
  }
523
- return JSON.stringify(v);
540
+ return v;
541
+ }
542
+
543
+ // Order two `follow` paths (identity sequences of equal depth) component-wise:
544
+ // two numbers numerically, two strings by code point; otherwise numbers precede
545
+ // strings precede everything else, and same-kind others order by canonical key.
546
+ function comparePath(a: unknown[], b: unknown[]): number {
547
+ const n = Math.min(a.length, b.length);
548
+ for (let i = 0; i < n; i++) {
549
+ const c = compareComponent(a[i], b[i]);
550
+ if (c !== 0) return c;
551
+ }
552
+ return a.length - b.length;
553
+ }
554
+
555
+ function compareComponent(x: unknown, y: unknown): number {
556
+ const c = compare(x, y);
557
+ if (c !== undefined) return c;
558
+ const rx = componentRank(x), ry = componentRank(y);
559
+ if (rx !== ry) return rx - ry;
560
+ const kx = canonicalKey(x), ky = canonicalKey(y);
561
+ return kx < ky ? -1 : kx > ky ? 1 : 0;
562
+ }
563
+
564
+ function componentRank(v: unknown): number {
565
+ return typeof v === "number" ? 0 : typeof v === "string" ? 1 : 2;
524
566
  }
525
567
 
526
568
  function compareCount(n: number, cmp: { op: string; value: number }): boolean {
@@ -537,20 +579,6 @@ function boundedCount(n: number, b: Bound): number {
537
579
  return b.limit == null ? rest : Math.min(rest, b.limit);
538
580
  }
539
581
 
540
- // Order `&&` conjuncts so cheap scalar leaves run before consumer-op leaves.
541
- function orderByCost(parts: Where[]): Where[] {
542
- return [...parts].sort((a, b) => whereCost(a) - whereCost(b));
543
- }
544
-
545
- function whereCost(w: Where): number {
546
- switch (w.kind) {
547
- case "op": return 2;
548
- case "and": case "or": return Math.max(0, ...w.parts.map(whereCost));
549
- case "not": return whereCost(w.expr);
550
- case "scalar": return 0;
551
- }
552
- }
553
-
554
582
  function describeReceiver(e: Expr): string {
555
583
  if (e.kind === "ident") return e.name;
556
584
  if (e.kind === "member") return `${describeReceiver(e.recv)}.${e.name}`;
@@ -558,6 +586,11 @@ function describeReceiver(e: Expr): string {
558
586
  return "receiver";
559
587
  }
560
588
 
589
+ // Split a follow query's `where` into seed conjuncts (no recursion intrinsic
590
+ // mentioned) and post-walk conjuncts. The test is syntactic — a bare `$depth`
591
+ // in the body of a follow always names the occurrence's metadata, so no
592
+ // property read can be mistaken for it here; without a `follow` this split is
593
+ // never consulted and `$depth` is an ordinary predicate over the row.
561
594
  function partitionRecur(w: Where): { seed: Where | null; post: Where | null } {
562
595
  const parts = w.kind === "and" ? w.parts : [w];
563
596
  const seed: Where[] = [];
package/src/index.ts CHANGED
@@ -27,10 +27,16 @@ import type { DataContext } from "./context.ts";
27
27
  import { DefaultContext } from "./context.ts";
28
28
 
29
29
  export { OqxError } from "./errors.ts";
30
+
31
+ /** The OQX spec version (`spec/oqx/VERSION`, `major.minor`) this implementation
32
+ * conforms to — distinct from the package's own semver. */
33
+ export const LANGUAGE_VERSION = "0.13";
30
34
  export type { OqxResult, Engine } from "./engine.ts";
31
35
  export { InMemoryEngine, runQuery } from "./engine.ts";
32
- export type { DataContext, CallResult } from "./context.ts";
36
+ export type { DataContext, CallResult, DefaultContextOptions } from "./context.ts";
33
37
  export { DefaultContext } from "./context.ts";
38
+ export type { RegexDialect, RegexFlags } from "./regex.ts";
39
+ export { compileRegex } from "./regex.ts";
34
40
  export type { QueryPlanner, Plan } from "./planner.ts";
35
41
  export { PlannedEngine } from "./planner.ts";
36
42
  export { IndexedCollection } from "./adapters/indexed.ts";
package/src/lexer.ts CHANGED
@@ -108,9 +108,18 @@ function lexFragment(src: string, base: number, out: Token[]): void {
108
108
  push("range", "..", i); i += 2; continue;
109
109
  }
110
110
 
111
- // `.` is a dot only when not the leading part of a number (.5) — but OQX has
112
- // no leading-dot numerals, so a bare `.` is always navigation.
113
- if (c === "." && !isDigit(src[i + 1] ?? "")) { push("dot", c, i); i++; continue; }
111
+ // `.` followed by a digit is neither navigation (a property name cannot start
112
+ // with a digit) nor a number (OQX has no leading-dot numerals): it is a
113
+ // malformed number, reported as such rather than surfacing as a confusing
114
+ // parse error downstream. Any other `.` is member navigation.
115
+ if (c === ".") {
116
+ if (isDigit(src[i + 1] ?? "")) {
117
+ const end = scanNumberTail(src, i + 1, base);
118
+ const lit = src.slice(i, end);
119
+ throw new OqxError(`malformed number ${JSON.stringify(lit)} at ${base + i} — a number starts with a digit (write 0${lit}), and a property name cannot be a digit (there is no index access)`, "lex");
120
+ }
121
+ push("dot", c, i); i++; continue;
122
+ }
114
123
 
115
124
  // string literal — decode into its VALUE (quotes stripped, escapes resolved).
116
125
  if (c === '"' || c === "'") {
@@ -133,18 +142,14 @@ function lexFragment(src: string, base: number, out: Token[]): void {
133
142
  continue;
134
143
  }
135
144
 
136
- // number (integer or decimal, optional exponent)
137
- if (isDigit(c) || (c === "." && isDigit(src[i + 1] ?? ""))) {
145
+ // number: `digits [ "." digits ] [ ("e"|"E") ["+"|"-"] digits ]`. A `.` is a
146
+ // decimal point only when a digit follows: `1..5` is `1` `..` `5`. A `.`
147
+ // followed by anything else (`1.`, `1.x`) and an exponent marker without
148
+ // digits (`1e`, `1e+`) are malformed numbers — lex errors, never a silent
149
+ // NaN or a dangling dot.
150
+ if (isDigit(c)) {
138
151
  const start = i;
139
- while (i < n && isDigit(src[i]!)) i++;
140
- // A `.` is a decimal point only when a digit follows; otherwise it belongs
141
- // to a range operator (`1..5`) or navigation, so the number stops here.
142
- if (src[i] === "." && isDigit(src[i + 1] ?? "")) { i++; while (i < n && isDigit(src[i]!)) i++; }
143
- if (src[i] === "e" || src[i] === "E") {
144
- i++;
145
- if (src[i] === "+" || src[i] === "-") i++;
146
- while (i < n && isDigit(src[i]!)) i++;
147
- }
152
+ i = scanNumberTail(src, i, base);
148
153
  push("number", src.slice(start, i), start);
149
154
  continue;
150
155
  }
@@ -168,6 +173,31 @@ function lexFragment(src: string, base: number, out: Token[]): void {
168
173
  }
169
174
  }
170
175
 
176
+ // Scan a number whose first digit is at `i`; return the index just past it.
177
+ // Throws the malformed-number lex error for a trailing decimal point or an
178
+ // exponent without digits.
179
+ function scanNumberTail(src: string, i: number, base = 0): number {
180
+ const start = i;
181
+ const n = src.length;
182
+ const fail = (end: number, why: string): never => {
183
+ throw new OqxError(`malformed number ${JSON.stringify(src.slice(start, end))} at ${base + start} — ${why}`, "lex");
184
+ };
185
+ while (i < n && isDigit(src[i]!)) i++;
186
+ if (src[i] === "." && src[i + 1] !== ".") {
187
+ if (!isDigit(src[i + 1] ?? "")) fail(i + 1, "a decimal point needs a digit after it (write 1.0, not 1.)");
188
+ i++;
189
+ while (i < n && isDigit(src[i]!)) i++;
190
+ }
191
+ if (src[i] === "e" || src[i] === "E") {
192
+ let j = i + 1;
193
+ if (src[j] === "+" || src[j] === "-") j++;
194
+ if (!isDigit(src[j] ?? "")) fail(j, "an exponent needs at least one digit (write 1e5)");
195
+ i = j;
196
+ while (i < n && isDigit(src[i]!)) i++;
197
+ }
198
+ return i;
199
+ }
200
+
171
201
  function unescape(c: string | undefined): string {
172
202
  switch (c) {
173
203
  case "n": return "\n";