aboutsummaryrefslogtreecommitdiff
path: root/src/ast.h
diff options
context:
space:
mode:
authorMustafa Quraish <[email protected]>2022-02-01 04:08:59 -0500
committerMustafa Quraish <[email protected]>2022-02-01 04:08:59 -0500
commitd471a41369690a9d2d9b8862ea5ff0ae9cbe40fc (patch)
tree9399d12700c3d975a95b0946833dc419b3268419 /src/ast.h
parentTesting: Add support for testing stdout results, check builtins (diff)
downloadcup-d471a41369690a9d2d9b8862ea5ff0ae9cbe40fc.tar.xz
cup-d471a41369690a9d2d9b8862ea5ff0ae9cbe40fc.zip
Add basic `defer` implementation.
We don't have any closures yet, so it's essentially the same as just moving the statement after the `defer` keyword to the end of the block/ right before returning from the function.
Diffstat (limited to 'src/ast.h')
-rw-r--r--src/ast.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/ast.h b/src/ast.h
index 39d1a4e..09d15d1 100644
--- a/src/ast.h
+++ b/src/ast.h
@@ -28,6 +28,7 @@
F(AST_CONDITIONAL, "conditional expression") \
F(AST_IF, "if statement") \
F(AST_WHILE, "while statement") \
+ F(AST_DEFER, "defer statement") \
F(AST_FOR, "for statement") \
F(AST_VARDECL, "variable decl") \
F(AST_LOCAL_VAR, "local variable") \