diff --git a/RegExpSupport/gen/org/intellij/lang/regexp/_RegExLexer.java b/RegExpSupport/gen/org/intellij/lang/regexp/_RegExLexer.java index b751ab59ba48..c8d3b4c482cf 100644 --- a/RegExpSupport/gen/org/intellij/lang/regexp/_RegExLexer.java +++ b/RegExpSupport/gen/org/intellij/lang/regexp/_RegExLexer.java @@ -1,20 +1,21 @@ -/* The following code was generated by JFlex 1.4.3 on 10/24/14 12:41 PM */ +/* The following code was generated by JFlex 1.4.3 on 10/24/14 2:25 PM */ /* It's an automatically generated code. Do not modify it. */ package org.intellij.lang.regexp; import com.intellij.lexer.FlexLexer; -import com.intellij.psi.tree.IElementType; -import java.util.LinkedList; -import java.util.EnumSet; import com.intellij.psi.StringEscapesTokenTypes; +import com.intellij.psi.tree.IElementType; + +import java.util.ArrayList; +import java.util.EnumSet; @SuppressWarnings("ALL") /** * This class is a scanner generated by * JFlex 1.4.3 - * on 10/24/14 12:41 PM from the specification file + * on 10/24/14 2:25 PM from the specification file * /Users/bas/Projects/IntelliJ IDEA Ultimate/tools/lexer/../../community/RegExpSupport/src/org/intellij/lang/regexp/regexp-lexer.flex */ class _RegExLexer implements FlexLexer { @@ -404,7 +405,7 @@ class _RegExLexer implements FlexLexer { /* user code: */ // This adds support for nested states. I'm no JFlex pro, so maybe this is overkill, but it works quite well. - private final LinkedList states = new LinkedList(); + private final ArrayList states = new ArrayList(); // This was an idea to use the regex implementation for XML schema regexes (which use a slightly different syntax) // as well, but is currently unfinished as it requires to tweak more places than just the lexer. @@ -433,11 +434,11 @@ class _RegExLexer implements FlexLexer { } private void yypushstate(int state) { - states.addFirst(yystate()); + states.add(yystate()); yybegin(state); } private void yypopstate() { - final int state = states.removeFirst(); + final int state = states.remove(states.size() - 1); yybegin(state); } diff --git a/RegExpSupport/src/org/intellij/lang/regexp/regexp-lexer.flex b/RegExpSupport/src/org/intellij/lang/regexp/regexp-lexer.flex index a40cd5a6291d..e6547a56a939 100644 --- a/RegExpSupport/src/org/intellij/lang/regexp/regexp-lexer.flex +++ b/RegExpSupport/src/org/intellij/lang/regexp/regexp-lexer.flex @@ -2,10 +2,11 @@ package org.intellij.lang.regexp; import com.intellij.lexer.FlexLexer; -import com.intellij.psi.tree.IElementType; -import java.util.LinkedList; -import java.util.EnumSet; import com.intellij.psi.StringEscapesTokenTypes; +import com.intellij.psi.tree.IElementType; + +import java.util.ArrayList; +import java.util.EnumSet; @SuppressWarnings("ALL") %% @@ -20,7 +21,7 @@ import com.intellij.psi.StringEscapesTokenTypes; %{ // This adds support for nested states. I'm no JFlex pro, so maybe this is overkill, but it works quite well. - private final LinkedList states = new LinkedList(); + private final ArrayList states = new ArrayList(); // This was an idea to use the regex implementation for XML schema regexes (which use a slightly different syntax) // as well, but is currently unfinished as it requires to tweak more places than just the lexer. @@ -49,11 +50,12 @@ import com.intellij.psi.StringEscapesTokenTypes; } private void yypushstate(int state) { - states.addFirst(yystate()); + states.add(yystate()); yybegin(state); } + private void yypopstate() { - final int state = states.removeFirst(); + final int state = states.remove(states.size() - 1); yybegin(state); }