private bool Locate(Type contextType, int line, int column, out Node node, out Scope scope, out Node context) { Locator locator = new Locator(contextType, line, column); global.Walk(locator); node = locator.Candidate; scope = locator.Scope != null ? scopes[locator.Scope] : null; context = locator.Context; #if DEBUG if (node != null) { Debug.Print("Located {0} in {1} at {2}:{3}-{4}:{5}", node, context != null ? (object)context : (object)"<unknown>", node.Start.Line, node.Start.Column, node.End.Line, node.End.Column ); } #endif return node != null && context != null; }
public bool Locate(int line, int column, out Node node, out Scope scope) { Locator locator = new Locator(line, column); global.Walk(locator); node = locator.Candidate; scope = locator.Scope != null ? scopes[locator.Scope] : null; #if DEBUG if (node != null) { Debug.Print("Located {0} at {1}:{2}-{3}:{4}", node, node.Start.Line, node.Start.Column, node.End.Line, node.End.Column ); } #endif return node != null; }