diff --git a/RegExpSupport/gen/org/intellij/lang/regexp/_RegExLexer.java b/RegExpSupport/gen/org/intellij/lang/regexp/_RegExLexer.java index c68c75ebdf54..9afabddbaf26 100644 --- a/RegExpSupport/gen/org/intellij/lang/regexp/_RegExLexer.java +++ b/RegExpSupport/gen/org/intellij/lang/regexp/_RegExLexer.java @@ -208,17 +208,17 @@ class _RegExLexer implements FlexLexer { "\1\26\1\27\1\30\1\31\1\32\1\33\1\34\1\35"+ "\1\10\1\36\1\2\1\37\1\40\1\37\1\41\1\42"+ "\1\43\1\44\1\45\1\46\1\1\1\47\1\50\2\51"+ - "\1\52\1\53\1\0\1\54\1\55\1\56\1\57\1\10"+ - "\1\60\1\61\1\62\2\63\1\64\1\65\1\66\1\67"+ - "\1\55\1\70\2\10\1\71\1\72\1\73\1\74\1\75"+ - "\1\76\1\77\1\100\1\0\1\101\1\102\1\103\1\104"+ - "\1\105\1\0\1\106\1\107\1\110\2\66\1\67\1\55"+ - "\1\111\1\112\1\113\1\114\1\115\1\116\1\117\1\120"+ - "\1\0\1\107\1\121\2\66\1\67\1\122\1\123\1\107"+ - "\1\66\1\67\1\66\1\124\4\66"; + "\1\52\1\53\1\0\1\54\1\55\1\56\1\57\1\60"+ + "\1\10\1\61\1\62\1\63\2\64\1\65\1\66\1\67"+ + "\1\70\1\55\1\71\1\72\2\10\1\73\1\74\1\75"+ + "\1\76\1\77\1\100\1\101\1\102\1\0\1\103\1\104"+ + "\1\105\1\106\1\107\1\0\1\110\1\111\1\112\2\67"+ + "\1\70\1\55\1\113\1\114\1\115\1\116\1\117\1\120"+ + "\1\121\1\122\1\0\1\111\1\123\2\67\1\70\1\124"+ + "\1\125\1\111\1\67\1\70\1\67\1\126\4\67"; private static int [] zzUnpackAction() { - int [] result = new int[128]; + int [] result = new int[130]; int offset = 0; offset = zzUnpackAction(ZZ_ACTION_PACKED_0, offset, result); return result; @@ -251,17 +251,18 @@ class _RegExLexer implements FlexLexer { "\0\u032c\0\u04c2\0\u032c\0\u04fc\0\u032c\0\u0536\0\u032c\0\u032c"+ "\0\u03a0\0\u032c\0\u032c\0\u032c\0\u0570\0\u05aa\0\u032c\0\u032c"+ "\0\u032c\0\u032c\0\u032c\0\u05e4\0\u061e\0\u032c\0\u0658\0\u032c"+ - "\0\u0692\0\u06cc\0\u032c\0\u032c\0\u032c\0\u032c\0\u032c\0\u0706"+ - "\0\u032c\0\u032c\0\u032c\0\u0740\0\u077a\0\u07b4\0\u032c\0\u07ee"+ - "\0\u0828\0\u032c\0\u032c\0\u032c\0\u032c\0\u032c\0\u032c\0\u032c"+ - "\0\u032c\0\u0862\0\u089c\0\u032c\0\u032c\0\u032c\0\u032c\0\u08d6"+ - "\0\u032c\0\u0910\0\u032c\0\u094a\0\u0984\0\u09be\0\u09f8\0\u032c"+ - "\0\u032c\0\u032c\0\u032c\0\u032c\0\u032c\0\u032c\0\u032c\0\u0a32"+ - "\0\u0a6c\0\u032c\0\u0aa6\0\u032c\0\u0ae0\0\u0692\0\u032c\0\u032c"+ - "\0\u0b1a\0\u0b54\0\u0b8e\0\u032c\0\u0bc8\0\u0c02\0\u0c3c\0\u0c76"; + "\0\u0692\0\u06cc\0\u032c\0\u032c\0\u032c\0\u032c\0\u032c\0\u032c"+ + "\0\u0706\0\u032c\0\u032c\0\u032c\0\u0740\0\u077a\0\u07b4\0\u032c"+ + "\0\u032c\0\u07ee\0\u0828\0\u032c\0\u032c\0\u032c\0\u032c\0\u032c"+ + "\0\u032c\0\u032c\0\u032c\0\u0862\0\u089c\0\u032c\0\u032c\0\u032c"+ + "\0\u032c\0\u08d6\0\u032c\0\u0910\0\u032c\0\u094a\0\u0984\0\u09be"+ + "\0\u09f8\0\u032c\0\u032c\0\u032c\0\u032c\0\u032c\0\u032c\0\u032c"+ + "\0\u032c\0\u0a32\0\u0a6c\0\u032c\0\u0aa6\0\u032c\0\u0ae0\0\u0692"+ + "\0\u032c\0\u032c\0\u0b1a\0\u0b54\0\u0b8e\0\u032c\0\u0bc8\0\u0c02"+ + "\0\u0c3c\0\u0c76"; private static int [] zzUnpackRowMap() { - int [] result = new int[128]; + int [] result = new int[130]; int offset = 0; offset = zzUnpackRowMap(ZZ_ROWMAP_PACKED_0, offset, result); return result; @@ -308,53 +309,53 @@ class _RegExLexer implements FlexLexer { "\1\44\10\73\22\44\2\73\2\44\2\73\1\44\1\73"+ "\1\44\4\73\1\74\6\73\112\0\1\75\62\0\1\76"+ "\4\0\1\77\53\0\1\100\1\101\1\102\4\103\1\100"+ - "\1\103\1\100\1\103\1\104\2\100\6\103\2\105\3\106"+ - "\3\107\1\110\2\111\2\112\1\104\1\113\1\104\1\114"+ - "\1\115\1\116\1\103\1\117\1\120\2\100\1\121\1\122"+ - "\1\104\1\100\1\122\1\100\1\122\2\100\1\122\4\100"+ - "\43\0\1\123\27\0\2\42\12\0\1\42\30\0\1\42"+ - "\24\0\2\44\10\0\3\44\6\0\23\44\1\0\2\44"+ - "\2\0\1\44\1\0\1\44\24\0\1\124\4\0\1\77"+ - "\44\0\1\125\6\0\1\100\1\101\1\102\4\103\1\100"+ - "\1\103\1\126\1\103\1\104\2\100\6\103\2\105\3\106"+ - "\3\107\1\110\2\111\2\112\1\104\1\113\1\104\1\114"+ - "\1\115\1\116\1\103\1\117\1\120\2\100\1\121\1\122"+ - "\1\104\1\100\1\122\1\100\1\122\2\100\1\122\4\100"+ - "\64\0\1\127\20\0\1\65\10\0\22\65\2\0\2\65"+ - "\2\0\1\65\1\0\1\65\26\0\1\66\10\0\22\66"+ - "\2\0\2\66\2\0\1\66\1\0\1\66\24\0\1\130"+ - "\64\0\1\131\33\0\1\132\11\0\1\133\1\134\7\0"+ - "\1\135\2\0\1\135\1\136\1\137\1\140\11\0\1\141"+ - "\61\0\2\101\43\0\1\101\25\0\1\142\43\0\1\142"+ - "\23\0\72\143\1\0\2\144\3\0\1\145\16\0\2\144"+ - "\4\0\3\144\3\0\1\144\1\0\1\144\2\0\1\144"+ - "\24\0\2\146\22\0\2\146\4\0\3\146\3\0\1\146"+ - "\1\0\1\146\2\0\1\146\24\0\1\101\1\147\43\0"+ - "\1\147\75\0\1\150\1\151\70\0\1\152\1\153\70\0"+ - "\1\154\14\0\1\155\71\0\1\156\1\157\1\0\5\160"+ - "\1\0\64\160\2\0\1\161\43\0\1\161\24\0\2\162"+ - "\22\0\2\162\4\0\3\162\3\0\1\162\1\0\1\162"+ - "\2\0\1\162\24\0\2\163\4\0\1\164\15\0\2\163"+ - "\4\0\3\163\3\0\1\163\1\0\1\163\2\0\1\163"+ - "\24\0\2\165\22\0\2\165\4\0\3\165\3\0\1\165"+ - "\1\0\1\165\2\0\1\165\24\0\1\101\1\166\43\0"+ - "\1\166\23\0\5\160\1\167\64\160\2\0\1\170\43\0"+ - "\1\170\24\0\2\171\4\0\1\162\15\0\2\171\4\0"+ - "\3\171\3\0\1\171\1\0\1\171\2\0\1\171\24\0"+ - "\2\172\22\0\2\172\4\0\3\172\3\0\1\172\1\0"+ - "\1\172\2\0\1\172\24\0\2\173\4\0\1\162\15\0"+ + "\1\104\1\100\1\104\1\105\2\100\1\104\5\103\2\106"+ + "\3\107\3\110\1\111\2\112\2\113\1\105\1\114\1\105"+ + "\1\115\1\116\1\117\1\120\1\121\1\122\2\100\1\123"+ + "\1\124\1\105\1\100\1\124\1\100\1\124\2\100\1\124"+ + "\4\100\43\0\1\125\27\0\2\42\12\0\1\42\30\0"+ + "\1\42\24\0\2\44\10\0\3\44\6\0\23\44\1\0"+ + "\2\44\2\0\1\44\1\0\1\44\24\0\1\126\4\0"+ + "\1\77\44\0\1\127\6\0\1\100\1\101\1\102\4\103"+ + "\1\100\1\104\1\130\1\104\1\105\2\100\1\104\5\103"+ + "\2\106\3\107\3\110\1\111\2\112\2\113\1\105\1\114"+ + "\1\105\1\115\1\116\1\117\1\120\1\121\1\122\2\100"+ + "\1\123\1\124\1\105\1\100\1\124\1\100\1\124\2\100"+ + "\1\124\4\100\64\0\1\131\20\0\1\65\10\0\22\65"+ + "\2\0\2\65\2\0\1\65\1\0\1\65\26\0\1\66"+ + "\10\0\22\66\2\0\2\66\2\0\1\66\1\0\1\66"+ + "\24\0\1\132\64\0\1\133\33\0\1\134\11\0\1\135"+ + "\1\136\7\0\1\137\2\0\1\137\1\140\1\141\1\142"+ + "\11\0\1\143\61\0\2\101\43\0\1\101\25\0\1\144"+ + "\43\0\1\144\23\0\72\145\1\0\2\146\3\0\1\147"+ + "\16\0\2\146\4\0\3\146\3\0\1\146\1\0\1\146"+ + "\2\0\1\146\24\0\2\150\22\0\2\150\4\0\3\150"+ + "\3\0\1\150\1\0\1\150\2\0\1\150\24\0\1\101"+ + "\1\151\43\0\1\151\75\0\1\152\1\153\70\0\1\154"+ + "\1\155\70\0\1\156\14\0\1\157\71\0\1\160\1\161"+ + "\1\0\5\162\1\0\64\162\2\0\1\163\43\0\1\163"+ + "\24\0\2\164\22\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\166"+ + "\15\0\2\165\4\0\3\165\3\0\1\165\1\0\1\165"+ + "\2\0\1\165\24\0\2\167\22\0\2\167\4\0\3\167"+ + "\3\0\1\167\1\0\1\167\2\0\1\167\24\0\1\101"+ + "\1\170\43\0\1\170\23\0\5\162\1\171\64\162\2\0"+ + "\1\172\43\0\1\172\24\0\2\173\4\0\1\164\15\0"+ "\2\173\4\0\3\173\3\0\1\173\1\0\1\173\2\0"+ "\1\173\24\0\2\174\22\0\2\174\4\0\3\174\3\0"+ "\1\174\1\0\1\174\2\0\1\174\24\0\2\175\4\0"+ - "\1\162\15\0\2\175\4\0\3\175\3\0\1\175\1\0"+ - "\1\175\2\0\1\175\24\0\2\176\4\0\1\162\15\0"+ - "\2\176\4\0\3\176\3\0\1\176\1\0\1\176\2\0"+ - "\1\176\24\0\2\177\4\0\1\162\15\0\2\177\4\0"+ - "\3\177\3\0\1\177\1\0\1\177\2\0\1\177\24\0"+ - "\2\200\4\0\1\162\15\0\2\200\4\0\3\200\3\0"+ - "\1\200\1\0\1\200\2\0\1\200\24\0\2\200\4\0"+ + "\1\164\15\0\2\175\4\0\3\175\3\0\1\175\1\0"+ + "\1\175\2\0\1\175\24\0\2\176\22\0\2\176\4\0"+ + "\3\176\3\0\1\176\1\0\1\176\2\0\1\176\24\0"+ + "\2\177\4\0\1\164\15\0\2\177\4\0\3\177\3\0"+ + "\1\177\1\0\1\177\2\0\1\177\24\0\2\200\4\0"+ "\1\164\15\0\2\200\4\0\3\200\3\0\1\200\1\0"+ - "\1\200\2\0\1\200\23\0"; + "\1\200\2\0\1\200\24\0\2\201\4\0\1\164\15\0"+ + "\2\201\4\0\3\201\3\0\1\201\1\0\1\201\2\0"+ + "\1\201\24\0\2\202\4\0\1\164\15\0\2\202\4\0"+ + "\3\202\3\0\1\202\1\0\1\202\2\0\1\202\24\0"+ + "\2\202\4\0\1\166\15\0\2\202\4\0\3\202\3\0"+ + "\1\202\1\0\1\202\2\0\1\202\23\0"; private static int [] zzUnpackTrans() { int [] result = new int[3248]; @@ -398,13 +399,13 @@ class _RegExLexer implements FlexLexer { "\10\0\1\1\5\0\2\11\1\1\2\11\2\1\12\11"+ "\1\1\1\11\1\1\1\11\1\1\5\11\1\1\1\11"+ "\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\5\11\1\1\3\11"+ - "\3\1\1\11\2\1\10\11\1\0\1\1\4\11\1\0"+ + "\2\1\1\11\1\0\1\11\2\1\6\11\1\1\3\11"+ + "\3\1\2\11\2\1\10\11\1\0\1\1\4\11\1\0"+ "\1\11\1\1\1\11\4\1\10\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[128]; + int [] result = new int[130]; int offset = 0; offset = zzUnpackAttribute(ZZ_ATTRIBUTE_PACKED_0, offset, result); return result; @@ -761,76 +762,76 @@ class _RegExLexer implements FlexLexer { case 1: { yypopstate(); return RegExpTT.COMMENT; } - case 85: break; + case 87: break; case 2: { return RegExpTT.CHARACTER; } - case 86: break; + case 88: break; case 3: { return RegExpTT.DOT; } - case 87: break; + case 89: break; case 4: { capturingGroupCount++; return RegExpTT.GROUP_BEGIN; } - case 88: break; + case 90: break; case 5: { return RegExpTT.GROUP_END; } - case 89: break; + case 91: break; case 6: { if (yystate() != CLASS2) yypushstate(EMBRACED); return RegExpTT.LBRACE; } - case 90: break; + case 92: break; case 7: { yypushstate(CLASS2); return RegExpTT.CLASS_BEGIN; } - case 91: break; + case 93: break; case 8: { return StringEscapesTokenTypes.INVALID_CHARACTER_ESCAPE_TOKEN; } - case 92: break; + case 94: break; case 9: { return RegExpTT.CARET; } - case 93: break; + case 95: break; case 10: { return RegExpTT.DOLLAR; } - case 94: break; + case 96: break; case 11: { return RegExpTT.QUEST; } - case 95: break; + case 97: break; case 12: { return RegExpTT.STAR; } - case 96: break; + case 98: break; case 13: { return RegExpTT.PLUS; } - case 97: break; + case 99: break; case 14: { return RegExpTT.UNION; } - case 98: break; + case 100: break; case 15: { return RegExpTT.MINUS; } - case 99: break; + case 101: break; case 16: { return commentMode ? com.intellij.psi.TokenType.WHITE_SPACE : RegExpTT.CHARACTER; } - case 100: break; + case 102: break; case 17: { return commentMode ? com.intellij.psi.TokenType.WHITE_SPACE : RegExpTT.CTRL_CHARACTER; } - case 101: break; + case 103: break; case 18: { if (commentMode) { yypushstate(COMMENT); return RegExpTT.COMMENT; } else return RegExpTT.CHARACTER; } - case 102: break; + case 104: break; case 19: { if (allowDanglingMetacharacters) { yypopstate(); yypushback(1); @@ -838,19 +839,19 @@ class _RegExLexer implements FlexLexer { return RegExpTT.BAD_CHARACTER; } } - case 103: break; + case 105: break; case 20: { return RegExpTT.NUMBER; } - case 104: break; + case 106: break; case 21: { yypopstate(); return RegExpTT.RBRACE; } - case 105: break; + case 107: break; case 22: { return RegExpTT.NAME; } - case 106: break; + case 108: break; case 23: { if (allowCaretNegatedProperties) { return RegExpTT.CARET; @@ -861,23 +862,23 @@ class _RegExLexer implements FlexLexer { return RegExpTT.BAD_CHARACTER; } } - case 107: break; + case 109: break; case 24: { return RegExpTT.COMMA; } - case 108: break; + case 110: break; case 25: { assert false : yytext(); } - case 109: break; + case 111: break; case 26: { yybegin(CLASS2); return RegExpTT.CHARACTER; } - case 110: break; + case 112: break; case 27: { yybegin(CLASS1); return RegExpTT.CARET; } - case 111: break; + case 113: break; case 28: { if (allowNestedCharacterClasses) { yypushstate(CLASS2); @@ -885,63 +886,63 @@ class _RegExLexer implements FlexLexer { } return RegExpTT.CHARACTER; } - case 112: break; + case 114: break; case 29: { yypopstate(); return RegExpTT.CLASS_END; } - case 113: break; + case 115: break; case 30: { return commentMode ? com.intellij.psi.TokenType.WHITE_SPACE : RegExpTT.ESC_CHARACTER; } - case 114: break; + case 116: break; case 31: { yypopstate(); yypushback(1); } - case 115: break; + case 117: break; case 32: { yypopstate(); yypushstate(EMBRACED); return RegExpTT.LBRACE; } - case 116: break; + case 118: break; case 33: { yypopstate(); if (allowCategoryShorthand) return RegExpTT.CATEGORY_SHORT_HAND; else yypushback(1); } - case 117: break; + case 119: break; case 34: { yybegin(YYINITIAL); return RegExpTT.BAD_CHARACTER; } - case 118: break; + case 120: break; case 35: { yybegin(YYINITIAL); return RegExpTT.GROUP_END; } - case 119: break; + case 121: break; case 36: { handleOptions(); return RegExpTT.OPTIONS_ON; } - case 120: break; + case 122: break; case 37: { handleOptions(); return RegExpTT.OPTIONS_OFF; } - case 121: break; + case 123: break; case 38: { yybegin(YYINITIAL); return RegExpTT.COLON; } - case 122: break; + case 124: break; case 39: { yybegin(YYINITIAL); return RegExpTT.GT; } - case 123: break; + case 125: break; case 40: { yybegin(YYINITIAL); return RegExpTT.QUOTE; } - case 124: break; + case 126: break; case 41: { return RegExpTT.BAD_CHARACTER; } - case 125: break; + case 127: break; case 42: { yybegin(OPTIONS); return RegExpTT.SET_OPTIONS; } - case 126: break; + case 128: break; case 43: // lookahead expression with fixed base length zzMarkedPos = Character.offsetByCodePoints @@ -949,11 +950,11 @@ class _RegExLexer implements FlexLexer { { if (allowEmptyCharacterClass) yypushstate(CLASS2); else yypushstate(CLASS1); return RegExpTT.CLASS_BEGIN; } - case 127: break; + case 129: break; case 44: { return RegExpTT.REDUNDANT_ESCAPE; } - case 128: break; + case 130: break; case 45: { if (yystate() == CLASS2) return RegExpTT.ESC_CHARACTER; while (yylength() > 2 && Integer.parseInt(yytext().toString().substring(1)) > capturingGroupCount) { @@ -961,60 +962,68 @@ class _RegExLexer implements FlexLexer { } return RegExpTT.BACKREF; } - case 129: break; + case 131: break; case 46: { return (allowOctalNoLeadingZero ? RegExpTT.OCT_CHAR : RegExpTT.BAD_OCT_VALUE); } - case 130: break; - case 47: - { return RegExpTT.ESC_CHARACTER; - } - case 131: break; - case 48: - { return RegExpTT.ESC_CTRL_CHARACTER; - } case 132: break; - case 49: - { return yystate() != CLASS2 ? RegExpTT.BOUNDARY : RegExpTT.ESC_CHARACTER; + case 47: + { return (yystate() == CLASS2) ? RegExpTT.REDUNDANT_ESCAPE : RegExpTT.ESC_CHARACTER; } case 133: break; - case 50: - { return RegExpTT.CHAR_CLASS; + case 48: + { return RegExpTT.ESC_CHARACTER; } case 134: break; - case 51: - { if (xmlSchemaMode) return RegExpTT.CHAR_CLASS; else return StringEscapesTokenTypes.INVALID_CHARACTER_ESCAPE_TOKEN; + case 49: + { return RegExpTT.ESC_CTRL_CHARACTER; } case 135: break; - case 52: - { yypushstate(PROP); return RegExpTT.PROPERTY; + case 50: + { return yystate() != CLASS2 ? RegExpTT.BOUNDARY : RegExpTT.ESC_CHARACTER; } case 136: break; - case 53: - { yypushstate(QUOTED); return RegExpTT.QUOTE_BEGIN; + case 51: + { return RegExpTT.CHAR_CLASS; } case 137: break; - case 54: - { return RegExpTT.BAD_HEX_VALUE; + case 52: + { if (xmlSchemaMode) return RegExpTT.CHAR_CLASS; else return StringEscapesTokenTypes.INVALID_CHARACTER_ESCAPE_TOKEN; } case 138: break; - case 55: - { return StringEscapesTokenTypes.INVALID_UNICODE_ESCAPE_TOKEN; + case 53: + { yypushstate(PROP); return RegExpTT.PROPERTY; } case 139: break; - case 56: - { return (allowHexDigitClass || allowHorizontalWhitespaceClass ? RegExpTT.CHAR_CLASS : StringEscapesTokenTypes.INVALID_CHARACTER_ESCAPE_TOKEN); + case 54: + { yypushstate(QUOTED); return RegExpTT.QUOTE_BEGIN; } case 140: break; - case 57: - { return commentMode ? RegExpTT.CHARACTER : RegExpTT.REDUNDANT_ESCAPE; + case 55: + { return RegExpTT.BAD_HEX_VALUE; } case 141: break; - case 58: - { yypopstate(); return RegExpTT.QUOTE_END; + case 56: + { return StringEscapesTokenTypes.INVALID_UNICODE_ESCAPE_TOKEN; } case 142: break; + case 57: + { return (yystate() == CLASS2) ? RegExpTT.ESC_CHARACTER : RegExpTT.REDUNDANT_ESCAPE; + } + case 143: break; + case 58: + { return (allowHexDigitClass || allowHorizontalWhitespaceClass ? RegExpTT.CHAR_CLASS : StringEscapesTokenTypes.INVALID_CHARACTER_ESCAPE_TOKEN); + } + case 144: break; case 59: + { return commentMode ? RegExpTT.CHARACTER : RegExpTT.REDUNDANT_ESCAPE; + } + case 145: break; + case 60: + { yypopstate(); return RegExpTT.QUOTE_END; + } + case 146: break; + case 61: // lookahead expression with fixed base length zzMarkedPos = Character.offsetByCodePoints (zzBufferL/*, zzStartRead, zzEndRead - zzStartRead*/, zzStartRead, 1); @@ -1024,8 +1033,8 @@ class _RegExLexer implements FlexLexer { } return RegExpTT.CHARACTER; } - case 143: break; - case 60: + case 147: break; + case 62: { if (allowPosixBracketExpressions) { yybegin(BRACKET_EXPRESSION); return RegExpTT.BRACKET_EXPRESSION_BEGIN; @@ -1034,97 +1043,97 @@ class _RegExLexer implements FlexLexer { return RegExpTT.CHARACTER; } } - case 144: break; - case 61: + case 148: break; + case 63: { if (!allowNestedCharacterClasses) return RegExpTT.CHARACTER; return RegExpTT.REDUNDANT_ESCAPE; } - case 145: break; - case 62: + case 149: break; + case 64: { if (allowNestedCharacterClasses) return RegExpTT.ANDAND; else yypushback(1); return RegExpTT.CHARACTER; } - case 146: break; - case 63: + case 150: break; + case 65: { yybegin(CLASS2); return RegExpTT.BRACKET_EXPRESSION_END; } - case 147: break; - case 64: + case 151: break; + case 66: { yybegin(PY_COND_REF); return RegExpTT.PYTHON_COND_REF; } - case 148: break; - case 65: + case 152: break; + case 67: { yybegin(NAMED_GROUP); capturingGroupCount++; return RegExpTT.RUBY_NAMED_GROUP; } - case 149: break; - case 66: + case 153: break; + case 68: { yybegin(QUOTED_NAMED_GROUP); capturingGroupCount++; return RegExpTT.RUBY_QUOTED_NAMED_GROUP; } - case 150: break; - case 67: + case 154: break; + case 69: { return RegExpTT.NON_CAPT_GROUP; } - case 151: break; - case 68: + case 155: break; + case 70: { return RegExpTT.POS_LOOKAHEAD; } - case 152: break; - case 69: + case 156: break; + case 71: { return RegExpTT.NEG_LOOKAHEAD; } - case 153: break; - case 70: + case 157: break; + case 72: // lookahead expression with fixed base length zzMarkedPos = Character.offsetByCodePoints (zzBufferL/*, zzStartRead, zzEndRead - zzStartRead*/, zzStartRead, 1); { if (allowEmptyCharacterClass) yypushstate(CLASS2); else yypushstate(NEGATE_CLASS1); return RegExpTT.CLASS_BEGIN; } - case 154: break; - case 71: + case 158: break; + case 73: { return RegExpTT.OCT_CHAR; } - case 155: break; - case 72: + case 159: break; + case 74: { if (xmlSchemaMode) { yypushback(1); return RegExpTT.CHAR_CLASS; } else return RegExpTT.CTRL; } - case 156: break; - case 73: + case 160: break; + case 75: { yybegin(NAMED_GROUP); return RegExpTT.RUBY_NAMED_GROUP_REF; } - case 157: break; - case 74: + case 161: break; + case 76: { yybegin(QUOTED_NAMED_GROUP); return RegExpTT.RUBY_QUOTED_NAMED_GROUP_REF; } - case 158: break; - case 75: + case 162: break; + case 77: { yybegin(NAMED_GROUP); return RegExpTT.RUBY_NAMED_GROUP_CALL; } - case 159: break; - case 76: + case 163: break; + case 78: { yybegin(QUOTED_NAMED_GROUP); return RegExpTT.RUBY_QUOTED_NAMED_GROUP_CALL; } - case 160: break; - case 77: + case 164: break; + case 79: { yybegin(NAMED_GROUP); capturingGroupCount++; return RegExpTT.PYTHON_NAMED_GROUP; } - case 161: break; - case 78: + case 165: break; + case 80: { yybegin(PY_NAMED_GROUP_REF); return RegExpTT.PYTHON_NAMED_GROUP_REF; } - case 162: break; - case 79: + case 166: break; + case 81: { return RegExpTT.POS_LOOKBEHIND; } - case 163: break; - case 80: + case 167: break; + case 82: { return RegExpTT.NEG_LOOKBEHIND; } - case 164: break; - case 81: + case 168: break; + case 83: { return RegExpTT.HEX_CHAR; } - case 165: break; - case 82: + case 169: break; + case 84: { if (allowOctalNoLeadingZero) return RegExpTT.OCT_CHAR; if (yystate() == CLASS2) return RegExpTT.ESC_CHARACTER; while (yylength() > 2 && Integer.parseInt(yytext().toString().substring(1)) > capturingGroupCount) { @@ -1132,15 +1141,15 @@ class _RegExLexer implements FlexLexer { } return RegExpTT.BACKREF; } - case 166: break; - case 83: + case 170: break; + case 85: { return RegExpTT.COMMENT; } - case 167: break; - case 84: + case 171: break; + case 86: { return RegExpTT.UNICODE_CHAR; } - case 168: break; + case 172: break; default: zzScanError(ZZ_NO_MATCH); } diff --git a/RegExpSupport/src/org/intellij/lang/regexp/regexp-lexer.flex b/RegExpSupport/src/org/intellij/lang/regexp/regexp-lexer.flex index 7b29dbaadc92..cc7cefa3e5ed 100644 --- a/RegExpSupport/src/org/intellij/lang/regexp/regexp-lexer.flex +++ b/RegExpSupport/src/org/intellij/lang/regexp/regexp-lexer.flex @@ -102,9 +102,8 @@ ESCAPE="\\" NAME=[:letter:]([:letter:]|_|[:digit:])* ANY=[^] -META={ESCAPE} | {DOT} | - "^" | "$" | "?" | "*" | "+" | "|" | - {LBRACKET} | {LBRACE} | {LPAREN} | {RPAREN} +META1 = {ESCAPE} | {LBRACKET} | "^" +META2= {DOT} | "$" | "?" | "*" | "+" | "|" | {LBRACE} | {LPAREN} | {RPAREN} CONTROL="t" | "n" | "r" | "f" | "a" | "e" BOUNDARY="b" | "B" | "A" | "z" | "Z" | "G" @@ -167,8 +166,9 @@ HEX_CHAR=[0-9a-fA-F] return RegExpTT.BACKREF; } -{ESCAPE} "-" { return RegExpTT.ESC_CHARACTER; } -{ESCAPE} {META} { return RegExpTT.ESC_CHARACTER; } +{ESCAPE} "-" { return (yystate() == CLASS2) ? RegExpTT.ESC_CHARACTER : RegExpTT.REDUNDANT_ESCAPE; } +{ESCAPE} {META1} { return RegExpTT.ESC_CHARACTER; } +{ESCAPE} {META2} { return (yystate() == CLASS2) ? RegExpTT.REDUNDANT_ESCAPE : RegExpTT.ESC_CHARACTER; } {ESCAPE} {CLASS} { return RegExpTT.CHAR_CLASS; } {ESCAPE} "R" { return RegExpTT.CHAR_CLASS; } {ESCAPE} {PROP} { yypushstate(PROP); return RegExpTT.PROPERTY; } diff --git a/RegExpSupport/testData/RETest.xml b/RegExpSupport/testData/RETest.xml index 33127bac191d..87b1ea104fa7 100644 --- a/RegExpSupport/testData/RETest.xml +++ b/RegExpSupport/testData/RETest.xml @@ -430,6 +430,10 @@ \X ERR + + \-[\*\-\[\]\\\+]]]> + OK +