cleanup
This commit is contained in:
@@ -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 } });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user