arena
This commit is contained in:
12
src/ast.zig
12
src/ast.zig
@@ -39,6 +39,7 @@ pub const Node = struct {
|
||||
type_expr: TypeExpr,
|
||||
param: Param,
|
||||
defer_stmt: DeferStmt,
|
||||
push_stmt: PushStmt,
|
||||
comptime_expr: ComptimeExpr,
|
||||
insert_expr: InsertExpr,
|
||||
return_stmt: ReturnStmt,
|
||||
@@ -253,12 +254,18 @@ pub const StructTypeParam = struct {
|
||||
constraint: *Node, // type_expr: "u32" for value param, "Type" for type param
|
||||
};
|
||||
|
||||
pub const UsingEntry = struct {
|
||||
insert_index: u32, // position in field_names where used fields are spliced
|
||||
type_name: []const u8, // struct type to inline
|
||||
};
|
||||
|
||||
pub const StructDecl = struct {
|
||||
name: []const u8,
|
||||
field_names: []const []const u8,
|
||||
field_types: []const *Node, // type_expr nodes
|
||||
field_defaults: []const ?*Node, // default value per field, null if none
|
||||
type_params: []const StructTypeParam = &.{},
|
||||
using_entries: []const UsingEntry = &.{},
|
||||
};
|
||||
|
||||
pub const StructFieldInit = struct {
|
||||
@@ -288,6 +295,11 @@ pub const DeferStmt = struct {
|
||||
expr: *Node,
|
||||
};
|
||||
|
||||
pub const PushStmt = struct {
|
||||
context_expr: *Node,
|
||||
body: *Node,
|
||||
};
|
||||
|
||||
pub const ComptimeExpr = struct {
|
||||
expr: *Node,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user