diff --git a/src/main/gen/de/platon42/intellij/plugins/m68k/lexer/_M68kLexer.java b/src/main/gen/de/platon42/intellij/plugins/m68k/lexer/_M68kLexer.java index 3913bf2..eb1a8ca 100644 --- a/src/main/gen/de/platon42/intellij/plugins/m68k/lexer/_M68kLexer.java +++ b/src/main/gen/de/platon42/intellij/plugins/m68k/lexer/_M68kLexer.java @@ -192,25 +192,26 @@ public class _M68kLexer implements FlexLexer { private static final String ZZ_ACTION_PACKED_0 = "\13\0\1\1\2\2\1\3\1\4\1\1\1\5\2\6" + "\1\2\1\7\1\10\1\1\1\11\2\12\1\7\1\10" + - "\1\13\1\14\1\15\1\1\1\16\1\17\5\16\6\1" + - "\1\20\1\21\1\22\1\23\1\24\1\25\1\26\1\27" + - "\1\30\1\31\2\16\1\32\1\33\1\32\1\34\1\35" + + "\1\13\1\14\1\15\1\1\1\16\1\17\1\20\5\17" + + "\6\1\1\21\1\22\1\23\1\24\1\25\1\26\1\27" + + "\1\30\1\31\1\32\2\17\1\33\1\34\1\33\1\35" + "\1\36\1\37\1\40\1\41\1\42\1\43\1\44\1\45" + - "\1\46\1\47\1\50\1\43\1\51\2\1\1\52\1\53" + - "\1\54\6\1\1\55\1\56\1\57\1\60\1\61\1\62" + + "\1\46\1\47\1\50\1\51\1\44\1\52\2\1\1\53" + + "\1\54\1\55\6\1\1\56\1\57\1\60\1\61\1\62" + "\1\63\1\64\1\65\1\66\1\67\1\70\1\71\1\72" + - "\1\73\1\66\1\74\1\75\1\12\4\75\1\0\1\4" + - "\1\76\2\77\1\4\3\0\1\100\1\101\1\102\1\103" + - "\1\104\1\105\1\106\1\16\1\107\1\110\1\111\2\0" + - "\1\112\4\0\2\16\1\33\1\100\1\101\1\102\1\113" + - "\1\114\1\115\1\116\1\117\1\120\1\121\2\0\1\122" + - "\1\123\1\124\2\0\1\125\4\0\1\57\1\126\1\127" + - "\1\130\1\131\1\132\1\133\1\134\1\0\1\75\1\0" + - "\1\75\1\0\1\75\1\0\1\75\2\0\1\4\1\77" + - "\1\7\1\135\1\136\1\137\1\140\1\0\1\75\6\0"; + "\1\73\1\74\1\67\1\75\1\76\1\12\4\76\1\5" + + "\1\12\1\0\1\4\1\77\2\100\1\101\3\0\1\102" + + "\1\103\1\104\1\105\1\106\1\107\1\110\1\17\1\111" + + "\1\112\1\113\2\0\1\114\4\0\2\17\1\34\1\102" + + "\1\103\1\104\1\115\1\116\1\117\1\120\1\121\1\122" + + "\1\123\2\0\1\124\1\125\1\126\2\0\1\127\4\0" + + "\1\60\1\130\1\131\1\132\1\133\1\134\1\135\1\136" + + "\1\0\1\76\1\0\1\76\1\0\1\76\1\0\1\76" + + "\2\0\1\4\1\100\1\101\1\7\1\137\1\140\1\141" + + "\1\142\1\143\1\0\1\76\6\0"; private static int[] zzUnpackAction() { - int[] result = new int[195]; + int[] result = new int[200]; int offset = 0; offset = zzUnpackAction(ZZ_ACTION_PACKED_0, offset, result); return result; @@ -240,29 +241,29 @@ public class _M68kLexer implements FlexLexer { "\0\u0366\0\u03a0\0\u027e\0\u03da\0\u0414\0\u044e\0\u0488\0\u04c2" + "\0\u04fc\0\u027e\0\u0536\0\u0570\0\u05aa\0\u027e\0\u05e4\0\u061e" + "\0\u0658\0\u0692\0\u06cc\0\u0706\0\u0740\0\u077a\0\u07b4\0\u07ee" + - "\0\u0828\0\u0862\0\u089c\0\u08d6\0\u0910\0\u094a\0\u027e\0\u027e" + + "\0\u0828\0\u0862\0\u089c\0\u08d6\0\u0910\0\u094a\0\u0984\0\u027e" + "\0\u027e\0\u027e\0\u027e\0\u027e\0\u027e\0\u027e\0\u027e\0\u027e" + - "\0\u0984\0\u09be\0\u09f8\0\u0a32\0\u0a6c\0\u027e\0\u0aa6\0\u0ae0" + - "\0\u027e\0\u027e\0\u027e\0\u027e\0\u0b1a\0\u027e\0\u027e\0\u027e" + - "\0\u027e\0\u0b54\0\u0b8e\0\u0bc8\0\u0c02\0\u0c3c\0\u027e\0\u0c76" + - "\0\u0cb0\0\u0cea\0\u0d24\0\u0d5e\0\u0d98\0\u0dd2\0\u0e0c\0\u027e" + - "\0\u027e\0\u0e46\0\u027e\0\u0e80\0\u0eba\0\u027e\0\u027e\0\u027e" + - "\0\u0ef4\0\u027e\0\u027e\0\u027e\0\u027e\0\u0f2e\0\u0f68\0\u0fa2" + - "\0\u0fdc\0\u0fdc\0\u1016\0\u1050\0\u108a\0\u10c4\0\u10fe\0\u1138" + - "\0\u1172\0\u11ac\0\u11e6\0\u1220\0\u125a\0\u11ac\0\u1294\0\u027e" + - "\0\u027e\0\u027e\0\u07b4\0\u07b4\0\u07b4\0\u07b4\0\u12ce\0\u0828" + - "\0\u0862\0\u089c\0\u08d6\0\u1308\0\u027e\0\u0910\0\u1342\0\u094a" + - "\0\u137c\0\u13b6\0\u13f0\0\u027e\0\u09f8\0\u09f8\0\u09f8\0\u027e" + - "\0\u027e\0\u027e\0\u027e\0\u027e\0\u027e\0\u027e\0\u142a\0\u1464" + - "\0\u0cea\0\u0d24\0\u0d5e\0\u0d98\0\u149e\0\u027e\0\u0dd2\0\u14d8" + - "\0\u0e0c\0\u1512\0\u027e\0\u027e\0\u027e\0\u027e\0\u027e\0\u027e" + - "\0\u027e\0\u027e\0\u154c\0\u1586\0\u15c0\0\u15fa\0\u1634\0\u166e" + - "\0\u16a8\0\u16e2\0\u171c\0\u1756\0\u027e\0\u027e\0\u027e\0\u07b4" + - "\0\u07b4\0\u07b4\0\u027e\0\u1790\0\u027e\0\u17ca\0\u1804\0\u183e" + - "\0\u1878\0\u18b2\0\u1172"; + "\0\u027e\0\u09be\0\u09f8\0\u0a32\0\u0a6c\0\u0aa6\0\u027e\0\u0ae0" + + "\0\u0b1a\0\u027e\0\u027e\0\u027e\0\u027e\0\u0b54\0\u027e\0\u027e" + + "\0\u027e\0\u027e\0\u0b8e\0\u0bc8\0\u0c02\0\u0c3c\0\u0c76\0\u027e" + + "\0\u0cb0\0\u0cea\0\u0d24\0\u0d5e\0\u0d98\0\u0dd2\0\u0e0c\0\u0e46" + + "\0\u027e\0\u027e\0\u0e80\0\u027e\0\u0eba\0\u0ef4\0\u027e\0\u027e" + + "\0\u027e\0\u0f2e\0\u027e\0\u027e\0\u027e\0\u027e\0\u0f68\0\u0fa2" + + "\0\u0fdc\0\u1016\0\u1016\0\u1050\0\u108a\0\u10c4\0\u10fe\0\u1138" + + "\0\u1138\0\u1172\0\u11ac\0\u11e6\0\u1220\0\u125a\0\u1294\0\u12ce" + + "\0\u1308\0\u1342\0\u027e\0\u027e\0\u027e\0\u07ee\0\u07ee\0\u07ee" + + "\0\u07ee\0\u137c\0\u0862\0\u089c\0\u08d6\0\u0910\0\u13b6\0\u027e" + + "\0\u094a\0\u13f0\0\u0984\0\u142a\0\u1464\0\u149e\0\u027e\0\u0a32" + + "\0\u0a32\0\u0a32\0\u027e\0\u027e\0\u027e\0\u027e\0\u027e\0\u027e" + + "\0\u027e\0\u14d8\0\u1512\0\u0d24\0\u0d5e\0\u0d98\0\u0dd2\0\u154c" + + "\0\u027e\0\u0e0c\0\u1586\0\u0e46\0\u15c0\0\u027e\0\u027e\0\u027e" + + "\0\u027e\0\u027e\0\u027e\0\u027e\0\u027e\0\u15fa\0\u1634\0\u166e" + + "\0\u16a8\0\u16e2\0\u171c\0\u1756\0\u1790\0\u17ca\0\u1804\0\u027e" + + "\0\u027e\0\u027e\0\u027e\0\u027e\0\u07ee\0\u07ee\0\u07ee\0\u027e" + + "\0\u183e\0\u027e\0\u1878\0\u18b2\0\u18ec\0\u1926\0\u1960\0\u11e6"; private static int[] zzUnpackRowMap() { - int[] result = new int[195]; + int[] result = new int[200]; int offset = 0; offset = zzUnpackRowMap(ZZ_ROWMAP_PACKED_0, offset, result); return result; @@ -294,113 +295,114 @@ public class _M68kLexer implements FlexLexer { "\2\32\1\33\1\25\1\34\1\14\4\34\1\35\1\14" + "\1\36\4\34\4\14\4\34\2\14\3\34\1\14\1\34" + "\7\14\1\37\14\14\5\34\1\14\2\32\1\33\1\40" + - "\16\14\1\41\24\14\1\37\22\14\2\32\1\33\1\25" + - "\1\42\1\43\1\44\1\45\1\46\2\47\2\14\2\47" + - "\1\50\1\47\1\14\1\47\1\51\1\14\1\44\3\47" + - "\1\52\1\43\1\42\1\46\1\47\1\43\1\47\1\53" + - "\1\54\1\55\1\56\2\14\1\57\1\37\1\60\1\61" + - "\1\62\1\63\1\64\1\65\1\66\1\67\1\70\3\14" + - "\2\71\1\47\1\72\1\47\1\14\2\32\1\33\1\25" + - "\1\73\1\14\5\73\2\14\4\73\1\74\1\75\2\14" + - "\4\73\1\76\1\14\3\73\1\14\1\73\4\14\1\77" + - "\1\100\1\101\1\37\1\14\1\102\1\103\1\104\1\105" + - "\1\106\1\107\1\110\1\111\1\112\1\113\1\114\5\73" + - "\1\14\2\32\1\33\1\25\2\14\1\115\5\14\1\36" + - "\1\116\3\14\1\117\3\14\1\115\11\14\1\116\7\14" + - "\1\37\22\14\2\32\1\33\1\25\1\120\1\121\5\120" + - "\2\14\4\120\1\14\1\120\1\122\1\14\4\120\1\123" + - "\1\121\3\120\1\121\1\120\1\124\1\125\1\126\1\127" + - "\2\14\1\57\1\37\1\14\1\61\1\62\1\130\1\64" + - "\1\65\1\66\1\67\1\131\3\14\5\120\1\14\2\32" + - "\1\33\1\25\15\14\1\132\7\14\1\133\12\14\1\134" + - "\1\135\1\136\1\37\1\14\1\137\1\140\1\104\1\141" + - "\1\142\1\143\1\144\1\145\1\146\1\147\1\150\5\14" + - "\1\151\1\152\1\32\1\33\1\25\35\151\1\153\1\154" + - "\1\155\1\156\1\151\1\57\1\37\21\151\1\14\2\32" + - "\1\33\66\14\74\0\1\15\73\0\1\17\71\0\1\157" + - "\10\20\1\160\4\20\1\161\1\0\1\162\1\0\4\20" + - "\1\0\6\20\24\0\5\20\5\0\1\163\1\0\5\163" + - "\2\0\4\163\4\0\4\163\2\0\3\163\1\0\1\163" + - "\24\0\5\163\1\22\3\0\66\22\2\0\1\23\73\0" + - "\1\25\72\0\1\26\1\27\4\26\2\27\1\164\4\26" + - "\1\0\1\165\1\166\1\0\4\26\1\0\1\27\3\26" + - "\1\27\1\26\24\0\5\26\5\0\10\27\1\164\4\27" + - "\2\0\1\166\1\0\4\27\1\0\6\27\24\0\5\27" + - "\5\0\1\167\1\0\5\167\2\0\4\167\4\0\4\167" + - "\2\0\3\167\1\0\1\167\24\0\5\167\1\31\3\0" + - "\66\31\2\0\1\32\74\0\1\34\1\35\4\34\2\35" + - "\1\0\4\34\1\0\1\165\2\0\4\34\1\0\1\35" + - "\3\34\1\35\1\34\24\0\5\34\5\0\10\35\1\0" + - "\4\35\4\0\4\35\1\0\6\35\24\0\5\35\1\37" + - "\3\0\66\37\4\0\1\40\113\0\2\170\1\171\1\172" + - "\45\0\1\47\1\173\6\47\1\0\4\47\2\0\1\47" + - "\1\0\4\47\1\0\1\173\5\47\24\0\5\47\6\0" + - "\1\43\24\0\1\43\3\0\1\43\37\0\3\47\1\173" + - "\4\47\1\0\4\47\2\0\1\47\1\0\4\47\1\0" + - "\6\47\24\0\2\47\1\174\2\47\5\0\10\47\1\0" + - "\4\47\2\0\1\47\1\0\4\47\1\0\6\47\24\0" + - "\2\175\3\47\5\0\1\47\1\176\6\47\1\0\4\47" + - "\2\0\1\47\1\0\4\47\1\0\1\176\5\47\24\0" + - "\5\47\5\0\10\47\1\0\4\47\2\0\1\47\1\0" + - "\4\47\1\0\6\47\24\0\5\47\5\0\2\47\1\177" + - "\5\47\1\0\4\47\2\0\1\47\1\0\1\177\3\47" + - "\1\0\6\47\24\0\5\47\6\0\1\200\20\0\1\200" + - "\3\0\6\200\25\0\1\200\36\0\1\201\44\0\1\202" + - "\24\0\1\202\36\0\2\203\2\0\21\203\1\204\14\203" + - "\1\205\27\203\2\206\2\0\21\206\1\207\15\206\1\205" + - "\26\206\2\210\2\0\21\210\1\211\16\210\1\205\25\210" + - "\5\0\10\47\1\0\4\47\2\0\1\47\1\0\4\47" + - "\1\0\6\47\24\0\2\212\3\47\5\0\10\47\1\0" + - "\4\47\2\0\1\47\1\0\1\47\1\213\2\47\1\0" + - "\6\47\24\0\4\47\1\213\5\0\10\73\1\0\4\73" + - "\2\0\1\73\1\0\4\73\1\0\6\73\24\0\5\73" + - "\22\0\1\214\54\0\10\73\1\0\4\73\2\0\1\73" + - "\1\0\2\215\1\216\1\217\1\0\6\73\24\0\5\73" + - "\22\0\1\220\22\0\1\221\1\222\45\0\1\223\23\0" + - "\1\224\45\0\1\222\131\0\1\225\72\0\1\226\72\0" + - "\1\76\23\0\1\227\21\0\1\227\50\0\1\230\57\0" + - "\10\120\1\0\4\120\1\0\7\120\1\0\6\120\24\0" + - "\5\120\6\0\1\121\24\0\1\121\3\0\1\121\40\0" + - "\1\231\20\0\1\231\3\0\6\231\25\0\1\231\36\0" + - "\1\232\44\0\1\233\24\0\1\233\36\0\2\234\2\0" + - "\21\234\1\235\14\234\1\236\27\234\2\237\2\0\21\237" + - "\1\240\15\237\1\236\26\237\2\241\2\0\21\241\1\242" + - "\16\241\1\236\25\241\22\0\1\243\71\0\1\244\22\0" + - "\1\245\1\246\45\0\1\247\23\0\1\250\45\0\1\246" + - "\131\0\1\251\72\0\1\252\72\0\1\133\5\0\2\151" + - "\3\0\42\151\2\0\21\151\2\153\2\0\1\253\20\153" + - "\1\254\14\153\1\151\4\153\2\253\21\153\2\154\2\0" + - "\1\255\20\154\1\256\15\154\1\151\3\154\2\255\21\154" + - "\2\155\2\0\1\257\20\155\1\260\16\155\1\151\2\155" + - "\2\257\21\155\2\156\2\0\1\261\20\156\1\262\20\156" + - "\1\151\2\261\21\156\4\0\1\157\2\0\1\263\6\0" + - "\1\264\3\0\1\161\3\0\1\263\11\0\1\264\35\0" + - "\1\157\10\0\1\265\4\0\1\161\53\0\1\161\102\0" + - "\1\266\61\0\10\163\1\266\4\163\4\0\4\163\1\0" + - "\6\163\24\0\5\163\15\0\1\265\54\0\1\267\3\0" + - "\66\267\5\0\10\167\1\266\4\167\4\0\4\167\1\0" + - "\6\167\24\0\5\167\5\0\3\47\1\270\4\47\1\0" + - "\4\47\2\0\1\47\1\0\4\47\1\0\6\47\24\0" + - "\5\47\1\203\3\0\66\203\1\206\3\0\66\206\1\210" + - "\3\0\66\210\5\0\10\47\1\0\4\47\2\0\1\47" + - "\1\0\4\47\1\0\6\47\24\0\2\47\1\271\2\47" + - "\5\0\10\47\1\0\4\47\2\0\1\47\1\0\4\47" + - "\1\0\6\47\24\0\2\47\1\272\2\47\21\0\1\273" + - "\70\0\1\273\51\0\1\234\3\0\66\234\1\237\3\0" + - "\66\237\1\241\3\0\66\241\2\253\2\0\21\253\1\274" + - "\14\253\1\275\27\253\1\153\1\151\2\0\1\253\42\153" + - "\2\253\21\153\2\255\2\0\21\255\1\276\15\255\1\275" + - "\26\255\1\154\1\151\2\0\1\255\42\154\2\255\21\154" + - "\2\257\2\0\21\257\1\277\16\257\1\275\25\257\1\155" + - "\1\151\2\0\1\257\42\155\2\257\21\155\2\261\2\0" + - "\21\261\1\300\20\261\1\275\23\261\1\156\1\151\2\0" + - "\1\261\42\156\2\261\21\156\16\0\1\301\21\0\1\301" + - "\50\0\1\302\52\0\1\253\3\0\66\253\1\255\3\0" + - "\66\255\1\257\3\0\66\257\1\261\3\0\66\261\21\0" + - "\1\303\70\0\1\303\51\0"; + "\16\14\1\41\24\14\1\37\22\14\2\32\1\33\1\42" + + "\1\43\1\44\1\45\1\46\1\47\2\50\2\14\2\50" + + "\1\51\1\50\1\14\1\50\1\52\1\14\1\45\3\50" + + "\1\53\1\44\1\43\1\47\1\50\1\44\1\50\1\54" + + "\1\55\1\56\1\57\2\14\1\60\1\37\1\61\1\62" + + "\1\63\1\64\1\65\1\66\1\67\1\70\1\71\3\14" + + "\2\72\1\50\1\73\1\50\1\14\2\32\1\33\1\42" + + "\1\74\1\14\5\74\2\14\4\74\1\75\1\76\2\14" + + "\4\74\1\77\1\14\3\74\1\14\1\74\4\14\1\100" + + "\1\101\1\102\1\37\1\14\1\103\1\104\1\105\1\106" + + "\1\107\1\110\1\111\1\112\1\113\1\114\1\115\5\74" + + "\1\14\2\32\1\33\1\25\2\14\1\116\5\14\1\36" + + "\1\117\3\14\1\120\3\14\1\116\11\14\1\117\7\14" + + "\1\37\22\14\2\32\1\33\1\42\1\121\1\122\5\121" + + "\2\14\4\121\1\14\1\121\1\123\1\14\4\121\1\124" + + "\1\122\3\121\1\122\1\121\1\125\1\126\1\127\1\130" + + "\2\14\1\60\1\37\1\14\1\62\1\63\1\131\1\65" + + "\1\66\1\67\1\70\1\132\3\14\5\121\1\14\2\32" + + "\1\33\1\42\15\14\1\133\7\14\1\134\12\14\1\135" + + "\1\136\1\137\1\37\1\14\1\140\1\141\1\105\1\142" + + "\1\143\1\144\1\145\1\146\1\147\1\150\1\151\5\14" + + "\1\152\1\153\1\32\1\33\1\42\35\152\1\154\1\155" + + "\1\156\1\157\1\152\1\60\1\37\21\152\1\160\1\161" + + "\1\32\1\33\66\160\74\0\1\15\73\0\1\17\71\0" + + "\1\162\10\20\1\163\4\20\1\164\1\0\1\165\1\0" + + "\4\20\1\0\6\20\24\0\5\20\5\0\1\166\1\0" + + "\5\166\2\0\4\166\4\0\4\166\2\0\3\166\1\0" + + "\1\166\24\0\5\166\1\22\3\0\66\22\2\0\1\23" + + "\73\0\1\25\72\0\1\26\1\27\4\26\2\27\1\167" + + "\4\26\1\0\1\170\1\171\1\0\4\26\1\0\1\27" + + "\3\26\1\27\1\26\24\0\5\26\5\0\10\27\1\167" + + "\4\27\2\0\1\171\1\0\4\27\1\0\6\27\24\0" + + "\5\27\5\0\1\172\1\0\5\172\2\0\4\172\4\0" + + "\4\172\2\0\3\172\1\0\1\172\24\0\5\172\1\31" + + "\3\0\66\31\2\0\1\32\74\0\1\34\1\35\4\34" + + "\2\35\1\0\4\34\1\0\1\170\2\0\4\34\1\0" + + "\1\35\3\34\1\35\1\34\24\0\5\34\5\0\10\35" + + "\1\0\4\35\4\0\4\35\1\0\6\35\24\0\5\35" + + "\1\37\3\0\66\37\4\0\1\40\113\0\2\173\1\174" + + "\1\175\44\0\1\42\72\0\1\50\1\176\6\50\1\0" + + "\4\50\2\0\1\50\1\0\4\50\1\0\1\176\5\50" + + "\24\0\5\50\6\0\1\44\24\0\1\44\3\0\1\44" + + "\37\0\3\50\1\176\4\50\1\0\4\50\2\0\1\50" + + "\1\0\4\50\1\0\6\50\24\0\2\50\1\177\2\50" + + "\5\0\10\50\1\0\4\50\2\0\1\50\1\0\4\50" + + "\1\0\6\50\24\0\2\200\3\50\5\0\1\50\1\201" + + "\6\50\1\0\4\50\2\0\1\50\1\0\4\50\1\0" + + "\1\201\5\50\24\0\5\50\5\0\10\50\1\0\4\50" + + "\2\0\1\50\1\0\4\50\1\0\6\50\24\0\5\50" + + "\5\0\2\50\1\202\5\50\1\0\4\50\2\0\1\50" + + "\1\0\1\202\3\50\1\0\6\50\24\0\5\50\6\0" + + "\1\203\20\0\1\203\3\0\6\203\25\0\1\203\36\0" + + "\1\204\44\0\1\205\24\0\1\205\36\0\2\206\2\0" + + "\21\206\1\207\14\206\1\210\27\206\2\211\2\0\21\211" + + "\1\212\15\211\1\210\26\211\2\213\2\0\21\213\1\214" + + "\16\213\1\210\25\213\5\0\10\50\1\0\4\50\2\0" + + "\1\50\1\0\4\50\1\0\6\50\24\0\2\215\3\50" + + "\5\0\10\50\1\0\4\50\2\0\1\50\1\0\1\50" + + "\1\216\2\50\1\0\6\50\24\0\4\50\1\216\5\0" + + "\10\74\1\0\4\74\2\0\1\74\1\0\4\74\1\0" + + "\6\74\24\0\5\74\22\0\1\217\54\0\10\74\1\0" + + "\4\74\2\0\1\74\1\0\2\220\1\221\1\222\1\0" + + "\6\74\24\0\5\74\22\0\1\223\22\0\1\224\1\225" + + "\45\0\1\226\23\0\1\227\45\0\1\225\131\0\1\230" + + "\72\0\1\231\72\0\1\77\23\0\1\232\21\0\1\232" + + "\50\0\1\233\57\0\10\121\1\0\4\121\1\0\7\121" + + "\1\0\6\121\24\0\5\121\6\0\1\122\24\0\1\122" + + "\3\0\1\122\40\0\1\234\20\0\1\234\3\0\6\234" + + "\25\0\1\234\36\0\1\235\44\0\1\236\24\0\1\236" + + "\36\0\2\237\2\0\21\237\1\240\14\237\1\241\27\237" + + "\2\242\2\0\21\242\1\243\15\242\1\241\26\242\2\244" + + "\2\0\21\244\1\245\16\244\1\241\25\244\22\0\1\246" + + "\71\0\1\247\22\0\1\250\1\251\45\0\1\252\23\0" + + "\1\253\45\0\1\251\131\0\1\254\72\0\1\255\72\0" + + "\1\134\5\0\2\152\3\0\42\152\2\0\21\152\2\154" + + "\2\0\1\256\20\154\1\257\14\154\1\152\4\154\2\256" + + "\21\154\2\155\2\0\1\260\20\155\1\261\15\155\1\152" + + "\3\155\2\260\21\155\2\156\2\0\1\262\20\156\1\263" + + "\16\156\1\152\2\156\2\262\21\156\2\157\2\0\1\264" + + "\20\157\1\265\20\157\1\152\2\264\21\157\2\160\2\0" + + "\66\160\4\0\1\162\2\0\1\266\6\0\1\267\3\0" + + "\1\164\3\0\1\266\11\0\1\267\35\0\1\162\10\0" + + "\1\270\4\0\1\164\53\0\1\164\102\0\1\271\61\0" + + "\10\166\1\271\4\166\4\0\4\166\1\0\6\166\24\0" + + "\5\166\15\0\1\272\54\0\1\273\3\0\66\273\15\0" + + "\1\274\61\0\10\172\1\274\4\172\4\0\4\172\1\0" + + "\6\172\24\0\5\172\5\0\3\50\1\275\4\50\1\0" + + "\4\50\2\0\1\50\1\0\4\50\1\0\6\50\24\0" + + "\5\50\1\206\3\0\66\206\1\211\3\0\66\211\1\213" + + "\3\0\66\213\5\0\10\50\1\0\4\50\2\0\1\50" + + "\1\0\4\50\1\0\6\50\24\0\2\50\1\276\2\50" + + "\5\0\10\50\1\0\4\50\2\0\1\50\1\0\4\50" + + "\1\0\6\50\24\0\2\50\1\277\2\50\21\0\1\300" + + "\70\0\1\300\51\0\1\237\3\0\66\237\1\242\3\0" + + "\66\242\1\244\3\0\66\244\2\256\2\0\21\256\1\301" + + "\14\256\1\302\27\256\1\154\1\152\2\0\1\256\42\154" + + "\2\256\21\154\2\260\2\0\21\260\1\303\15\260\1\302" + + "\26\260\1\155\1\152\2\0\1\260\42\155\2\260\21\155" + + "\2\262\2\0\21\262\1\304\16\262\1\302\25\262\1\156" + + "\1\152\2\0\1\262\42\156\2\262\21\156\2\264\2\0" + + "\21\264\1\305\20\264\1\302\23\264\1\157\1\152\2\0" + + "\1\264\42\157\2\264\21\157\16\0\1\306\21\0\1\306" + + "\50\0\1\307\52\0\1\256\3\0\66\256\1\260\3\0" + + "\66\260\1\262\3\0\66\262\1\264\3\0\66\264\21\0" + + "\1\310\70\0\1\310\51\0"; private static int[] zzUnpackTrans() { - int[] result = new int[6380]; + int[] result = new int[6554]; int offset = 0; offset = zzUnpackTrans(ZZ_TRANS_PACKED_0, offset, result); return result; @@ -439,16 +441,16 @@ public class _M68kLexer implements FlexLexer { private static final String ZZ_ATTRIBUTE_PACKED_0 = "\13\0\2\11\5\1\1\11\6\1\1\11\3\1\1\11" + - "\20\1\12\11\5\1\1\11\2\1\4\11\1\1\4\11" + + "\21\1\12\11\5\1\1\11\2\1\4\11\1\1\4\11" + "\5\1\1\11\10\1\2\11\1\1\1\11\2\1\3\11" + - "\1\1\4\11\11\1\1\0\5\1\3\0\3\11\10\1" + + "\1\1\4\11\13\1\1\0\5\1\3\0\3\11\10\1" + "\2\0\1\11\4\0\2\1\1\11\3\1\7\11\2\0" + "\3\1\2\0\1\11\4\0\10\11\1\0\1\1\1\0" + - "\1\1\1\0\1\1\1\0\1\1\2\0\3\11\3\1" + + "\1\1\1\0\1\1\1\0\1\1\2\0\5\11\3\1" + "\1\11\1\0\1\11\6\0"; private static int[] zzUnpackAttribute() { - int[] result = new int[195]; + int[] result = new int[200]; int offset = 0; offset = zzUnpackAttribute(ZZ_ATTRIBUTE_PACKED_0, offset, result); return result; @@ -524,8 +526,16 @@ public class _M68kLexer implements FlexLexer { private boolean zzEOFDone; /* user code: */ - public _M68kLexer() { + private M68kLexerPrefs lexerPrefs; + boolean eatOneWhitespace = false; + + public M68kLexerPrefs getLexerPrefs() { + return lexerPrefs; + } + + public _M68kLexer(M68kLexerPrefs lexerPrefs) { this((java.io.Reader) null); + this.lexerPrefs = lexerPrefs; } @@ -771,41 +781,43 @@ public class _M68kLexer implements FlexLexer { return BAD_CHARACTER; } // fall through - case 97: + case 100: break; case 2: { return WHITE_SPACE; } // fall through - case 98: + case 101: break; case 3: { yybegin(NOSOL); + eatOneWhitespace = false; return WHITE_SPACE; } // fall through - case 99: + case 102: break; case 4: { yybegin(INSTRPART); + eatOneWhitespace = false; yypushback(pushbackLabelColons(yytext())); return GLOBAL_LABEL_DEF; } // fall through - case 100: + case 103: break; case 5: { return COMMENT; } // fall through - case 101: + case 104: break; case 6: { yybegin(YYINITIAL); return WHITE_SPACE; } // fall through - case 102: + case 105: break; case 7: { if (isAsmMnemonicWithSize(yytext())) { @@ -826,620 +838,646 @@ public class _M68kLexer implements FlexLexer { return OTHER_DIRECTIVE; } yybegin(MACROCALL); + eatOneWhitespace = true; return MACRO_INVOKATION; } // fall through - case 103: + case 106: break; case 8: { yybegin(MACROCALL); + eatOneWhitespace = true; return MACRO_INVOKATION; } // fall through - case 104: + case 107: break; case 9: { yybegin(YYINITIAL); return COMMENT; } // fall through - case 105: + case 108: break; case 10: { yybegin(YYINITIAL); return EOL; } // fall through - case 106: + case 109: break; case 11: { return COLON; } // fall through - case 107: + case 110: break; case 12: { yybegin(WAITEOL); return COMMENT; } // fall through - case 108: + case 111: break; case 13: { yybegin(ASMOPS); return WHITE_SPACE; } // fall through - case 109: - break; - case 14: { - yybegin(ASMOPS_OP); - return SYMBOL; - } - // fall through - case 110: - break; - case 15: { - yybegin(ASMOPS_OP); - return DECIMAL; - } - // fall through - case 111: - break; - case 16: { - return SEPARATOR; - } - // fall through case 112: break; - case 17: { - return HASH; + case 14: { + return handleEolCommentWhitespace(this); } // fall through case 113: break; - case 18: { - return OP_BITWISE_XOR; + case 15: { + yybegin(ASMOPS_OP); + return SYMBOL; } // fall through case 114: break; - case 19: { - return ROUND_L; + case 16: { + yybegin(ASMOPS_OP); + return DECIMAL; } // fall through case 115: break; - case 20: { - yybegin(ASMOPS_OP); - return ROUND_R; + case 17: { + return SEPARATOR; } // fall through case 116: break; - case 21: { - return OP_UNARY_NOT; + case 18: { + return HASH; } // fall through case 117: break; - case 22: { - return OP_UNARY_COMPL; + case 19: { + return OP_BITWISE_XOR; } // fall through case 118: break; - case 23: { - return OP_PLUS; + case 20: { + return ROUND_L; } // fall through case 119: break; - case 24: { - return OP_MINUS; + case 21: { + yybegin(ASMOPS_OP); + return ROUND_R; } // fall through case 120: break; - case 25: { - yybegin(ASMOPS_OP); - return CURRENT_PC_SYMBOL; + case 22: { + return OP_UNARY_NOT; } // fall through case 121: break; - case 26: { - return SYMBOL; + case 23: { + return OP_UNARY_COMPL; } // fall through case 122: break; - case 27: { - yybegin(ASMOPS); - return OP_CMP_EQ; + case 24: { + return OP_PLUS; } // fall through case 123: break; - case 28: { - yybegin(ASMOPS); - return OP_AR_MOD; + case 25: { + return OP_MINUS; } // fall through case 124: break; - case 29: { - yybegin(ASMOPS); - return OP_CMP_LT; + case 26: { + yybegin(ASMOPS_OP); + return CURRENT_PC_SYMBOL; } // fall through case 125: break; - case 30: { - yybegin(ASMOPS); - return OP_CMP_GT; + case 27: { + return SYMBOL; } // fall through case 126: break; - case 31: { + case 28: { yybegin(ASMOPS); - return SEPARATOR; + return OP_CMP_EQ; } // fall through case 127: break; - case 32: { + case 29: { yybegin(ASMOPS); - return OP_BITWISE_XOR; + return OP_AR_MOD; } // fall through case 128: break; - case 33: { + case 30: { yybegin(ASMOPS); - return ROUND_L; + return OP_CMP_LT; } // fall through case 129: break; - case 34: { - return ROUND_R; + case 31: { + yybegin(ASMOPS); + return OP_CMP_GT; } // fall through case 130: break; - case 35: { + case 32: { yybegin(ASMOPS); - return OP_BITWISE_OR; + return SEPARATOR; } // fall through case 131: break; - case 36: { + case 33: { yybegin(ASMOPS); - return OP_UNARY_COMPL; + return OP_BITWISE_XOR; } // fall through case 132: break; - case 37: { + case 34: { yybegin(ASMOPS); - return OP_PLUS; + return ROUND_L; } // fall through case 133: break; - case 38: { - yybegin(ASMOPS); - return OP_MINUS; + case 35: { + return ROUND_R; } // fall through case 134: break; - case 39: { + case 36: { yybegin(ASMOPS); - return OP_AR_MUL; + return OP_BITWISE_OR; } // fall through case 135: break; - case 40: { + case 37: { yybegin(ASMOPS); - return OP_BITWISE_AND; + return OP_UNARY_COMPL; } // fall through case 136: break; - case 41: { + case 38: { yybegin(ASMOPS); - return OP_AR_DIV; + return OP_PLUS; } // fall through case 137: break; - case 42: { - yybegin(EXPR); - return OP_ASSIGN; + case 39: { + yybegin(ASMOPS); + return OP_MINUS; } // fall through case 138: break; - case 43: { - yybegin(EXPR_OP); - return SYMBOL; + case 40: { + yybegin(ASMOPS); + return OP_AR_MUL; } // fall through case 139: break; - case 44: { - yybegin(EXPR_OP); - return DECIMAL; + case 41: { + yybegin(ASMOPS); + return OP_BITWISE_AND; } // fall through case 140: break; - case 45: { - yybegin(EXPR_OP); - return ROUND_R; + case 42: { + yybegin(ASMOPS); + return OP_AR_DIV; } // fall through case 141: break; - case 46: { - yybegin(EXPR_OP); - return CURRENT_PC_SYMBOL; + case 43: { + yybegin(EXPR); + return OP_ASSIGN; } // fall through case 142: break; - case 47: { - yybegin(EXPR); - return OP_CMP_EQ; + case 44: { + yybegin(EXPR_OP); + return SYMBOL; } // fall through case 143: break; - case 48: { - yybegin(EXPR); - return OP_AR_MOD; + case 45: { + yybegin(EXPR_OP); + return DECIMAL; } // fall through case 144: break; - case 49: { - yybegin(EXPR); - return OP_CMP_LT; + case 46: { + yybegin(EXPR_OP); + return ROUND_R; } // fall through case 145: break; - case 50: { - yybegin(EXPR); - return OP_CMP_GT; + case 47: { + yybegin(EXPR_OP); + return CURRENT_PC_SYMBOL; } // fall through case 146: break; - case 51: { + case 48: { yybegin(EXPR); - return SEPARATOR; + return OP_CMP_EQ; } // fall through case 147: break; - case 52: { + case 49: { yybegin(EXPR); - return OP_BITWISE_XOR; + return OP_AR_MOD; } // fall through case 148: break; - case 53: { + case 50: { yybegin(EXPR); - return ROUND_L; + return OP_CMP_LT; } // fall through case 149: break; - case 54: { + case 51: { yybegin(EXPR); - return OP_BITWISE_OR; + return OP_CMP_GT; } // fall through case 150: break; - case 55: { + case 52: { yybegin(EXPR); - return OP_UNARY_COMPL; + return SEPARATOR; } // fall through case 151: break; - case 56: { + case 53: { yybegin(EXPR); - return OP_PLUS; + return OP_BITWISE_XOR; } // fall through case 152: break; - case 57: { + case 54: { yybegin(EXPR); - return OP_MINUS; + return ROUND_L; } // fall through case 153: break; - case 58: { + case 55: { yybegin(EXPR); - return OP_AR_MUL; + return OP_BITWISE_OR; } // fall through case 154: break; - case 59: { + case 56: { yybegin(EXPR); - return OP_BITWISE_AND; + return OP_UNARY_COMPL; } // fall through case 155: break; - case 60: { + case 57: { yybegin(EXPR); - return OP_AR_DIV; + return OP_PLUS; } // fall through case 156: break; - case 61: { - return STRINGLIT; + case 58: { + yybegin(EXPR); + return OP_MINUS; } // fall through case 157: break; - case 62: { - yybegin(ASSIGNMENT); - yypushback(pushbackAssignment(yytext())); - return SYMBOLDEF; + case 59: { + yybegin(EXPR); + return OP_AR_MUL; } // fall through case 158: break; + case 60: { + yybegin(EXPR); + return OP_BITWISE_AND; + } + // fall through + case 159: + break; + case 61: { + yybegin(EXPR); + return OP_AR_DIV; + } + // fall through + case 160: + break; + case 62: { + return STRINGLIT; + } + // fall through + case 161: + break; case 63: { + yybegin(ASSIGNMENT); + eatOneWhitespace = true; + yypushback(pushbackAssignment(yytext())); + return SYMBOLDEF; + } + // fall through + case 162: + break; + case 64: { + yybegin(INSTRPART); + eatOneWhitespace = false; + yypushback(pushbackLabelColons(yytext())); + return LOCAL_LABEL_DEF; + } + // fall through + case 163: + break; + case 65: { + yybegin(INSTRPART); + yypushback(pushbackLabelColons(yytext())); + return GLOBAL_LABEL_DEF; + } + // fall through + case 164: + break; + case 66: { + return OPSIZE_BS; + } + // fall through + case 165: + break; + case 67: { + return OPSIZE_W; + } + // fall through + case 166: + break; + case 68: { + return OPSIZE_L; + } + // fall through + case 167: + break; + case 69: { + yybegin(ASMOPS_OP); + return AREG; + } + // fall through + case 168: + break; + case 70: { + yybegin(ASMOPS_OP); + return REG_SR; + } + // fall through + case 169: + break; + case 71: { + yybegin(ASMOPS_OP); + return PC; + } + // fall through + case 170: + break; + case 72: { + yybegin(ASMOPS_OP); + return DREG; + } + // fall through + case 171: + break; + case 73: { + yybegin(ASMOPS_OP); + return HEXADECIMAL; + } + // fall through + case 172: + break; + case 74: { + yybegin(ASMOPS_OP); + return BINARY; + } + // fall through + case 173: + break; + case 75: { + yybegin(ASMOPS_OP); + return OCTAL; + } + // fall through + case 174: + break; + case 76: { + yybegin(ASMOPS_OP); + return STRINGLIT; + } + // fall through + case 175: + break; + case 77: { + yybegin(ASMOPS); + return OP_CMP_LT_EQ; + } + // fall through + case 176: + break; + case 78: { + yybegin(ASMOPS); + return OP_AR_SHIFT_L; + } + // fall through + case 177: + break; + case 79: { + yybegin(ASMOPS); + return OP_CMP_NOT_EQ; + } + // fall through + case 178: + break; + case 80: { + yybegin(ASMOPS); + return OP_CMP_GT_EQ; + } + // fall through + case 179: + break; + case 81: { + yybegin(ASMOPS); + return OP_AR_SHIFT_R; + } + // fall through + case 180: + break; + case 82: { + yybegin(ASMOPS); + return OP_LOGICAL_AND; + } + // fall through + case 181: + break; + case 83: { + yybegin(ASMOPS); + return OP_LOGICAL_OR; + } + // fall through + case 182: + break; + case 84: { + yybegin(EXPR_OP); + return HEXADECIMAL; + } + // fall through + case 183: + break; + case 85: { + yybegin(EXPR_OP); + return BINARY; + } + // fall through + case 184: + break; + case 86: { + yybegin(EXPR_OP); + return OCTAL; + } + // fall through + case 185: + break; + case 87: { + yybegin(EXPR_OP); + return STRINGLIT; + } + // fall through + case 186: + break; + case 88: { + yybegin(EXPR); + return OP_CMP_LT_EQ; + } + // fall through + case 187: + break; + case 89: { + yybegin(EXPR); + return OP_AR_SHIFT_L; + } + // fall through + case 188: + break; + case 90: { + yybegin(EXPR); + return OP_CMP_NOT_EQ; + } + // fall through + case 189: + break; + case 91: { + yybegin(EXPR); + return OP_CMP_GT_EQ; + } + // fall through + case 190: + break; + case 92: { + yybegin(EXPR); + return OP_AR_SHIFT_R; + } + // fall through + case 191: + break; + case 93: { + yybegin(EXPR); + return OP_LOGICAL_AND; + } + // fall through + case 192: + break; + case 94: { + yybegin(EXPR); + return OP_LOGICAL_OR; + } + // fall through + case 193: + break; + case 95: { yybegin(INSTRPART); yypushback(pushbackLabelColons(yytext())); return LOCAL_LABEL_DEF; } // fall through - case 159: + case 194: break; - case 64: { - return OPSIZE_BS; - } - // fall through - case 160: - break; - case 65: { - return OPSIZE_W; - } - // fall through - case 161: - break; - case 66: { - return OPSIZE_L; - } - // fall through - case 162: - break; - case 67: { - yybegin(ASMOPS_OP); - return AREG; - } - // fall through - case 163: - break; - case 68: { - yybegin(ASMOPS_OP); - return REG_SR; - } - // fall through - case 164: - break; - case 69: { - yybegin(ASMOPS_OP); - return PC; - } - // fall through - case 165: - break; - case 70: { - yybegin(ASMOPS_OP); - return DREG; - } - // fall through - case 166: - break; - case 71: { - yybegin(ASMOPS_OP); - return HEXADECIMAL; - } - // fall through - case 167: - break; - case 72: { - yybegin(ASMOPS_OP); - return BINARY; - } - // fall through - case 168: - break; - case 73: { - yybegin(ASMOPS_OP); - return OCTAL; - } - // fall through - case 169: - break; - case 74: { - yybegin(ASMOPS_OP); - return STRINGLIT; - } - // fall through - case 170: - break; - case 75: { - yybegin(ASMOPS); - return OP_CMP_LT_EQ; - } - // fall through - case 171: - break; - case 76: { - yybegin(ASMOPS); - return OP_AR_SHIFT_L; - } - // fall through - case 172: - break; - case 77: { - yybegin(ASMOPS); - return OP_CMP_NOT_EQ; - } - // fall through - case 173: - break; - case 78: { - yybegin(ASMOPS); - return OP_CMP_GT_EQ; - } - // fall through - case 174: - break; - case 79: { - yybegin(ASMOPS); - return OP_AR_SHIFT_R; - } - // fall through - case 175: - break; - case 80: { - yybegin(ASMOPS); - return OP_LOGICAL_AND; - } - // fall through - case 176: - break; - case 81: { - yybegin(ASMOPS); - return OP_LOGICAL_OR; - } - // fall through - case 177: - break; - case 82: { - yybegin(EXPR_OP); - return HEXADECIMAL; - } - // fall through - case 178: - break; - case 83: { - yybegin(EXPR_OP); - return BINARY; - } - // fall through - case 179: - break; - case 84: { - yybegin(EXPR_OP); - return OCTAL; - } - // fall through - case 180: - break; - case 85: { - yybegin(EXPR_OP); - return STRINGLIT; - } - // fall through - case 181: - break; - case 86: { - yybegin(EXPR); - return OP_CMP_LT_EQ; - } - // fall through - case 182: - break; - case 87: { - yybegin(EXPR); - return OP_AR_SHIFT_L; - } - // fall through - case 183: - break; - case 88: { - yybegin(EXPR); - return OP_CMP_NOT_EQ; - } - // fall through - case 184: - break; - case 89: { - yybegin(EXPR); - return OP_CMP_GT_EQ; - } - // fall through - case 185: - break; - case 90: { - yybegin(EXPR); - return OP_AR_SHIFT_R; - } - // fall through - case 186: - break; - case 91: { - yybegin(EXPR); - return OP_LOGICAL_AND; - } - // fall through - case 187: - break; - case 92: { - yybegin(EXPR); - return OP_LOGICAL_OR; - } - // fall through - case 188: - break; - case 93: { + case 96: { yybegin(ASMOPS_OP); return REG_USP; } // fall through - case 189: + case 195: break; - case 94: { + case 97: { yybegin(ASMOPS_OP); return REG_CCR; } // fall through - case 190: + case 196: break; - case 95: { + case 98: { yybegin(ASMOPS_OP); return REG_VBR; } // fall through - case 191: + case 197: break; - case 96: { + case 99: { yybegin(EXPR); return EQU; } // fall through - case 192: + case 198: break; default: zzScanError(ZZ_NO_MATCH); diff --git a/src/main/java/de/platon42/intellij/plugins/m68k/lexer/LexerUtil.kt b/src/main/java/de/platon42/intellij/plugins/m68k/lexer/LexerUtil.kt index a98a640..e6c7a14 100644 --- a/src/main/java/de/platon42/intellij/plugins/m68k/lexer/LexerUtil.kt +++ b/src/main/java/de/platon42/intellij/plugins/m68k/lexer/LexerUtil.kt @@ -1,5 +1,7 @@ package de.platon42.intellij.plugins.m68k.lexer +import com.intellij.psi.TokenType +import com.intellij.psi.tree.IElementType import de.platon42.intellij.plugins.m68k.asm.AssemblerDirectives import de.platon42.intellij.plugins.m68k.asm.M68kIsa.mnemonics @@ -30,4 +32,13 @@ object LexerUtil { fun pushbackLabelColons(text: CharSequence): Int { return text.count { it == ':' } } + + @JvmStatic + fun handleEolCommentWhitespace(lexer: _M68kLexer): IElementType { + if (!lexer.eatOneWhitespace && lexer.lexerPrefs.spaceIntroducesComment) { + lexer.yybegin(_M68kLexer.WAITEOL) + } + lexer.eatOneWhitespace = false; + return TokenType.WHITE_SPACE + } } \ No newline at end of file diff --git a/src/main/java/de/platon42/intellij/plugins/m68k/lexer/M68kLexer.kt b/src/main/java/de/platon42/intellij/plugins/m68k/lexer/M68kLexer.kt index 27ce3ec..3e410a0 100644 --- a/src/main/java/de/platon42/intellij/plugins/m68k/lexer/M68kLexer.kt +++ b/src/main/java/de/platon42/intellij/plugins/m68k/lexer/M68kLexer.kt @@ -2,4 +2,4 @@ package de.platon42.intellij.plugins.m68k.lexer import com.intellij.lexer.FlexAdapter -class M68kLexer : FlexAdapter(_M68kLexer()) \ No newline at end of file +class M68kLexer(lexerPrefs: M68kLexerPrefs) : FlexAdapter(_M68kLexer(lexerPrefs)) \ No newline at end of file diff --git a/src/main/java/de/platon42/intellij/plugins/m68k/lexer/M68kLexerPrefs.kt b/src/main/java/de/platon42/intellij/plugins/m68k/lexer/M68kLexerPrefs.kt new file mode 100644 index 0000000..be7dca3 --- /dev/null +++ b/src/main/java/de/platon42/intellij/plugins/m68k/lexer/M68kLexerPrefs.kt @@ -0,0 +1,8 @@ +package de.platon42.intellij.plugins.m68k.lexer + +data class M68kLexerPrefs( + var spaceIntroducesComment: Boolean = false, + var maxLinesPerMacro: Int = 50, + var macroSectionUnparsed: Boolean = false, + var macroParametersUnparsed: Boolean = true +) \ No newline at end of file diff --git a/src/main/java/de/platon42/intellij/plugins/m68k/lexer/_M68kLexer.flex b/src/main/java/de/platon42/intellij/plugins/m68k/lexer/_M68kLexer.flex index 3f53bff..741c3cc 100644 --- a/src/main/java/de/platon42/intellij/plugins/m68k/lexer/_M68kLexer.flex +++ b/src/main/java/de/platon42/intellij/plugins/m68k/lexer/_M68kLexer.flex @@ -11,8 +11,17 @@ import static de.platon42.intellij.plugins.m68k.lexer.LexerUtil.*; %% %{ - public _M68kLexer() { - this((java.io.Reader)null); + private M68kLexerPrefs lexerPrefs; + boolean eatOneWhitespace = false; + + public M68kLexerPrefs getLexerPrefs() + { + return lexerPrefs; + } + + public _M68kLexer(M68kLexerPrefs lexerPrefs) { + this((java.io.Reader)null); + this.lexerPrefs = lexerPrefs; } %} @@ -49,16 +58,17 @@ STRINGLIT=(`([^`\\\r\n]|\\.)*`|'([^'\\\r\n]|\\.)*'|\"([^\"\\\r\n]|\\.)*\") PLAINPARAM=(`([^`\\\r\n]|\\.)*`|'([^'\\\r\n]|\\.)*'|\"([^\"\\\r\n]|\\.)*\")|<([^>\\\r\n]|\\.)*>|([^,;\p{Blank}\r\n])+ // why does \R not work, I have no idea COMMENT=([;].*+) HASH_COMMENT=([#;*].*+) +SKIP_TO_EOL=[^\r\n]+ %state NOSOL,INSTRPART,ASMINSTR,ASMOPS,ASMOPS_OP,ASSIGNMENT,EXPR,EXPR_OP,MACROCALL,WAITEOL %% { - {WHITE_SPACE} { yybegin(NOSOL); return WHITE_SPACE; } + {WHITE_SPACE} { yybegin(NOSOL); eatOneWhitespace = false; return WHITE_SPACE; } {EOL} { return WHITE_SPACE; } - {ASSIGNMENT} { yybegin(ASSIGNMENT); yypushback(pushbackAssignment(yytext())); return SYMBOLDEF; } - {LOCAL_LABEL} { yybegin(INSTRPART); yypushback(pushbackLabelColons(yytext())); return LOCAL_LABEL_DEF; } - {GLOBAL_LABEL} { yybegin(INSTRPART); yypushback(pushbackLabelColons(yytext())); return GLOBAL_LABEL_DEF; } + {ASSIGNMENT} { yybegin(ASSIGNMENT); eatOneWhitespace = true; yypushback(pushbackAssignment(yytext())); return SYMBOLDEF; } + {LOCAL_LABEL} { yybegin(INSTRPART); eatOneWhitespace = false; yypushback(pushbackLabelColons(yytext())); return LOCAL_LABEL_DEF; } + {GLOBAL_LABEL} { yybegin(INSTRPART); eatOneWhitespace = false; yypushback(pushbackLabelColons(yytext())); return GLOBAL_LABEL_DEF; } {HASH_COMMENT} { return COMMENT; } } @@ -73,10 +83,10 @@ HASH_COMMENT=([#;*].*+) if(isAsmMnemonic(yytext())) { yybegin(ASMINSTR); return MNEMONIC; } if(isDataDirective(yytext())) { yybegin(EXPR); return DATA_DIRECTIVE; } if(isOtherDirective(yytext())) { yybegin(EXPR); return OTHER_DIRECTIVE; } - yybegin(MACROCALL); return MACRO_INVOKATION; + yybegin(MACROCALL); eatOneWhitespace = true; return MACRO_INVOKATION; } // {MNEMONIC} { if(isAsmMnemonic(yytext())) { yybegin(ASMINSTR); return MNEMONIC; } else { yybegin(INSTRPART); return SYMBOL; } } - {MACRONAME} { yybegin(MACROCALL); return MACRO_INVOKATION; } + {MACRONAME} { yybegin(MACROCALL); eatOneWhitespace = true; return MACRO_INVOKATION; } {HASH_COMMENT} { yybegin(YYINITIAL); return COMMENT; } } @@ -91,10 +101,10 @@ HASH_COMMENT=([#;*].*+) if(isAsmMnemonic(yytext())) { yybegin(ASMINSTR); return MNEMONIC; } if(isDataDirective(yytext())) { yybegin(EXPR); return DATA_DIRECTIVE; } if(isOtherDirective(yytext())) { yybegin(EXPR); return OTHER_DIRECTIVE; } - yybegin(MACROCALL); return MACRO_INVOKATION; + yybegin(MACROCALL); eatOneWhitespace = true; return MACRO_INVOKATION; } // {MNEMONIC} { if(isAsmMnemonic(yytext())) { yybegin(ASMINSTR); return MNEMONIC; } else { return SYMBOL; } } - {MACRONAME} { yybegin(MACROCALL); return MACRO_INVOKATION; } + {MACRONAME} { yybegin(MACROCALL); eatOneWhitespace = true; return MACRO_INVOKATION; } {COMMENT} { yybegin(WAITEOL); return COMMENT; } } @@ -111,7 +121,7 @@ HASH_COMMENT=([#;*].*+) } { - {WHITE_SPACE} { return WHITE_SPACE; } // FIXME space optionally introduces comment + {WHITE_SPACE} { return handleEolCommentWhitespace(this); } {EOL} { yybegin(YYINITIAL); return EOL; } {COMMENT} { yybegin(WAITEOL); return COMMENT; } @@ -134,7 +144,7 @@ HASH_COMMENT=([#;*].*+) } { - {WHITE_SPACE} { return WHITE_SPACE; } // FIXME space optionally introduces comment + {WHITE_SPACE} { return handleEolCommentWhitespace(this); } {EOL} { yybegin(YYINITIAL); return EOL; } {BINARY} { yybegin(EXPR_OP); return BINARY; } @@ -159,7 +169,7 @@ HASH_COMMENT=([#;*].*+) } { - {WHITE_SPACE} { return WHITE_SPACE; } // FIXME space optionally introduces comment + {WHITE_SPACE} { return handleEolCommentWhitespace(this); } {EOL} { yybegin(YYINITIAL); return EOL; } "<<" { yybegin(EXPR); return OP_AR_SHIFT_L; } @@ -195,7 +205,7 @@ HASH_COMMENT=([#;*].*+) } { - {WHITE_SPACE} { return WHITE_SPACE; } // FIXME space optionally introduces comment + {WHITE_SPACE} { return handleEolCommentWhitespace(this); } {EOL} { yybegin(YYINITIAL); return EOL; } {BINARY} { yybegin(ASMOPS_OP); return BINARY; } @@ -230,7 +240,7 @@ HASH_COMMENT=([#;*].*+) } { - {WHITE_SPACE} { return WHITE_SPACE; } // FIXME space optionally introduces comment + {WHITE_SPACE} { return handleEolCommentWhitespace(this); } {EOL} { yybegin(YYINITIAL); return EOL; } {OPSIZE_BS} { return OPSIZE_BS; } @@ -274,6 +284,7 @@ HASH_COMMENT=([#;*].*+) { {EOL} { yybegin(YYINITIAL); return EOL; } + {SKIP_TO_EOL} { return COMMENT; } } [^] { return BAD_CHARACTER; } diff --git a/src/main/java/de/platon42/intellij/plugins/m68k/parser/M68kParserDefinition.java b/src/main/java/de/platon42/intellij/plugins/m68k/parser/M68kParserDefinition.java index 97a8a02..bbbc235 100644 --- a/src/main/java/de/platon42/intellij/plugins/m68k/parser/M68kParserDefinition.java +++ b/src/main/java/de/platon42/intellij/plugins/m68k/parser/M68kParserDefinition.java @@ -12,6 +12,7 @@ import com.intellij.psi.tree.IFileElementType; import com.intellij.psi.tree.TokenSet; import de.platon42.intellij.plugins.m68k.M68kFileElementType; import de.platon42.intellij.plugins.m68k.lexer.M68kLexer; +import de.platon42.intellij.plugins.m68k.lexer.M68kLexerPrefs; import de.platon42.intellij.plugins.m68k.psi.M68kFile; import de.platon42.intellij.plugins.m68k.psi.M68kTypes; import org.jetbrains.annotations.NotNull; @@ -20,12 +21,19 @@ public class M68kParserDefinition implements ParserDefinition { public static final TokenSet STRING_LITERALS = TokenSet.create(M68kTypes.STRINGLIT); public static final TokenSet COMMENTS = TokenSet.create(M68kTypes.COMMENT); + private M68kLexerPrefs lexerPrefs = new M68kLexerPrefs(); // TODO make this configurable + public M68kParserDefinition() { } + public M68kLexerPrefs getLexerPrefs() { + return lexerPrefs; + } + @Override public @NotNull Lexer createLexer(Project project) { - return new M68kLexer(); + // TODO take prefs from project somehow + return new M68kLexer(lexerPrefs); } @Override diff --git a/src/main/java/de/platon42/intellij/plugins/m68k/syntax/M68kColorSettingsPage.kt b/src/main/java/de/platon42/intellij/plugins/m68k/syntax/M68kColorSettingsPage.kt index 5eeb33d..5739122 100644 --- a/src/main/java/de/platon42/intellij/plugins/m68k/syntax/M68kColorSettingsPage.kt +++ b/src/main/java/de/platon42/intellij/plugins/m68k/syntax/M68kColorSettingsPage.kt @@ -9,6 +9,7 @@ import com.intellij.openapi.util.NlsContexts.ConfigurableName import de.platon42.intellij.plugins.m68k.M68kIcons.FILE import de.platon42.intellij.plugins.m68k.syntax.M68kSyntaxHighlighter.Companion.AREG import de.platon42.intellij.plugins.m68k.syntax.M68kSyntaxHighlighter.Companion.BAD_CHARACTER +import de.platon42.intellij.plugins.m68k.syntax.M68kSyntaxHighlighter.Companion.COLON import de.platon42.intellij.plugins.m68k.syntax.M68kSyntaxHighlighter.Companion.COMMENT import de.platon42.intellij.plugins.m68k.syntax.M68kSyntaxHighlighter.Companion.DATA_PREPROCESSOR import de.platon42.intellij.plugins.m68k.syntax.M68kSyntaxHighlighter.Companion.DATA_WIDTH_BS @@ -36,7 +37,7 @@ class M68kColorSettingsPage : ColorSettingsPage { } override fun getHighlighter(): SyntaxHighlighter { - return M68kSyntaxHighlighter() + return M68kSyntaxHighlighter(null) } @NonNls @@ -85,24 +86,26 @@ hello: dc.b 'Hello World!',10,0 companion object { private val DESCRIPTORS = arrayOf( - AttributesDescriptor("Global labels", GLOBAL_LABEL), - AttributesDescriptor("Local labels", LOCAL_LABEL), - AttributesDescriptor("Comma (separator)", SEPARATOR), - AttributesDescriptor("Symbol definition", SYMBOLDEF), - AttributesDescriptor("Symbol reference", SYMBOL), - AttributesDescriptor("Assembly mnemonic", MNEMONIC), - AttributesDescriptor("Macro invocation", MACRO_CALL), - AttributesDescriptor("Byte/short data width", DATA_WIDTH_BS), - AttributesDescriptor("Word data width", DATA_WIDTH_W), - AttributesDescriptor("Long data width", DATA_WIDTH_L), - AttributesDescriptor("Data preprocessor directives", DATA_PREPROCESSOR), - AttributesDescriptor("Other preprocessor directives", OTHER_PREPROCESSOR), - AttributesDescriptor("Strings", STRING), - AttributesDescriptor("Numbers", NUMBER), - AttributesDescriptor("Address registers", AREG), - AttributesDescriptor("Data registers", DREG), - AttributesDescriptor("Special registers", SPECIAL_REG), - AttributesDescriptor("Comments", COMMENT), - AttributesDescriptor("Bad characters", BAD_CHARACTER)) + AttributesDescriptor("Global labels", GLOBAL_LABEL), + AttributesDescriptor("Local labels", LOCAL_LABEL), + AttributesDescriptor("Comma (separator)", SEPARATOR), + AttributesDescriptor("Colon", COLON), + AttributesDescriptor("Symbol definition", SYMBOLDEF), + AttributesDescriptor("Symbol reference", SYMBOL), + AttributesDescriptor("Assembly mnemonic", MNEMONIC), + AttributesDescriptor("Macro invocation", MACRO_CALL), + AttributesDescriptor("Byte/short data width", DATA_WIDTH_BS), + AttributesDescriptor("Word data width", DATA_WIDTH_W), + AttributesDescriptor("Long data width", DATA_WIDTH_L), + AttributesDescriptor("Data preprocessor directives", DATA_PREPROCESSOR), + AttributesDescriptor("Other preprocessor directives", OTHER_PREPROCESSOR), + AttributesDescriptor("Strings", STRING), + AttributesDescriptor("Numbers", NUMBER), + AttributesDescriptor("Address registers", AREG), + AttributesDescriptor("Data registers", DREG), + AttributesDescriptor("Special registers", SPECIAL_REG), + AttributesDescriptor("Comments", COMMENT), + AttributesDescriptor("Bad characters", BAD_CHARACTER) + ) } } \ No newline at end of file diff --git a/src/main/java/de/platon42/intellij/plugins/m68k/syntax/M68kSyntaxHighlighter.kt b/src/main/java/de/platon42/intellij/plugins/m68k/syntax/M68kSyntaxHighlighter.kt index 2f70bf5..32d8f94 100644 --- a/src/main/java/de/platon42/intellij/plugins/m68k/syntax/M68kSyntaxHighlighter.kt +++ b/src/main/java/de/platon42/intellij/plugins/m68k/syntax/M68kSyntaxHighlighter.kt @@ -5,19 +5,27 @@ import com.intellij.openapi.editor.DefaultLanguageHighlighterColors import com.intellij.openapi.editor.HighlighterColors import com.intellij.openapi.editor.colors.TextAttributesKey import com.intellij.openapi.fileTypes.SyntaxHighlighterBase +import com.intellij.openapi.project.Project import com.intellij.psi.TokenType import com.intellij.psi.tree.IElementType import de.platon42.intellij.plugins.m68k.lexer.M68kLexer +import de.platon42.intellij.plugins.m68k.lexer.M68kLexerPrefs import de.platon42.intellij.plugins.m68k.psi.M68kTypes -class M68kSyntaxHighlighter : SyntaxHighlighterBase() { +class M68kSyntaxHighlighter(val project: Project?) : SyntaxHighlighterBase() { override fun getHighlightingLexer(): Lexer { - return M68kLexer() + if (project == null) { + return M68kLexer(M68kLexerPrefs()) // Use some defaults + } else { + // FIXME Where do we get the prefs from? + return M68kLexer(M68kLexerPrefs()) + } } override fun getTokenHighlights(tokenType: IElementType): Array { return when (tokenType) { M68kTypes.SEPARATOR -> arrayOf(SEPARATOR) + M68kTypes.COLON -> arrayOf(COLON) M68kTypes.GLOBAL_LABEL_DEF, M68kTypes.GLOBAL_LABEL -> arrayOf(GLOBAL_LABEL) M68kTypes.LOCAL_LABEL_DEF, M68kTypes.LOCAL_LABEL -> arrayOf(LOCAL_LABEL) M68kTypes.SYMBOLDEF -> arrayOf(SYMBOLDEF) @@ -44,6 +52,7 @@ class M68kSyntaxHighlighter : SyntaxHighlighterBase() { val GLOBAL_LABEL = TextAttributesKey.createTextAttributesKey("M68K_LOCAL_LABEL", DefaultLanguageHighlighterColors.LOCAL_VARIABLE) val LOCAL_LABEL = TextAttributesKey.createTextAttributesKey("M68K_GLOBAL_LABEL", DefaultLanguageHighlighterColors.GLOBAL_VARIABLE) val SEPARATOR = TextAttributesKey.createTextAttributesKey("M68K_SEPARATOR", DefaultLanguageHighlighterColors.COMMA) + val COLON = TextAttributesKey.createTextAttributesKey("M68K_COLON", DefaultLanguageHighlighterColors.DOT) val SYMBOLDEF = TextAttributesKey.createTextAttributesKey("M68K_SYMBOLDEF", DefaultLanguageHighlighterColors.STATIC_FIELD) val SYMBOL = TextAttributesKey.createTextAttributesKey("M68K_SYMBOL", DefaultLanguageHighlighterColors.IDENTIFIER) val MNEMONIC = TextAttributesKey.createTextAttributesKey("M68K_MNEMONIC", DefaultLanguageHighlighterColors.FUNCTION_CALL) diff --git a/src/main/java/de/platon42/intellij/plugins/m68k/syntax/M68kSyntaxHighlighterFactory.kt b/src/main/java/de/platon42/intellij/plugins/m68k/syntax/M68kSyntaxHighlighterFactory.kt index e96aef5..7061460 100644 --- a/src/main/java/de/platon42/intellij/plugins/m68k/syntax/M68kSyntaxHighlighterFactory.kt +++ b/src/main/java/de/platon42/intellij/plugins/m68k/syntax/M68kSyntaxHighlighterFactory.kt @@ -5,5 +5,5 @@ import com.intellij.openapi.project.Project import com.intellij.openapi.vfs.VirtualFile class M68kSyntaxHighlighterFactory : SyntaxHighlighterFactory() { - override fun getSyntaxHighlighter(project: Project?, virtualFile: VirtualFile?) = M68kSyntaxHighlighter() + override fun getSyntaxHighlighter(project: Project?, virtualFile: VirtualFile?) = M68kSyntaxHighlighter(project) } \ No newline at end of file diff --git a/src/test/java/de/platon42/intellij/jupiter/ParsingTestExtension.java b/src/test/java/de/platon42/intellij/jupiter/ParsingTestExtension.java index 36d0ad9..1d59ad3 100644 --- a/src/test/java/de/platon42/intellij/jupiter/ParsingTestExtension.java +++ b/src/test/java/de/platon42/intellij/jupiter/ParsingTestExtension.java @@ -112,6 +112,9 @@ public class ParsingTestExtension implements ParameterResolver, AfterTestExecuti } public interface IParsingTestCase { + + ParserDefinition getParserDefinition(); + void ensureNoErrorElements(); void doTest(boolean checkResult); @@ -129,11 +132,14 @@ public class ParsingTestExtension implements ParameterResolver, AfterTestExecuti private static class ParsingTestCaseWrapper extends ParsingTestCase implements IParsingTestCase { private ExtensionContext extensionContext; + + private ParserDefinition parserDefinition; private static ExtensionContext extensionContextHack; private ParsingTestCaseWrapper(ExtensionContext extensionContext, String extension, ParserDefinition parserDefinition) { super(passthroughInitHack(extensionContext), extension, parserDefinition); this.extensionContext = extensionContext; + this.parserDefinition = parserDefinition; } private static String passthroughInitHack(ExtensionContext extensionContext) { @@ -159,6 +165,11 @@ public class ParsingTestExtension implements ParameterResolver, AfterTestExecuti super.tearDown(); // Clears fields! } + @Override + public ParserDefinition getParserDefinition() { + return parserDefinition; + } + @Override public String getName() { String testname = extensionContext.getDisplayName().replace(" ", "_"); diff --git a/src/test/java/de/platon42/intellij/plugins/m68k/parser/CommentsTest.kt b/src/test/java/de/platon42/intellij/plugins/m68k/parser/CommentsTest.kt index fef4b70..0786953 100644 --- a/src/test/java/de/platon42/intellij/plugins/m68k/parser/CommentsTest.kt +++ b/src/test/java/de/platon42/intellij/plugins/m68k/parser/CommentsTest.kt @@ -47,4 +47,40 @@ internal class CommentsTest : AbstractParsingTest() { internal fun end_of_line_comments(@MyTestCase testCase: ParsingTestExtension.IParsingTestCase) { testGoodSyntax(testCase, "foo = 1234; hi\n\n\nlabel; foo\n\n\n add.w d0,d0;narf \n\n") } + + @Test + internal fun comment_after_instruction_with_space_introduces_comment_option(@MyTestCase testCase: ParsingTestExtension.IParsingTestCase) { + (testCase.parserDefinition as M68kParserDefinition).lexerPrefs.spaceIntroducesComment = true + testGoodSyntax(testCase, " add.w d0,d0 hey comment\n") + } + + @Test + internal fun comment_after_assignment_with_space_introduces_comment_option(@MyTestCase testCase: ParsingTestExtension.IParsingTestCase) { + (testCase.parserDefinition as M68kParserDefinition).lexerPrefs.spaceIntroducesComment = true + testGoodSyntax(testCase, "FOO = 123+23 hey comment\n") + } + + @Test + internal fun comment_after_macro_call_with_space_introduces_comment_option(@MyTestCase testCase: ParsingTestExtension.IParsingTestCase) { + (testCase.parserDefinition as M68kParserDefinition).lexerPrefs.spaceIntroducesComment = true + testGoodSyntax(testCase, " PUSHM d0,d0 hey comment\n") + } + + @Test + internal fun space_does_not_start_comment_within_instruction_without_space_introduces_comment_option(@MyTestCase testCase: ParsingTestExtension.IParsingTestCase) { + (testCase.parserDefinition as M68kParserDefinition).lexerPrefs.spaceIntroducesComment = false + testGoodSyntax(testCase, " add.w # 234, d0 ; hey comment\n") + } + + @Test + internal fun space_does_not_start_comment_within_assignment_without_space_introduces_comment_option(@MyTestCase testCase: ParsingTestExtension.IParsingTestCase) { + (testCase.parserDefinition as M68kParserDefinition).lexerPrefs.spaceIntroducesComment = false + testGoodSyntax(testCase, "FOO = 123 + 23 ; hey comment\n") + } + + @Test + internal fun space_does_not_start_comment_within_macro_call_without_space_introduces_comment_option(@MyTestCase testCase: ParsingTestExtension.IParsingTestCase) { + (testCase.parserDefinition as M68kParserDefinition).lexerPrefs.spaceIntroducesComment = false + testGoodSyntax(testCase, " PUSHM d0, d0 ; hey comment\n") + } } \ No newline at end of file diff --git a/src/test/resources/parser/comments/comment_after_assignment_with_space_introduces_comment_option.txt b/src/test/resources/parser/comments/comment_after_assignment_with_space_introduces_comment_option.txt new file mode 100644 index 0000000..d7d921a --- /dev/null +++ b/src/test/resources/parser/comments/comment_after_assignment_with_space_introduces_comment_option.txt @@ -0,0 +1,16 @@ +Assembly File: a.asm + M68kStatementImpl(STATEMENT) + M68kAssignmentImpl(ASSIGNMENT) + PsiElement(M68kTokenType.SYMBOLDEF)('FOO') + PsiWhiteSpace(' ') + PsiElement(M68kTokenType.OP_ASSIGN)('=') + PsiWhiteSpace(' ') + M68kBinaryAddExprImpl(BINARY_ADD_EXPR) + M68kLiteralExprImpl(LITERAL_EXPR) + PsiElement(M68kTokenType.DECIMAL)('123') + PsiElement(M68kTokenType.OP_PLUS)('+') + M68kLiteralExprImpl(LITERAL_EXPR) + PsiElement(M68kTokenType.DECIMAL)('23') + PsiWhiteSpace(' ') + PsiComment(M68kTokenType.COMMENT)('hey comment') + PsiElement(M68kTokenType.EOL)('\n') \ No newline at end of file diff --git a/src/test/resources/parser/comments/comment_after_instruction_with_space_introduces_comment_option.txt b/src/test/resources/parser/comments/comment_after_instruction_with_space_introduces_comment_option.txt new file mode 100644 index 0000000..03bbf40 --- /dev/null +++ b/src/test/resources/parser/comments/comment_after_instruction_with_space_introduces_comment_option.txt @@ -0,0 +1,19 @@ +Assembly File: a.asm + PsiWhiteSpace(' ') + M68kStatementImpl(STATEMENT) + M68kAsmInstructionImpl(ASM_INSTRUCTION) + M68kAsmOpImpl(ASM_OP) + PsiElement(M68kTokenType.MNEMONIC)('add') + M68kOperandSizeImpl(OPERAND_SIZE) + PsiElement(M68kTokenType.OPSIZE_W)('.w') + PsiWhiteSpace(' ') + M68kDataRegisterDirectAddressingModeImpl(DATA_REGISTER_DIRECT_ADDRESSING_MODE) + M68kDataRegisterImpl(DATA_REGISTER) + PsiElement(M68kTokenType.DREG)('d0') + PsiElement(M68kTokenType.SEPARATOR)(',') + M68kDataRegisterDirectAddressingModeImpl(DATA_REGISTER_DIRECT_ADDRESSING_MODE) + M68kDataRegisterImpl(DATA_REGISTER) + PsiElement(M68kTokenType.DREG)('d0') + PsiWhiteSpace(' ') + PsiComment(M68kTokenType.COMMENT)('hey comment') + PsiElement(M68kTokenType.EOL)('\n') \ No newline at end of file diff --git a/src/test/resources/parser/comments/comment_after_macro_call_with_space_introduces_comment_option.txt b/src/test/resources/parser/comments/comment_after_macro_call_with_space_introduces_comment_option.txt new file mode 100644 index 0000000..9087d72 --- /dev/null +++ b/src/test/resources/parser/comments/comment_after_macro_call_with_space_introduces_comment_option.txt @@ -0,0 +1,12 @@ +Assembly File: a.asm + PsiWhiteSpace(' ') + M68kStatementImpl(STATEMENT) + M68kMacroCallImpl(MACRO_CALL) + PsiElement(M68kTokenType.MACRO_INVOKATION)('PUSHM') + PsiWhiteSpace(' ') + PsiElement(M68kTokenType.STRINGLIT)('d0') + PsiElement(M68kTokenType.SEPARATOR)(',') + PsiElement(M68kTokenType.STRINGLIT)('d0') + PsiWhiteSpace(' ') + PsiComment(M68kTokenType.COMMENT)('hey comment') + PsiElement(M68kTokenType.EOL)('\n') \ No newline at end of file diff --git a/src/test/resources/parser/comments/space_does_not_start_comment_within_assignment_without_space_introduces_comment_option.txt b/src/test/resources/parser/comments/space_does_not_start_comment_within_assignment_without_space_introduces_comment_option.txt new file mode 100644 index 0000000..8d8da99 --- /dev/null +++ b/src/test/resources/parser/comments/space_does_not_start_comment_within_assignment_without_space_introduces_comment_option.txt @@ -0,0 +1,18 @@ +Assembly File: a.asm + M68kStatementImpl(STATEMENT) + M68kAssignmentImpl(ASSIGNMENT) + PsiElement(M68kTokenType.SYMBOLDEF)('FOO') + PsiWhiteSpace(' ') + PsiElement(M68kTokenType.OP_ASSIGN)('=') + PsiWhiteSpace(' ') + M68kBinaryAddExprImpl(BINARY_ADD_EXPR) + M68kLiteralExprImpl(LITERAL_EXPR) + PsiElement(M68kTokenType.DECIMAL)('123') + PsiWhiteSpace(' ') + PsiElement(M68kTokenType.OP_PLUS)('+') + PsiWhiteSpace(' ') + M68kLiteralExprImpl(LITERAL_EXPR) + PsiElement(M68kTokenType.DECIMAL)('23') + PsiWhiteSpace(' ') + PsiComment(M68kTokenType.COMMENT)('; hey comment') + PsiElement(M68kTokenType.EOL)('\n') \ No newline at end of file diff --git a/src/test/resources/parser/comments/space_does_not_start_comment_within_instruction_without_space_introduces_comment_option.txt b/src/test/resources/parser/comments/space_does_not_start_comment_within_instruction_without_space_introduces_comment_option.txt new file mode 100644 index 0000000..0b5953c --- /dev/null +++ b/src/test/resources/parser/comments/space_does_not_start_comment_within_instruction_without_space_introduces_comment_option.txt @@ -0,0 +1,22 @@ +Assembly File: a.asm + PsiWhiteSpace(' ') + M68kStatementImpl(STATEMENT) + M68kAsmInstructionImpl(ASM_INSTRUCTION) + M68kAsmOpImpl(ASM_OP) + PsiElement(M68kTokenType.MNEMONIC)('add') + M68kOperandSizeImpl(OPERAND_SIZE) + PsiElement(M68kTokenType.OPSIZE_W)('.w') + PsiWhiteSpace(' ') + M68kImmediateDataImpl(IMMEDIATE_DATA) + PsiElement(M68kTokenType.HASH)('#') + PsiWhiteSpace(' ') + M68kLiteralExprImpl(LITERAL_EXPR) + PsiElement(M68kTokenType.DECIMAL)('234') + PsiElement(M68kTokenType.SEPARATOR)(',') + PsiWhiteSpace(' ') + M68kDataRegisterDirectAddressingModeImpl(DATA_REGISTER_DIRECT_ADDRESSING_MODE) + M68kDataRegisterImpl(DATA_REGISTER) + PsiElement(M68kTokenType.DREG)('d0') + PsiWhiteSpace(' ') + PsiComment(M68kTokenType.COMMENT)('; hey comment') + PsiElement(M68kTokenType.EOL)('\n') \ No newline at end of file diff --git a/src/test/resources/parser/comments/space_does_not_start_comment_within_macro_call_without_space_introduces_comment_option.txt b/src/test/resources/parser/comments/space_does_not_start_comment_within_macro_call_without_space_introduces_comment_option.txt new file mode 100644 index 0000000..3e14f79 --- /dev/null +++ b/src/test/resources/parser/comments/space_does_not_start_comment_within_macro_call_without_space_introduces_comment_option.txt @@ -0,0 +1,13 @@ +Assembly File: a.asm + PsiWhiteSpace(' ') + M68kStatementImpl(STATEMENT) + M68kMacroCallImpl(MACRO_CALL) + PsiElement(M68kTokenType.MACRO_INVOKATION)('PUSHM') + PsiWhiteSpace(' ') + PsiElement(M68kTokenType.STRINGLIT)('d0') + PsiElement(M68kTokenType.SEPARATOR)(',') + PsiWhiteSpace(' ') + PsiElement(M68kTokenType.STRINGLIT)('d0') + PsiWhiteSpace(' ') + PsiComment(M68kTokenType.COMMENT)('; hey comment') + PsiElement(M68kTokenType.EOL)('\n') \ No newline at end of file