writeonce/compiler/test/golden/tokens/representative.expected
shoney.arickathil 012562290d feat(compiler): Tasks 1-4 — scaffold, diagnostics, lexer, declaration parser
- Task 1: OCaml/dune scaffold with woc CLI (exit codes 0/1/2), just woc-build/woc-test
- Task 2: Diagnostics module — WO-E coded diagnostics with excerpts, related sites, ordered dedup collector, exit-code decision
- Task 3: Newline-significant lexer mirroring rt conventions (self/me/subscribe/insert stay idents), --dump-tokens, golden test framework with bless mode
- Task 4: Declaration parser — class/type/interface/fn signatures, @gc/@table annotations, brace-depth skip-on-block (service/policy/on), decl-level recovery, --dump-ast goldens
- 13 golden fixtures (tokens + AST) with WOC_BLESS=1 support
- just woc-test green (14 diag + 93 runner checks)
2026-08-10 09:00:08 +02:00

169 lines
2.3 KiB
Text

1:88 NEWLINE
2:1 AT
2:2 IDENT(table)
2:7 LPAREN
2:8 IDENT(name)
2:12 COLON
2:14 STR(products)
2:24 COMMA
2:26 IDENT(index)
2:31 COLON
2:33 LBRACKET
2:34 IDENT(name)
2:38 RBRACKET
2:39 RPAREN
2:40 NEWLINE
3:1 KW_CLASS
3:7 IDENT(Product)
3:15 LBRACE
3:16 NEWLINE
4:3 KW_LET
4:7 IDENT(name)
4:11 COLON
4:13 IDENT(Text)
4:18 EQ
4:20 STR(widget)
4:28 NEWLINE
5:3 KW_LET
5:7 IDENT(price)
5:12 COLON
5:14 IDENT(Int)
5:18 EQ
5:20 INT(42)
5:22 NEWLINE
6:3 KW_LET
6:7 IDENT(tags)
6:11 COLON
6:13 LBRACKET
6:14 IDENT(Text)
6:18 RBRACKET
6:20 EQ
6:22 LBRACKET
6:23 RBRACKET
6:24 NEWLINE
7:3 KW_LET
7:7 IDENT(in_stock)
7:15 COLON
7:17 IDENT(Bool)
7:22 EQ
7:24 KW_TRUE
7:28 NEWLINE
9:3 KW_FN
9:6 IDENT(discounted)
9:16 LPAREN
9:17 IDENT(pct)
9:20 COLON
9:22 IDENT(Int)
9:25 RPAREN
9:27 ARROW
9:30 IDENT(Int)
9:34 LBRACE
9:35 NEWLINE
10:5 KW_LET
10:9 IDENT(cut)
10:13 EQ
10:15 IDENT(self)
10:19 DOT
10:20 IDENT(price)
10:26 STAR
10:28 IDENT(pct)
10:32 SLASH
10:34 INT(100)
10:37 NEWLINE
11:5 KW_IF
11:8 IDENT(cut)
11:12 GTEQ
11:15 IDENT(self)
11:19 DOT
11:20 IDENT(price)
11:26 LBRACE
11:27 NEWLINE
12:7 KW_RETURN
12:14 INT(0)
12:15 NEWLINE
13:5 RBRACE
13:7 KW_ELSE
13:12 LBRACE
13:13 NEWLINE
14:7 KW_RETURN
14:14 IDENT(self)
14:18 DOT
14:19 IDENT(price)
14:25 DASH
14:27 IDENT(cut)
14:30 NEWLINE
15:5 RBRACE
15:6 NEWLINE
16:3 RBRACE
16:4 NEWLINE
18:3 KW_FN
18:6 IDENT(total)
18:11 LPAREN
18:12 IDENT(counts)
18:18 COLON
18:20 LBRACKET
18:21 IDENT(Int)
18:24 RBRACKET
18:25 RPAREN
18:27 ARROW
18:30 IDENT(Int)
18:34 LBRACE
18:35 NEWLINE
19:5 KW_LET
19:9 IDENT(sum)
19:13 EQ
19:15 INT(0)
19:16 NEWLINE
20:5 KW_FOR
20:9 IDENT(n)
20:11 KW_IN
20:14 IDENT(counts)
20:21 LBRACE
20:22 NEWLINE
21:7 IDENT(sum)
21:11 EQ
21:13 IDENT(sum)
21:17 PLUS
21:19 IDENT(n)
21:20 NEWLINE
22:5 RBRACE
22:6 NEWLINE
23:5 KW_RETURN
23:12 IDENT(sum)
23:15 NEWLINE
24:3 RBRACE
24:4 NEWLINE
26:3 KW_FN
26:6 IDENT(clearance)
26:15 LPAREN
26:16 RPAREN
26:18 ARROW
26:21 IDENT(Bool)
26:26 LBRACE
26:27 NEWLINE
27:5 KW_LET
27:9 IDENT(ok)
27:12 EQ
27:14 IDENT(self)
27:18 DOT
27:19 IDENT(price)
27:25 LTEQ
27:28 INT(50)
27:30 NEWLINE
28:5 KW_WHILE
28:11 IDENT(ok)
28:14 LBRACE
28:15 NEWLINE
29:7 KW_RETURN
29:14 KW_FALSE
29:19 NEWLINE
30:5 RBRACE
30:6 NEWLINE
31:5 KW_RETURN
31:12 IDENT(ok)
31:14 NEWLINE
32:3 RBRACE
32:4 NEWLINE
33:1 RBRACE
33:2 NEWLINE
34:1 EOF