From d4fb8b48ceeae3b2ce92f03ed7c64d5af6379901 Mon Sep 17 00:00:00 2001 From: "Maxim.Mossienko" Date: Mon, 6 Jun 2016 21:39:01 +0200 Subject: [PATCH] more accurately removed unnecessary code --- .../src/com/intellij/lexer/XmlHighlightingLexer.java | 2 +- xml/xml-psi-impl/src/com/intellij/lexer/_XmlLexer.flex | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/xml/xml-psi-impl/src/com/intellij/lexer/XmlHighlightingLexer.java b/xml/xml-psi-impl/src/com/intellij/lexer/XmlHighlightingLexer.java index 8fd3e8418e2c..beacf34050aa 100644 --- a/xml/xml-psi-impl/src/com/intellij/lexer/XmlHighlightingLexer.java +++ b/xml/xml-psi-impl/src/com/intellij/lexer/XmlHighlightingLexer.java @@ -38,7 +38,7 @@ public class XmlHighlightingLexer extends DelegateLexer { } private IElementType fixWrongTokenTypes(IElementType tokenType) { - int state = getState(); + int state = getState() & 0x1f; // __XmlLexer.C_COMMENT_END is last state with value 30 if (tokenType == XmlTokenType.XML_NAME) { if (state == __XmlLexer.TAG || state == __XmlLexer.END_TAG) { // translate XML names for tags into XmlTagName diff --git a/xml/xml-psi-impl/src/com/intellij/lexer/_XmlLexer.flex b/xml/xml-psi-impl/src/com/intellij/lexer/_XmlLexer.flex index cd72a3a4423e..5c6c87f53723 100644 --- a/xml/xml-psi-impl/src/com/intellij/lexer/_XmlLexer.flex +++ b/xml/xml-psi-impl/src/com/intellij/lexer/_XmlLexer.flex @@ -64,6 +64,7 @@ import com.intellij.psi.xml.*; %state DOCTYPE %xstate CDATA %state C_COMMENT_START +/* this state should be last, number of states should be less than 16 */ %state C_COMMENT_END ALPHA=[:letter:]