public override string GetLeadingWhiteSpace(PythonAst ast)
 {
     if (_sliceStart != null)
     {
         return(_sliceStart.GetLeadingWhiteSpace(ast));
     }
     return(this.GetProceedingWhiteSpace(ast));
 }
Exemple #2
0
        internal override void AppendCodeStringStmt(StringBuilder res, PythonAst ast, CodeFormattingOptions format)
        {
            format.ReflowComment(res, this.GetProceedingWhiteSpace(ast));
            res.Append("return");
            if (_expression != null)
            {
                int len = res.Length;

                _expression.AppendCodeString(res, ast, format);
                if (this.IsAltForm(ast))
                {
                    // remove the leading white space and insert a single space
                    res.Remove(len, _expression.GetLeadingWhiteSpace(ast).Length);
                    res.Insert(len, ' ');
                }
            }
        }
Exemple #3
0
 public override string GetLeadingWhiteSpace(PythonAst ast)
 {
     return(_target.GetLeadingWhiteSpace(ast));
 }
 public override string GetLeadingWhiteSpace(PythonAst ast)
 {
     return(_expression.GetLeadingWhiteSpace(ast));
 }