ast: remove Expr Node (lives under Stmt)
This commit is contained in:
parent
b382c136ec
commit
1c8eda7305
3 changed files with 0 additions and 14 deletions
|
@ -14,7 +14,6 @@ pub const NodeType = enum {
|
|||
ConstDecl,
|
||||
Struct,
|
||||
Block,
|
||||
Expr,
|
||||
Stmt,
|
||||
};
|
||||
|
||||
|
@ -238,7 +237,6 @@ pub const Node = union(NodeType) {
|
|||
|
||||
Block: StmtList,
|
||||
|
||||
Expr: *Expr,
|
||||
Stmt: *Stmt,
|
||||
|
||||
pub fn mkRoot(allocator: *std.mem.Allocator) !*Node {
|
||||
|
|
|
@ -70,12 +70,6 @@ pub fn printNode(node: *Node, ident: usize) void {
|
|||
}
|
||||
},
|
||||
|
||||
.Expr => |expr| {
|
||||
printIdent(ident);
|
||||
printExpr(expr);
|
||||
std.debug.warn("\n");
|
||||
},
|
||||
|
||||
.Stmt => |stmt| {
|
||||
printIdent(ident);
|
||||
printStmt(ident, stmt);
|
||||
|
|
|
@ -162,12 +162,6 @@ pub const Parser = struct {
|
|||
return node;
|
||||
}
|
||||
|
||||
fn mkExpr(self: *Parser, expr: *Expr) !*ast.Node {
|
||||
var node = try self.allocator.create(Node);
|
||||
node.* = Node{ .Expr = expr };
|
||||
return node;
|
||||
}
|
||||
|
||||
fn mkStmt(self: *Parser, stmt: *Stmt) !*ast.Node {
|
||||
var node = try self.allocator.create(Node);
|
||||
node.* = Node{ .Stmt = stmt };
|
||||
|
|
Loading…
Reference in a new issue