ABT.Env2.InScope C# (CSharp) Method

InScope() public method

Add a new local symbol table.
public InScope ( ) : Env2
return Env2
        public Env2 InScope() {
            if (this._functionScope.IsNone) {
                throw new InvalidProgramException("Isn't in a function. Cannot push scope.");
            }

            return new Env2(
                this._globalSymbolTable,
                Option.Some(new FunctionScope(
                    this._functionScope.Value.FunctionType,
                    this._functionScope.Value.FunctionParams,
                    this._functionScope.Value.LocalScopes.Push(new LocalSymbolTable())
                ))
            );
        }