This commit is contained in:
agra
2026-02-11 14:07:43 +02:00
parent cdc6c59dda
commit 94b0296fd5
11 changed files with 406 additions and 674 deletions

View File

@@ -169,6 +169,16 @@ pub const Parser = struct {
// Otherwise it's a constant expression
const value = try self.parseExpr();
// name :: type_expr #builtin; — builtin with type annotation
if (self.current.tag == .hash_builtin) {
const bi_start = self.current.loc.start;
self.advance();
try self.expect(.semicolon);
const bi = try self.createNode(bi_start, .{ .builtin_expr = {} });
return try self.createNode(start_pos, .{ .const_decl = .{ .name = name, .type_annotation = value, .value = bi } });
}
try self.expect(.semicolon);
return try self.createNode(start_pos, .{ .const_decl = .{ .name = name, .type_annotation = null, .value = value } });
}