diff --git a/platform/lang-impl/src/com/intellij/indentation/IndentationParser.java b/platform/lang-impl/src/com/intellij/indentation/IndentationParser.java index 76b41402461d..7edfc9f94405 100644 --- a/platform/lang-impl/src/com/intellij/indentation/IndentationParser.java +++ b/platform/lang-impl/src/com/intellij/indentation/IndentationParser.java @@ -79,7 +79,7 @@ public abstract class IndentationParser implements PsiParser { currentIndent = 0; } } - builder.advanceLexer(); + advanceLexer(builder); } // Close all left opened markers @@ -90,10 +90,20 @@ public abstract class IndentationParser implements PsiParser { stack.pop().second.done(myBlockElementType); } + return buildTree(fileMarker, builder, root); + } + + protected ASTNode buildTree(final PsiBuilder.Marker fileMarker, + final PsiBuilder builder, + final IElementType root) { fileMarker.done(root); return builder.getTreeBuilt(); } + protected void advanceLexer(PsiBuilder builder) { + builder.advanceLexer(); + } + private void passEOLsAndIndents(final PsiBuilder builder) { IElementType tokenType = builder.getTokenType(); while (tokenType == myEolTokenType || tokenType == myIndentTokenType){