air: data model, text parser and canonical serializer (P0-4, P0-5, P0-6)

- src/air/module.zig: types, values, instructions, blocks, functions
- src/air/parse.zig: lexer and parser for text AIR format 0 with name
  resolution; reports E0001-E0006, E5001 (undefined/double definition),
  E5002 (unknown block label)
- src/air/print.zig: canonical serializer (spec 07 §8.5) with a
  deterministic round-trip fuzz test
- diag registry: E0xxx, E1003, T0xxx
This commit is contained in:
dev committed 2026-10-04 12:19:38 +03:00
1 parent 41b764ccfd
commit ef6a2c5475
5 files changed
+1636 -9

No files matched your search

+29 -8
View File
@@ -1,12 +1,33 @@
//! AIR — Aji Intermediate Representation (spec 07, RFC 0004).
//!
//! Phase 0 deliverables (docs/plan/phase-0-semantic-skeleton.md):
//! - type and value model;
//! - text AIR lexer, parser and canonical serializer;
//! - functions, basic blocks with block parameters, terminators.
//! AIR — Aji Intermediate Representation (spec 07, spec 07a, RFC 0004).
//!
//! Text AIR is the canonical interchange until opcode numbering freezes
//! (RFC 0004 "Binary stability").
/// Bumped on any incompatible change to text or binary AIR (spec 00 §5).
pub const format_version: u32 = 0;
const module = @import("air/module.zig");
pub const format_version = module.format_version;
pub const lang_version = module.lang_version;
pub const Module = module.Module;
pub const Function = module.Function;
pub const Block = module.Block;
pub const Inst = module.Inst;
pub const Op = module.Op;
pub const Type = module.Type;
pub const IntType = module.IntType;
pub const TypeDecl = module.TypeDecl;
pub const ValueId = module.ValueId;
pub const Span = module.Span;
pub const Param = module.Param;
pub const Target = module.Target;
pub const forEachUse = module.forEachUse;
pub const successors = module.successors;
pub const parse = @import("air/parse.zig");
pub const print = @import("air/print.zig");
test {
_ = module;
_ = parse;
_ = print;
}