diff --git a/RegExpSupport/gen/org/intellij/lang/regexp/_RegExLexer.java b/RegExpSupport/gen/org/intellij/lang/regexp/_RegExLexer.java
index 392cc60cb96b..72796ffe3c30 100644
--- a/RegExpSupport/gen/org/intellij/lang/regexp/_RegExLexer.java
+++ b/RegExpSupport/gen/org/intellij/lang/regexp/_RegExLexer.java
@@ -1,4 +1,4 @@
-/* The following code was generated by JFlex 1.4.3 on 10/30/14 5:39 PM */
+/* The following code was generated by JFlex 1.4.3 on 11/1/14 12:37 PM */
/* It's an automatically generated code. Do not modify it. */
package org.intellij.lang.regexp;
@@ -15,7 +15,7 @@ import java.util.EnumSet;
/**
* This class is a scanner generated by
* JFlex 1.4.3
- * on 10/30/14 5:39 PM from the specification file
+ * on 11/1/14 12:37 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 {
@@ -28,6 +28,7 @@ class _RegExLexer implements FlexLexer {
public static final int PY_NAMED_GROUP_REF = 22;
public static final int QUOTED = 2;
public static final int OPTIONS = 14;
+ public static final int BRACKET_EXPRESSION = 26;
public static final int PY_COND_REF = 24;
public static final int YYINITIAL = 0;
public static final int NAMED_GROUP = 18;
@@ -45,81 +46,81 @@ class _RegExLexer implements FlexLexer {
*/
private static final int ZZ_LEXSTATE[] = {
0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7,
- 8, 8, 9, 9, 10, 10, 11, 11, 12, 12
+ 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13
};
/**
* Translates characters to character classes
*/
private static final String ZZ_CMAP_PACKED =
- "\10\0\2\61\1\13\1\0\1\61\1\67\22\0\1\53\1\65\1\0"+
- "\1\66\1\15\1\0\1\60\1\51\1\4\1\5\1\17\1\20\1\57"+
- "\1\45\1\3\1\0\1\2\7\44\2\1\1\62\1\0\1\50\1\64"+
- "\1\63\1\16\1\0\1\24\1\24\1\32\1\31\1\41\1\37\1\25"+
- "\1\46\1\34\2\52\1\54\1\54\1\54\1\52\1\36\1\40\1\52"+
- "\1\30\2\52\1\27\1\27\1\27\1\52\1\26\1\10\1\12\1\11"+
- "\1\14\1\55\1\0\1\23\1\24\1\33\1\31\1\23\1\23\1\52"+
- "\1\46\1\34\1\52\1\47\2\52\1\22\1\52\1\35\1\52\1\22"+
- "\1\27\1\22\1\43\1\27\1\27\1\42\1\52\1\25\1\6\1\21"+
- "\1\7\54\0\1\52\12\0\1\52\4\0\1\52\5\0\27\52\1\0"+
- "\37\52\1\0\u013f\52\31\0\162\52\4\0\14\52\16\0\5\52\11\0"+
- "\1\52\213\0\1\52\13\0\1\52\1\0\3\52\1\0\1\52\1\0"+
- "\24\52\1\0\54\52\1\0\46\52\1\0\5\52\4\0\202\52\10\0"+
- "\105\52\1\0\46\52\2\0\2\52\6\0\20\52\41\0\46\52\2\0"+
- "\1\52\7\0\47\52\110\0\33\52\5\0\3\52\56\0\32\52\5\0"+
- "\13\52\25\0\12\56\4\0\2\52\1\0\143\52\1\0\1\52\17\0"+
- "\2\52\7\0\2\52\12\56\3\52\2\0\1\52\20\0\1\52\1\0"+
- "\36\52\35\0\3\52\60\0\46\52\13\0\1\52\u0152\0\66\52\3\0"+
- "\1\52\22\0\1\52\7\0\12\52\4\0\12\56\25\0\10\52\2\0"+
- "\2\52\2\0\26\52\1\0\7\52\1\0\1\52\3\0\4\52\3\0"+
- "\1\52\36\0\2\52\1\0\3\52\4\0\12\56\2\52\23\0\6\52"+
- "\4\0\2\52\2\0\26\52\1\0\7\52\1\0\2\52\1\0\2\52"+
- "\1\0\2\52\37\0\4\52\1\0\1\52\7\0\12\56\2\0\3\52"+
- "\20\0\11\52\1\0\3\52\1\0\26\52\1\0\7\52\1\0\2\52"+
- "\1\0\5\52\3\0\1\52\22\0\1\52\17\0\2\52\4\0\12\56"+
- "\25\0\10\52\2\0\2\52\2\0\26\52\1\0\7\52\1\0\2\52"+
- "\1\0\5\52\3\0\1\52\36\0\2\52\1\0\3\52\4\0\12\56"+
- "\1\0\1\52\21\0\1\52\1\0\6\52\3\0\3\52\1\0\4\52"+
- "\3\0\2\52\1\0\1\52\1\0\2\52\3\0\2\52\3\0\3\52"+
- "\3\0\10\52\1\0\3\52\55\0\11\56\25\0\10\52\1\0\3\52"+
- "\1\0\27\52\1\0\12\52\1\0\5\52\46\0\2\52\4\0\12\56"+
- "\25\0\10\52\1\0\3\52\1\0\27\52\1\0\12\52\1\0\5\52"+
- "\3\0\1\52\40\0\1\52\1\0\2\52\4\0\12\56\25\0\10\52"+
- "\1\0\3\52\1\0\27\52\1\0\20\52\46\0\2\52\4\0\12\56"+
- "\25\0\22\52\3\0\30\52\1\0\11\52\1\0\1\52\2\0\7\52"+
- "\72\0\60\52\1\0\2\52\14\0\7\52\11\0\12\56\47\0\2\52"+
- "\1\0\1\52\2\0\2\52\1\0\1\52\2\0\1\52\6\0\4\52"+
- "\1\0\7\52\1\0\3\52\1\0\1\52\1\0\1\52\2\0\2\52"+
- "\1\0\4\52\1\0\2\52\11\0\1\52\2\0\5\52\1\0\1\52"+
- "\11\0\12\56\2\0\2\52\42\0\1\52\37\0\12\56\26\0\10\52"+
- "\1\0\42\52\35\0\4\52\164\0\42\52\1\0\5\52\1\0\2\52"+
- "\25\0\12\56\6\0\6\52\112\0\46\52\12\0\51\52\7\0\132\52"+
- "\5\0\104\52\5\0\122\52\6\0\7\52\1\0\77\52\1\0\1\52"+
- "\1\0\4\52\2\0\7\52\1\0\1\52\1\0\4\52\2\0\47\52"+
- "\1\0\1\52\1\0\4\52\2\0\37\52\1\0\1\52\1\0\4\52"+
- "\2\0\7\52\1\0\1\52\1\0\4\52\2\0\7\52\1\0\7\52"+
- "\1\0\27\52\1\0\37\52\1\0\1\52\1\0\4\52\2\0\7\52"+
- "\1\0\47\52\1\0\23\52\16\0\11\56\56\0\125\52\14\0\u026c\52"+
- "\2\0\10\52\12\0\32\52\5\0\113\52\25\0\15\52\1\0\4\52"+
- "\16\0\22\52\16\0\22\52\16\0\15\52\1\0\3\52\17\0\64\52"+
- "\43\0\1\52\4\0\1\52\3\0\12\56\46\0\12\56\6\0\130\52"+
- "\10\0\51\52\127\0\35\52\51\0\12\56\36\52\2\0\5\52\u038b\0"+
- "\154\52\224\0\234\52\4\0\132\52\6\0\26\52\2\0\6\52\2\0"+
- "\46\52\2\0\6\52\2\0\10\52\1\0\1\52\1\0\1\52\1\0"+
- "\1\52\1\0\37\52\2\0\65\52\1\0\7\52\1\0\1\52\3\0"+
- "\3\52\1\0\7\52\3\0\4\52\2\0\6\52\4\0\15\52\5\0"+
- "\3\52\1\0\7\52\164\0\1\52\15\0\1\52\202\0\1\52\4\0"+
- "\1\52\2\0\12\52\1\0\1\52\3\0\5\52\6\0\1\52\1\0"+
- "\1\52\1\0\1\52\1\0\4\52\1\0\3\52\1\0\7\52\3\0"+
- "\3\52\5\0\5\52\u0ebb\0\2\52\52\0\5\52\5\0\2\52\4\0"+
- "\126\52\6\0\3\52\1\0\132\52\1\0\4\52\5\0\50\52\4\0"+
- "\136\52\21\0\30\52\70\0\20\52\u0200\0\u19b6\52\112\0\u51a6\52\132\0"+
- "\u048d\52\u0773\0\u2ba4\52\u215c\0\u012e\52\2\0\73\52\225\0\7\52\14\0"+
- "\5\52\5\0\1\52\1\0\12\52\1\0\15\52\1\0\5\52\1\0"+
- "\1\52\1\0\2\52\1\0\2\52\1\0\154\52\41\0\u016b\52\22\0"+
- "\100\52\2\0\66\52\50\0\14\52\164\0\5\52\1\0\207\52\23\0"+
- "\12\56\7\0\32\52\6\0\32\52\13\0\131\52\3\0\6\52\2\0"+
- "\6\52\2\0\6\52\2\0\3\52\43\0";
+ "\10\0\2\62\1\16\1\0\1\62\1\67\22\0\1\55\1\65\1\0"+
+ "\1\66\1\20\1\0\1\61\1\54\1\4\1\5\1\22\1\23\1\57"+
+ "\1\50\1\3\1\0\1\2\7\47\2\1\1\60\1\0\1\53\1\64"+
+ "\1\63\1\21\1\0\1\27\1\27\1\35\1\34\1\44\1\42\1\30"+
+ "\1\51\1\37\2\13\1\56\1\56\1\56\1\13\1\41\1\43\1\13"+
+ "\1\33\2\13\1\32\1\32\1\32\1\13\1\31\1\10\1\12\1\11"+
+ "\1\17\1\14\1\0\1\26\1\27\1\36\1\34\1\26\1\26\1\13"+
+ "\1\51\1\37\1\13\1\52\2\13\1\25\1\13\1\40\1\13\1\25"+
+ "\1\32\1\25\1\46\1\32\1\32\1\45\1\13\1\30\1\6\1\24"+
+ "\1\7\54\0\1\13\12\0\1\13\4\0\1\13\5\0\27\13\1\0"+
+ "\37\13\1\0\u013f\13\31\0\162\13\4\0\14\13\16\0\5\13\11\0"+
+ "\1\13\213\0\1\13\13\0\1\13\1\0\3\13\1\0\1\13\1\0"+
+ "\24\13\1\0\54\13\1\0\46\13\1\0\5\13\4\0\202\13\10\0"+
+ "\105\13\1\0\46\13\2\0\2\13\6\0\20\13\41\0\46\13\2\0"+
+ "\1\13\7\0\47\13\110\0\33\13\5\0\3\13\56\0\32\13\5\0"+
+ "\13\13\25\0\12\15\4\0\2\13\1\0\143\13\1\0\1\13\17\0"+
+ "\2\13\7\0\2\13\12\15\3\13\2\0\1\13\20\0\1\13\1\0"+
+ "\36\13\35\0\3\13\60\0\46\13\13\0\1\13\u0152\0\66\13\3\0"+
+ "\1\13\22\0\1\13\7\0\12\13\4\0\12\15\25\0\10\13\2\0"+
+ "\2\13\2\0\26\13\1\0\7\13\1\0\1\13\3\0\4\13\3\0"+
+ "\1\13\36\0\2\13\1\0\3\13\4\0\12\15\2\13\23\0\6\13"+
+ "\4\0\2\13\2\0\26\13\1\0\7\13\1\0\2\13\1\0\2\13"+
+ "\1\0\2\13\37\0\4\13\1\0\1\13\7\0\12\15\2\0\3\13"+
+ "\20\0\11\13\1\0\3\13\1\0\26\13\1\0\7\13\1\0\2\13"+
+ "\1\0\5\13\3\0\1\13\22\0\1\13\17\0\2\13\4\0\12\15"+
+ "\25\0\10\13\2\0\2\13\2\0\26\13\1\0\7\13\1\0\2\13"+
+ "\1\0\5\13\3\0\1\13\36\0\2\13\1\0\3\13\4\0\12\15"+
+ "\1\0\1\13\21\0\1\13\1\0\6\13\3\0\3\13\1\0\4\13"+
+ "\3\0\2\13\1\0\1\13\1\0\2\13\3\0\2\13\3\0\3\13"+
+ "\3\0\10\13\1\0\3\13\55\0\11\15\25\0\10\13\1\0\3\13"+
+ "\1\0\27\13\1\0\12\13\1\0\5\13\46\0\2\13\4\0\12\15"+
+ "\25\0\10\13\1\0\3\13\1\0\27\13\1\0\12\13\1\0\5\13"+
+ "\3\0\1\13\40\0\1\13\1\0\2\13\4\0\12\15\25\0\10\13"+
+ "\1\0\3\13\1\0\27\13\1\0\20\13\46\0\2\13\4\0\12\15"+
+ "\25\0\22\13\3\0\30\13\1\0\11\13\1\0\1\13\2\0\7\13"+
+ "\72\0\60\13\1\0\2\13\14\0\7\13\11\0\12\15\47\0\2\13"+
+ "\1\0\1\13\2\0\2\13\1\0\1\13\2\0\1\13\6\0\4\13"+
+ "\1\0\7\13\1\0\3\13\1\0\1\13\1\0\1\13\2\0\2\13"+
+ "\1\0\4\13\1\0\2\13\11\0\1\13\2\0\5\13\1\0\1\13"+
+ "\11\0\12\15\2\0\2\13\42\0\1\13\37\0\12\15\26\0\10\13"+
+ "\1\0\42\13\35\0\4\13\164\0\42\13\1\0\5\13\1\0\2\13"+
+ "\25\0\12\15\6\0\6\13\112\0\46\13\12\0\51\13\7\0\132\13"+
+ "\5\0\104\13\5\0\122\13\6\0\7\13\1\0\77\13\1\0\1\13"+
+ "\1\0\4\13\2\0\7\13\1\0\1\13\1\0\4\13\2\0\47\13"+
+ "\1\0\1\13\1\0\4\13\2\0\37\13\1\0\1\13\1\0\4\13"+
+ "\2\0\7\13\1\0\1\13\1\0\4\13\2\0\7\13\1\0\7\13"+
+ "\1\0\27\13\1\0\37\13\1\0\1\13\1\0\4\13\2\0\7\13"+
+ "\1\0\47\13\1\0\23\13\16\0\11\15\56\0\125\13\14\0\u026c\13"+
+ "\2\0\10\13\12\0\32\13\5\0\113\13\25\0\15\13\1\0\4\13"+
+ "\16\0\22\13\16\0\22\13\16\0\15\13\1\0\3\13\17\0\64\13"+
+ "\43\0\1\13\4\0\1\13\3\0\12\15\46\0\12\15\6\0\130\13"+
+ "\10\0\51\13\127\0\35\13\51\0\12\15\36\13\2\0\5\13\u038b\0"+
+ "\154\13\224\0\234\13\4\0\132\13\6\0\26\13\2\0\6\13\2\0"+
+ "\46\13\2\0\6\13\2\0\10\13\1\0\1\13\1\0\1\13\1\0"+
+ "\1\13\1\0\37\13\2\0\65\13\1\0\7\13\1\0\1\13\3\0"+
+ "\3\13\1\0\7\13\3\0\4\13\2\0\6\13\4\0\15\13\5\0"+
+ "\3\13\1\0\7\13\164\0\1\13\15\0\1\13\202\0\1\13\4\0"+
+ "\1\13\2\0\12\13\1\0\1\13\3\0\5\13\6\0\1\13\1\0"+
+ "\1\13\1\0\1\13\1\0\4\13\1\0\3\13\1\0\7\13\3\0"+
+ "\3\13\5\0\5\13\u0ebb\0\2\13\52\0\5\13\5\0\2\13\4\0"+
+ "\126\13\6\0\3\13\1\0\132\13\1\0\4\13\5\0\50\13\4\0"+
+ "\136\13\21\0\30\13\70\0\20\13\u0200\0\u19b6\13\112\0\u51a6\13\132\0"+
+ "\u048d\13\u0773\0\u2ba4\13\u215c\0\u012e\13\2\0\73\13\225\0\7\13\14\0"+
+ "\5\13\5\0\1\13\1\0\12\13\1\0\15\13\1\0\5\13\1\0"+
+ "\1\13\1\0\2\13\1\0\2\13\1\0\154\13\41\0\u016b\13\22\0"+
+ "\100\13\2\0\66\13\50\0\14\13\164\0\5\13\1\0\207\13\23\0"+
+ "\12\15\7\0\32\13\6\0\32\13\13\0\131\13\3\0\6\13\2\0"+
+ "\6\13\2\0\6\13\2\0\3\13\43\0";
/**
* Translates characters to character classes
@@ -132,22 +133,23 @@ class _RegExLexer implements FlexLexer {
private static final int [] ZZ_ACTION = zzUnpackAction();
private static final String ZZ_ACTION_PACKED_0 =
- "\7\0\1\1\1\2\4\0\1\3\1\4\1\5\1\6"+
+ "\7\0\1\1\1\2\5\0\1\3\1\4\1\5\1\6"+
"\1\7\1\10\1\11\1\12\1\13\1\14\1\15\1\16"+
"\1\17\1\20\1\21\1\22\1\23\1\3\1\24\1\25"+
"\1\26\1\27\1\30\1\31\1\32\1\33\1\34\1\35"+
"\1\11\1\36\1\3\1\37\1\40\1\37\1\41\1\42"+
- "\1\43\1\1\1\44\1\45\1\2\1\46\1\47\1\50"+
- "\1\51\1\0\1\52\1\53\1\54\1\55\1\56\1\57"+
- "\1\60\1\61\2\62\1\63\1\11\1\64\1\65\1\66"+
- "\1\53\1\67\1\11\1\70\1\71\1\72\1\73\1\74"+
- "\1\0\1\75\1\76\1\77\1\100\1\101\1\0\1\102"+
- "\1\103\1\104\2\65\1\66\1\53\1\105\1\106\1\107"+
- "\1\110\1\111\1\112\1\0\1\103\1\113\2\65\1\66"+
- "\1\114\1\115\1\103\1\65\1\66\1\65\1\116\4\65";
+ "\1\43\1\1\1\44\1\45\1\2\1\46\1\47\2\50"+
+ "\1\51\1\52\1\0\1\53\1\54\1\55\1\56\1\11"+
+ "\1\57\1\60\1\61\1\62\2\63\1\64\1\65\1\66"+
+ "\1\67\1\54\1\70\1\11\1\71\1\72\1\73\1\74"+
+ "\1\75\1\76\1\77\1\0\1\100\1\101\1\102\1\103"+
+ "\1\104\1\0\1\105\1\106\1\107\2\66\1\67\1\54"+
+ "\1\110\1\111\1\112\1\113\1\114\1\115\1\0\1\106"+
+ "\1\116\2\66\1\67\1\117\1\120\1\106\1\66\1\67"+
+ "\1\66\1\121\4\66";
private static int [] zzUnpackAction() {
- int [] result = new int[119];
+ int [] result = new int[124];
int offset = 0;
offset = zzUnpackAction(ZZ_ACTION_PACKED_0, offset, result);
return result;
@@ -173,23 +175,24 @@ class _RegExLexer implements FlexLexer {
private static final String ZZ_ROWMAP_PACKED_0 =
"\0\0\0\70\0\160\0\250\0\340\0\u0118\0\u0150\0\u0188"+
- "\0\u01c0\0\u01f8\0\u0230\0\u0268\0\u02a0\0\u02d8\0\u02d8\0\u0310"+
- "\0\u02d8\0\u02d8\0\u0348\0\u0380\0\u02d8\0\u02d8\0\u02d8\0\u02d8"+
- "\0\u02d8\0\u02d8\0\u02d8\0\u02d8\0\u02d8\0\u02d8\0\u03b8\0\u02d8"+
- "\0\u03f0\0\u02d8\0\u0428\0\u02d8\0\u02d8\0\u02d8\0\u02d8\0\u0460"+
- "\0\u02d8\0\u0498\0\u02d8\0\u04d0\0\u02d8\0\u02d8\0\u0348\0\u02d8"+
- "\0\u02d8\0\u02d8\0\u0508\0\u0540\0\u02d8\0\u02d8\0\u02d8\0\u02d8"+
- "\0\u0578\0\u02d8\0\u05b0\0\u02d8\0\u05e8\0\u0620\0\u02d8\0\u02d8"+
- "\0\u02d8\0\u02d8\0\u02d8\0\u02d8\0\u0658\0\u02d8\0\u02d8\0\u02d8"+
- "\0\u0690\0\u06c8\0\u0700\0\u02d8\0\u0738\0\u02d8\0\u02d8\0\u02d8"+
- "\0\u02d8\0\u02d8\0\u0770\0\u07a8\0\u02d8\0\u02d8\0\u02d8\0\u02d8"+
- "\0\u07e0\0\u02d8\0\u0818\0\u02d8\0\u0850\0\u0888\0\u08c0\0\u08f8"+
- "\0\u02d8\0\u02d8\0\u02d8\0\u02d8\0\u02d8\0\u02d8\0\u0930\0\u0968"+
- "\0\u02d8\0\u09a0\0\u02d8\0\u09d8\0\u05e8\0\u02d8\0\u02d8\0\u0a10"+
- "\0\u0a48\0\u0a80\0\u02d8\0\u0ab8\0\u0af0\0\u0b28\0\u0b60";
+ "\0\u01c0\0\u01f8\0\u0230\0\u0268\0\u02a0\0\u02d8\0\u0310\0\u0310"+
+ "\0\u0348\0\u0310\0\u0310\0\u0380\0\u03b8\0\u0310\0\u0310\0\u0310"+
+ "\0\u0310\0\u0310\0\u0310\0\u0310\0\u0310\0\u0310\0\u0310\0\u03f0"+
+ "\0\u0310\0\u0428\0\u0310\0\u0460\0\u0310\0\u0310\0\u0310\0\u0310"+
+ "\0\u0498\0\u0310\0\u04d0\0\u0310\0\u0508\0\u0310\0\u0310\0\u0380"+
+ "\0\u0310\0\u0310\0\u0310\0\u0540\0\u0578\0\u0310\0\u0310\0\u0310"+
+ "\0\u0310\0\u0310\0\u05b0\0\u05e8\0\u0310\0\u0620\0\u0310\0\u0658"+
+ "\0\u0690\0\u0310\0\u0310\0\u0310\0\u0310\0\u0310\0\u0310\0\u0310"+
+ "\0\u06c8\0\u0310\0\u0310\0\u0700\0\u0738\0\u0770\0\u0310\0\u07a8"+
+ "\0\u0310\0\u0310\0\u0310\0\u0310\0\u0310\0\u0310\0\u0310\0\u07e0"+
+ "\0\u0818\0\u0310\0\u0310\0\u0310\0\u0310\0\u0850\0\u0310\0\u0888"+
+ "\0\u0310\0\u08c0\0\u08f8\0\u0930\0\u0968\0\u0310\0\u0310\0\u0310"+
+ "\0\u0310\0\u0310\0\u0310\0\u09a0\0\u09d8\0\u0310\0\u0a10\0\u0310"+
+ "\0\u0a48\0\u0658\0\u0310\0\u0310\0\u0a80\0\u0ab8\0\u0af0\0\u0310"+
+ "\0\u0b28\0\u0b60\0\u0b98\0\u0bd0";
private static int [] zzUnpackRowMap() {
- int [] result = new int[119];
+ int [] result = new int[124];
int offset = 0;
offset = zzUnpackRowMap(ZZ_ROWMAP_PACKED_0, offset, result);
return result;
@@ -212,73 +215,76 @@ class _RegExLexer implements FlexLexer {
private static final int [] ZZ_TRANS = zzUnpackTrans();
private static final String ZZ_TRANS_PACKED_0 =
- "\3\16\1\17\1\20\1\21\1\22\1\16\1\23\1\16"+
- "\1\24\1\25\1\26\1\27\1\30\1\31\1\32\1\33"+
- "\23\16\1\34\5\16\1\35\5\16\1\25\4\16\1\36"+
- "\1\25\12\16\1\37\55\16\1\40\2\41\4\40\1\42"+
- "\12\40\22\43\1\41\1\40\2\43\2\40\1\43\1\40"+
- "\1\43\1\40\1\41\1\44\10\40\11\45\1\46\1\45"+
- "\1\0\67\45\1\0\1\47\53\45\6\16\1\22\1\16"+
- "\1\50\1\51\1\52\1\53\1\26\30\16\1\34\12\16"+
- "\1\54\1\53\5\16\1\53\6\55\1\56\1\55\1\57"+
- "\1\55\1\24\13\55\1\60\1\55\1\60\1\55\1\60"+
- "\3\55\1\60\15\55\1\60\13\55\5\61\1\62\14\61"+
- "\22\63\1\61\1\64\2\63\2\61\1\63\1\61\1\63"+
- "\5\61\1\65\5\61\13\11\1\66\53\11\1\66\22\61"+
- "\22\43\2\61\2\43\2\61\1\43\1\61\1\43\6\61"+
- "\1\67\26\61\22\43\2\61\2\43\1\61\1\70\1\43"+
- "\1\61\1\43\20\61\1\62\14\61\22\43\2\61\2\43"+
- "\2\61\1\43\1\61\1\43\14\61\2\41\2\61\1\62"+
- "\14\61\22\43\1\41\1\61\2\43\2\61\1\43\1\61"+
- "\1\43\1\61\1\41\11\61\106\0\1\71\62\0\1\72"+
- "\2\0\1\73\53\0\1\74\1\75\1\76\4\77\1\74"+
- "\1\77\1\74\1\77\1\100\6\77\2\101\3\102\3\103"+
- "\1\104\1\105\1\104\2\106\1\107\1\110\1\107\1\111"+
- "\1\112\1\113\1\77\1\114\1\115\2\74\1\107\1\100"+
- "\1\107\4\74\1\100\5\74\1\100\41\0\1\116\27\0"+
- "\2\41\41\0\1\41\11\0\1\41\12\0\2\43\17\0"+
- "\23\43\1\0\2\43\2\0\1\43\1\0\3\43\22\0"+
- "\1\117\2\0\1\73\53\0\1\74\1\75\1\76\4\77"+
- "\1\74\1\77\1\120\1\77\1\100\6\77\2\101\3\102"+
- "\3\103\1\104\1\105\1\104\2\106\1\107\1\110\1\107"+
- "\1\111\1\112\1\113\1\77\1\114\1\115\2\74\1\107"+
- "\1\100\1\107\4\74\1\100\5\74\1\100\60\0\1\121"+
- "\31\0\22\63\2\0\2\63\2\0\1\63\1\0\1\63"+
- "\35\0\22\64\2\0\2\64\2\0\1\64\1\0\1\64"+
- "\17\0\1\122\31\0\1\123\11\0\1\124\1\125\10\0"+
- "\2\126\1\127\1\130\1\131\12\0\1\132\57\0\2\75"+
- "\41\0\1\75\25\0\1\133\41\0\1\133\23\0\70\134"+
- "\1\0\2\135\3\0\1\136\14\0\2\135\4\0\3\135"+
- "\3\0\1\135\1\0\1\135\2\0\1\135\24\0\2\137"+
- "\20\0\2\137\4\0\3\137\3\0\1\137\1\0\1\137"+
- "\2\0\1\137\24\0\1\75\1\140\41\0\1\140\73\0"+
- "\1\141\1\142\66\0\1\143\13\0\1\144\67\0\1\145"+
- "\1\146\2\0\5\147\1\0\62\147\2\0\1\150\41\0"+
- "\1\150\24\0\2\151\20\0\2\151\4\0\3\151\3\0"+
- "\1\151\1\0\1\151\2\0\1\151\24\0\2\152\4\0"+
- "\1\153\13\0\2\152\4\0\3\152\3\0\1\152\1\0"+
- "\1\152\2\0\1\152\24\0\2\154\20\0\2\154\4\0"+
- "\3\154\3\0\1\154\1\0\1\154\2\0\1\154\24\0"+
- "\1\75\1\155\41\0\1\155\23\0\5\147\1\156\62\147"+
- "\2\0\1\157\41\0\1\157\24\0\2\160\4\0\1\151"+
- "\13\0\2\160\4\0\3\160\3\0\1\160\1\0\1\160"+
- "\2\0\1\160\24\0\2\161\20\0\2\161\4\0\3\161"+
- "\3\0\1\161\1\0\1\161\2\0\1\161\24\0\2\162"+
- "\4\0\1\151\13\0\2\162\4\0\3\162\3\0\1\162"+
- "\1\0\1\162\2\0\1\162\24\0\2\163\20\0\2\163"+
- "\4\0\3\163\3\0\1\163\1\0\1\163\2\0\1\163"+
- "\24\0\2\164\4\0\1\151\13\0\2\164\4\0\3\164"+
- "\3\0\1\164\1\0\1\164\2\0\1\164\24\0\2\165"+
- "\4\0\1\151\13\0\2\165\4\0\3\165\3\0\1\165"+
- "\1\0\1\165\2\0\1\165\24\0\2\166\4\0\1\151"+
- "\13\0\2\166\4\0\3\166\3\0\1\166\1\0\1\166"+
- "\2\0\1\166\24\0\2\167\4\0\1\151\13\0\2\167"+
- "\4\0\3\167\3\0\1\167\1\0\1\167\2\0\1\167"+
- "\24\0\2\167\4\0\1\153\13\0\2\167\4\0\3\167"+
- "\3\0\1\167\1\0\1\167\2\0\1\167\23\0";
+ "\3\17\1\20\1\21\1\22\1\23\1\17\1\24\1\17"+
+ "\1\25\3\17\1\26\1\27\1\30\1\31\1\32\1\33"+
+ "\1\34\23\17\1\35\4\17\1\36\4\17\1\26\3\17"+
+ "\1\37\1\26\12\17\1\40\55\17\1\41\2\42\4\41"+
+ "\1\43\3\41\1\44\1\41\1\42\7\41\22\44\1\42"+
+ "\1\41\2\44\3\41\1\44\1\45\10\41\11\46\1\47"+
+ "\4\46\1\0\67\46\1\0\1\50\50\46\6\17\1\23"+
+ "\1\17\1\51\1\52\1\53\3\17\1\54\1\27\30\17"+
+ "\1\35\10\17\1\55\1\54\4\17\1\54\6\56\1\57"+
+ "\1\56\1\60\1\56\1\25\16\56\1\61\1\56\1\61"+
+ "\1\56\1\61\3\56\1\61\14\56\1\61\11\56\5\62"+
+ "\1\63\5\62\1\64\11\62\22\64\1\62\1\65\2\64"+
+ "\3\62\1\64\1\62\1\66\7\62\16\11\1\67\50\11"+
+ "\1\67\13\62\1\44\11\62\22\44\2\62\2\44\3\62"+
+ "\1\44\4\62\1\70\17\62\1\44\11\62\22\44\2\62"+
+ "\2\44\1\62\1\71\1\62\1\44\16\62\1\63\5\62"+
+ "\1\44\11\62\22\44\2\62\2\44\3\62\1\44\12\62"+
+ "\2\42\2\62\1\63\5\62\1\44\1\62\1\42\7\62"+
+ "\22\44\1\42\1\62\2\44\3\62\1\44\11\62\13\72"+
+ "\1\44\11\72\22\44\2\72\2\44\3\72\1\44\1\72"+
+ "\1\73\7\72\111\0\1\74\57\0\1\75\5\0\1\76"+
+ "\50\0\1\77\1\100\1\101\4\102\1\77\1\102\1\77"+
+ "\1\102\1\103\2\77\1\104\6\102\2\105\3\106\3\107"+
+ "\1\110\1\111\1\110\2\112\1\103\1\113\1\103\1\114"+
+ "\1\115\1\116\1\102\1\117\1\120\2\77\1\104\1\103"+
+ "\3\77\1\104\4\77\1\104\44\0\1\121\24\0\2\42"+
+ "\12\0\1\42\31\0\1\42\21\0\2\44\10\0\3\44"+
+ "\7\0\23\44\1\0\2\44\3\0\1\44\22\0\1\122"+
+ "\5\0\1\76\40\0\1\123\7\0\1\77\1\100\1\101"+
+ "\4\102\1\77\1\102\1\124\1\102\1\103\2\77\1\104"+
+ "\6\102\2\105\3\106\3\107\1\110\1\111\1\110\2\112"+
+ "\1\103\1\113\1\103\1\114\1\115\1\116\1\102\1\117"+
+ "\1\120\2\77\1\104\1\103\3\77\1\104\4\77\1\104"+
+ "\61\0\1\125\21\0\1\64\11\0\22\64\2\0\2\64"+
+ "\3\0\1\64\24\0\1\65\11\0\22\65\2\0\2\65"+
+ "\3\0\1\65\22\0\1\126\62\0\1\127\34\0\1\130"+
+ "\11\0\1\131\1\132\3\0\1\133\2\0\1\133\1\134"+
+ "\1\135\1\136\12\0\1\137\57\0\2\100\44\0\1\100"+
+ "\22\0\1\140\44\0\1\140\20\0\70\141\1\0\2\142"+
+ "\3\0\1\143\17\0\2\142\4\0\3\142\3\0\1\142"+
+ "\1\0\1\142\2\0\1\142\21\0\2\144\23\0\2\144"+
+ "\4\0\3\144\3\0\1\144\1\0\1\144\2\0\1\144"+
+ "\21\0\1\100\1\145\44\0\1\145\73\0\1\146\1\147"+
+ "\66\0\1\150\10\0\1\151\67\0\1\152\1\153\2\0"+
+ "\5\154\1\0\62\154\2\0\1\155\44\0\1\155\21\0"+
+ "\2\156\23\0\2\156\4\0\3\156\3\0\1\156\1\0"+
+ "\1\156\2\0\1\156\21\0\2\157\4\0\1\160\16\0"+
+ "\2\157\4\0\3\157\3\0\1\157\1\0\1\157\2\0"+
+ "\1\157\21\0\2\161\23\0\2\161\4\0\3\161\3\0"+
+ "\1\161\1\0\1\161\2\0\1\161\21\0\1\100\1\162"+
+ "\44\0\1\162\20\0\5\154\1\163\62\154\2\0\1\164"+
+ "\44\0\1\164\21\0\2\165\4\0\1\156\16\0\2\165"+
+ "\4\0\3\165\3\0\1\165\1\0\1\165\2\0\1\165"+
+ "\21\0\2\166\23\0\2\166\4\0\3\166\3\0\1\166"+
+ "\1\0\1\166\2\0\1\166\21\0\2\167\4\0\1\156"+
+ "\16\0\2\167\4\0\3\167\3\0\1\167\1\0\1\167"+
+ "\2\0\1\167\21\0\2\170\23\0\2\170\4\0\3\170"+
+ "\3\0\1\170\1\0\1\170\2\0\1\170\21\0\2\171"+
+ "\4\0\1\156\16\0\2\171\4\0\3\171\3\0\1\171"+
+ "\1\0\1\171\2\0\1\171\21\0\2\172\4\0\1\156"+
+ "\16\0\2\172\4\0\3\172\3\0\1\172\1\0\1\172"+
+ "\2\0\1\172\21\0\2\173\4\0\1\156\16\0\2\173"+
+ "\4\0\3\173\3\0\1\173\1\0\1\173\2\0\1\173"+
+ "\21\0\2\174\4\0\1\156\16\0\2\174\4\0\3\174"+
+ "\3\0\1\174\1\0\1\174\2\0\1\174\21\0\2\174"+
+ "\4\0\1\160\16\0\2\174\4\0\3\174\3\0\1\174"+
+ "\1\0\1\174\2\0\1\174\20\0";
private static int [] zzUnpackTrans() {
- int [] result = new int[2968];
+ int [] result = new int[3080];
int offset = 0;
offset = zzUnpackTrans(ZZ_TRANS_PACKED_0, offset, result);
return result;
@@ -319,16 +325,16 @@ class _RegExLexer implements FlexLexer {
private static final int [] ZZ_ATTRIBUTE = zzUnpackAttribute();
private static final String ZZ_ATTRIBUTE_PACKED_0 =
- "\7\0\2\1\4\0\2\11\1\1\2\11\2\1\12\11"+
+ "\7\0\2\1\5\0\2\11\1\1\2\11\2\1\12\11"+
"\1\1\1\11\1\1\1\11\1\1\4\11\1\1\1\11"+
- "\1\1\1\11\1\1\2\11\1\1\3\11\2\1\4\11"+
- "\1\1\1\11\1\0\1\11\2\1\6\11\1\1\3\11"+
- "\3\1\1\11\1\1\5\11\1\0\1\1\4\11\1\0"+
+ "\1\1\1\11\1\1\2\11\1\1\3\11\2\1\5\11"+
+ "\2\1\1\11\1\0\1\11\2\1\7\11\1\1\2\11"+
+ "\3\1\1\11\1\1\7\11\1\0\1\1\4\11\1\0"+
"\1\11\1\1\1\11\4\1\6\11\1\0\1\1\1\11"+
"\1\1\1\11\2\1\2\11\3\1\1\11\4\1";
private static int [] zzUnpackAttribute() {
- int [] result = new int[119];
+ int [] result = new int[124];
int offset = 0;
offset = zzUnpackAttribute(ZZ_ATTRIBUTE_PACKED_0, offset, result);
return result;
@@ -403,6 +409,7 @@ class _RegExLexer implements FlexLexer {
private boolean allowEmptyCharacterClass;
private boolean allowHorizontalWhitespaceClass;
private boolean allowCategoryShorthand;
+ private boolean allowPosixBracketExpressions;
_RegExLexer(EnumSet capabilities) {
this((java.io.Reader)null);
@@ -415,6 +422,7 @@ class _RegExLexer implements FlexLexer {
this.allowHorizontalWhitespaceClass = capabilities.contains(RegExpCapability.ALLOW_HORIZONTAL_WHITESPACE_CLASS);
this.allowEmptyCharacterClass = capabilities.contains(RegExpCapability.ALLOW_EMPTY_CHARACTER_CLASS);
this.allowCategoryShorthand = capabilities.contains(RegExpCapability.UNICODE_CATEGORY_SHORTHAND);
+ this.allowPosixBracketExpressions = capabilities.contains(RegExpCapability.POSIX_BRACKET_EXPRESSIONS);
}
private void yypushstate(int state) {
@@ -685,137 +693,141 @@ class _RegExLexer implements FlexLexer {
zzMarkedPos = zzMarkedPosL;
switch (zzAction < 0 ? zzAction : ZZ_ACTION[zzAction]) {
- case 78:
+ case 81:
{ return RegExpTT.UNICODE_CHAR;
}
- case 79: break;
+ case 82: break;
case 7:
{ if (yystate() != CLASS2) yypushstate(EMBRACED); return RegExpTT.LBRACE;
}
- case 80: break;
+ case 83: break;
case 24:
{ return RegExpTT.COMMA;
}
- case 81: break;
- case 64:
+ case 84: break;
+ case 67:
{ return RegExpTT.POS_LOOKAHEAD;
}
- case 82: break;
- case 62:
+ case 85: break;
+ case 65:
{ yybegin(QUOTED_NAMED_GROUP); capturingGroupCount++; return RegExpTT.RUBY_QUOTED_NAMED_GROUP;
}
- case 83: break;
- case 77:
+ case 86: break;
+ case 80:
{ return RegExpTT.COMMENT;
}
- case 84: break;
+ case 87: break;
case 14:
{ return RegExpTT.STAR;
}
- case 85: break;
- case 60:
+ case 88: break;
+ case 63:
{ yybegin(PY_COND_REF); return RegExpTT.PYTHON_COND_REF;
}
- case 86: break;
- case 49:
+ case 89: break;
+ case 50:
{ return RegExpTT.CHAR_CLASS;
}
- case 87: break;
+ case 90: break;
case 36:
{ handleOptions(); return RegExpTT.OPTIONS_OFF;
}
- case 88: break;
- case 56:
+ case 91: break;
+ case 57:
{ yypopstate(); return RegExpTT.QUOTE_END;
}
- case 89: break;
+ case 92: break;
case 35:
{ yybegin(YYINITIAL); return RegExpTT.GROUP_END;
}
- case 90: break;
- case 41:
+ case 93: break;
+ case 42:
// lookahead expression with fixed base length
zzMarkedPos = zzStartRead + 1;
{ if (allowEmptyCharacterClass) yypushstate(CLASS2); else yypushstate(CLASS1);
return RegExpTT.CLASS_BEGIN;
}
- case 91: break;
+ case 94: break;
case 37:
{ yybegin(YYINITIAL); return RegExpTT.COLON;
}
- case 92: break;
+ case 95: break;
case 6:
{ return RegExpTT.GROUP_END;
}
- case 93: break;
+ case 96: break;
case 25:
{ assert false : yytext();
}
- case 94: break;
+ case 97: break;
case 18:
{ return commentMode ? com.intellij.psi.TokenType.WHITE_SPACE : RegExpTT.CHARACTER;
}
- case 95: break;
- case 46:
+ case 98: break;
+ case 47:
{ return commentMode ? RegExpTT.CHARACTER : RegExpTT.REDUNDANT_ESCAPE;
}
- case 96: break;
+ case 99: break;
case 23:
{ return RegExpTT.NAME;
}
- case 97: break;
+ case 100: break;
case 29:
{ yypopstate(); return RegExpTT.CLASS_END;
}
- case 98: break;
+ case 101: break;
+ case 72:
+ { yybegin(NAMED_GROUP); return RegExpTT.RUBY_NAMED_GROUP_REF;
+ }
+ case 102: break;
case 34:
{ yybegin(YYINITIAL); return RegExpTT.BAD_CHARACTER;
}
- case 99: break;
- case 52:
+ case 103: break;
+ case 53:
{ yypushstate(QUOTED); return RegExpTT.QUOTE_BEGIN;
}
- case 100: break;
- case 69:
- { yybegin(NAMED_GROUP); return RegExpTT.RUBY_NAMED_GROUP_REF;
+ case 104: break;
+ case 40:
+ { return RegExpTT.BAD_CHARACTER;
}
- case 101: break;
+ case 105: break;
case 21:
{ return RegExpTT.NUMBER;
}
- case 102: break;
+ case 106: break;
case 4:
{ return RegExpTT.DOT;
}
- case 103: break;
- case 74:
+ case 107: break;
+ case 77:
{ return RegExpTT.NEG_LOOKBEHIND;
}
- case 104: break;
+ case 108: break;
case 33:
{ yypopstate(); if (allowCategoryShorthand) return RegExpTT.CATEGORY_SHORT_HAND; else yypushback(1);
}
- case 105: break;
- case 44:
+ case 109: break;
+ case 45:
{ return (allowOctalNoLeadingZero ? RegExpTT.OCT_CHAR : RegExpTT.BAD_OCT_VALUE);
}
- case 106: break;
- case 65:
+ case 110: break;
+ case 68:
{ return RegExpTT.NEG_LOOKAHEAD;
}
- case 107: break;
+ case 111: break;
case 10:
{ return commentMode ? com.intellij.psi.TokenType.WHITE_SPACE : RegExpTT.CTRL_CHARACTER;
}
- case 108: break;
- case 63:
+ case 112: break;
+ case 66:
{ return RegExpTT.NON_CAPT_GROUP;
}
- case 109: break;
- case 70:
+ case 113: break;
+ case 73:
{ yybegin(QUOTED_NAMED_GROUP); return RegExpTT.RUBY_QUOTED_NAMED_GROUP_REF;
}
- case 110: break;
+ case 114: break;
case 28:
{ if (allowNestedCharacterClasses) {
yypushstate(CLASS2);
@@ -823,24 +835,24 @@ class _RegExLexer implements FlexLexer {
}
return RegExpTT.CHARACTER;
}
- case 111: break;
+ case 115: break;
case 19:
{ if (commentMode) { yypushstate(COMMENT); return RegExpTT.COMMENT; } else return RegExpTT.CHARACTER;
}
- case 112: break;
- case 51:
+ case 116: break;
+ case 52:
{ yypushstate(PROP); return RegExpTT.PROPERTY;
}
- case 113: break;
+ case 117: break;
case 8:
{ yypushstate(CLASS2);
return RegExpTT.CLASS_BEGIN;
}
- case 114: break;
- case 73:
+ case 118: break;
+ case 76:
{ return RegExpTT.POS_LOOKBEHIND;
}
- case 115: break;
+ case 119: break;
case 20:
{ if (allowDanglingMetacharacters) {
yypopstate(); yypushback(1);
@@ -848,72 +860,76 @@ class _RegExLexer implements FlexLexer {
return RegExpTT.BAD_CHARACTER;
}
}
- case 116: break;
- case 75:
+ case 120: break;
+ case 78:
{ return RegExpTT.HEX_CHAR;
}
- case 117: break;
+ case 121: break;
case 1:
{ handleOptions(); return RegExpTT.OPTIONS_ON;
}
- case 118: break;
- case 43:
+ case 122: break;
+ case 44:
{ if (yystate() == CLASS2) return RegExpTT.ESC_CHARACTER;
while (yylength() > 2 && Integer.parseInt(yytext().toString().substring(1)) > capturingGroupCount) {
yypushback(1);
}
return RegExpTT.BACKREF;
}
- case 119: break;
+ case 123: break;
+ case 62:
+ { yybegin(CLASS2); return RegExpTT.BRACKET_EXPRESSION_END;
+ }
+ case 124: break;
case 2:
{ yypopstate(); return RegExpTT.COMMENT;
}
- case 120: break;
+ case 125: break;
case 17:
{ return RegExpTT.MINUS;
}
- case 121: break;
- case 47:
+ case 126: break;
+ case 48:
{ return RegExpTT.ESC_CTRL_CHARACTER;
}
- case 122: break;
+ case 127: break;
case 32:
{ yypopstate(); yypushstate(EMBRACED); return RegExpTT.LBRACE;
}
- case 123: break;
+ case 128: break;
case 13:
{ return RegExpTT.QUEST;
}
- case 124: break;
- case 71:
+ case 129: break;
+ case 74:
{ yybegin(NAMED_GROUP); capturingGroupCount++; return RegExpTT.PYTHON_NAMED_GROUP;
}
- case 125: break;
+ case 130: break;
case 5:
{ capturingGroupCount++; return RegExpTT.GROUP_BEGIN;
}
- case 126: break;
+ case 131: break;
case 15:
{ return RegExpTT.PLUS;
}
- case 127: break;
- case 67:
+ case 132: break;
+ case 70:
{ return RegExpTT.OCT_CHAR;
}
- case 128: break;
+ case 133: break;
case 39:
{ yybegin(YYINITIAL); return RegExpTT.QUOTE;
}
- case 129: break;
+ case 134: break;
case 31:
{ yypopstate(); yypushback(1);
}
- case 130: break;
+ case 135: break;
case 27:
{ yybegin(CLASS1); return RegExpTT.CARET;
}
- case 131: break;
- case 57:
+ case 136: break;
+ case 58:
// lookahead expression with fixed base length
zzMarkedPos = zzStartRead + 1;
{ if (allowNestedCharacterClasses) {
@@ -922,104 +938,114 @@ class _RegExLexer implements FlexLexer {
}
return RegExpTT.CHARACTER;
}
- case 132: break;
- case 58:
+ case 137: break;
+ case 59:
+ { if (allowPosixBracketExpressions) {
+ yybegin(BRACKET_EXPRESSION);
+ return RegExpTT.BRACKET_EXPRESSION_BEGIN;
+ } else {
+ yypushback(1);
+ return RegExpTT.CHARACTER;
+ }
+ }
+ case 138: break;
+ case 60:
{ if (!allowNestedCharacterClasses) return RegExpTT.CHARACTER;
return RegExpTT.REDUNDANT_ESCAPE;
}
- case 133: break;
+ case 139: break;
case 38:
{ yybegin(YYINITIAL); return RegExpTT.GT;
}
- case 134: break;
- case 72:
+ case 140: break;
+ case 75:
{ yybegin(PY_NAMED_GROUP_REF); return RegExpTT.PYTHON_NAMED_GROUP_REF;
}
- case 135: break;
+ case 141: break;
case 16:
{ return RegExpTT.UNION;
}
- case 136: break;
+ case 142: break;
case 3:
{ return RegExpTT.CHARACTER;
}
- case 137: break;
- case 40:
+ case 143: break;
+ case 41:
{ yybegin(OPTIONS); return RegExpTT.SET_OPTIONS;
}
- case 138: break;
+ case 144: break;
case 26:
{ yybegin(CLASS2); return RegExpTT.CHARACTER;
}
- case 139: break;
- case 68:
+ case 145: break;
+ case 71:
{ if (xmlSchemaMode) { yypushback(1); return RegExpTT.CHAR_CLASS; } else return RegExpTT.CTRL;
}
- case 140: break;
+ case 146: break;
case 30:
{ return commentMode ? com.intellij.psi.TokenType.WHITE_SPACE : RegExpTT.ESC_CHARACTER;
}
- case 141: break;
+ case 147: break;
case 12:
{ return RegExpTT.DOLLAR;
}
- case 142: break;
- case 59:
+ case 148: break;
+ case 61:
{ if (allowNestedCharacterClasses) return RegExpTT.ANDAND; else yypushback(1); return RegExpTT.CHARACTER;
}
- case 143: break;
- case 50:
+ case 149: break;
+ case 51:
{ if (xmlSchemaMode) return RegExpTT.CHAR_CLASS; else return StringEscapesTokenTypes.INVALID_CHARACTER_ESCAPE_TOKEN;
}
- case 144: break;
- case 42:
+ case 150: break;
+ case 43:
{ return RegExpTT.REDUNDANT_ESCAPE;
}
- case 145: break;
- case 55:
+ case 151: break;
+ case 56:
{ return (allowHexDigitClass || allowHorizontalWhitespaceClass ? RegExpTT.CHAR_CLASS : StringEscapesTokenTypes.INVALID_CHARACTER_ESCAPE_TOKEN);
}
- case 146: break;
- case 48:
+ case 152: break;
+ case 49:
{ return yystate() != CLASS2 ? RegExpTT.BOUNDARY : RegExpTT.ESC_CHARACTER;
}
- case 147: break;
+ case 153: break;
case 22:
{ yypopstate(); return RegExpTT.RBRACE;
}
- case 148: break;
- case 66:
+ case 154: break;
+ case 69:
// lookahead expression with fixed base length
zzMarkedPos = zzStartRead + 1;
{ if (allowEmptyCharacterClass) yypushstate(CLASS2); else yypushstate(NEGATE_CLASS1);
return RegExpTT.CLASS_BEGIN;
}
- case 149: break;
- case 61:
+ case 155: break;
+ case 64:
{ yybegin(NAMED_GROUP); capturingGroupCount++; return RegExpTT.RUBY_NAMED_GROUP;
}
- case 150: break;
- case 54:
+ case 156: break;
+ case 55:
{ return StringEscapesTokenTypes.INVALID_UNICODE_ESCAPE_TOKEN;
}
- case 151: break;
- case 53:
+ case 157: break;
+ case 54:
{ return RegExpTT.BAD_HEX_VALUE;
}
- case 152: break;
+ case 158: break;
case 9:
{ return StringEscapesTokenTypes.INVALID_CHARACTER_ESCAPE_TOKEN;
}
- case 153: break;
+ case 159: break;
case 11:
{ return RegExpTT.CARET;
}
- case 154: break;
- case 45:
+ case 160: break;
+ case 46:
{ return RegExpTT.ESC_CHARACTER;
}
- case 155: break;
- case 76:
+ case 161: break;
+ case 79:
{ if (allowOctalNoLeadingZero) return RegExpTT.OCT_CHAR;
if (yystate() == CLASS2) return RegExpTT.ESC_CHARACTER;
while (yylength() > 2 && Integer.parseInt(yytext().toString().substring(1)) > capturingGroupCount) {
@@ -1027,7 +1053,7 @@ class _RegExLexer implements FlexLexer {
}
return RegExpTT.BACKREF;
}
- case 156: break;
+ case 162: break;
default:
if (zzInput == YYEOF && zzStartRead == zzCurrentPos) {
zzAtEOF = true;
diff --git a/RegExpSupport/src/org/intellij/lang/regexp/DefaultRegExpPropertiesProvider.java b/RegExpSupport/src/org/intellij/lang/regexp/DefaultRegExpPropertiesProvider.java
index 844a42edb7a0..520d9542668e 100644
--- a/RegExpSupport/src/org/intellij/lang/regexp/DefaultRegExpPropertiesProvider.java
+++ b/RegExpSupport/src/org/intellij/lang/regexp/DefaultRegExpPropertiesProvider.java
@@ -113,6 +113,23 @@ public final class DefaultRegExpPropertiesProvider {
{"e", "escape character ('\\u001B')"}
};
+ private final String[][] myPosixCharacterClasses = {
+ {"alnum", "Alphanumeric characters"},
+ {"alpha", "Alphabetic characters"},
+ {"ascii", "ASCII characters"},
+ {"blank", "Space and tab"},
+ {"cntrl", "Control characters"},
+ {"digit", "Digits"},
+ {"graph", "Visible characters"},
+ {"lower", "Lowercase letters"},
+ {"print", "Visible characters and spaces"},
+ {"punct", "Punctuation and symbols"},
+ {"space", "All whitespace characters, including line breaks"},
+ {"upper", "Uppercase letters"},
+ {"word", "Word characters (letters, numbers and underscores)"},
+ {"xdigit","Hexadecimal digits"},
+ };
+
private DefaultRegExpPropertiesProvider() {
}
@@ -157,4 +174,9 @@ public final class DefaultRegExpPropertiesProvider {
public String[][] getKnownCharacterClasses() {
return myCharacterClasses;
}
+
+ @NotNull
+ public String[][] getPosixCharacterClasses() {
+ return myPosixCharacterClasses;
+ }
}
diff --git a/RegExpSupport/src/org/intellij/lang/regexp/RegExpCapability.java b/RegExpSupport/src/org/intellij/lang/regexp/RegExpCapability.java
index 51b4dbf53576..906b540e4724 100644
--- a/RegExpSupport/src/org/intellij/lang/regexp/RegExpCapability.java
+++ b/RegExpSupport/src/org/intellij/lang/regexp/RegExpCapability.java
@@ -28,5 +28,6 @@ public enum RegExpCapability {
ALLOW_HEX_DIGIT_CLASS,
ALLOW_EMPTY_CHARACTER_CLASS,
ALLOW_HORIZONTAL_WHITESPACE_CLASS,
- UNICODE_CATEGORY_SHORTHAND
+ UNICODE_CATEGORY_SHORTHAND,
+ POSIX_BRACKET_EXPRESSIONS
}
diff --git a/RegExpSupport/src/org/intellij/lang/regexp/RegExpCompletionContributor.java b/RegExpSupport/src/org/intellij/lang/regexp/RegExpCompletionContributor.java
index 51f1bd83ba04..6883923b57fb 100644
--- a/RegExpSupport/src/org/intellij/lang/regexp/RegExpCompletionContributor.java
+++ b/RegExpSupport/src/org/intellij/lang/regexp/RegExpCompletionContributor.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2009 JetBrains s.r.o.
+ * Copyright 2000-2014 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -20,11 +20,15 @@ import com.intellij.codeInsight.completion.*;
import com.intellij.codeInsight.lookup.LookupElement;
import com.intellij.codeInsight.lookup.LookupElementBuilder;
import com.intellij.codeInsight.lookup.TailTypeDecorator;
+import com.intellij.openapi.editor.Document;
+import com.intellij.openapi.editor.Editor;
+import com.intellij.openapi.util.TextRange;
import com.intellij.patterns.ElementPattern;
import com.intellij.psi.PsiElement;
import com.intellij.util.PlatformIcons;
import com.intellij.util.ProcessingContext;
import com.intellij.util.ui.EmptyIcon;
+import org.intellij.lang.regexp.psi.RegExpClass;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
@@ -47,6 +51,9 @@ public final class RegExpCompletionContributor extends CompletionContributor {
final ElementPattern propertyNamePattern = psiElement().afterLeaf(psiElement().withText("{").afterLeaf(propertyPattern));
extend(CompletionType.BASIC, propertyNamePattern, new PropertyNameCompletionProvider());
+
+ final ElementPattern bracketExpressionPattern = psiElement().afterLeaf(psiElement(RegExpTT.BRACKET_EXPRESSION_BEGIN));
+ extend(CompletionType.BASIC, bracketExpressionPattern, new BracketExpressionCompletionProvider());
}
{
@@ -85,6 +92,34 @@ public final class RegExpCompletionContributor extends CompletionContributor {
return LookupElementBuilder.create(name).withTypeText(type).withIcon(icon);
}
+ private static class BracketExpressionCompletionProvider extends CompletionProvider {
+
+ @Override
+ protected void addCompletions(@NotNull CompletionParameters parameters,
+ ProcessingContext context,
+ @NotNull CompletionResultSet result) {
+
+ for (String[] completion : RegExpLanguageHosts.getInstance().getPosixCharacterClasses(parameters.getPosition())) {
+ result.addElement(
+ LookupElementBuilder.create(completion[0]).withTypeText((completion.length > 1) ? completion[1] : null).withIcon(emptyIcon)
+ .withInsertHandler(new InsertHandler() {
+ @Override
+ public void handleInsert(InsertionContext context, LookupElement item) {
+ context.setAddCompletionChar(false);
+ final Editor editor = context.getEditor();
+ final Document document = editor.getDocument();
+ final int tailOffset = context.getTailOffset();
+ if (document.getTextLength() < tailOffset + 2 ||
+ !document.getText(new TextRange(tailOffset, tailOffset + 2)).equals(":]")) {
+ document.insertString(tailOffset, ":]");
+ }
+ editor.getCaretModel().moveCaretRelatively(2, 0, false, false, true);
+ }
+ }));
+ }
+ }
+ }
+
private static class PropertyNameCompletionProvider extends CompletionProvider {
public void addCompletions(@NotNull final CompletionParameters parameters,
diff --git a/RegExpSupport/src/org/intellij/lang/regexp/RegExpElementTypes.java b/RegExpSupport/src/org/intellij/lang/regexp/RegExpElementTypes.java
index f04b11415bc9..6c3d3c4afcce 100644
--- a/RegExpSupport/src/org/intellij/lang/regexp/RegExpElementTypes.java
+++ b/RegExpSupport/src/org/intellij/lang/regexp/RegExpElementTypes.java
@@ -38,6 +38,7 @@ public interface RegExpElementTypes {
IElementType BOUNDARY = new RegExpElementType("BOUNDARY");
IElementType NAMED_GROUP_REF = new RegExpElementType("NAMED_GROUP_REF");
IElementType PY_COND_REF = new RegExpElementType("PY_COND_REF");
+ IElementType POSIX_BRACKET_EXPRESSION = new RegExpElementType("POSIX_BRACKET_EXPRESSION");
TokenSet ATOMS = TokenSet.create(CLOSURE, BOUNDARY,
SIMPLE_CLASS, CLASS, CHAR, GROUP, PROPERTY, SET_OPTIONS, BACKREF, NAMED_GROUP_REF);
diff --git a/RegExpSupport/src/org/intellij/lang/regexp/RegExpLanguageHosts.java b/RegExpSupport/src/org/intellij/lang/regexp/RegExpLanguageHosts.java
index c4003af8e1ba..5b6351cfb7c9 100644
--- a/RegExpSupport/src/org/intellij/lang/regexp/RegExpLanguageHosts.java
+++ b/RegExpSupport/src/org/intellij/lang/regexp/RegExpLanguageHosts.java
@@ -143,4 +143,8 @@ public final class RegExpLanguageHosts extends ClassExtension capabilities) {
this((java.io.Reader)null);
@@ -48,6 +49,7 @@ import java.util.EnumSet;
this.allowHorizontalWhitespaceClass = capabilities.contains(RegExpCapability.ALLOW_HORIZONTAL_WHITESPACE_CLASS);
this.allowEmptyCharacterClass = capabilities.contains(RegExpCapability.ALLOW_EMPTY_CHARACTER_CLASS);
this.allowCategoryShorthand = capabilities.contains(RegExpCapability.UNICODE_CATEGORY_SHORTHAND);
+ this.allowPosixBracketExpressions = capabilities.contains(RegExpCapability.POSIX_BRACKET_EXPRESSIONS);
}
private void yypushstate(int state) {
@@ -84,6 +86,7 @@ import java.util.EnumSet;
%xstate QUOTED_NAMED_GROUP
%xstate PY_NAMED_GROUP_REF
%xstate PY_COND_REF
+%xstate BRACKET_EXPRESSION
DIGITS=[1-9][0-9]*
@@ -96,6 +99,7 @@ LBRACKET="["
RBRACKET="]"
ESCAPE="\\"
+NAME=[:letter:]([:letter:]|_|[:digit:])*
ANY=.|\n
META={ESCAPE} | {DOT} |
@@ -198,7 +202,7 @@ HEX_CHAR=[0-9a-fA-F]
{LBRACE} { if (yystate() != CLASS2) yypushstate(EMBRACED); return RegExpTT.LBRACE; }
{
- [:letter:]([:letter:]|_|[:digit:])* { return RegExpTT.NAME; }
+ {NAME} { return RegExpTT.NAME; }
[:digit:]+ { return RegExpTT.NUMBER; }
"," { return RegExpTT.COMMA; }
@@ -251,6 +255,14 @@ HEX_CHAR=[0-9a-fA-F]
}
{
+ {LBRACKET} ":" { if (allowPosixBracketExpressions) {
+ yybegin(BRACKET_EXPRESSION);
+ return RegExpTT.BRACKET_EXPRESSION_BEGIN;
+ } else {
+ yypushback(1);
+ return RegExpTT.CHARACTER;
+ }
+ }
{RBRACKET} { yypopstate(); return RegExpTT.CLASS_END; }
"&&" { if (allowNestedCharacterClasses) return RegExpTT.ANDAND; else yypushback(1); return RegExpTT.CHARACTER; }
@@ -258,6 +270,11 @@ HEX_CHAR=[0-9a-fA-F]
{ANY} { return RegExpTT.CHARACTER; }
}
+ {
+ {NAME} { return RegExpTT.NAME; }
+ ":" {RBRACKET} { yybegin(CLASS2); return RegExpTT.BRACKET_EXPRESSION_END; }
+ {ANY} { return RegExpTT.BAD_CHARACTER; }
+}
{
{LPAREN} { capturingGroupCount++; return RegExpTT.GROUP_BEGIN; }
@@ -297,26 +314,26 @@ HEX_CHAR=[0-9a-fA-F]
}
{
- [:letter:]([:letter:]|_|[:digit:])* { return RegExpTT.NAME; }
+ {NAME} { return RegExpTT.NAME; }
">" { yybegin(YYINITIAL); return RegExpTT.GT; }
{ANY} { yybegin(YYINITIAL); return RegExpTT.BAD_CHARACTER; }
}
{
- [:letter:]([:letter:]|_|[:digit:])* { return RegExpTT.NAME; }
+ {NAME} { return RegExpTT.NAME; }
"'" { yybegin(YYINITIAL); return RegExpTT.QUOTE; }
{ANY} { yybegin(YYINITIAL); return RegExpTT.BAD_CHARACTER; }
}
{
- [:letter:]([:letter:]|_|[:digit:])* { return RegExpTT.NAME; }
+ {NAME} { return RegExpTT.NAME; }
")" { yybegin(YYINITIAL); return RegExpTT.GROUP_END; }
{ANY} { yybegin(YYINITIAL); return RegExpTT.BAD_CHARACTER; }
}
{
- [:letter:]([:letter:]|_|[:digit:])* { return RegExpTT.NAME; }
- [:digit:]+ { return RegExpTT.NUMBER; }
+ {NAME} { return RegExpTT.NAME; }
+ [:digit:]+ { return RegExpTT.NUMBER; }
")" { yybegin(YYINITIAL); return RegExpTT.GROUP_END; }
{ANY} { yybegin(YYINITIAL); return RegExpTT.BAD_CHARACTER; }
}
diff --git a/RegExpSupport/src/org/intellij/lang/regexp/validation/RegExpAnnotator.java b/RegExpSupport/src/org/intellij/lang/regexp/validation/RegExpAnnotator.java
index 06f7614e8d31..dc5f528442d9 100644
--- a/RegExpSupport/src/org/intellij/lang/regexp/validation/RegExpAnnotator.java
+++ b/RegExpSupport/src/org/intellij/lang/regexp/validation/RegExpAnnotator.java
@@ -24,6 +24,7 @@ import com.intellij.lang.annotation.Annotator;
import com.intellij.psi.PsiComment;
import com.intellij.psi.PsiElement;
import com.intellij.psi.util.PsiTreeUtil;
+import com.intellij.util.containers.ContainerUtil;
import org.intellij.lang.regexp.RegExpLanguageHosts;
import org.intellij.lang.regexp.RegExpTT;
import org.intellij.lang.regexp.psi.*;
@@ -31,8 +32,11 @@ import org.jetbrains.annotations.NotNull;
import java.math.BigInteger;
import java.util.HashSet;
+import java.util.Set;
public final class RegExpAnnotator extends RegExpElementVisitor implements Annotator {
+ private static final Set POSIX_CHARACTER_CLASSES = ContainerUtil.newHashSet(
+ "alnum", "alpha", "ascii", "blank", "cntrl", "digit", "graph", "lower", "print", "punct", "space", "upper", "word", "xdigit");
private AnnotationHolder myHolder;
private final RegExpLanguageHosts myLanguageHosts;
@@ -283,6 +287,17 @@ public final class RegExpAnnotator extends RegExpElementVisitor implements Annot
}
}
+ @Override
+ public void visitPosixBracketExpression(RegExpPosixBracketExpression posixBracketExpression) {
+ final String className = posixBracketExpression.getClassName();
+ if (!POSIX_CHARACTER_CLASSES.contains(className)) {
+ final Annotation annotation = myHolder.createErrorAnnotation(posixBracketExpression, "Unknown POSIX character class");
+ if (annotation != null) {
+ annotation.setHighlightType(ProblemHighlightType.LIKE_UNKNOWN_SYMBOL);
+ }
+ }
+ }
+
private static void registerFix(Annotation a, IntentionAction action) {
if (a != null) {
// IDEA-9381
diff --git a/RegExpSupport/test/test/BaseParseTestcase.java b/RegExpSupport/test/org/intellij/lang/regexp/BaseParseTestCase.java
similarity index 94%
rename from RegExpSupport/test/test/BaseParseTestcase.java
rename to RegExpSupport/test/org/intellij/lang/regexp/BaseParseTestCase.java
index efb7b4188d6a..4aa9edbf9d4d 100644
--- a/RegExpSupport/test/test/BaseParseTestcase.java
+++ b/RegExpSupport/test/org/intellij/lang/regexp/BaseParseTestCase.java
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package test;
+package org.intellij.lang.regexp;
import com.intellij.openapi.application.PathManager;
import com.intellij.openapi.application.Result;
@@ -26,15 +26,14 @@ import com.intellij.testFramework.fixtures.CodeInsightTestFixture;
import com.intellij.testFramework.fixtures.IdeaProjectTestFixture;
import com.intellij.testFramework.fixtures.IdeaTestFixtureFactory;
import com.intellij.testFramework.fixtures.TestFixtureBuilder;
-import org.intellij.lang.regexp.RegExpFileType;
import java.io.File;
-public abstract class BaseParseTestcase extends UsefulTestCase{
+public abstract class BaseParseTestCase extends UsefulTestCase{
protected CodeInsightTestFixture myFixture;
@SuppressWarnings({"JUnitTestCaseWithNonTrivialConstructors"})
- public BaseParseTestcase() {
+ public BaseParseTestCase() {
PlatformTestCase.initPlatformLangPrefix();
}
diff --git a/RegExpSupport/test/test/ParseTest.java b/RegExpSupport/test/org/intellij/lang/regexp/ParseTest.java
similarity index 92%
rename from RegExpSupport/test/test/ParseTest.java
rename to RegExpSupport/test/org/intellij/lang/regexp/ParseTest.java
index 4ab429ad2d38..4ceccc03f2cc 100644
--- a/RegExpSupport/test/test/ParseTest.java
+++ b/RegExpSupport/test/org/intellij/lang/regexp/ParseTest.java
@@ -13,9 +13,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package test;
+package org.intellij.lang.regexp;
-public class ParseTest extends BaseParseTestcase {
+public class ParseTest extends BaseParseTestCase {
//public void test0() throws Throwable {
// myFixture.testHighlighting("test0.regexp");
diff --git a/RegExpSupport/test/test/RegExpCompletionTest.java b/RegExpSupport/test/org/intellij/lang/regexp/RegExpCompletionTest.java
similarity index 96%
rename from RegExpSupport/test/test/RegExpCompletionTest.java
rename to RegExpSupport/test/org/intellij/lang/regexp/RegExpCompletionTest.java
index 5e90be4a485a..5b128b32699c 100644
--- a/RegExpSupport/test/test/RegExpCompletionTest.java
+++ b/RegExpSupport/test/org/intellij/lang/regexp/RegExpCompletionTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2009 JetBrains s.r.o.
+ * Copyright 2000-2014 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -13,13 +13,12 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package test;
+package org.intellij.lang.regexp;
import com.intellij.openapi.application.PathManager;
import com.intellij.testFramework.PlatformTestCase;
import com.intellij.testFramework.fixtures.CodeInsightFixtureTestCase;
import com.intellij.util.ArrayUtil;
-import org.intellij.lang.regexp.DefaultRegExpPropertiesProvider;
import java.io.File;
import java.util.ArrayList;
diff --git a/RegExpSupport/test/org/intellij/lang/regexp/RegExpLexerTest.java b/RegExpSupport/test/org/intellij/lang/regexp/RegExpLexerTest.java
new file mode 100644
index 000000000000..8650991bd669
--- /dev/null
+++ b/RegExpSupport/test/org/intellij/lang/regexp/RegExpLexerTest.java
@@ -0,0 +1,63 @@
+/*
+ * Copyright 2000-2014 JetBrains s.r.o.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.intellij.lang.regexp;
+
+import com.intellij.lexer.Lexer;
+import com.intellij.testFramework.LexerTestCase;
+
+import java.util.EnumSet;
+
+/**
+ * @author Bas Leijdekkers
+ */
+public class RegExpLexerTest extends LexerTestCase {
+
+ public void testAmpersand() {
+ final RegExpLexer lexer = new RegExpLexer(EnumSet.noneOf(RegExpCapability.class));
+ doTest("[a&&]", "CLASS_BEGIN ('[')\n" +
+ "CHARACTER ('a')\n" +
+ "CHARACTER ('&')\n" +
+ "CHARACTER ('&')\n" +
+ "CLASS_END (']')", lexer);
+ }
+
+ public void testIntersection() {
+ final RegExpLexer lexer = new RegExpLexer(EnumSet.of(RegExpCapability.NESTED_CHARACTER_CLASSES));
+ doTest("[a&&]", "CLASS_BEGIN ('[')\n" +
+ "CHARACTER ('a')\n" +
+ "ANDAND ('&&')\n" +
+ "CLASS_END (']')", lexer);
+ }
+
+ public void testPosixBracketExpression() {
+ final RegExpLexer lexer = new RegExpLexer(EnumSet.of(RegExpCapability.POSIX_BRACKET_EXPRESSIONS));
+ doTest("[[:xdigit:]]", "CLASS_BEGIN ('[')\n" +
+ "BRACKET_EXPRESSION_BEGIN ('[:')\n" +
+ "NAME ('xdigit')\n" +
+ "BRACKET_EXPRESSION_END (':]')\n" +
+ "CLASS_END (']')", lexer);
+ }
+
+ @Override
+ protected Lexer createLexer() {
+ return null;
+ }
+
+ @Override
+ protected String getDirPath() {
+ return "";
+ }
+}
diff --git a/RegExpSupport/test/test/MainParseTest.java b/RegExpSupport/test/org/intellij/lang/regexp/RegExpParseTest.java
similarity index 93%
rename from RegExpSupport/test/test/MainParseTest.java
rename to RegExpSupport/test/org/intellij/lang/regexp/RegExpParseTest.java
index 7b6914ba2b2a..7aa073894522 100644
--- a/RegExpSupport/test/test/MainParseTest.java
+++ b/RegExpSupport/test/org/intellij/lang/regexp/RegExpParseTest.java
@@ -13,11 +13,8 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package test;
+package org.intellij.lang.regexp;
-import org.intellij.lang.regexp.RegExpFileType;
-import org.intellij.lang.regexp.RegExpLanguageHost;
-import org.intellij.lang.regexp.RegExpLanguageHosts;
import org.jdom.Document;
import org.jdom.Element;
import org.jdom.input.SAXBuilder;
@@ -30,7 +27,7 @@ import java.util.Map;
import java.util.regex.Pattern;
import java.util.regex.PatternSyntaxException;
-public class MainParseTest extends BaseParseTestcase {
+public class RegExpParseTest extends BaseParseTestCase {
private ByteArrayOutputStream myOut;
@@ -175,16 +172,19 @@ public class MainParseTest extends BaseParseTestcase {
System.out.print("filename = " + name);
n++;
- final MainParseTest.Test test = myMap.get(name);
+ final RegExpParseTest.Test test = myMap.get(name);
try {
if (test.regExpHost != null) {
final Class aClass = (Class)Class.forName(test.regExpHost);
final RegExpLanguageHost host = aClass.newInstance();
RegExpLanguageHosts.setRegExpHost(host);
}
- myFixture.configureByText(RegExpFileType.INSTANCE, test.pattern);
- myFixture.testHighlighting(test.showWarnings, true, test.showInfo);
- RegExpLanguageHosts.setRegExpHost(null);
+ try {
+ myFixture.configureByText(RegExpFileType.INSTANCE, test.pattern);
+ myFixture.testHighlighting(test.showWarnings, true, test.showInfo);
+ } finally {
+ RegExpLanguageHosts.setRegExpHost(null);
+ }
if (test.expectedResult == Result.ERR) {
System.out.println(" FAILED. Expression incorrectly parsed OK: " + test.pattern);
diff --git a/colorSchemes/src/colorSchemes/Darcula.xml b/colorSchemes/src/colorSchemes/Darcula.xml
index bf0d584c0771..de43ae57788f 100644
--- a/colorSchemes/src/colorSchemes/Darcula.xml
+++ b/colorSchemes/src/colorSchemes/Darcula.xml
@@ -126,7 +126,7 @@
-
-
+
@@ -547,7 +547,7 @@
-
+
@@ -749,7 +749,7 @@
-
+
@@ -939,7 +939,7 @@
-
+
@@ -979,13 +979,13 @@
-
+
-
+
@@ -997,7 +997,7 @@
-
+
@@ -1493,7 +1493,7 @@
-
+
diff --git a/colorSchemes/src/colorSchemes/all_hallows_eve.xml b/colorSchemes/src/colorSchemes/all_hallows_eve.xml
index a6f2dc954792..533c3f159b43 100644
--- a/colorSchemes/src/colorSchemes/all_hallows_eve.xml
+++ b/colorSchemes/src/colorSchemes/all_hallows_eve.xml
@@ -67,7 +67,7 @@
-
+
@@ -247,7 +247,7 @@
-
+
@@ -527,7 +527,7 @@
-
+
@@ -802,7 +802,7 @@
-
+
@@ -1013,7 +1013,7 @@
-
+
@@ -1070,10 +1070,10 @@
-
+
-
+
@@ -1081,7 +1081,7 @@
-
+
@@ -2102,7 +2102,7 @@
-
+
diff --git a/colorSchemes/src/colorSchemes/blackboard.xml b/colorSchemes/src/colorSchemes/blackboard.xml
index 5a5cace3af1f..f49cef54ada1 100644
--- a/colorSchemes/src/colorSchemes/blackboard.xml
+++ b/colorSchemes/src/colorSchemes/blackboard.xml
@@ -49,7 +49,7 @@
-
+
@@ -179,7 +179,7 @@
-
+
@@ -555,7 +555,7 @@
-
+
@@ -825,12 +825,12 @@
-
+
-
+
@@ -840,7 +840,7 @@
-
+
@@ -1377,7 +1377,7 @@
-
+
diff --git a/colorSchemes/src/colorSchemes/cobalt.xml b/colorSchemes/src/colorSchemes/cobalt.xml
index 0ecbaf13229a..8e56cdeefa2e 100644
--- a/colorSchemes/src/colorSchemes/cobalt.xml
+++ b/colorSchemes/src/colorSchemes/cobalt.xml
@@ -51,7 +51,7 @@
-
+
@@ -259,7 +259,7 @@
-
+
@@ -722,7 +722,7 @@
-
+
@@ -953,7 +953,7 @@
-
+
@@ -1074,7 +1074,7 @@
-
+
@@ -1095,7 +1095,7 @@
-
+
@@ -1105,7 +1105,7 @@
-
+
@@ -1883,7 +1883,7 @@
-
+
diff --git a/colorSchemes/src/colorSchemes/github.xml b/colorSchemes/src/colorSchemes/github.xml
index 2c3b7d8b0de4..bb6702866d5e 100644
--- a/colorSchemes/src/colorSchemes/github.xml
+++ b/colorSchemes/src/colorSchemes/github.xml
@@ -27,7 +27,7 @@
-
+
@@ -63,7 +63,7 @@
-
+
@@ -423,7 +423,7 @@
-
+
@@ -601,7 +601,7 @@
-
+
@@ -695,7 +695,7 @@
-
+
@@ -750,7 +750,7 @@
-
+
@@ -767,7 +767,7 @@
-
+
@@ -1252,7 +1252,7 @@
-
+
diff --git a/colorSchemes/src/colorSchemes/monokai.xml b/colorSchemes/src/colorSchemes/monokai.xml
index 26df45285190..c973beb25c61 100644
--- a/colorSchemes/src/colorSchemes/monokai.xml
+++ b/colorSchemes/src/colorSchemes/monokai.xml
@@ -50,7 +50,7 @@
-
+
@@ -191,7 +191,7 @@
-
+
@@ -604,7 +604,7 @@
-
+
@@ -882,12 +882,12 @@
-
+
-
+
@@ -897,7 +897,7 @@
-
+
@@ -1466,7 +1466,7 @@
-
+
diff --git a/colorSchemes/src/colorSchemes/rails_casts.xml b/colorSchemes/src/colorSchemes/rails_casts.xml
index 482692c3ae54..a2f35c8d59d2 100644
--- a/colorSchemes/src/colorSchemes/rails_casts.xml
+++ b/colorSchemes/src/colorSchemes/rails_casts.xml
@@ -51,7 +51,7 @@
-
+
@@ -200,7 +200,7 @@
-
+
@@ -604,7 +604,7 @@
-
+
@@ -814,7 +814,7 @@
-
+
@@ -906,7 +906,7 @@
-
+
@@ -926,7 +926,7 @@
-
+
@@ -936,7 +936,7 @@
-
+
@@ -1563,7 +1563,7 @@
-
+
diff --git a/colorSchemes/src/colorSchemes/twilight.xml b/colorSchemes/src/colorSchemes/twilight.xml
index 41e5f1ac623e..4fc07340f9b9 100644
--- a/colorSchemes/src/colorSchemes/twilight.xml
+++ b/colorSchemes/src/colorSchemes/twilight.xml
@@ -50,7 +50,7 @@
-
+
@@ -202,7 +202,7 @@
-
+
@@ -665,7 +665,7 @@
-
+
@@ -871,7 +871,7 @@
-
+
@@ -962,7 +962,7 @@
-
+
@@ -982,7 +982,7 @@
-
+
@@ -992,7 +992,7 @@
-
+
@@ -1614,7 +1614,7 @@
-
+
diff --git a/java/compiler/impl/src/com/intellij/compiler/server/BuildManager.java b/java/compiler/impl/src/com/intellij/compiler/server/BuildManager.java
index d516d5b2f74e..411cc3d5720a 100644
--- a/java/compiler/impl/src/com/intellij/compiler/server/BuildManager.java
+++ b/java/compiler/impl/src/com/intellij/compiler/server/BuildManager.java
@@ -25,7 +25,10 @@ import com.intellij.execution.ExecutionException;
import com.intellij.execution.ExecutionManager;
import com.intellij.execution.configurations.GeneralCommandLine;
import com.intellij.execution.configurations.RunProfile;
-import com.intellij.execution.process.*;
+import com.intellij.execution.process.OSProcessHandler;
+import com.intellij.execution.process.ProcessAdapter;
+import com.intellij.execution.process.ProcessEvent;
+import com.intellij.execution.process.ProcessHandler;
import com.intellij.ide.DataManager;
import com.intellij.ide.PowerSaveMode;
import com.intellij.ide.file.BatchFileChangeListener;
@@ -101,8 +104,7 @@ import org.jetbrains.jps.cmdline.ClasspathBootstrap;
import org.jetbrains.jps.incremental.Utils;
import org.jetbrains.jps.model.serialization.JpsGlobalLoader;
-import javax.tools.JavaCompiler;
-import javax.tools.ToolProvider;
+import javax.tools.*;
import java.awt.*;
import java.io.File;
import java.io.IOException;
@@ -122,6 +124,7 @@ import static org.jetbrains.jps.api.CmdlineRemoteProto.Message.ControllerMessage
public class BuildManager implements ApplicationComponent{
public static final Key ALLOW_AUTOMAKE = Key.create("_allow_automake_when_process_is_active_");
private static final Key FORCE_MODEL_LOADING_PARAMETER = Key.create(BuildParametersKeys.FORCE_MODEL_LOADING);
+ private static final Key STDERR_OUTPUT = Key.create("_process_launch_errors_");
private static final Logger LOG = Logger.getInstance("#com.intellij.compiler.server.BuildManager");
private static final String COMPILER_PROCESS_JDK_PROPERTY = "compiler.process.jdk";
@@ -549,13 +552,25 @@ public class BuildManager implements ApplicationComponent{
Pair, OSProcessHandler> pair = takePreloadedProcess(projectPath);
if (pair != null) {
final RequestFuture future = pair.first;
+ final OSProcessHandler processHandler = pair.second;
myMessageDispatcher.cancelSession(future.getRequestID());
// waiting for preloaded process from project's task queue guarantees no build is started for this project
// until this one gracefully exits and closes all its storages
getProjectData(projectPath).taskQueue.submit(new Runnable() {
@Override
public void run() {
- future.waitFor();
+ Throwable error = null;
+ try {
+ while (!processHandler.waitFor()) {
+ LOG.info("processHandler.waitFor() returned false for session " + future.getRequestID() + ", continue waiting");
+ }
+ }
+ catch (Throwable e) {
+ error = e;
+ }
+ finally {
+ notifySessionTerminationIfNeeded(future.getRequestID(), error);
+ }
}
});
}
@@ -675,7 +690,7 @@ public class BuildManager implements ApplicationComponent{
try {
if (project.isDisposed()) {
if (usingPreloadedProcess) {
- future.cancel(true);
+ future.cancel(false);
}
else {
return;
@@ -683,77 +698,58 @@ public class BuildManager implements ApplicationComponent{
}
myBuildsInProgress.put(projectPath, future);
final OSProcessHandler processHandler;
- final StringBuilder errorsOnLaunch = new StringBuilder();
+ CharSequence errorsOnLaunch;
if (usingPreloadedProcess) {
final boolean paramsSent = myMessageDispatcher.sendBuildParameters(future.getRequestID(), params);
if (!paramsSent) {
myMessageDispatcher.cancelSession(future.getRequestID());
}
processHandler = preloaded.second;
+ errorsOnLaunch = STDERR_OUTPUT.get(processHandler);
}
else {
processHandler = launchBuildProcess(project, myListenPort, sessionId, false);
- processHandler.addProcessListener(new ProcessAdapter() {
- @Override
- public void onTextAvailable(ProcessEvent event, Key outputType) {
- if (ProcessOutputTypes.STDERR.equals(outputType)) {
- if (errorsOnLaunch.length() < 1024) {
- final String text = event.getText();
- if (!StringUtil.isEmptyOrSpaces(text)) {
- errorsOnLaunch.append(text);
- }
- }
- }
- }
- });
+ errorsOnLaunch = new StringBuffer();
+ processHandler.addProcessListener(new StdOutputCollector((StringBuffer)errorsOnLaunch));
processHandler.startNotify();
}
- final boolean terminated = processHandler.waitFor();
- if (terminated) {
- final int exitValue = processHandler.getProcess().exitValue();
- if (exitValue != 0) {
- final StringBuilder msg = new StringBuilder();
- msg.append("Abnormal build process termination: ");
- if (errorsOnLaunch.length() > 0) {
- msg.append("\n").append(errorsOnLaunch);
- }
- else {
- msg.append("unknown error");
- }
- handler.handleFailure(sessionId, CmdlineProtoUtil.createFailure(msg.toString(), null));
+ while (!processHandler.waitFor()) {
+ LOG.info("processHandler.waitFor() returned false for session " + sessionId + ", continue waiting");
+ }
+
+ final int exitValue = processHandler.getProcess().exitValue();
+ if (exitValue != 0) {
+ final StringBuilder msg = new StringBuilder();
+ msg.append("Abnormal build process termination: ");
+ if (errorsOnLaunch != null && errorsOnLaunch.length() > 0) {
+ msg.append("\n").append(errorsOnLaunch);
}
+ else {
+ msg.append("unknown error");
+ }
+ handler.handleFailure(sessionId, CmdlineProtoUtil.createFailure(msg.toString(), null));
}
- else {
- handler.handleFailure(sessionId, CmdlineProtoUtil.createFailure("Disconnected from build process", null));
- }
+
}
catch (Throwable e) {
execFailure = e;
}
finally {
myBuildsInProgress.remove(projectPath);
- if (myMessageDispatcher.getAssociatedChannel(sessionId) == null) {
- // either the connection has never been established (process not started or execution failed), or no messages were sent from the launched process.
- // in this case the session cannot be unregistered by the message dispatcher
- final BuilderMessageHandler unregistered = myMessageDispatcher.unregisterBuildMessageHandler(sessionId);
- if (unregistered != null) {
- if (execFailure != null) {
- unregistered.handleFailure(sessionId, CmdlineProtoUtil.createFailure(execFailure.getMessage(), execFailure));
- }
- unregistered.sessionTerminated(sessionId);
- }
- }
+ notifySessionTerminationIfNeeded(sessionId, execFailure);
if (Registry.is("compiler.process.preload") && !project.isDisposed()) {
runCommand(new Runnable() {
public void run() {
- try {
- final Future, OSProcessHandler>> preloadResult = launchPreloadedBuildProcess(project, projectTaskQueue);
- myPreloadedBuilds.put(projectPath, preloadResult);
- }
- catch (Exception e) {
- LOG.info("Error pre-loading build process for project " + projectPath, e);
+ if (!myPreloadedBuilds.containsKey(projectPath)) {
+ try {
+ final Future, OSProcessHandler>> preloadResult = launchPreloadedBuildProcess(project, projectTaskQueue);
+ myPreloadedBuilds.put(projectPath, preloadResult);
+ }
+ catch (Throwable e) {
+ LOG.info("Error pre-loading build process for project " + projectPath, e);
+ }
}
}
});
@@ -764,11 +760,7 @@ public class BuildManager implements ApplicationComponent{
});
}
catch (Throwable e) {
- final BuilderMessageHandler unregistered = myMessageDispatcher.unregisterBuildMessageHandler(sessionId);
- if (unregistered != null) {
- unregistered.handleFailure(sessionId, CmdlineProtoUtil.createFailure(e.getMessage(), e));
- unregistered.sessionTerminated(sessionId);
- }
+ handleProcessExecutionFailure(sessionId, e);
}
}
});
@@ -776,6 +768,28 @@ public class BuildManager implements ApplicationComponent{
return _future;
}
+ private void notifySessionTerminationIfNeeded(UUID sessionId, @Nullable Throwable execFailure) {
+ if (myMessageDispatcher.getAssociatedChannel(sessionId) == null) {
+ // either the connection has never been established (process not started or execution failed), or no messages were sent from the launched process.
+ // in this case the session cannot be unregistered by the message dispatcher
+ final BuilderMessageHandler unregistered = myMessageDispatcher.unregisterBuildMessageHandler(sessionId);
+ if (unregistered != null) {
+ if (execFailure != null) {
+ unregistered.handleFailure(sessionId, CmdlineProtoUtil.createFailure(execFailure.getMessage(), execFailure));
+ }
+ unregistered.sessionTerminated(sessionId);
+ }
+ }
+ }
+
+ private void handleProcessExecutionFailure(UUID sessionId, Throwable e) {
+ final BuilderMessageHandler unregistered = myMessageDispatcher.unregisterBuildMessageHandler(sessionId);
+ if (unregistered != null) {
+ unregistered.handleFailure(sessionId, CmdlineProtoUtil.createFailure(e.getMessage(), e));
+ unregistered.sessionTerminated(sessionId);
+ }
+ }
+
@NotNull
private ProjectData getProjectData(String projectPath) {
synchronized (myProjectDataMap) {
@@ -828,23 +842,15 @@ public class BuildManager implements ApplicationComponent{
try {
myMessageDispatcher.registerBuildMessageHandler(future, null);
final OSProcessHandler processHandler = launchBuildProcess(project, myListenPort, future.getRequestID(), true);
- processHandler.addProcessListener(new ProcessAdapter() {
- @Override
- public void onTextAvailable(ProcessEvent event, Key outputType) {
- if (ProcessOutputTypes.STDERR.equals(outputType)) {
- final String text = event.getText();
- if (!StringUtil.isEmptyOrSpaces(text)) {
- LOG.info("PRELOADED_BUILD_PROCESS: " + text);
- }
- }
- }
- });
+ final StringBuffer errors = new StringBuffer();
+ processHandler.addProcessListener(new StdOutputCollector(errors));
+ STDERR_OUTPUT.set(processHandler, errors);
processHandler.startNotify();
return Pair.create(future, processHandler);
}
catch (ExecutionException e) {
- myMessageDispatcher.unregisterBuildMessageHandler(future.getRequestID());
+ handleProcessExecutionFailure(future.getRequestID(), e);
throw e;
}
}
@@ -1236,6 +1242,36 @@ public class BuildManager implements ApplicationComponent{
}
}
+ private static final class StdOutputCollector extends ProcessAdapter {
+ private final Appendable myOutput;
+ private int myStoredLength = 0;
+ public StdOutputCollector(Appendable outputSink) {
+ myOutput = outputSink;
+ }
+
+ @Override
+ public void onTextAvailable(ProcessEvent event, Key outputType) {
+ String text;
+
+ synchronized (this) {
+ if (myStoredLength > 2048) {
+ return;
+ }
+ text = event.getText();
+ if (StringUtil.isEmptyOrSpaces(text)) {
+ return;
+ }
+ myStoredLength += text.length();
+ }
+
+ try {
+ myOutput.append(text);
+ }
+ catch (IOException ignored) {
+ }
+ }
+ }
+
private class ProjectWatcher extends ProjectManagerAdapter {
private final Map myConnections = new HashMap();
diff --git a/java/debugger/impl/src/com/intellij/debugger/actions/SmartStepTarget.java b/java/debugger/impl/src/com/intellij/debugger/actions/SmartStepTarget.java
index a6579a94357c..4fd7a3ea9e96 100644
--- a/java/debugger/impl/src/com/intellij/debugger/actions/SmartStepTarget.java
+++ b/java/debugger/impl/src/com/intellij/debugger/actions/SmartStepTarget.java
@@ -50,6 +50,7 @@ public abstract class SmartStepTarget {
return myNeedBreakpointRequest;
}
+ @Nullable
public Range getCallingExpressionLines() {
return myExpressionLines;
}
diff --git a/java/debugger/impl/src/com/intellij/debugger/engine/BasicStepMethodFilter.java b/java/debugger/impl/src/com/intellij/debugger/engine/BasicStepMethodFilter.java
index 50fafaf563cc..63a22bc1acbf 100644
--- a/java/debugger/impl/src/com/intellij/debugger/engine/BasicStepMethodFilter.java
+++ b/java/debugger/impl/src/com/intellij/debugger/engine/BasicStepMethodFilter.java
@@ -75,6 +75,7 @@ public class BasicStepMethodFilter implements NamedMethodFilter {
return false;
}
+ @Nullable
@Override
public Range getCallingExpressionLines() {
return myCallingExpressionLines;
diff --git a/java/debugger/impl/src/com/intellij/debugger/engine/LambdaMethodFilter.java b/java/debugger/impl/src/com/intellij/debugger/engine/LambdaMethodFilter.java
index 043b103ee734..f85733082a90 100644
--- a/java/debugger/impl/src/com/intellij/debugger/engine/LambdaMethodFilter.java
+++ b/java/debugger/impl/src/com/intellij/debugger/engine/LambdaMethodFilter.java
@@ -82,6 +82,7 @@ public class LambdaMethodFilter implements BreakpointStepMethodFilter{
return method.name().startsWith(LAMBDA_METHOD_PREFIX) && (!vm.canGetSyntheticAttribute() || method.isSynthetic());
}
+ @Nullable
@Override
public Range getCallingExpressionLines() {
return myCallingExpressionLines;
diff --git a/java/debugger/impl/src/com/intellij/debugger/engine/MethodFilter.java b/java/debugger/impl/src/com/intellij/debugger/engine/MethodFilter.java
index 18ece3d40f0f..bd49cbbbf7b7 100644
--- a/java/debugger/impl/src/com/intellij/debugger/engine/MethodFilter.java
+++ b/java/debugger/impl/src/com/intellij/debugger/engine/MethodFilter.java
@@ -18,8 +18,9 @@ package com.intellij.debugger.engine;
import com.intellij.debugger.engine.evaluation.EvaluateException;
import com.intellij.util.Range;
import com.sun.jdi.Location;
+import org.jetbrains.annotations.Nullable;
public interface MethodFilter {
boolean locationMatches(DebugProcessImpl process, Location location) throws EvaluateException;
- Range getCallingExpressionLines();
+ @Nullable Range getCallingExpressionLines();
}
diff --git a/java/debugger/impl/src/com/intellij/debugger/engine/RequestHint.java b/java/debugger/impl/src/com/intellij/debugger/engine/RequestHint.java
index 8ab29740ba23..9be08b960e51 100644
--- a/java/debugger/impl/src/com/intellij/debugger/engine/RequestHint.java
+++ b/java/debugger/impl/src/com/intellij/debugger/engine/RequestHint.java
@@ -35,6 +35,7 @@ import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.util.Computable;
import com.intellij.psi.PsiMethod;
import com.intellij.psi.util.PsiTreeUtil;
+import com.intellij.util.Range;
import com.sun.jdi.Location;
import com.sun.jdi.Method;
import com.sun.jdi.VMDisconnectedException;
@@ -142,8 +143,8 @@ public class RequestHint {
return myPosition.getLine() == locationPosition.getLine();
}
else {
- return locationPosition.getLine() >= myMethodFilter.getCallingExpressionLines().getFrom() &&
- locationPosition.getLine() <= myMethodFilter.getCallingExpressionLines().getTo();
+ Range exprLines = myMethodFilter.getCallingExpressionLines();
+ return exprLines != null && locationPosition.getLine() >= exprLines.getFrom() && locationPosition.getLine() <= exprLines.getTo();
}
}
diff --git a/java/debugger/impl/src/com/intellij/debugger/impl/DebuggerManagerImpl.java b/java/debugger/impl/src/com/intellij/debugger/impl/DebuggerManagerImpl.java
index 392a14b78bbf..9c094e255ca9 100644
--- a/java/debugger/impl/src/com/intellij/debugger/impl/DebuggerManagerImpl.java
+++ b/java/debugger/impl/src/com/intellij/debugger/impl/DebuggerManagerImpl.java
@@ -582,7 +582,7 @@ public class DebuggerManagerImpl extends DebuggerManagerEx implements Persistent
GenericDebuggerRunnerSettings settings,
boolean checkValidity)
throws ExecutionException {
- return createDebugParameters(parameters, settings.LOCAL, settings.getTransport(), settings.DEBUG_PORT, checkValidity);
+ return createDebugParameters(parameters, settings.LOCAL, settings.getTransport(), settings.getDebugPort(), checkValidity);
}
private static class MyDebuggerStateManager extends DebuggerStateManager {
diff --git a/java/debugger/impl/src/com/intellij/debugger/impl/GenericDebuggerParametersRunnerConfigurable.java b/java/debugger/impl/src/com/intellij/debugger/impl/GenericDebuggerParametersRunnerConfigurable.java
index 9d5d48146b62..2d07226a7229 100644
--- a/java/debugger/impl/src/com/intellij/debugger/impl/GenericDebuggerParametersRunnerConfigurable.java
+++ b/java/debugger/impl/src/com/intellij/debugger/impl/GenericDebuggerParametersRunnerConfigurable.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2009 JetBrains s.r.o.
+ * Copyright 2000-2014 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -132,7 +132,7 @@ public class GenericDebuggerParametersRunnerConfigurable extends SettingsEditor<
}
private int getTransport() {
- if(myIsLocal) {
+ if (myIsLocal) {
return DebuggerSettings.getInstance().DEBUGGER_TRANSPORT;
}
else {
diff --git a/java/debugger/impl/src/com/intellij/debugger/impl/GenericDebuggerRunner.java b/java/debugger/impl/src/com/intellij/debugger/impl/GenericDebuggerRunner.java
index 06408ce2a27a..cba2d3ef9b67 100644
--- a/java/debugger/impl/src/com/intellij/debugger/impl/GenericDebuggerRunner.java
+++ b/java/debugger/impl/src/com/intellij/debugger/impl/GenericDebuggerRunner.java
@@ -134,7 +134,7 @@ public class GenericDebuggerRunner extends JavaPatchableProgramRunner findExpression(PsiElement element, boolean allowMethodCalls) {
PsiElement expression = null;
PsiElement parent = element.getParent();
- if (parent instanceof PsiLiteralExpression) {
+ if (parent instanceof PsiLiteralExpression || parent instanceof PsiLambdaExpression) {
element = parent;
parent = parent.getParent();
}
@@ -95,7 +95,7 @@ public class JavaEditorTextProviderImpl implements EditorTextProvider {
}
else if (parent instanceof PsiReferenceExpression) {
final PsiElement pparent = parent.getParent();
- if (pparent instanceof PsiCallExpression) {
+ if (parent instanceof PsiMethodReferenceExpression || pparent instanceof PsiCallExpression) {
parent = pparent;
}
else if (pparent instanceof PsiReferenceExpression) {
@@ -116,11 +116,19 @@ public class JavaEditorTextProviderImpl implements EditorTextProvider {
expression = parent;
}
}
- else if (allowMethodCalls) {
- PsiElement e = PsiTreeUtil.getParentOfType(element, PsiVariable.class, PsiExpression.class, PsiMethod.class);
- if (e instanceof PsiNewExpression) {
- if (((PsiNewExpression)e).getAnonymousClass() == null) {
- expression = e;
+ else {
+ PsiElement castExpr = PsiTreeUtil.getParentOfType(element, PsiTypeCastExpression.class);
+ if (castExpr != null) {
+ if (allowMethodCalls || !DebuggerUtils.hasSideEffects(castExpr)) {
+ expression = castExpr;
+ }
+ }
+ else if (allowMethodCalls) {
+ PsiElement e = PsiTreeUtil.getParentOfType(element, PsiVariable.class, PsiExpression.class, PsiMethod.class);
+ if (e instanceof PsiNewExpression) {
+ if (((PsiNewExpression)e).getAnonymousClass() == null) {
+ expression = e;
+ }
}
}
}
diff --git a/java/debugger/impl/src/com/intellij/debugger/settings/CompoundRendererConfigurable.java b/java/debugger/impl/src/com/intellij/debugger/settings/CompoundRendererConfigurable.java
index a4484cccc1fe..1fcddb685485 100644
--- a/java/debugger/impl/src/com/intellij/debugger/settings/CompoundRendererConfigurable.java
+++ b/java/debugger/impl/src/com/intellij/debugger/settings/CompoundRendererConfigurable.java
@@ -339,8 +339,8 @@ class CompoundRendererConfigurable extends JPanel {
final NodeRendererSettings rendererSettings = NodeRendererSettings.getInstance();
if (rendererSettings.isBase(labelRenderer)) {
- myRbDefaultLabel.setSelected(true);
myLabelEditor.setText(emptyExpressionFragment);
+ myRbDefaultLabel.setSelected(true);
}
else {
myRbExpressionLabel.setSelected(true);
@@ -391,6 +391,7 @@ class CompoundRendererConfigurable extends JPanel {
for (final Pair pair : data) {
myData.add(new Row(pair.getFirst(), pair.getSecond()));
}
+ fireTableDataChanged();
}
@Override
diff --git a/java/debugger/openapi/src/com/intellij/debugger/engine/evaluation/EvaluateExceptionUtil.java b/java/debugger/openapi/src/com/intellij/debugger/engine/evaluation/EvaluateExceptionUtil.java
index 4d5536c37c4e..bbf200afdeff 100644
--- a/java/debugger/openapi/src/com/intellij/debugger/engine/evaluation/EvaluateExceptionUtil.java
+++ b/java/debugger/openapi/src/com/intellij/debugger/engine/evaluation/EvaluateExceptionUtil.java
@@ -16,6 +16,7 @@
package com.intellij.debugger.engine.evaluation;
import com.intellij.debugger.DebuggerBundle;
+import com.intellij.openapi.util.text.StringUtil;
import com.sun.jdi.*;
/**
@@ -81,7 +82,12 @@ public class EvaluateExceptionUtil {
return th.getMessage();
}
else {
- return th.getClass().getName() + " : " + (th.getMessage() != null ? th.getMessage() : "");
+ StringBuilder res = new StringBuilder(th.getClass().getName());
+ String message = th.getMessage();
+ if (!StringUtil.isEmpty(message)) {
+ res.append(" : ").append(message);
+ }
+ return res.toString();
}
}
}
diff --git a/java/execution/impl/src/com/intellij/execution/JavaRunConfigurationExtensionManager.java b/java/execution/impl/src/com/intellij/execution/JavaRunConfigurationExtensionManager.java
index 556027008efd..9ea8e4058f13 100644
--- a/java/execution/impl/src/com/intellij/execution/JavaRunConfigurationExtensionManager.java
+++ b/java/execution/impl/src/com/intellij/execution/JavaRunConfigurationExtensionManager.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2011 JetBrains s.r.o.
+ * Copyright 2000-2014 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -17,7 +17,6 @@ package com.intellij.execution;
import com.intellij.execution.configuration.RunConfigurationExtensionsManager;
import com.intellij.execution.configurations.RunConfigurationBase;
-import com.intellij.execution.configurations.RuntimeConfigurationException;
import com.intellij.openapi.components.ServiceManager;
import com.intellij.openapi.diagnostic.Logger;
@@ -26,7 +25,7 @@ import com.intellij.openapi.diagnostic.Logger;
* Date: 10/4/11
*/
public class JavaRunConfigurationExtensionManager extends RunConfigurationExtensionsManager {
- private static final Logger LOG = Logger.getInstance("#" + RunConfigurationExtension.class.getName());
+ private static final Logger LOG = Logger.getInstance(RunConfigurationExtension.class);
public JavaRunConfigurationExtensionManager() {
super(RunConfigurationExtension.EP_NAME);
@@ -36,7 +35,7 @@ public class JavaRunConfigurationExtensionManager extends RunConfigurationExtens
return ServiceManager.getService(JavaRunConfigurationExtensionManager.class);
}
- public static void checkConfigurationIsValid(RunConfigurationBase configuration) throws RuntimeConfigurationException {
+ public static void checkConfigurationIsValid(RunConfigurationBase configuration) {
try {
getInstance().validateConfiguration(configuration, false);
}
diff --git a/java/execution/impl/src/com/intellij/execution/application/ApplicationConfiguration.java b/java/execution/impl/src/com/intellij/execution/application/ApplicationConfiguration.java
index b736d9f0b127..de8bcbb84ae6 100644
--- a/java/execution/impl/src/com/intellij/execution/application/ApplicationConfiguration.java
+++ b/java/execution/impl/src/com/intellij/execution/application/ApplicationConfiguration.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2013 JetBrains s.r.o.
+ * Copyright 2000-2014 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -56,7 +56,7 @@ public class ApplicationConfiguration extends ModuleBasedConfiguration myEnvs = new LinkedHashMap();
+ private final Map myEnvs = new LinkedHashMap();
public boolean PASS_PARENT_ENVS = true;
public ApplicationConfiguration(final String name, final Project project, ApplicationConfigurationType applicationConfigurationType) {
diff --git a/java/execution/impl/src/com/intellij/execution/application/ApplicationConfigurationType.java b/java/execution/impl/src/com/intellij/execution/application/ApplicationConfigurationType.java
index fba68e43f396..e6e6a0037cee 100644
--- a/java/execution/impl/src/com/intellij/execution/application/ApplicationConfigurationType.java
+++ b/java/execution/impl/src/com/intellij/execution/application/ApplicationConfigurationType.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2009 JetBrains s.r.o.
+ * Copyright 2000-2014 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -33,10 +33,9 @@ import javax.swing.*;
public class ApplicationConfigurationType implements ConfigurationType {
private final ConfigurationFactory myFactory;
-
- /**reflection*/
public ApplicationConfigurationType() {
myFactory = new ConfigurationFactoryEx(this) {
+ @Override
public RunConfiguration createTemplateConfiguration(Project project) {
return new ApplicationConfiguration("", project, ApplicationConfigurationType.this);
}
@@ -48,18 +47,22 @@ public class ApplicationConfigurationType implements ConfigurationType {
};
}
+ @Override
public String getDisplayName() {
return ExecutionBundle.message("application.configuration.name");
}
+ @Override
public String getConfigurationTypeDescription() {
return ExecutionBundle.message("application.configuration.description");
}
+ @Override
public Icon getIcon() {
return AllIcons.RunConfigurations.Application;
}
+ @Override
public ConfigurationFactory[] getConfigurationFactories() {
return new ConfigurationFactory[]{myFactory};
}
@@ -87,6 +90,7 @@ public class ApplicationConfigurationType implements ConfigurationType {
}
+ @Override
@NotNull
@NonNls
public String getId() {
@@ -97,5 +101,4 @@ public class ApplicationConfigurationType implements ConfigurationType {
public static ApplicationConfigurationType getInstance() {
return ConfigurationTypeUtil.findConfigurationType(ApplicationConfigurationType.class);
}
-
}
diff --git a/java/java-impl/src/com/intellij/find/findUsages/JavaFindUsagesHandler.java b/java/java-impl/src/com/intellij/find/findUsages/JavaFindUsagesHandler.java
index 9d2b9176f9c7..c8bc09984ac3 100644
--- a/java/java-impl/src/com/intellij/find/findUsages/JavaFindUsagesHandler.java
+++ b/java/java-impl/src/com/intellij/find/findUsages/JavaFindUsagesHandler.java
@@ -98,7 +98,10 @@ public class JavaFindUsagesHandler extends FindUsagesHandler{
final PsiMethod method = (PsiMethod)parameter.getDeclarationScope();
PsiMethod[] overrides = OverridingMethodsSearch.search(method, true).toArray(PsiMethod.EMPTY_ARRAY);
for (int i = 0; i < overrides.length; i++) {
- overrides[i] = (PsiMethod)overrides[i].getNavigationElement();
+ final PsiElement navigationElement = overrides[i].getNavigationElement();
+ if (navigationElement instanceof PsiMethod) {
+ overrides[i] = (PsiMethod)navigationElement;
+ }
}
List elementsToSearch = new ArrayList(overrides.length + 1);
elementsToSearch.add(parameter);
diff --git a/java/java-impl/src/com/intellij/ide/util/gotoByName/DefaultSymbolNavigationContributor.java b/java/java-impl/src/com/intellij/ide/util/gotoByName/DefaultSymbolNavigationContributor.java
index a2256a79b850..24ada216c0d9 100644
--- a/java/java-impl/src/com/intellij/ide/util/gotoByName/DefaultSymbolNavigationContributor.java
+++ b/java/java-impl/src/com/intellij/ide/util/gotoByName/DefaultSymbolNavigationContributor.java
@@ -62,9 +62,11 @@ public class DefaultSymbolNavigationContributor implements ChooseByNameContribut
GlobalSearchScope scope = includeNonProjectItems ? GlobalSearchScope.allScope(project) : GlobalSearchScope.projectScope(project);
PsiShortNamesCache cache = PsiShortNamesCache.getInstance(project);
+ Condition qualifiedMatcher = getQualifiedNameMatcher(pattern);
+
List result = new ArrayList();
for (PsiMethod method : cache.getMethodsByName(name, scope)) {
- if (!method.isConstructor() && isOpenable(method) && !hasSuperMethod(method, scope)) {
+ if (!method.isConstructor() && isOpenable(method) && !hasSuperMethod(method, scope, qualifiedMatcher)) {
result.add(method);
}
}
@@ -87,13 +89,14 @@ public class DefaultSymbolNavigationContributor implements ChooseByNameContribut
return member.getContainingFile().getVirtualFile() != null;
}
- private static boolean hasSuperMethod(PsiMethod method, GlobalSearchScope scope) {
+ private static boolean hasSuperMethod(PsiMethod method, GlobalSearchScope scope, Condition qualifiedMatcher) {
PsiClass containingClass = method.getContainingClass();
if (containingClass == null) return false;
for (PsiMethod candidate : containingClass.findMethodsByName(method.getName(), true)) {
if (candidate.getContainingClass() != containingClass &&
PsiSearchScopeUtil.isInScope(scope, candidate) &&
+ qualifiedMatcher.value(candidate) &&
PsiSuperMethodImplUtil.isSuperMethodSmart(method, candidate)) {
return true;
}
@@ -118,20 +121,7 @@ public class DefaultSymbolNavigationContributor implements ChooseByNameContribut
PsiShortNamesCache cache = PsiShortNamesCache.getInstance(scope.getProject());
String completePattern = parameters.getCompletePattern();
- final Condition qualifiedMatcher;
- if (completePattern.contains(".")) {
- final MinusculeMatcher matcher = new MinusculeMatcher("*" + StringUtil.replace(completePattern, ".", ".*"), NameUtil.MatchingCaseSensitivity.NONE);
- qualifiedMatcher = new Condition() {
- @Override
- public boolean value(PsiMember member) {
- String qualifiedName = PsiUtil.getMemberQualifiedName(member);
- return qualifiedName != null && matcher.matches(qualifiedName);
- }
- };
- } else {
- //noinspection unchecked
- qualifiedMatcher = Condition.TRUE;
- }
+ final Condition qualifiedMatcher = getQualifiedNameMatcher(completePattern);
//noinspection UnusedDeclaration
final Set collectedMethods = new THashSet();
@@ -163,13 +153,31 @@ public class DefaultSymbolNavigationContributor implements ChooseByNameContribut
Iterator iterator = collectedMethods.iterator();
while(iterator.hasNext()) {
PsiMethod method = iterator.next();
- if (!hasSuperMethod(method, scope) && !processor.process(method)) return;
+ if (!hasSuperMethod(method, scope, qualifiedMatcher) && !processor.process(method)) return;
ProgressManager.checkCanceled();
iterator.remove();
}
}
}
+ private static Condition getQualifiedNameMatcher(String completePattern) {
+ final Condition qualifiedMatcher;
+ if (completePattern.contains(".")) {
+ final MinusculeMatcher matcher = new MinusculeMatcher("*" + StringUtil.replace(completePattern, ".", ".*"), NameUtil.MatchingCaseSensitivity.NONE);
+ qualifiedMatcher = new Condition() {
+ @Override
+ public boolean value(PsiMember member) {
+ String qualifiedName = PsiUtil.getMemberQualifiedName(member);
+ return qualifiedName != null && matcher.matches(qualifiedName);
+ }
+ };
+ } else {
+ //noinspection unchecked
+ qualifiedMatcher = Condition.TRUE;
+ }
+ return qualifiedMatcher;
+ }
+
private static class MyComparator implements Comparator{
public static final MyComparator INSTANCE = new MyComparator();
diff --git a/java/java-impl/src/com/intellij/refactoring/introduceparameterobject/usageInfo/MergeMethodArguments.java b/java/java-impl/src/com/intellij/refactoring/introduceparameterobject/usageInfo/MergeMethodArguments.java
index 3ba23bc1e0fe..f127efd9f450 100644
--- a/java/java-impl/src/com/intellij/refactoring/introduceparameterobject/usageInfo/MergeMethodArguments.java
+++ b/java/java-impl/src/com/intellij/refactoring/introduceparameterobject/usageInfo/MergeMethodArguments.java
@@ -94,18 +94,26 @@ public class MergeMethodArguments extends FixableUsageInfo {
}
final List parametersInfo = new ArrayList();
final PsiClassType classType = JavaPsiFacade.getElementFactory(getProject()).createType(psiClass, subst);
- parametersInfo.add(new ParameterInfoImpl(-1, parameterName, classType, null) {
+
+ final ParameterInfoImpl mergedParamInfo = new ParameterInfoImpl(-1, parameterName, classType, null) {
@Override
public PsiExpression getValue(final PsiCallExpression expr) throws IncorrectOperationException {
- return (PsiExpression)JavaCodeStyleManager.getInstance(getProject()).shortenClassReferences(psiFacade.getElementFactory().createExpressionFromText(getMergedParam(expr), expr));
+ return (PsiExpression)JavaCodeStyleManager.getInstance(getProject())
+ .shortenClassReferences(psiFacade.getElementFactory().createExpressionFromText(getMergedParam(expr), expr));
}
- });
+ };
+
+ int firstIncludedIdx = -1;
final PsiParameter[] parameters = method.getParameterList().getParameters();
for (int i = 0; i < parameters.length; i++) {
if (!isParameterToMerge(i)) {
parametersInfo.add(new ParameterInfoImpl(i, parameters[i].getName(), parameters[i].getType()));
+ } else if (firstIncludedIdx == -1) {
+ firstIncludedIdx = i;
}
}
+
+ parametersInfo.add(firstIncludedIdx == -1 ? 0 : firstIncludedIdx, mergedParamInfo);
final SmartPsiElementPointer meth = SmartPointerManager.getInstance(getProject()).createSmartPsiElementPointer(method);
Runnable performChangeSignatureRunnable = new Runnable() {
diff --git a/java/java-psi-api/src/com/intellij/psi/util/PsiTypesUtil.java b/java/java-psi-api/src/com/intellij/psi/util/PsiTypesUtil.java
index 906b576e3369..e7f6d5706b9c 100644
--- a/java/java-psi-api/src/com/intellij/psi/util/PsiTypesUtil.java
+++ b/java/java-psi-api/src/com/intellij/psi/util/PsiTypesUtil.java
@@ -166,10 +166,7 @@ public class PsiTypesUtil {
qualifierType = JavaPsiFacade.getInstance(project).getElementFactory().createType((PsiClass)parent.getPsi());
}
}
- PsiElement parent = call.getParent();
- boolean captureTopLevelWildcards = parent instanceof PsiReferenceExpression && parent.getParent() instanceof PsiMethodCallExpression ||
- parent instanceof PsiExpressionList;
- return createJavaLangClassType(methodExpression, qualifierType, captureTopLevelWildcards);
+ return createJavaLangClassType(methodExpression, qualifierType, true);
}
return null;
}
diff --git a/java/java-psi-api/src/com/intellij/psi/util/TypeConversionUtil.java b/java/java-psi-api/src/com/intellij/psi/util/TypeConversionUtil.java
index b75d6687f8ac..78d3e73e7ea3 100644
--- a/java/java-psi-api/src/com/intellij/psi/util/TypeConversionUtil.java
+++ b/java/java-psi-api/src/com/intellij/psi/util/TypeConversionUtil.java
@@ -384,7 +384,7 @@ public class TypeConversionUtil {
return aClass != null &&
bClass != null &&
aClass.getManager().areElementsEquivalent(aClass, bClass) &&
- areSameArgumentTypes(aClass, resolveResult1.getSubstitutor(), resolveResult2.getSubstitutor());
+ areSameArgumentTypes(aClass, resolveResult1.getSubstitutor(), resolveResult2.getSubstitutor(), 1);
}
private static boolean areSameArgumentTypes(@NotNull PsiClass aClass, @NotNull PsiSubstitutor substitutor1, @NotNull PsiSubstitutor substitutor2) {
diff --git a/java/java-psi-impl/src/com/intellij/psi/impl/source/resolve/graphInference/constraints/TypeCompatibilityConstraint.java b/java/java-psi-impl/src/com/intellij/psi/impl/source/resolve/graphInference/constraints/TypeCompatibilityConstraint.java
index f01c82cae769..7b76a68ab5d3 100644
--- a/java/java-psi-impl/src/com/intellij/psi/impl/source/resolve/graphInference/constraints/TypeCompatibilityConstraint.java
+++ b/java/java-psi-impl/src/com/intellij/psi/impl/source/resolve/graphInference/constraints/TypeCompatibilityConstraint.java
@@ -17,6 +17,7 @@ package com.intellij.psi.impl.source.resolve.graphInference.constraints;
import com.intellij.psi.*;
import com.intellij.psi.impl.source.resolve.graphInference.InferenceSession;
+import com.intellij.psi.impl.source.resolve.graphInference.InferenceVariable;
import com.intellij.psi.util.PsiUtil;
import com.intellij.psi.util.TypeConversionUtil;
import org.jetbrains.annotations.NotNull;
@@ -72,7 +73,12 @@ public class TypeCompatibilityConstraint implements ConstraintFormula {
final PsiClass sClass = sResult.getElement();
if (tClass != null && sClass != null) {
final PsiSubstitutor sSubstitutor = TypeConversionUtil.getClassSubstitutor(tClass, sClass, sResult.getSubstitutor());
- if (sSubstitutor != null && PsiUtil.isRawSubstitutor(tClass, sSubstitutor)) {
+ if (sSubstitutor != null) {
+ if (PsiUtil.isRawSubstitutor(tClass, sSubstitutor)) {
+ return true;
+ }
+ }
+ else if (tClass instanceof InferenceVariable && ((PsiClassType)s).isRaw() && tClass.isInheritor(sClass, true)) {
return true;
}
}
diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/advHighlighting7/ClassLiteral.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/advHighlighting7/ClassLiteral.java
index 97673a5f25ee..659f721faa69 100644
--- a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/advHighlighting7/ClassLiteral.java
+++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/advHighlighting7/ClassLiteral.java
@@ -11,3 +11,18 @@ class Example {
return getClass() == obj.getClass();
}
}
+
+class Foo {
+
+ public static Class extends Foo>> fFoo(final Foo> foo) {
+ Class extends Foo>> fooClass = foo.getClass();
+ fooClass = foo.getClass();
+ return foo.getClass();
+ }
+
+ public static Class extends Foo extends String>> fFoo1(final Foo extends String> foo) {
+ Class extends Foo extends String>> fooClass = foo.getClass();
+ fooClass = foo.getClass();
+ return foo.getClass();
+ }
+}
\ No newline at end of file
diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/advHighlighting7/MultiCatch.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/advHighlighting7/MultiCatch.java
index 83b2d4976ffd..a7a73af4b45a 100644
--- a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/advHighlighting7/MultiCatch.java
+++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/advHighlighting7/MultiCatch.java
@@ -60,8 +60,8 @@ abstract class C {
try { g(); }
catch (IE1 | IE2 e) {
Class extends E> clazz1 = e.getClass();
- Class extends IE1> clazz2 = e.getClass();
- Class extends I> clazz3 = e.getClass();
+ Class extends IE1> clazz2 = e.getClass();
+ Class extends I> clazz3 = e.getClass();
}
try { f(); }
diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/genericsHighlighting/NestedLevelsToCheckTypeArguments.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/genericsHighlighting/NestedLevelsToCheckTypeArguments.java
new file mode 100644
index 000000000000..d82c192ffb68
--- /dev/null
+++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/genericsHighlighting/NestedLevelsToCheckTypeArguments.java
@@ -0,0 +1,5 @@
+class ImmutableSet {
+ void foo(final ImmutableSet> of) {
+ Object types = (ImmutableSet>) of;
+ }
+}
\ No newline at end of file
diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/graphInference/UncheckedConversionWithRecursiveTypeParams.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/graphInference/UncheckedConversionWithRecursiveTypeParams.java
new file mode 100644
index 000000000000..f9fc707a2924
--- /dev/null
+++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/graphInference/UncheckedConversionWithRecursiveTypeParams.java
@@ -0,0 +1,13 @@
+
+import java.util.List;
+
+class Foo {
+
+ public void test(Foo parent) {
+ Foo foo = getElements(parent).get(0);
+ }
+
+ public static > List getElements(E parent) {
+ return null;
+ }
+}
diff --git a/java/java-tests/testSrc/com/intellij/codeInsight/daemon/GenericsHighlightingTest.java b/java/java-tests/testSrc/com/intellij/codeInsight/daemon/GenericsHighlightingTest.java
index dececea84471..cc02f8e523be 100644
--- a/java/java-tests/testSrc/com/intellij/codeInsight/daemon/GenericsHighlightingTest.java
+++ b/java/java-tests/testSrc/com/intellij/codeInsight/daemon/GenericsHighlightingTest.java
@@ -430,6 +430,10 @@ public class GenericsHighlightingTest extends LightDaemonAnalyzerTestCase {
doTest(LanguageLevel.JDK_1_7, JavaSdkVersion.JDK_1_7, false);
}
+ public void testNestedLevelsToCheckTypeArguments() throws Exception {
+ doTest(LanguageLevel.JDK_1_7, JavaSdkVersion.JDK_1_7, false);
+ }
+
public void testJavaUtilCollections_NoVerify() throws Exception {
PsiClass collectionsClass = getJavaFacade().findClass("java.util.Collections", GlobalSearchScope.moduleWithLibrariesScope(getModule()));
assertNotNull(collectionsClass);
diff --git a/java/java-tests/testSrc/com/intellij/codeInsight/daemon/lambda/GraphInferenceHighlightingTest.java b/java/java-tests/testSrc/com/intellij/codeInsight/daemon/lambda/GraphInferenceHighlightingTest.java
index 122e776fda9d..acec098d6a5b 100644
--- a/java/java-tests/testSrc/com/intellij/codeInsight/daemon/lambda/GraphInferenceHighlightingTest.java
+++ b/java/java-tests/testSrc/com/intellij/codeInsight/daemon/lambda/GraphInferenceHighlightingTest.java
@@ -255,6 +255,10 @@ public class GraphInferenceHighlightingTest extends LightDaemonAnalyzerTestCase
doTest();
}
+ public void testUncheckedConversionWithRecursiveTypeParams() throws Exception {
+ doTest(false);
+ }
+
private void doTest() throws Exception {
doTest(false);
}
diff --git a/java/java-tests/testSrc/com/intellij/navigation/ChooseByNameTest.groovy b/java/java-tests/testSrc/com/intellij/navigation/ChooseByNameTest.groovy
index 0a5b65deb372..cbe18110f49a 100644
--- a/java/java-tests/testSrc/com/intellij/navigation/ChooseByNameTest.groovy
+++ b/java/java-tests/testSrc/com/intellij/navigation/ChooseByNameTest.groovy
@@ -239,6 +239,14 @@ class Intf {
assert !(sdkRun in noLibs)
}
+ public void "test super method not matching query qualifier"() {
+ def base = myFixture.addClass("class Base { void xpaint() {} }").methods[0]
+ def sub = myFixture.addClass("class Sub extends Base { void xpaint() {} }").methods[0]
+
+ assert getPopupElements(new GotoSymbolModel2(project), 'Ba.xpai', false) == [base]
+ assert getPopupElements(new GotoSymbolModel2(project), 'Su.xpai', false) == [sub]
+ }
+
private List

-
-