예제 #1
0
 public override int GetStop(PythonAst ast) {
     return ast.IndexToLocation(_endIndex).Index;
 }
예제 #2
0
파일: Node.cs 프로젝트: zuokaihuang/PTVS
 public SourceLocation GetEnd(PythonAst parent)
 {
     return(parent.IndexToLocation(EndIndex));
 }
예제 #3
0
 public override int GetStart(PythonAst ast) {
     return ast.IndexToLocation(_startIndex).Index;
 }
예제 #4
0
 public SourceLocation GetHeader(PythonAst ast) {
     return ast.IndexToLocation(_headerIndex);
 }
예제 #5
0
파일: Node.cs 프로젝트: zuokaihuang/PTVS
 public SourceLocation GetStart(PythonAst parent)
 {
     return(parent.IndexToLocation(StartIndex));
 }
예제 #6
0
파일: Node.cs 프로젝트: RussBaz/PTVS
 public SourceLocation GetEnd(PythonAst parent) {            
     return parent.IndexToLocation(EndIndex);
 }
 /// <summary>
 /// Returns the span of the name component of the expression
 /// </summary>
 public SourceSpan GetNameSpan(PythonAst parent)
 {
     return(new SourceSpan(parent.IndexToLocation(NameHeader), GetEnd(parent)));
 }
예제 #8
0
파일: Node.cs 프로젝트: RussBaz/PTVS
 public SourceLocation GetStart(PythonAst parent) {
     return parent.IndexToLocation(StartIndex);            
 }
예제 #9
0
        private static int GetParentScopeIndent(InterpreterScope scope, PythonAst tree)
        {
            if (scope is ClassScope) {
                // Return column of "class" statement
                return tree.IndexToLocation(scope.GetStart(tree)).Column;
            }

            var function = scope as FunctionScope;
            if (function != null && !((FunctionDefinition)function.Node).IsLambda) {
                // Return column of "def" statement
                return tree.IndexToLocation(scope.GetStart(tree)).Column;
            }

            var isinstance = scope as IsInstanceScope;
            if (isinstance != null && isinstance._effectiveSuite != null) {
                int col = tree.IndexToLocation(isinstance._startIndex).Column;
                if (isinstance._effectiveSuite.StartIndex < isinstance._startIndex) {
                    // "assert isinstance", so scope is before the test
                    return col - 1;
                } else {
                    // "if isinstance", so scope is at the test
                    return col;
                }
            }

            return -1;
        }
 public SourceLocation GetHeader(PythonAst ast)
 {
     return(ast.IndexToLocation(_headerIndex));
 }
예제 #11
0
파일: ClassScope.cs 프로젝트: omnimark/PTVS
 public override int GetBodyStart(PythonAst ast) {
     return ast.IndexToLocation(((ClassDefinition)Node).HeaderIndex).Index;
 }
예제 #12
0
 /// <summary>
 /// Returns the span of the name component of the expression
 /// </summary>
 public SourceSpan GetNameSpan(PythonAst parent) {
     return new SourceSpan(parent.IndexToLocation(_nameHeader), GetEnd(parent));
 }