|| lineMap.getLineNumber(commentStart) <= lineMap.getLineNumber(argumentTracker.currentArgumentEndPosition)) { argumentTracker.addCommentToCurrentArgument(c, Position.ANY);
/** * Enters the given tree (se {@link #scan(JCTree)}. */ protected void enter(JCTree tree) { super.enter(tree); positionStack.push(new Position(getCurrentPosition(), currentLine, currentColumn)); if (compilationUnit != null && tree.pos >= 0 && inSourceMap(tree)) { sourceMap.addEntry(new Position(tree.pos, // compilationUnit.lineMap.getLineNumber(tree.pos), // compilationUnit.lineMap.getColumnNumber(tree.pos)), positionStack.peek()); } }
/** * Exits the currently scanned tree. */ @Override protected void exit() { JCTree tree = stack.peek(); if (compilationUnit != null && tree instanceof JCBlock) { int endPos = tree.getEndPosition(diagnosticSource.getEndPosTable()); sourceMap.addEntry( new Position(endPos, // compilationUnit.lineMap.getLineNumber(endPos), // compilationUnit.lineMap.getColumnNumber(endPos)), new Position(getCurrentPosition(), currentLine, currentColumn)); } super.exit(); positionStack.pop(); }
/** Source file positions in CRT are integers in the format: * {@literal line-number << LINESHIFT + column-number } */ private int encodePosition(int pos, Position.LineMap lineMap, Log log) { int line = lineMap.getLineNumber(pos); int col = lineMap.getColumnNumber(pos); int new_pos = Position.encodePosition(line, col); if (crtDebug) { System.out.println(", line = " + line + ", column = " + col + ", new_pos = " + new_pos); } if (new_pos == Position.NOPOS) log.warning(pos, "position.overflow", line); return new_pos; }
public int getLine() { return (lineMap != null) ? lineMap.getLineNumber(pos) : -1; }
public int getLine() { return (lineMap != null) ? lineMap.getLineNumber(pos) : -1; }
public int getLine() { return (lineMap != null) ? lineMap.getLineNumber(pos) : -1; }
boolean isCommentOnPreviousLine(Comment c) { int tokenLine = lineMap.getLineNumber(c.getSourcePos(0)); return tokenLine == currentLineNumber - 1; }
/** Force stat begin eagerly */ public void markStatBegin() { if (alive && lineDebugInfo) { int line = lineMap.getLineNumber(pendingStatPos); char cp1 = (char)cp; char line1 = (char)line; if (cp1 == cp && line1 == line) addLineNumber(cp1, line1); } pendingStatPos = Position.NOPOS; }
/** Source file positions in CRT are integers in the format: * line-number << LINESHIFT + column-number */ private int encodePosition(int pos, Position.LineMap lineMap, Log log) { int line = lineMap.getLineNumber(pos); int col = lineMap.getColumnNumber(pos); int new_pos = Position.encodePosition(line, col); if (crtDebug) { System.out.println(", line = " + line + ", column = " + col + ", new_pos = " + new_pos); } if (new_pos == Position.NOPOS) log.warning(pos, "position.overflow", line); return new_pos; }
/** Force stat begin eagerly */ public void markStatBegin() { if (alive && lineDebugInfo) { int line = lineMap.getLineNumber(pendingStatPos); char cp1 = (char)cp; char line1 = (char)line; if (cp1 == cp && line1 == line) addLineNumber(cp1, line1); } pendingStatPos = Position.NOPOS; }
/** Force stat begin eagerly */ public void markStatBegin() { if (alive && lineDebugInfo) { int line = lineMap.getLineNumber(pendingStatPos); char cp1 = (char)cp; char line1 = (char)line; if (cp1 == cp && line1 == line) addLineNumber(cp1, line1); } pendingStatPos = Position.NOPOS; }
public int getLine() { return (lineMap != null) ? lineMap.getLineNumber(pos) : -1; }
/** Force stat begin eagerly */ public void markStatBegin() { if (alive && lineDebugInfo) { int line = lineMap.getLineNumber(pendingStatPos); char cp1 = (char)cp; char line1 = (char)line; if (cp1 == cp && line1 == line) addLineNumber(cp1, line1); } pendingStatPos = Position.NOPOS; }
boolean isPreviousArgumentOnPreviousLine() { return lineMap.getLineNumber(previousArgumentEndPosition) == lineMap.getLineNumber(currentArgumentStartPosition) - 1; }
/** The line in the source file. The first line is numbered 1; * 0 means no line number information is available. */ public int line() { if (lineMap == null) { return 0; } else { return lineMap.getLineNumber(position); } }
void advance(ErrorProneToken token) { int line = lineMap.getLineNumber(token.pos()); if (line != currentLineNumber) { currentLineNumber = line; previousLineEmpty = tokensOnCurrentLine == 0; tokensOnCurrentLine = 0; } else { tokensOnCurrentLine++; } }
boolean isCommentOnPreviousLine(Comment c) { int tokenLine = lineMap.getLineNumber(c.getSourcePos(0)); return tokenLine == currentLineNumber - 1; }
boolean isPreviousArgumentOnPreviousLine() { return lineMap.getLineNumber(previousArgumentEndPosition) == lineMap.getLineNumber(currentArgumentStartPosition) - 1; }
void advance(ErrorProneToken token) { int line = lineMap.getLineNumber(token.pos()); if (line != currentLineNumber) { currentLineNumber = line; previousLineEmpty = tokensOnCurrentLine == 0; tokensOnCurrentLine = 0; } else { tokensOnCurrentLine++; } }