void (int indent, boolean insideSequence) { // Preserve most test and current behaviour for most general cases without comments if (getTokenType() == EOL) { advanceLexer(); if (getTokenType() == INDENT) { advanceLexer(); } } final PsiBuilder.Marker marker = mark(); passJunk(); PsiBuilder.Marker endOfNodeMarker = null; IElementType nodeType = null; // It looks like tag for a block node should be located on a separate line if (getTokenType() == YAMLTokenTypes.TAG && myBuilder.lookAhead(1) == YAMLTokenTypes.EOL) { advanceLexer(); } int numberOfItems = 0; while (!eof() && (isJunk() || !eolSeen || myIndent + getIndentBonus(insideSequence) >= indent)) { if (isJunk()) { advanceLexer(); continue; } if (!myStopTokensStack.isEmpty() && myStopTokensStack.peek().contains(getTokenType())) { rollBackToEol(); break; } numberOfItems++; final IElementType parsedTokenType = parseSingleStatement(eolSeen ? myIndent : indent, indent); if (nodeType == null) { if (parsedTokenType == YAMLElementTypes.SEQUENCE_ITEM) { nodeType = YAMLElementTypes.SEQUENCE; } else if (parsedTokenType == YAMLElementTypes.KEY_VALUE_PAIR) { nodeType = YAMLElementTypes.MAPPING; } else if (numberOfItems > 1) { nodeType = YAMLElementTypes.COMPOUND_VALUE; } } if (endOfNodeMarker != null) { endOfNodeMarker.drop(); } endOfNodeMarker = mark(); } if (endOfNodeMarker != null) { dropEolMarker(); endOfNodeMarker.rollbackTo(); } else { rollBackToEol(); } includeBlockEmptyTail(indent); if (nodeType != null) { marker.done(nodeType); marker.setCustomEdgeTokenBinders( (tokens, atStreamEdge, getter) -> findLeftRange(tokens), (tokens, atStreamEdge, getter) -> tokens.size()); } else { marker.drop(); } }