]> ocean-lang.org Git - ocean/blobdiff - csrc/oceani.mdc
oceani: update min_depth promptly.
[ocean] / csrc / oceani.mdc
index af24d9becd86326c48633e66cd0718a5510479da..04cae63a944360db4e963e1f43a622b05b785854 100644 (file)
@@ -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;