Merge remote-tracking branch 'origin/master'

This commit is contained in:
Roman Shevchenko
2016-05-12 12:06:01 +02:00
22 changed files with 6912 additions and 6708 deletions
@@ -56,16 +56,16 @@ class _RegExLexer implements FlexLexer {
* Translates characters to character classes
*/
private static final String ZZ_CMAP_PACKED =
"\10\0\2\65\1\16\1\20\1\21\1\17\22\0\1\60\1\70\1\0"+
"\1\71\1\23\1\0\1\64\1\57\1\4\1\5\1\25\1\26\1\62"+
"\1\53\1\3\1\0\1\2\7\52\2\1\1\63\1\0\1\56\1\67"+
"\1\66\1\24\1\0\1\32\1\32\1\40\1\37\1\47\1\45\1\33"+
"\1\54\1\42\2\13\1\61\1\61\1\61\1\13\1\44\1\46\1\13"+
"\1\36\2\13\1\35\1\35\1\35\1\13\1\34\1\10\1\12\1\11"+
"\1\22\1\14\1\0\1\31\1\32\1\41\1\37\1\31\1\31\1\13"+
"\1\54\1\42\1\13\1\55\2\13\1\30\1\13\1\43\1\13\1\30"+
"\1\35\1\30\1\51\1\35\1\35\1\50\1\13\1\33\1\6\1\27"+
"\1\7\7\0\1\20\44\0\1\13\12\0\1\13\4\0\1\13\5\0"+
"\10\0\2\64\1\57\1\60\1\61\1\57\22\0\1\54\1\67\1\0"+
"\1\70\1\17\1\0\1\63\1\53\1\4\1\5\1\21\1\22\1\56"+
"\1\47\1\3\1\0\1\2\7\46\2\1\1\62\1\0\1\52\1\66"+
"\1\65\1\20\1\0\1\26\1\26\1\34\1\33\1\43\1\41\1\27"+
"\1\50\1\36\2\13\1\55\1\55\1\55\1\13\1\40\1\42\1\13"+
"\1\32\2\13\1\31\1\31\1\31\1\13\1\30\1\10\1\12\1\11"+
"\1\16\1\14\1\0\1\25\1\26\1\35\1\33\1\25\1\25\1\13"+
"\1\50\1\36\1\13\1\51\2\13\1\24\1\13\1\37\1\13\1\24"+
"\1\31\1\24\1\45\1\31\1\31\1\44\1\13\1\27\1\6\1\23"+
"\1\7\7\0\1\60\44\0\1\13\12\0\1\13\4\0\1\13\5\0"+
"\27\13\1\0\37\13\1\0\u01ca\13\4\0\14\13\16\0\5\13\7\0"+
"\1\13\1\0\1\13\201\0\5\13\1\0\2\13\2\0\4\13\1\0"+
"\1\13\6\0\1\13\1\0\3\13\1\0\1\13\1\0\24\13\1\0"+
@@ -119,7 +119,7 @@ class _RegExLexer implements FlexLexer {
"\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\53\0"+
"\1\20\1\20\107\0\1\13\15\0\1\13\20\0\15\13\145\0\1\13"+
"\1\60\1\60\107\0\1\13\15\0\1\13\20\0\15\13\145\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\13\13\2\0\4\13"+
"\5\0\5\13\4\0\1\13\64\0\2\13\u0a7b\0\57\13\1\0\57\13"+
@@ -197,20 +197,20 @@ 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\5\0\1\3\1\4\1\5\1\6"+
"\10\0\1\1\5\0\1\2\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\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";
"\1\17\1\20\1\21\1\22\1\2\1\23\1\24\1\25"+
"\1\26\1\27\1\30\1\31\1\32\1\33\1\34\1\10"+
"\1\35\1\2\1\36\1\37\1\36\1\40\1\41\1\42"+
"\1\43\1\44\1\45\1\1\1\46\1\47\2\50\1\51"+
"\1\52\1\0\1\53\1\54\1\55\1\56\1\10\1\57"+
"\1\60\1\61\2\62\1\63\1\64\1\65\1\66\1\54"+
"\1\67\1\10\1\70\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\65\1\66\1\54\1\110"+
"\1\111\1\112\1\113\1\114\1\115\1\0\1\106\1\116"+
"\2\65\1\66\1\117\1\120\1\106\1\65\1\66\1\65"+
"\1\121\4\65";
private static int [] zzUnpackAction() {
int [] result = new int[124];
@@ -238,22 +238,22 @@ class _RegExLexer implements FlexLexer {
private static final int [] ZZ_ROWMAP = zzUnpackRowMap();
private static final String ZZ_ROWMAP_PACKED_0 =
"\0\0\0\72\0\164\0\256\0\350\0\u0122\0\u015c\0\u0196"+
"\0\u01d0\0\u020a\0\u0244\0\u027e\0\u02b8\0\u02f2\0\u032c\0\u032c"+
"\0\u0366\0\u032c\0\u032c\0\u03a0\0\u03da\0\u032c\0\u032c\0\u032c"+
"\0\u032c\0\u032c\0\u032c\0\u032c\0\u032c\0\u032c\0\u032c\0\u0414"+
"\0\u032c\0\u044e\0\u032c\0\u0488\0\u032c\0\u032c\0\u032c\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\u032c\0\u032c"+
"\0\u0706\0\u032c\0\u032c\0\u0740\0\u077a\0\u07b4\0\u032c\0\u07ee"+
"\0\u032c\0\u032c\0\u032c\0\u032c\0\u032c\0\u032c\0\u032c\0\u0828"+
"\0\u0862\0\u032c\0\u032c\0\u032c\0\u032c\0\u089c\0\u032c\0\u08d6"+
"\0\u032c\0\u0910\0\u094a\0\u0984\0\u09be\0\u032c\0\u032c\0\u032c"+
"\0\u032c\0\u032c\0\u032c\0\u09f8\0\u0a32\0\u032c\0\u0a6c\0\u032c"+
"\0\u0aa6\0\u0692\0\u032c\0\u032c\0\u0ae0\0\u0b1a\0\u0b54\0\u032c"+
"\0\u0b8e\0\u0bc8\0\u0c02\0\u0c3c";
"\0\0\0\71\0\162\0\253\0\344\0\u011d\0\u0156\0\u018f"+
"\0\u01c8\0\u0201\0\u023a\0\u0273\0\u02ac\0\u02e5\0\u031e\0\u031e"+
"\0\u0357\0\u031e\0\u031e\0\u0390\0\u03c9\0\u031e\0\u031e\0\u031e"+
"\0\u031e\0\u031e\0\u031e\0\u031e\0\u031e\0\u031e\0\u031e\0\u0402"+
"\0\u031e\0\u043b\0\u031e\0\u0474\0\u031e\0\u031e\0\u031e\0\u031e"+
"\0\u04ad\0\u031e\0\u04e6\0\u031e\0\u051f\0\u031e\0\u031e\0\u0390"+
"\0\u031e\0\u031e\0\u031e\0\u0558\0\u0591\0\u031e\0\u031e\0\u031e"+
"\0\u031e\0\u031e\0\u05ca\0\u0603\0\u031e\0\u063c\0\u031e\0\u0675"+
"\0\u06ae\0\u031e\0\u031e\0\u031e\0\u031e\0\u031e\0\u031e\0\u06e7"+
"\0\u031e\0\u031e\0\u0720\0\u0759\0\u0792\0\u031e\0\u07cb\0\u031e"+
"\0\u031e\0\u031e\0\u031e\0\u031e\0\u031e\0\u031e\0\u031e\0\u0804"+
"\0\u083d\0\u031e\0\u031e\0\u031e\0\u031e\0\u0876\0\u031e\0\u08af"+
"\0\u031e\0\u08e8\0\u0921\0\u095a\0\u0993\0\u031e\0\u031e\0\u031e"+
"\0\u031e\0\u031e\0\u031e\0\u09cc\0\u0a05\0\u031e\0\u0a3e\0\u031e"+
"\0\u0a77\0\u0675\0\u031e\0\u031e\0\u0ab0\0\u0ae9\0\u0b22\0\u031e"+
"\0\u0b5b\0\u0b94\0\u0bcd\0\u0c06";
private static int [] zzUnpackRowMap() {
int [] result = new int[124];
@@ -280,78 +280,76 @@ class _RegExLexer implements FlexLexer {
private static final String ZZ_TRANS_PACKED_0 =
"\3\17\1\20\1\21\1\22\1\23\1\17\1\24\1\17"+
"\1\25\3\17\2\26\1\0\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\12\17\1\40\4\17\3\0\50\17"+
"\1\41\2\42\4\41\1\43\3\41\1\44\1\41\1\42"+
"\1\41\3\0\6\41\22\44\1\42\1\41\2\44\3\41"+
"\1\44\1\45\7\41\11\46\1\47\4\46\4\0\66\46"+
"\4\0\1\50\47\46\6\17\1\23\1\17\1\51\1\52"+
"\1\53\3\17\2\54\1\0\1\54\1\27\30\17\1\35"+
"\10\17\1\55\1\54\4\17\6\56\1\57\1\56\1\60"+
"\1\56\1\25\4\56\1\26\1\0\1\26\12\56\1\61"+
"\1\56\1\61\1\56\1\61\3\56\1\61\14\56\1\61"+
"\10\56\5\62\1\63\5\62\1\64\3\62\3\0\6\62"+
"\22\64\1\62\1\65\2\64\3\62\1\64\1\62\1\66"+
"\6\62\16\11\2\67\52\11\13\62\1\44\3\62\3\0"+
"\6\62\22\44\2\62\2\44\3\62\1\44\4\62\1\70"+
"\16\62\1\44\3\62\3\0\6\62\22\44\2\62\2\44"+
"\1\62\1\71\1\62\1\44\15\62\1\63\5\62\1\44"+
"\3\62\3\0\6\62\22\44\2\62\2\44\3\62\1\44"+
"\11\62\2\42\2\62\1\63\5\62\1\44\1\62\1\42"+
"\1\62\3\0\6\62\22\44\1\42\1\62\2\44\3\62"+
"\1\44\10\62\13\72\1\44\3\72\3\0\6\72\22\44"+
"\2\72\2\44\3\72\1\44\1\72\1\73\6\72\116\0"+
"\1\74\56\0\1\75\10\0\1\76\47\0\1\77\1\100"+
"\1\101\4\102\1\77\1\102\1\77\1\102\1\103\2\77"+
"\2\104\1\0\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\47\0\1\121\23\0\2\42\12\0\1\42"+
"\34\0\1\42\20\0\2\44\10\0\3\44\12\0\23\44"+
"\1\0\2\44\3\0\1\44\21\0\1\122\10\0\1\76"+
"\40\0\1\123\6\0\1\77\1\100\1\101\4\102\1\77"+
"\1\102\1\124\1\102\1\103\2\77\2\104\1\0\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\64\0"+
"\1\125\20\0\1\64\14\0\22\64\2\0\2\64\3\0"+
"\1\64\23\0\1\65\14\0\22\65\2\0\2\65\3\0"+
"\1\65\21\0\1\126\64\0\1\127\37\0\1\130\11\0"+
"\1\131\1\132\3\0\1\133\2\0\1\133\1\134\1\135"+
"\1\136\11\0\1\137\61\0\2\100\47\0\1\100\21\0"+
"\1\140\47\0\1\140\17\0\17\141\3\0\50\141\1\0"+
"\2\142\3\0\1\143\22\0\2\142\4\0\3\142\3\0"+
"\1\142\1\0\1\142\2\0\1\142\20\0\2\144\26\0"+
"\2\144\4\0\3\144\3\0\1\144\1\0\1\144\2\0"+
"\1\144\20\0\1\100\1\145\47\0\1\145\75\0\1\146"+
"\1\147\70\0\1\150\10\0\1\151\71\0\1\152\1\153"+
"\1\0\5\154\1\0\64\154\2\0\1\155\47\0\1\155"+
"\20\0\2\156\26\0\2\156\4\0\3\156\3\0\1\156"+
"\1\0\1\156\2\0\1\156\20\0\2\157\4\0\1\160"+
"\21\0\2\157\4\0\3\157\3\0\1\157\1\0\1\157"+
"\2\0\1\157\20\0\2\161\26\0\2\161\4\0\3\161"+
"\3\0\1\161\1\0\1\161\2\0\1\161\20\0\1\100"+
"\1\162\47\0\1\162\17\0\5\154\1\163\64\154\2\0"+
"\1\164\47\0\1\164\20\0\2\165\4\0\1\156\21\0"+
"\2\165\4\0\3\165\3\0\1\165\1\0\1\165\2\0"+
"\1\165\20\0\2\166\26\0\2\166\4\0\3\166\3\0"+
"\1\166\1\0\1\166\2\0\1\166\20\0\2\167\4\0"+
"\1\156\21\0\2\167\4\0\3\167\3\0\1\167\1\0"+
"\1\167\2\0\1\167\20\0\2\170\26\0\2\170\4\0"+
"\3\170\3\0\1\170\1\0\1\170\2\0\1\170\20\0"+
"\2\171\4\0\1\156\21\0\2\171\4\0\3\171\3\0"+
"\1\171\1\0\1\171\2\0\1\171\20\0\2\172\4\0"+
"\1\156\21\0\2\172\4\0\3\172\3\0\1\172\1\0"+
"\1\172\2\0\1\172\20\0\2\173\4\0\1\156\21\0"+
"\2\173\4\0\3\173\3\0\1\173\1\0\1\173\2\0"+
"\1\173\20\0\2\174\4\0\1\156\21\0\2\174\4\0"+
"\3\174\3\0\1\174\1\0\1\174\2\0\1\174\20\0"+
"\2\174\4\0\1\160\21\0\2\174\4\0\3\174\3\0"+
"\1\174\1\0\1\174\2\0\1\174\17\0";
"\1\25\3\17\1\26\1\27\1\30\1\31\1\32\1\33"+
"\23\17\1\34\4\17\1\35\2\17\1\36\1\17\1\36"+
"\2\17\1\36\3\17\1\37\12\17\1\40\56\17\1\41"+
"\2\42\4\41\1\43\3\41\1\44\1\41\1\42\6\41"+
"\22\44\1\42\1\41\2\44\3\41\1\44\1\45\12\41"+
"\11\46\1\47\45\46\3\0\25\46\1\50\40\46\3\0"+
"\7\46\6\17\1\23\1\17\1\51\1\52\1\53\3\17"+
"\1\26\30\17\1\34\7\17\1\54\1\17\1\54\1\17"+
"\1\55\1\54\4\17\6\56\1\57\1\56\1\60\1\56"+
"\1\25\15\56\1\61\1\56\1\61\1\56\1\61\3\56"+
"\1\61\14\56\1\61\13\56\5\62\1\63\5\62\1\64"+
"\10\62\22\64\1\62\1\65\2\64\3\62\1\64\4\62"+
"\1\66\6\62\57\11\1\67\11\11\13\62\1\44\10\62"+
"\22\44\2\62\2\44\3\62\1\44\7\62\1\70\16\62"+
"\1\44\10\62\22\44\2\62\2\44\1\62\1\71\1\62"+
"\1\44\20\62\1\63\5\62\1\44\10\62\22\44\2\62"+
"\2\44\3\62\1\44\14\62\2\42\2\62\1\63\5\62"+
"\1\44\1\62\1\42\6\62\22\44\1\42\1\62\2\44"+
"\3\62\1\44\13\62\13\72\1\44\10\72\22\44\2\72"+
"\2\44\3\72\1\44\4\72\1\73\6\72\111\0\1\74"+
"\61\0\1\75\4\0\1\76\52\0\1\77\1\100\1\101"+
"\4\102\1\77\1\102\1\77\1\102\1\103\2\77\6\102"+
"\2\104\3\105\3\106\1\107\1\110\1\107\2\111\1\103"+
"\1\112\1\103\1\113\1\114\1\115\1\102\1\116\1\117"+
"\2\77\1\120\1\103\1\77\1\120\1\77\1\120\2\77"+
"\1\120\4\77\43\0\1\121\26\0\2\42\12\0\1\42"+
"\30\0\1\42\23\0\2\44\10\0\3\44\6\0\23\44"+
"\1\0\2\44\3\0\1\44\24\0\1\122\4\0\1\76"+
"\43\0\1\123\6\0\1\77\1\100\1\101\4\102\1\77"+
"\1\102\1\124\1\102\1\103\2\77\6\102\2\104\3\105"+
"\3\106\1\107\1\110\1\107\2\111\1\103\1\112\1\103"+
"\1\113\1\114\1\115\1\102\1\116\1\117\2\77\1\120"+
"\1\103\1\77\1\120\1\77\1\120\2\77\1\120\4\77"+
"\63\0\1\125\20\0\1\64\10\0\22\64\2\0\2\64"+
"\3\0\1\64\26\0\1\65\10\0\22\65\2\0\2\65"+
"\3\0\1\65\24\0\1\126\63\0\1\127\33\0\1\130"+
"\11\0\1\131\1\132\6\0\1\133\2\0\1\133\1\134"+
"\1\135\1\136\11\0\1\137\60\0\2\100\43\0\1\100"+
"\24\0\1\140\43\0\1\140\22\0\71\141\1\0\2\142"+
"\3\0\1\143\16\0\2\142\4\0\3\142\3\0\1\142"+
"\1\0\1\142\2\0\1\142\23\0\2\144\22\0\2\144"+
"\4\0\3\144\3\0\1\144\1\0\1\144\2\0\1\144"+
"\23\0\1\100\1\145\43\0\1\145\74\0\1\146\1\147"+
"\67\0\1\150\13\0\1\151\70\0\1\152\1\153\1\0"+
"\5\154\1\0\63\154\2\0\1\155\43\0\1\155\23\0"+
"\2\156\22\0\2\156\4\0\3\156\3\0\1\156\1\0"+
"\1\156\2\0\1\156\23\0\2\157\4\0\1\160\15\0"+
"\2\157\4\0\3\157\3\0\1\157\1\0\1\157\2\0"+
"\1\157\23\0\2\161\22\0\2\161\4\0\3\161\3\0"+
"\1\161\1\0\1\161\2\0\1\161\23\0\1\100\1\162"+
"\43\0\1\162\22\0\5\154\1\163\63\154\2\0\1\164"+
"\43\0\1\164\23\0\2\165\4\0\1\156\15\0\2\165"+
"\4\0\3\165\3\0\1\165\1\0\1\165\2\0\1\165"+
"\23\0\2\166\22\0\2\166\4\0\3\166\3\0\1\166"+
"\1\0\1\166\2\0\1\166\23\0\2\167\4\0\1\156"+
"\15\0\2\167\4\0\3\167\3\0\1\167\1\0\1\167"+
"\2\0\1\167\23\0\2\170\22\0\2\170\4\0\3\170"+
"\3\0\1\170\1\0\1\170\2\0\1\170\23\0\2\171"+
"\4\0\1\156\15\0\2\171\4\0\3\171\3\0\1\171"+
"\1\0\1\171\2\0\1\171\23\0\2\172\4\0\1\156"+
"\15\0\2\172\4\0\3\172\3\0\1\172\1\0\1\172"+
"\2\0\1\172\23\0\2\173\4\0\1\156\15\0\2\173"+
"\4\0\3\173\3\0\1\173\1\0\1\173\2\0\1\173"+
"\23\0\2\174\4\0\1\156\15\0\2\174\4\0\3\174"+
"\3\0\1\174\1\0\1\174\2\0\1\174\23\0\2\174"+
"\4\0\1\160\15\0\2\174\4\0\3\174\3\0\1\174"+
"\1\0\1\174\2\0\1\174\22\0";
private static int [] zzUnpackTrans() {
int [] result = new int[3190];
int [] result = new int[3135];
int offset = 0;
offset = zzUnpackTrans(ZZ_TRANS_PACKED_0, offset, result);
return result;
@@ -389,11 +387,11 @@ class _RegExLexer implements FlexLexer {
private static final int [] ZZ_ATTRIBUTE = zzUnpackAttribute();
private static final String ZZ_ATTRIBUTE_PACKED_0 =
"\7\0\2\1\5\0\2\11\1\1\2\11\2\1\12\11"+
"\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\4\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\7\11\1\1\2\11"+
"\3\1\1\11\1\1\7\11\1\0\1\1\4\11\1\0"+
"\2\1\1\11\1\0\1\11\2\1\6\11\1\1\2\11"+
"\3\1\1\11\1\1\10\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";
@@ -658,18 +656,6 @@ class _RegExLexer implements FlexLexer {
}
/**
* Contains user EOF-code, which will be executed exactly once,
* when the end of file is reached
*/
private void zzDoEOF() {
if (!zzEOFDone) {
zzEOFDone = true;
}
}
/**
* Resumes scanning until the next regular expression is matched,
* the end of input is encountered or an I/O-Error occurs.
@@ -757,158 +743,157 @@ class _RegExLexer implements FlexLexer {
if (zzInput == YYEOF && zzStartRead == zzCurrentPos) {
zzAtEOF = true;
zzDoEOF();
return null;
}
else {
switch (zzAction < 0 ? zzAction : ZZ_ACTION[zzAction]) {
case 1:
{ handleOptions(); return RegExpTT.OPTIONS_ON;
{ yypopstate(); return RegExpTT.COMMENT;
}
case 82: break;
case 2:
{ yypopstate(); return RegExpTT.COMMENT;
{ return RegExpTT.CHARACTER;
}
case 83: break;
case 3:
{ return RegExpTT.CHARACTER;
{ return RegExpTT.DOT;
}
case 84: break;
case 4:
{ return RegExpTT.DOT;
{ capturingGroupCount++; return RegExpTT.GROUP_BEGIN;
}
case 85: break;
case 5:
{ capturingGroupCount++; return RegExpTT.GROUP_BEGIN;
{ return RegExpTT.GROUP_END;
}
case 86: break;
case 6:
{ return RegExpTT.GROUP_END;
{ if (yystate() != CLASS2) yypushstate(EMBRACED); return RegExpTT.LBRACE;
}
case 87: break;
case 7:
{ if (yystate() != CLASS2) yypushstate(EMBRACED); return RegExpTT.LBRACE;
}
case 88: break;
case 8:
{ yypushstate(CLASS2);
return RegExpTT.CLASS_BEGIN;
}
case 88: break;
case 8:
{ return StringEscapesTokenTypes.INVALID_CHARACTER_ESCAPE_TOKEN;
}
case 89: break;
case 9:
{ return StringEscapesTokenTypes.INVALID_CHARACTER_ESCAPE_TOKEN;
{ return RegExpTT.CARET;
}
case 90: break;
case 10:
{ return commentMode ? com.intellij.psi.TokenType.WHITE_SPACE : RegExpTT.CTRL_CHARACTER;
{ return RegExpTT.DOLLAR;
}
case 91: break;
case 11:
{ return RegExpTT.CARET;
{ return RegExpTT.QUEST;
}
case 92: break;
case 12:
{ return RegExpTT.DOLLAR;
{ return RegExpTT.STAR;
}
case 93: break;
case 13:
{ return RegExpTT.QUEST;
{ return RegExpTT.PLUS;
}
case 94: break;
case 14:
{ return RegExpTT.STAR;
{ return RegExpTT.UNION;
}
case 95: break;
case 15:
{ return RegExpTT.PLUS;
{ return RegExpTT.MINUS;
}
case 96: break;
case 16:
{ return RegExpTT.UNION;
{ return commentMode ? com.intellij.psi.TokenType.WHITE_SPACE : RegExpTT.CHARACTER;
}
case 97: break;
case 17:
{ return RegExpTT.MINUS;
{ return commentMode ? com.intellij.psi.TokenType.WHITE_SPACE : RegExpTT.CTRL_CHARACTER;
}
case 98: break;
case 18:
{ return commentMode ? com.intellij.psi.TokenType.WHITE_SPACE : RegExpTT.CHARACTER;
{ if (commentMode) { yypushstate(COMMENT); return RegExpTT.COMMENT; } else return RegExpTT.CHARACTER;
}
case 99: break;
case 19:
{ if (commentMode) { yypushstate(COMMENT); return RegExpTT.COMMENT; } else return RegExpTT.CHARACTER;
}
case 100: break;
case 20:
{ if (allowDanglingMetacharacters) {
yypopstate(); yypushback(1);
} else {
return RegExpTT.BAD_CHARACTER;
}
}
case 100: break;
case 20:
{ return RegExpTT.NUMBER;
}
case 101: break;
case 21:
{ return RegExpTT.NUMBER;
{ yypopstate(); return RegExpTT.RBRACE;
}
case 102: break;
case 22:
{ yypopstate(); return RegExpTT.RBRACE;
{ return RegExpTT.NAME;
}
case 103: break;
case 23:
{ return RegExpTT.NAME;
{ return RegExpTT.COMMA;
}
case 104: break;
case 24:
{ return RegExpTT.COMMA;
{ assert false : yytext();
}
case 105: break;
case 25:
{ assert false : yytext();
{ yybegin(CLASS2); return RegExpTT.CHARACTER;
}
case 106: break;
case 26:
{ yybegin(CLASS2); return RegExpTT.CHARACTER;
{ yybegin(CLASS1); return RegExpTT.CARET;
}
case 107: break;
case 27:
{ yybegin(CLASS1); return RegExpTT.CARET;
}
case 108: break;
case 28:
{ if (allowNestedCharacterClasses) {
yypushstate(CLASS2);
return RegExpTT.CLASS_BEGIN;
}
return RegExpTT.CHARACTER;
}
case 108: break;
case 28:
{ yypopstate(); return RegExpTT.CLASS_END;
}
case 109: break;
case 29:
{ yypopstate(); return RegExpTT.CLASS_END;
{ return commentMode ? com.intellij.psi.TokenType.WHITE_SPACE : RegExpTT.ESC_CHARACTER;
}
case 110: break;
case 30:
{ return commentMode ? com.intellij.psi.TokenType.WHITE_SPACE : RegExpTT.ESC_CHARACTER;
{ yypopstate(); yypushback(1);
}
case 111: break;
case 31:
{ yypopstate(); yypushback(1);
{ yypopstate(); yypushstate(EMBRACED); return RegExpTT.LBRACE;
}
case 112: break;
case 32:
{ yypopstate(); yypushstate(EMBRACED); return RegExpTT.LBRACE;
{ yypopstate(); if (allowCategoryShorthand) return RegExpTT.CATEGORY_SHORT_HAND; else yypushback(1);
}
case 113: break;
case 33:
{ yypopstate(); if (allowCategoryShorthand) return RegExpTT.CATEGORY_SHORT_HAND; else yypushback(1);
{ yybegin(YYINITIAL); return RegExpTT.BAD_CHARACTER;
}
case 114: break;
case 34:
{ yybegin(YYINITIAL); return RegExpTT.BAD_CHARACTER;
{ yybegin(YYINITIAL); return RegExpTT.GROUP_END;
}
case 115: break;
case 35:
{ yybegin(YYINITIAL); return RegExpTT.GROUP_END;
{ handleOptions(); return RegExpTT.OPTIONS_ON;
}
case 116: break;
case 36:
@@ -964,43 +949,43 @@ class _RegExLexer implements FlexLexer {
}
case 127: break;
case 47:
{ return commentMode ? RegExpTT.CHARACTER : RegExpTT.REDUNDANT_ESCAPE;
{ return RegExpTT.ESC_CTRL_CHARACTER;
}
case 128: break;
case 48:
{ return RegExpTT.ESC_CTRL_CHARACTER;
{ return yystate() != CLASS2 ? RegExpTT.BOUNDARY : RegExpTT.ESC_CHARACTER;
}
case 129: break;
case 49:
{ return yystate() != CLASS2 ? RegExpTT.BOUNDARY : RegExpTT.ESC_CHARACTER;
{ return RegExpTT.CHAR_CLASS;
}
case 130: break;
case 50:
{ return RegExpTT.CHAR_CLASS;
{ if (xmlSchemaMode) return RegExpTT.CHAR_CLASS; else return StringEscapesTokenTypes.INVALID_CHARACTER_ESCAPE_TOKEN;
}
case 131: break;
case 51:
{ if (xmlSchemaMode) return RegExpTT.CHAR_CLASS; else return StringEscapesTokenTypes.INVALID_CHARACTER_ESCAPE_TOKEN;
{ yypushstate(PROP); return RegExpTT.PROPERTY;
}
case 132: break;
case 52:
{ yypushstate(PROP); return RegExpTT.PROPERTY;
{ yypushstate(QUOTED); return RegExpTT.QUOTE_BEGIN;
}
case 133: break;
case 53:
{ yypushstate(QUOTED); return RegExpTT.QUOTE_BEGIN;
{ return RegExpTT.BAD_HEX_VALUE;
}
case 134: break;
case 54:
{ return RegExpTT.BAD_HEX_VALUE;
{ return StringEscapesTokenTypes.INVALID_UNICODE_ESCAPE_TOKEN;
}
case 135: break;
case 55:
{ return StringEscapesTokenTypes.INVALID_UNICODE_ESCAPE_TOKEN;
{ return (allowHexDigitClass || allowHorizontalWhitespaceClass ? RegExpTT.CHAR_CLASS : StringEscapesTokenTypes.INVALID_CHARACTER_ESCAPE_TOKEN);
}
case 136: break;
case 56:
{ return (allowHexDigitClass || allowHorizontalWhitespaceClass ? RegExpTT.CHAR_CLASS : StringEscapesTokenTypes.INVALID_CHARACTER_ESCAPE_TOKEN);
{ return commentMode ? RegExpTT.CHARACTER : RegExpTT.REDUNDANT_ESCAPE;
}
case 137: break;
case 57:
@@ -16,8 +16,6 @@ import java.util.EnumSet;
%unicode
%function advance
%type IElementType
%eof{ return;
%eof}
%{
// This adds support for nested states. I'm no JFlex pro, so maybe this is overkill, but it works quite well.
@@ -100,7 +98,7 @@ RBRACKET="]"
ESCAPE="\\"
NAME=[:letter:]([:letter:]|_|[:digit:])*
ANY=.|\n
ANY=[^]
META={ESCAPE} | {DOT} |
"^" | "$" | "?" | "*" | "+" | "|" |
@@ -304,7 +302,7 @@ HEX_CHAR=[0-9a-fA-F]
}
<OPTIONS> {
[:letter:]* { handleOptions(); return RegExpTT.OPTIONS_ON; }
[:letter:]+ { handleOptions(); return RegExpTT.OPTIONS_ON; }
("-" [:letter:]*) { handleOptions(); return RegExpTT.OPTIONS_OFF; }
":" { yybegin(YYINITIAL); return RegExpTT.COLON; }
@@ -34,6 +34,15 @@ public class RegExpLexerTest extends LexerTestCase {
"CLASS_END (']')", lexer);
}
public void testQE() {
final RegExpLexer lexer = new RegExpLexer(EnumSet.noneOf(RegExpCapability.class));
doTest("\\Q\r\n\\E", "QUOTE_BEGIN ('\\Q')\n" +
"CHARACTER ('\n" +
"')\n" +
"CHARACTER ('\\n')\n" +
"QUOTE_END ('\\E')", lexer);
}
public void testIntersection() {
final RegExpLexer lexer = new RegExpLexer(EnumSet.of(RegExpCapability.NESTED_CHARACTER_CLASSES));
doTest("[a&&]", "CLASS_BEGIN ('[')\n" +
@@ -46,9 +46,11 @@ public abstract class DebuggerManager implements ProjectComponent {
public abstract String getVMClassQualifiedName(PsiClass aClass);
/**
* @deprecated use PositionManagerFactory extension point instead
* @deprecated use {@link PositionManagerFactory} extension point instead
*/
@Deprecated
public abstract void registerPositionManagerFactory(Function<DebugProcess, PositionManager> factory);
@Deprecated
public abstract void unregisterPositionManagerFactory(Function<DebugProcess, PositionManager> factory);
}
@@ -484,7 +484,7 @@ public class EnterHandler extends BaseEnterHandler {
private int adjustLineIndent(CharSequence docChars) {
int indentStart = CharArrayUtil.shiftBackwardUntil(docChars, myOffset - 1, "\n") + 1;
int indentEnd = CharArrayUtil.shiftForward(docChars, indentStart, " \t");
String newIndent = CodeStyleFacade.getInstance(getProject()).getLineIndent(myDocument, myOffset);
String newIndent = CodeStyleFacade.getInstance(getProject()).getLineIndent(myEditor, myDocument, myOffset);
if (newIndent == null) return myOffset;
int delta = newIndent.length() - (indentEnd - indentStart);
myDocument.replaceString(indentStart, indentEnd, newIndent);
@@ -16,9 +16,7 @@
package com.intellij.find.actions;
import com.intellij.openapi.editor.markup.TextAttributes;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.Comparing;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.psi.PsiFile;
import com.intellij.psi.PsiManager;
@@ -27,8 +25,6 @@ import com.intellij.ui.FileColorManager;
import com.intellij.ui.SimpleColoredComponent;
import com.intellij.ui.SimpleTextAttributes;
import com.intellij.ui.speedSearch.SpeedSearchUtil;
import com.intellij.usageView.UsageTreeColors;
import com.intellij.usageView.UsageTreeColorsScheme;
import com.intellij.usages.TextChunk;
import com.intellij.usages.Usage;
import com.intellij.usages.UsageGroup;
@@ -42,7 +38,6 @@ import com.intellij.util.ObjectUtils;
import com.intellij.util.ui.EmptyIcon;
import com.intellij.util.ui.UIUtil;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import javax.swing.*;
import javax.swing.table.TableCellRenderer;
@@ -109,11 +104,8 @@ class ShowUsagesTableCellRenderer implements TableCellRenderer {
panel.setBackground(panelBackground);
panel.setForeground(panelForeground);
VirtualFile file = getFile(usage);
VirtualFile prevFile = findPrevFile(list, row, column);
if (column == 0) {
appendGroupText(list, (GroupNode)usageNode.getParent(), panel, fileBgColor, isSelected, Comparing.equal(file, prevFile));
appendGroupText(list, (GroupNode)usageNode.getParent(), panel, fileBgColor, isSelected);
return panel;
}
else if (usage != ShowUsagesAction.MORE_USAGES_SEPARATOR && usage != ShowUsagesAction.USAGES_OUTSIDE_SCOPE_SEPARATOR) {
@@ -144,14 +136,6 @@ class ShowUsagesTableCellRenderer implements TableCellRenderer {
return panel;
}
@Nullable
private static VirtualFile findPrevFile(@NotNull JTable table, int row, int column) {
if (row <= 0) return null;
Object prev = table.getValueAt(row - 1, column);
UsageNode usageNode = prev instanceof UsageNode ? (UsageNode)prev : null;
return getFile(usageNode == null ? null : usageNode.getUsage());
}
@NotNull
public static SimpleTextAttributes getAttributes(boolean isSelected, Color fileBgColor, Color bg, Color fg, TextChunk chunk) {
SimpleTextAttributes background = chunk.getSimpleAttributesIgnoreBackground();
@@ -211,8 +195,7 @@ class ShowUsagesTableCellRenderer implements TableCellRenderer {
return component;
}
@NotNull
private static SimpleTextAttributes deriveAttributesWithColor(@NotNull SimpleTextAttributes attributes, @Nullable Color fileBgColor) {
private static SimpleTextAttributes deriveAttributesWithColor(SimpleTextAttributes attributes, Color fileBgColor) {
if (fileBgColor != null) {
attributes = attributes.derive(-1,null, fileBgColor,null);
}
@@ -225,7 +208,7 @@ class ShowUsagesTableCellRenderer implements TableCellRenderer {
fileBgColor = UIUtil.getListSelectionBackground();
}
else {
VirtualFile virtualFile = getFile(usage);
VirtualFile virtualFile = usage instanceof UsageInFile ? ((UsageInFile)usage).getFile() : null;
if (virtualFile != null) {
Project project = myUsageView.getProject();
PsiFile psiFile = PsiManager.getInstance(project).findFile(virtualFile);
@@ -238,28 +221,16 @@ class ShowUsagesTableCellRenderer implements TableCellRenderer {
return fileBgColor;
}
private static VirtualFile getFile(@Nullable Usage usage) {
return usage instanceof UsageInFile ? ((UsageInFile)usage).getFile() : null;
}
private void appendGroupText(@NotNull JTable table,
@Nullable GroupNode node,
@NotNull JPanel panel,
@Nullable Color fileBgColor,
boolean isSelected,
boolean sameFile) {
private void appendGroupText(JTable table, final GroupNode node, JPanel panel, Color fileBgColor, boolean isSelected) {
UsageGroup group = node == null ? null : node.getGroup();
if (group == null) return;
GroupNode parentGroup = (GroupNode)node.getParent();
appendGroupText(table, parentGroup, panel, fileBgColor, isSelected, sameFile);
appendGroupText(table, parentGroup, panel, fileBgColor, isSelected);
if (node.canNavigateToSource()) {
SimpleColoredComponent renderer = new SimpleColoredComponent();
renderer.setIcon(group.getIcon(false));
TextAttributes attributes = UsageTreeColorsScheme.getInstance().getScheme().getAttributes(UsageTreeColors.USAGE_LOCATION);
SimpleTextAttributes attr = sameFile && !isSelected
? SimpleTextAttributes.fromTextAttributes(attributes)
: SimpleTextAttributes.REGULAR_ATTRIBUTES;
renderer.append(group.getText(myUsageView), deriveAttributesWithColor(attr, fileBgColor));
SimpleTextAttributes attributes = deriveAttributesWithColor(SimpleTextAttributes.REGULAR_ATTRIBUTES, fileBgColor);
renderer.append(group.getText(myUsageView), attributes);
renderer.setBorder(null);
SpeedSearchUtil.applySpeedSearchHighlighting(table, renderer, false, isSelected);
panel.add(renderer);
@@ -36,7 +36,8 @@ public final class NextOccurrenceAction extends PrevNextOccurrenceAction {
@Override
public void actionPerformed(AnActionEvent e) {
e.getRequiredData(SearchSession.KEY).searchForward();
SearchSession session = e.getRequiredData(SearchSession.KEY);
if (session.hasMatches()) session.searchForward();
}
@NotNull
@@ -35,7 +35,8 @@ public abstract class PrevNextOccurrenceAction extends DumbAwareAction implement
@Override
public final void update(AnActionEvent e) {
SearchSession search = e.getData(SearchSession.KEY);
e.getPresentation().setEnabled(search != null && search.hasMatches());
boolean invokedByShortcut = !ActionPlaces.isToolbarPlace(e.getPlace());
e.getPresentation().setEnabled(search != null && (invokedByShortcut || search.hasMatches()));
}
@Nullable
@@ -39,7 +39,8 @@ public final class PrevOccurrenceAction extends PrevNextOccurrenceAction {
@Override
public void actionPerformed(AnActionEvent e) {
e.getRequiredData(SearchSession.KEY).searchBackward();
SearchSession session = e.getRequiredData(SearchSession.KEY);
if (session.hasMatches()) session.searchBackward();
}
@NotNull
@@ -22,10 +22,12 @@ package com.intellij.psi.impl.source.codeStyle;
import com.intellij.codeStyle.CodeStyleFacade;
import com.intellij.lang.Language;
import com.intellij.openapi.editor.Document;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.fileTypes.FileType;
import com.intellij.openapi.options.Configurable;
import com.intellij.openapi.project.Project;
import com.intellij.psi.PsiDocumentManager;
import com.intellij.psi.PsiFile;
import com.intellij.psi.codeStyle.CodeStyleManager;
import com.intellij.psi.codeStyle.CodeStyleSettingsManager;
import org.jetbrains.annotations.NotNull;
@@ -49,12 +51,22 @@ public class CodeStyleFacadeImpl extends CodeStyleFacade {
@Override
@Nullable
@Deprecated
public String getLineIndent(@NotNull final Document document, int offset) {
if (myProject == null) return null;
PsiDocumentManager.getInstance(myProject).commitDocument(document);
return CodeStyleManager.getInstance(myProject).getLineIndent(document, offset);
}
@Override
public String getLineIndent(@NotNull Editor editor, @NotNull Document document, int offset) {
if (myProject == null) return null;
PsiDocumentManager documentManager = PsiDocumentManager.getInstance(myProject);
PsiFile file = documentManager.getPsiFile(document);
LineIndentProvider lineIndentProvider = LineIndentProviderEP.findLineIndentProvider(file);
return lineIndentProvider != null ? lineIndentProvider.getLineIndent(myProject, editor, document, offset) : null;
}
@Override
public String getLineSeparator() {
return CodeStyleSettingsManager.getSettings(myProject).getLineSeparator();
@@ -0,0 +1,42 @@
/*
* Copyright 2000-2016 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 com.intellij.psi.impl.source.codeStyle;
import com.intellij.openapi.editor.Document;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.project.Project;
import com.intellij.psi.PsiDocumentManager;
import com.intellij.psi.PsiFile;
import com.intellij.psi.codeStyle.CodeStyleManager;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
/**
* Formatter-based line indent provider which calculates indent using formatting model.
*/
public class FormatterBasedLineIndentProvider implements LineIndentProvider {
@Nullable
@Override
public String getLineIndent(@NotNull Project project, @NotNull Editor editor, @NotNull Document document, int offset) {
PsiDocumentManager.getInstance(project).commitDocument(document);
return CodeStyleManager.getInstance(project).getLineIndent(document, offset);
}
@Override
public boolean isSuitableFor(@Nullable PsiFile file) {
return true;
}
}
@@ -0,0 +1,91 @@
/*
* Copyright 2000-2016 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 com.intellij.psi.impl.source.codeStyle;
import com.intellij.formatting.Indent;
import com.intellij.lang.Language;
import com.intellij.openapi.editor.Document;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.editor.ex.EditorEx;
import com.intellij.openapi.editor.highlighter.EditorHighlighter;
import com.intellij.openapi.editor.highlighter.HighlighterIterator;
import com.intellij.openapi.project.Project;
import com.intellij.psi.PsiFile;
import com.intellij.psi.tree.IElementType;
import com.intellij.util.text.CharArrayUtil;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
/**
* A base class Java-like language line indent provider. If JavaLikeLangLineIndentProvider is unable to calculate
* the indentation, it forwards the request to FormatterBasedLineIndentProvider.
*/
public abstract class JavaLikeLangLineIndentProvider extends FormatterBasedLineIndentProvider {
@Nullable
@Override
public String getLineIndent(@NotNull Project project, @NotNull Editor editor, @NotNull Document document, int offset) {
Indent.Type indent = getIndent(editor, document, offset);
if (indent == Indent.Type.NONE) return null;
return super.getLineIndent(project, editor, document, offset);
}
@Override
public final boolean isSuitableFor(@Nullable PsiFile file) {
if (file != null) {
return isSuitableForLanguage(file.getLanguage());
}
return false;
}
protected abstract boolean isSuitableForLanguage(@NotNull Language language);
@Nullable
protected Indent.Type getIndent(@NotNull Editor editor, @NotNull Document document, int offset) {
CharSequence docChars = document.getCharsSequence();
EditorHighlighter highlighter = ((EditorEx)editor).getHighlighter();
HighlighterIterator iterator = highlighter.createIterator(offset - 1);
if (isWhitespace(iterator.getTokenType())) {
if (containsLineBreaks(iterator, docChars)) {
iterator.retreat();
if (!iterator.atEnd()) {
if (isEndOfCodeBlock(iterator)) return Indent.Type.NONE;
}
}
}
return null;
}
protected abstract boolean isWhitespace(@NotNull IElementType tokenType);
private static boolean containsLineBreaks(@NotNull HighlighterIterator iterator, @NotNull CharSequence chars) {
return CharArrayUtil.containLineBreaks(chars, iterator.getStart(), iterator.getEnd());
}
protected boolean isEndOfCodeBlock(@NotNull HighlighterIterator iterator) {
if (isSemicolon(iterator.getTokenType())) iterator.retreat();
if (!iterator.atEnd()) {
if (isWhitespace(iterator.getTokenType())) iterator.retreat();
if (!iterator.atEnd()) {
return isBlockClosingBrace(iterator.getTokenType());
}
}
return false;
}
protected abstract boolean isSemicolon(@NotNull IElementType tokenType);
protected abstract boolean isBlockClosingBrace(@NotNull IElementType tokenType);
}
@@ -0,0 +1,45 @@
/*
* Copyright 2000-2016 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 com.intellij.psi.impl.source.codeStyle;
import com.intellij.openapi.editor.Document;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.project.Project;
import com.intellij.psi.PsiFile;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
/**
* An interface for indentation calculation. Used in editor actions like Enter handling.
*/
public interface LineIndentProvider {
/**
* Calculates the indent that should be used for the line at specified offset in the specified
* document.
*
* @param project The current project.
* @param editor The current editor.
* @param document The document for which the indent should be calculated.
* @param offset The caret offset in the editor.
* @return The indent string (possibly consisting of tabs and/or white spaces), or null if
* LineIndentProvider can't calculate the indent (in this case no indent adjustment will be made).
*/
@Nullable
String getLineIndent(@NotNull Project project, @NotNull Editor editor, @NotNull Document document, int offset);
boolean isSuitableFor(@Nullable PsiFile file);
}
@@ -0,0 +1,38 @@
/*
* Copyright 2000-2016 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 com.intellij.psi.impl.source.codeStyle;
import com.intellij.openapi.extensions.ExtensionPointName;
import com.intellij.psi.PsiFile;
import org.jetbrains.annotations.Nullable;
/**
* Line indent provider extension point
*/
public class LineIndentProviderEP {
public final static ExtensionPointName<LineIndentProvider> EP_NAME = ExtensionPointName.create("com.intellij.lineIndentProvider");
@Nullable
public static LineIndentProvider findLineIndentProvider(@Nullable PsiFile psiFile) {
LineIndentProvider foundProvider = null;
for (LineIndentProvider provider : EP_NAME.getExtensions()) {
if (foundProvider == null || provider.isSuitableFor(psiFile) && foundProvider.getClass().isInstance(provider)) {
foundProvider = provider;
}
}
return foundProvider;
}
}
@@ -22,6 +22,7 @@ package com.intellij.codeStyle;
import com.intellij.lang.Language;
import com.intellij.openapi.components.ServiceManager;
import com.intellij.openapi.editor.Document;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.fileTypes.FileType;
import com.intellij.openapi.options.Configurable;
import com.intellij.openapi.project.Project;
@@ -46,9 +47,26 @@ public abstract class CodeStyleFacade {
* @param offset the caret offset in the editor.
* @return the indent string (containing of tabs and/or white spaces), or null if it
* was not possible to calculate the indent.
* @deprecated Use {@link #getLineIndent(Editor, Document, int)} instead.
*/
@Nullable
@Deprecated
public abstract String getLineIndent(@NotNull Document document, int offset);
/**
* Calculates the indent that should be used for the line at specified offset in the specified
* document.
*
* @param editor the editor for which the indent must be returned.
* @param document the document for which the indent should be calculated.
* @param offset the caret offset in the editor.
* @return the indent string (containing of tabs and/or white spaces), or null if it
* was not possible to calculate the indent.
*/
public String getLineIndent(@NotNull Editor editor, @NotNull Document document, int offset) {
//noinspection deprecation
return getLineIndent(document, offset);
}
public abstract int getIndentSize(FileType fileType);
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2014 JetBrains s.r.o.
* Copyright 2000-2016 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,6 +17,7 @@ package com.intellij.ui.components.labels;
import com.intellij.ide.DataManager;
import com.intellij.openapi.actionSystem.*;
import com.intellij.openapi.actionSystem.ex.ActionUtil;
import com.intellij.util.ui.EmptyIcon;
import com.intellij.util.ui.UIUtil;
import org.jetbrains.annotations.NonNls;
@@ -60,7 +61,7 @@ public class ActionLink extends LinkLabel implements DataProvider {
presentation,
ActionManager.getInstance(),
0);
myAction.update(event);
ActionUtil.performDumbAwareUpdate(myAction, event, true);
if (event.getPresentation().isEnabled() && event.getPresentation().isVisible()) {
myAction.actionPerformed(event);
if (onDone != null) {
@@ -116,6 +116,10 @@ public class CalendarView extends JPanel {
mySeconds.setValue(new Integer(myCalendar.get(Calendar.SECOND)));
}
public JComponent getDaysCombo() {
return myDays;
}
private void addTimeFields() {
JPanel timePanel = new JPanel(new FlowLayout(FlowLayout.RIGHT));
timePanel.add(myHours);
@@ -289,6 +289,7 @@
<extensionPoint name="preFormatProcessor" interface="com.intellij.psi.impl.source.codeStyle.PreFormatProcessor"/>
<extensionPoint name="postFormatProcessor" interface="com.intellij.psi.impl.source.codeStyle.PostFormatProcessor"/>
<extensionPoint name="disabledIndentRangesProvider" interface="com.intellij.psi.impl.source.DisabledIndentRangesProvider"/>
<extensionPoint name="lineIndentProvider" interface="com.intellij.psi.impl.source.codeStyle.LineIndentProvider"/>
<extensionPoint name="declarationRangeHandler" beanClass="com.intellij.util.MixinEP">
<with attribute="implementationClass" implements="com.intellij.codeInsight.hint.DeclarationRangeHandler"/>
@@ -953,6 +953,7 @@
<nonProjectFileWritingAccessExtension implementation="com.intellij.ide.actions.EditCustomPropertiesAction$AccessExtension"/>
<nonProjectFileWritingAccessExtension implementation="com.intellij.ide.actions.EditCustomVmOptionsAction$AccessExtension"/>
<lineIndentProvider implementation="com.intellij.psi.impl.source.codeStyle.FormatterBasedLineIndentProvider"/>
</extensions>
</idea-plugin>
File diff suppressed because it is too large Load Diff
@@ -15,10 +15,6 @@ import com.jetbrains.rest.RestTokenTypes;
%function advance
%type IElementType
%eof{ return;
%eof}
CRLF= \n|\r|\r\n
SPACE=[\ \t]
@@ -29,7 +25,7 @@ USUAL_TYPES="attention"|"caution"|"danger"|"error"|"hint"|"important"|"note"|"ti
HIGHLIGHT_TYPES= "highlight" | "sourcecode" | "code-block"
ANY_CHAR = [^\t`\ \n]
NOT_BACKQUOTE = [^`]
ANY= .|\n
ANY=[^]
%state IN_EXPLISIT_MARKUP
%state IN_COMMENT
@@ -39407,6 +39407,7 @@ beys
bezel
bezel's
bezels
bezier
bf
bhaji
biannual