Example #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);
    }
  }
Example #2
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);
   }
 }