예제 #1
0
  private void end(StringBuilder ans, Pretty pretty, String indent) {
    if (endEncloser == null) return;
    if (!pretty.pretty) ans.append(endEncloser);
    else {
      Utilities.assureEndsWithNewLine(ans);
      ans.append(indent + endEncloser);
      if (pretty.comments && endComment.length() > 0) ans.append("#" + endComment);

      Utilities.assureEndsWithNewLine(ans);
    }
  }
예제 #2
0
 void doKids(StringBuilder ans, Pretty pretty, String indent) {
   if (kids == null) return;
   for (Rope kid : kids) {
     if (!pretty.pretty) {
       kid.toString(ans, pretty, "");
     } else {
       kid.toString(ans, pretty, indent + getKidIndentIncrement(kid, pretty));
       Utilities.assureEndsWithNewLine(ans);
     }
   }
 }
예제 #3
0
 private void start(StringBuilder ans, Pretty pretty, String indent) {
   if (startEncloser == null) return;
   if (!pretty.pretty) {
     ans.append(startEncloser);
   } else {
     String comment;
     if (pretty.comments && startComment.length() > 0) comment = " #" + startComment;
     else comment = "";
     ans.append(indent + startEncloser + comment);
     Utilities.assureEndsWithNewLine(ans);
   }
 }