diff options
| author | 2026-10-14 10:47:30 +0000 | |
|---|---|---|
| committer | 2026-10-14 10:47:30 +0000 | |
| commit | 4a22cf28742bf33577678de494aa09ab60a3c820 (patch) | |
| tree | d9133c7ab431fd3f41ef7713a869d23be4539244 /src/compiler/base.zc | |
| parent | Merge four small fixes: std hovers, capture terminator, bare static calls, vo... (diff) | |
| parent | zc: add the defer statement (diff) | |
Merge the defer statement; todo: tick it, add its follow-ups
Diffstat (limited to 'src/compiler/base.zc')
| -rw-r--r-- | src/compiler/base.zc | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/compiler/base.zc b/src/compiler/base.zc index 17ec80b..d83dc9d 100644 --- a/src/compiler/base.zc +++ b/src/compiler/base.zc @@ -248,6 +248,14 @@ word xprojection; int af_mutation_tick; int xbor = -1; // local a pointer value is borrowed from, or -1 int mdbg, mdbg_flags; // memdebug: compile checks in, and the flags start() turns on int lsp, loopbase, ctxsp, snaptop; +// defer: the statements registered and not yet run, DFR_W words each (the block +// depth of the defer, its token list, whether the analyzer was on, whether compiling +// it failed, so the error is reported once, and the locals there were at the defer), +// newest last. dfr_base is where the current function's entries start. dfr_on is set +// while a deferred statement is compiled; dfr_lsp and dfr_ctx say where its own loops +// and function begin. +const int DFR_MAX = 256, DFR_W = 5; +word[1280] dfr; int ndfr, dfr_base, dfr_on, dfr_lsp, dfr_ctx; int lv, lvk, lvi, kw_expr, xcls, fty; // interned spellings the parser compares against |
