X-Git-Url: https://ocean-lang.org/code/?p=ocean;a=blobdiff_plain;f=csrc%2Foceani.mdc;h=04cae63a944360db4e963e1f43a622b05b785854;hp=af24d9becd86326c48633e66cd0718a5510479da;hb=20a0aeadef40b5d44f10e41b64be4d9a6df360e0;hpb=d7e32bb049504f5e931f09ac041470f496c58b2c diff --git a/csrc/oceani.mdc b/csrc/oceani.mdc index af24d9b..04cae63 100644 --- a/csrc/oceani.mdc +++ b/csrc/oceani.mdc @@ -953,13 +953,13 @@ Each variable records a scope depth and is in one of four states: enclosed the declaration, and that has closed. - "conditionally in scope". The "in scope" block and all parallel - scopes have closed, and no further mention of the name has been - seen. This state includes a secondary nest depth which records the - outermost scope seen since the variable became conditionally in - scope. If a use of the name is found, the variable becomes "in - scope" and that secondary depth becomes the recorded scope depth. - If the name is declared as a new variable, the old variable becomes - "out of scope" and the recorded scope depth stays unchanged. + scopes have closed, and no further mention of the name has been seen. + This state includes a secondary nest depth (`min_depth`) which records + the outermost scope seen since the variable became conditionally in + scope. If a use of the name is found, the variable becomes "in scope" + and that secondary depth becomes the recorded scope depth. If the + name is declared as a new variable, the old variable becomes "out of + scope" and the recorded scope depth stays unchanged. - "out of scope". The variable is neither in scope nor conditionally in scope. It is permanently out of scope now and can be removed from @@ -1150,6 +1150,7 @@ all pending-scope variables become conditionally scoped. (v->scope == OutScope || v->name->var != v) ? (*vp = v->in_scope, 0) : ( vp = &v->in_scope, 0)) { + v->min_depth = c->scope_depth; if (v->name->var != v) { /* This is still in scope, but we haven't just * closed the scope. @@ -1208,7 +1209,6 @@ all pending-scope variables become conditionally scoped. v2 = v2->previous) if (v2->type == Tlabel) { v2->scope = CondScope; - v2->min_depth = c->scope_depth; } else v2->scope = OutScope; break;