for (int i = 0; i < fragments.size(); i++) { Token token = fragments.get(i); if (token.hasNLSTag()) { if (ScannerHelper.isWhitespace(this.tm.charAt(token.originalStart - 1))) token.spaceBefore();
if (fragment.hasNLSTag()) { int tagNumber = this.stringLiteralsInLine.indexOf(fragment.getNLSTag()); assert tagNumber >= 0;
if (fragment.hasNLSTag()) { int tagNumber = this.stringLiteralsInLine.indexOf(fragment.getNLSTag()); assert tagNumber >= 0;
if (fragment.hasNLSTag()) { int tagNumber = this.stringLiteralsInLine.indexOf(fragment.getNLSTag()); assert tagNumber >= 0;
translated.setWrapPolicy(WrapPolicy.DISABLE_WRAP); if (token.hasNLSTag()) { if (translationMap == null) translationMap = new HashMap<>();
translated.setWrapPolicy(WrapPolicy.DISABLE_WRAP); if (token.hasNLSTag()) { if (translationMap == null) translationMap = new HashMap<>();
if (translated.getWrapPolicy() == null) translated.setWrapPolicy(WrapPolicy.DISABLE_WRAP); if (token.hasNLSTag()) translationMap.put(token, translated);
for (int i = 0; i < fragments.size(); i++) { Token token = fragments.get(i); if (token.hasNLSTag()) { if (ScannerHelper.isWhitespace(this.tm.charAt(token.originalStart - 1))) token.spaceBefore();
for (int i = 0; i < fragments.size(); i++) { Token token = fragments.get(i); if (token.hasNLSTag()) { if (ScannerHelper.isWhitespace(this.tm.charAt(token.originalStart - 1))) token.spaceBefore();
@Override protected boolean token(Token traversed, int index) { if (index == this.value) { this.isNLSTagInLine = false; return false; } if (traversed.hasNLSTag()) { assert traversed.tokenType == TokenNameStringLiteral; this.isNLSTagInLine = true; } if (traversed.getAlign() > 0) this.counter = traversed.getAlign(); List<Token> internalStructure = traversed.getInternalStructure(); if (internalStructure != null && !internalStructure.isEmpty()) { assert traversed.tokenType == TokenNameCOMMENT_BLOCK || traversed.tokenType == TokenNameCOMMENT_JAVADOC; this.counter = TokenManager.this.commentWrapper.wrapMultiLineComment(traversed, this.counter, true, this.isNLSTagInLine); } else { this.counter += getLength(traversed, this.counter); } if (isSpaceAfter()) this.counter++; return true; } };
@Override protected boolean token(Token traversed, int index) { if (index == this.value) { this.isNLSTagInLine = false; return false; } if (traversed.hasNLSTag()) { assert traversed.tokenType == TokenNameStringLiteral; this.isNLSTagInLine = true; } if (traversed.getAlign() > 0) this.counter = traversed.getAlign(); List<Token> internalStructure = traversed.getInternalStructure(); if (internalStructure != null && !internalStructure.isEmpty()) { assert traversed.tokenType == TokenNameCOMMENT_BLOCK || traversed.tokenType == TokenNameCOMMENT_JAVADOC; this.counter = TokenManager.this.commentWrapper.wrapMultiLineComment(traversed, this.counter, true, this.isNLSTagInLine); } else { this.counter += getLength(traversed, this.counter); } if (isSpaceAfter()) this.counter++; return true; } };
@Override protected boolean token(Token traversed, int index) { if (index == this.value) { this.isNLSTagInLine = false; return false; } if (traversed.hasNLSTag()) { assert traversed.tokenType == TokenNameStringLiteral; this.isNLSTagInLine = true; } if (traversed.getAlign() > 0) this.counter = traversed.getAlign(); List<Token> internalStructure = traversed.getInternalStructure(); if (internalStructure != null && !internalStructure.isEmpty()) { assert traversed.tokenType == TokenNameCOMMENT_BLOCK || traversed.tokenType == TokenNameCOMMENT_JAVADOC; this.counter = TokenManager.this.commentWrapper.wrapMultiLineComment(traversed, this.counter, true, this.isNLSTagInLine); } else { this.counter += getLength(traversed, this.counter); } if (isSpaceAfter()) this.counter++; return true; } };
private void wrapComments() { CommentWrapExecutor commentWrapper = new CommentWrapExecutor(this.tm, this.options); boolean isNLSTagInLine = false; for (int i = 0; i < this.tm.size(); i++) { Token token = this.tm.get(i); if (token.getLineBreaksBefore() > 0 || token.getLineBreaksAfter() > 0) isNLSTagInLine = false; if (token.hasNLSTag()) { assert token.tokenType == TokenNameStringLiteral; isNLSTagInLine = true; } List<Token> structure = token.getInternalStructure(); if (structure != null && !structure.isEmpty() && !isNLSTagInLine) { int startPosition = this.tm.getPositionInLine(i); if (token.tokenType == TokenNameCOMMENT_LINE) { commentWrapper.wrapLineComment(token, startPosition); } else { assert token.tokenType == TokenNameCOMMENT_BLOCK || token.tokenType == TokenNameCOMMENT_JAVADOC; commentWrapper.wrapMultiLineComment(token, startPosition, false, false); } } } }
private void wrapComments() { CommentWrapExecutor commentWrapper = new CommentWrapExecutor(this.tm, this.options); boolean isNLSTagInLine = false; for (int i = 0; i < this.tm.size(); i++) { Token token = this.tm.get(i); if (token.getLineBreaksBefore() > 0 || token.getLineBreaksAfter() > 0) isNLSTagInLine = false; if (token.hasNLSTag()) { assert token.tokenType == TokenNameStringLiteral; isNLSTagInLine = true; } List<Token> structure = token.getInternalStructure(); if (structure != null && !structure.isEmpty() && !isNLSTagInLine) { int startPosition = this.tm.getPositionInLine(i); if (token.tokenType == TokenNameCOMMENT_LINE) { commentWrapper.wrapLineComment(token, startPosition); } else { assert token.tokenType == TokenNameCOMMENT_BLOCK || token.tokenType == TokenNameCOMMENT_JAVADOC; commentWrapper.wrapMultiLineComment(token, startPosition, false, false); } } } }
private void wrapComments() { CommentWrapExecutor commentWrapper = new CommentWrapExecutor(this.tm, this.options); boolean isNLSTagInLine = false; for (int i = 0; i < this.tm.size(); i++) { Token token = this.tm.get(i); if (token.getLineBreaksBefore() > 0 || token.getLineBreaksAfter() > 0) isNLSTagInLine = false; if (token.hasNLSTag()) { assert token.tokenType == TokenNameStringLiteral; isNLSTagInLine = true; } List<Token> structure = token.getInternalStructure(); if (structure != null && !structure.isEmpty() && !isNLSTagInLine) { int startPosition = this.tm.getPositionInLine(i); if (token.tokenType == TokenNameCOMMENT_LINE) { commentWrapper.wrapLineComment(token, startPosition); } else { assert token.tokenType == TokenNameCOMMENT_BLOCK || token.tokenType == TokenNameCOMMENT_JAVADOC; commentWrapper.wrapMultiLineComment(token, startPosition, false, false); } } } }
return false; if (token.hasNLSTag()) this.isNLSTagInLine = true;
@Override protected boolean token(Token token, int index) { if (token.hasNLSTag()) this.isNLSTagInLine = true;
@Override protected boolean token(Token token, int index) { if (token.hasNLSTag()) this.isNLSTagInLine = true;