ast: remove Expr Node (lives under Stmt)

This commit is contained in:
Luna 2019-08-26 14:48:53 -03:00
parent b382c136ec
commit 1c8eda7305
3 changed files with 0 additions and 14 deletions

View File

@ -14,7 +14,6 @@ pub const NodeType = enum {
ConstDecl, ConstDecl,
Struct, Struct,
Block, Block,
Expr,
Stmt, Stmt,
}; };
@ -238,7 +237,6 @@ pub const Node = union(NodeType) {
Block: StmtList, Block: StmtList,
Expr: *Expr,
Stmt: *Stmt, Stmt: *Stmt,
pub fn mkRoot(allocator: *std.mem.Allocator) !*Node { pub fn mkRoot(allocator: *std.mem.Allocator) !*Node {

View File

@ -70,12 +70,6 @@ pub fn printNode(node: *Node, ident: usize) void {
} }
}, },
.Expr => |expr| {
printIdent(ident);
printExpr(expr);
std.debug.warn("\n");
},
.Stmt => |stmt| { .Stmt => |stmt| {
printIdent(ident); printIdent(ident);
printStmt(ident, stmt); printStmt(ident, stmt);

View File

@ -162,12 +162,6 @@ pub const Parser = struct {
return node; 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 { fn mkStmt(self: *Parser, stmt: *Stmt) !*ast.Node {
var node = try self.allocator.create(Node); var node = try self.allocator.create(Node);
node.* = Node{ .Stmt = stmt }; node.* = Node{ .Stmt = stmt };