- docs/examples/operators: manual-test workload (ok/FAIL lines per expression; trap mode proves WO_T_SHIFT); NO test fixtures by developer directive — acceptance is the manual pass - 00-wob-format.md: v6 section (opcodes 42-46, T_SHIFT, header v6) - CODE-LOGIC.md both sides: precedence-into-existing-rungs, Lua not, rewind-and-reparse compound assigns, trap-not-mask, 63-bit hex limit - story 36 refine -> in-progress with landing blockquote; board updated - gates: woc-test 543/0, wovm-test ASan, oop-accept ALL MET, deps-accept 8/0, web-app 26/0 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1.6 KiB
1.6 KiB
operators — iteration 36's manual-test workload
Exercises everything iteration 36 added to the language: boolean not,
the five Int bitwise operators (& | ^ << >>), hex/binary/
underscore integer literals, and the five compound assigns
(+= -= *= /= %=).
Run it
woc . # from this directory
./target/operators
Every line prints ok <label> = <value> — each label states the exact
expression and the expected result, so a manual test is reading the
lines and spotting any FAIL. The sections, in order:
- Literals —
0xFF,0b1010_1010,1_000_000against their decimal twins. - The five operators — including
-16 >> 2 = -4(>>is ARITHMETIC: the sign bit extends, the story's settled decision 1) and complement spelled-1 ^ x(no~in this language). - Precedence pins — Go's C-trap fix:
&/<</>>bind with*,|/^bind with+, all above comparison, sox & mask == 0groups the AND first and1 << 4 + 1is 17, not 32. not— a word likeand/or, Lua's unary placement:not a == bgroups(not a) == b.- Compound assigns — one value threaded through all five.
- The consumer proof — HMAC's ipad/opad step (story 34's blocker):
byte_at(key, i) ^ 0x36/^ 0x5Cin pure.wo.
The trap
./target/operators trap
must die with trap 12 in shift_by ...: shift count out of range 0..63
(exit 1). A shift count outside 0..63 is a RUN-TIME trap only when the
count is a variable — a literal out-of-range count never compiles
(WO-E223, try changing 1 << 6 to 1 << 64).