parsing code for defer and more
* disable goto and label support see #44 * refactor the way block contexts work
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user