lineComment.setAlign(WrapExecutor.this.tm.getNLSAlign(index)); lineComment.setInternalStructure(new ArrayList<Token>()); WrapExecutor.this.tm.insert(index + 1, lineComment); structureChanged(); return true; // will fill the line comment structure in next step
lineComment.setAlign(WrapExecutor.this.tm.getNLSAlign(index)); lineComment.setInternalStructure(new ArrayList<Token>()); WrapExecutor.this.tm.insert(index + 1, lineComment); structureChanged(); return true; // will fill the line comment structure in next step
lineComment.setAlign(WrapExecutor.this.tm.getNLSAlign(index)); lineComment.setInternalStructure(new ArrayList<Token>()); WrapExecutor.this.tm.insert(index + 1, lineComment); structureChanged(); return true; // will fill the line comment structure in next step
private void handleTokenAfter(ASTNode node, int tokenType, boolean spaceBefore, boolean spaceAfter) { if (spaceBefore || spaceAfter) { if (tokenType == TokenNameGREATER) { // there could be ">>" or ">>>" instead, get rid of them int index = this.tm.lastIndexIn(node, -1); for (int i = index; i < index + 2; i++) { Token token = this.tm.get(i); if (token.tokenType == TokenNameRIGHT_SHIFT || token.tokenType == TokenNameUNSIGNED_RIGHT_SHIFT) { this.tm.remove(i); for (int j = 0; j < (token.tokenType == TokenNameRIGHT_SHIFT ? 2 : 3); j++) { this.tm.insert(i + j, new Token(token.originalStart + j, token.originalStart + j, TokenNameGREATER)); } } } } Token token = this.tm.firstTokenAfter(node, tokenType); handleToken(token, spaceBefore, spaceAfter); } }
private void handleTokenAfter(ASTNode node, int tokenType, boolean spaceBefore, boolean spaceAfter) { if (tokenType == TokenNameGREATER) { // there could be ">>" or ">>>" instead, get rid of them int index = this.tm.lastIndexIn(node, -1); for (int i = index; i < index + 2; i++) { Token token = this.tm.get(i); if (token.tokenType == TokenNameRIGHT_SHIFT || token.tokenType == TokenNameUNSIGNED_RIGHT_SHIFT) { this.tm.remove(i); for (int j = 0; j < (token.tokenType == TokenNameRIGHT_SHIFT ? 2 : 3); j++) { this.tm.insert(i + j, new Token(token.originalStart + j, token.originalStart + j, TokenNameGREATER)); } } } } if (spaceBefore || spaceAfter) { Token token = this.tm.firstTokenAfter(node, tokenType); handleToken(token, spaceBefore, spaceAfter); } }
private void handleTokenAfter(ASTNode node, int tokenType, boolean spaceBefore, boolean spaceAfter) { if (tokenType == TokenNameGREATER) { // there could be ">>" or ">>>" instead, get rid of them int index = this.tm.lastIndexIn(node, -1); for (int i = index; i < index + 2; i++) { Token token = this.tm.get(i); if (token.tokenType == TokenNameRIGHT_SHIFT || token.tokenType == TokenNameUNSIGNED_RIGHT_SHIFT) { this.tm.remove(i); for (int j = 0; j < (token.tokenType == TokenNameRIGHT_SHIFT ? 2 : 3); j++) { this.tm.insert(i + j, new Token(token.originalStart + j, token.originalStart + j, TokenNameGREATER)); } } } } if (spaceBefore || spaceAfter) { Token token = this.tm.firstTokenAfter(node, tokenType); handleToken(token, spaceBefore, spaceAfter); } }
Token merged = new Token(previous, previous.originalStart, commentToken.originalEnd, previous.tokenType); this.tm.remove(commentIndex - 1); this.tm.insert(commentIndex - 1, merged); this.tm.remove(commentIndex); List<Token> lastStructure = this.lastLineComment.getInternalStructure();
Token merged = new Token(previous, previous.originalStart, commentToken.originalEnd, previous.tokenType); this.tm.remove(commentIndex - 1); this.tm.insert(commentIndex - 1, merged); this.tm.remove(commentIndex); List<Token> lastStructure = this.lastLineComment.getInternalStructure();
Token merged = new Token(previous, previous.originalStart, commentToken.originalEnd, previous.tokenType); this.tm.remove(commentIndex - 1); this.tm.insert(commentIndex - 1, merged); this.tm.remove(commentIndex); List<Token> lastStructure = this.lastLineComment.getInternalStructure();