/** * @return true if the comment contains on/off tag and should not be formatted */ private boolean handleFormatOnOffTags(Token commentToken) { if (!this.options.use_tags) return false; String commentString = this.tm.toString(commentToken); int offIndex = this.formatDisableTag != null ? commentString.lastIndexOf(this.formatDisableTag) : -1; int onIndex = this.formatEnableTag != null ? commentString.lastIndexOf(this.formatEnableTag) : -1; if (this.lastFormatOffComment == null) { if (offIndex > onIndex) this.lastFormatOffComment = commentToken; } else { if (onIndex > offIndex) { this.tm.addDisableFormatTokenPair(this.lastFormatOffComment, commentToken); this.lastFormatOffComment = null; } } return offIndex >= 0 || onIndex >= 0; }
/** * @return true if the comment contains on/off tag and should not be formatted */ private boolean handleFormatOnOffTags(Token commentToken) { if (!this.options.use_tags) return false; String commentString = this.tm.toString(commentToken); int offIndex = this.formatDisableTag != null ? commentString.lastIndexOf(this.formatDisableTag) : -1; int onIndex = this.formatEnableTag != null ? commentString.lastIndexOf(this.formatEnableTag) : -1; if (this.lastFormatOffComment == null) { if (offIndex > onIndex) this.lastFormatOffComment = commentToken; } else { if (onIndex > offIndex) { this.tm.addDisableFormatTokenPair(this.lastFormatOffComment, commentToken); this.lastFormatOffComment = null; } } return offIndex >= 0 || onIndex >= 0; }
/** * @return true if the comment contains on/off tag and should not be formatted */ private boolean handleFormatOnOffTags(Token commentToken) { if (!this.options.use_tags) return false; String commentString = this.tm.toString(commentToken); int offIndex = this.formatDisableTag != null ? commentString.lastIndexOf(this.formatDisableTag) : -1; int onIndex = this.formatEnableTag != null ? commentString.lastIndexOf(this.formatEnableTag) : -1; if (this.lastFormatOffComment == null) { if (offIndex > onIndex) this.lastFormatOffComment = commentToken; } else { if (onIndex > offIndex) { this.tm.addDisableFormatTokenPair(this.lastFormatOffComment, commentToken); this.lastFormatOffComment = null; } } return offIndex >= 0 || onIndex >= 0; }
@Override public boolean preVisit2(ASTNode node) { this.currentDepth++; assert this.wrapIndexes.isEmpty() && this.secondaryWrapIndexes.isEmpty() && this.wrapPenalties.isEmpty(); assert this.wrapParentIndex == -1 && this.wrapGroupEnd == -1; boolean isMalformed = (node.getFlags() & ASTNode.MALFORMED) != 0; if (isMalformed) { this.tm.addDisableFormatTokenPair(this.tm.firstTokenIn(node, -1), this.tm.lastTokenIn(node, -1)); } return !isMalformed; }
@Override public boolean preVisit2(ASTNode node) { this.currentDepth++; assert this.wrapIndexes.isEmpty() && this.secondaryWrapIndexes.isEmpty() && this.wrapPenalties.isEmpty(); assert this.wrapParentIndex == -1 && this.wrapGroupEnd == -1; boolean isMalformed = (node.getFlags() & ASTNode.MALFORMED) != 0; if (isMalformed) { this.tm.addDisableFormatTokenPair(this.tm.firstTokenIn(node, -1), this.tm.lastTokenIn(node, -1)); } return !isMalformed; }
@Override public boolean preVisit2(ASTNode node) { this.currentDepth++; assert this.wrapIndexes.isEmpty() && this.secondaryWrapIndexes.isEmpty() && this.wrapPenalties.isEmpty(); assert this.wrapParentIndex == -1 && this.wrapGroupEnd == -1; boolean isMalformed = (node.getFlags() & ASTNode.MALFORMED) != 0; if (isMalformed) { this.tm.addDisableFormatTokenPair(this.tm.firstTokenIn(node, -1), this.tm.lastTokenIn(node, -1)); } return !isMalformed; }
public void finishUp() { if (this.lastFormatOffComment != null) this.tm.addDisableFormatTokenPair(this.lastFormatOffComment, this.tm.get(this.tm.size() - 1)); } }
public void finishUp() { if (this.lastFormatOffComment != null) this.tm.addDisableFormatTokenPair(this.lastFormatOffComment, this.tm.get(this.tm.size() - 1)); } }
public void finishUp() { if (this.lastFormatOffComment != null) this.tm.addDisableFormatTokenPair(this.lastFormatOffComment, this.tm.get(this.tm.size() - 1)); } }