build options #compiler

This commit is contained in:
agra
2026-03-03 09:35:50 +02:00
parent aa1235c621
commit 03074472e5
16 changed files with 191 additions and 64 deletions

View File

@@ -1215,13 +1215,18 @@ pub const Parser = struct {
return_type = try self.parseTypeExpr();
}
// Body: block `{ ... }`, arrow `=> expr;`, #builtin, or #foreign marker
// Body: block `{ ... }`, arrow `=> expr;`, #builtin, #compiler, or #foreign marker
var is_arrow = false;
const body = if (self.current.tag == .hash_builtin) blk: {
const bi_start = self.current.loc.start;
self.advance();
try self.expect(.semicolon);
break :blk try self.createNode(bi_start, .{ .builtin_expr = {} });
} else if (self.current.tag == .hash_compiler) blk: {
const ci_start = self.current.loc.start;
self.advance();
try self.expect(.semicolon);
break :blk try self.createNode(ci_start, .{ .compiler_expr = {} });
} else if (self.current.tag == .hash_foreign) blk: {
const fi_start = self.current.loc.start;
self.advance();
@@ -2351,7 +2356,7 @@ pub const Parser = struct {
fn isFunctionDef(self: *Parser) bool {
const tag = self.peekPastParens() orelse return false;
return tag == .l_brace or tag == .arrow or tag == .hash_builtin or tag == .hash_foreign or tag == .fat_arrow;
return tag == .l_brace or tag == .arrow or tag == .hash_builtin or tag == .hash_compiler or tag == .hash_foreign or tag == .fat_arrow;
}
fn isAssignOp(self: *const Parser) bool {