void space() { formatter.space(); lastWritten = LastWritten.Whitespace; }
void space() { formatter.space(); lastWritten = LastWritten.Whitespace; }
void space() { formatter.space(); lastWritten = LastWritten.Whitespace; }
void writeKeyword(final String token, final Role tokenRole) { if (tokenRole != null) { writeSpecialsUpToRole(tokenRole); } if (lastWritten == LastWritten.KeywordOrIdentifier) { formatter.space(); } formatter.writeKeyword(token); lastWritten = LastWritten.KeywordOrIdentifier; }
void writeKeyword(final String token, final Role tokenRole) { if (tokenRole != null) { writeSpecialsUpToRole(tokenRole); } if (lastWritten == LastWritten.KeywordOrIdentifier) { formatter.space(); } formatter.writeKeyword(token); lastWritten = LastWritten.KeywordOrIdentifier; }
void writeKeyword(final String token, final Role tokenRole) { if (tokenRole != null) { writeSpecialsUpToRole(tokenRole); } if (lastWritten == LastWritten.KeywordOrIdentifier) { formatter.space(); } formatter.writeKeyword(token); lastWritten = LastWritten.KeywordOrIdentifier; }
void writeIdentifier(final String identifier, final Role<Identifier> identifierRole) { writeSpecialsUpToRole(identifierRole != null ? identifierRole : Roles.IDENTIFIER); if (isKeyword(identifier, containerStack.peek())) { if (lastWritten == LastWritten.KeywordOrIdentifier) { space(); } // this space is not strictly required, so we call space() // formatter.writeToken("$"); } else if (lastWritten == LastWritten.KeywordOrIdentifier) { formatter.space(); // this space is strictly required, so we directly call the formatter } if (identifierRole == Roles.LABEL) { formatter.writeLabel(identifier); } else { formatter.writeIdentifier(identifier); } lastWritten = LastWritten.KeywordOrIdentifier; }
void writeIdentifier(final String identifier, final Role<Identifier> identifierRole) { writeSpecialsUpToRole(identifierRole != null ? identifierRole : Roles.IDENTIFIER); if (isKeyword(identifier, containerStack.peek())) { if (lastWritten == LastWritten.KeywordOrIdentifier) { space(); } // this space is not strictly required, so we call space() // formatter.writeToken("$"); } else if (lastWritten == LastWritten.KeywordOrIdentifier) { formatter.space(); // this space is strictly required, so we directly call the formatter } if (identifierRole == Roles.LABEL) { formatter.writeLabel(identifier); } else { formatter.writeIdentifier(identifier); } lastWritten = LastWritten.KeywordOrIdentifier; }
void writeIdentifier(final String identifier, final Role<Identifier> identifierRole) { writeSpecialsUpToRole(identifierRole != null ? identifierRole : Roles.IDENTIFIER); if (isKeyword(identifier, containerStack.peek())) { if (lastWritten == LastWritten.KeywordOrIdentifier) { space(); } // this space is not strictly required, so we call space() // formatter.writeToken("$"); } else if (lastWritten == LastWritten.KeywordOrIdentifier) { formatter.space(); // this space is strictly required, so we directly call the formatter } if (identifierRole == Roles.LABEL) { formatter.writeLabel(identifier); } else { formatter.writeIdentifier(identifier); } lastWritten = LastWritten.KeywordOrIdentifier; }
@Override public Void visitComment(final Comment comment, final Void ignored) { if (lastWritten == LastWritten.Division) { formatter.space(); } formatter.startNode(comment); formatter.writeComment(comment.getCommentType(), comment.getContent()); formatter.endNode(comment); lastWritten = LastWritten.Whitespace; return null; }
@Override public Void visitComment(final Comment comment, final Void ignored) { if (lastWritten == LastWritten.Division) { formatter.space(); } formatter.startNode(comment); formatter.writeComment(comment.getCommentType(), comment.getContent()); formatter.endNode(comment); lastWritten = LastWritten.Whitespace; return null; }
@Override public Void visitComment(final Comment comment, final Void ignored) { if (lastWritten == LastWritten.Division) { formatter.space(); } formatter.startNode(comment); formatter.writeComment(comment.getCommentType(), comment.getContent()); formatter.endNode(comment); lastWritten = LastWritten.Whitespace; return null; }
lastWritten == LastWritten.Division && token.charAt(0) == '*') { formatter.space();
lastWritten == LastWritten.Division && token.charAt(0) == '*') { formatter.space();
lastWritten == LastWritten.Division && token.charAt(0) == '*') { formatter.space();
private void writeQualifiedIdentifier(final Iterable<Identifier> identifiers) { boolean first = true; for (final Identifier identifier : identifiers) { if (first) { first = false; if (lastWritten == LastWritten.KeywordOrIdentifier) { formatter.space(); } } else { writeSpecialsUpToRole(Roles.DOT, identifier); formatter.writeToken("."); lastWritten = LastWritten.Other; } writeSpecialsUpToNode(identifier); formatter.writeIdentifier(identifier.getName()); lastWritten = LastWritten.KeywordOrIdentifier; } }
private void writeQualifiedIdentifier(final Iterable<Identifier> identifiers) { boolean first = true; for (final Identifier identifier : identifiers) { if (first) { first = false; if (lastWritten == LastWritten.KeywordOrIdentifier) { formatter.space(); } } else { writeSpecialsUpToRole(Roles.DOT, identifier); formatter.writeToken("."); lastWritten = LastWritten.Other; } writeSpecialsUpToNode(identifier); formatter.writeIdentifier(identifier.getName()); lastWritten = LastWritten.KeywordOrIdentifier; } }
private void writeQualifiedIdentifier(final Iterable<Identifier> identifiers) { boolean first = true; for (final Identifier identifier : identifiers) { if (first) { first = false; if (lastWritten == LastWritten.KeywordOrIdentifier) { formatter.space(); } } else { writeSpecialsUpToRole(Roles.DOT, identifier); formatter.writeToken("."); lastWritten = LastWritten.Other; } writeSpecialsUpToNode(identifier); formatter.writeIdentifier(identifier.getName()); lastWritten = LastWritten.KeywordOrIdentifier; } }