aboutsummaryrefslogtreecommitdiff
path: root/token.c
diff options
context:
space:
mode:
authorAnna (navi) Figueiredo Gomes <navi@vlhl.dev>2024-11-06 02:46:44 +0100
committerAnna (navi) Figueiredo Gomes <navi@vlhl.dev>2024-11-06 12:17:01 +0100
commit3e51be9d94e561549281e386ce1b7554018ef4dd (patch)
treea88f20aba911030f16e692351cf5489746917910 /token.c
parentf66a661359a39e10af01508ad02429517b8460e3 (diff)
cproc: Implement defer statement.defer
implemented by keeping a list of deferred blocks in a function, and emitting them before scope exits (return, lbracket, break, continue) TODO: error checking, the compiler should error should a compile time jump (goto) would go over a defer statement.
Diffstat (limited to 'token.c')
-rw-r--r--token.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/token.c b/token.c
index b67baa6..0a70662 100644
--- a/token.c
+++ b/token.c
@@ -22,6 +22,7 @@ const char *tokstr[] = {
[TCONSTEXPR] = "constexpr",
[TCONTINUE] = "continue",
[TDEFAULT] = "default",
+ [TDEFER] = "defer",
[TDO] = "do",
[TDOUBLE] = "double",
[TELSE] = "else",