summaryrefslogtreecommitdiff
path: root/parse.c
diff options
context:
space:
mode:
Diffstat (limited to 'parse.c')
-rw-r--r--parse.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/parse.c b/parse.c
index 290bb5d..7c6fe7d 100644
--- a/parse.c
+++ b/parse.c
@@ -2448,6 +2448,13 @@ static Status parse_stmt(Parser *p, Statement *s, bool *was_a_statement) {
return false;
}
goto success;
+ case KW_DEFER:
+ s->kind = STMT_DEFER;
+ ++t->token;
+ s->defer = parser_malloc(p, sizeof *s->defer);
+ if (!parse_stmt(p, s->defer, was_a_statement))
+ return false;
+ goto success;
default: break;
}
} else if (t->token->kind == TOKEN_DIRECT) {
@@ -2932,6 +2939,10 @@ static void fprint_stmt(FILE *out, Statement *s) {
case STMT_CONT:
fprintf(out, "continue;");
break;
+ case STMT_DEFER:
+ fprintf(out, "defer ");
+ fprint_stmt(out, s->defer);
+ break;
}
}