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,
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 {

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| {
printIdent(ident);
printStmt(ident, stmt);

View File

@ -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 };