Public repository: timo / feel

Reader

An interpreter of FEEL, written in Rust, with integrations for PostgreSQL, WASM, Lua, and Python.

feat(core): comma-list-of-tests `in`-RHS (Form 1, TCK 0072 +70)

public

feat(core): comma-list-of-tests `in`-RHS (Form 1, TCK 0072 +70)

The membership `in`-RHS is a distinct grammatical category (positive unary
tests), not an expression. Give it dedicated test-mode productions instead of
delegating the whole RHS to `Sum`:

  * bracket/paren comma-lists of tests — `x in [1,2,3]`, `x in (false,true)`,
    `x in (1,<5,>=10)`, `x in [[2..4],[1..3]]` — an OR of element tests
    (`eval_in` already OR-folds `Vec<UnaryTest>`, so eval is untouched);
  * single intervals `[a..b]`/`(a..b)` now parse straight to
    `UnaryTest::Interval` (no `RangeLit` + `unary_test_from_expr` round-trip);
  * the one-element paren tests `(=10)`/`(!=10)` fall out for free as `Compare`
    elements — no Form-4 value-position desugar needed here.

The lever is a bracket-free `NbSum` chain for the bare-endpoint branch: by never
starting with `[`/`(`, it leaves the `in [` / `in (` states with exactly one
bracket production (the test-list / interval), so the interval-vs-list split is a
clean first-element factoring (`..` vs `,`/`]`/`)`) rather than a reduce/reduce
against the value `List`/`RangeLit`. LR(1)-clean — build.rs's no-conflict gate
passes. (Reverse-bracket `]a..b]` stays deferred: it would overload `]` as an
opener, the one genuinely fatal case — see ROADMAP.)

Ingester: widen the `in`-RHS gate to accept any balanced bracket/paren test
group; allow a parenthesised comparison only after `in` (value-position `(<10)`
stays rejected for Form 4). One cross-type case (`true in [false,2,3]`) is
skipped: feel-core makes a non-null type mismatch under `=` an error-null
(ADR-14), so it OR-folds to null where the TCK wants false — a separate
semantics decision (see ROADMAP).

Suite 2650 -> 2720.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Changeset668bb84424d90a661970e566d1865b2f47f7f207
Author (claimed)Timo Stolz <timo.stolz@gmail.com>,
Parents69676ca0fbde
Children
Pushlog
by timo via ssh

modified crates/feel-core/src/feel.lalrpop +95 −16

@@ -294,24 +294,103 @@
294294
     <e:Disjunction> => IterSource::Expr(Box::new(e)),
295295
 };
296296
 
297
-// The right-hand side of membership `in` — positive unary tests (DMN rule 49).
298
-// Two LR(1)-clean forms: a comparison test `<op> endpoint` (`< 10`, `= e`, `!= e`,
299
-// any endpoint expression, incl. a list `=[1,2,3]` or a temporal `=@"…"`), and a
300
-// single bare endpoint expression `e`. The bare form is a full `Sum`, so it covers
301
-// a written interval literal `[a..b]` / `(a..b]` (now a first-class `RangeLit`
302
-// value), an expression yielding a range (`range("[1..3]")`, a range-typed
303
-// variable), and a plain scalar (`1 in 1` is `1 = 1`). `unary_test_from_expr` routes
304
-// a written interval back to the dedicated `Interval` *test* (byte-for-byte the old
305
-// behaviour); anything else becomes an `Endpoint` (equality, or range membership).
306
-// Because `[a..b]`/`[1,2,3]` are ordinary `Primary`s now, there is no separate
307
-// `IntervalStart` nonterminal here — which is exactly what used to clash with the
308
-// list literal on the bare `[` (build.rs's no-conflict gate proves it stays clean).
309
-// The comma-separated *list-of-tests* forms (`x in [1,2,3]`, `x in (false,true)`,
310
-// `x in [[a..b],[c..d]]`) — where the brackets are a list of tests, not one value —
311
-// remain deferred (they need the test-list-vs-value bracket split; see ROADMAP).
297
+// The right-hand side of membership `in` — *positive unary tests* (DMN rule 49), a
298
+// grammatical category distinct from `expression`. Its own nonterminals (this is the
299
+// whole reason lalrpop's separate categories suffice — no hand-written parser needed):
300
+//   * a single comparison test `<op> endpoint` (`< 10`, `= e`, `!= e`);
301
+//   * a single interval `[a..b]` / `(a..b)` / `[a..b)` / `(a..b]` (any endpoints);
302
+//   * a comma-list of tests in brackets or parens — `x in [1,2,3]`, `x in (false,true)`,
303
+//     `x in (1,<5,>=10)`, `x in [[2..4],[1..3]]`, `x in (=10)` — an OR of the element
304
+//     tests (`eval_in` already OR-folds `Vec<UnaryTest>`, so this needs no eval change);
305
+//   * a bare endpoint expression that does NOT start with `[`/`(` — a scalar (`1 in 1`
306
+//     is `1 = 1`), a variable, a `range(...)` call, an `@"…"` temporal, or arithmetic
307
+//     of those.
308
+// The bare branch goes through the bracket-free `NbSum` chain below, NOT `Sum`. That is
309
+// the lever that keeps `[`/`(` out of the bare branch, so after `in [` (resp. `in (`)
310
+// there is exactly ONE bracket production — the test-list / interval — instead of two
311
+// competing ones (test-list vs. the value `List`/`RangeLit` reachable through a full
312
+// `Sum`). With only one, the interval-vs-list split is the same first-element factoring
313
+// as `RangeLit`: parse the first `Sum`, then branch on `..` (interval) vs. `,`/`]`/`)`
314
+// (list). That is a FIRST-overlap on a shared prefix, not a token-role conflict, so it
315
+// is LR(1)-clean (the build.rs no-conflict gate proves it). Nested intervals / lists in
316
+// a test-list reuse the value-position `Sum` (a `[2..4]` element arrives as a `RangeLit`
317
+// value that `unary_test_from_expr` reclassifies to an interval test), so they live one
318
+// nesting level down and never compete in the `in [` state. A leading `]a..b]` reverse
319
+// interval is *not* here (it would overload `]` as an opener — the one genuinely fatal,
320
+// deferred case; see ROADMAP).
312321
 InRhs: Vec<UnaryTest> = {
313322
     <op:CmpOp> <e:Sum> => vec![UnaryTest::Compare(op, Box::new(e))],
314
-    <e:Sum> => vec![unary_test_from_expr(e)],
323
+    <e:NbSum> => vec![unary_test_from_expr(e)],
324
+    "[" <lo:Sum> ".." <hi:Sum> <eo:IntervalEnd> =>
325
+        vec![UnaryTest::Interval(Interval { start_open: false, start: Box::new(lo), end: Box::new(hi), end_open: eo })],
326
+    "(" <lo:Sum> ".." <hi:Sum> <eo:IntervalEnd> =>
327
+        vec![UnaryTest::Interval(Interval { start_open: true, start: Box::new(lo), end: Box::new(hi), end_open: eo })],
328
+    "[" <ts:Comma<UnaryTestElem>> "]" => ts,
329
+    "(" <ts:Comma<UnaryTestElem>> ")" => ts,
330
+};
331
+
332
+// One element of a bracketed / parenthesised test-list: a comparison test (`< 5`,
333
+// `= e`, `!= e`), or a bare endpoint via the full `Sum` — which covers a value, a
334
+// nested list value, and a nested interval `[2..4]` (a `RangeLit` value that
335
+// `unary_test_from_expr` reclassifies to a `UnaryTest::Interval`). Using the full
336
+// `Sum` here is safe: an element only competes with the single-interval production on
337
+// the shared `"[" Sum` prefix, resolved one token later by `..` vs. `,`/`]`/`)`.
338
+UnaryTestElem: UnaryTest = {
339
+    <op:CmpOp> <e:Sum> => UnaryTest::Compare(op, Box::new(e)),
340
+    <e:Sum> => unary_test_from_expr(e),
341
+};
342
+
343
+// Bracket-free arithmetic chain — a copy of `Sum`/`Product`/`Power`/`Unary`/`Postfix`
344
+// whose *leading* primary is never `[`- or `(`-led (`NbPrimary` drops `List`, `RangeLit`
345
+// and the `"(" Expr ")"` grouping). It is the bare-endpoint branch of `InRhs`: by never
346
+// starting with `[`/`(` it leaves the `in [` / `in (` states with a single bracket
347
+// production each, which is what keeps Form 1 LR(1)-clean (see `InRhs`). Only the
348
+// *leftmost* primary is restricted — right operands and inner sub-expressions stay the
349
+// full `Sum`/`Expr` nonterminals — so `1 + 2`, `-5`, `range("[1..3]")`, `a.b`, `xs[1]`
350
+// are all still reachable as bare endpoints; only a *leading* `[`/`(` is peeled off to
351
+// the dedicated bracket productions above. (Cost: a bare endpoint can no longer *begin*
352
+// with a grouping/list/range literal, e.g. `x in (1+2)*3` — not a shape the TCK uses;
353
+// `x in (1+2)`, `x in [a..b]`, `x in [1,2,3]` are all still covered by the rules above.)
354
+NbSum: Expr = {
355
+    <l:NbSum> "+" <r:Product> => Expr::Arith(ArithOp::Add, Box::new(l), Box::new(r)),
356
+    <l:NbSum> "-" <r:Product> => Expr::Arith(ArithOp::Sub, Box::new(l), Box::new(r)),
357
+    NbProduct,
358
+};
359
+
360
+NbProduct: Expr = {
361
+    <l:NbProduct> "*" <r:Power> => Expr::Arith(ArithOp::Mul, Box::new(l), Box::new(r)),
362
+    <l:NbProduct> "/" <r:Power> => Expr::Arith(ArithOp::Div, Box::new(l), Box::new(r)),
363
+    NbPower,
364
+};
365
+
366
+NbPower: Expr = {
367
+    <l:NbPower> "**" <r:Unary> => Expr::Arith(ArithOp::Pow, Box::new(l), Box::new(r)),
368
+    NbUnary,
369
+};
370
+
371
+NbUnary: Expr = {
372
+    "-" <e:Unary> => Expr::Neg(Box::new(e)),
373
+    NbPostfix,
374
+};
375
+
376
+NbPostfix: Expr = {
377
+    <e:NbPostfix> "." <n:Name> => Expr::Path(Box::new(e), n),
378
+    <e:NbPostfix> "[" <idx:Expr> "]" => Expr::Filter(Box::new(e), Box::new(idx)),
379
+    <n:Name> "(" ")" => Expr::FnCall(n, CallArgs::default()),
380
+    <n:Name> "(" <a:Comma<Arg>> ")" => Expr::FnCall(n, callargs_from(a)),
381
+    NbPrimary,
382
+};
383
+
384
+NbPrimary: Expr = {
385
+    Num => Expr::Number(<>),
386
+    Str => Expr::Str(<>),
387
+    TemporalLit => Expr::TemporalLit(<>),
388
+    "true" => Expr::Bool(true),
389
+    "false" => Expr::Bool(false),
390
+    "null" => Expr::Null,
391
+    Context,
392
+    "not" "(" <e:Expr> ")" => Expr::Not(Box::new(e)),
393
+    Name => Expr::Var(<>),
315394
 };
316395
 
317396
 IntervalEnd: bool = {

modified crates/feel-core/src/lib.rs +61 −0

@@ -602,6 +602,67 @@
602602
     }
603603
 
604604
     #[test]
605
+    fn in_unary_test_lists_tck_0072() {
606
+        // Comma-list-of-tests `in`-RHS forms (Form 1): a bracketed/parenthesised list
607
+        // of positive unary tests is an OR of its elements. Endpoints, nested ranges,
608
+        // comparison elements (`< 5`, `>= 10`), and the one-element paren tests
609
+        // `(= e)` / `(!= e)` all flow through the dedicated test-mode `InRhs`
610
+        // productions; the cases are lifted straight from 0072-feel-in.
611
+        let cases: &[(&str, bool)] = &[
612
+            // bracket list of endpoints
613
+            ("1 in [2,3,1]", true),
614
+            ("1 in [2,3,4]", false),
615
+            (r#""a" in ["b","c","a"]"#, true),
616
+            (r#""a" in ["b","c","d"]"#, false),
617
+            ("true in [true, false]", true),
618
+            ("true in [false, false]", false),
619
+            // bracket list of ranges (nested intervals reclassified to interval tests)
620
+            ("1 in [[2..4], [1..3]]", true),
621
+            ("1 in [[2..4], [5..7]]", false),
622
+            (r#""b" in [["f".."h"], ["a".."c"]]"#, true),
623
+            // paren list, incl. comparison elements
624
+            ("10 in (1, < 5, >=10)", true),
625
+            ("3 in (1, < 5, >=10)", true),
626
+            ("7 in (1, < 5, >=10)", false),
627
+            ("5 in (1, 5, 9)", true),
628
+            ("10 in (1, 5, 9)", false),
629
+            ("true in (false, true)", true),
630
+            ("true in (false, false)", false),
631
+            (r#""d" in ("c", < "c", >="d")"#, true),
632
+            (r#""d" in ("c", >="e")"#, false),
633
+            // one-element paren tests `(= e)` / `(!= e)` — Compare elements, no Form-4 desugar
634
+            ("10 in (=10)", true),
635
+            ("10 in (!=10)", false),
636
+            ("5 in (!=10)", true),
637
+            ("true in (=true)", true),
638
+            ("true in (!=true)", false),
639
+            (r#""a" in (="a")"#, true),
640
+            (r#""a" in (!="a")"#, false),
641
+            // list / context values as endpoints (same-type equality; a *cross*-type
642
+            // endpoint like `[1,2,3] in [1,2,3]` is the ADR-14 error-null deviation,
643
+            // tested elsewhere, not here)
644
+            ("[1,2,3] in [[1,2,3,4], [1,2,3]]", true),
645
+            ("[1,2,3] in ([1,2,3])", true),
646
+            ("[1,2,3] in (=[1,2,3])", true),
647
+            ("[1,2,3] in (!=[1,2,3])", false),
648
+            (r#"{a: "foo"} in ({a: "bar"}, {a: "foo"})"#, true),
649
+            (r#"{a: "foo"} in (={a: "foo"})"#, true),
650
+            // single interval / comparison / bare endpoint still parse as before
651
+            ("5 in [1..10]", true),
652
+            ("5 in (5..10]", false),
653
+            ("5 in [5..10]", true),
654
+            ("5 in (1..10)", true),
655
+            ("1 in (1..10)", false),
656
+            ("3 in < 5", true),
657
+            ("1 in 1", true),
658
+            ("1 in 2", false),
659
+        ];
660
+        for (src, want) in cases {
661
+            assert_eq!(ev(src), b(*want), "`{src}`");
662
+        }
663
+    }
664
+
665
+    #[test]
605666
     fn arithmetic_and_precedence() {
606667
         assert_eq!(ev("1 + 1"), num(2.0));
607668
         assert_eq!(ev("1 + 2 * 3"), num(7.0)); // * binds tighter than +

modified crates/feel-core/tests/fixtures/0072-feel-in.json +560 −0

@@ -1,4 +1,12 @@
11
 [
2
+  {
3
+    "id": "0072-feel-in:boolean_001:boolean_001",
4
+    "expression": "true in [true, false]",
5
+    "expected": true,
6
+    "expected_type": "boolean",
7
+    "comparison": "exact",
8
+    "deviation": null
9
+  },
210
   {
311
     "id": "0072-feel-in:boolean_011:boolean_011",
412
     "expression": "true in true",
@@ -8,6 +16,22 @@
816
     "deviation": null
917
   },
1018
   {
19
+    "id": "0072-feel-in:boolean_014:boolean_014",
20
+    "expression": "true in (false, true)",
21
+    "expected": true,
22
+    "expected_type": "boolean",
23
+    "comparison": "exact",
24
+    "deviation": null
25
+  },
26
+  {
27
+    "id": "0072-feel-in:boolean_014_a:boolean_014_a",
28
+    "expression": "true in (false, false)",
29
+    "expected": false,
30
+    "expected_type": "boolean",
31
+    "comparison": "exact",
32
+    "deviation": null
33
+  },
34
+  {
1135
     "id": "0072-feel-in:boolean_015_a:boolean_015_a",
1236
     "expression": "true in =true",
1337
     "expected": true,
@@ -16,6 +40,14 @@
1640
     "deviation": null
1741
   },
1842
   {
43
+    "id": "0072-feel-in:boolean_015_b:boolean_015_b",
44
+    "expression": "true in (=true)",
45
+    "expected": true,
46
+    "expected_type": "boolean",
47
+    "comparison": "exact",
48
+    "deviation": null
49
+  },
50
+  {
1951
     "id": "0072-feel-in:boolean_015_c:boolean_015_c",
2052
     "expression": "true in =false",
2153
     "expected": false,
@@ -32,6 +64,14 @@
3264
     "deviation": null
3365
   },
3466
   {
67
+    "id": "0072-feel-in:boolean_016_b:boolean_016_b",
68
+    "expression": "true in (!=true)",
69
+    "expected": false,
70
+    "expected_type": "boolean",
71
+    "comparison": "exact",
72
+    "deviation": null
73
+  },
74
+  {
3575
     "id": "0072-feel-in:boolean_016_c:boolean_016_c",
3676
     "expression": "true in !=false",
3777
     "expected": true,
@@ -40,6 +80,22 @@
4080
     "deviation": null
4181
   },
4282
   {
83
+    "id": "0072-feel-in:context_001:context_001",
84
+    "expression": "{a: \"foo\"} in [{b: \"bar\"}, {a: \"foo\"}]",
85
+    "expected": true,
86
+    "expected_type": "boolean",
87
+    "comparison": "exact",
88
+    "deviation": null
89
+  },
90
+  {
91
+    "id": "0072-feel-in:context_001_a:context_001_a",
92
+    "expression": "{c: \"baz\"} in [{b: \"bar\"}, {a: \"foo\"}]",
93
+    "expected": false,
94
+    "expected_type": "boolean",
95
+    "comparison": "exact",
96
+    "deviation": null
97
+  },
98
+  {
4399
     "id": "0072-feel-in:context_011:context_011",
44100
     "expression": "{a: \"foo\"} in {a: \"foo\"}",
45101
     "expected": true,
@@ -48,6 +104,54 @@
48104
     "deviation": null
49105
   },
50106
   {
107
+    "id": "0072-feel-in:context_014:context_014",
108
+    "expression": "{a: \"foo\"} in ({a: \"bar\"}, {a: \"foo\"})",
109
+    "expected": true,
110
+    "expected_type": "boolean",
111
+    "comparison": "exact",
112
+    "deviation": null
113
+  },
114
+  {
115
+    "id": "0072-feel-in:context_014_a:context_014_a",
116
+    "expression": "{a: \"foo\"} in ({a: \"bar\"}, {a: \"baz\"})",
117
+    "expected": false,
118
+    "expected_type": "boolean",
119
+    "comparison": "exact",
120
+    "deviation": null
121
+  },
122
+  {
123
+    "id": "0072-feel-in:dateTime_001:dateTime_001",
124
+    "expression": "date and time(\"2018-12-08T10:30:08\") in [date and time(\"2018-12-08T10:30:08\"),date and time(\"2018-12-08T10:30:09\"),date and time(\"2018-12-08T10:30:10\")]",
125
+    "expected": true,
126
+    "expected_type": "boolean",
127
+    "comparison": "exact",
128
+    "deviation": null
129
+  },
130
+  {
131
+    "id": "0072-feel-in:dateTime_001_a:dateTime_001_a",
132
+    "expression": "date and time(\"2018-12-08T10:30:11\") in [date and time(\"2018-12-08T10:30:08\"),date and time(\"2018-12-08T10:30:09\"),date and time(\"2018-12-08T10:30:10\")]",
133
+    "expected": false,
134
+    "expected_type": "boolean",
135
+    "comparison": "exact",
136
+    "deviation": null
137
+  },
138
+  {
139
+    "id": "0072-feel-in:dateTime_002:dateTime_002",
140
+    "expression": "date and time(\"2018-12-08T10:30:11\") in [[date and time(\"2018-12-08T10:30:05\") .. date and time(\"2018-12-08T10:30:07\")], [date and time(\"2018-12-08T10:30:10\") .. date and time(\"2018-12-08T10:30:12\")]]",
141
+    "expected": true,
142
+    "expected_type": "boolean",
143
+    "comparison": "exact",
144
+    "deviation": null
145
+  },
146
+  {
147
+    "id": "0072-feel-in:dateTime_002_a:dateTime_002_a",
148
+    "expression": "date and time(\"2018-12-08T10:30:04\") in [[date and time(\"2018-12-08T10:30:05\") .. date and time(\"2018-12-08T10:30:07\")], [date and time(\"2018-12-08T10:30:10\") .. date and time(\"2018-12-08T10:30:12\")]]",
149
+    "expected": false,
150
+    "expected_type": "boolean",
151
+    "comparison": "exact",
152
+    "deviation": null
153
+  },
154
+  {
51155
     "id": "0072-feel-in:dateTime_003:dateTime_003",
52156
     "expression": "date and time(\"2018-12-08T10:30:04\") in <= date and time(\"2018-12-08T10:30:05\")",
53157
     "expected": true,
@@ -296,6 +400,54 @@
296400
     "deviation": null
297401
   },
298402
   {
403
+    "id": "0072-feel-in:dateTime_014:dateTime_014",
404
+    "expression": "date and time(\"2018-12-08T10:30:05\") in (date and time(\"2018-12-08T10:30:04\"), >=date and time(\"2018-12-08T10:30:05\"))",
405
+    "expected": true,
406
+    "expected_type": "boolean",
407
+    "comparison": "exact",
408
+    "deviation": null
409
+  },
410
+  {
411
+    "id": "0072-feel-in:dateTime_014_a:dateTime_014_a",
412
+    "expression": "date and time(\"2018-12-08T10:30:05\") in (date and time(\"2018-12-08T10:30:04\"), >=date and time(\"2018-12-08T10:30:06\"))",
413
+    "expected": false,
414
+    "expected_type": "boolean",
415
+    "comparison": "exact",
416
+    "deviation": null
417
+  },
418
+  {
419
+    "id": "0072-feel-in:date_001:date_001",
420
+    "expression": "date(\"2018-12-08\") in [date(\"2018-12-08\"),date(\"2018-12-09\"),date(\"2018-12-10\")]",
421
+    "expected": true,
422
+    "expected_type": "boolean",
423
+    "comparison": "exact",
424
+    "deviation": null
425
+  },
426
+  {
427
+    "id": "0072-feel-in:date_001_a:date_001_a",
428
+    "expression": "date(\"2018-12-11\") in [date(\"2018-12-08\"),date(\"2018-12-09\"),date(\"2018-12-10\")]",
429
+    "expected": false,
430
+    "expected_type": "boolean",
431
+    "comparison": "exact",
432
+    "deviation": null
433
+  },
434
+  {
435
+    "id": "0072-feel-in:date_002:date_002",
436
+    "expression": "date(\"2018-12-11\") in [[date(\"2018-12-05\") .. date(\"2018-12-07\")], [date(\"2018-12-10\") .. date(\"2018-12-12\")]]",
437
+    "expected": true,
438
+    "expected_type": "boolean",
439
+    "comparison": "exact",
440
+    "deviation": null
441
+  },
442
+  {
443
+    "id": "0072-feel-in:date_002_a:date_002_a",
444
+    "expression": "date(\"2018-12-04\") in [[date(\"2018-12-05\") .. date(\"2018-12-07\")], [date(\"2018-12-10\") .. date(\"2018-12-12\")]]",
445
+    "expected": false,
446
+    "expected_type": "boolean",
447
+    "comparison": "exact",
448
+    "deviation": null
449
+  },
450
+  {
299451
     "id": "0072-feel-in:date_003:date_003",
300452
     "expression": "date(\"2018-12-04\") in <= date(\"2018-12-05\")",
301453
     "expected": true,
@@ -544,6 +696,22 @@
544696
     "deviation": null
545697
   },
546698
   {
699
+    "id": "0072-feel-in:date_014:date_014",
700
+    "expression": "date(\"2018-12-05\") in (date(\"2018-12-04\"), >=date(\"2018-12-05\"))",
701
+    "expected": true,
702
+    "expected_type": "boolean",
703
+    "comparison": "exact",
704
+    "deviation": null
705
+  },
706
+  {
707
+    "id": "0072-feel-in:date_014_a:date_014_a",
708
+    "expression": "date(\"2018-12-05\") in (date(\"2018-12-04\"), >=date(\"2018-12-06\"))",
709
+    "expected": false,
710
+    "expected_type": "boolean",
711
+    "comparison": "exact",
712
+    "deviation": null
713
+  },
714
+  {
547715
     "id": "0072-feel-in:date_015_a:date_015_a",
548716
     "expression": "@\"2018-12-05\" in =@\"2018-12-05\"",
549717
     "expected": true,
@@ -552,6 +720,14 @@
552720
     "deviation": null
553721
   },
554722
   {
723
+    "id": "0072-feel-in:date_015_b:date_015_b",
724
+    "expression": "@\"2018-12-05\" in (=@\"2018-12-05\")",
725
+    "expected": true,
726
+    "expected_type": "boolean",
727
+    "comparison": "exact",
728
+    "deviation": null
729
+  },
730
+  {
555731
     "id": "0072-feel-in:date_015_c:date_015_c",
556732
     "expression": "@\"2018-12-05\" in =@\"2018-12-06\"",
557733
     "expected": false,
@@ -568,6 +744,14 @@
568744
     "deviation": null
569745
   },
570746
   {
747
+    "id": "0072-feel-in:date_016_b:date_016_b",
748
+    "expression": "@\"2018-12-05\" in (!=@\"2018-12-05\")",
749
+    "expected": false,
750
+    "expected_type": "boolean",
751
+    "comparison": "exact",
752
+    "deviation": null
753
+  },
754
+  {
571755
     "id": "0072-feel-in:date_016_c:date_016_c",
572756
     "expression": "@\"2018-12-05\" in !=@\"2018-12-06\"",
573757
     "expected": true,
@@ -584,6 +768,14 @@
584768
     "deviation": null
585769
   },
586770
   {
771
+    "id": "0072-feel-in:datetime_015_b:datetime_015_b",
772
+    "expression": "@\"2018-12-08T10:30:05\" in (=@\"2018-12-08T10:30:05\")",
773
+    "expected": true,
774
+    "expected_type": "boolean",
775
+    "comparison": "exact",
776
+    "deviation": null
777
+  },
778
+  {
587779
     "id": "0072-feel-in:datetime_015_c:datetime_015_c",
588780
     "expression": "@\"2018-12-08T10:30:05\" in =@\"2018-12-08T10:30:06\"",
589781
     "expected": false,
@@ -600,6 +792,14 @@
600792
     "deviation": null
601793
   },
602794
   {
795
+    "id": "0072-feel-in:datetime_016_b:datetime_016_b",
796
+    "expression": "@\"2018-12-08T10:30:05\" in (!=@\"2018-12-08T10:30:05\")",
797
+    "expected": false,
798
+    "expected_type": "boolean",
799
+    "comparison": "exact",
800
+    "deviation": null
801
+  },
802
+  {
603803
     "id": "0072-feel-in:datetime_016_c:datetime_016_c",
604804
     "expression": "@\"2018-12-08T10:30:05\" in !=@\"2018-12-08T10:30:06\"",
605805
     "expected": true,
@@ -608,6 +808,38 @@
608808
     "deviation": null
609809
   },
610810
   {
811
+    "id": "0072-feel-in:dt_duration_001:dt_duration_001",
812
+    "expression": "duration(\"P8D\") in [duration(\"P8D\"),duration(\"P9D\"),duration(\"P10D\")]",
813
+    "expected": true,
814
+    "expected_type": "boolean",
815
+    "comparison": "exact",
816
+    "deviation": null
817
+  },
818
+  {
819
+    "id": "0072-feel-in:dt_duration_001_a:dt_duration_001_a",
820
+    "expression": "duration(\"P11D\") in [duration(\"P8D\"),duration(\"P9D\"),duration(\"P10D\")]",
821
+    "expected": false,
822
+    "expected_type": "boolean",
823
+    "comparison": "exact",
824
+    "deviation": null
825
+  },
826
+  {
827
+    "id": "0072-feel-in:dt_duration_002:dt_duration_002",
828
+    "expression": "duration(\"P11D\") in [[duration(\"P5D\") .. duration(\"P7D\")], [duration(\"P10D\") .. duration(\"P12D\")]]",
829
+    "expected": true,
830
+    "expected_type": "boolean",
831
+    "comparison": "exact",
832
+    "deviation": null
833
+  },
834
+  {
835
+    "id": "0072-feel-in:dt_duration_002_a:dt_duration_002_a",
836
+    "expression": "duration(\"P4D\") in [[duration(\"P5D\") .. duration(\"P7D\")], [duration(\"P10D\") .. duration(\"P12D\")]]",
837
+    "expected": false,
838
+    "expected_type": "boolean",
839
+    "comparison": "exact",
840
+    "deviation": null
841
+  },
842
+  {
611843
     "id": "0072-feel-in:dt_duration_003:dt_duration_003",
612844
     "expression": "duration(\"P4D\") in <= duration(\"P5D\")",
613845
     "expected": true,
@@ -856,6 +1088,22 @@
8561088
     "deviation": null
8571089
   },
8581090
   {
1091
+    "id": "0072-feel-in:dt_duration_014:dt_duration_014",
1092
+    "expression": "duration(\"P5D\") in (duration(\"P4D\"), >=duration(\"P5D\"))",
1093
+    "expected": true,
1094
+    "expected_type": "boolean",
1095
+    "comparison": "exact",
1096
+    "deviation": null
1097
+  },
1098
+  {
1099
+    "id": "0072-feel-in:dt_duration_014_a:dt_duration_014_a",
1100
+    "expression": "duration(\"P5D\") in (duration(\"P4D\"), >=duration(\"P6D\"))",
1101
+    "expected": false,
1102
+    "expected_type": "boolean",
1103
+    "comparison": "exact",
1104
+    "deviation": null
1105
+  },
1106
+  {
8591107
     "id": "0072-feel-in:dt_duration_015_a:dt_duration_015_a",
8601108
     "expression": "@\"P5D\" in =@\"P5D\"",
8611109
     "expected": true,
@@ -864,6 +1112,14 @@
8641112
     "deviation": null
8651113
   },
8661114
   {
1115
+    "id": "0072-feel-in:dt_duration_015_b:dt_duration_015_b",
1116
+    "expression": "@\"P5D\" in (=@\"P5D\")",
1117
+    "expected": true,
1118
+    "expected_type": "boolean",
1119
+    "comparison": "exact",
1120
+    "deviation": null
1121
+  },
1122
+  {
8671123
     "id": "0072-feel-in:dt_duration_015_c:dt_duration_015_c",
8681124
     "expression": "@\"P5D\" in =@\"P6D\"",
8691125
     "expected": false,
@@ -880,6 +1136,14 @@
8801136
     "deviation": null
8811137
   },
8821138
   {
1139
+    "id": "0072-feel-in:dt_duration_016_b:dt_duration_016_b",
1140
+    "expression": "@\"P5D\" in (!=@\"P5D\")",
1141
+    "expected": false,
1142
+    "expected_type": "boolean",
1143
+    "comparison": "exact",
1144
+    "deviation": null
1145
+  },
1146
+  {
8831147
     "id": "0072-feel-in:dt_duration_016_c:dt_duration_016_c",
8841148
     "expression": "@\"P5D\" in !=@\"P6D\"",
8851149
     "expected": true,
@@ -888,6 +1152,46 @@
8881152
     "deviation": null
8891153
   },
8901154
   {
1155
+    "id": "0072-feel-in:list_001:list_001",
1156
+    "expression": "[1,2,3] in [[1,2,3,4], [1,2,3]]",
1157
+    "expected": true,
1158
+    "expected_type": "boolean",
1159
+    "comparison": "exact",
1160
+    "deviation": null
1161
+  },
1162
+  {
1163
+    "id": "0072-feel-in:list_001_a:list_001_a",
1164
+    "expression": "[1,2,3,5] in [[1,2,3,4], [1,2,3]]",
1165
+    "expected": false,
1166
+    "expected_type": "boolean",
1167
+    "comparison": "exact",
1168
+    "deviation": null
1169
+  },
1170
+  {
1171
+    "id": "0072-feel-in:list_011_a:list_011_a",
1172
+    "expression": "[1,2,3] in [[1,2,3], [1,2,3,4]]",
1173
+    "expected": true,
1174
+    "expected_type": "boolean",
1175
+    "comparison": "exact",
1176
+    "deviation": null
1177
+  },
1178
+  {
1179
+    "id": "0072-feel-in:list_011_b:list_011_b",
1180
+    "expression": "[1,2,2] in [[1,2,3], [1,2,3,4]]",
1181
+    "expected": false,
1182
+    "expected_type": "boolean",
1183
+    "comparison": "exact",
1184
+    "deviation": null
1185
+  },
1186
+  {
1187
+    "id": "0072-feel-in:list_014_a:list_014_a",
1188
+    "expression": "[1,2,3] in ([[1,2,3,4]], [[1,2,3,5]])",
1189
+    "expected": false,
1190
+    "expected_type": "boolean",
1191
+    "comparison": "exact",
1192
+    "deviation": null
1193
+  },
1194
+  {
8911195
     "id": "0072-feel-in:list_015_a:list_015_a",
8921196
     "expression": "[1,2,3] in =[1,2,3]",
8931197
     "expected": true,
@@ -896,6 +1200,14 @@
8961200
     "deviation": null
8971201
   },
8981202
   {
1203
+    "id": "0072-feel-in:list_015_b:list_015_b",
1204
+    "expression": "[1,2,3] in (=[1,2,3])",
1205
+    "expected": true,
1206
+    "expected_type": "boolean",
1207
+    "comparison": "exact",
1208
+    "deviation": null
1209
+  },
1210
+  {
8991211
     "id": "0072-feel-in:list_015_c:list_015_c",
9001212
     "expression": "[1,2,3] in =[1,2,3,4]",
9011213
     "expected": false,
@@ -906,6 +1218,14 @@
9061218
   {
9071219
     "id": "0072-feel-in:list_016_a:list_016_a",
9081220
     "expression": "[1,2,3] in !=[1,2,3]",
1221
+    "expected": false,
1222
+    "expected_type": "boolean",
1223
+    "comparison": "exact",
1224
+    "deviation": null
1225
+  },
1226
+  {
1227
+    "id": "0072-feel-in:list_016_b:list_016_b",
1228
+    "expression": "[1,2,3] in (!=[1,2,3])",
9091229
     "expected": false,
9101230
     "expected_type": "boolean",
9111231
     "comparison": "exact",
@@ -960,6 +1280,38 @@
9601280
     "deviation": null
9611281
   },
9621282
   {
1283
+    "id": "0072-feel-in:number_001:number_001",
1284
+    "expression": "1 in [2,3,1]",
1285
+    "expected": true,
1286
+    "expected_type": "boolean",
1287
+    "comparison": "exact",
1288
+    "deviation": null
1289
+  },
1290
+  {
1291
+    "id": "0072-feel-in:number_001_a:number_001_a",
1292
+    "expression": "1 in [2,3,4]",
1293
+    "expected": false,
1294
+    "expected_type": "boolean",
1295
+    "comparison": "exact",
1296
+    "deviation": null
1297
+  },
1298
+  {
1299
+    "id": "0072-feel-in:number_002:number_002",
1300
+    "expression": "1 in [[2..4], [1..3]]",
1301
+    "expected": true,
1302
+    "expected_type": "boolean",
1303
+    "comparison": "exact",
1304
+    "deviation": null
1305
+  },
1306
+  {
1307
+    "id": "0072-feel-in:number_002_a:number_002_a",
1308
+    "expression": "5 in [[2..4], [1..3]]",
1309
+    "expected": false,
1310
+    "expected_type": "boolean",
1311
+    "comparison": "exact",
1312
+    "deviation": null
1313
+  },
1314
+  {
9631315
     "id": "0072-feel-in:number_003:number_003",
9641316
     "expression": "1 in <= 10",
9651317
     "expected": true,
@@ -1208,6 +1560,22 @@
12081560
     "deviation": null
12091561
   },
12101562
   {
1563
+    "id": "0072-feel-in:number_014:number_014",
1564
+    "expression": "10 in (1, < 5, >=10)",
1565
+    "expected": true,
1566
+    "expected_type": "boolean",
1567
+    "comparison": "exact",
1568
+    "deviation": null
1569
+  },
1570
+  {
1571
+    "id": "0072-feel-in:number_014_a:number_014_a",
1572
+    "expression": "10 in (1, 5, 9)",
1573
+    "expected": false,
1574
+    "expected_type": "boolean",
1575
+    "comparison": "exact",
1576
+    "deviation": null
1577
+  },
1578
+  {
12111579
     "id": "0072-feel-in:number_015_a:number_015_a",
12121580
     "expression": "10 in =10",
12131581
     "expected": true,
@@ -1216,6 +1584,14 @@
12161584
     "deviation": null
12171585
   },
12181586
   {
1587
+    "id": "0072-feel-in:number_015_b:number_015_b",
1588
+    "expression": "10 in (=10)",
1589
+    "expected": true,
1590
+    "expected_type": "boolean",
1591
+    "comparison": "exact",
1592
+    "deviation": null
1593
+  },
1594
+  {
12191595
     "id": "0072-feel-in:number_015_c:number_015_c",
12201596
     "expression": "10 in =11",
12211597
     "expected": false,
@@ -1232,6 +1608,14 @@
12321608
     "deviation": null
12331609
   },
12341610
   {
1611
+    "id": "0072-feel-in:number_016_b:number_016_b",
1612
+    "expression": "10 in (!=10)",
1613
+    "expected": false,
1614
+    "expected_type": "boolean",
1615
+    "comparison": "exact",
1616
+    "deviation": null
1617
+  },
1618
+  {
12351619
     "id": "0072-feel-in:number_016_c:number_016_c",
12361620
     "expression": "10 in !=11",
12371621
     "expected": true,
@@ -1240,6 +1624,38 @@
12401624
     "deviation": null
12411625
   },
12421626
   {
1627
+    "id": "0072-feel-in:string_001:string_001",
1628
+    "expression": "\"a\" in [\"b\",\"c\",\"a\"]",
1629
+    "expected": true,
1630
+    "expected_type": "boolean",
1631
+    "comparison": "exact",
1632
+    "deviation": null
1633
+  },
1634
+  {
1635
+    "id": "0072-feel-in:string_001_a:string_001_a",
1636
+    "expression": "\"a\" in [\"b\",\"c\",\"d\"]",
1637
+    "expected": false,
1638
+    "expected_type": "boolean",
1639
+    "comparison": "exact",
1640
+    "deviation": null
1641
+  },
1642
+  {
1643
+    "id": "0072-feel-in:string_002:string_002",
1644
+    "expression": "\"b\" in [[\"f\"..\"h\"], [\"a\"..\"c\"]]",
1645
+    "expected": true,
1646
+    "expected_type": "boolean",
1647
+    "comparison": "exact",
1648
+    "deviation": null
1649
+  },
1650
+  {
1651
+    "id": "0072-feel-in:string_002_a:string_002_a",
1652
+    "expression": "\"i\" in [[\"f\"..\"h\"], [\"a\"..\"c\"]]",
1653
+    "expected": false,
1654
+    "expected_type": "boolean",
1655
+    "comparison": "exact",
1656
+    "deviation": null
1657
+  },
1658
+  {
12431659
     "id": "0072-feel-in:string_003:string_003",
12441660
     "expression": "\"a\" in <= \"b\"",
12451661
     "expected": true,
@@ -1480,6 +1896,22 @@
14801896
     "deviation": null
14811897
   },
14821898
   {
1899
+    "id": "0072-feel-in:string_014:string_014",
1900
+    "expression": "\"d\" in (\"c\", < \"c\", >=\"d\")",
1901
+    "expected": true,
1902
+    "expected_type": "boolean",
1903
+    "comparison": "exact",
1904
+    "deviation": null
1905
+  },
1906
+  {
1907
+    "id": "0072-feel-in:string_014_a:string_014_a",
1908
+    "expression": "\"d\" in (\"c\", >=\"e\")",
1909
+    "expected": false,
1910
+    "expected_type": "boolean",
1911
+    "comparison": "exact",
1912
+    "deviation": null
1913
+  },
1914
+  {
14831915
     "id": "0072-feel-in:string_015_a:string_015_a",
14841916
     "expression": "\"a\" in =\"a\"",
14851917
     "expected": true,
@@ -1488,6 +1920,14 @@
14881920
     "deviation": null
14891921
   },
14901922
   {
1923
+    "id": "0072-feel-in:string_015_b:string_015_b",
1924
+    "expression": "\"a\" in (=\"a\")",
1925
+    "expected": true,
1926
+    "expected_type": "boolean",
1927
+    "comparison": "exact",
1928
+    "deviation": null
1929
+  },
1930
+  {
14911931
     "id": "0072-feel-in:string_015_c:string_015_c",
14921932
     "expression": "\"a\" in =\"b\"",
14931933
     "expected": false,
@@ -1504,6 +1944,14 @@
15041944
     "deviation": null
15051945
   },
15061946
   {
1947
+    "id": "0072-feel-in:string_016_b:string_016_b",
1948
+    "expression": "\"a\" in (!=\"a\")",
1949
+    "expected": false,
1950
+    "expected_type": "boolean",
1951
+    "comparison": "exact",
1952
+    "deviation": null
1953
+  },
1954
+  {
15071955
     "id": "0072-feel-in:string_016_c:string_016_c",
15081956
     "expression": "\"a\" in !=\"b\"",
15091957
     "expected": true,
@@ -1512,6 +1960,38 @@
15121960
     "deviation": null
15131961
   },
15141962
   {
1963
+    "id": "0072-feel-in:time_001:time_001",
1964
+    "expression": "time(\"10:30:08\") in [time(\"10:30:08\"),time(\"10:30:09\"),time(\"10:30:10\")]",
1965
+    "expected": true,
1966
+    "expected_type": "boolean",
1967
+    "comparison": "exact",
1968
+    "deviation": null
1969
+  },
1970
+  {
1971
+    "id": "0072-feel-in:time_001_a:time_001_a",
1972
+    "expression": "time(\"10:30:11\") in [time(\"10:30:08\"),time(\"10:30:09\"),time(\"10:30:10\")]",
1973
+    "expected": false,
1974
+    "expected_type": "boolean",
1975
+    "comparison": "exact",
1976
+    "deviation": null
1977
+  },
1978
+  {
1979
+    "id": "0072-feel-in:time_002:time_002",
1980
+    "expression": "time(\"10:30:11\") in [[time(\"10:30:05\") .. time(\"10:30:07\")], [time(\"10:30:10\") .. time(\"10:30:12\")]]",
1981
+    "expected": true,
1982
+    "expected_type": "boolean",
1983
+    "comparison": "exact",
1984
+    "deviation": null
1985
+  },
1986
+  {
1987
+    "id": "0072-feel-in:time_002_a:time_002_a",
1988
+    "expression": "time(\"10:30:04\") in [[time(\"10:30:05\") .. time(\"10:30:07\")], [time(\"10:30:10\") .. time(\"10:30:12\")]]",
1989
+    "expected": false,
1990
+    "expected_type": "boolean",
1991
+    "comparison": "exact",
1992
+    "deviation": null
1993
+  },
1994
+  {
15151995
     "id": "0072-feel-in:time_003:time_003",
15161996
     "expression": "time(\"10:30:04\") in <= time(\"10:30:05\")",
15171997
     "expected": true,
@@ -1760,6 +2240,22 @@
17602240
     "deviation": null
17612241
   },
17622242
   {
2243
+    "id": "0072-feel-in:time_014:time_014",
2244
+    "expression": "time(\"10:30:05\") in (time(\"10:30:04\"), >=time(\"10:30:05\"))",
2245
+    "expected": true,
2246
+    "expected_type": "boolean",
2247
+    "comparison": "exact",
2248
+    "deviation": null
2249
+  },
2250
+  {
2251
+    "id": "0072-feel-in:time_014_a:time_014_a",
2252
+    "expression": "time(\"10:30:05\") in (time(\"10:30:04\"), >=time(\"10:30:06\"))",
2253
+    "expected": false,
2254
+    "expected_type": "boolean",
2255
+    "comparison": "exact",
2256
+    "deviation": null
2257
+  },
2258
+  {
17632259
     "id": "0072-feel-in:time_015_a:time_015_a",
17642260
     "expression": "@\"10:30:05\" in =@\"10:30:05\"",
17652261
     "expected": true,
@@ -1768,6 +2264,14 @@
17682264
     "deviation": null
17692265
   },
17702266
   {
2267
+    "id": "0072-feel-in:time_015_b:time_015_b",
2268
+    "expression": "@\"10:30:05\" in (=@\"10:30:05\")",
2269
+    "expected": true,
2270
+    "expected_type": "boolean",
2271
+    "comparison": "exact",
2272
+    "deviation": null
2273
+  },
2274
+  {
17712275
     "id": "0072-feel-in:time_015_c:time_015_c",
17722276
     "expression": "@\"10:30:05\" in =@\"10:30:06\"",
17732277
     "expected": false,
@@ -1784,6 +2288,14 @@
17842288
     "deviation": null
17852289
   },
17862290
   {
2291
+    "id": "0072-feel-in:time_016_b:time_016_b",
2292
+    "expression": "@\"10:30:05\" in (!=@\"10:30:05\")",
2293
+    "expected": false,
2294
+    "expected_type": "boolean",
2295
+    "comparison": "exact",
2296
+    "deviation": null
2297
+  },
2298
+  {
17872299
     "id": "0072-feel-in:time_016_c:time_016_c",
17882300
     "expression": "@\"10:30:05\" in !=@\"10:30:06\"",
17892301
     "expected": true,
@@ -1792,6 +2304,38 @@
17922304
     "deviation": null
17932305
   },
17942306
   {
2307
+    "id": "0072-feel-in:ym_duration_001:ym_duration_001",
2308
+    "expression": "duration(\"P8Y\") in [duration(\"P8Y\"),duration(\"P9Y\"),duration(\"P10Y\")]",
2309
+    "expected": true,
2310
+    "expected_type": "boolean",
2311
+    "comparison": "exact",
2312
+    "deviation": null
2313
+  },
2314
+  {
2315
+    "id": "0072-feel-in:ym_duration_001_a:ym_duration_001_a",
2316
+    "expression": "duration(\"P11Y\") in [duration(\"P8Y\"),duration(\"P9Y\"),duration(\"P10Y\")]",
2317
+    "expected": false,
2318
+    "expected_type": "boolean",
2319
+    "comparison": "exact",
2320
+    "deviation": null
2321
+  },
2322
+  {
2323
+    "id": "0072-feel-in:ym_duration_002:ym_duration_002",
2324
+    "expression": "duration(\"P11Y\") in [[duration(\"P5Y\") .. duration(\"P7Y\")], [duration(\"P10Y\") .. duration(\"P12Y\")]]",
2325
+    "expected": true,
2326
+    "expected_type": "boolean",
2327
+    "comparison": "exact",
2328
+    "deviation": null
2329
+  },
2330
+  {
2331
+    "id": "0072-feel-in:ym_duration_002_a:ym_duration_002_a",
2332
+    "expression": "duration(\"P4Y\") in [[duration(\"P5Y\") .. duration(\"P7Y\")], [duration(\"P10Y\") .. duration(\"P12Y\")]]",
2333
+    "expected": false,
2334
+    "expected_type": "boolean",
2335
+    "comparison": "exact",
2336
+    "deviation": null
2337
+  },
2338
+  {
17952339
     "id": "0072-feel-in:ym_duration_003:ym_duration_003",
17962340
     "expression": "duration(\"P4Y\") in <= duration(\"P5Y\")",
17972341
     "expected": true,
@@ -2038,5 +2582,21 @@
20382582
     "expected_type": "boolean",
20392583
     "comparison": "exact",
20402584
     "deviation": null
2585
+  },
2586
+  {
2587
+    "id": "0072-feel-in:ym_duration_014:ym_duration_014",
2588
+    "expression": "duration(\"P5Y\") in (duration(\"P4Y\"), >=duration(\"P5Y\"))",
2589
+    "expected": true,
2590
+    "expected_type": "boolean",
2591
+    "comparison": "exact",
2592
+    "deviation": null
2593
+  },
2594
+  {
2595
+    "id": "0072-feel-in:ym_duration_014_a:ym_duration_014_a",
2596
+    "expression": "duration(\"P5Y\") in (duration(\"P4Y\"), >=duration(\"P6Y\"))",
2597
+    "expected": false,
2598
+    "expected_type": "boolean",
2599
+    "comparison": "exact",
2600
+    "deviation": null
20412601
   }
20422602
 ]

modified tools/ingest_tck.py +45 −29

@@ -118,47 +118,41 @@
118118
 })
119119
 
120120
 
121
-def _single_interval(rhs: str) -> bool:
122
-    """`rhs` begins with `[` or `(`: true iff it is a *single* interval — a top-level
123
-    `..` and no top-level comma before the matching close (so `[date(…)..date(…)]`
124
-    with parenthesised endpoints is accepted, but a list `[2,3,1]` /
125
-    `[[a..b],[c..d]]` is not)."""
121
+def _balanced_bracket_group(rhs: str) -> bool:
122
+    """`rhs` begins with `[` or `(`: true iff that opening bracket has a matching close
123
+    (a balanced leading group). Covers both a *single* interval `[a..b]` and the
124
+    comma-list / parenthesised test-list forms (`[2,3,1]`, `(false,true)`,
125
+    `(1,<5,>=10)`, `[[a..b],[c..d]]`, `(=10)`) — all positive unary tests after `in`
126
+    (Form 1). A close with nothing open (the reverse-bracket `]a..b]`) is rejected; the
127
+    broader reverse-bracket / unbalanced detection lives in the `..` scan in
128
+    `fits_slice_grammar`."""
126129
     depth = 0
127
-    saw_dotdot = saw_comma = False
128
-    i = 0
129
-    while i < len(rhs):
130
-        c = rhs[i]
130
+    for c in rhs:
131131
         if c in "[(":
132132
             depth += 1
133133
         elif c in "])":
134134
             depth -= 1
135
+            if depth < 0:
136
+                return False
135137
             if depth == 0:
136
-                return saw_dotdot and not saw_comma
137
-        elif depth == 1 and rhs[i : i + 2] == "..":
138
-            saw_dotdot = True
139
-            i += 2
140
-            continue
141
-        elif depth == 1 and c == ",":
142
-            saw_comma = True
143
-        i += 1
138
+                return True
144139
     return False  # unbalanced
145140
 
146141
 
147142
 def _in_rhs_supported(after: str) -> bool:
148143
     """True if the text after a membership `in` is a slice-supported positive unary
149
-    test: a single comparison `<op> endpoint` (`< 10`, `= e`, `!= e`), a single
150
-    interval `[a..b]`/`(a..b)` (endpoints may be function calls), or a *bare endpoint*
151
-    expression — a scalar (`1 in 1` is `1 = 1`) or an expression yielding a range
152
-    (`2 in range("[1..3]")` is membership). The comma-list-of-tests forms
153
-    (`x in [2,3,1]`, `x in (false,true)`, `x in [[a..b],[c..d]]`) stay out of slice —
154
-    there the brackets are a *list of tests*, not one value (deferred — see ROADMAP)."""
144
+    test: a single comparison `<op> endpoint` (`< 10`, `= e`, `!= e`), a bracket/paren
145
+    group — a single interval `[a..b]`/`(a..b)` OR a comma-list / parenthesised list of
146
+    tests (`[2,3,1]`, `(false,true)`, `(1,<5,>=10)`, `[[a..b],[c..d]]`, `(=10)`), all
147
+    now parsed as positive unary tests (Form 1) — or a *bare endpoint* expression: a
148
+    scalar (`1 in 1` is `1 = 1`) or an expression yielding a range
149
+    (`2 in range("[1..3]")` is membership). Endpoints may be function calls; names are
150
+    pre-validated by the free-name scan in `fits_slice_grammar`."""
155151
     t = after.lstrip()
156152
     if re.match(r"<=|>=|!=|<|>|=", t):
157153
         return True
158154
     if t[:1] in "[(":
159
-        # A bracket-led RHS is a single interval/range literal; a comma-list of tests
160
-        # is not yet supported.
161
-        return _single_interval(t)
155
+        return _balanced_bracket_group(t)
162156
     # A bare non-bracket endpoint (a scalar, a variable, or a `range(…)` call): the
163157
     # free-name scan in `fits_slice_grammar` has already validated every name here.
164158
     return True
@@ -204,9 +198,14 @@
204198
             return False
205199
         s = value_expr
206200
 
207
-    # Parenthesised unary range/comparison tests like `(< 10)`, `(=10)`.
208
-    if re.search(r"[\[(]\s*(<=|>=|!=|<|>|=)", s):
209
-        return False
201
+    # A parenthesised comparison test in *value* position — `(< 10)`, `(=10)` — is a
202
+    # range-as-value form not yet supported (Form 4 / ROADMAP); reject it. The SAME
203
+    # shape directly after a membership `in` IS supported now (a one-element paren
204
+    # test-list `x in (=10)` ≡ `Compare(Eq, 10)`; Form 1), so only reject an open
205
+    # bracket/paren + comparison that does not directly follow an `in`.
206
+    for _m in re.finditer(r"[\[(]\s*(?:<=|>=|!=|<|>|=)", s):
207
+        if not re.search(r"(?:^|[^\w])in\s*$", s[: _m.start()]):
208
+            return False
210209
 
211210
     # Multiple iteration contexts (`for i in a, j in b …`; ADR-25) are in the slice
212211
     # now. The subsequent `, name in` variables are added to `bound` below and the
@@ -534,6 +533,19 @@
534533
     "0068-feel-equality:time_005:time_005",
535534
 })
536535
 
536
+# Case ids asserting that a *cross-type* equality test is `false` (DMN reads
537
+# `true = 2`, `[1,2,3] = 1`, … as false). feel-core deliberately makes a non-null
538
+# type mismatch under `=`/`!=` an error-null instead — a conscious "incomparable ⇒
539
+# unknown" reading (ADR-14), unit-tested as `100 = "100"` → error and `{a: 1} = 1`
540
+# → null. So `true in [false, 2, 3]` OR-folds to null where the TCK wants false.
541
+# Exactly one 0072 membership case rides on this (the bracket/paren list parsing
542
+# itself, Form 1, is unaffected). Skipped so the closed loop stays green without
543
+# weakening `=`; aligning cross-type equality with the TCK's `false` is a separate
544
+# semantics decision (its own ADR) — see ROADMAP.
545
+CROSS_TYPE_EQUALITY_SKIPS: frozenset[str] = frozenset({
546
+    "0072-feel-in:boolean_001_a:boolean_001_a",
547
+})
548
+
537549
 # Named-argument calls that name a built-in *overload* whose parameter name
538550
 # feel-core's single-row parameter table cannot carry (ADR-23). The grammar parses
539551
 # these and the head is an in-slice built-in, but the bind fails, so the result is
@@ -861,6 +873,10 @@
861873
                 skipped.append((case_id, "second-resolution temporal equality (ADR-18)"))
862874
                 continue
863875
 
876
+            if case_id in CROSS_TYPE_EQUALITY_SKIPS:
877
+                skipped.append((case_id, "cross-type `=` is error-null in feel-core, not false (ADR-14)"))
878
+                continue
879
+
864880
             if case_id in NAMED_ARG_OVERLOAD_SKIPS:
865881
                 skipped.append((case_id, "named-arg overload not in feel-core's param table (ADR-23)"))
866882
                 continue