This commit is contained in:
agra
2026-02-19 01:26:04 +02:00
parent fbf8a62362
commit e0e655cd36
11 changed files with 938 additions and 25 deletions

View File

@@ -65,6 +65,9 @@ pub const Node = struct {
foreign_expr: ForeignExpr,
library_decl: LibraryDecl,
function_type_expr: FunctionTypeExpr,
tuple_type_expr: TupleTypeExpr,
tuple_literal: TupleLiteral,
ufcs_alias: UfcsAlias,
pub fn declName(self: Data) ?[]const u8 {
return switch (self) {
@@ -75,6 +78,7 @@ pub const Node = struct {
.struct_decl => |d| d.name,
.union_decl => |d| d.name,
.namespace_decl => |d| d.name,
.ufcs_alias => |d| d.name,
else => null,
};
}
@@ -153,6 +157,7 @@ pub const BinaryOp = struct {
or_op,
bit_and,
bit_or,
in_op,
};
};
@@ -394,3 +399,22 @@ pub const FunctionTypeExpr = struct {
param_types: []const *Node,
return_type: ?*Node, // null = void return
};
pub const TupleTypeExpr = struct {
field_types: []const *Node,
field_names: ?[]const []const u8, // null for positional
};
pub const TupleLiteral = struct {
elements: []const TupleElement,
};
pub const TupleElement = struct {
name: ?[]const u8, // null for positional
value: *Node,
};
pub const UfcsAlias = struct {
name: []const u8,
target: []const u8,
};