/// <summary> /// Returns a new SuiteStatement which is composed of a subset of the statements in this suite statement. /// </summary> /// <param name="start"></param> /// <param name="end"></param> /// <returns></returns> public SuiteStatement CloneSubset(PythonAst ast, int start, int end) { var statements = new Statement[end - start + 1]; for (var i = start; i <= end; i++) { statements[i - start] = Statements[i]; } var res = new SuiteStatement(statements); // propagate white space so we stay mostly the same... var itemWhiteSpace = this.GetListWhiteSpace(ast); var colonWhiteSpace = this.GetPreceedingWhiteSpaceDefaultNull(ast); if (itemWhiteSpace != null) { // semi-colon list of statements, must end in a new line, but the original new line // could be multiple lines. ast.SetAttribute(res, NodeAttributes.ListWhiteSpace, new string[0]); } else { ast.SetAttribute(res, NodeAttributes.IsAltFormValue, NodeAttributes.IsAltFormValue); } return(res); }
public virtual void PostWalk(SuiteStatement node) { }
// SuiteStatement public virtual bool Walk(SuiteStatement node) { return(true); }
// SuiteStatement public override bool Walk(SuiteStatement node) { return(Contains(node)); }
public override void PostWalk(SuiteStatement node) { }
// SuiteStatement public override bool Walk(SuiteStatement node) { return(false); }