/// <summary> /// Begins a lexical scope. /// </summary> public void BeginScope() { ILGeneratorScope scope = new ILGeneratorScope(this.offset, this.host.NameTable, this.method); this.scopeStack.Push(scope); this.scopes.Add(scope); }
/// <summary> /// Begins a lexical scope. /// </summary> public void BeginScope(uint numberOfIteratorLocalsInScope) { ILGeneratorScope scope = new ILGeneratorScope(this.offset, this.host.NameTable, this.method); this.scopeStack.Push(scope); this.scopes.Add(scope); if (numberOfIteratorLocalsInScope == 0) { return; } if (this.iteratorScopes == null) { this.iteratorScopes = new List <ILocalScope>(); } while (numberOfIteratorLocalsInScope-- > 0) { this.iteratorScopes.Add(scope); } }
/// <summary> /// Begins a lexical scope. /// </summary> public void BeginScope(uint numberOfIteratorLocalsInScope) { ILGeneratorScope scope = new ILGeneratorScope(this.offset, this.host.NameTable, this.method); this.scopeStack.Push(scope); this.scopes.Add(scope); if (numberOfIteratorLocalsInScope == 0) return; if (this.iteratorScopes == null) this.iteratorScopes = new List<ILocalScope>(); while (numberOfIteratorLocalsInScope-- > 0) { this.iteratorScopes.Add(scope); } }
/// <summary> /// Begins a lexical scope. /// </summary> public void BeginScope() { var startLabel = new ILGeneratorLabel(); this.MarkLabel(startLabel); ILGeneratorScope scope = new ILGeneratorScope(startLabel, this.host.NameTable, this.method); this.scopeStack.Push(scope); this.scopes.Add(scope); }