<feed xmlns='http://www.w3.org/2005/Atom'>
<title>moon/zygotec/tests/langerrors/defer_continue.zc, branch main</title>
<subtitle> work-in-progress programming language.
</subtitle>
<id>https://git.downsta.ir/moon/zygotec/atom?h=main</id>
<link rel='self' href='https://git.downsta.ir/moon/zygotec/atom?h=main'/>
<link rel='alternate' type='text/html' href='https://git.downsta.ir/moon/zygotec/'/>
<updated>2026-10-14T10:39:47+00:00</updated>
<entry>
<title>zc: add the defer statement</title>
<updated>2026-10-14T10:39:47+00:00</updated>
<author>
<name>zinc</name>
<email>zinc@downsta.ir</email>
</author>
<published>2026-10-14T10:39:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.downsta.ir/moon/zygotec/commit/?id=54b8a8918bb63c98a8f58e823033232243647562'/>
<id>urn:sha1:54b8a8918bb63c98a8f58e823033232243647562</id>
<content type='text'>
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).
</content>
</entry>
</feed>
