semantic: Mark Scopes with nestedDepth in ScopeManager.