void (int whiteSpaceStart, IElementType whitespaceTokenType) { int lastIndent = myIndentStack.topInt(); int indent = getNextLineIndent(); myLastNewLineIndent = indent; // don't generate indent/dedent tokens if a line contains only end-of-line comment and whitespace if (getBaseTokenType() == getCommentTokenType()) { indent = lastIndent; } int whiteSpaceEnd = (getBaseTokenType() == null) ? super.getBufferEnd() : getBaseTokenStart(); if (indent > lastIndent) { myIndentStack.push(indent); myTokenQueue.add(new PendingToken(whitespaceTokenType, whiteSpaceStart, whiteSpaceEnd)); int insertIndex = skipPrecedingCommentsWithIndent(indent, myTokenQueue.size() - 1); int indentOffset = insertIndex == myTokenQueue.size() ? whiteSpaceEnd : myTokenQueue.get(insertIndex).getStart(); myTokenQueue.add(insertIndex, new PendingToken(PyTokenTypes.INDENT, indentOffset, indentOffset)); } else if (indent < lastIndent) { closeDanglingSuitesWithComments(indent, whiteSpaceStart); myTokenQueue.add(new PendingToken(whitespaceTokenType, whiteSpaceStart, whiteSpaceEnd)); } else { myTokenQueue.add(new PendingToken(whitespaceTokenType, whiteSpaceStart, whiteSpaceEnd)); } }