aboutsummaryrefslogtreecommitdiff
path: root/editors
diff options
context:
space:
mode:
authorGravatar zinc <zinc@downsta.ir> 2026-10-14 10:39:47 +0000
committerGravatar zinc <zinc@downsta.ir> 2026-10-14 10:39:47 +0000
commit54b8a8918bb63c98a8f58e823033232243647562 (patch)
treee0608f7dab1f568c22390262e5a6d39966519760 /editors
parenttodo: handoff section with state, conventions, in-flight work and architectur... (diff)
zc: add the defer statement
defer expr; and defer { ... } register code that runs when the enclosing block ends: at the end of the block, and at return, break and continue that leave it. the tokens are kept at the defer and compiled again at each exit (block_close, body, kw_return, kw_break, kw_continue), newest first, before the block's variables are released, so the analyzer sees a deferred rt.free(p) as the transfer of p where it runs. names mean what they meant at the defer; values are read when it runs. return, break and continue inside a deferred statement are errors, reported once. works in unchecked code and closures (own base per function context).
Diffstat (limited to 'editors')
-rw-r--r--editors/vscode/syntaxes/zc.tmLanguage.json2
1 files changed, 1 insertions, 1 deletions
diff --git a/editors/vscode/syntaxes/zc.tmLanguage.json b/editors/vscode/syntaxes/zc.tmLanguage.json
index 6f76e03..fab026b 100644
--- a/editors/vscode/syntaxes/zc.tmLanguage.json
+++ b/editors/vscode/syntaxes/zc.tmLanguage.json
@@ -83,7 +83,7 @@
"patterns": [
{
"name": "keyword.control.zc",
- "match": "\\b(if|else|while|do|for|switch|case|default|break|continue|return)\\b"
+ "match": "\\b(if|else|while|do|for|switch|case|default|break|continue|return|defer)\\b"
},
{
"name": "keyword.declaration.zc",