public NormalExpressionWalker(PythonAst ast, int location, int endLocation, FindExpressionOptions options) : base(location)
 {
     Tree = ast;
     ExtendedStatements = true;
     _endLocation       = endLocation;
     _options           = options;
 }
        public ExpressionFinder(string expression, PythonLanguageVersion version, FindExpressionOptions options)
        {
            var parser = Parser.CreateParser(new StringReader(expression), version, ParserOptions.Default);

            Ast = parser.ParseTopExpression(null);
            Ast.Body.SetLoc(0, expression.Length);
            Options = options;
        }
 public ExpressionFinder(PythonAst ast, FindExpressionOptions options)
 {
     Ast     = ast;
     Options = options;
 }
Exemple #4
0
        public static Node GetNode(PythonAst ast, SourceLocation location, FindExpressionOptions options)
        {
            var finder = new ExpressionFinder(ast, options);

            return(finder.GetExpression(location));
        }