aboutsummaryrefslogtreecommitdiff
path: root/src/ast_render.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/ast_render.cpp')
-rw-r--r--src/ast_render.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/ast_render.cpp b/src/ast_render.cpp
index c4268d01c5..917c61c51c 100644
--- a/src/ast_render.cpp
+++ b/src/ast_render.cpp
@@ -122,6 +122,8 @@ static const char *node_type_str(NodeType node_type) {
return "Directive";
case NodeTypeReturnExpr:
return "ReturnExpr";
+ case NodeTypeDeferExpr:
+ return "DeferExpr";
case NodeTypeVariableDeclaration:
return "VariableDeclaration";
case NodeTypeTypeDecl:
@@ -259,6 +261,14 @@ void ast_print(FILE *f, AstNode *node, int indent) {
ast_print(f, node->data.return_expr.expr, indent + 2);
break;
}
+ case NodeTypeDeferExpr:
+ {
+ const char *prefix_str = return_prefix_str(node->data.defer_expr.kind);
+ fprintf(f, "%s%s\n", prefix_str, node_type_str(node->type));
+ if (node->data.defer_expr.expr)
+ ast_print(f, node->data.defer_expr.expr, indent + 2);
+ break;
+ }
case NodeTypeVariableDeclaration:
{
Buf *name_buf = &node->data.variable_declaration.symbol;
@@ -620,6 +630,8 @@ static void render_node(AstRender *ar, AstNode *node) {
break;
case NodeTypeReturnExpr:
zig_panic("TODO");
+ case NodeTypeDeferExpr:
+ zig_panic("TODO");
case NodeTypeVariableDeclaration:
{
const char *pub_str = visib_mod_string(node->data.variable_declaration.visib_mod);