Phase 6A: .aji layer 5 (linear values, own, regions, outcome matches, or trap)
- explicit move for named linear values; E7003 with suggestion "move x"; move of a copyable value is E7006; moved state left to the verifier - own.new/own.array/region.create/region.new/region.array/cap.narrow.budget as outcome matches or with `or trap`; own.take/own.free/region.reset/ region.destroy as AIR names in AIR operand order - region.new/region.array take an explicit ref/mut region binding (E7005 otherwise); reset/destroy end nothing (verifier E2104) - match kind (enum/outcome/integer) decided by the parser; built-in error enums (alloc_error, cap_error, io_error) matched exhaustively - cap<K> types; linear owners borrowed in place - features header = registry closure of the features used - parameters keep their source names (grants by @main parameter name) - aji lower --stats: mechanical_air_eliminated = 1 - source/AIR bytes - spec 15, grammar, quick reference, plan updated
This commit is contained in:
1 parent
eca30f817a
commit
bdcf871e5d
28 files changed
+882
-78
No files matched your search
@@ -701,7 +701,15 @@ const Parser = struct {
|
||||
const scrut = try p.condition();
|
||||
_ = try p.expect(.l_brace, "`{`");
|
||||
const as = try p.arms();
|
||||
return .{ .span = p.span(start), .kind = .{ .match_expr = try p.box(ast.Match, .{ .scrutinee = scrut, .arms = as, .span = p.span(start) }) } };
|
||||
var kind: ast.Match.Kind = .integer;
|
||||
for (as) |a| switch (a.pattern.kind) {
|
||||
.ctor => |c| {
|
||||
kind = if (c.qualifier != null) .@"enum" else .outcome;
|
||||
break;
|
||||
},
|
||||
else => {},
|
||||
};
|
||||
return .{ .span = p.span(start), .kind = .{ .match_expr = try p.box(ast.Match, .{ .scrutinee = scrut, .arms = as, .span = p.span(start), .kind = kind }) } };
|
||||
}
|
||||
if (isKeyword(t.text)) return p.fail(t, "an expression");
|
||||
_ = p.next();
|
||||
|
||||
Reference in new issue
Block a user