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
@@ -0,0 +1,12 @@
|
||||
module demo.sum
|
||||
air 0
|
||||
lang 0.1
|
||||
features [effects]
|
||||
|
||||
fn @main() -> u64
|
||||
effects []
|
||||
entry:
|
||||
%c_1 = const.u64 10
|
||||
%c_2 = const.u64 20
|
||||
%t_3 = add.checked.u64 %c_1, %c_2
|
||||
ret %t_3
|
||||
Reference in new issue
Block a user