Phase 6A: .aji frontend, layer 1 (scalars, expressions, functions, control flow)
src/frontend: lexer, AST, parser for the full 6A grammar (first error only: one E7001 with span, expected and found), lowering to canonical text AIR with a line map. Variables become SSA with block parameters carried across if/while/for/loop joins; short-circuit and/or; checked, wrapping and cast forms; calls; untyped let literals typed from later uses, never guessed (E7007). The frontend repairs nothing. check.checkFile: .aji → frontend → existing AIR parser and verifier; every diagnostic at its source location, AIR location kept as air_line/air_col; trap records gain source_location. CLI: check/run on .aji, aji lower [--annotate]. Runner: .aji tests with the same headers; every accepted module must lower deterministically, be canonical (lower → parse → print unchanged) and match <file>.expected if present. Layer-1 tests: 6 run, 6 E7xxx rejects, 2 verifier-caught (E1002, E3101).
This commit is contained in:
1 parent
bfb4c445cd
commit
ba3e9b3719
26 files changed
+2478
-13
No files matched your search
@@ -269,9 +269,9 @@ A byte string or array used where a `slice<u8>` is expected is materialized in f
|
||||
|
||||
| Problem | Code |
|
||||
|---|---|
|
||||
| found by the verifier on the lowered AIR | the AIR code, reported with `source_location` (file, line, column of the construct the instruction came from) and `air_location` (function, block, instruction) |
|
||||
| found by the verifier on the lowered AIR | the AIR code; the diagnostic's `file`, `line` and `col` are the source location of the construct the instruction came from, and `air_line`/`air_col` locate it in the lowered AIR (`aji lower`); the verifier's own fields (`function`, `block`, `inst`) are kept |
|
||||
| syntax, name resolution, lowering and invalid source constructs | `E7xxx`, below |
|
||||
| trap at run time | the trap record also carries `source_location` |
|
||||
| trap at run time | the trap record also carries `source_location` (`file`, `line`, `col`) |
|
||||
|
||||
| Code | Kind | Meaning |
|
||||
|---|---|---|
|
||||
@@ -290,3 +290,6 @@ A byte string or array used where a `slice<u8>` is expected is materialized in f
|
||||
| `aji check file.aji` | parse, lower, verify |
|
||||
| `aji run file.aji` | the same, then run (same flags and run record as for `.air`) |
|
||||
| `aji lower file.aji` | print the canonical AIR |
|
||||
| `aji lower --annotate file.aji` | the same with `; line:col-line:col` source spans before each instruction (not canonical; for debugging) |
|
||||
|
||||
Lowering is deterministic: the same source and compiler give byte-identical AIR, and the lowered AIR is canonical (parse → print reproduces it). The conformance runner checks both for every accepted `.aji` test.
|
||||
Reference in new issue
Block a user