private static bool CanBackUp(PythonAst tree, Node node, Node statement, ScopeStatement scope, int column) { if (node != null || (statement != null && !((statement as ExpressionStatement)?.Expression is ErrorExpression))) { return(false); } int top = 1; if (scope != null) { var scopeStart = scope.GetStart(tree); if (scope.Body != null) { top = (scope.Body.GetEnd(tree).Line == scopeStart.Line) ? scope.Body.GetStart(tree).Column : scopeStart.Column; } else { top = scopeStart.Column; } } if (column <= top) { return(false); } return(true); }
private static bool CanBackUp(PythonAst ast, Node node, Node statement, ScopeStatement scope, int column) { if (node != null || !((statement as ExpressionStatement)?.Expression is ErrorExpression)) { return(false); } var top = 1; if (scope != null) { var scopeStart = scope.GetStart(ast); if (scope.Body != null) { top = scope.Body.GetEnd(ast).Line == scopeStart.Line ? scope.Body.GetStart(ast).Column : scopeStart.Column; } else { top = scopeStart.Column; } } return(column > top); }