From aa484e035e94beb0dc1e3a1da42cd1855f79fe8f Mon Sep 17 00:00:00 2001 From: Oleg Sukhodolsky Date: Thu, 12 Jul 2012 17:27:53 +0400 Subject: [PATCH] RUBY-11500: All HAMLTags must ends with xml_end_tag_start and xml_tag_end --- .../com/intellij/indentation/IndentationParser.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/platform/lang-impl/src/com/intellij/indentation/IndentationParser.java b/platform/lang-impl/src/com/intellij/indentation/IndentationParser.java index e5960b789ea6..f406db0d336f 100644 --- a/platform/lang-impl/src/com/intellij/indentation/IndentationParser.java +++ b/platform/lang-impl/src/com/intellij/indentation/IndentationParser.java @@ -72,14 +72,14 @@ public abstract class IndentationParser implements PsiParser { } // Close indentation blocks while (!stack.isEmpty() && currentIndent < stack.peek().first) { - stack.pop().second.done(myBlockElementType); + closeBlock(builder, stack.pop().second); } if (!stack.isEmpty()) { final Pair pair = stack.peek(); if (currentIndent >= pair.first) { if (currentIndent == pair.first) { - stack.pop().second.done(myBlockElementType); + closeBlock(builder, stack.pop().second); } passEOLsAndIndents(builder); stack.push(Pair.create(currentIndent, builder.mark())); @@ -98,7 +98,7 @@ public abstract class IndentationParser implements PsiParser { startLineMarker.drop(); } while (!stack.isEmpty()){ - stack.pop().second.done(myBlockElementType); + closeBlock(builder, stack.pop().second); } documentMarker.done(myDocumentType); @@ -106,6 +106,10 @@ public abstract class IndentationParser implements PsiParser { return builder.getTreeBuilt(); } + protected void closeBlock(@NotNull PsiBuilder builder, @NotNull PsiBuilder.Marker marker) { + marker.done(myBlockElementType); + } + protected void advanceLexer(@NotNull PsiBuilder builder) { builder.advanceLexer(); }