air: feature negotiation for AIR format 0 (DD-014)
- reference/air-features.md: normative feature registry (arrays, atomics, capabilities, channels, effects, islands, ownership, regions, sync, tasks; all reserved), dependency closures, reasons for E0006 - spec 07 §8.1/§8.5/§8.7: features are mandatory, validated before the body, full dependency closure declared, sorted canonically; every extension belongs to a feature; published feature semantics immutable - spec 05 §8: features vs effects vs capabilities - src/air/features.zig: registry, validation, sync test with the docs - parser validates features first; E0006 carries `reason` - `aji features` prints supported AIR format, language and features - conformance: unknown, reserved and duplicate feature tests - plan: feature publication tasks in phases 1-5
This commit is contained in:
1 parent
03dda1245a
commit
19dff5dd52
24 files changed
+366
-17
No files matched your search
@@ -20,6 +20,7 @@ const usage =
|
||||
\\ verify, then run @main and print the run record;
|
||||
\\ --fuel stops after N executed instructions
|
||||
\\ codes list diagnostic codes as JSON Lines
|
||||
\\ features print supported AIR format, language version and features
|
||||
\\ explain <code> show one diagnostic code
|
||||
\\ version print toolchain version
|
||||
\\
|
||||
@@ -54,6 +55,16 @@ fn run(io: std.Io, arena: std.mem.Allocator, args: []const [:0]const u8, out: *s
|
||||
try out.print("aji {s} (air format {d})\n", .{ aji.version, aji.air.format_version });
|
||||
return .accepted;
|
||||
}
|
||||
if (std.mem.eql(u8, cmd, "features")) {
|
||||
var s: std.json.Stringify = .{ .writer = out };
|
||||
try s.write(.{
|
||||
.air = aji.air.format_version,
|
||||
.lang = std.fmt.comptimePrint("{d}.{d}", .{ aji.air.lang_version[0], aji.air.lang_version[1] }),
|
||||
.features = &aji.air.features.supported,
|
||||
});
|
||||
try out.writeByte('\n');
|
||||
return .accepted;
|
||||
}
|
||||
if (std.mem.eql(u8, cmd, "codes")) {
|
||||
for (aji.diag.registry) |c| try writeCode(out, c);
|
||||
return .accepted;
|
||||
|
||||
Reference in new issue
Block a user