diff options
| author | gingerBill <gingerBill@users.noreply.github.com> | 2025-02-19 10:59:05 +0000 |
|---|---|---|
| committer | gingerBill <gingerBill@users.noreply.github.com> | 2025-02-19 10:59:05 +0000 |
| commit | 0bac34eec891080e2d0b9b4fc9e7b429a42064a3 (patch) | |
| tree | 28f3a43d652ee4e1fe90af9d0410ebcf01083b5e /src/checker.cpp | |
| parent | 827cd45f04f2f86c59c67c549dbc44b33e1f2863 (diff) | |
Number fields within procedures with a depth-first numbering system
Diffstat (limited to 'src/checker.cpp')
| -rw-r--r-- | src/checker.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/checker.cpp b/src/checker.cpp index 38da38b0c..f1f1b2556 100644 --- a/src/checker.cpp +++ b/src/checker.cpp @@ -358,6 +358,10 @@ gb_internal void check_open_scope(CheckerContext *c, Ast *node) { scope->flags |= ScopeFlag_Type; break; } + if (c->decl && c->decl->proc_lit) { + // Number the scopes within a procedure body depth-first + scope->index = c->decl->scope_index++; + } c->scope = scope; c->state_flags |= StateFlag_bounds_check; } |