plum

#treesitter#compiler#wasm

git clone https://git.pyrossh.dev/plum

A statically typed, imperative programming language inspired by rust, python


b0d445d — Peter John 2026-11-01T16:31:14+05:30
docs(plans): review residuals plan (approved)
docs/plans/2026-11-01-review-residuals.review.md ADDED
@@ -0,0 +1,35 @@
1
+ # Review residuals: literal error positions, digit type names, unknown methods on consts — review plan
2
+
3
+ ## Summary
4
+ The independent review of everything merged since `0dc0e16` (error sets, `primitive`, optionals and `try`, pattern `if`, inline `if`) found four bugs. Those are already fixed in `287a0ad`. It also left three smaller gaps. This plan fixes those three so the review is complete, then merges `docs/refresh` into `master`.
5
+
6
+ ## What will be built
7
+ | Part | What it does | Size | Built by |
8
+ |---|---|---|---|
9
+ | Literal error position | "integer literal out of range" errors report `file:line:col`, not just the message | S | a careful helper |
10
+ | Digit type names | Type and variant names like `E1`, `V2`, `A1` parse. Single letters stay generic params, and `Int.MAX`-style consts keep working | S | a careful helper |
11
+ | Unknown method on a const | Calling a missing method on a heap-valued static const (`Cfg.TABLE.size()`) is reported by the checker, with a position, instead of failing later in codegen | S | a careful helper |
12
+
13
+ ## How it fits together
14
+ ```mermaid
15
+ flowchart LR
16
+ P[Parser / lexer] -->|literal position| L[Loader errors]
17
+ P -->|E1-style names| G[Grammar]
18
+ C[Checker] -->|methods on static consts| E[Error with position]
19
+ L --> U[You see file:line:col]
20
+ E --> U
21
+ ```
22
+
23
+ ## Decisions you can change
24
+ - Digit type names: allow any `[A-Z][A-Za-z0-9]*` except a lone capital letter (default) | require at least two letters
25
+ - After the fixes: merge `docs/refresh` into `master` (default) | stop and let you review first
26
+
27
+ ## How we will know it works
28
+ - `x := 0x8000_0000_0000_0000` reports an error naming the file and line.
29
+ - `enum E1 = | A1 | B2` works with `match` and with pattern `if`.
30
+ - `Cfg.TABLE.size()` (TABLE a Map) fails in the checker with "Map[...] has no method 'size'" and a position.
31
+ - `cargo test --workspace`, the full Plum suite (50/50 files) and `tree-sitter test` all pass.
32
+ - Each fix is logged in the superlite incident ledger.
33
+
34
+ ## Rough time and cost
35
+ Rough: one fixer run of about 10–20 minutes, then a final re-run of all three suites.