Rhino.Ast.Scope.SplitScope C# (CSharp) Method

SplitScope() public static method

Creates a new scope node, moving symbol table information from "scope" to the new node, and making "scope" a nested scope contained by the new node.
Creates a new scope node, moving symbol table information from "scope" to the new node, and making "scope" a nested scope contained by the new node. Useful for injecting a new scope in a scope chain.
public static SplitScope ( Rhino scope ) : Scope
scope Rhino
return Scope
		public static Rhino.Ast.Scope SplitScope(Rhino.Ast.Scope scope)
		{
			Rhino.Ast.Scope result = new Rhino.Ast.Scope(scope.GetType());
			result.symbolTable = scope.symbolTable;
			scope.symbolTable = null;
			result.parent = scope.parent;
			result.SetParentScope(scope.GetParentScope());
			result.SetParentScope(result);
			scope.parent = result;
			result.top = scope.top;
			return result;
		}