nx_probe_opstart_live.nx source
↩ module page · 19 lines · 1028 B
1// nx_probe_opstart_live.nx -- MUST-REFUSE WITNESS for the operator-at-expression-start refusal
2// (parse_primary denylist: "an operator starts this expression"), written 2026-09-02 because its old
3// witness, nx_probe_mlop_live.nx, stopped reaching the condition when LN15 shipped: a line opening
4// with `+` now JOINS the expression above it, and that program is simply correct.
5//
6// THIS fixture cannot be joined into anything correct. After `a +` the parser asks parse_unary for an
7// operand; `+` has no prefix form (parse_unary consumes - ! ~ & * only), so parse_primary is handed an
8// operator token with the expression already open. The rule did not change; only its irreducible
9// witness did.
10//
11// EXPECT: COMPILE-FAIL, exit 2, with 'an operator starts this expression'. If this ever BUILDS, the
12// parser-desync refusal has been lost -- there is no benign reading of `a + + b`.
13func main(argc: i64, argv: *u8) -> i64 {
14 let a: i64 = 1
15 let b: i64 = 2
16 let c: i64 = a + + b
17 if c != 3 { return 7 }
18 return 0
19}