diff --git a/.gitignore b/.gitignore index a36aa36e..958f5f00 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ .qodana .intellijPlatform build +tmp diff --git a/src/main/gen/io/vlang/lang/VlangParser.java b/src/main/gen/io/vlang/lang/VlangParser.java index 3bf6209e..bfe8f477 100644 --- a/src/main/gen/io/vlang/lang/VlangParser.java +++ b/src/main/gen/io/vlang/lang/VlangParser.java @@ -379,10 +379,10 @@ public static boolean AsmBlockStatement(PsiBuilder b, int l) { boolean r, p; Marker m = enter_section_(b, l, _NONE_, ASM_BLOCK_STATEMENT, null); r = consumeToken(b, ASM); - p = r; // pin = 1 - r = r && report_error_(b, AsmBlockStatement_1(b, l + 1)); - r = p && report_error_(b, consumeToken(b, IDENTIFIER)) && r; - r = p && AsmBlock(b, l + 1) && r; + r = r && AsmBlockStatement_1(b, l + 1); + r = r && consumeToken(b, IDENTIFIER); + p = r; // pin = 3 + r = r && AsmBlock(b, l + 1); exit_section_(b, l, m, r, p, null); return r || p; } @@ -1702,9 +1702,8 @@ private static boolean EnumDeclaration_1(PsiBuilder b, int l) { // EnumFieldDefinition ('=' Expression)? semi? public static boolean EnumFieldDeclaration(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "EnumFieldDeclaration")) return false; - if (!nextTokenIs(b, IDENTIFIER)) return false; boolean r, p; - Marker m = enter_section_(b, l, _NONE_, ENUM_FIELD_DECLARATION, null); + Marker m = enter_section_(b, l, _NONE_, ENUM_FIELD_DECLARATION, ""); r = EnumFieldDefinition(b, l + 1); p = r; // pin = 1 r = r && report_error_(b, EnumFieldDeclaration_1(b, l + 1)); @@ -1739,14 +1738,14 @@ private static boolean EnumFieldDeclaration_2(PsiBuilder b, int l) { } /* ********************************************************** */ - // identifier + // <> identifier public static boolean EnumFieldDefinition(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "EnumFieldDefinition")) return false; - if (!nextTokenIs(b, IDENTIFIER)) return false; boolean r; - Marker m = enter_section_(b); - r = consumeToken(b, IDENTIFIER); - exit_section_(b, m, ENUM_FIELD_DEFINITION, r); + Marker m = enter_section_(b, l, _NONE_, ENUM_FIELD_DEFINITION, ""); + r = remapToIdentifier(b, l + 1); + r = r && consumeToken(b, IDENTIFIER); + exit_section_(b, l, m, r, false, null); return r; } @@ -1754,7 +1753,6 @@ public static boolean EnumFieldDefinition(PsiBuilder b, int l) { // EnumFieldDeclaration (EnumFieldDeclaration)* static boolean EnumFields(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "EnumFields")) return false; - if (!nextTokenIs(b, IDENTIFIER)) return false; boolean r; Marker m = enter_section_(b); r = EnumFieldDeclaration(b, l + 1); @@ -2823,6 +2821,50 @@ private static boolean IfExpression_4_0_0(PsiBuilder b, int l) { return true; } + /* ********************************************************** */ + // implements TypeName (',' TypeName)* LastComma? + public static boolean ImplementsClause(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "ImplementsClause")) return false; + if (!nextTokenIs(b, IMPLEMENTS)) return false; + boolean r; + Marker m = enter_section_(b); + r = consumeToken(b, IMPLEMENTS); + r = r && TypeName(b, l + 1); + r = r && ImplementsClause_2(b, l + 1); + r = r && ImplementsClause_3(b, l + 1); + exit_section_(b, m, IMPLEMENTS_CLAUSE, r); + return r; + } + + // (',' TypeName)* + private static boolean ImplementsClause_2(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "ImplementsClause_2")) return false; + while (true) { + int c = current_position_(b); + if (!ImplementsClause_2_0(b, l + 1)) break; + if (!empty_element_parsed_guard_(b, "ImplementsClause_2", c)) break; + } + return true; + } + + // ',' TypeName + private static boolean ImplementsClause_2_0(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "ImplementsClause_2_0")) return false; + boolean r; + Marker m = enter_section_(b); + r = consumeToken(b, COMMA); + r = r && TypeName(b, l + 1); + exit_section_(b, m, null, r); + return r; + } + + // LastComma? + private static boolean ImplementsClause_3(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "ImplementsClause_3")) return false; + LastComma(b, l + 1); + return true; + } + /* ********************************************************** */ // as ImportAliasName public static boolean ImportAlias(PsiBuilder b, int l) { @@ -3469,6 +3511,18 @@ private static boolean LabeledStatement_1(PsiBuilder b, int l) { return true; } + /* ********************************************************** */ + // ',' + public static boolean LastComma(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "LastComma")) return false; + if (!nextTokenIs(b, COMMA)) return false; + boolean r; + Marker m = enter_section_(b); + r = consumeToken(b, COMMA); + exit_section_(b, m, LAST_COMMA, r); + return r; + } + /* ********************************************************** */ // ExpressionList public static boolean LeftHandExprList(PsiBuilder b, int l) { @@ -4190,13 +4244,15 @@ private static boolean QualifiedReferenceExpression_0(PsiBuilder b, int l) { } /* ********************************************************** */ - // '.' identifier + // '.' <> identifier public static boolean QualifiedTypeReferenceExpression(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "QualifiedTypeReferenceExpression")) return false; if (!nextTokenIs(b, DOT)) return false; boolean r; Marker m = enter_section_(b, l, _LEFT_, TYPE_REFERENCE_EXPRESSION, null); - r = consumeTokens(b, 0, DOT, IDENTIFIER); + r = consumeToken(b, DOT); + r = r && remapToIdentifier(b, l + 1); + r = r && consumeToken(b, IDENTIFIER); exit_section_(b, l, m, r, false, null); return r; } @@ -5696,7 +5752,7 @@ private static boolean StructDeclaration_1(PsiBuilder b, int l) { } /* ********************************************************** */ - // (struct | union) identifier GenericParameters? '{' FieldsGroup* '}' + // (struct | union) identifier GenericParameters? ImplementsClause? '{' FieldsGroup* '}' public static boolean StructType(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "StructType")) return false; if (!nextTokenIs(b, "", STRUCT, UNION)) return false; @@ -5706,8 +5762,9 @@ public static boolean StructType(PsiBuilder b, int l) { p = r; // pin = 1 r = r && report_error_(b, consumeToken(b, IDENTIFIER)); r = p && report_error_(b, StructType_2(b, l + 1)) && r; + r = p && report_error_(b, StructType_3(b, l + 1)) && r; r = p && report_error_(b, consumeToken(b, LBRACE)) && r; - r = p && report_error_(b, StructType_4(b, l + 1)) && r; + r = p && report_error_(b, StructType_5(b, l + 1)) && r; r = p && consumeToken(b, RBRACE) && r; exit_section_(b, l, m, r, p, null); return r || p; @@ -5729,13 +5786,20 @@ private static boolean StructType_2(PsiBuilder b, int l) { return true; } + // ImplementsClause? + private static boolean StructType_3(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "StructType_3")) return false; + ImplementsClause(b, l + 1); + return true; + } + // FieldsGroup* - private static boolean StructType_4(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "StructType_4")) return false; + private static boolean StructType_5(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "StructType_5")) return false; while (true) { int c = current_position_(b); if (!FieldsGroup(b, l + 1)) break; - if (!empty_element_parsed_guard_(b, "StructType_4", c)) break; + if (!empty_element_parsed_guard_(b, "StructType_5", c)) break; } return true; } @@ -6948,13 +7012,15 @@ private static boolean FunctionLit_2(PsiBuilder b, int l) { return true; } - // '.' identifier + // '.' <> identifier public static boolean EnumFetch(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "EnumFetch")) return false; if (!nextTokenIsSmart(b, DOT)) return false; boolean r; Marker m = enter_section_(b); - r = consumeTokensSmart(b, 2, DOT, IDENTIFIER); + r = consumeTokenSmart(b, DOT); + r = r && remapToIdentifier(b, l + 1); + r = r && consumeToken(b, IDENTIFIER); exit_section_(b, m, ENUM_FETCH, r); return r; } diff --git a/src/main/gen/io/vlang/lang/VlangTypes.java b/src/main/gen/io/vlang/lang/VlangTypes.java index 014d5a26..e0117446 100644 --- a/src/main/gen/io/vlang/lang/VlangTypes.java +++ b/src/main/gen/io/vlang/lang/VlangTypes.java @@ -93,6 +93,7 @@ public interface VlangTypes { IElementType GUARD_VAR_DECLARATION = new VlangCompositeElementType("GUARD_VAR_DECLARATION"); IElementType IF_ATTRIBUTE = new VlangCompositeElementType("IF_ATTRIBUTE"); IElementType IF_EXPRESSION = new VlangCompositeElementType("IF_EXPRESSION"); + IElementType IMPLEMENTS_CLAUSE = new VlangCompositeElementType("IMPLEMENTS_CLAUSE"); IElementType IMPORT_ALIAS = VlangElementTypeFactory.stubFactory("IMPORT_ALIAS"); IElementType IMPORT_ALIAS_NAME = new VlangCompositeElementType("IMPORT_ALIAS_NAME"); IElementType IMPORT_DECLARATION = new VlangCompositeElementType("IMPORT_DECLARATION"); @@ -117,6 +118,7 @@ public interface VlangTypes { IElementType LABELED_STATEMENT = new VlangCompositeElementType("LABELED_STATEMENT"); IElementType LABEL_DEFINITION = VlangElementTypeFactory.stubFactory("LABEL_DEFINITION"); IElementType LABEL_REF = new VlangCompositeElementType("LABEL_REF"); + IElementType LAST_COMMA = new VlangCompositeElementType("LAST_COMMA"); IElementType LEFT_HAND_EXPR_LIST = new VlangCompositeElementType("LEFT_HAND_EXPR_LIST"); IElementType LITERAL = new VlangCompositeElementType("LITERAL"); IElementType LITERAL_VALUE_EXPRESSION = new VlangCompositeElementType("LITERAL_VALUE_EXPRESSION"); @@ -280,6 +282,7 @@ public interface VlangTypes { IElementType IDENTIFIER = new VlangTokenType("identifier"); IElementType IF = new VlangTokenType("if"); IElementType IF_COMPILE_TIME = new VlangTokenType("$if"); + IElementType IMPLEMENTS = new VlangTokenType("implements"); IElementType IMPORT = new VlangTokenType("import"); IElementType IN = new VlangTokenType("in"); IElementType INT = new VlangTokenType("int"); @@ -608,6 +611,9 @@ else if (type == IF_ATTRIBUTE) { else if (type == IF_EXPRESSION) { return new VlangIfExpressionImpl(node); } + else if (type == IMPLEMENTS_CLAUSE) { + return new VlangImplementsClauseImpl(node); + } else if (type == IMPORT_ALIAS) { return new VlangImportAliasImpl(node); } @@ -680,6 +686,9 @@ else if (type == LABEL_DEFINITION) { else if (type == LABEL_REF) { return new VlangLabelRefImpl(node); } + else if (type == LAST_COMMA) { + return new VlangLastCommaImpl(node); + } else if (type == LEFT_HAND_EXPR_LIST) { return new VlangLeftHandExprListImpl(node); } diff --git a/src/main/gen/io/vlang/lang/_VlangLexer.java b/src/main/gen/io/vlang/lang/_VlangLexer.java index f0889b90..ea58b3e5 100644 --- a/src/main/gen/io/vlang/lang/_VlangLexer.java +++ b/src/main/gen/io/vlang/lang/_VlangLexer.java @@ -315,19 +315,19 @@ private static int zzUnpackcmap_blocks(String packed, int offset, int [] result) "\11\32\1\146\7\32\1\147\1\150\1\32\1\151\1\152"+ "\15\32\1\0\1\53\1\55\1\153\5\61\1\32\1\154"+ "\1\155\4\0\1\156\2\32\4\0\6\32\1\157\1\160"+ - "\1\161\1\32\1\162\3\32\1\163\2\32\1\164\10\32"+ + "\1\161\1\32\1\162\4\32\1\163\2\32\1\164\10\32"+ "\1\165\1\166\3\32\1\53\1\155\1\61\1\167\3\61"+ "\1\170\2\32\1\111\2\0\1\111\2\32\1\171\1\172"+ - "\1\32\1\173\1\174\3\32\1\175\2\32\1\176\3\32"+ + "\1\32\1\173\1\174\4\32\1\175\2\32\1\176\3\32"+ "\1\177\3\32\1\200\2\32\1\53\4\61\2\32\4\0"+ - "\1\201\1\202\1\32\1\203\2\32\1\204\1\205\1\206"+ + "\1\201\1\202\2\32\1\203\2\32\1\204\1\205\1\206"+ "\1\207\1\210\1\211\1\212\1\213\1\214\1\32\1\53"+ - "\1\61\2\32\3\0\4\32\1\53\1\61\1\215\1\32"+ - "\2\0\1\216\2\32\2\217\1\32\2\111\1\220\1\221"+ - "\1\222\4\0"; + "\1\61\2\32\3\0\5\32\1\53\1\61\1\215\1\32"+ + "\2\0\1\216\3\32\2\217\1\32\2\111\1\32\1\220"+ + "\1\221\1\222\2\0\1\223\2\0"; private static int [] zzUnpackAction() { - int [] result = new int[411]; + int [] result = new int[418]; int offset = 0; offset = zzUnpackAction(ZZ_ACTION_PACKED_0, offset, result); return result; @@ -389,24 +389,25 @@ private static int zzUnpackAction(String packed, int offset, int [] result) { "\0\u2c3d\0\u2c88\0\u2cd3\0\u2d1e\0\u02a3\0\u3b79\0\u3bc4\0\u3c0f"+ "\0\u3c5a\0\u3ca5\0\u3cf0\0\u3d3b\0\u3d86\0\u3dd1\0\u3e1c\0\u3e67"+ "\0\u3eb2\0\u08ca\0\u08ca\0\u08ca\0\u3efd\0\u08ca\0\u3f48\0\u3f93"+ - "\0\u3fde\0\u08ca\0\u4029\0\u4074\0\u08ca\0\u40bf\0\u410a\0\u4155"+ - "\0\u41a0\0\u41eb\0\u4236\0\u4281\0\u42cc\0\u08ca\0\u4317\0\u4362"+ - "\0\u43ad\0\u43f8\0\u4443\0\u1437\0\u448e\0\u44d9\0\u4524\0\u456f"+ - "\0\u45ba\0\u08ca\0\u4605\0\u4650\0\u469b\0\u46e6\0\u4731\0\u477c"+ - "\0\u47c7\0\u4812\0\u08ca\0\u08ca\0\u485d\0\u08ca\0\u08ca\0\u48a8"+ - "\0\u48f3\0\u493e\0\u08ca\0\u4989\0\u49d4\0\u08ca\0\u4a1f\0\u4a6a"+ - "\0\u4ab5\0\u08ca\0\u4b00\0\u4b4b\0\u4b96\0\u08ca\0\u4be1\0\u4c2c"+ + "\0\u3fde\0\u4029\0\u08ca\0\u4074\0\u40bf\0\u08ca\0\u410a\0\u4155"+ + "\0\u41a0\0\u41eb\0\u4236\0\u4281\0\u42cc\0\u4317\0\u08ca\0\u4362"+ + "\0\u43ad\0\u43f8\0\u4443\0\u448e\0\u1437\0\u44d9\0\u4524\0\u456f"+ + "\0\u45ba\0\u4605\0\u08ca\0\u4650\0\u469b\0\u46e6\0\u4731\0\u477c"+ + "\0\u47c7\0\u4812\0\u485d\0\u08ca\0\u08ca\0\u48a8\0\u08ca\0\u08ca"+ + "\0\u48f3\0\u493e\0\u4989\0\u49d4\0\u08ca\0\u4a1f\0\u4a6a\0\u08ca"+ + "\0\u4ab5\0\u4b00\0\u4b4b\0\u08ca\0\u4b96\0\u4be1\0\u4c2c\0\u08ca"+ "\0\u4c77\0\u4cc2\0\u4d0d\0\u4d58\0\u4da3\0\u4dee\0\u4e39\0\u4e84"+ - "\0\u4ecf\0\u4f1a\0\u4f65\0\u08ca\0\u08ca\0\u4fb0\0\u08ca\0\u4ffb"+ - "\0\u5046\0\u08ca\0\u08ca\0\u08ca\0\u08ca\0\u08ca\0\u08ca\0\u08ca"+ - "\0\u08ca\0\u08ca\0\u5091\0\u50dc\0\u5127\0\u5172\0\u51bd\0\u5208"+ + "\0\u4ecf\0\u4f1a\0\u4f65\0\u4fb0\0\u4ffb\0\u08ca\0\u08ca\0\u5046"+ + "\0\u5091\0\u08ca\0\u50dc\0\u5127\0\u08ca\0\u08ca\0\u08ca\0\u08ca"+ + "\0\u08ca\0\u08ca\0\u08ca\0\u08ca\0\u08ca\0\u5172\0\u51bd\0\u5208"+ "\0\u5253\0\u529e\0\u52e9\0\u5334\0\u537f\0\u53ca\0\u5415\0\u5460"+ - "\0\u08ca\0\u54ab\0\u54f6\0\u5541\0\u08ca\0\u558c\0\u55d7\0\u08ca"+ - "\0\u1356\0\u5622\0\u566d\0\u56b8\0\u08ca\0\u08ca\0\u08ca\0\u5703"+ - "\0\u574e\0\u5799\0\u57e4"; + "\0\u54ab\0\u54f6\0\u5541\0\u558c\0\u08ca\0\u55d7\0\u5622\0\u566d"+ + "\0\u08ca\0\u56b8\0\u5703\0\u574e\0\u08ca\0\u1356\0\u5799\0\u57e4"+ + "\0\u582f\0\u587a\0\u08ca\0\u08ca\0\u08ca\0\u58c5\0\u5910\0\u08ca"+ + "\0\u595b\0\u59a6"; private static int [] zzUnpackRowMap() { - int [] result = new int[411]; + int [] result = new int[418]; int offset = 0; offset = zzUnpackRowMap(ZZ_ROWMAP_PACKED_0, offset, result); return result; @@ -636,163 +637,172 @@ private static int zzUnpackRowMap(String packed, int offset, int [] result) { "\20\45\1\u0125\7\45\4\0\1\45\25\0\4\45\7\0"+ "\10\45\4\0\1\45\1\0\15\45\1\u0126\12\45\4\0"+ "\1\45\25\0\4\45\7\0\10\45\4\0\1\45\1\0"+ - "\15\45\1\u0127\12\45\4\0\1\45\25\0\4\45\7\0"+ - "\10\45\4\0\1\45\1\0\4\45\1\u0128\23\45\4\0"+ + "\12\45\1\u0127\2\45\1\u0128\12\45\4\0\1\45\25\0"+ + "\4\45\7\0\10\45\4\0\1\45\1\0\4\45\1\u0129"+ + "\23\45\4\0\1\45\25\0\4\45\7\0\10\45\4\0"+ + "\1\45\1\0\4\45\1\u012a\23\45\4\0\1\45\25\0"+ + "\4\45\7\0\10\45\4\0\1\45\1\0\11\45\1\u012b"+ + "\16\45\4\0\1\45\25\0\4\45\7\0\10\45\4\0"+ + "\1\45\1\0\2\45\1\u012c\25\45\4\0\1\45\25\0"+ + "\4\45\7\0\10\45\4\0\1\45\1\0\22\45\1\u012d"+ + "\5\45\4\0\1\45\25\0\4\45\7\0\10\45\4\0"+ + "\1\45\1\0\4\45\1\u012e\23\45\4\0\1\45\25\0"+ + "\4\45\7\0\10\45\4\0\1\45\1\0\22\45\1\u012f"+ + "\5\45\4\0\1\45\25\0\4\45\7\0\10\45\4\0"+ + "\1\45\1\0\2\45\1\u0130\25\45\4\0\1\45\25\0"+ + "\4\45\7\0\10\45\4\0\1\45\1\0\4\45\1\u0131"+ + "\23\45\4\0\1\45\25\0\4\45\7\0\10\45\4\0"+ + "\1\45\1\0\17\45\1\u0132\10\45\4\0\1\45\25\0"+ + "\4\45\7\0\10\45\4\0\1\45\1\0\4\45\1\u0133"+ + "\23\45\4\0\1\45\25\0\4\45\7\0\10\45\4\0"+ + "\1\45\1\0\24\45\1\u0134\3\45\4\0\1\45\25\0"+ + "\4\45\7\0\10\45\4\0\1\45\1\0\21\45\1\u0135"+ + "\6\45\4\0\1\45\25\0\4\45\7\0\10\45\4\0"+ + "\1\45\1\0\22\45\1\u0136\5\45\4\0\1\45\25\0"+ + "\4\45\7\0\10\45\4\0\1\45\1\0\4\45\1\u0137"+ + "\23\45\4\0\1\45\25\0\4\45\7\0\10\45\4\0"+ + "\1\45\1\0\4\45\1\u0138\23\45\4\0\1\45\25\0"+ + "\4\45\7\0\10\45\4\0\1\45\1\0\15\45\1\u0139"+ + "\12\45\4\0\1\45\25\0\4\45\7\0\10\45\4\0"+ + "\1\45\1\0\1\u013a\27\45\4\0\1\45\25\0\4\45"+ + "\7\0\10\45\4\0\1\45\1\0\1\u013b\27\45\4\0"+ + "\1\45\24\0\1\u0110\113\0\4\125\7\0\10\125\4\0"+ + "\1\125\1\0\1\u013c\27\125\4\0\1\125\2\131\1\0"+ + "\2\131\1\0\16\131\1\u013d\63\131\1\0\2\131\2\144"+ + "\1\0\2\144\1\0\60\144\1\u013e\26\144\1\0\2\144"+ + "\1\0\56\144\1\u013f\30\144\1\0\2\144\1\0\62\144"+ + "\1\u0140\24\144\1\0\2\144\1\0\54\144\1\u0141\32\144"+ + "\1\0\2\144\1\0\52\144\1\u0142\32\144\25\0\4\45"+ + "\7\0\10\45\4\0\1\45\1\0\4\45\1\u0143\23\45"+ + "\4\0\1\45\25\0\4\45\7\0\10\45\4\0\1\45"+ + "\1\0\15\45\1\u0144\12\45\4\0\1\45\25\0\4\45"+ + "\7\0\10\45\4\0\1\45\1\0\5\45\1\u0145\22\45"+ + "\4\0\1\45\25\0\3\u0146\110\0\4\u0147\7\0\3\u0147"+ + "\13\0\6\u0147\54\0\4\u0148\7\0\3\u0148\13\0\6\u0148"+ + "\54\0\4\u0149\7\0\3\u0149\13\0\6\u0149\54\0\4\45"+ + "\7\0\10\45\4\0\1\45\1\0\17\45\1\u014a\10\45"+ + "\4\0\1\45\25\0\4\45\7\0\10\45\4\0\1\45"+ + "\1\0\10\45\1\u014b\17\45\4\0\1\45\25\0\4\45"+ + "\7\0\10\45\4\0\1\45\1\0\11\45\1\u014c\16\45"+ + "\4\0\1\45\25\0\4\45\7\0\10\45\4\0\1\45"+ + "\1\0\21\45\1\u014d\6\45\4\0\1\45\25\0\4\45"+ + "\7\0\10\45\4\0\1\45\1\0\10\45\1\u014e\17\45"+ + "\4\0\1\45\25\0\4\45\7\0\10\45\4\0\1\45"+ + "\1\0\17\45\1\u014f\10\45\4\0\1\45\25\0\4\45"+ + "\7\0\10\45\4\0\1\45\1\0\4\45\1\u0150\23\45"+ + "\4\0\1\45\25\0\4\45\7\0\10\45\4\0\1\45"+ + "\1\0\4\45\1\u0151\23\45\4\0\1\45\25\0\4\45"+ + "\7\0\10\45\4\0\1\45\1\0\17\45\1\u0152\10\45"+ + "\4\0\1\45\25\0\4\45\7\0\10\45\4\0\1\45"+ + "\1\0\17\45\1\u0153\10\45\4\0\1\45\25\0\4\45"+ + "\7\0\10\45\4\0\1\45\1\0\5\45\1\u0154\22\45"+ + "\4\0\1\45\25\0\4\45\7\0\10\45\4\0\1\45"+ + "\1\0\7\45\1\u0155\20\45\4\0\1\45\25\0\4\45"+ + "\7\0\10\45\4\0\1\45\1\0\12\45\1\u0156\15\45"+ + "\4\0\1\45\25\0\4\45\7\0\10\45\4\0\1\45"+ + "\1\0\17\45\1\u0157\10\45\4\0\1\45\25\0\4\45"+ + "\7\0\10\45\4\0\1\45\1\0\11\45\1\u0158\16\45"+ + "\4\0\1\45\25\0\4\45\7\0\10\45\4\0\1\45"+ + "\1\0\2\45\1\u0159\25\45\4\0\1\45\25\0\4\45"+ + "\7\0\10\45\4\0\1\45\1\0\4\45\1\u015a\23\45"+ + "\4\0\1\45\25\0\4\45\7\0\10\45\4\0\1\45"+ + "\1\0\15\45\1\u015b\12\45\4\0\1\45\25\0\4\45"+ + "\7\0\10\45\4\0\1\45\1\0\14\45\1\u015c\13\45"+ + "\4\0\1\45\25\0\4\45\7\0\10\45\4\0\1\45"+ + "\1\0\10\45\1\u015d\17\45\4\0\1\45\25\0\4\45"+ + "\7\0\10\45\4\0\1\45\1\0\2\45\1\u015e\25\45"+ + "\4\0\1\45\25\0\4\45\7\0\10\45\4\0\1\45"+ + "\1\0\15\45\1\u015f\12\45\4\0\1\45\25\0\4\45"+ + "\7\0\10\45\4\0\1\45\1\0\14\45\1\u0160\13\45"+ + "\4\0\1\45\25\0\4\45\7\0\10\45\4\0\1\45"+ + "\1\0\5\45\1\u0161\22\45\4\0\1\45\25\0\4\45"+ + "\7\0\10\45\4\0\1\45\1\0\21\45\1\u0162\6\45"+ + "\4\0\1\45\25\0\4\125\7\0\10\125\4\0\1\125"+ + "\1\0\21\125\1\u0163\6\125\4\0\1\125\2\144\1\0"+ + "\2\144\1\0\64\144\1\u0164\20\144\2\u013f\1\0\2\u013f"+ + "\1\0\105\u013f\2\144\1\0\2\144\1\0\72\144\1\u0165"+ + "\14\144\1\0\2\144\1\0\67\144\1\u0166\17\144\1\0"+ + "\2\144\1\0\65\144\1\u0167\17\144\25\0\4\45\7\0"+ + "\10\45\4\0\1\45\1\0\1\45\1\u0168\26\45\4\0"+ "\1\45\25\0\4\45\7\0\10\45\4\0\1\45\1\0"+ - "\4\45\1\u0129\23\45\4\0\1\45\25\0\4\45\7\0"+ - "\10\45\4\0\1\45\1\0\11\45\1\u012a\16\45\4\0"+ + "\20\45\1\u0169\7\45\4\0\1\45\51\0\1\u016a\3\0"+ + "\1\333\62\0\4\u016b\7\0\3\u016b\13\0\6\u016b\54\0"+ + "\4\u016c\7\0\3\u016c\13\0\6\u016c\100\0\1\u016d\3\0"+ + "\1\333\62\0\4\45\7\0\10\45\4\0\1\45\1\0"+ + "\21\45\1\u016e\6\45\4\0\1\45\25\0\4\45\7\0"+ + "\10\45\4\0\1\45\1\0\2\45\1\u016f\25\45\4\0"+ "\1\45\25\0\4\45\7\0\10\45\4\0\1\45\1\0"+ - "\2\45\1\u012b\25\45\4\0\1\45\25\0\4\45\7\0"+ - "\10\45\4\0\1\45\1\0\22\45\1\u012c\5\45\4\0"+ + "\14\45\1\u0170\13\45\4\0\1\45\25\0\4\45\7\0"+ + "\10\45\4\0\1\45\1\0\13\45\1\u0171\14\45\4\0"+ "\1\45\25\0\4\45\7\0\10\45\4\0\1\45\1\0"+ - "\4\45\1\u012d\23\45\4\0\1\45\25\0\4\45\7\0"+ - "\10\45\4\0\1\45\1\0\22\45\1\u012e\5\45\4\0"+ + "\21\45\1\u0172\6\45\4\0\1\45\25\0\4\45\7\0"+ + "\10\45\4\0\1\45\1\0\5\45\1\u0173\22\45\4\0"+ "\1\45\25\0\4\45\7\0\10\45\4\0\1\45\1\0"+ - "\2\45\1\u012f\25\45\4\0\1\45\25\0\4\45\7\0"+ - "\10\45\4\0\1\45\1\0\4\45\1\u0130\23\45\4\0"+ + "\21\45\1\u0174\6\45\4\0\1\45\25\0\4\45\7\0"+ + "\10\45\4\0\1\45\1\0\4\45\1\u0175\23\45\4\0"+ "\1\45\25\0\4\45\7\0\10\45\4\0\1\45\1\0"+ - "\17\45\1\u0131\10\45\4\0\1\45\25\0\4\45\7\0"+ - "\10\45\4\0\1\45\1\0\4\45\1\u0132\23\45\4\0"+ + "\14\45\1\u0176\13\45\4\0\1\45\25\0\4\45\7\0"+ + "\10\45\4\0\1\45\1\0\21\45\1\u0177\6\45\4\0"+ "\1\45\25\0\4\45\7\0\10\45\4\0\1\45\1\0"+ - "\24\45\1\u0133\3\45\4\0\1\45\25\0\4\45\7\0"+ - "\10\45\4\0\1\45\1\0\21\45\1\u0134\6\45\4\0"+ + "\3\45\1\u0178\24\45\4\0\1\45\25\0\4\45\7\0"+ + "\10\45\4\0\1\45\1\0\5\45\1\u0179\22\45\4\0"+ "\1\45\25\0\4\45\7\0\10\45\4\0\1\45\1\0"+ - "\22\45\1\u0135\5\45\4\0\1\45\25\0\4\45\7\0"+ - "\10\45\4\0\1\45\1\0\4\45\1\u0136\23\45\4\0"+ + "\2\45\1\u017a\25\45\4\0\1\45\25\0\4\45\7\0"+ + "\10\45\4\0\1\45\1\0\21\45\1\u017b\6\45\4\0"+ "\1\45\25\0\4\45\7\0\10\45\4\0\1\45\1\0"+ - "\4\45\1\u0137\23\45\4\0\1\45\25\0\4\45\7\0"+ - "\10\45\4\0\1\45\1\0\15\45\1\u0138\12\45\4\0"+ + "\5\45\1\u017c\22\45\4\0\1\45\25\0\4\45\7\0"+ + "\10\45\4\0\1\45\1\0\4\45\1\u017d\23\45\4\0"+ "\1\45\25\0\4\45\7\0\10\45\4\0\1\45\1\0"+ - "\1\u0139\27\45\4\0\1\45\25\0\4\45\7\0\10\45"+ - "\4\0\1\45\1\0\1\u013a\27\45\4\0\1\45\24\0"+ - "\1\u0110\113\0\4\125\7\0\10\125\4\0\1\125\1\0"+ - "\1\u013b\27\125\4\0\1\125\2\131\1\0\2\131\1\0"+ - "\16\131\1\u013c\63\131\1\0\2\131\2\144\1\0\2\144"+ - "\1\0\60\144\1\u013d\26\144\1\0\2\144\1\0\56\144"+ - "\1\u013e\30\144\1\0\2\144\1\0\62\144\1\u013f\24\144"+ - "\1\0\2\144\1\0\54\144\1\u0140\32\144\1\0\2\144"+ - "\1\0\52\144\1\u0141\32\144\25\0\4\45\7\0\10\45"+ - "\4\0\1\45\1\0\4\45\1\u0142\23\45\4\0\1\45"+ - "\25\0\4\45\7\0\10\45\4\0\1\45\1\0\15\45"+ - "\1\u0143\12\45\4\0\1\45\25\0\4\45\7\0\10\45"+ - "\4\0\1\45\1\0\5\45\1\u0144\22\45\4\0\1\45"+ - "\25\0\3\u0145\110\0\4\u0146\7\0\3\u0146\13\0\6\u0146"+ - "\54\0\4\u0147\7\0\3\u0147\13\0\6\u0147\54\0\4\u0148"+ - "\7\0\3\u0148\13\0\6\u0148\54\0\4\45\7\0\10\45"+ - "\4\0\1\45\1\0\17\45\1\u0149\10\45\4\0\1\45"+ - "\25\0\4\45\7\0\10\45\4\0\1\45\1\0\10\45"+ - "\1\u014a\17\45\4\0\1\45\25\0\4\45\7\0\10\45"+ - "\4\0\1\45\1\0\11\45\1\u014b\16\45\4\0\1\45"+ - "\25\0\4\45\7\0\10\45\4\0\1\45\1\0\21\45"+ - "\1\u014c\6\45\4\0\1\45\25\0\4\45\7\0\10\45"+ - "\4\0\1\45\1\0\10\45\1\u014d\17\45\4\0\1\45"+ - "\25\0\4\45\7\0\10\45\4\0\1\45\1\0\17\45"+ - "\1\u014e\10\45\4\0\1\45\25\0\4\45\7\0\10\45"+ - "\4\0\1\45\1\0\4\45\1\u014f\23\45\4\0\1\45"+ - "\25\0\4\45\7\0\10\45\4\0\1\45\1\0\17\45"+ - "\1\u0150\10\45\4\0\1\45\25\0\4\45\7\0\10\45"+ - "\4\0\1\45\1\0\17\45\1\u0151\10\45\4\0\1\45"+ - "\25\0\4\45\7\0\10\45\4\0\1\45\1\0\5\45"+ - "\1\u0152\22\45\4\0\1\45\25\0\4\45\7\0\10\45"+ - "\4\0\1\45\1\0\7\45\1\u0153\20\45\4\0\1\45"+ + "\10\45\1\u017e\17\45\4\0\1\45\25\0\4\125\7\0"+ + "\10\125\4\0\1\125\1\0\10\125\1\u017f\17\125\4\0"+ + "\1\125\2\144\1\0\2\144\1\0\54\144\1\u013f\32\144"+ + "\1\0\2\144\1\0\53\144\1\u0164\33\144\1\0\2\144"+ + "\1\0\71\144\1\u013f\15\144\1\0\2\144\1\0\64\144"+ + "\1\u0180\20\144\25\0\4\45\7\0\10\45\4\0\1\45"+ + "\1\0\1\u0181\27\45\4\0\1\45\25\0\4\45\7\0"+ + "\10\45\4\0\1\45\1\0\4\45\1\u0182\23\45\4\0"+ + "\1\45\25\0\3\u0183\110\0\4\u0184\7\0\3\u0184\13\0"+ + "\6\u0184\54\0\4\216\7\0\3\216\13\0\6\216\132\0"+ + "\1\u0185\34\0\4\45\7\0\10\45\4\0\1\45\1\0"+ + "\22\45\1\u0186\5\45\4\0\1\45\25\0\4\45\7\0"+ + "\10\45\4\0\1\45\1\0\4\45\1\u0187\23\45\4\0"+ + "\1\45\25\0\4\45\7\0\10\45\4\0\1\45\1\0"+ + "\1\u0188\27\45\4\0\1\45\25\0\4\45\7\0\10\45"+ + "\4\0\1\45\1\0\26\45\1\u0189\1\45\4\0\1\45"+ "\25\0\4\45\7\0\10\45\4\0\1\45\1\0\12\45"+ - "\1\u0154\15\45\4\0\1\45\25\0\4\45\7\0\10\45"+ - "\4\0\1\45\1\0\17\45\1\u0155\10\45\4\0\1\45"+ - "\25\0\4\45\7\0\10\45\4\0\1\45\1\0\11\45"+ - "\1\u0156\16\45\4\0\1\45\25\0\4\45\7\0\10\45"+ - "\4\0\1\45\1\0\2\45\1\u0157\25\45\4\0\1\45"+ + "\1\u018a\15\45\4\0\1\45\25\0\4\125\7\0\10\125"+ + "\4\0\1\125\1\0\12\125\1\u018b\15\125\4\0\1\125"+ + "\2\144\1\0\2\144\1\0\55\144\1\u018c\27\144\25\0"+ + "\4\45\7\0\10\45\4\0\1\45\1\0\12\45\1\u018d"+ + "\15\45\4\0\1\45\25\0\4\45\7\0\10\45\4\0"+ + "\1\45\1\0\21\45\1\u018e\6\45\4\0\1\45\25\0"+ + "\3\u018f\110\0\4\u011a\7\0\3\u011a\13\0\6\u011a\54\0"+ + "\4\u0190\7\0\3\u0190\13\0\6\u0190\54\0\4\45\7\0"+ + "\10\45\4\0\1\45\1\0\4\45\1\u0191\23\45\4\0"+ + "\1\45\25\0\4\45\7\0\10\45\4\0\1\45\1\0"+ + "\14\45\1\u0192\13\45\4\0\1\45\25\0\4\45\7\0"+ + "\10\45\4\0\1\45\1\0\2\45\1\u0193\25\45\4\0"+ + "\1\45\25\0\4\45\7\0\10\45\4\0\1\45\1\0"+ + "\16\45\1\u0194\11\45\4\0\1\45\25\0\4\45\7\0"+ + "\10\45\4\0\1\45\1\0\4\45\1\u0195\23\45\4\0"+ + "\1\45\25\0\4\125\7\0\10\125\4\0\1\125\1\0"+ + "\4\125\1\u0196\23\125\4\0\1\125\2\144\1\0\2\144"+ + "\1\0\60\144\1\u010a\24\144\25\0\4\45\7\0\10\45"+ + "\4\0\1\45\1\0\15\45\1\u0197\12\45\4\0\1\45"+ + "\25\0\3\u0198\110\0\4\u0199\7\0\3\u0199\13\0\6\u0199"+ + "\54\0\4\45\7\0\10\45\4\0\1\45\1\0\21\45"+ + "\1\u019a\6\45\4\0\1\45\25\0\4\45\7\0\10\45"+ + "\4\0\1\45\1\0\4\45\1\u019b\23\45\4\0\1\45"+ "\25\0\4\45\7\0\10\45\4\0\1\45\1\0\4\45"+ - "\1\u0158\23\45\4\0\1\45\25\0\4\45\7\0\10\45"+ - "\4\0\1\45\1\0\15\45\1\u0159\12\45\4\0\1\45"+ - "\25\0\4\45\7\0\10\45\4\0\1\45\1\0\14\45"+ - "\1\u015a\13\45\4\0\1\45\25\0\4\45\7\0\10\45"+ - "\4\0\1\45\1\0\10\45\1\u015b\17\45\4\0\1\45"+ - "\25\0\4\45\7\0\10\45\4\0\1\45\1\0\2\45"+ - "\1\u015c\25\45\4\0\1\45\25\0\4\45\7\0\10\45"+ - "\4\0\1\45\1\0\15\45\1\u015d\12\45\4\0\1\45"+ - "\25\0\4\45\7\0\10\45\4\0\1\45\1\0\14\45"+ - "\1\u015e\13\45\4\0\1\45\25\0\4\45\7\0\10\45"+ - "\4\0\1\45\1\0\5\45\1\u015f\22\45\4\0\1\45"+ - "\25\0\4\45\7\0\10\45\4\0\1\45\1\0\21\45"+ - "\1\u0160\6\45\4\0\1\45\25\0\4\125\7\0\10\125"+ - "\4\0\1\125\1\0\21\125\1\u0161\6\125\4\0\1\125"+ - "\2\144\1\0\2\144\1\0\64\144\1\u0162\20\144\2\u013e"+ - "\1\0\2\u013e\1\0\105\u013e\2\144\1\0\2\144\1\0"+ - "\72\144\1\u0163\14\144\1\0\2\144\1\0\67\144\1\u0164"+ - "\17\144\1\0\2\144\1\0\65\144\1\u0165\17\144\25\0"+ - "\4\45\7\0\10\45\4\0\1\45\1\0\1\45\1\u0166"+ - "\26\45\4\0\1\45\25\0\4\45\7\0\10\45\4\0"+ - "\1\45\1\0\20\45\1\u0167\7\45\4\0\1\45\51\0"+ - "\1\u0168\3\0\1\333\62\0\4\u0169\7\0\3\u0169\13\0"+ - "\6\u0169\54\0\4\u016a\7\0\3\u016a\13\0\6\u016a\100\0"+ - "\1\u016b\3\0\1\333\62\0\4\45\7\0\10\45\4\0"+ - "\1\45\1\0\21\45\1\u016c\6\45\4\0\1\45\25\0"+ - "\4\45\7\0\10\45\4\0\1\45\1\0\2\45\1\u016d"+ - "\25\45\4\0\1\45\25\0\4\45\7\0\10\45\4\0"+ - "\1\45\1\0\14\45\1\u016e\13\45\4\0\1\45\25\0"+ - "\4\45\7\0\10\45\4\0\1\45\1\0\21\45\1\u016f"+ - "\6\45\4\0\1\45\25\0\4\45\7\0\10\45\4\0"+ - "\1\45\1\0\5\45\1\u0170\22\45\4\0\1\45\25\0"+ - "\4\45\7\0\10\45\4\0\1\45\1\0\21\45\1\u0171"+ - "\6\45\4\0\1\45\25\0\4\45\7\0\10\45\4\0"+ - "\1\45\1\0\4\45\1\u0172\23\45\4\0\1\45\25\0"+ - "\4\45\7\0\10\45\4\0\1\45\1\0\14\45\1\u0173"+ - "\13\45\4\0\1\45\25\0\4\45\7\0\10\45\4\0"+ - "\1\45\1\0\21\45\1\u0174\6\45\4\0\1\45\25\0"+ - "\4\45\7\0\10\45\4\0\1\45\1\0\3\45\1\u0175"+ - "\24\45\4\0\1\45\25\0\4\45\7\0\10\45\4\0"+ - "\1\45\1\0\5\45\1\u0176\22\45\4\0\1\45\25\0"+ - "\4\45\7\0\10\45\4\0\1\45\1\0\2\45\1\u0177"+ - "\25\45\4\0\1\45\25\0\4\45\7\0\10\45\4\0"+ - "\1\45\1\0\21\45\1\u0178\6\45\4\0\1\45\25\0"+ - "\4\45\7\0\10\45\4\0\1\45\1\0\5\45\1\u0179"+ - "\22\45\4\0\1\45\25\0\4\45\7\0\10\45\4\0"+ - "\1\45\1\0\4\45\1\u017a\23\45\4\0\1\45\25\0"+ - "\4\45\7\0\10\45\4\0\1\45\1\0\10\45\1\u017b"+ - "\17\45\4\0\1\45\25\0\4\125\7\0\10\125\4\0"+ - "\1\125\1\0\10\125\1\u017c\17\125\4\0\1\125\2\144"+ - "\1\0\2\144\1\0\54\144\1\u013e\32\144\1\0\2\144"+ - "\1\0\53\144\1\u0162\33\144\1\0\2\144\1\0\71\144"+ - "\1\u013e\15\144\1\0\2\144\1\0\64\144\1\u017d\20\144"+ - "\25\0\4\45\7\0\10\45\4\0\1\45\1\0\1\u017e"+ - "\27\45\4\0\1\45\25\0\4\45\7\0\10\45\4\0"+ - "\1\45\1\0\4\45\1\u017f\23\45\4\0\1\45\25\0"+ - "\3\u0180\110\0\4\u0181\7\0\3\u0181\13\0\6\u0181\54\0"+ - "\4\216\7\0\3\216\13\0\6\216\132\0\1\u0182\34\0"+ - "\4\45\7\0\10\45\4\0\1\45\1\0\22\45\1\u0183"+ - "\5\45\4\0\1\45\25\0\4\45\7\0\10\45\4\0"+ - "\1\45\1\0\1\u0184\27\45\4\0\1\45\25\0\4\45"+ - "\7\0\10\45\4\0\1\45\1\0\26\45\1\u0185\1\45"+ - "\4\0\1\45\25\0\4\45\7\0\10\45\4\0\1\45"+ - "\1\0\12\45\1\u0186\15\45\4\0\1\45\25\0\4\125"+ - "\7\0\10\125\4\0\1\125\1\0\12\125\1\u0187\15\125"+ - "\4\0\1\125\2\144\1\0\2\144\1\0\55\144\1\u0188"+ - "\27\144\25\0\4\45\7\0\10\45\4\0\1\45\1\0"+ - "\12\45\1\u0189\15\45\4\0\1\45\25\0\4\45\7\0"+ - "\10\45\4\0\1\45\1\0\21\45\1\u018a\6\45\4\0"+ - "\1\45\25\0\3\u018b\110\0\4\u011a\7\0\3\u011a\13\0"+ - "\6\u011a\54\0\4\u018c\7\0\3\u018c\13\0\6\u018c\54\0"+ - "\4\45\7\0\10\45\4\0\1\45\1\0\4\45\1\u018d"+ - "\23\45\4\0\1\45\25\0\4\45\7\0\10\45\4\0"+ - "\1\45\1\0\2\45\1\u018e\25\45\4\0\1\45\25\0"+ - "\4\45\7\0\10\45\4\0\1\45\1\0\16\45\1\u018f"+ - "\11\45\4\0\1\45\25\0\4\45\7\0\10\45\4\0"+ - "\1\45\1\0\4\45\1\u0190\23\45\4\0\1\45\25\0"+ - "\4\125\7\0\10\125\4\0\1\125\1\0\4\125\1\u0191"+ - "\23\125\4\0\1\125\2\144\1\0\2\144\1\0\60\144"+ - "\1\u010a\24\144\25\0\4\45\7\0\10\45\4\0\1\45"+ - "\1\0\15\45\1\u0192\12\45\4\0\1\45\25\0\3\u0193"+ - "\110\0\4\u0194\7\0\3\u0194\13\0\6\u0194\54\0\4\45"+ - "\7\0\10\45\4\0\1\45\1\0\4\45\1\u0195\23\45"+ - "\4\0\1\45\25\0\4\45\7\0\10\45\4\0\1\45"+ - "\1\0\4\45\1\u0196\23\45\4\0\1\45\25\0\4\45"+ - "\7\0\10\45\4\0\1\45\1\0\5\45\1\u0197\22\45"+ - "\4\0\1\45\51\0\1\u0198\3\0\1\333\106\0\1\u0199"+ - "\3\0\1\333\62\0\3\u019a\166\0\1\u0147\34\0\3\u019b"+ - "\110\0\3\216\63\0"; + "\1\u019c\23\45\4\0\1\45\25\0\4\45\7\0\10\45"+ + "\4\0\1\45\1\0\5\45\1\u019d\22\45\4\0\1\45"+ + "\51\0\1\u019e\3\0\1\333\106\0\1\u019f\3\0\1\333"+ + "\62\0\4\45\7\0\10\45\4\0\1\45\1\0\20\45"+ + "\1\u01a0\7\45\4\0\1\45\25\0\3\u01a1\166\0\1\u0148"+ + "\34\0\3\u01a2\110\0\3\216\63\0"; private static int [] zzUnpacktrans() { - int [] result = new int[22575]; + int [] result = new int[23025]; int offset = 0; offset = zzUnpacktrans(ZZ_TRANS_PACKED_0, offset, result); return result; @@ -839,11 +849,12 @@ private static int zzUnpacktrans(String packed, int offset, int [] result) { "\1\0\30\1\2\0\13\1\2\11\3\1\4\11\15\1"+ "\2\11\3\0\4\1\2\11\2\0\3\1\1\11\2\0"+ "\1\1\2\0\26\1\1\11\15\1\1\0\2\1\1\11"+ - "\7\1\1\11\4\0\1\11\2\1\4\0\52\1\2\0"+ - "\40\1\4\0\24\1\3\0\10\1\2\0\13\1\4\0"; + "\7\1\1\11\4\0\1\11\2\1\4\0\53\1\2\0"+ + "\41\1\4\0\25\1\3\0\11\1\2\0\15\1\2\0"+ + "\1\1\2\0"; private static int [] zzUnpackAttribute() { - int [] result = new int[411]; + int [] result = new int[418]; int offset = 0; offset = zzUnpackAttribute(ZZ_ATTRIBUTE_PACKED_0, offset, result); return result; @@ -1214,7 +1225,7 @@ else if (zzAtEOF) { zzStartRead = commentStart; return MULTI_LINE_COMMENT; } // fall though - case 412: break; + case 419: break; default: return null; } @@ -1225,204 +1236,204 @@ else if (zzAtEOF) { { return BAD_CHARACTER; } // fall through - case 147: break; + case 148: break; case 2: { return WS; } // fall through - case 148: break; + case 149: break; case 3: { return NLS; } // fall through - case 149: break; + case 150: break; case 4: { pushState(MAYBE_SEMICOLON); return NOT; } // fall through - case 150: break; + case 151: break; case 5: { pushState(STRING); return OPEN_QUOTE; } // fall through - case 151: break; + case 152: break; case 6: { return DOLLAR; } // fall through - case 152: break; + case 153: break; case 7: { return REMAINDER; } // fall through - case 153: break; + case 154: break; case 8: { return BIT_AND; } // fall through - case 154: break; + case 155: break; case 9: { pushState(SINGLE_STRING); return OPEN_QUOTE; } // fall through - case 155: break; + case 156: break; case 10: { return LPAREN; } // fall through - case 156: break; + case 157: break; case 11: { pushState(MAYBE_SEMICOLON); return RPAREN; } // fall through - case 157: break; + case 158: break; case 12: { return MUL; } // fall through - case 158: break; + case 159: break; case 13: { return PLUS; } // fall through - case 159: break; + case 160: break; case 14: { return COMMA; } // fall through - case 160: break; + case 161: break; case 15: { return MINUS; } // fall through - case 161: break; + case 162: break; case 16: { return DOT; } // fall through - case 162: break; + case 163: break; case 17: { return QUOTIENT; } // fall through - case 163: break; + case 164: break; case 18: { pushState(MAYBE_SEMICOLON); return INT; } // fall through - case 164: break; + case 165: break; case 19: { pushState(MAYBE_SEMICOLON); return COLON; } // fall through - case 165: break; + case 166: break; case 20: { return SEMICOLON; } // fall through - case 166: break; + case 167: break; case 21: { return LESS; } // fall through - case 167: break; + case 168: break; case 22: { return ASSIGN; } // fall through - case 168: break; + case 169: break; case 23: { pushState(MAYBE_SEMICOLON); return GREATER; } // fall through - case 169: break; + case 170: break; case 24: { pushState(MAYBE_SEMICOLON); return QUESTION; } // fall through - case 170: break; + case 171: break; case 25: { return AT; } // fall through - case 171: break; + case 172: break; case 26: { pushState(MAYBE_SEMICOLON); return IDENTIFIER; } // fall through - case 172: break; + case 173: break; case 27: { return LBRACK; } // fall through - case 173: break; + case 174: break; case 28: { pushState(MAYBE_SEMICOLON); return RBRACK; } // fall through - case 174: break; + case 175: break; case 29: { return BIT_XOR; } // fall through - case 175: break; + case 176: break; case 30: { return BACKTICK; } // fall through - case 176: break; + case 177: break; case 31: { return LBRACE; } // fall through - case 177: break; + case 178: break; case 32: { return BIT_OR; } // fall through - case 178: break; + case 179: break; case 33: { pushState(MAYBE_SEMICOLON); return RBRACE; } // fall through - case 179: break; + case 180: break; case 34: { return TILDA; } // fall through - case 180: break; + case 181: break; case 35: { popMaybeSemicolonState(); yypushback(yytext().length()); } // fall through - case 181: break; + case 182: break; case 36: { popMaybeSemicolonState(); yypushback(yytext().length()); return SEMICOLON_SYNTHETIC; } // fall through - case 182: break; + case 183: break; case 37: { return LITERAL_STRING_TEMPLATE_ENTRY; } // fall through - case 183: break; + case 184: break; case 38: { popState(); pushState(MAYBE_SEMICOLON); return CLOSING_QUOTE; } // fall through - case 184: break; + case 185: break; case 39: { } // fall through - case 185: break; + case 186: break; case 40: { lBraceCount++; return LBRACE; } // fall through - case 186: break; + case 187: break; case 41: { if (lBraceCount == 0) { popState(); @@ -1433,236 +1444,236 @@ else if (zzAtEOF) { return RBRACE; } // fall through - case 187: break; + case 188: break; case 42: { popState(); return IDENTIFIER; } // fall through - case 188: break; + case 189: break; case 43: { return IDENTIFIER; } // fall through - case 189: break; + case 190: break; case 44: { yybegin(ASM_BLOCK_LINE); return LBRACE; } // fall through - case 190: break; + case 191: break; case 45: { return ASM_LINE; } // fall through - case 191: break; + case 192: break; case 46: { yybegin(MAYBE_SEMICOLON); return RBRACE; } // fall through - case 192: break; + case 193: break; case 47: { return SAFE_DOT; } // fall through - case 193: break; + case 194: break; case 48: { return NOT_EQ; } // fall through - case 194: break; + case 195: break; case 49: { return HASH_COMMENT; } // fall through - case 195: break; + case 196: break; case 50: { return HASH_LBRACK; } // fall through - case 196: break; + case 197: break; case 51: { return REMAINDER_ASSIGN; } // fall through - case 197: break; + case 198: break; case 52: { return COND_AND; } // fall through - case 198: break; + case 199: break; case 53: { return BIT_AND_ASSIGN; } // fall through - case 199: break; + case 200: break; case 54: { return BIT_CLEAR; } // fall through - case 200: break; + case 201: break; case 55: { return MUL_ASSIGN; } // fall through - case 201: break; + case 202: break; case 56: { pushState(MAYBE_SEMICOLON); return PLUS_PLUS; } // fall through - case 202: break; + case 203: break; case 57: { return PLUS_ASSIGN; } // fall through - case 203: break; + case 204: break; case 58: { pushState(MAYBE_SEMICOLON); return MINUS_MINUS; } // fall through - case 204: break; + case 205: break; case 59: { return MINUS_ASSIGN; } // fall through - case 205: break; + case 206: break; case 60: { return RANGE; } // fall through - case 206: break; + case 207: break; case 61: { pushState(MAYBE_SEMICOLON); return FLOAT; } // fall through - case 207: break; + case 208: break; case 62: { pushState(MULTI_LINE_COMMENT_STATE); commentDepth = 0; commentStart = getTokenStart(); } // fall through - case 208: break; + case 209: break; case 63: { return DOC_COMMENT; } // fall through - case 209: break; + case 210: break; case 64: { return QUOTIENT_ASSIGN; } // fall through - case 210: break; + case 211: break; case 65: { return VAR_ASSIGN; } // fall through - case 211: break; + case 212: break; case 66: { return SEND_CHANNEL; } // fall through - case 212: break; + case 213: break; case 67: { return SHIFT_LEFT; } // fall through - case 213: break; + case 214: break; case 68: { return LESS_OR_EQUAL; } // fall through - case 214: break; + case 215: break; case 69: { return EQ; } // fall through - case 215: break; + case 216: break; case 70: { return GREATER_OR_EQUAL; } // fall through - case 216: break; + case 217: break; case 71: { return AT_LBRACK; } // fall through - case 217: break; + case 218: break; case 72: { return BIT_XOR_ASSIGN; } // fall through - case 218: break; + case 219: break; case 73: { pushState(MAYBE_SEMICOLON); return CHAR; } // fall through - case 219: break; + case 220: break; case 74: { return AS ; } // fall through - case 220: break; + case 221: break; case 75: { return FN; } // fall through - case 221: break; + case 222: break; case 76: { return GO; } // fall through - case 222: break; + case 223: break; case 77: { return IF; } // fall through - case 223: break; + case 224: break; case 78: { return IN; } // fall through - case 224: break; + case 225: break; case 79: { return IS; } // fall through - case 225: break; + case 226: break; case 80: { return OR; } // fall through - case 226: break; + case 227: break; case 81: { return BIT_OR_ASSIGN; } // fall through - case 227: break; + case 228: break; case 82: { return COND_OR; } // fall through - case 228: break; + case 229: break; case 83: { return LINE_COMMENT; } // fall through - case 229: break; + case 230: break; case 84: { pushState(SHORT_TEMPLATE_ENTRY); yypushback(yylength() - 1); return SHORT_TEMPLATE_ENTRY_START; } // fall through - case 230: break; + case 231: break; case 85: { pushState(LONG_TEMPLATE_ENTRY); return LONG_TEMPLATE_ENTRY_START; } // fall through - case 231: break; + case 232: break; case 86: { return LITERAL_STRING_TEMPLATE_ESCAPE_ENTRY; } // fall through - case 232: break; + case 233: break; case 87: { if (commentDepth > 0) { commentDepth--; @@ -1674,302 +1685,307 @@ else if (zzAtEOF) { } } // fall through - case 233: break; + case 234: break; case 88: { commentDepth++; } // fall through - case 234: break; + case 235: break; case 89: { return NOT_IN; } // fall through - case 235: break; + case 236: break; case 90: { return NOT_IS; } // fall through - case 236: break; + case 237: break; case 91: { return SHEBANG; } // fall through - case 237: break; + case 238: break; case 92: { return IF_COMPILE_TIME; } // fall through - case 238: break; + case 239: break; case 93: { return BIT_CLEAR_ASSIGN; } // fall through - case 239: break; + case 240: break; case 94: { return TRIPLE_DOT; } // fall through - case 240: break; + case 241: break; case 95: { pushState(MAYBE_SEMICOLON); return HEX; } // fall through - case 241: break; + case 242: break; case 96: { pushState(MAYBE_SEMICOLON); return BIN; } // fall through - case 242: break; + case 243: break; case 97: { pushState(MAYBE_SEMICOLON); return OCT; } // fall through - case 243: break; + case 244: break; case 98: { return SHIFT_LEFT_ASSIGN; } // fall through - case 244: break; + case 245: break; case 99: { return SHIFT_RIGHT_ASSIGN; } // fall through - case 245: break; + case 246: break; case 100: { pushState(MAYBE_SEMICOLON); return BAD_CHARACTER; } // fall through - case 246: break; + case 247: break; case 101: { pushState(ASM_BLOCK); return ASM; } // fall through - case 247: break; + case 248: break; case 102: { return FOR; } // fall through - case 248: break; + case 249: break; case 103: { return MUT; } // fall through - case 249: break; + case 250: break; case 104: { pushState(MAYBE_SEMICOLON); return NIL; } // fall through - case 250: break; + case 251: break; case 105: { return PUB; } // fall through - case 251: break; + case 252: break; case 106: { pushState(MAYBE_SEMICOLON); return RAW_STRING; } // fall through - case 252: break; + case 253: break; case 107: { yypushback(3); pushState(MAYBE_SEMICOLON); return NOT; } // fall through - case 253: break; + case 254: break; case 108: { return FOR_COMPILE_TIME; } // fall through - case 254: break; + case 255: break; case 109: { return MULTI_LINE_COMMENT; } // fall through - case 255: break; + case 256: break; case 110: { return UNSIGNED_SHIFT_RIGHT_ASSIGN; } // fall through - case 256: break; + case 257: break; case 111: { return DUMP; } // fall through - case 257: break; + case 258: break; case 112: { return ELSE; } // fall through - case 258: break; + case 259: break; case 113: { return ENUM; } // fall through - case 259: break; + case 260: break; case 114: { return GOTO; } // fall through - case 260: break; + case 261: break; case 115: { return LOCK; } // fall through - case 261: break; + case 262: break; case 116: { pushState(MAYBE_SEMICOLON); return NONE; } // fall through - case 262: break; + case 263: break; case 117: { pushState(MAYBE_SEMICOLON); return TRUE; } // fall through - case 263: break; + case 264: break; case 118: { return TYPE_; } // fall through - case 264: break; + case 265: break; case 119: { return COMPILE_DIRECTIVE; } // fall through - case 265: break; + case 266: break; case 120: { return ELSE_COMPILE_TIME; } // fall through - case 266: break; + case 267: break; case 121: { pushState(MAYBE_SEMICOLON); return BREAK; } // fall through - case 267: break; + case 268: break; case 122: { return CONST; } // fall through - case 268: break; + case 269: break; case 123: { return DEFER; } // fall through - case 269: break; + case 270: break; case 124: { pushState(MAYBE_SEMICOLON); return FALSE; } // fall through - case 270: break; + case 271: break; case 125: { return MATCH; } // fall through - case 271: break; + case 272: break; case 126: { return RLOCK; } // fall through - case 272: break; + case 273: break; case 127: { return SPAWN; } // fall through - case 273: break; + case 274: break; case 128: { return UNION; } // fall through - case 274: break; + case 275: break; case 129: { return ASSERT; } // fall through - case 275: break; + case 276: break; case 130: { return ATOMIC; } // fall through - case 276: break; + case 277: break; case 131: { return IMPORT ; } // fall through - case 277: break; + case 278: break; case 132: { return MODULE; } // fall through - case 278: break; + case 279: break; case 133: { pushState(MAYBE_SEMICOLON); return RETURN; } // fall through - case 279: break; + case 280: break; case 134: { return SELECT; } // fall through - case 280: break; + case 281: break; case 135: { return SHARED; } // fall through - case 281: break; + case 282: break; case 136: { return SIZEOF; } // fall through - case 282: break; + case 283: break; case 137: { return STATIC; } // fall through - case 283: break; + case 284: break; case 138: { return STRUCT; } // fall through - case 284: break; + case 285: break; case 139: { return TYPEOF; } // fall through - case 285: break; + case 286: break; case 140: { return UNSAFE; } // fall through - case 286: break; + case 287: break; case 141: { return BUILTIN_GLOBAL; } // fall through - case 287: break; + case 288: break; case 142: { pushState(MAYBE_SEMICOLON); return CONTINUE; } // fall through - case 288: break; + case 289: break; case 143: { return VOLATILE; } // fall through - case 289: break; + case 290: break; case 144: { return INTERFACE; } // fall through - case 290: break; + case 291: break; case 145: { return ISREFTYPE; } // fall through - case 291: break; + case 292: break; case 146: { return OFFSETOF; } // fall through - case 292: break; + case 293: break; + case 147: + { return IMPLEMENTS; + } + // fall through + case 294: break; default: zzScanError(ZZ_NO_MATCH); } diff --git a/src/main/gen/io/vlang/lang/psi/VlangAliasType.java b/src/main/gen/io/vlang/lang/psi/VlangAliasType.java index 43af21b0..1cdc3f88 100644 --- a/src/main/gen/io/vlang/lang/psi/VlangAliasType.java +++ b/src/main/gen/io/vlang/lang/psi/VlangAliasType.java @@ -21,7 +21,6 @@ public interface VlangAliasType extends VlangType, VlangGenericParametersOwner { boolean isAlias(); - @Nullable - VlangType getAliasType(); + @Nullable VlangType getAliasType(); } diff --git a/src/main/gen/io/vlang/lang/psi/VlangAnonymousStructType.java b/src/main/gen/io/vlang/lang/psi/VlangAnonymousStructType.java index 6ceca58d..3c53b9a6 100644 --- a/src/main/gen/io/vlang/lang/psi/VlangAnonymousStructType.java +++ b/src/main/gen/io/vlang/lang/psi/VlangAnonymousStructType.java @@ -19,10 +19,8 @@ public interface VlangAnonymousStructType extends VlangType, VlangFieldListOwner @NotNull PsiElement getStruct(); - @NotNull - List getFieldList(); + @NotNull List<@NotNull VlangFieldDefinition> getFieldList(); - @NotNull - List getOwnFieldList(); + @NotNull List<@NotNull VlangFieldDefinition> getOwnFieldList(); } diff --git a/src/main/gen/io/vlang/lang/psi/VlangAppendStatement.java b/src/main/gen/io/vlang/lang/psi/VlangAppendStatement.java index 87645386..07210ce1 100644 --- a/src/main/gen/io/vlang/lang/psi/VlangAppendStatement.java +++ b/src/main/gen/io/vlang/lang/psi/VlangAppendStatement.java @@ -13,7 +13,6 @@ public interface VlangAppendStatement extends VlangStatement { @NotNull VlangShiftLeftOp getShiftLeftOp(); - @Nullable - VlangExpression getLeft(); + @Nullable VlangExpression getLeft(); } diff --git a/src/main/gen/io/vlang/lang/psi/VlangAsmBlockStatement.java b/src/main/gen/io/vlang/lang/psi/VlangAsmBlockStatement.java index 8ab4ca7d..b43a4ebd 100644 --- a/src/main/gen/io/vlang/lang/psi/VlangAsmBlockStatement.java +++ b/src/main/gen/io/vlang/lang/psi/VlangAsmBlockStatement.java @@ -13,7 +13,7 @@ public interface VlangAsmBlockStatement extends VlangStatement { @NotNull PsiElement getAsm(); - @Nullable + @NotNull PsiElement getIdentifier(); @Nullable diff --git a/src/main/gen/io/vlang/lang/psi/VlangAttributeIdentifier.java b/src/main/gen/io/vlang/lang/psi/VlangAttributeIdentifier.java index f1c182fe..02ef9966 100644 --- a/src/main/gen/io/vlang/lang/psi/VlangAttributeIdentifier.java +++ b/src/main/gen/io/vlang/lang/psi/VlangAttributeIdentifier.java @@ -17,7 +17,6 @@ public interface VlangAttributeIdentifier extends VlangCompositeElement { @Nullable PsiElement getUnsafe(); - @NotNull - VlangAttributeReference getReference(); + @NotNull VlangAttributeReference getReference(); } diff --git a/src/main/gen/io/vlang/lang/psi/VlangBinaryExpr.java b/src/main/gen/io/vlang/lang/psi/VlangBinaryExpr.java index b6243c68..a217d5b7 100644 --- a/src/main/gen/io/vlang/lang/psi/VlangBinaryExpr.java +++ b/src/main/gen/io/vlang/lang/psi/VlangBinaryExpr.java @@ -16,7 +16,6 @@ public interface VlangBinaryExpr extends VlangExpression { @Nullable VlangExpression getRight(); - @Nullable - PsiElement getOperator(); + @Nullable PsiElement getOperator(); } diff --git a/src/main/gen/io/vlang/lang/psi/VlangCallExpr.java b/src/main/gen/io/vlang/lang/psi/VlangCallExpr.java index 1c5d32fd..9de8bef9 100644 --- a/src/main/gen/io/vlang/lang/psi/VlangCallExpr.java +++ b/src/main/gen/io/vlang/lang/psi/VlangCallExpr.java @@ -28,17 +28,13 @@ public interface VlangCallExpr extends VlangExpression, VlangGenericArgumentsOwn @Nullable VlangResultPropagationExpression getResultPropagationExpression(); - @NotNull - List getParameters(); + @NotNull List<@NotNull VlangExpression> getParameters(); - @Nullable - PsiElement getIdentifier(); + @Nullable PsiElement getIdentifier(); - @Nullable - VlangReferenceExpression getQualifier(); + @Nullable VlangReferenceExpression getQualifier(); - @Nullable - PsiElement resolve(); + @Nullable PsiElement resolve(); int paramIndexOf(@NotNull PsiElement pos); diff --git a/src/main/gen/io/vlang/lang/psi/VlangCaptureList.java b/src/main/gen/io/vlang/lang/psi/VlangCaptureList.java index ece5161a..a5bb3000 100644 --- a/src/main/gen/io/vlang/lang/psi/VlangCaptureList.java +++ b/src/main/gen/io/vlang/lang/psi/VlangCaptureList.java @@ -16,7 +16,6 @@ public interface VlangCaptureList extends VlangCompositeElement { @Nullable PsiElement getRbrack(); - @NotNull - PsiElement addCapture(@NotNull String name); + @NotNull PsiElement addCapture(@NotNull String name); } diff --git a/src/main/gen/io/vlang/lang/psi/VlangConstDefinition.java b/src/main/gen/io/vlang/lang/psi/VlangConstDefinition.java index c2a198f5..23bacb71 100644 --- a/src/main/gen/io/vlang/lang/psi/VlangConstDefinition.java +++ b/src/main/gen/io/vlang/lang/psi/VlangConstDefinition.java @@ -20,8 +20,7 @@ public interface VlangConstDefinition extends VlangNamedElement, StubBasedPsiEle @NotNull PsiElement getIdentifier(); - @Nullable - VlangTypeEx getTypeInner(@Nullable ResolveState context); + @Nullable VlangTypeEx getTypeInner(@Nullable ResolveState context); boolean isPublic(); @@ -31,10 +30,8 @@ public interface VlangConstDefinition extends VlangNamedElement, StubBasedPsiEle //matching deleteDefinition(VlangConstDefinition, ...) //methods are not found in VlangPsiImplUtil - @NotNull - String getName(); + @NotNull String getName(); - @Nullable - VlangSymbolVisibility getSymbolVisibility(); + @Nullable VlangSymbolVisibility getSymbolVisibility(); } diff --git a/src/main/gen/io/vlang/lang/psi/VlangDumpCallExpr.java b/src/main/gen/io/vlang/lang/psi/VlangDumpCallExpr.java index e5adc9d0..9237797d 100644 --- a/src/main/gen/io/vlang/lang/psi/VlangDumpCallExpr.java +++ b/src/main/gen/io/vlang/lang/psi/VlangDumpCallExpr.java @@ -20,7 +20,6 @@ public interface VlangDumpCallExpr extends VlangExpression, VlangBuiltinCallOwne @NotNull PsiElement getDump(); - @NotNull - VlangBuiltinReference getReference(); + @NotNull VlangBuiltinReference<@NotNull VlangDumpCallExpr> getReference(); } diff --git a/src/main/gen/io/vlang/lang/psi/VlangEmbeddedDefinition.java b/src/main/gen/io/vlang/lang/psi/VlangEmbeddedDefinition.java index 60c3291e..db0c91aa 100644 --- a/src/main/gen/io/vlang/lang/psi/VlangEmbeddedDefinition.java +++ b/src/main/gen/io/vlang/lang/psi/VlangEmbeddedDefinition.java @@ -14,13 +14,10 @@ public interface VlangEmbeddedDefinition extends VlangNamedElement, StubBasedPsi @NotNull VlangType getType(); - @NotNull - String getName(); + @NotNull String getName(); - @Nullable - PsiElement getIdentifier(); + @Nullable PsiElement getIdentifier(); - @NotNull - VlangTypeEx getType(@Nullable ResolveState context); + @NotNull VlangTypeEx getType(@Nullable ResolveState context); } diff --git a/src/main/gen/io/vlang/lang/psi/VlangEnumDeclaration.java b/src/main/gen/io/vlang/lang/psi/VlangEnumDeclaration.java index 227fac63..592278ba 100644 --- a/src/main/gen/io/vlang/lang/psi/VlangEnumDeclaration.java +++ b/src/main/gen/io/vlang/lang/psi/VlangEnumDeclaration.java @@ -20,14 +20,11 @@ public interface VlangEnumDeclaration extends VlangNamedElement, VlangAttributeO @Nullable VlangSymbolVisibility getSymbolVisibility(); - @NotNull - String getName(); + @NotNull String getName(); - @Nullable - PsiElement getIdentifier(); + @Nullable PsiElement getIdentifier(); - @NotNull - VlangTypeEx getTypeInner(@Nullable ResolveState context); + @NotNull VlangTypeEx getTypeInner(@Nullable ResolveState context); boolean isFlag(); diff --git a/src/main/gen/io/vlang/lang/psi/VlangEnumFetch.java b/src/main/gen/io/vlang/lang/psi/VlangEnumFetch.java index 48f04e22..7bfaf221 100644 --- a/src/main/gen/io/vlang/lang/psi/VlangEnumFetch.java +++ b/src/main/gen/io/vlang/lang/psi/VlangEnumFetch.java @@ -14,13 +14,10 @@ public interface VlangEnumFetch extends VlangExpression, VlangReferenceExpressio @NotNull PsiElement getIdentifier(); - @NotNull - VlangReference getReference(); + @NotNull VlangReference getReference(); - @Nullable - VlangCompositeElement getQualifier(); + @Nullable VlangCompositeElement getQualifier(); - @Nullable - PsiElement resolve(); + @Nullable PsiElement resolve(); } diff --git a/src/main/gen/io/vlang/lang/psi/VlangEnumFieldDefinition.java b/src/main/gen/io/vlang/lang/psi/VlangEnumFieldDefinition.java index b760aa66..21563d61 100644 --- a/src/main/gen/io/vlang/lang/psi/VlangEnumFieldDefinition.java +++ b/src/main/gen/io/vlang/lang/psi/VlangEnumFieldDefinition.java @@ -16,10 +16,8 @@ public interface VlangEnumFieldDefinition extends VlangNamedElement, StubBasedPs boolean isPublic(); - @NotNull - VlangTypeEx getTypeInner(@Nullable ResolveState context); + @NotNull VlangTypeEx getTypeInner(@Nullable ResolveState context); - @Nullable - Long constantValue(); + @Nullable Long constantValue(); } diff --git a/src/main/gen/io/vlang/lang/psi/VlangEnumType.java b/src/main/gen/io/vlang/lang/psi/VlangEnumType.java index dd7c56d8..3da9989f 100644 --- a/src/main/gen/io/vlang/lang/psi/VlangEnumType.java +++ b/src/main/gen/io/vlang/lang/psi/VlangEnumType.java @@ -25,7 +25,6 @@ public interface VlangEnumType extends VlangType { @Nullable PsiElement getIdentifier(); - @NotNull - List getFieldList(); + @NotNull List<@NotNull VlangEnumFieldDefinition> getFieldList(); } diff --git a/src/main/gen/io/vlang/lang/psi/VlangExpression.java b/src/main/gen/io/vlang/lang/psi/VlangExpression.java index 57fa3003..63725e29 100644 --- a/src/main/gen/io/vlang/lang/psi/VlangExpression.java +++ b/src/main/gen/io/vlang/lang/psi/VlangExpression.java @@ -9,7 +9,6 @@ public interface VlangExpression extends VlangTypeOwner { - @Nullable - VlangTypeEx getType(@Nullable ResolveState context); + @Nullable VlangTypeEx getType(@Nullable ResolveState context); } diff --git a/src/main/gen/io/vlang/lang/psi/VlangFieldDefinition.java b/src/main/gen/io/vlang/lang/psi/VlangFieldDefinition.java index 156107d3..52df2e51 100644 --- a/src/main/gen/io/vlang/lang/psi/VlangFieldDefinition.java +++ b/src/main/gen/io/vlang/lang/psi/VlangFieldDefinition.java @@ -14,14 +14,11 @@ public interface VlangFieldDefinition extends VlangMutabilityOwner, VlangNamedEl @NotNull PsiElement getIdentifier(); - @Nullable - VlangCompositeElement getQualifier(); + @Nullable VlangCompositeElement getQualifier(); - @Nullable - String getQualifiedName(); + @Nullable String getQualifiedName(); - @NotNull - VlangTypeEx getTypeInner(@Nullable ResolveState context); + @NotNull VlangTypeEx getTypeInner(@Nullable ResolveState context); boolean isPublic(); @@ -33,7 +30,6 @@ public interface VlangFieldDefinition extends VlangMutabilityOwner, VlangNamedEl void makeImmutable(); - @NotNull - VlangNamedElement getOwner(); + @NotNull VlangNamedElement getOwner(); } diff --git a/src/main/gen/io/vlang/lang/psi/VlangFieldName.java b/src/main/gen/io/vlang/lang/psi/VlangFieldName.java index a9c3d3d3..04d61181 100644 --- a/src/main/gen/io/vlang/lang/psi/VlangFieldName.java +++ b/src/main/gen/io/vlang/lang/psi/VlangFieldName.java @@ -10,13 +10,10 @@ public interface VlangFieldName extends VlangReferenceExpressionBase { @NotNull VlangReferenceExpression getReferenceExpression(); - @NotNull - PsiElement getIdentifier(); + @NotNull PsiElement getIdentifier(); - @Nullable - VlangCompositeElement getQualifier(); + @Nullable VlangCompositeElement getQualifier(); - @Nullable - PsiElement resolve(); + @Nullable PsiElement resolve(); } diff --git a/src/main/gen/io/vlang/lang/psi/VlangFieldsGroup.java b/src/main/gen/io/vlang/lang/psi/VlangFieldsGroup.java index cc5378a3..56f49802 100644 --- a/src/main/gen/io/vlang/lang/psi/VlangFieldsGroup.java +++ b/src/main/gen/io/vlang/lang/psi/VlangFieldsGroup.java @@ -22,7 +22,6 @@ public interface VlangFieldsGroup extends VlangMemberModifiersOwner { @Nullable PsiElement getSemicolonSynthetic(); - @NotNull - List getMemberModifierList(); + @NotNull List<@NotNull VlangMemberModifier> getMemberModifierList(); } diff --git a/src/main/gen/io/vlang/lang/psi/VlangFunctionDeclaration.java b/src/main/gen/io/vlang/lang/psi/VlangFunctionDeclaration.java index fa377a53..4a06dd51 100644 --- a/src/main/gen/io/vlang/lang/psi/VlangFunctionDeclaration.java +++ b/src/main/gen/io/vlang/lang/psi/VlangFunctionDeclaration.java @@ -32,11 +32,9 @@ public interface VlangFunctionDeclaration extends VlangSignatureOwner, VlangFunc @NotNull PsiElement getIdentifier(); - @NotNull - String getName(); + @NotNull String getName(); - @Nullable - VlangTypeEx getTypeInner(@Nullable ResolveState context); + @Nullable VlangTypeEx getTypeInner(@Nullable ResolveState context); boolean isDefinition(); diff --git a/src/main/gen/io/vlang/lang/psi/VlangFunctionLit.java b/src/main/gen/io/vlang/lang/psi/VlangFunctionLit.java index b475294b..750f2bcf 100644 --- a/src/main/gen/io/vlang/lang/psi/VlangFunctionLit.java +++ b/src/main/gen/io/vlang/lang/psi/VlangFunctionLit.java @@ -22,8 +22,7 @@ public interface VlangFunctionLit extends VlangExpression, VlangSignatureOwner, @NotNull PsiElement getFn(); - @NotNull - PsiElement addCapture(@NotNull String name); + @NotNull PsiElement addCapture(@NotNull String name); //WARNING: processDeclarations(...) is skipped //matching processDeclarations(VlangFunctionLit, ...) diff --git a/src/main/gen/io/vlang/lang/psi/VlangGenericArguments.java b/src/main/gen/io/vlang/lang/psi/VlangGenericArguments.java index 2bdcf301..8d33bbbf 100644 --- a/src/main/gen/io/vlang/lang/psi/VlangGenericArguments.java +++ b/src/main/gen/io/vlang/lang/psi/VlangGenericArguments.java @@ -7,7 +7,6 @@ public interface VlangGenericArguments extends VlangCompositeElement { - @NotNull - List getTypeArguments(); + @NotNull List<@NotNull VlangType> getTypeArguments(); } diff --git a/src/main/gen/io/vlang/lang/psi/VlangGenericParameter.java b/src/main/gen/io/vlang/lang/psi/VlangGenericParameter.java index 406eaa7c..1070613d 100644 --- a/src/main/gen/io/vlang/lang/psi/VlangGenericParameter.java +++ b/src/main/gen/io/vlang/lang/psi/VlangGenericParameter.java @@ -14,7 +14,6 @@ public interface VlangGenericParameter extends VlangNamedElement, StubBasedPsiEl @NotNull PsiElement getIdentifier(); - @Nullable - VlangTypeEx getTypeInner(@Nullable ResolveState context); + @Nullable VlangTypeEx getTypeInner(@Nullable ResolveState context); } diff --git a/src/main/gen/io/vlang/lang/psi/VlangGenericParameters.java b/src/main/gen/io/vlang/lang/psi/VlangGenericParameters.java index 762aa84f..3959e633 100644 --- a/src/main/gen/io/vlang/lang/psi/VlangGenericParameters.java +++ b/src/main/gen/io/vlang/lang/psi/VlangGenericParameters.java @@ -9,7 +9,6 @@ public interface VlangGenericParameters extends VlangCompositeElement, StubBasedPsiElement { - @NotNull - List getParameters(); + @NotNull List<@NotNull VlangGenericParameter> getParameters(); } diff --git a/src/main/gen/io/vlang/lang/psi/VlangGlobalVariableDefinition.java b/src/main/gen/io/vlang/lang/psi/VlangGlobalVariableDefinition.java index 6929a3a0..12d8d886 100644 --- a/src/main/gen/io/vlang/lang/psi/VlangGlobalVariableDefinition.java +++ b/src/main/gen/io/vlang/lang/psi/VlangGlobalVariableDefinition.java @@ -34,8 +34,7 @@ public interface VlangGlobalVariableDefinition extends VlangNamedElement, StubBa //matching getName(VlangGlobalVariableDefinition, ...) //methods are not found in VlangPsiImplUtil - @Nullable - VlangTypeEx getTypeInner(@Nullable ResolveState context); + @Nullable VlangTypeEx getTypeInner(@Nullable ResolveState context); //WARNING: getSymbolVisibility(...) is skipped //matching getSymbolVisibility(VlangGlobalVariableDefinition, ...) diff --git a/src/main/gen/io/vlang/lang/psi/VlangImplementsClause.java b/src/main/gen/io/vlang/lang/psi/VlangImplementsClause.java new file mode 100644 index 00000000..5926f6ba --- /dev/null +++ b/src/main/gen/io/vlang/lang/psi/VlangImplementsClause.java @@ -0,0 +1,19 @@ +// This is a generated file. Not intended for manual editing. +package io.vlang.lang.psi; + +import java.util.List; +import org.jetbrains.annotations.*; +import com.intellij.psi.PsiElement; + +public interface VlangImplementsClause extends VlangCompositeElement { + + @Nullable + VlangLastComma getLastComma(); + + @NotNull + List getTypeReferenceExpressionList(); + + @NotNull + PsiElement getImplements(); + +} diff --git a/src/main/gen/io/vlang/lang/psi/VlangImportAlias.java b/src/main/gen/io/vlang/lang/psi/VlangImportAlias.java index 25ead938..29bf1f69 100644 --- a/src/main/gen/io/vlang/lang/psi/VlangImportAlias.java +++ b/src/main/gen/io/vlang/lang/psi/VlangImportAlias.java @@ -15,13 +15,10 @@ public interface VlangImportAlias extends VlangNamedElement, StubBasedPsiElement @NotNull PsiElement getAs(); - @NotNull - String getName(); + @NotNull String getName(); - @Nullable - PsiElement getIdentifier(); + @Nullable PsiElement getIdentifier(); - @NotNull - String getQualifiedName(); + @NotNull String getQualifiedName(); } diff --git a/src/main/gen/io/vlang/lang/psi/VlangImportAliasName.java b/src/main/gen/io/vlang/lang/psi/VlangImportAliasName.java index 44f6589a..75435606 100644 --- a/src/main/gen/io/vlang/lang/psi/VlangImportAliasName.java +++ b/src/main/gen/io/vlang/lang/psi/VlangImportAliasName.java @@ -11,7 +11,6 @@ public interface VlangImportAliasName extends VlangCompositeElement { @NotNull PsiElement getIdentifier(); - @NotNull - VlangModuleReference getReference(); + @NotNull VlangModuleReference<@NotNull VlangImportAliasName> getReference(); } diff --git a/src/main/gen/io/vlang/lang/psi/VlangImportName.java b/src/main/gen/io/vlang/lang/psi/VlangImportName.java index e9327552..212ab3e4 100644 --- a/src/main/gen/io/vlang/lang/psi/VlangImportName.java +++ b/src/main/gen/io/vlang/lang/psi/VlangImportName.java @@ -14,27 +14,20 @@ public interface VlangImportName extends VlangNamedElement, StubBasedPsiElement< @NotNull PsiElement getIdentifier(); - @NotNull - String getQualifier(); + @NotNull String getQualifier(); - @NotNull - PsiElement getNameIdentifier(); + @NotNull PsiElement getNameIdentifier(); - @NotNull - PsiElement setName(@NotNull String newName); + @NotNull PsiElement setName(@NotNull String newName); - @NotNull - String getName(); + @NotNull String getName(); int getTextOffset(); - @NotNull - VlangModuleReference getReference(); + @NotNull VlangModuleReference<@NotNull VlangImportName> getReference(); - @NotNull - List resolve(); + @NotNull List<@NotNull VlangModule> resolve(); - @NotNull - String getQualifiedName(); + @NotNull String getQualifiedName(); } diff --git a/src/main/gen/io/vlang/lang/psi/VlangImportPath.java b/src/main/gen/io/vlang/lang/psi/VlangImportPath.java index b7bc2784..e2076680 100644 --- a/src/main/gen/io/vlang/lang/psi/VlangImportPath.java +++ b/src/main/gen/io/vlang/lang/psi/VlangImportPath.java @@ -10,13 +10,10 @@ public interface VlangImportPath extends VlangCompositeElement { @NotNull List getImportNameList(); - @NotNull - String getQualifiedName(); + @NotNull String getQualifiedName(); - @NotNull - String getLastPart(); + @NotNull String getLastPart(); - @NotNull - PsiElement getLastPartPsi(); + @NotNull PsiElement getLastPartPsi(); } diff --git a/src/main/gen/io/vlang/lang/psi/VlangImportSpec.java b/src/main/gen/io/vlang/lang/psi/VlangImportSpec.java index 36227897..bb9e4bbf 100644 --- a/src/main/gen/io/vlang/lang/psi/VlangImportSpec.java +++ b/src/main/gen/io/vlang/lang/psi/VlangImportSpec.java @@ -17,28 +17,20 @@ public interface VlangImportSpec extends VlangCompositeElement { @Nullable VlangSelectiveImportList getSelectiveImportList(); - @NotNull - PsiElement getIdentifier(); + @NotNull PsiElement getIdentifier(); - @NotNull - String getLastPart(); + @NotNull String getLastPart(); - @NotNull - PsiElement getLastPartPsi(); + @NotNull PsiElement getLastPartPsi(); - @NotNull - String getName(); + @NotNull String getName(); - @NotNull - String getImportedName(); + @NotNull String getImportedName(); - @Nullable - String getAliasName(); + @Nullable String getAliasName(); - @NotNull - String getPathName(); + @NotNull String getPathName(); - @NotNull - List resolve(); + @NotNull List<@NotNull VlangModule> resolve(); } diff --git a/src/main/gen/io/vlang/lang/psi/VlangIndexOrSliceExpr.java b/src/main/gen/io/vlang/lang/psi/VlangIndexOrSliceExpr.java index b4423ddc..6b596524 100644 --- a/src/main/gen/io/vlang/lang/psi/VlangIndexOrSliceExpr.java +++ b/src/main/gen/io/vlang/lang/psi/VlangIndexOrSliceExpr.java @@ -37,16 +37,12 @@ public interface VlangIndexOrSliceExpr extends VlangExpression { boolean isSlice(); - @Nullable - PsiElement getExpression(); + @Nullable PsiElement getExpression(); - @Nullable - Pair getRange(); + @Nullable Pair<@Nullable PsiElement, @Nullable PsiElement> getRange(); - @Nullable - PsiElement getSliceStart(); + @Nullable PsiElement getSliceStart(); - @Nullable - PsiElement getSliceEnd(); + @Nullable PsiElement getSliceEnd(); } diff --git a/src/main/gen/io/vlang/lang/psi/VlangInterfaceDeclaration.java b/src/main/gen/io/vlang/lang/psi/VlangInterfaceDeclaration.java index ebe1d0f8..453287cb 100644 --- a/src/main/gen/io/vlang/lang/psi/VlangInterfaceDeclaration.java +++ b/src/main/gen/io/vlang/lang/psi/VlangInterfaceDeclaration.java @@ -20,13 +20,10 @@ public interface VlangInterfaceDeclaration extends VlangNamedElement, VlangAttri @Nullable VlangSymbolVisibility getSymbolVisibility(); - @NotNull - String getName(); + @NotNull String getName(); - @Nullable - PsiElement getIdentifier(); + @Nullable PsiElement getIdentifier(); - @NotNull - VlangTypeEx getTypeInner(@Nullable ResolveState context); + @NotNull VlangTypeEx getTypeInner(@Nullable ResolveState context); } diff --git a/src/main/gen/io/vlang/lang/psi/VlangInterfaceMethodDefinition.java b/src/main/gen/io/vlang/lang/psi/VlangInterfaceMethodDefinition.java index b2dfe9b0..35bed315 100644 --- a/src/main/gen/io/vlang/lang/psi/VlangInterfaceMethodDefinition.java +++ b/src/main/gen/io/vlang/lang/psi/VlangInterfaceMethodDefinition.java @@ -20,17 +20,14 @@ public interface VlangInterfaceMethodDefinition extends VlangSignatureOwner, Vla @NotNull PsiElement getIdentifier(); - @Nullable - VlangTypeEx getTypeInner(@Nullable ResolveState context); + @Nullable VlangTypeEx getTypeInner(@Nullable ResolveState context); boolean isPublic(); boolean isMutable(); - @NotNull - VlangInterfaceDeclaration getOwner(); + @NotNull VlangInterfaceDeclaration getOwner(); - @NotNull - String getQualifiedName(); + @NotNull String getQualifiedName(); } diff --git a/src/main/gen/io/vlang/lang/psi/VlangInterfaceType.java b/src/main/gen/io/vlang/lang/psi/VlangInterfaceType.java index 0d37d325..a0e41988 100644 --- a/src/main/gen/io/vlang/lang/psi/VlangInterfaceType.java +++ b/src/main/gen/io/vlang/lang/psi/VlangInterfaceType.java @@ -25,19 +25,14 @@ public interface VlangInterfaceType extends VlangType, VlangFieldListOwner, Vlan @NotNull PsiElement getInterface(); - @NotNull - List getFieldList(); + @NotNull List<@NotNull VlangFieldDefinition> getFieldList(); - @NotNull - List getOwnFieldList(); + @NotNull List<@NotNull VlangFieldDefinition> getOwnFieldList(); - @NotNull - List getMethodList(); + @NotNull List<@NotNull VlangInterfaceMethodDefinition> getMethodList(); - @NotNull - List getEmbeddedInterfaces(); + @NotNull List<@NotNull VlangInterfaceType> getEmbeddedInterfaces(); - @NotNull - List getEmbeddedInterfacesList(); + @NotNull List<@NotNull VlangEmbeddedDefinition> getEmbeddedInterfacesList(); } diff --git a/src/main/gen/io/vlang/lang/psi/VlangIsRefTypeCallExpr.java b/src/main/gen/io/vlang/lang/psi/VlangIsRefTypeCallExpr.java index 31c86083..c341af3f 100644 --- a/src/main/gen/io/vlang/lang/psi/VlangIsRefTypeCallExpr.java +++ b/src/main/gen/io/vlang/lang/psi/VlangIsRefTypeCallExpr.java @@ -23,7 +23,6 @@ public interface VlangIsRefTypeCallExpr extends VlangExpression, VlangBuiltinCal @NotNull PsiElement getIsreftype(); - @NotNull - VlangBuiltinReference getReference(); + @NotNull VlangBuiltinReference<@NotNull VlangIsRefTypeCallExpr> getReference(); } diff --git a/src/main/gen/io/vlang/lang/psi/VlangJsonCallExpr.java b/src/main/gen/io/vlang/lang/psi/VlangJsonCallExpr.java index 4932301f..8ded1fc8 100644 --- a/src/main/gen/io/vlang/lang/psi/VlangJsonCallExpr.java +++ b/src/main/gen/io/vlang/lang/psi/VlangJsonCallExpr.java @@ -10,7 +10,6 @@ public interface VlangJsonCallExpr extends VlangCallExpr { @NotNull VlangJsonArgumentList getJsonArgumentList(); - @NotNull - List getParameters(); + @NotNull List<@NotNull VlangExpression> getParameters(); } diff --git a/src/main/gen/io/vlang/lang/psi/VlangLabelRef.java b/src/main/gen/io/vlang/lang/psi/VlangLabelRef.java index 71235e16..0054cfe6 100644 --- a/src/main/gen/io/vlang/lang/psi/VlangLabelRef.java +++ b/src/main/gen/io/vlang/lang/psi/VlangLabelRef.java @@ -11,10 +11,8 @@ public interface VlangLabelRef extends VlangCompositeElement { @NotNull PsiElement getIdentifier(); - @NotNull - VlangLabelReference getReference(); + @NotNull VlangLabelReference getReference(); - @NotNull - String getName(); + @NotNull String getName(); } diff --git a/src/main/gen/io/vlang/lang/psi/VlangLastComma.java b/src/main/gen/io/vlang/lang/psi/VlangLastComma.java new file mode 100644 index 00000000..128cd407 --- /dev/null +++ b/src/main/gen/io/vlang/lang/psi/VlangLastComma.java @@ -0,0 +1,16 @@ +// This is a generated file. Not intended for manual editing. +package io.vlang.lang.psi; + +import java.util.List; +import org.jetbrains.annotations.*; +import com.intellij.psi.PsiElement; +import com.intellij.psi.PsiErrorElement; + +public interface VlangLastComma extends PsiErrorElement { + + @NotNull + PsiElement getComma(); + + @NotNull String getErrorDescription(); + +} diff --git a/src/main/gen/io/vlang/lang/psi/VlangMatchArm.java b/src/main/gen/io/vlang/lang/psi/VlangMatchArm.java index f8806b0a..51059ce3 100644 --- a/src/main/gen/io/vlang/lang/psi/VlangMatchArm.java +++ b/src/main/gen/io/vlang/lang/psi/VlangMatchArm.java @@ -16,7 +16,6 @@ public interface VlangMatchArm extends VlangCompositeElement { @Nullable PsiElement getSemicolonSynthetic(); - @NotNull - List getParameterList(); + @NotNull List<@NotNull VlangCompositeElement> getParameterList(); } diff --git a/src/main/gen/io/vlang/lang/psi/VlangMatchExpression.java b/src/main/gen/io/vlang/lang/psi/VlangMatchExpression.java index 3bc08c44..45f97320 100644 --- a/src/main/gen/io/vlang/lang/psi/VlangMatchExpression.java +++ b/src/main/gen/io/vlang/lang/psi/VlangMatchExpression.java @@ -22,17 +22,13 @@ public interface VlangMatchExpression extends VlangExpression { @NotNull PsiElement getMatch(); - @NotNull - List getArms(); + @NotNull List<@NotNull VlangMatchArm> getArms(); - @NotNull - List getExpressionArms(); + @NotNull List<@NotNull VlangExpression> getExpressionArms(); - @NotNull - List getTypeArms(); + @NotNull List<@NotNull VlangType> getTypeArms(); - @Nullable - VlangMatchElseArmClause getElseArm(); + @Nullable VlangMatchElseArmClause getElseArm(); boolean withElse(); diff --git a/src/main/gen/io/vlang/lang/psi/VlangMembersGroup.java b/src/main/gen/io/vlang/lang/psi/VlangMembersGroup.java index 8cd0c988..af88f108 100644 --- a/src/main/gen/io/vlang/lang/psi/VlangMembersGroup.java +++ b/src/main/gen/io/vlang/lang/psi/VlangMembersGroup.java @@ -25,7 +25,6 @@ public interface VlangMembersGroup extends VlangMemberModifiersOwner { @Nullable PsiElement getSemicolonSynthetic(); - @NotNull - List getMemberModifierList(); + @NotNull List<@NotNull VlangMemberModifier> getMemberModifierList(); } diff --git a/src/main/gen/io/vlang/lang/psi/VlangMethodDeclaration.java b/src/main/gen/io/vlang/lang/psi/VlangMethodDeclaration.java index 80a08ea9..59b74763 100644 --- a/src/main/gen/io/vlang/lang/psi/VlangMethodDeclaration.java +++ b/src/main/gen/io/vlang/lang/psi/VlangMethodDeclaration.java @@ -41,20 +41,15 @@ public interface VlangMethodDeclaration extends VlangSignatureOwner, VlangFuncti @NotNull PsiElement getFn(); - @Nullable - VlangType getReceiverType(); + @Nullable VlangType getReceiverType(); - @Nullable - VlangTypeEx getTypeInner(@Nullable ResolveState context); + @Nullable VlangTypeEx getTypeInner(@Nullable ResolveState context); - @Nullable - PsiElement getIdentifier(); + @Nullable PsiElement getIdentifier(); - @Nullable - String getQualifiedName(); + @Nullable String getQualifiedName(); - @Nullable - VlangNamedElement getOwner(); + @Nullable VlangNamedElement getOwner(); boolean isMutable(); diff --git a/src/main/gen/io/vlang/lang/psi/VlangModuleClause.java b/src/main/gen/io/vlang/lang/psi/VlangModuleClause.java index 90c1b032..6ece21db 100644 --- a/src/main/gen/io/vlang/lang/psi/VlangModuleClause.java +++ b/src/main/gen/io/vlang/lang/psi/VlangModuleClause.java @@ -24,7 +24,6 @@ public interface VlangModuleClause extends VlangNamedElement, VlangAttributeOwne @NotNull PsiElement getModule(); - @NotNull - String getName(); + @NotNull String getName(); } diff --git a/src/main/gen/io/vlang/lang/psi/VlangOffsetOfCallExpr.java b/src/main/gen/io/vlang/lang/psi/VlangOffsetOfCallExpr.java index 85765ced..9609617c 100644 --- a/src/main/gen/io/vlang/lang/psi/VlangOffsetOfCallExpr.java +++ b/src/main/gen/io/vlang/lang/psi/VlangOffsetOfCallExpr.java @@ -26,7 +26,6 @@ public interface VlangOffsetOfCallExpr extends VlangExpression, VlangBuiltinCall @NotNull PsiElement getOffsetof(); - @NotNull - VlangBuiltinReference getReference(); + @NotNull VlangBuiltinReference<@NotNull VlangOffsetOfCallExpr> getReference(); } diff --git a/src/main/gen/io/vlang/lang/psi/VlangParamDefinition.java b/src/main/gen/io/vlang/lang/psi/VlangParamDefinition.java index 1c362a75..4f4344ae 100644 --- a/src/main/gen/io/vlang/lang/psi/VlangParamDefinition.java +++ b/src/main/gen/io/vlang/lang/psi/VlangParamDefinition.java @@ -23,8 +23,7 @@ public interface VlangParamDefinition extends VlangMutabilityOwner, VlangNamedEl boolean isVariadic(); - @Nullable - String getName(); + @Nullable String getName(); boolean isPublic(); diff --git a/src/main/gen/io/vlang/lang/psi/VlangRangeClause.java b/src/main/gen/io/vlang/lang/psi/VlangRangeClause.java index 40d0ae73..f916fffc 100644 --- a/src/main/gen/io/vlang/lang/psi/VlangRangeClause.java +++ b/src/main/gen/io/vlang/lang/psi/VlangRangeClause.java @@ -17,7 +17,6 @@ public interface VlangRangeClause extends VlangVarDeclaration { //matching getRangeExpression(VlangRangeClause, ...) //methods are not found in VlangPsiImplUtil - @NotNull - List getVariablesList(); + @NotNull List<@NotNull VlangVarDefinition> getVariablesList(); } diff --git a/src/main/gen/io/vlang/lang/psi/VlangReceiver.java b/src/main/gen/io/vlang/lang/psi/VlangReceiver.java index 71b0f4d8..567db69b 100644 --- a/src/main/gen/io/vlang/lang/psi/VlangReceiver.java +++ b/src/main/gen/io/vlang/lang/psi/VlangReceiver.java @@ -23,11 +23,9 @@ public interface VlangReceiver extends VlangMutabilityOwner, VlangNamedElement, @NotNull PsiElement getIdentifier(); - @NotNull - VlangTypeEx getTypeInner(@Nullable ResolveState context); + @NotNull VlangTypeEx getTypeInner(@Nullable ResolveState context); - @Nullable - String getName(); + @Nullable String getName(); boolean isPublic(); diff --git a/src/main/gen/io/vlang/lang/psi/VlangReferenceExpression.java b/src/main/gen/io/vlang/lang/psi/VlangReferenceExpression.java index 1fca2607..68a0b356 100644 --- a/src/main/gen/io/vlang/lang/psi/VlangReferenceExpression.java +++ b/src/main/gen/io/vlang/lang/psi/VlangReferenceExpression.java @@ -12,17 +12,13 @@ public interface VlangReferenceExpression extends VlangExpression, VlangReferenc @NotNull PsiElement getIdentifier(); - @NotNull - VlangReference getReference(); + @NotNull VlangReference getReference(); - @Nullable - VlangCompositeElement getQualifier(); + @Nullable VlangCompositeElement getQualifier(); - @Nullable - PsiElement resolve(); + @Nullable PsiElement resolve(); - @NotNull - Access getReadWriteAccess(); + @NotNull Access getReadWriteAccess(); boolean safeAccess(); diff --git a/src/main/gen/io/vlang/lang/psi/VlangReturnStatement.java b/src/main/gen/io/vlang/lang/psi/VlangReturnStatement.java index 5e5fee24..0a681899 100644 --- a/src/main/gen/io/vlang/lang/psi/VlangReturnStatement.java +++ b/src/main/gen/io/vlang/lang/psi/VlangReturnStatement.java @@ -13,7 +13,6 @@ public interface VlangReturnStatement extends VlangStatement { @NotNull PsiElement getReturn(); - @Nullable - VlangSignatureOwner getOwner(); + @Nullable VlangSignatureOwner getOwner(); } diff --git a/src/main/gen/io/vlang/lang/psi/VlangSignature.java b/src/main/gen/io/vlang/lang/psi/VlangSignature.java index 068bc59d..447d2b43 100644 --- a/src/main/gen/io/vlang/lang/psi/VlangSignature.java +++ b/src/main/gen/io/vlang/lang/psi/VlangSignature.java @@ -16,7 +16,6 @@ public interface VlangSignature extends VlangCompositeElement, StubBasedPsiEleme @Nullable VlangResult getResult(); - @NotNull - Pair resultCount(); + @NotNull Pair<@NotNull Integer, @NotNull Integer> resultCount(); } diff --git a/src/main/gen/io/vlang/lang/psi/VlangSizeOfCallExpr.java b/src/main/gen/io/vlang/lang/psi/VlangSizeOfCallExpr.java index 0f2f9d8a..97683b21 100644 --- a/src/main/gen/io/vlang/lang/psi/VlangSizeOfCallExpr.java +++ b/src/main/gen/io/vlang/lang/psi/VlangSizeOfCallExpr.java @@ -23,7 +23,6 @@ public interface VlangSizeOfCallExpr extends VlangExpression, VlangBuiltinCallOw @NotNull PsiElement getSizeof(); - @NotNull - VlangBuiltinReference getReference(); + @NotNull VlangBuiltinReference<@NotNull VlangSizeOfCallExpr> getReference(); } diff --git a/src/main/gen/io/vlang/lang/psi/VlangSqlExpression.java b/src/main/gen/io/vlang/lang/psi/VlangSqlExpression.java index 96419033..77d98c27 100644 --- a/src/main/gen/io/vlang/lang/psi/VlangSqlExpression.java +++ b/src/main/gen/io/vlang/lang/psi/VlangSqlExpression.java @@ -15,7 +15,6 @@ public interface VlangSqlExpression extends VlangExpression { @NotNull VlangSqlBlock getSqlBlock(); - @Nullable - VlangTypeEx getType(@Nullable ResolveState context); + @Nullable VlangTypeEx getType(@Nullable ResolveState context); } diff --git a/src/main/gen/io/vlang/lang/psi/VlangStaticMethodDeclaration.java b/src/main/gen/io/vlang/lang/psi/VlangStaticMethodDeclaration.java index e4fdeaee..af31d6b8 100644 --- a/src/main/gen/io/vlang/lang/psi/VlangStaticMethodDeclaration.java +++ b/src/main/gen/io/vlang/lang/psi/VlangStaticMethodDeclaration.java @@ -42,10 +42,8 @@ public interface VlangStaticMethodDeclaration extends VlangSignatureOwner, Vlang //matching getType(VlangStaticMethodDeclaration, ...) //methods are not found in VlangPsiImplUtil - @Nullable - VlangTypeEx getTypeInner(@Nullable ResolveState context); + @Nullable VlangTypeEx getTypeInner(@Nullable ResolveState context); - @Nullable - String getQualifiedName(); + @NotNull String getQualifiedName(); } diff --git a/src/main/gen/io/vlang/lang/psi/VlangStringLiteral.java b/src/main/gen/io/vlang/lang/psi/VlangStringLiteral.java index 0f771547..0926c106 100644 --- a/src/main/gen/io/vlang/lang/psi/VlangStringLiteral.java +++ b/src/main/gen/io/vlang/lang/psi/VlangStringLiteral.java @@ -17,20 +17,16 @@ public interface VlangStringLiteral extends VlangExpression, PsiLanguageInjectio boolean isValidHost(); - @NotNull - VlangStringLiteral updateText(@NotNull String text); + @NotNull VlangStringLiteral updateText(@NotNull String text); - @NotNull - StringLiteralEscaper createLiteralTextEscaper(); + @NotNull StringLiteralEscaper<@NotNull VlangStringLiteral> createLiteralTextEscaper(); //WARNING: getDecodedText(...) is skipped //matching getDecodedText(VlangStringLiteral, ...) //methods are not found in VlangPsiImplUtil - @NotNull - PsiReference[] getReferences(); + @NotNull PsiReference @NotNull [] getReferences(); - @NotNull - String getContents(); + @NotNull String getContents(); } diff --git a/src/main/gen/io/vlang/lang/psi/VlangStructDeclaration.java b/src/main/gen/io/vlang/lang/psi/VlangStructDeclaration.java index b207005e..9a5bf1a4 100644 --- a/src/main/gen/io/vlang/lang/psi/VlangStructDeclaration.java +++ b/src/main/gen/io/vlang/lang/psi/VlangStructDeclaration.java @@ -20,23 +20,18 @@ public interface VlangStructDeclaration extends VlangNamedElement, VlangAttribut @Nullable VlangSymbolVisibility getSymbolVisibility(); - @Nullable - PsiElement getIdentifier(); + @Nullable PsiElement getIdentifier(); - @NotNull - String getName(); + @NotNull String getName(); - @NotNull - VlangTypeEx getTypeInner(@Nullable ResolveState context); + @NotNull VlangTypeEx getTypeInner(@Nullable ResolveState context); boolean isUnion(); - @NotNull - String getKindName(); + @NotNull String getKindName(); boolean isAttribute(); - @Nullable - PsiElement addField(@NotNull String name, @NotNull String type, boolean mutable); + @Nullable PsiElement addField(@NotNull String name, @NotNull String type, boolean mutable); } diff --git a/src/main/gen/io/vlang/lang/psi/VlangStructType.java b/src/main/gen/io/vlang/lang/psi/VlangStructType.java index 15dbd7e4..69b16e8e 100644 --- a/src/main/gen/io/vlang/lang/psi/VlangStructType.java +++ b/src/main/gen/io/vlang/lang/psi/VlangStructType.java @@ -13,6 +13,9 @@ public interface VlangStructType extends VlangType, VlangFieldListOwner, VlangGe @Nullable VlangGenericParameters getGenericParameters(); + @Nullable + VlangImplementsClause getImplementsClause(); + @Nullable PsiElement getLbrace(); @@ -28,17 +31,13 @@ public interface VlangStructType extends VlangType, VlangFieldListOwner, VlangGe @Nullable PsiElement getUnion(); - @NotNull - List getFieldList(); + @NotNull List<@NotNull VlangFieldDefinition> getFieldList(); - @NotNull - List getOwnFieldList(); + @NotNull List<@NotNull VlangFieldDefinition> getOwnFieldList(); - @NotNull - List getEmbeddedStructs(); + @NotNull List<@NotNull VlangStructType> getEmbeddedStructs(); - @NotNull - List getEmbeddedStructList(); + @NotNull List<@NotNull VlangEmbeddedDefinition> getEmbeddedStructList(); boolean isUnion(); diff --git a/src/main/gen/io/vlang/lang/psi/VlangType.java b/src/main/gen/io/vlang/lang/psi/VlangType.java index 36e8b750..fc362a97 100644 --- a/src/main/gen/io/vlang/lang/psi/VlangType.java +++ b/src/main/gen/io/vlang/lang/psi/VlangType.java @@ -21,13 +21,10 @@ public interface VlangType extends VlangGenericArgumentsOwner, StubBasedPsiEleme @Nullable VlangTypeReferenceExpression getTypeReferenceExpression(); - @Nullable - PsiElement getIdentifier(); + @Nullable PsiElement getIdentifier(); - @Nullable - VlangType getUnderlyingType(); + @Nullable VlangType getUnderlyingType(); - @NotNull - VlangType resolveType(); + @NotNull VlangType resolveType(); } diff --git a/src/main/gen/io/vlang/lang/psi/VlangTypeAliasDeclaration.java b/src/main/gen/io/vlang/lang/psi/VlangTypeAliasDeclaration.java index e8f314e9..846ddf74 100644 --- a/src/main/gen/io/vlang/lang/psi/VlangTypeAliasDeclaration.java +++ b/src/main/gen/io/vlang/lang/psi/VlangTypeAliasDeclaration.java @@ -23,13 +23,10 @@ public interface VlangTypeAliasDeclaration extends VlangNamedElement, VlangAttri @NotNull PsiElement getType_(); - @Nullable - PsiElement getIdentifier(); + @Nullable PsiElement getIdentifier(); - @NotNull - String getName(); + @NotNull String getName(); - @NotNull - VlangTypeEx getTypeInner(@Nullable ResolveState context); + @NotNull VlangTypeEx getTypeInner(@Nullable ResolveState context); } diff --git a/src/main/gen/io/vlang/lang/psi/VlangTypeOfCallExpr.java b/src/main/gen/io/vlang/lang/psi/VlangTypeOfCallExpr.java index 6b977558..54866c8f 100644 --- a/src/main/gen/io/vlang/lang/psi/VlangTypeOfCallExpr.java +++ b/src/main/gen/io/vlang/lang/psi/VlangTypeOfCallExpr.java @@ -23,7 +23,6 @@ public interface VlangTypeOfCallExpr extends VlangExpression, VlangBuiltinCallOw @NotNull PsiElement getTypeof(); - @NotNull - VlangBuiltinReference getReference(); + @NotNull VlangBuiltinReference<@NotNull VlangTypeOfCallExpr> getReference(); } diff --git a/src/main/gen/io/vlang/lang/psi/VlangTypeReferenceExpression.java b/src/main/gen/io/vlang/lang/psi/VlangTypeReferenceExpression.java index 6a80ff95..bb55171d 100644 --- a/src/main/gen/io/vlang/lang/psi/VlangTypeReferenceExpression.java +++ b/src/main/gen/io/vlang/lang/psi/VlangTypeReferenceExpression.java @@ -13,14 +13,11 @@ public interface VlangTypeReferenceExpression extends VlangReferenceExpressionBa @NotNull PsiElement getIdentifier(); - @NotNull - VlangReference getReference(); + @NotNull VlangReference getReference(); - @Nullable - VlangCompositeElement getQualifier(); + @Nullable VlangCompositeElement getQualifier(); - @Nullable - PsiElement resolve(); + @Nullable PsiElement resolve(); //WARNING: getType(...) is skipped //matching getType(VlangTypeReferenceExpression, ...) diff --git a/src/main/gen/io/vlang/lang/psi/VlangVarDefinition.java b/src/main/gen/io/vlang/lang/psi/VlangVarDefinition.java index 21380489..89e3ea46 100644 --- a/src/main/gen/io/vlang/lang/psi/VlangVarDefinition.java +++ b/src/main/gen/io/vlang/lang/psi/VlangVarDefinition.java @@ -18,14 +18,11 @@ public interface VlangVarDefinition extends VlangMutabilityOwner, VlangNamedElem @NotNull PsiElement getIdentifier(); - @Nullable - VlangTypeEx getTypeInner(@Nullable ResolveState context); + @Nullable VlangTypeEx getTypeInner(@Nullable ResolveState context); - @NotNull - String getName(); + @NotNull String getName(); - @NotNull - PsiReference getReference(); + @NotNull PsiReference getReference(); boolean isMutable(); @@ -35,10 +32,8 @@ public interface VlangVarDefinition extends VlangMutabilityOwner, VlangNamedElem void makeImmutable(); - @Nullable - VlangExpression getInitializer(); + @Nullable VlangExpression getInitializer(); - @Nullable - VlangSymbolVisibility getSymbolVisibility(); + @Nullable VlangSymbolVisibility getSymbolVisibility(); } diff --git a/src/main/gen/io/vlang/lang/psi/VlangVisitor.java b/src/main/gen/io/vlang/lang/psi/VlangVisitor.java index fce38dc0..b6208cbd 100644 --- a/src/main/gen/io/vlang/lang/psi/VlangVisitor.java +++ b/src/main/gen/io/vlang/lang/psi/VlangVisitor.java @@ -3,6 +3,7 @@ import org.jetbrains.annotations.*; import com.intellij.psi.PsiElementVisitor; +import com.intellij.psi.PsiErrorElement; import com.intellij.psi.PsiLanguageInjectionHost; public class VlangVisitor extends PsiElementVisitor { @@ -356,6 +357,10 @@ public void visitIfExpression(@NotNull VlangIfExpression o) { visitExpression(o); } + public void visitImplementsClause(@NotNull VlangImplementsClause o) { + visitCompositeElement(o); + } + public void visitImportAlias(@NotNull VlangImportAlias o) { visitNamedElement(o); } @@ -458,6 +463,10 @@ public void visitLabeledStatement(@NotNull VlangLabeledStatement o) { visitStatement(o); } + public void visitLastComma(@NotNull VlangLastComma o) { + visitPsiErrorElement(o); + } + public void visitLeftHandExprList(@NotNull VlangLeftHandExprList o) { visitCompositeElement(o); } @@ -915,6 +924,10 @@ public void visitWrongPointerType(@NotNull VlangWrongPointerType o) { visitType(o); } + public void visitPsiErrorElement(@NotNull PsiErrorElement o) { + visitElement(o); + } + public void visitAttributeOwner(@NotNull VlangAttributeOwner o) { visitCompositeElement(o); } diff --git a/src/main/gen/io/vlang/lang/psi/impl/VlangAliasTypeImpl.java b/src/main/gen/io/vlang/lang/psi/impl/VlangAliasTypeImpl.java index dfd2d34f..ec21f580 100644 --- a/src/main/gen/io/vlang/lang/psi/impl/VlangAliasTypeImpl.java +++ b/src/main/gen/io/vlang/lang/psi/impl/VlangAliasTypeImpl.java @@ -63,8 +63,7 @@ public boolean isAlias() { } @Override - @Nullable - public VlangType getAliasType() { + public @Nullable VlangType getAliasType() { return VlangPsiImplUtil.getAliasType(this); } diff --git a/src/main/gen/io/vlang/lang/psi/impl/VlangAnonymousStructTypeImpl.java b/src/main/gen/io/vlang/lang/psi/impl/VlangAnonymousStructTypeImpl.java index 6b1793b2..7d12a1a8 100644 --- a/src/main/gen/io/vlang/lang/psi/impl/VlangAnonymousStructTypeImpl.java +++ b/src/main/gen/io/vlang/lang/psi/impl/VlangAnonymousStructTypeImpl.java @@ -58,14 +58,12 @@ public PsiElement getStruct() { } @Override - @NotNull - public List getFieldList() { + public @NotNull List<@NotNull VlangFieldDefinition> getFieldList() { return VlangPsiImplUtil.getFieldList(this); } @Override - @NotNull - public List getOwnFieldList() { + public @NotNull List<@NotNull VlangFieldDefinition> getOwnFieldList() { return VlangPsiImplUtil.getOwnFieldList(this); } diff --git a/src/main/gen/io/vlang/lang/psi/impl/VlangAppendStatementImpl.java b/src/main/gen/io/vlang/lang/psi/impl/VlangAppendStatementImpl.java index 24ff2e87..24ee7f82 100644 --- a/src/main/gen/io/vlang/lang/psi/impl/VlangAppendStatementImpl.java +++ b/src/main/gen/io/vlang/lang/psi/impl/VlangAppendStatementImpl.java @@ -40,8 +40,7 @@ public VlangShiftLeftOp getShiftLeftOp() { } @Override - @Nullable - public VlangExpression getLeft() { + public @Nullable VlangExpression getLeft() { return VlangPsiImplUtil.getLeft(this); } diff --git a/src/main/gen/io/vlang/lang/psi/impl/VlangAsmBlockStatementImpl.java b/src/main/gen/io/vlang/lang/psi/impl/VlangAsmBlockStatementImpl.java index 49e7da61..e10cff00 100644 --- a/src/main/gen/io/vlang/lang/psi/impl/VlangAsmBlockStatementImpl.java +++ b/src/main/gen/io/vlang/lang/psi/impl/VlangAsmBlockStatementImpl.java @@ -40,9 +40,9 @@ public PsiElement getAsm() { } @Override - @Nullable + @NotNull public PsiElement getIdentifier() { - return findChildByType(IDENTIFIER); + return notNullChild(findChildByType(IDENTIFIER)); } @Override diff --git a/src/main/gen/io/vlang/lang/psi/impl/VlangAttributeIdentifierImpl.java b/src/main/gen/io/vlang/lang/psi/impl/VlangAttributeIdentifierImpl.java index 54327a18..0e6f3007 100644 --- a/src/main/gen/io/vlang/lang/psi/impl/VlangAttributeIdentifierImpl.java +++ b/src/main/gen/io/vlang/lang/psi/impl/VlangAttributeIdentifierImpl.java @@ -45,8 +45,7 @@ public PsiElement getUnsafe() { } @Override - @NotNull - public VlangAttributeReference getReference() { + public @NotNull VlangAttributeReference getReference() { return VlangPsiImplUtil.getReference(this); } diff --git a/src/main/gen/io/vlang/lang/psi/impl/VlangBinaryExprImpl.java b/src/main/gen/io/vlang/lang/psi/impl/VlangBinaryExprImpl.java index 2061f4f7..6c554b76 100644 --- a/src/main/gen/io/vlang/lang/psi/impl/VlangBinaryExprImpl.java +++ b/src/main/gen/io/vlang/lang/psi/impl/VlangBinaryExprImpl.java @@ -48,8 +48,7 @@ public VlangExpression getRight() { } @Override - @Nullable - public PsiElement getOperator() { + public @Nullable PsiElement getOperator() { return VlangPsiImplUtil.getOperator(this); } diff --git a/src/main/gen/io/vlang/lang/psi/impl/VlangCallExprImpl.java b/src/main/gen/io/vlang/lang/psi/impl/VlangCallExprImpl.java index 513969f3..deb2fb27 100644 --- a/src/main/gen/io/vlang/lang/psi/impl/VlangCallExprImpl.java +++ b/src/main/gen/io/vlang/lang/psi/impl/VlangCallExprImpl.java @@ -70,26 +70,22 @@ public VlangResultPropagationExpression getResultPropagationExpression() { } @Override - @NotNull - public List getParameters() { + public @NotNull List<@NotNull VlangExpression> getParameters() { return VlangPsiImplUtil.getParameters(this); } @Override - @Nullable - public PsiElement getIdentifier() { + public @Nullable PsiElement getIdentifier() { return VlangPsiImplUtil.getIdentifier(this); } @Override - @Nullable - public VlangReferenceExpression getQualifier() { + public @Nullable VlangReferenceExpression getQualifier() { return VlangPsiImplUtil.getQualifier(this); } @Override - @Nullable - public PsiElement resolve() { + public @Nullable PsiElement resolve() { return VlangPsiImplUtil.resolve(this); } diff --git a/src/main/gen/io/vlang/lang/psi/impl/VlangCaptureListImpl.java b/src/main/gen/io/vlang/lang/psi/impl/VlangCaptureListImpl.java index f413448e..9ac1c917 100644 --- a/src/main/gen/io/vlang/lang/psi/impl/VlangCaptureListImpl.java +++ b/src/main/gen/io/vlang/lang/psi/impl/VlangCaptureListImpl.java @@ -45,8 +45,7 @@ public PsiElement getRbrack() { } @Override - @NotNull - public PsiElement addCapture(@NotNull String name) { + public @NotNull PsiElement addCapture(@NotNull String name) { return VlangPsiImplUtil.addCapture(this, name); } diff --git a/src/main/gen/io/vlang/lang/psi/impl/VlangConstDefinitionImpl.java b/src/main/gen/io/vlang/lang/psi/impl/VlangConstDefinitionImpl.java index 81b9bafa..275f1773 100644 --- a/src/main/gen/io/vlang/lang/psi/impl/VlangConstDefinitionImpl.java +++ b/src/main/gen/io/vlang/lang/psi/impl/VlangConstDefinitionImpl.java @@ -53,8 +53,7 @@ public PsiElement getIdentifier() { } @Override - @Nullable - public VlangTypeEx getTypeInner(@Nullable ResolveState context) { + public @Nullable VlangTypeEx getTypeInner(@Nullable ResolveState context) { return VlangPsiImplUtil.getTypeInner(this, context); } @@ -69,14 +68,12 @@ public boolean isCompileTime() { } @Override - @NotNull - public String getName() { + public @NotNull String getName() { return VlangPsiImplUtil.getName(this); } @Override - @Nullable - public VlangSymbolVisibility getSymbolVisibility() { + public @Nullable VlangSymbolVisibility getSymbolVisibility() { return VlangPsiImplUtil.getSymbolVisibility(this); } diff --git a/src/main/gen/io/vlang/lang/psi/impl/VlangDumpCallExprImpl.java b/src/main/gen/io/vlang/lang/psi/impl/VlangDumpCallExprImpl.java index f5629b1b..29257fa2 100644 --- a/src/main/gen/io/vlang/lang/psi/impl/VlangDumpCallExprImpl.java +++ b/src/main/gen/io/vlang/lang/psi/impl/VlangDumpCallExprImpl.java @@ -52,8 +52,7 @@ public PsiElement getDump() { } @Override - @NotNull - public VlangBuiltinReference getReference() { + public @NotNull VlangBuiltinReference<@NotNull VlangDumpCallExpr> getReference() { return VlangPsiImplUtil.getReference(this); } diff --git a/src/main/gen/io/vlang/lang/psi/impl/VlangEmbeddedDefinitionImpl.java b/src/main/gen/io/vlang/lang/psi/impl/VlangEmbeddedDefinitionImpl.java index 553c3f35..0e0f0e3b 100644 --- a/src/main/gen/io/vlang/lang/psi/impl/VlangEmbeddedDefinitionImpl.java +++ b/src/main/gen/io/vlang/lang/psi/impl/VlangEmbeddedDefinitionImpl.java @@ -41,20 +41,17 @@ public VlangType getType() { } @Override - @NotNull - public String getName() { + public @NotNull String getName() { return VlangPsiImplUtil.getName(this); } @Override - @Nullable - public PsiElement getIdentifier() { + public @Nullable PsiElement getIdentifier() { return VlangPsiImplUtil.getIdentifier(this); } @Override - @NotNull - public VlangTypeEx getType(@Nullable ResolveState context) { + public @NotNull VlangTypeEx getType(@Nullable ResolveState context) { return VlangPsiImplUtil.getType(this, context); } diff --git a/src/main/gen/io/vlang/lang/psi/impl/VlangEnumDeclarationImpl.java b/src/main/gen/io/vlang/lang/psi/impl/VlangEnumDeclarationImpl.java index f2fb2d65..2c556ff1 100644 --- a/src/main/gen/io/vlang/lang/psi/impl/VlangEnumDeclarationImpl.java +++ b/src/main/gen/io/vlang/lang/psi/impl/VlangEnumDeclarationImpl.java @@ -53,20 +53,17 @@ public VlangSymbolVisibility getSymbolVisibility() { } @Override - @NotNull - public String getName() { + public @NotNull String getName() { return VlangPsiImplUtil.getName(this); } @Override - @Nullable - public PsiElement getIdentifier() { + public @Nullable PsiElement getIdentifier() { return VlangPsiImplUtil.getIdentifier(this); } @Override - @NotNull - public VlangTypeEx getTypeInner(@Nullable ResolveState context) { + public @NotNull VlangTypeEx getTypeInner(@Nullable ResolveState context) { return VlangPsiImplUtil.getTypeInner(this, context); } diff --git a/src/main/gen/io/vlang/lang/psi/impl/VlangEnumFetchImpl.java b/src/main/gen/io/vlang/lang/psi/impl/VlangEnumFetchImpl.java index 6e7103d3..5f4826b9 100644 --- a/src/main/gen/io/vlang/lang/psi/impl/VlangEnumFetchImpl.java +++ b/src/main/gen/io/vlang/lang/psi/impl/VlangEnumFetchImpl.java @@ -40,20 +40,17 @@ public PsiElement getIdentifier() { } @Override - @NotNull - public VlangReference getReference() { + public @NotNull VlangReference getReference() { return VlangPsiImplUtil.getReference(this); } @Override - @Nullable - public VlangCompositeElement getQualifier() { + public @Nullable VlangCompositeElement getQualifier() { return VlangPsiImplUtil.getQualifier(this); } @Override - @Nullable - public PsiElement resolve() { + public @Nullable PsiElement resolve() { return VlangPsiImplUtil.resolve(this); } diff --git a/src/main/gen/io/vlang/lang/psi/impl/VlangEnumFieldDefinitionImpl.java b/src/main/gen/io/vlang/lang/psi/impl/VlangEnumFieldDefinitionImpl.java index 7121c37f..fe8b66ea 100644 --- a/src/main/gen/io/vlang/lang/psi/impl/VlangEnumFieldDefinitionImpl.java +++ b/src/main/gen/io/vlang/lang/psi/impl/VlangEnumFieldDefinitionImpl.java @@ -46,14 +46,12 @@ public boolean isPublic() { } @Override - @NotNull - public VlangTypeEx getTypeInner(@Nullable ResolveState context) { + public @NotNull VlangTypeEx getTypeInner(@Nullable ResolveState context) { return VlangPsiImplUtil.getTypeInner(this, context); } @Override - @Nullable - public Long constantValue() { + public @Nullable Long constantValue() { return VlangPsiImplUtil.constantValue(this); } diff --git a/src/main/gen/io/vlang/lang/psi/impl/VlangEnumTypeImpl.java b/src/main/gen/io/vlang/lang/psi/impl/VlangEnumTypeImpl.java index 574254a6..48bf85a2 100644 --- a/src/main/gen/io/vlang/lang/psi/impl/VlangEnumTypeImpl.java +++ b/src/main/gen/io/vlang/lang/psi/impl/VlangEnumTypeImpl.java @@ -70,8 +70,7 @@ public PsiElement getIdentifier() { } @Override - @NotNull - public List getFieldList() { + public @NotNull List<@NotNull VlangEnumFieldDefinition> getFieldList() { return VlangPsiImplUtil.getFieldList(this); } diff --git a/src/main/gen/io/vlang/lang/psi/impl/VlangExpressionImpl.java b/src/main/gen/io/vlang/lang/psi/impl/VlangExpressionImpl.java index d192ab88..76ff126f 100644 --- a/src/main/gen/io/vlang/lang/psi/impl/VlangExpressionImpl.java +++ b/src/main/gen/io/vlang/lang/psi/impl/VlangExpressionImpl.java @@ -29,8 +29,7 @@ public void accept(@NotNull PsiElementVisitor visitor) { } @Override - @Nullable - public VlangTypeEx getType(@Nullable ResolveState context) { + public @Nullable VlangTypeEx getType(@Nullable ResolveState context) { return VlangPsiImplUtil.getType(this, context); } diff --git a/src/main/gen/io/vlang/lang/psi/impl/VlangFieldDefinitionImpl.java b/src/main/gen/io/vlang/lang/psi/impl/VlangFieldDefinitionImpl.java index 3370b328..b00cba82 100644 --- a/src/main/gen/io/vlang/lang/psi/impl/VlangFieldDefinitionImpl.java +++ b/src/main/gen/io/vlang/lang/psi/impl/VlangFieldDefinitionImpl.java @@ -41,20 +41,17 @@ public PsiElement getIdentifier() { } @Override - @Nullable - public VlangCompositeElement getQualifier() { + public @Nullable VlangCompositeElement getQualifier() { return VlangPsiImplUtil.getQualifier(this); } @Override - @Nullable - public String getQualifiedName() { + public @Nullable String getQualifiedName() { return VlangPsiImplUtil.getQualifiedName(this); } @Override - @NotNull - public VlangTypeEx getTypeInner(@Nullable ResolveState context) { + public @NotNull VlangTypeEx getTypeInner(@Nullable ResolveState context) { return VlangPsiImplUtil.getTypeInner(this, context); } @@ -84,8 +81,7 @@ public void makeImmutable() { } @Override - @NotNull - public VlangNamedElement getOwner() { + public @NotNull VlangNamedElement getOwner() { return VlangPsiImplUtil.getOwner(this); } diff --git a/src/main/gen/io/vlang/lang/psi/impl/VlangFieldNameImpl.java b/src/main/gen/io/vlang/lang/psi/impl/VlangFieldNameImpl.java index 688754eb..c5420d78 100644 --- a/src/main/gen/io/vlang/lang/psi/impl/VlangFieldNameImpl.java +++ b/src/main/gen/io/vlang/lang/psi/impl/VlangFieldNameImpl.java @@ -33,20 +33,17 @@ public VlangReferenceExpression getReferenceExpression() { } @Override - @NotNull - public PsiElement getIdentifier() { + public @NotNull PsiElement getIdentifier() { return VlangPsiImplUtil.getIdentifier(this); } @Override - @Nullable - public VlangCompositeElement getQualifier() { + public @Nullable VlangCompositeElement getQualifier() { return VlangPsiImplUtil.getQualifier(this); } @Override - @Nullable - public PsiElement resolve() { + public @Nullable PsiElement resolve() { return VlangPsiImplUtil.resolve(this); } diff --git a/src/main/gen/io/vlang/lang/psi/impl/VlangFieldsGroupImpl.java b/src/main/gen/io/vlang/lang/psi/impl/VlangFieldsGroupImpl.java index 56cdefdf..6b2cdc6e 100644 --- a/src/main/gen/io/vlang/lang/psi/impl/VlangFieldsGroupImpl.java +++ b/src/main/gen/io/vlang/lang/psi/impl/VlangFieldsGroupImpl.java @@ -57,8 +57,7 @@ public PsiElement getSemicolonSynthetic() { } @Override - @NotNull - public List getMemberModifierList() { + public @NotNull List<@NotNull VlangMemberModifier> getMemberModifierList() { return VlangPsiImplUtil.getMemberModifierList(this); } diff --git a/src/main/gen/io/vlang/lang/psi/impl/VlangFunctionDeclarationImpl.java b/src/main/gen/io/vlang/lang/psi/impl/VlangFunctionDeclarationImpl.java index bdad7ba9..168d56dd 100644 --- a/src/main/gen/io/vlang/lang/psi/impl/VlangFunctionDeclarationImpl.java +++ b/src/main/gen/io/vlang/lang/psi/impl/VlangFunctionDeclarationImpl.java @@ -77,14 +77,12 @@ public PsiElement getIdentifier() { } @Override - @NotNull - public String getName() { + public @NotNull String getName() { return VlangPsiImplUtil.getName(this); } @Override - @Nullable - public VlangTypeEx getTypeInner(@Nullable ResolveState context) { + public @Nullable VlangTypeEx getTypeInner(@Nullable ResolveState context) { return VlangPsiImplUtil.getTypeInner(this, context); } diff --git a/src/main/gen/io/vlang/lang/psi/impl/VlangFunctionLitImpl.java b/src/main/gen/io/vlang/lang/psi/impl/VlangFunctionLitImpl.java index 4649ff6e..39106e51 100644 --- a/src/main/gen/io/vlang/lang/psi/impl/VlangFunctionLitImpl.java +++ b/src/main/gen/io/vlang/lang/psi/impl/VlangFunctionLitImpl.java @@ -58,8 +58,7 @@ public PsiElement getFn() { } @Override - @NotNull - public PsiElement addCapture(@NotNull String name) { + public @NotNull PsiElement addCapture(@NotNull String name) { return VlangPsiImplUtil.addCapture(this, name); } diff --git a/src/main/gen/io/vlang/lang/psi/impl/VlangGenericArgumentsImpl.java b/src/main/gen/io/vlang/lang/psi/impl/VlangGenericArgumentsImpl.java index c4df0c4a..2ed95ad0 100644 --- a/src/main/gen/io/vlang/lang/psi/impl/VlangGenericArgumentsImpl.java +++ b/src/main/gen/io/vlang/lang/psi/impl/VlangGenericArgumentsImpl.java @@ -27,8 +27,7 @@ public void accept(@NotNull PsiElementVisitor visitor) { } @Override - @NotNull - public List getTypeArguments() { + public @NotNull List<@NotNull VlangType> getTypeArguments() { return VlangPsiImplUtil.getTypeArguments(this); } diff --git a/src/main/gen/io/vlang/lang/psi/impl/VlangGenericParameterImpl.java b/src/main/gen/io/vlang/lang/psi/impl/VlangGenericParameterImpl.java index a1ac66fc..d0caa9ba 100644 --- a/src/main/gen/io/vlang/lang/psi/impl/VlangGenericParameterImpl.java +++ b/src/main/gen/io/vlang/lang/psi/impl/VlangGenericParameterImpl.java @@ -41,8 +41,7 @@ public PsiElement getIdentifier() { } @Override - @Nullable - public VlangTypeEx getTypeInner(@Nullable ResolveState context) { + public @Nullable VlangTypeEx getTypeInner(@Nullable ResolveState context) { return VlangPsiImplUtil.getTypeInner(this, context); } diff --git a/src/main/gen/io/vlang/lang/psi/impl/VlangGenericParametersImpl.java b/src/main/gen/io/vlang/lang/psi/impl/VlangGenericParametersImpl.java index 9fd23e3c..75510321 100644 --- a/src/main/gen/io/vlang/lang/psi/impl/VlangGenericParametersImpl.java +++ b/src/main/gen/io/vlang/lang/psi/impl/VlangGenericParametersImpl.java @@ -33,8 +33,7 @@ public void accept(@NotNull PsiElementVisitor visitor) { } @Override - @NotNull - public List getParameters() { + public @NotNull List<@NotNull VlangGenericParameter> getParameters() { return VlangPsiImplUtil.getParameters(this); } diff --git a/src/main/gen/io/vlang/lang/psi/impl/VlangGlobalVariableDefinitionImpl.java b/src/main/gen/io/vlang/lang/psi/impl/VlangGlobalVariableDefinitionImpl.java index 3e00d9b6..75e151fb 100644 --- a/src/main/gen/io/vlang/lang/psi/impl/VlangGlobalVariableDefinitionImpl.java +++ b/src/main/gen/io/vlang/lang/psi/impl/VlangGlobalVariableDefinitionImpl.java @@ -65,8 +65,7 @@ public PsiElement getIdentifier() { } @Override - @Nullable - public VlangTypeEx getTypeInner(@Nullable ResolveState context) { + public @Nullable VlangTypeEx getTypeInner(@Nullable ResolveState context) { return VlangPsiImplUtil.getTypeInner(this, context); } diff --git a/src/main/gen/io/vlang/lang/psi/impl/VlangImplementsClauseImpl.java b/src/main/gen/io/vlang/lang/psi/impl/VlangImplementsClauseImpl.java new file mode 100644 index 00000000..9f802a98 --- /dev/null +++ b/src/main/gen/io/vlang/lang/psi/impl/VlangImplementsClauseImpl.java @@ -0,0 +1,47 @@ +// This is a generated file. Not intended for manual editing. +package io.vlang.lang.psi.impl; + +import java.util.List; +import org.jetbrains.annotations.*; +import com.intellij.lang.ASTNode; +import com.intellij.psi.PsiElement; +import com.intellij.psi.PsiElementVisitor; +import io.vlang.lang.psi.VlangPsiTreeUtil; +import static io.vlang.lang.VlangTypes.*; +import io.vlang.lang.psi.*; + +public class VlangImplementsClauseImpl extends VlangCompositeElementImpl implements VlangImplementsClause { + + public VlangImplementsClauseImpl(@NotNull ASTNode node) { + super(node); + } + + public void accept(@NotNull VlangVisitor visitor) { + visitor.visitImplementsClause(this); + } + + @Override + public void accept(@NotNull PsiElementVisitor visitor) { + if (visitor instanceof VlangVisitor) accept((VlangVisitor)visitor); + else super.accept(visitor); + } + + @Override + @Nullable + public VlangLastComma getLastComma() { + return VlangPsiTreeUtil.getChildOfType(this, VlangLastComma.class); + } + + @Override + @NotNull + public List getTypeReferenceExpressionList() { + return VlangPsiTreeUtil.getChildrenOfTypeAsList(this, VlangTypeReferenceExpression.class); + } + + @Override + @NotNull + public PsiElement getImplements() { + return notNullChild(findChildByType(IMPLEMENTS)); + } + +} diff --git a/src/main/gen/io/vlang/lang/psi/impl/VlangImportAliasImpl.java b/src/main/gen/io/vlang/lang/psi/impl/VlangImportAliasImpl.java index 0d7aeaaf..e0113260 100644 --- a/src/main/gen/io/vlang/lang/psi/impl/VlangImportAliasImpl.java +++ b/src/main/gen/io/vlang/lang/psi/impl/VlangImportAliasImpl.java @@ -45,20 +45,17 @@ public PsiElement getAs() { } @Override - @NotNull - public String getName() { + public @NotNull String getName() { return VlangPsiImplUtil.getName(this); } @Override - @Nullable - public PsiElement getIdentifier() { + public @Nullable PsiElement getIdentifier() { return VlangPsiImplUtil.getIdentifier(this); } @Override - @NotNull - public String getQualifiedName() { + public @NotNull String getQualifiedName() { return VlangPsiImplUtil.getQualifiedName(this); } diff --git a/src/main/gen/io/vlang/lang/psi/impl/VlangImportAliasNameImpl.java b/src/main/gen/io/vlang/lang/psi/impl/VlangImportAliasNameImpl.java index 6780767f..48059994 100644 --- a/src/main/gen/io/vlang/lang/psi/impl/VlangImportAliasNameImpl.java +++ b/src/main/gen/io/vlang/lang/psi/impl/VlangImportAliasNameImpl.java @@ -34,8 +34,7 @@ public PsiElement getIdentifier() { } @Override - @NotNull - public VlangModuleReference getReference() { + public @NotNull VlangModuleReference<@NotNull VlangImportAliasName> getReference() { return VlangPsiImplUtil.getReference(this); } diff --git a/src/main/gen/io/vlang/lang/psi/impl/VlangImportNameImpl.java b/src/main/gen/io/vlang/lang/psi/impl/VlangImportNameImpl.java index c6303abe..58c67384 100644 --- a/src/main/gen/io/vlang/lang/psi/impl/VlangImportNameImpl.java +++ b/src/main/gen/io/vlang/lang/psi/impl/VlangImportNameImpl.java @@ -40,26 +40,22 @@ public PsiElement getIdentifier() { } @Override - @NotNull - public String getQualifier() { + public @NotNull String getQualifier() { return VlangPsiImplUtil.getQualifier(this); } @Override - @NotNull - public PsiElement getNameIdentifier() { + public @NotNull PsiElement getNameIdentifier() { return VlangPsiImplUtil.getNameIdentifier(this); } @Override - @NotNull - public PsiElement setName(@NotNull String newName) { + public @NotNull PsiElement setName(@NotNull String newName) { return VlangPsiImplUtil.setName(this, newName); } @Override - @NotNull - public String getName() { + public @NotNull String getName() { return VlangPsiImplUtil.getName(this); } @@ -69,20 +65,17 @@ public int getTextOffset() { } @Override - @NotNull - public VlangModuleReference getReference() { + public @NotNull VlangModuleReference<@NotNull VlangImportName> getReference() { return VlangPsiImplUtil.getReference(this); } @Override - @NotNull - public List resolve() { + public @NotNull List<@NotNull VlangModule> resolve() { return VlangPsiImplUtil.resolve(this); } @Override - @NotNull - public String getQualifiedName() { + public @NotNull String getQualifiedName() { return VlangPsiImplUtil.getQualifiedName(this); } diff --git a/src/main/gen/io/vlang/lang/psi/impl/VlangImportPathImpl.java b/src/main/gen/io/vlang/lang/psi/impl/VlangImportPathImpl.java index 587d8201..1ae9b8e6 100644 --- a/src/main/gen/io/vlang/lang/psi/impl/VlangImportPathImpl.java +++ b/src/main/gen/io/vlang/lang/psi/impl/VlangImportPathImpl.java @@ -33,20 +33,17 @@ public List getImportNameList() { } @Override - @NotNull - public String getQualifiedName() { + public @NotNull String getQualifiedName() { return VlangPsiImplUtil.getQualifiedName(this); } @Override - @NotNull - public String getLastPart() { + public @NotNull String getLastPart() { return VlangPsiImplUtil.getLastPart(this); } @Override - @NotNull - public PsiElement getLastPartPsi() { + public @NotNull PsiElement getLastPartPsi() { return VlangPsiImplUtil.getLastPartPsi(this); } diff --git a/src/main/gen/io/vlang/lang/psi/impl/VlangImportSpecImpl.java b/src/main/gen/io/vlang/lang/psi/impl/VlangImportSpecImpl.java index f5d68574..472d86c8 100644 --- a/src/main/gen/io/vlang/lang/psi/impl/VlangImportSpecImpl.java +++ b/src/main/gen/io/vlang/lang/psi/impl/VlangImportSpecImpl.java @@ -45,50 +45,42 @@ public VlangSelectiveImportList getSelectiveImportList() { } @Override - @NotNull - public PsiElement getIdentifier() { + public @NotNull PsiElement getIdentifier() { return VlangPsiImplUtil.getIdentifier(this); } @Override - @NotNull - public String getLastPart() { + public @NotNull String getLastPart() { return VlangPsiImplUtil.getLastPart(this); } @Override - @NotNull - public PsiElement getLastPartPsi() { + public @NotNull PsiElement getLastPartPsi() { return VlangPsiImplUtil.getLastPartPsi(this); } @Override - @NotNull - public String getName() { + public @NotNull String getName() { return VlangPsiImplUtil.getName(this); } @Override - @NotNull - public String getImportedName() { + public @NotNull String getImportedName() { return VlangPsiImplUtil.getImportedName(this); } @Override - @Nullable - public String getAliasName() { + public @Nullable String getAliasName() { return VlangPsiImplUtil.getAliasName(this); } @Override - @NotNull - public String getPathName() { + public @NotNull String getPathName() { return VlangPsiImplUtil.getPathName(this); } @Override - @NotNull - public List resolve() { + public @NotNull List<@NotNull VlangModule> resolve() { return VlangPsiImplUtil.resolve(this); } diff --git a/src/main/gen/io/vlang/lang/psi/impl/VlangIndexOrSliceExprImpl.java b/src/main/gen/io/vlang/lang/psi/impl/VlangIndexOrSliceExprImpl.java index 0d9a7ca7..19e1754c 100644 --- a/src/main/gen/io/vlang/lang/psi/impl/VlangIndexOrSliceExprImpl.java +++ b/src/main/gen/io/vlang/lang/psi/impl/VlangIndexOrSliceExprImpl.java @@ -88,26 +88,22 @@ public boolean isSlice() { } @Override - @Nullable - public PsiElement getExpression() { + public @Nullable PsiElement getExpression() { return VlangPsiImplUtil.getExpression(this); } @Override - @Nullable - public Pair getRange() { + public @Nullable Pair<@Nullable PsiElement, @Nullable PsiElement> getRange() { return VlangPsiImplUtil.getRange(this); } @Override - @Nullable - public PsiElement getSliceStart() { + public @Nullable PsiElement getSliceStart() { return VlangPsiImplUtil.getSliceStart(this); } @Override - @Nullable - public PsiElement getSliceEnd() { + public @Nullable PsiElement getSliceEnd() { return VlangPsiImplUtil.getSliceEnd(this); } diff --git a/src/main/gen/io/vlang/lang/psi/impl/VlangInterfaceDeclarationImpl.java b/src/main/gen/io/vlang/lang/psi/impl/VlangInterfaceDeclarationImpl.java index 3b9d27e6..d35e42d6 100644 --- a/src/main/gen/io/vlang/lang/psi/impl/VlangInterfaceDeclarationImpl.java +++ b/src/main/gen/io/vlang/lang/psi/impl/VlangInterfaceDeclarationImpl.java @@ -53,20 +53,17 @@ public VlangSymbolVisibility getSymbolVisibility() { } @Override - @NotNull - public String getName() { + public @NotNull String getName() { return VlangPsiImplUtil.getName(this); } @Override - @Nullable - public PsiElement getIdentifier() { + public @Nullable PsiElement getIdentifier() { return VlangPsiImplUtil.getIdentifier(this); } @Override - @NotNull - public VlangTypeEx getTypeInner(@Nullable ResolveState context) { + public @NotNull VlangTypeEx getTypeInner(@Nullable ResolveState context) { return VlangPsiImplUtil.getTypeInner(this, context); } diff --git a/src/main/gen/io/vlang/lang/psi/impl/VlangInterfaceMethodDefinitionImpl.java b/src/main/gen/io/vlang/lang/psi/impl/VlangInterfaceMethodDefinitionImpl.java index 795ac91c..5dd3e8c0 100644 --- a/src/main/gen/io/vlang/lang/psi/impl/VlangInterfaceMethodDefinitionImpl.java +++ b/src/main/gen/io/vlang/lang/psi/impl/VlangInterfaceMethodDefinitionImpl.java @@ -53,8 +53,7 @@ public PsiElement getIdentifier() { } @Override - @Nullable - public VlangTypeEx getTypeInner(@Nullable ResolveState context) { + public @Nullable VlangTypeEx getTypeInner(@Nullable ResolveState context) { return VlangPsiImplUtil.getTypeInner(this, context); } @@ -69,14 +68,12 @@ public boolean isMutable() { } @Override - @NotNull - public VlangInterfaceDeclaration getOwner() { + public @NotNull VlangInterfaceDeclaration getOwner() { return VlangPsiImplUtil.getOwner(this); } @Override - @NotNull - public String getQualifiedName() { + public @NotNull String getQualifiedName() { return VlangPsiImplUtil.getQualifiedName(this); } diff --git a/src/main/gen/io/vlang/lang/psi/impl/VlangInterfaceTypeImpl.java b/src/main/gen/io/vlang/lang/psi/impl/VlangInterfaceTypeImpl.java index b5f8470e..cb7acd85 100644 --- a/src/main/gen/io/vlang/lang/psi/impl/VlangInterfaceTypeImpl.java +++ b/src/main/gen/io/vlang/lang/psi/impl/VlangInterfaceTypeImpl.java @@ -70,32 +70,27 @@ public PsiElement getInterface() { } @Override - @NotNull - public List getFieldList() { + public @NotNull List<@NotNull VlangFieldDefinition> getFieldList() { return VlangPsiImplUtil.getFieldList(this); } @Override - @NotNull - public List getOwnFieldList() { + public @NotNull List<@NotNull VlangFieldDefinition> getOwnFieldList() { return VlangPsiImplUtil.getOwnFieldList(this); } @Override - @NotNull - public List getMethodList() { + public @NotNull List<@NotNull VlangInterfaceMethodDefinition> getMethodList() { return VlangPsiImplUtil.getMethodList(this); } @Override - @NotNull - public List getEmbeddedInterfaces() { + public @NotNull List<@NotNull VlangInterfaceType> getEmbeddedInterfaces() { return VlangPsiImplUtil.getEmbeddedInterfaces(this); } @Override - @NotNull - public List getEmbeddedInterfacesList() { + public @NotNull List<@NotNull VlangEmbeddedDefinition> getEmbeddedInterfacesList() { return VlangPsiImplUtil.getEmbeddedInterfacesList(this); } diff --git a/src/main/gen/io/vlang/lang/psi/impl/VlangIsRefTypeCallExprImpl.java b/src/main/gen/io/vlang/lang/psi/impl/VlangIsRefTypeCallExprImpl.java index bbb5f6ef..2126c8e1 100644 --- a/src/main/gen/io/vlang/lang/psi/impl/VlangIsRefTypeCallExprImpl.java +++ b/src/main/gen/io/vlang/lang/psi/impl/VlangIsRefTypeCallExprImpl.java @@ -58,8 +58,7 @@ public PsiElement getIsreftype() { } @Override - @NotNull - public VlangBuiltinReference getReference() { + public @NotNull VlangBuiltinReference<@NotNull VlangIsRefTypeCallExpr> getReference() { return VlangPsiImplUtil.getReference(this); } diff --git a/src/main/gen/io/vlang/lang/psi/impl/VlangJsonCallExprImpl.java b/src/main/gen/io/vlang/lang/psi/impl/VlangJsonCallExprImpl.java index 7ae37860..d09165c0 100644 --- a/src/main/gen/io/vlang/lang/psi/impl/VlangJsonCallExprImpl.java +++ b/src/main/gen/io/vlang/lang/psi/impl/VlangJsonCallExprImpl.java @@ -34,8 +34,7 @@ public VlangJsonArgumentList getJsonArgumentList() { } @Override - @NotNull - public List getParameters() { + public @NotNull List<@NotNull VlangExpression> getParameters() { return VlangPsiImplUtil.getParameters(this); } diff --git a/src/main/gen/io/vlang/lang/psi/impl/VlangLabelRefImpl.java b/src/main/gen/io/vlang/lang/psi/impl/VlangLabelRefImpl.java index aee1b282..19502fa2 100644 --- a/src/main/gen/io/vlang/lang/psi/impl/VlangLabelRefImpl.java +++ b/src/main/gen/io/vlang/lang/psi/impl/VlangLabelRefImpl.java @@ -33,14 +33,12 @@ public PsiElement getIdentifier() { } @Override - @NotNull - public VlangLabelReference getReference() { + public @NotNull VlangLabelReference getReference() { return VlangPsiImplUtil.getReference(this); } @Override - @NotNull - public String getName() { + public @NotNull String getName() { return VlangPsiImplUtil.getName(this); } diff --git a/src/main/gen/io/vlang/lang/psi/impl/VlangLastCommaImpl.java b/src/main/gen/io/vlang/lang/psi/impl/VlangLastCommaImpl.java new file mode 100644 index 00000000..c0fe6f46 --- /dev/null +++ b/src/main/gen/io/vlang/lang/psi/impl/VlangLastCommaImpl.java @@ -0,0 +1,40 @@ +// This is a generated file. Not intended for manual editing. +package io.vlang.lang.psi.impl; + +import java.util.List; +import org.jetbrains.annotations.*; +import com.intellij.lang.ASTNode; +import com.intellij.psi.PsiElement; +import com.intellij.psi.PsiElementVisitor; +import io.vlang.lang.psi.VlangPsiTreeUtil; +import static io.vlang.lang.VlangTypes.*; +import io.vlang.lang.psi.*; + +public class VlangLastCommaImpl extends VlangCompositeElementImpl implements VlangLastComma { + + public VlangLastCommaImpl(@NotNull ASTNode node) { + super(node); + } + + public void accept(@NotNull VlangVisitor visitor) { + visitor.visitLastComma(this); + } + + @Override + public void accept(@NotNull PsiElementVisitor visitor) { + if (visitor instanceof VlangVisitor) accept((VlangVisitor)visitor); + else super.accept(visitor); + } + + @Override + @NotNull + public PsiElement getComma() { + return notNullChild(findChildByType(COMMA)); + } + + @Override + public @NotNull String getErrorDescription() { + return VlangPsiImplUtil.getErrorDescription(this); + } + +} diff --git a/src/main/gen/io/vlang/lang/psi/impl/VlangMatchArmImpl.java b/src/main/gen/io/vlang/lang/psi/impl/VlangMatchArmImpl.java index 072baa61..03ae41cc 100644 --- a/src/main/gen/io/vlang/lang/psi/impl/VlangMatchArmImpl.java +++ b/src/main/gen/io/vlang/lang/psi/impl/VlangMatchArmImpl.java @@ -45,8 +45,7 @@ public PsiElement getSemicolonSynthetic() { } @Override - @NotNull - public List getParameterList() { + public @NotNull List<@NotNull VlangCompositeElement> getParameterList() { return VlangPsiImplUtil.getParameterList(this); } diff --git a/src/main/gen/io/vlang/lang/psi/impl/VlangMatchExpressionImpl.java b/src/main/gen/io/vlang/lang/psi/impl/VlangMatchExpressionImpl.java index ee2131a3..c50ae528 100644 --- a/src/main/gen/io/vlang/lang/psi/impl/VlangMatchExpressionImpl.java +++ b/src/main/gen/io/vlang/lang/psi/impl/VlangMatchExpressionImpl.java @@ -58,26 +58,22 @@ public PsiElement getMatch() { } @Override - @NotNull - public List getArms() { + public @NotNull List<@NotNull VlangMatchArm> getArms() { return VlangPsiImplUtil.getArms(this); } @Override - @NotNull - public List getExpressionArms() { + public @NotNull List<@NotNull VlangExpression> getExpressionArms() { return VlangPsiImplUtil.getExpressionArms(this); } @Override - @NotNull - public List getTypeArms() { + public @NotNull List<@NotNull VlangType> getTypeArms() { return VlangPsiImplUtil.getTypeArms(this); } @Override - @Nullable - public VlangMatchElseArmClause getElseArm() { + public @Nullable VlangMatchElseArmClause getElseArm() { return VlangPsiImplUtil.getElseArm(this); } diff --git a/src/main/gen/io/vlang/lang/psi/impl/VlangMembersGroupImpl.java b/src/main/gen/io/vlang/lang/psi/impl/VlangMembersGroupImpl.java index 325ce73a..902aef8b 100644 --- a/src/main/gen/io/vlang/lang/psi/impl/VlangMembersGroupImpl.java +++ b/src/main/gen/io/vlang/lang/psi/impl/VlangMembersGroupImpl.java @@ -63,8 +63,7 @@ public PsiElement getSemicolonSynthetic() { } @Override - @NotNull - public List getMemberModifierList() { + public @NotNull List<@NotNull VlangMemberModifier> getMemberModifierList() { return VlangPsiImplUtil.getMemberModifierList(this); } diff --git a/src/main/gen/io/vlang/lang/psi/impl/VlangMethodDeclarationImpl.java b/src/main/gen/io/vlang/lang/psi/impl/VlangMethodDeclarationImpl.java index 6fef9081..b454f6de 100644 --- a/src/main/gen/io/vlang/lang/psi/impl/VlangMethodDeclarationImpl.java +++ b/src/main/gen/io/vlang/lang/psi/impl/VlangMethodDeclarationImpl.java @@ -95,32 +95,27 @@ public PsiElement getFn() { } @Override - @Nullable - public VlangType getReceiverType() { + public @Nullable VlangType getReceiverType() { return VlangPsiImplUtil.getReceiverType(this); } @Override - @Nullable - public VlangTypeEx getTypeInner(@Nullable ResolveState context) { + public @Nullable VlangTypeEx getTypeInner(@Nullable ResolveState context) { return VlangPsiImplUtil.getTypeInner(this, context); } @Override - @Nullable - public PsiElement getIdentifier() { + public @Nullable PsiElement getIdentifier() { return VlangPsiImplUtil.getIdentifier(this); } @Override - @Nullable - public String getQualifiedName() { + public @Nullable String getQualifiedName() { return VlangPsiImplUtil.getQualifiedName(this); } @Override - @Nullable - public VlangNamedElement getOwner() { + public @Nullable VlangNamedElement getOwner() { return VlangPsiImplUtil.getOwner(this); } diff --git a/src/main/gen/io/vlang/lang/psi/impl/VlangModuleClauseImpl.java b/src/main/gen/io/vlang/lang/psi/impl/VlangModuleClauseImpl.java index 29f5c702..a8c1bf81 100644 --- a/src/main/gen/io/vlang/lang/psi/impl/VlangModuleClauseImpl.java +++ b/src/main/gen/io/vlang/lang/psi/impl/VlangModuleClauseImpl.java @@ -63,8 +63,7 @@ public PsiElement getModule() { } @Override - @NotNull - public String getName() { + public @NotNull String getName() { return VlangPsiImplUtil.getName(this); } diff --git a/src/main/gen/io/vlang/lang/psi/impl/VlangOffsetOfCallExprImpl.java b/src/main/gen/io/vlang/lang/psi/impl/VlangOffsetOfCallExprImpl.java index b9dcc221..a4a9bcae 100644 --- a/src/main/gen/io/vlang/lang/psi/impl/VlangOffsetOfCallExprImpl.java +++ b/src/main/gen/io/vlang/lang/psi/impl/VlangOffsetOfCallExprImpl.java @@ -64,8 +64,7 @@ public PsiElement getOffsetof() { } @Override - @NotNull - public VlangBuiltinReference getReference() { + public @NotNull VlangBuiltinReference<@NotNull VlangOffsetOfCallExpr> getReference() { return VlangPsiImplUtil.getReference(this); } diff --git a/src/main/gen/io/vlang/lang/psi/impl/VlangParamDefinitionImpl.java b/src/main/gen/io/vlang/lang/psi/impl/VlangParamDefinitionImpl.java index 4d82b740..20a9b6c0 100644 --- a/src/main/gen/io/vlang/lang/psi/impl/VlangParamDefinitionImpl.java +++ b/src/main/gen/io/vlang/lang/psi/impl/VlangParamDefinitionImpl.java @@ -62,8 +62,7 @@ public boolean isVariadic() { } @Override - @Nullable - public String getName() { + public @Nullable String getName() { return VlangPsiImplUtil.getName(this); } diff --git a/src/main/gen/io/vlang/lang/psi/impl/VlangRangeClauseImpl.java b/src/main/gen/io/vlang/lang/psi/impl/VlangRangeClauseImpl.java index 34f837af..c426164b 100644 --- a/src/main/gen/io/vlang/lang/psi/impl/VlangRangeClauseImpl.java +++ b/src/main/gen/io/vlang/lang/psi/impl/VlangRangeClauseImpl.java @@ -40,8 +40,7 @@ public PsiElement getIn() { } @Override - @NotNull - public List getVariablesList() { + public @NotNull List<@NotNull VlangVarDefinition> getVariablesList() { return VlangPsiImplUtil.getVariablesList(this); } diff --git a/src/main/gen/io/vlang/lang/psi/impl/VlangReceiverImpl.java b/src/main/gen/io/vlang/lang/psi/impl/VlangReceiverImpl.java index 13f0899e..7b072ed2 100644 --- a/src/main/gen/io/vlang/lang/psi/impl/VlangReceiverImpl.java +++ b/src/main/gen/io/vlang/lang/psi/impl/VlangReceiverImpl.java @@ -59,14 +59,12 @@ public PsiElement getIdentifier() { } @Override - @NotNull - public VlangTypeEx getTypeInner(@Nullable ResolveState context) { + public @NotNull VlangTypeEx getTypeInner(@Nullable ResolveState context) { return VlangPsiImplUtil.getTypeInner(this, context); } @Override - @Nullable - public String getName() { + public @Nullable String getName() { return VlangPsiImplUtil.getName(this); } diff --git a/src/main/gen/io/vlang/lang/psi/impl/VlangReferenceExpressionImpl.java b/src/main/gen/io/vlang/lang/psi/impl/VlangReferenceExpressionImpl.java index 3121fe6b..698f2855 100644 --- a/src/main/gen/io/vlang/lang/psi/impl/VlangReferenceExpressionImpl.java +++ b/src/main/gen/io/vlang/lang/psi/impl/VlangReferenceExpressionImpl.java @@ -35,26 +35,22 @@ public PsiElement getIdentifier() { } @Override - @NotNull - public VlangReference getReference() { + public @NotNull VlangReference getReference() { return VlangPsiImplUtil.getReference(this); } @Override - @Nullable - public VlangCompositeElement getQualifier() { + public @Nullable VlangCompositeElement getQualifier() { return VlangPsiImplUtil.getQualifier(this); } @Override - @Nullable - public PsiElement resolve() { + public @Nullable PsiElement resolve() { return VlangPsiImplUtil.resolve(this); } @Override - @NotNull - public Access getReadWriteAccess() { + public @NotNull Access getReadWriteAccess() { return VlangPsiImplUtil.getReadWriteAccess(this); } diff --git a/src/main/gen/io/vlang/lang/psi/impl/VlangReturnStatementImpl.java b/src/main/gen/io/vlang/lang/psi/impl/VlangReturnStatementImpl.java index 64fad1bc..1bc426b1 100644 --- a/src/main/gen/io/vlang/lang/psi/impl/VlangReturnStatementImpl.java +++ b/src/main/gen/io/vlang/lang/psi/impl/VlangReturnStatementImpl.java @@ -40,8 +40,7 @@ public PsiElement getReturn() { } @Override - @Nullable - public VlangSignatureOwner getOwner() { + public @Nullable VlangSignatureOwner getOwner() { return VlangPsiImplUtil.getOwner(this); } diff --git a/src/main/gen/io/vlang/lang/psi/impl/VlangSignatureImpl.java b/src/main/gen/io/vlang/lang/psi/impl/VlangSignatureImpl.java index db5c2d67..73f914fe 100644 --- a/src/main/gen/io/vlang/lang/psi/impl/VlangSignatureImpl.java +++ b/src/main/gen/io/vlang/lang/psi/impl/VlangSignatureImpl.java @@ -46,8 +46,7 @@ public VlangResult getResult() { } @Override - @NotNull - public Pair resultCount() { + public @NotNull Pair<@NotNull Integer, @NotNull Integer> resultCount() { return VlangPsiImplUtil.resultCount(this); } diff --git a/src/main/gen/io/vlang/lang/psi/impl/VlangSizeOfCallExprImpl.java b/src/main/gen/io/vlang/lang/psi/impl/VlangSizeOfCallExprImpl.java index c85ef6d6..1e09d1f4 100644 --- a/src/main/gen/io/vlang/lang/psi/impl/VlangSizeOfCallExprImpl.java +++ b/src/main/gen/io/vlang/lang/psi/impl/VlangSizeOfCallExprImpl.java @@ -58,8 +58,7 @@ public PsiElement getSizeof() { } @Override - @NotNull - public VlangBuiltinReference getReference() { + public @NotNull VlangBuiltinReference<@NotNull VlangSizeOfCallExpr> getReference() { return VlangPsiImplUtil.getReference(this); } diff --git a/src/main/gen/io/vlang/lang/psi/impl/VlangSqlExpressionImpl.java b/src/main/gen/io/vlang/lang/psi/impl/VlangSqlExpressionImpl.java index 9350f70b..de34fd04 100644 --- a/src/main/gen/io/vlang/lang/psi/impl/VlangSqlExpressionImpl.java +++ b/src/main/gen/io/vlang/lang/psi/impl/VlangSqlExpressionImpl.java @@ -42,8 +42,7 @@ public VlangSqlBlock getSqlBlock() { } @Override - @Nullable - public VlangTypeEx getType(@Nullable ResolveState context) { + public @Nullable VlangTypeEx getType(@Nullable ResolveState context) { return VlangPsiImplUtil.getType(this, context); } diff --git a/src/main/gen/io/vlang/lang/psi/impl/VlangStaticMethodDeclarationImpl.java b/src/main/gen/io/vlang/lang/psi/impl/VlangStaticMethodDeclarationImpl.java index 7f2bc2c7..d65a3f26 100644 --- a/src/main/gen/io/vlang/lang/psi/impl/VlangStaticMethodDeclarationImpl.java +++ b/src/main/gen/io/vlang/lang/psi/impl/VlangStaticMethodDeclarationImpl.java @@ -89,14 +89,12 @@ public PsiElement getIdentifier() { } @Override - @Nullable - public VlangTypeEx getTypeInner(@Nullable ResolveState context) { + public @Nullable VlangTypeEx getTypeInner(@Nullable ResolveState context) { return VlangPsiImplUtil.getTypeInner(this, context); } @Override - @Nullable - public String getQualifiedName() { + public @NotNull String getQualifiedName() { return VlangPsiImplUtil.getQualifiedName(this); } diff --git a/src/main/gen/io/vlang/lang/psi/impl/VlangStringLiteralImpl.java b/src/main/gen/io/vlang/lang/psi/impl/VlangStringLiteralImpl.java index 273636cd..28ecb6e4 100644 --- a/src/main/gen/io/vlang/lang/psi/impl/VlangStringLiteralImpl.java +++ b/src/main/gen/io/vlang/lang/psi/impl/VlangStringLiteralImpl.java @@ -46,26 +46,22 @@ public boolean isValidHost() { } @Override - @NotNull - public VlangStringLiteral updateText(@NotNull String text) { + public @NotNull VlangStringLiteral updateText(@NotNull String text) { return VlangPsiImplUtil.updateText(this, text); } @Override - @NotNull - public StringLiteralEscaper createLiteralTextEscaper() { + public @NotNull StringLiteralEscaper<@NotNull VlangStringLiteral> createLiteralTextEscaper() { return VlangPsiImplUtil.createLiteralTextEscaper(this); } @Override - @NotNull - public PsiReference[] getReferences() { + public @NotNull PsiReference @NotNull [] getReferences() { return VlangPsiImplUtil.getReferences(this); } @Override - @NotNull - public String getContents() { + public @NotNull String getContents() { return VlangPsiImplUtil.getContents(this); } diff --git a/src/main/gen/io/vlang/lang/psi/impl/VlangStructDeclarationImpl.java b/src/main/gen/io/vlang/lang/psi/impl/VlangStructDeclarationImpl.java index a8152244..450c3097 100644 --- a/src/main/gen/io/vlang/lang/psi/impl/VlangStructDeclarationImpl.java +++ b/src/main/gen/io/vlang/lang/psi/impl/VlangStructDeclarationImpl.java @@ -53,20 +53,17 @@ public VlangSymbolVisibility getSymbolVisibility() { } @Override - @Nullable - public PsiElement getIdentifier() { + public @Nullable PsiElement getIdentifier() { return VlangPsiImplUtil.getIdentifier(this); } @Override - @NotNull - public String getName() { + public @NotNull String getName() { return VlangPsiImplUtil.getName(this); } @Override - @NotNull - public VlangTypeEx getTypeInner(@Nullable ResolveState context) { + public @NotNull VlangTypeEx getTypeInner(@Nullable ResolveState context) { return VlangPsiImplUtil.getTypeInner(this, context); } @@ -76,8 +73,7 @@ public boolean isUnion() { } @Override - @NotNull - public String getKindName() { + public @NotNull String getKindName() { return VlangPsiImplUtil.getKindName(this); } @@ -87,8 +83,7 @@ public boolean isAttribute() { } @Override - @Nullable - public PsiElement addField(@NotNull String name, @NotNull String type, boolean mutable) { + public @Nullable PsiElement addField(@NotNull String name, @NotNull String type, boolean mutable) { return VlangPsiImplUtil.addField(this, name, type, mutable); } diff --git a/src/main/gen/io/vlang/lang/psi/impl/VlangStructTypeImpl.java b/src/main/gen/io/vlang/lang/psi/impl/VlangStructTypeImpl.java index ce497e81..4cd8e007 100644 --- a/src/main/gen/io/vlang/lang/psi/impl/VlangStructTypeImpl.java +++ b/src/main/gen/io/vlang/lang/psi/impl/VlangStructTypeImpl.java @@ -45,6 +45,12 @@ public VlangGenericParameters getGenericParameters() { return VlangPsiTreeUtil.getStubChildOfType(this, VlangGenericParameters.class); } + @Override + @Nullable + public VlangImplementsClause getImplementsClause() { + return VlangPsiTreeUtil.getChildOfType(this, VlangImplementsClause.class); + } + @Override @Nullable public PsiElement getLbrace() { @@ -76,26 +82,22 @@ public PsiElement getUnion() { } @Override - @NotNull - public List getFieldList() { + public @NotNull List<@NotNull VlangFieldDefinition> getFieldList() { return VlangPsiImplUtil.getFieldList(this); } @Override - @NotNull - public List getOwnFieldList() { + public @NotNull List<@NotNull VlangFieldDefinition> getOwnFieldList() { return VlangPsiImplUtil.getOwnFieldList(this); } @Override - @NotNull - public List getEmbeddedStructs() { + public @NotNull List<@NotNull VlangStructType> getEmbeddedStructs() { return VlangPsiImplUtil.getEmbeddedStructs(this); } @Override - @NotNull - public List getEmbeddedStructList() { + public @NotNull List<@NotNull VlangEmbeddedDefinition> getEmbeddedStructList() { return VlangPsiImplUtil.getEmbeddedStructList(this); } diff --git a/src/main/gen/io/vlang/lang/psi/impl/VlangTypeAliasDeclarationImpl.java b/src/main/gen/io/vlang/lang/psi/impl/VlangTypeAliasDeclarationImpl.java index 23cd2479..80cb4a27 100644 --- a/src/main/gen/io/vlang/lang/psi/impl/VlangTypeAliasDeclarationImpl.java +++ b/src/main/gen/io/vlang/lang/psi/impl/VlangTypeAliasDeclarationImpl.java @@ -59,20 +59,17 @@ public PsiElement getType_() { } @Override - @Nullable - public PsiElement getIdentifier() { + public @Nullable PsiElement getIdentifier() { return VlangPsiImplUtil.getIdentifier(this); } @Override - @NotNull - public String getName() { + public @NotNull String getName() { return VlangPsiImplUtil.getName(this); } @Override - @NotNull - public VlangTypeEx getTypeInner(@Nullable ResolveState context) { + public @NotNull VlangTypeEx getTypeInner(@Nullable ResolveState context) { return VlangPsiImplUtil.getTypeInner(this, context); } diff --git a/src/main/gen/io/vlang/lang/psi/impl/VlangTypeImpl.java b/src/main/gen/io/vlang/lang/psi/impl/VlangTypeImpl.java index c1ec5785..488fcf7b 100644 --- a/src/main/gen/io/vlang/lang/psi/impl/VlangTypeImpl.java +++ b/src/main/gen/io/vlang/lang/psi/impl/VlangTypeImpl.java @@ -57,20 +57,17 @@ public VlangTypeReferenceExpression getTypeReferenceExpression() { } @Override - @Nullable - public PsiElement getIdentifier() { + public @Nullable PsiElement getIdentifier() { return VlangPsiImplUtil.getIdentifier(this); } @Override - @Nullable - public VlangType getUnderlyingType() { + public @Nullable VlangType getUnderlyingType() { return VlangPsiImplUtil.getUnderlyingType(this); } @Override - @NotNull - public VlangType resolveType() { + public @NotNull VlangType resolveType() { return VlangPsiImplUtil.resolveType(this); } diff --git a/src/main/gen/io/vlang/lang/psi/impl/VlangTypeOfCallExprImpl.java b/src/main/gen/io/vlang/lang/psi/impl/VlangTypeOfCallExprImpl.java index 62346379..b2756769 100644 --- a/src/main/gen/io/vlang/lang/psi/impl/VlangTypeOfCallExprImpl.java +++ b/src/main/gen/io/vlang/lang/psi/impl/VlangTypeOfCallExprImpl.java @@ -58,8 +58,7 @@ public PsiElement getTypeof() { } @Override - @NotNull - public VlangBuiltinReference getReference() { + public @NotNull VlangBuiltinReference<@NotNull VlangTypeOfCallExpr> getReference() { return VlangPsiImplUtil.getReference(this); } diff --git a/src/main/gen/io/vlang/lang/psi/impl/VlangTypeReferenceExpressionImpl.java b/src/main/gen/io/vlang/lang/psi/impl/VlangTypeReferenceExpressionImpl.java index 41236cd6..05ef9374 100644 --- a/src/main/gen/io/vlang/lang/psi/impl/VlangTypeReferenceExpressionImpl.java +++ b/src/main/gen/io/vlang/lang/psi/impl/VlangTypeReferenceExpressionImpl.java @@ -39,20 +39,17 @@ public PsiElement getIdentifier() { } @Override - @NotNull - public VlangReference getReference() { + public @NotNull VlangReference getReference() { return VlangPsiImplUtil.getReference(this); } @Override - @Nullable - public VlangCompositeElement getQualifier() { + public @Nullable VlangCompositeElement getQualifier() { return VlangPsiImplUtil.getQualifier(this); } @Override - @Nullable - public PsiElement resolve() { + public @Nullable PsiElement resolve() { return VlangPsiImplUtil.resolve(this); } diff --git a/src/main/gen/io/vlang/lang/psi/impl/VlangVarDefinitionImpl.java b/src/main/gen/io/vlang/lang/psi/impl/VlangVarDefinitionImpl.java index 7fe56047..f37cef17 100644 --- a/src/main/gen/io/vlang/lang/psi/impl/VlangVarDefinitionImpl.java +++ b/src/main/gen/io/vlang/lang/psi/impl/VlangVarDefinitionImpl.java @@ -48,20 +48,17 @@ public PsiElement getIdentifier() { } @Override - @Nullable - public VlangTypeEx getTypeInner(@Nullable ResolveState context) { + public @Nullable VlangTypeEx getTypeInner(@Nullable ResolveState context) { return VlangPsiImplUtil.getTypeInner(this, context); } @Override - @NotNull - public String getName() { + public @NotNull String getName() { return VlangPsiImplUtil.getName(this); } @Override - @NotNull - public PsiReference getReference() { + public @NotNull PsiReference getReference() { return VlangPsiImplUtil.getReference(this); } @@ -86,14 +83,12 @@ public void makeImmutable() { } @Override - @Nullable - public VlangExpression getInitializer() { + public @Nullable VlangExpression getInitializer() { return VlangPsiImplUtil.getInitializer(this); } @Override - @Nullable - public VlangSymbolVisibility getSymbolVisibility() { + public @Nullable VlangSymbolVisibility getSymbolVisibility() { return VlangPsiImplUtil.getSymbolVisibility(this); } diff --git a/src/main/kotlin/io/vlang/ide/inspections/general/VlangInterfaceNotImplementedInspection.kt b/src/main/kotlin/io/vlang/ide/inspections/general/VlangInterfaceNotImplementedInspection.kt new file mode 100644 index 00000000..576c7468 --- /dev/null +++ b/src/main/kotlin/io/vlang/ide/inspections/general/VlangInterfaceNotImplementedInspection.kt @@ -0,0 +1,96 @@ +package io.vlang.ide.inspections.general + +import com.intellij.codeInspection.LocalQuickFixAndIntentionActionOnPsiElement +import com.intellij.codeInspection.ProblemsHolder +import com.intellij.codeInspection.util.IntentionFamilyName +import com.intellij.codeInspection.util.IntentionName +import com.intellij.openapi.editor.Editor +import com.intellij.openapi.project.Project +import com.intellij.openapi.util.Iconable +import com.intellij.psi.PsiElement +import com.intellij.psi.PsiElementVisitor +import com.intellij.psi.PsiFile +import com.intellij.psi.SmartPointerManager +import io.vlang.ide.inspections.VlangBaseInspection +import io.vlang.ide.intentions.VlangImplementInterfaceIntention +import io.vlang.lang.psi.* +import io.vlang.lang.psi.types.VlangBaseTypeEx.Companion.toEx +import io.vlang.lang.psi.types.VlangFunctionTypeEx +import javax.swing.Icon + +class VlangInterfaceNotImplementedInspection : VlangBaseInspection() { + override fun buildVisitor(holder: ProblemsHolder, isOnTheFly: Boolean): PsiElementVisitor { + return object : VlangVisitor() { + override fun visitStructType(o: VlangStructType) { + val implementsClause = o.implementsClause + if (implementsClause != null) { + val interfaces = + implementsClause.typeReferenceExpressionList.map { it to (it.resolve() as? VlangInterfaceDeclaration)?.interfaceType } + interfaces.forEach { (ref, iface) -> + if (iface != null + && (!iface.fieldList.all { isAlreadyImplementedField(o, it) } + || !iface.methodList.all { isAlreadyImplementedMethod(o, it) }) + ) { + + val smartRef = SmartPointerManager.createPointer(ref) + holder.registerProblem( + ref, + "Explicit interface #ref not implemented", +// LocalQuickFix.from(VlangImplementInterfaceIntention().asModCommandAction())!! + +// LocalQuickFixBackedByIntentionAction(VlangImplementInterfaceIntention()) + + object : LocalQuickFixAndIntentionActionOnPsiElement(ref), Iconable { + val action = VlangImplementInterfaceIntention() + override fun invoke( + project: Project, + file: PsiFile, + editor: Editor?, + startElement: PsiElement, + endElement: PsiElement, + ) { + action(project, editor, file) + } + + override fun getText(): @IntentionName String = "Implement explicit interface `${startElement.text}`" + + override fun getFamilyName(): @IntentionFamilyName String = action.familyName + + override fun getIcon(flags: Int): Icon? = action.getIcon(flags) + } + ) + } + } + } + super.visitStructType(o) + } + } + } + + private fun isAlreadyImplementedMethod(struct: VlangStructType, method: VlangInterfaceMethodDefinition): Boolean { + val structMethods = struct.toEx().methodsList(struct.project) + return structMethods + .filter { it.name == method.name } + // if interface method immutable, don't care about struct method mutability + .filter { !method.isMutable || it.receiver.isMutable() == method.isMutable } + .any { structMethod -> + val interfaceTypeEx = VlangFunctionTypeEx.from(method) ?: return@any false + val structTypeEx = VlangFunctionTypeEx.from(structMethod) ?: return@any false + + interfaceTypeEx.isEqual(structTypeEx) + } + } + + private fun isAlreadyImplementedField(struct: VlangStructType, field: VlangFieldDefinition): Boolean { + val structFields = struct.fieldList + return structFields + .filter { it.name == field.name } + // if interface field immutable, don't care about struct field mutability + .filter { !field.isMutable() || it.isMutable() == field.isMutable() } + .any { structField -> + val structFieldType = structField.getType(null) ?: return@any false + val interfaceFieldType = field.getType(null) ?: return@any false + structFieldType.isEqual(interfaceFieldType) + } + } +} diff --git a/src/main/kotlin/io/vlang/ide/refactoring/VlangImplementMethodsHandler.kt b/src/main/kotlin/io/vlang/ide/refactoring/VlangImplementMethodsHandler.kt index ce946d58..10b850db 100644 --- a/src/main/kotlin/io/vlang/ide/refactoring/VlangImplementMethodsHandler.kt +++ b/src/main/kotlin/io/vlang/ide/refactoring/VlangImplementMethodsHandler.kt @@ -54,11 +54,24 @@ class VlangImplementMethodsHandler : LanguageCodeInsightActionHandler { } } + if (element.parentOfType(true) != null && element.parentOfType() != null) { + val typeRef = element.parentOfType(true)!! + val interfaceDeclaration = typeRef.resolve() as? VlangInterfaceDeclaration + if (interfaceDeclaration != null) { + startImplementing(project, file, editor, struct, interfaceDeclaration) + return + } + } + val oldPopup = project.getUserData(ChooseByNamePopup.CHOOSE_BY_NAME_POPUP_IN_PROJECT_KEY) oldPopup?.close(false) val model = - VlangTypeContributorsBasedGotoByModel(project, MyGotoClassLikeContributor(file, struct), "Choose interface to implement") + VlangTypeContributorsBasedGotoByModel( + project, + MyGotoClassLikeContributor(file, struct), + "Choose interface to implement" + ) val provider = DefaultChooseByNameItemProvider(file) val popup = MyChooseByNamePopup(project, model, provider, oldPopup) @@ -155,12 +168,9 @@ class VlangImplementMethodsHandler : LanguageCodeInsightActionHandler { if (templateText.isNotEmpty()) { val receiverNames = generateReceiverNames(struct) - template.addVariable( - "RECEIVER", ConstantNode(receiverNames.first()) - .withLookupItems( - receiverNames.map { LookupElementBuilder.create(it) } - ), true - ) + val value = ConstantNode(receiverNames.first()) + .withLookupItems(receiverNames.map { LookupElementBuilder.create(it) }) + template.addVariable("RECEIVER", value, true) } editor.caretModel.moveToOffset(struct.endOffset) @@ -197,7 +207,10 @@ class VlangImplementMethodsHandler : LanguageCodeInsightActionHandler { return type.readableName(context) } - private fun isAlreadyImplementedMethod(struct: VlangStructDeclaration, method: VlangInterfaceMethodDefinition): Boolean { + private fun isAlreadyImplementedMethod( + struct: VlangStructDeclaration, + method: VlangInterfaceMethodDefinition, + ): Boolean { val structMethods = struct.structType.toEx().methodsList(struct.project) return structMethods .filter { it.name == method.name } @@ -226,7 +239,7 @@ class VlangImplementMethodsHandler : LanguageCodeInsightActionHandler { private fun generateReceiverNames(struct: VlangStructDeclaration): List { val firstLetter = struct.name.first().lowercaseChar().toString() - val other = listOf(firstLetter, "this") + val other = listOf(firstLetter, "_", "this") val structMethods = struct.structType.toEx().methodsList(struct.project) val first = VlangLangUtil.getUsedReceiverNameOrDefault(structMethods, null) diff --git a/src/main/kotlin/io/vlang/lang/VlangParserUtil.kt b/src/main/kotlin/io/vlang/lang/VlangParserUtil.kt index 8c61c7d3..3aeb1766 100644 --- a/src/main/kotlin/io/vlang/lang/VlangParserUtil.kt +++ b/src/main/kotlin/io/vlang/lang/VlangParserUtil.kt @@ -272,6 +272,18 @@ object VlangParserUtil : GeneratedParserUtilBase() { return true } + @JvmStatic + fun remapToIdentifier(builder: PsiBuilder, @Suppress("UNUSED_PARAMETER") level: Int): Boolean { + if (builder.tokenType == IDENTIFIER) { + return true + } + if (builder.tokenType in VlangTokenTypes.KEYWORDS.types || builder.tokenType in VlangTokenTypes.BOOL_LITERALS.types) { + builder.remapCurrentToken(IDENTIFIER) + return true + } + return false + } + @JvmStatic fun callExpr(builder: PsiBuilder, level: Int): Boolean { val m = builder.latestDoneMarker diff --git a/src/main/kotlin/io/vlang/lang/completion/VlangCompletionPatterns.kt b/src/main/kotlin/io/vlang/lang/completion/VlangCompletionPatterns.kt index 3fff80ba..60d69fd6 100644 --- a/src/main/kotlin/io/vlang/lang/completion/VlangCompletionPatterns.kt +++ b/src/main/kotlin/io/vlang/lang/completion/VlangCompletionPatterns.kt @@ -66,8 +66,20 @@ object VlangCompletionPatterns { fun onType(): PsiElementPattern.Capture = psiElement() .withParent(VlangTypeReferenceExpression::class.java) + .andNot(onImplementsClause()) .notAfterLiteral() + /** + * On implements clause + * + * struct A implements + */ + fun onImplementsClause(): PsiElementPattern.Capture = + psiElement() + .withSuperParent(3, VlangStructType::class.java) + .withSuperParent(2, VlangImplementsClause::class.java) + .withParent(VlangTypeReferenceExpression::class.java) + /** * Element after if/else expression like: * @@ -161,6 +173,7 @@ object VlangCompletionPatterns { fun referenceExpression(): PsiElementPattern.Capture { return psiElement() .withParent(VlangReferenceExpressionBase::class.java) + .andNot(onImplementsClause()) .notAfterLiteral() .noTopLevelNext() } @@ -168,6 +181,7 @@ object VlangCompletionPatterns { fun cachedReferenceExpression(): PsiElementPattern.Capture { return psiElement() .withParent(psiElement().withReference(VlangCachedReference::class.java)) + .andNot(onImplementsClause()) .notAfterLiteral() .noTopLevelNext() } diff --git a/src/main/kotlin/io/vlang/lang/completion/contributors/VlangCompletionContributor.kt b/src/main/kotlin/io/vlang/lang/completion/contributors/VlangCompletionContributor.kt index 23d8ac7e..b8da1bfa 100644 --- a/src/main/kotlin/io/vlang/lang/completion/contributors/VlangCompletionContributor.kt +++ b/src/main/kotlin/io/vlang/lang/completion/contributors/VlangCompletionContributor.kt @@ -8,6 +8,7 @@ import io.vlang.lang.completion.VlangCompletionPatterns.cachedReferenceExpressio import io.vlang.lang.completion.VlangCompletionPatterns.insideStatementWithLabel import io.vlang.lang.completion.VlangCompletionPatterns.insideStruct import io.vlang.lang.completion.VlangCompletionPatterns.onExpression +import io.vlang.lang.completion.VlangCompletionPatterns.onImplementsClause import io.vlang.lang.completion.VlangCompletionPatterns.onModuleImportName import io.vlang.lang.completion.VlangCompletionPatterns.onStatement import io.vlang.lang.completion.VlangCompletionPatterns.onTopLevel @@ -29,6 +30,7 @@ class VlangCompletionContributor : CompletionContributor() { extend(CompletionType.BASIC, onType(), MapTypeCompletionProvider) extend(CompletionType.BASIC, onType(), ChanTypeCompletionProvider) extend(CompletionType.BASIC, insideStruct(), StructFieldGroupModifierCompletionProvider) + extend(CompletionType.BASIC, onImplementsClause(), InterfaceCompletionProvider) extend(CompletionType.BASIC, insideStatementWithLabel(), LabelCompletionProvider) extend(CompletionType.BASIC, referenceExpression(), ReferenceCompletionProvider) diff --git a/src/main/kotlin/io/vlang/lang/completion/providers/InterfaceCompletionProvider.kt b/src/main/kotlin/io/vlang/lang/completion/providers/InterfaceCompletionProvider.kt new file mode 100644 index 00000000..a8591ba9 --- /dev/null +++ b/src/main/kotlin/io/vlang/lang/completion/providers/InterfaceCompletionProvider.kt @@ -0,0 +1,101 @@ +package io.vlang.lang.completion.providers + +import com.intellij.codeInsight.completion.CompletionParameters +import com.intellij.codeInsight.completion.CompletionProvider +import com.intellij.codeInsight.completion.CompletionResultSet +import com.intellij.psi.util.parentOfType +import com.intellij.util.ProcessingContext +import com.intellij.util.Processors +import io.vlang.lang.completion.VlangCompletionUtil +import io.vlang.lang.completion.providers.ReferenceCompletionProvider.MyScopeProcessor +import io.vlang.lang.psi.VlangFile +import io.vlang.lang.psi.VlangInterfaceDeclaration +import io.vlang.lang.psi.VlangNamedElement +import io.vlang.lang.psi.VlangReferenceExpressionBase +import io.vlang.lang.psi.VlangStructDeclaration +import io.vlang.lang.psi.impl.VlangCachedReference +import io.vlang.lang.psi.impl.VlangReference +import io.vlang.lang.search.VlangGotoUtil +import io.vlang.lang.search.VlangSuperSearch + +object InterfaceCompletionProvider : CompletionProvider() { + +// override fun addCompletions( +// parameters: CompletionParameters, +// context: ProcessingContext, +// result: CompletionResultSet, +// ) { +// val pos = parameters.position +// val project = pos.project +// val file = pos.containingFile as VlangFile +// val struct = pos.parentOfType() ?: return +// +// val set = VlangCompletionUtil.withCamelHumpPrefixMatcher(result) +// +// val alreadyImplementedTypes = getAlreadyImplementedTypes(struct) +// val processor = Processor { element -> +// ProgressManager.checkCanceled() +// if (element !is VlangInterfaceDeclaration) return@Processor false +// if (alreadyImplementedTypes.contains(element)) return@Processor false +// val fromFile = element.containingFile as? VlangFile ?: return@Processor false +// val isDirectlyAccessible = VlangCodeInsightUtil.isDirectlyAccessible(fromFile, file) +// if (element.isPublic() || isDirectlyAccessible) { +// val icon = AllIcons.Nodes.Interface +// val name = element.name +// if (name.isEmpty()) { +// return@Processor false +// } +// +// val moduleName = fromFile.getModuleName() +// +// val qualifiedName = when { +// isDirectlyAccessible -> name +// moduleName != null -> "${moduleName.substringAfterLast('.')}.$name" +// else -> name +// } +// +// val lookupElement = PrioritizedLookupElement.withPriority( +// LookupElementBuilder.createWithSmartPointer(qualifiedName, element) +// .withRenderer(ClassLikeRenderer(icon, moduleName)) +// .withInsertHandler(ClassLikeInsertHandler(moduleName)), priority.toDouble() +// ) +// +// set.addElement(lookupElement) +// } +// true +// } +// +// StubIndex.getInstance().processElements( +// VlangClassLikeIndex.KEY, "interface", project, GlobalSearchScope.allScope(project), null, +// VlangNamedElement::class.java, processor +// ) +// +// } + + override fun addCompletions( + parameters: CompletionParameters, + context: ProcessingContext, + result: CompletionResultSet, + ) { + val element = parameters.position + val set = VlangCompletionUtil.withCamelHumpPrefixMatcher(result) + + val file = element.containingFile as? VlangFile ?: return + val referenceExpression = element.parentOfType() ?: return + val ref = referenceExpression.reference + if (ref is VlangReference) { + ref.processResolveVariants(MyScopeProcessor(parameters, set, file, ReferenceCompletionProvider.interfacesOnlyAccept)) + } else if (ref is VlangCachedReference<*>) { + ref.processResolveVariants(MyScopeProcessor(parameters, set, file, ReferenceCompletionProvider.interfacesOnlyAccept)) + } + } + + private fun getAlreadyImplementedTypes(struct: VlangStructDeclaration): Set { + val set = mutableSetOf() + VlangSuperSearch.execute( + VlangGotoUtil.param(struct), + Processors.cancelableCollectProcessor(set as Collection) + ) + return set + } +} diff --git a/src/main/kotlin/io/vlang/lang/completion/providers/ReferenceCompletionProvider.kt b/src/main/kotlin/io/vlang/lang/completion/providers/ReferenceCompletionProvider.kt index b5686c0e..04468e67 100644 --- a/src/main/kotlin/io/vlang/lang/completion/providers/ReferenceCompletionProvider.kt +++ b/src/main/kotlin/io/vlang/lang/completion/providers/ReferenceCompletionProvider.kt @@ -1,6 +1,7 @@ package io.vlang.lang.completion.providers import com.intellij.codeInsight.completion.* +import com.intellij.codeInsight.completion.XmlCompletionContributor.createLookupElement import com.intellij.codeInsight.lookup.LookupElement import com.intellij.codeInsight.lookup.LookupElementBuilder import com.intellij.codeInsight.template.TemplateManager @@ -52,10 +53,11 @@ object ReferenceCompletionProvider : CompletionProvider() fillStructFieldNameVariants(parameters, set, variants, refExpression) if (variants != VlangStructLiteralCompletion.Variants.FIELD_NAME_ONLY) { - ref.processResolveVariants(MyScopeProcessor(parameters, set, file, ref.forTypes)) + val acceptPredicate = if (ref.forTypes) forTypesAccept else genericAccept + ref.processResolveVariants(MyScopeProcessor(parameters, set, file, acceptPredicate)) } } else if (ref is VlangCachedReference<*>) { - ref.processResolveVariants(MyScopeProcessor(parameters, set, file, false)) + ref.processResolveVariants(MyScopeProcessor(parameters, set, file, genericAccept)) } } @@ -90,7 +92,8 @@ object ReferenceCompletionProvider : CompletionProvider() val alreadyAssignedFields = VlangStructLiteralCompletion.alreadyAssignedFields(elementList) - VlangFieldNameReference(refExpression).processResolveVariants(object : MyScopeProcessor(parameters, result, file, false) { + VlangFieldNameReference(refExpression).processResolveVariants(object : + MyScopeProcessor(parameters, result, file, genericAccept) { override fun execute(element: PsiElement, state: ResolveState): Boolean { val structFieldName = when (element) { @@ -173,28 +176,117 @@ object ReferenceCompletionProvider : CompletionProvider() template.isToReformat = true fields.forEach { - template.addVariable("field_${it.first.replace("@", "at_")}", ConstantNode(VlangLangUtil.getDefaultValue(element, it.second)), true) + template.addVariable( + "field_${it.first.replace("@", "at_")}", + ConstantNode(VlangLangUtil.getDefaultValue(element, it.second)), + true + ) } TemplateManager.getInstance(project).startTemplate(context.editor, template) } } + fun interface AcceptPredicate { + fun accept(e: PsiElement, state: ResolveState, file: VlangFile): Boolean + } + + val forTypesAccept = AcceptPredicate { e: PsiElement, state: ResolveState, file: VlangFile -> + if (e !is VlangNamedElement) { + return@AcceptPredicate false + } + + if (!e.isPublic() && !state.get(LOCAL_RESOLVE) && !state.get(PROCESS_PRIVATE_MEMBERS)) { + return@AcceptPredicate false + } + + if (e.isBlank()) { + return@AcceptPredicate false + } + + // forbid raw map completion + if (e is VlangStructDeclaration && e.name == "map") { + return@AcceptPredicate false + } + + return@AcceptPredicate e is VlangStructDeclaration || + e is VlangEnumDeclaration || + e is VlangTypeAliasDeclaration || + e is VlangInterfaceDeclaration + } + + val interfacesOnlyAccept = AcceptPredicate { e: PsiElement, state: ResolveState, file: VlangFile -> + if (e !is VlangNamedElement) { + return@AcceptPredicate false + } + + if (!e.isPublic() && !state.get(LOCAL_RESOLVE)) { + return@AcceptPredicate false + } + + if (e.isBlank()) { + return@AcceptPredicate false + } + + return@AcceptPredicate e is VlangInterfaceDeclaration + } + + val genericAccept = AcceptPredicate { e: PsiElement, state: ResolveState, file: VlangFile -> + if (e is VlangFile) { + return@AcceptPredicate true + } + + if (e is VlangImportAlias) { + return@AcceptPredicate true + } + + if (e is VlangGlobalVariableDefinition) { + // global variables are visible everywhere + return@AcceptPredicate true + } + + if (e is VlangNamedElement) { + if (e.isBlank()) { + return@AcceptPredicate false + } + + if (e.name?.startsWith("C.") == true) { + return@AcceptPredicate file.isCFile() + } + + if (e.name?.startsWith("JS.") == true) { + return@AcceptPredicate file.isJSFile() + } + + // forbid raw map completion + if (e is VlangStructDeclaration && e.name == "map") { + return@AcceptPredicate false + } + + if ((e is VlangMethodDeclaration || e is VlangFieldDefinition) && state.get(PROCESS_PRIVATE_MEMBERS)) { + return@AcceptPredicate true + } + + return@AcceptPredicate state.get(LOCAL_RESOLVE) || e.isPublic() + } + + return@AcceptPredicate false + } + open class MyScopeProcessor( private val parameters: CompletionParameters, private val result: CompletionResultSet, private val file: VlangFile, - private val forTypes: Boolean, + private val accept: AcceptPredicate, ) : VlangScopeProcessor() { private val processedNames = mutableSetOf() override fun execute(element: PsiElement, state: ResolveState): Boolean { - if (accept(element, state, file, forTypes)) { + if (accept.accept(element, state, file)) { addElement( element, state, - forTypes, processedNames, result, parameters, @@ -203,196 +295,142 @@ object ReferenceCompletionProvider : CompletionProvider() return true } - private fun accept(e: PsiElement, state: ResolveState, file: VlangFile, forTypes: Boolean): Boolean { - if (forTypes) { - if (e !is VlangNamedElement) return false - if (!e.isPublic() && !state.get(LOCAL_RESOLVE) && !state.get(PROCESS_PRIVATE_MEMBERS)) { - return false - } + override fun isCompletion(): Boolean = true - if (e.isBlank()) { - return false - } - // forbid raw map completion - if (e is VlangStructDeclaration && e.name == "map") { - return false + private fun addElement( + o: PsiElement, + state: ResolveState, + processedNames: MutableSet, + set: CompletionResultSet, + parameters: CompletionParameters, + ) { + val lookup = createLookupElement(o, state, parameters) + if (lookup != null) { + val key = lookup.lookupString + o.javaClass + if (!processedNames.contains(key)) { + set.addElement(lookup) + processedNames.add(key) } - - return e is VlangStructDeclaration || - e is VlangEnumDeclaration || - e is VlangTypeAliasDeclaration || - e is VlangInterfaceDeclaration - } - - if (e is VlangFile) { - return true } + } - if (e is VlangImportAlias) { - return true + private fun createLookupElement( + element: PsiElement, + state: ResolveState, + parameters: CompletionParameters, + ): LookupElement? { + if (element is VlangFile) { + return VlangCompletionUtil.createModuleLookupElement(element) } - if (e is VlangGlobalVariableDefinition) { - // global variables are visible everywhere - return true + val elementFile = element.containingFile as? VlangFile ?: return null + val context = parameters.position + val contextFile = context.containingFile as? VlangFile ?: return null + val isSameModule = VlangCodeInsightUtil.sameModule(contextFile, elementFile) + + val contextFunction = context.parentOfType() + val elementFunction = element.parentOfType() + val isLocal = contextFunction == elementFunction + + val kind = when (element) { + is VlangFunctionDeclaration -> VlangLookupElementProperties.ElementKind.FUNCTION + is VlangMethodDeclaration -> VlangLookupElementProperties.ElementKind.METHOD + is VlangStructDeclaration -> VlangLookupElementProperties.ElementKind.STRUCT + is VlangEnumDeclaration -> VlangLookupElementProperties.ElementKind.ENUM + is VlangInterfaceDeclaration -> VlangLookupElementProperties.ElementKind.INTERFACE + is VlangConstDefinition -> VlangLookupElementProperties.ElementKind.CONSTANT + is VlangTypeAliasDeclaration -> VlangLookupElementProperties.ElementKind.TYPE_ALIAS + is VlangFieldDefinition -> VlangLookupElementProperties.ElementKind.FIELD + is VlangInterfaceMethodDefinition -> VlangLookupElementProperties.ElementKind.INTERFACE_METHOD + is VlangEnumFieldDefinition -> VlangLookupElementProperties.ElementKind.ENUM_FIELD + is VlangImportAlias -> VlangLookupElementProperties.ElementKind.IMPORT_ALIAS + is VlangGlobalVariableDefinition -> VlangLookupElementProperties.ElementKind.GLOBAL + is VlangNamedElement -> VlangLookupElementProperties.ElementKind.OTHER + else -> return null } - if (e is VlangNamedElement) { - if (e.isBlank()) { - return false - } - - if (e.name?.startsWith("C.") == true) { - return file.isCFile() - } - - if (e.name?.startsWith("JS.") == true) { - return file.isJSFile() - } - - // forbid raw map completion - if (e is VlangStructDeclaration && e.name == "map") { - return false + val isTypeCompatible = false + // TODO: Needs stubs enhancement + // if (element is VlangTypeOwner) { + // val type = element.getType(null)?.unwrapFunction() + // val contextType = VlangTypeInferenceUtil.getContextType(context.parent) + // isTypeCompatible = + // type != null && contextType != null && type !is VlangVoidPtrTypeEx && contextType.isAssignableFrom(type, context.project) + // } + + var isReceiverTypeCompatible = false + if (element is VlangMethodDeclaration) { + val parent = context.parent as? VlangReferenceExpression + val qualifier = parent?.getQualifier() as? VlangReferenceExpression + if (qualifier != null) { + val mutabilityOwner = qualifier.resolve() as? VlangMutabilityOwner + + val mutableMethod = element.isMutable + val mutableCaller = mutabilityOwner != null && mutabilityOwner.isMutable() + val isReceiverTypeNotCompatible = mutableMethod && !mutableCaller + isReceiverTypeCompatible = !isReceiverTypeNotCompatible } - - if ((e is VlangMethodDeclaration || e is VlangFieldDefinition) && state.get(PROCESS_PRIVATE_MEMBERS)) { - return true - } - - return state.get(LOCAL_RESOLVE) || e.isPublic() } - return false - } - - override fun isCompletion(): Boolean = true - } - - private fun addElement( - o: PsiElement, - state: ResolveState, - forTypes: Boolean, - processedNames: MutableSet, - set: CompletionResultSet, - parameters: CompletionParameters, - ) { - val lookup = createLookupElement(o, state, forTypes, parameters) - if (lookup != null) { - val key = lookup.lookupString + o.javaClass - if (!processedNames.contains(key)) { - set.addElement(lookup) - processedNames.add(key) + var isContextMember = false + if (contextFunction is VlangMethodDeclaration) { + if (element is VlangFieldDefinition || element is VlangMethodDeclaration) { + element as VlangNamedElement + val ownerType = (element.getOwner() as? VlangNamedElement)?.getType(null) + val receiverType = contextFunction.receiverType.toEx().unwrapPointer() + if (ownerType.isNullableEqual(receiverType)) { + isContextMember = true + } + } } - } - } - private fun createLookupElement( - element: PsiElement, - state: ResolveState, - forTypes: Boolean, - parameters: CompletionParameters, - ): LookupElement? { - if (element is VlangFile) { - return VlangCompletionUtil.createModuleLookupElement(element) - } + val lookupElement = when (element) { + is VlangFunctionDeclaration -> VlangCompletionUtil.createFunctionLookupElement(element, state) + is VlangMethodDeclaration -> VlangCompletionUtil.createMethodLookupElement(element) + is VlangStructDeclaration -> VlangCompletionUtil.createStructLookupElement( + element, + state, + needBrackets = accept != forTypesAccept + ) - val elementFile = element.containingFile as? VlangFile ?: return null - val context = parameters.position - val contextFile = context.containingFile as? VlangFile ?: return null - val isSameModule = VlangCodeInsightUtil.sameModule(contextFile, elementFile) - - val contextFunction = context.parentOfType() - val elementFunction = element.parentOfType() - val isLocal = contextFunction == elementFunction - - val kind = when (element) { - is VlangFunctionDeclaration -> VlangLookupElementProperties.ElementKind.FUNCTION - is VlangMethodDeclaration -> VlangLookupElementProperties.ElementKind.METHOD - is VlangStructDeclaration -> VlangLookupElementProperties.ElementKind.STRUCT - is VlangEnumDeclaration -> VlangLookupElementProperties.ElementKind.ENUM - is VlangInterfaceDeclaration -> VlangLookupElementProperties.ElementKind.INTERFACE - is VlangConstDefinition -> VlangLookupElementProperties.ElementKind.CONSTANT - is VlangTypeAliasDeclaration -> VlangLookupElementProperties.ElementKind.TYPE_ALIAS - is VlangFieldDefinition -> VlangLookupElementProperties.ElementKind.FIELD - is VlangInterfaceMethodDefinition -> VlangLookupElementProperties.ElementKind.INTERFACE_METHOD - is VlangEnumFieldDefinition -> VlangLookupElementProperties.ElementKind.ENUM_FIELD - is VlangImportAlias -> VlangLookupElementProperties.ElementKind.IMPORT_ALIAS - is VlangGlobalVariableDefinition -> VlangLookupElementProperties.ElementKind.GLOBAL - is VlangNamedElement -> VlangLookupElementProperties.ElementKind.OTHER - else -> return null - } + is VlangEnumDeclaration -> VlangCompletionUtil.createEnumLookupElement(element, state) + is VlangInterfaceDeclaration -> VlangCompletionUtil.createInterfaceLookupElement(element, state) + is VlangTypeAliasDeclaration -> VlangCompletionUtil.createTypeAliasLookupElement(element, state) + is VlangFieldDefinition -> VlangCompletionUtil.createFieldLookupElement(element) + is VlangInterfaceMethodDefinition -> VlangCompletionUtil.createInterfaceMethodLookupElement(element, state) + is VlangConstDefinition -> VlangCompletionUtil.createConstantLookupElement(element, state) + is VlangEnumFieldDefinition -> VlangCompletionUtil.createEnumFieldLookupElement(element) + is VlangGlobalVariableDefinition -> VlangCompletionUtil.createGlobalVariableLikeLookupElement( + element, + state + ) - val isTypeCompatible = false - // TODO: Needs stubs enhancement - // if (element is VlangTypeOwner) { - // val type = element.getType(null)?.unwrapFunction() - // val contextType = VlangTypeInferenceUtil.getContextType(context.parent) - // isTypeCompatible = - // type != null && contextType != null && type !is VlangVoidPtrTypeEx && contextType.isAssignableFrom(type, context.project) - // } - - var isReceiverTypeCompatible = false - if (element is VlangMethodDeclaration) { - val parent = context.parent as? VlangReferenceExpression - val qualifier = parent?.getQualifier() as? VlangReferenceExpression - if (qualifier != null) { - val mutabilityOwner = qualifier.resolve() as? VlangMutabilityOwner - - val mutableMethod = element.isMutable - val mutableCaller = mutabilityOwner != null && mutabilityOwner.isMutable() - val isReceiverTypeNotCompatible = mutableMethod && !mutableCaller - isReceiverTypeCompatible = !isReceiverTypeNotCompatible + is VlangImportAlias -> VlangCompletionUtil.createImportAliasLookupElement(element) + is VlangNamedElement -> VlangCompletionUtil.createVariableLikeLookupElement(element) + else -> null } - } - var isContextMember = false - if (contextFunction is VlangMethodDeclaration) { - if (element is VlangFieldDefinition || element is VlangMethodDeclaration) { - element as VlangNamedElement - val ownerType = (element.getOwner() as? VlangNamedElement)?.getType(null) - val receiverType = contextFunction.receiverType.toEx().unwrapPointer() - if (ownerType.isNullableEqual(receiverType)) { - isContextMember = true - } + var isContextElement = false + if (lookupElement is PrioritizedLookupElement<*>) { + isContextElement = lookupElement.priority.toInt() == VlangCompletionUtil.CONTEXT_COMPLETION_PRIORITY } - } - - val lookupElement = when (element) { - is VlangFunctionDeclaration -> VlangCompletionUtil.createFunctionLookupElement(element, state) - is VlangMethodDeclaration -> VlangCompletionUtil.createMethodLookupElement(element) - is VlangStructDeclaration -> VlangCompletionUtil.createStructLookupElement(element, state, !forTypes) - is VlangEnumDeclaration -> VlangCompletionUtil.createEnumLookupElement(element, state) - is VlangInterfaceDeclaration -> VlangCompletionUtil.createInterfaceLookupElement(element, state) - is VlangTypeAliasDeclaration -> VlangCompletionUtil.createTypeAliasLookupElement(element, state) - is VlangFieldDefinition -> VlangCompletionUtil.createFieldLookupElement(element) - is VlangInterfaceMethodDefinition -> VlangCompletionUtil.createInterfaceMethodLookupElement(element, state) - is VlangConstDefinition -> VlangCompletionUtil.createConstantLookupElement(element, state) - is VlangEnumFieldDefinition -> VlangCompletionUtil.createEnumFieldLookupElement(element) - is VlangGlobalVariableDefinition -> VlangCompletionUtil.createGlobalVariableLikeLookupElement(element, state) - is VlangImportAlias -> VlangCompletionUtil.createImportAliasLookupElement(element) - is VlangNamedElement -> VlangCompletionUtil.createVariableLikeLookupElement(element) - else -> null - } - var isContextElement = false - if (lookupElement is PrioritizedLookupElement<*>) { - isContextElement = lookupElement.priority.toInt() == VlangCompletionUtil.CONTEXT_COMPLETION_PRIORITY + val isNotDeprecated = element !is VlangNamedElement || !element.isDeprecated() + + return lookupElement?.toVlangLookupElement( + VlangLookupElementProperties( + isLocal = isLocal, + isSameModule = isSameModule, + elementKind = kind, + isReceiverTypeCompatible = isReceiverTypeCompatible, + isTypeCompatible = isTypeCompatible, + isContextElement = isContextElement, + isNotDeprecated = isNotDeprecated, + isContextMember = isContextMember, + ) + ) } - val isNotDeprecated = element !is VlangNamedElement || !element.isDeprecated() - - return lookupElement?.toVlangLookupElement( - VlangLookupElementProperties( - isLocal = isLocal, - isSameModule = isSameModule, - elementKind = kind, - isReceiverTypeCompatible = isReceiverTypeCompatible, - isTypeCompatible = isTypeCompatible, - isContextElement = isContextElement, - isNotDeprecated = isNotDeprecated, - isContextMember = isContextMember, - ) - ) } } diff --git a/src/main/kotlin/io/vlang/lang/grammar/v.bnf b/src/main/kotlin/io/vlang/lang/grammar/v.bnf index 341cf716..9fa99732 100644 --- a/src/main/kotlin/io/vlang/lang/grammar/v.bnf +++ b/src/main/kotlin/io/vlang/lang/grammar/v.bnf @@ -381,7 +381,7 @@ left SelectArmAssignmentStatement ::= AssignOp BeforeBlockExpression {extends=As SelectElseArmClause ::= else Block semi {pin=1} // asm [volatile] { ... } -AsmBlockStatement ::= asm volatile? identifier AsmBlock {pin=1} +AsmBlockStatement ::= asm volatile? identifier AsmBlock {pin=3} AsmBlock ::= '{' ('}' | (ASM_LINE)* '}') {pin(".*")=1} ////// DECLARATIONS ////// @@ -398,12 +398,20 @@ AnonymousStructType ::= struct '{' FieldsGroup* '}' { methods=[getFieldList getOwnFieldList] } -StructType ::= (struct | union) identifier GenericParameters? '{' FieldsGroup* '}' { +StructType ::= (struct | union) identifier GenericParameters? ImplementsClause? '{' FieldsGroup* '}' { pin=1 implements="io.vlang.lang.psi.VlangFieldListOwner" methods=[getFieldList getOwnFieldList getEmbeddedStructs getEmbeddedStructList isUnion] } +ImplementsClause ::= implements TypeName (',' TypeName)* LastComma? + +LastComma ::= ',' { +// extends="com.intellij.psi.impl.source.tree.PsiErrorElementImpl" + implements="com.intellij.psi.PsiErrorElement" + methods=[getErrorDescription] +} + FieldsGroup ::= UnfinishedMemberModifiers | WithModifiersFieldsGroup | WithoutModifiersFieldsGroup { methods=[getMemberModifierList] implements="io.vlang.lang.psi.VlangMemberModifiersOwner" @@ -484,7 +492,8 @@ EnumBackedTypeAs ::= as Type {pin=1} private EnumFields ::= EnumFieldDeclaration (EnumFieldDeclaration)* EnumFieldDeclaration ::= EnumFieldDefinition ('=' Expression)? semi? {pin=1} -EnumFieldDefinition ::= identifier { +EnumFieldDefinition ::= <> identifier { + pin=2 methods=[isPublic getTypeInner constantValue] stubClass="io.vlang.lang.stubs.VlangEnumFieldDefinitionStub" } @@ -725,7 +734,8 @@ Type ::= TypeModifiers? (TypeLit | TypeName) GenericArguments? { private TypeName ::= TypeReferenceExpression QualifiedTypeReferenceExpression* -left QualifiedTypeReferenceExpression ::= '.' identifier {elementType=TypeReferenceExpression} +left QualifiedTypeReferenceExpression ::= '.' <> identifier {elementType=TypeReferenceExpression} + TypeReferenceExpression ::= identifier { stubClass="io.vlang.lang.stubs.VlangTypeReferenceExpressionStub" methods=[getReference getQualifier resolve getType] @@ -747,7 +757,7 @@ private TypeLit ::= | AtomicType | AnonymousStructType | StructType - | InterfaceType + | InterfaceType // inline interface ??? // [] ArrayType ::= '['']' Type {pin=3} @@ -973,8 +983,8 @@ ResultPropagationExpression ::= '!' {pin=1} UnpackingExpression ::= '...' Expression {pin=1} // . -EnumFetch ::= '.' identifier { - pin=2 +EnumFetch ::= '.' <> identifier { + pin=3 methods=[getReference getQualifier resolve] } diff --git a/src/main/kotlin/io/vlang/lang/lexer/v.flex b/src/main/kotlin/io/vlang/lang/lexer/v.flex index 8bef85d0..552aa26a 100644 --- a/src/main/kotlin/io/vlang/lang/lexer/v.flex +++ b/src/main/kotlin/io/vlang/lang/lexer/v.flex @@ -329,6 +329,7 @@ REGULAR_SINGLE_STRING_PART=[^\\\'\$]+ "module" { return MODULE; } "import" { return IMPORT ; } "struct" { return STRUCT; } +"implements" { return IMPLEMENTS; } "union" { return UNION; } "interface" { return INTERFACE; } "enum" { return ENUM; } diff --git a/src/main/kotlin/io/vlang/lang/psi/VlangTokenTypes.kt b/src/main/kotlin/io/vlang/lang/psi/VlangTokenTypes.kt index 900fbc5b..024059bc 100644 --- a/src/main/kotlin/io/vlang/lang/psi/VlangTokenTypes.kt +++ b/src/main/kotlin/io/vlang/lang/psi/VlangTokenTypes.kt @@ -47,6 +47,7 @@ object VlangTokenTypes { GO, GOTO, IF, + IMPLEMENTS, IMPORT, INTERFACE, MODULE, diff --git a/src/main/kotlin/io/vlang/lang/psi/impl/VlangPsiImplUtil.kt b/src/main/kotlin/io/vlang/lang/psi/impl/VlangPsiImplUtil.kt index ca8e745f..ede3b4fe 100644 --- a/src/main/kotlin/io/vlang/lang/psi/impl/VlangPsiImplUtil.kt +++ b/src/main/kotlin/io/vlang/lang/psi/impl/VlangPsiImplUtil.kt @@ -56,6 +56,11 @@ object VlangPsiImplUtil { return o.getBlock() == null } + @JvmStatic + fun getErrorDescription(@Suppress("unused") o: VlangLastComma): String { + return "Trailing comma not supported" + } + @JvmStatic fun isNoReturn(o: VlangFunctionDeclaration): Boolean { return o.attributes?.attributeList?.any { diff --git a/src/main/kotlin/io/vlang/lang/psi/impl/VlangReference.kt b/src/main/kotlin/io/vlang/lang/psi/impl/VlangReference.kt index 41dde945..f134e712 100644 --- a/src/main/kotlin/io/vlang/lang/psi/impl/VlangReference.kt +++ b/src/main/kotlin/io/vlang/lang/psi/impl/VlangReference.kt @@ -9,18 +9,24 @@ import com.intellij.openapi.util.TextRange import com.intellij.psi.* import com.intellij.psi.impl.source.resolve.ResolveCache import com.intellij.psi.search.GlobalSearchScope +import com.intellij.psi.stubs.StubIndex import com.intellij.psi.util.PsiTreeUtil import com.intellij.psi.util.childrenOfType import com.intellij.psi.util.parentOfType import com.intellij.util.ArrayUtil +import com.intellij.util.containers.addAllIfNotNull import io.vlang.configurations.VlangConfiguration import io.vlang.ide.codeInsight.VlangCodeInsightUtil import io.vlang.ide.codeInsight.VlangTypeInferenceUtil import io.vlang.lang.psi.* +import io.vlang.lang.psi.impl.VlangPsiImplUtil.createContextOnElement import io.vlang.lang.psi.impl.VlangPsiImplUtil.processNamedElements import io.vlang.lang.psi.types.* import io.vlang.lang.psi.types.VlangBaseTypeEx.Companion.toEx import io.vlang.lang.sql.VlangSqlUtil +import io.vlang.lang.stubs.VlangInterfaceDeclarationStub +import io.vlang.lang.stubs.index.VlangClassLikeIndex +import io.vlang.lang.stubs.index.VlangClassLikeIndex.Companion.KEY import io.vlang.lang.stubs.index.VlangGlobalVariablesIndex import io.vlang.lang.stubs.index.VlangModulesFingerprintIndex import io.vlang.lang.stubs.index.VlangModulesIndex @@ -469,6 +475,40 @@ class VlangReference(el: VlangReferenceExpressionBase, val forTypes: Boolean = f return processEnumFetch(myElement as VlangEnumFetch, processor, state) } +// if (myElement is VlangTypeReferenceExpression && myElement.parent is VlangStructType) { +// val currentFile = element.containingFile as VlangFile +// val variants = mutableListOf() +// +//// val resolve = myElement.resolve() +//// if (resolve != null && resolve is VlangInterfaceDeclaration) { +//// if (!processType(resolve.interfaceType.toEx(), processor, state)) return false +//// } +// val element = +// VlangClassLikeIndex.find(myElement.text, project, GlobalSearchScope.projectScope(project)).firstOrNull() +// +// +// // Add interfaces from the same file +// variants.addAll(currentFile.getInterfaces()) +// +// // Add interfaces from imports +// currentFile.getImports().forEach { +// val importedFile = VlangModulesIndex.find(it.name, project, GlobalSearchScope.projectScope(project)).firstOrNull() +// if (importedFile != null) { +// variants.addAll(importedFile.getInterfaces()) +// } +// } +// +// return processNamedElements( +// processor, +// state, +//// file.getInterfaces(), +// variants, +// Conditions.alwaysTrue(), +// localResolve = true, +// checkContainingFile = false +// ) +// } + when (myElement.parent) { is VlangFieldName -> { if (!processTrailingStructParams(processor, state)) return false @@ -559,7 +599,8 @@ class VlangReference(el: VlangReferenceExpressionBase, val forTypes: Boolean = f if (receiverType is VlangGenericInstantiationEx && receiverType.inner is VlangResolvableTypeEx<*>) { val resolved = (receiverType.inner as VlangResolvableTypeEx<*>).resolve(project) ?: return false - val genericParametersOwner = resolved.childrenOfType().firstOrNull() ?: return false + val genericParametersOwner = + resolved.childrenOfType().firstOrNull() ?: return false val genericParameters = genericParametersOwner.genericParameters?.parameters ?: return false if (!processNamedElements(processor, state, genericParameters, false)) return false @@ -728,7 +769,13 @@ class VlangReference(el: VlangReferenceExpressionBase, val forTypes: Boolean = f continue } - if (!processFileEntities(moduleFile, processor, state.put(MODULE_NAME, moduleFile.getModuleQualifiedName()), false)) { + if (!processFileEntities( + moduleFile, + processor, + state.put(MODULE_NAME, moduleFile.getModuleQualifiedName()), + false + ) + ) { return false } } @@ -755,7 +802,11 @@ class VlangReference(el: VlangReferenceExpressionBase, val forTypes: Boolean = f return processStubFile("compile_time_constants.v", processor, state) } - private fun processImportedModulesForCompletion(file: VlangFile, processor: VlangScopeProcessor, state: ResolveState): Boolean { + private fun processImportedModulesForCompletion( + file: VlangFile, + processor: VlangScopeProcessor, + state: ResolveState, + ): Boolean { if (!processor.isCompletion()) { // This method is only for autocompletion when a user writes // a symbol (from another module) name, and we want to import @@ -883,7 +934,12 @@ class VlangReference(el: VlangReferenceExpressionBase, val forTypes: Boolean = f ) } - private fun processBlock(file: VlangFile, processor: VlangScopeProcessor, state: ResolveState, localResolve: Boolean): Boolean { + private fun processBlock( + file: VlangFile, + processor: VlangScopeProcessor, + state: ResolveState, + localResolve: Boolean, + ): Boolean { val context = if (file is VlangCodeFragment) file.context else myElement val newState = if (file is VlangCodeFragment) @@ -893,7 +949,12 @@ class VlangReference(el: VlangReferenceExpressionBase, val forTypes: Boolean = f val delegate = createDelegate(processor, file is VlangCodeFragment) ResolveUtil.treeWalkUp(context, delegate) - return processNamedElements(processor, newState.put(NOT_PROCESS_EMBEDDED_DEFINITION, true), delegate.getVariants(), localResolve) + return processNamedElements( + processor, + newState.put(NOT_PROCESS_EMBEDDED_DEFINITION, true), + delegate.getVariants(), + localResolve + ) } private fun processPseudoParams(processor: VlangScopeProcessor, state: ResolveState): Boolean { @@ -1017,7 +1078,8 @@ class VlangReference(el: VlangReferenceExpressionBase, val forTypes: Boolean = f } } - override fun isReferenceTo(element: PsiElement) = couldBeReferenceTo(element, myElement) && super.isReferenceTo(element) + override fun isReferenceTo(element: PsiElement) = + couldBeReferenceTo(element, myElement) && super.isReferenceTo(element) private fun couldBeReferenceTo(definition: PsiElement, reference: PsiElement): Boolean { if (definition is PsiDirectory && reference is VlangReferenceExpressionBase) return true diff --git a/src/main/kotlin/io/vlang/lang/stubs/index/VlangClassLikeIndex.kt b/src/main/kotlin/io/vlang/lang/stubs/index/VlangClassLikeIndex.kt index f3ce74c6..9929ecc8 100644 --- a/src/main/kotlin/io/vlang/lang/stubs/index/VlangClassLikeIndex.kt +++ b/src/main/kotlin/io/vlang/lang/stubs/index/VlangClassLikeIndex.kt @@ -18,7 +18,7 @@ class VlangClassLikeIndex : StringStubIndexExtension() { name: String, project: Project, scope: GlobalSearchScope?, - idFilter: IdFilter? + idFilter: IdFilter? = null ): Collection { return StubIndex.getElements(KEY, name, project, scope, idFilter, VlangNamedElement::class.java) } diff --git a/src/main/resources/META-INF/inspections.xml b/src/main/resources/META-INF/inspections.xml index 740e9ca1..d9d296be 100644 --- a/src/main/resources/META-INF/inspections.xml +++ b/src/main/resources/META-INF/inspections.xml @@ -79,6 +79,15 @@ level="ERROR" implementationClass="io.vlang.ide.inspections.general.VlangDuplicateFieldInspection"/> + + + +Reports explicit interface declarations on structs which are not fully implemented. + + \ No newline at end of file diff --git a/src/test/kotlin/io/vlang/lang/parser/ParserTest.kt b/src/test/kotlin/io/vlang/lang/parser/ParserTest.kt index 8175f69d..f0c2bc05 100644 --- a/src/test/kotlin/io/vlang/lang/parser/ParserTest.kt +++ b/src/test/kotlin/io/vlang/lang/parser/ParserTest.kt @@ -26,4 +26,5 @@ class ParserTest : ParserTestBase("parser", "v", VlangParserDefinition()) { fun `test top level expressions`() = doTest(true) fun `test sql`() = doTest(true) fun `test static function`() = doTest(true) + fun `test enum keyword fields`() = doTest(true) } diff --git a/src/test/resources/parser/enum keyword fields.txt b/src/test/resources/parser/enum keyword fields.txt new file mode 100644 index 00000000..af49542d --- /dev/null +++ b/src/test/resources/parser/enum keyword fields.txt @@ -0,0 +1,173 @@ +V Language file + MODULE_CLAUSE + PsiElement(VlangTokenType.module)('module') + PsiElement(VlangTokenType.identifier)('main') + ENUM_DECLARATION + ENUM_TYPE + PsiElement(VlangTokenType.enum)('enum') + PsiElement(VlangTokenType.identifier)('Keywords') + PsiElement(VlangTokenType.{)('{') + ENUM_FIELD_DECLARATION + ENUM_FIELD_DEFINITION + PsiElement(VlangTokenType.identifier)('module') + ENUM_FIELD_DECLARATION + ENUM_FIELD_DEFINITION + PsiElement(VlangTokenType.identifier)('import') + ENUM_FIELD_DECLARATION + ENUM_FIELD_DEFINITION + PsiElement(VlangTokenType.identifier)('struct') + ENUM_FIELD_DECLARATION + ENUM_FIELD_DEFINITION + PsiElement(VlangTokenType.identifier)('implements') + ENUM_FIELD_DECLARATION + ENUM_FIELD_DEFINITION + PsiElement(VlangTokenType.identifier)('union') + ENUM_FIELD_DECLARATION + ENUM_FIELD_DEFINITION + PsiElement(VlangTokenType.identifier)('interface') + ENUM_FIELD_DECLARATION + ENUM_FIELD_DEFINITION + PsiElement(VlangTokenType.identifier)('enum') + ENUM_FIELD_DECLARATION + ENUM_FIELD_DEFINITION + PsiElement(VlangTokenType.identifier)('const') + ENUM_FIELD_DECLARATION + ENUM_FIELD_DEFINITION + PsiElement(VlangTokenType.identifier)('type') + ENUM_FIELD_DECLARATION + ENUM_FIELD_DEFINITION + PsiElement(VlangTokenType.identifier)('fn') + ENUM_FIELD_DECLARATION + ENUM_FIELD_DEFINITION + PsiElement(VlangTokenType.identifier)('return') + ENUM_FIELD_DECLARATION + ENUM_FIELD_DEFINITION + PsiElement(VlangTokenType.identifier)('select') + ENUM_FIELD_DECLARATION + ENUM_FIELD_DEFINITION + PsiElement(VlangTokenType.identifier)('match') + ENUM_FIELD_DECLARATION + ENUM_FIELD_DEFINITION + PsiElement(VlangTokenType.identifier)('or') + ENUM_FIELD_DECLARATION + ENUM_FIELD_DEFINITION + PsiElement(VlangTokenType.identifier)('if') + ENUM_FIELD_DECLARATION + ENUM_FIELD_DEFINITION + PsiElement(VlangTokenType.identifier)('else') + ENUM_FIELD_DECLARATION + ENUM_FIELD_DEFINITION + PsiElement(VlangTokenType.identifier)('goto') + ENUM_FIELD_DECLARATION + ENUM_FIELD_DEFINITION + PsiElement(VlangTokenType.identifier)('assert') + ENUM_FIELD_DECLARATION + ENUM_FIELD_DEFINITION + PsiElement(VlangTokenType.identifier)('for') + ENUM_FIELD_DECLARATION + ENUM_FIELD_DEFINITION + PsiElement(VlangTokenType.identifier)('break') + ENUM_FIELD_DECLARATION + ENUM_FIELD_DEFINITION + PsiElement(VlangTokenType.identifier)('continue') + ENUM_FIELD_DECLARATION + ENUM_FIELD_DEFINITION + PsiElement(VlangTokenType.identifier)('unsafe') + ENUM_FIELD_DECLARATION + ENUM_FIELD_DEFINITION + PsiElement(VlangTokenType.identifier)('defer') + ENUM_FIELD_DECLARATION + ENUM_FIELD_DEFINITION + PsiElement(VlangTokenType.identifier)('go') + ENUM_FIELD_DECLARATION + ENUM_FIELD_DEFINITION + PsiElement(VlangTokenType.identifier)('spawn') + ENUM_FIELD_DECLARATION + ENUM_FIELD_DEFINITION + PsiElement(VlangTokenType.identifier)('rlock') + ENUM_FIELD_DECLARATION + ENUM_FIELD_DEFINITION + PsiElement(VlangTokenType.identifier)('lock') + ENUM_FIELD_DECLARATION + ENUM_FIELD_DEFINITION + PsiElement(VlangTokenType.identifier)('as') + ENUM_FIELD_DECLARATION + ENUM_FIELD_DEFINITION + PsiElement(VlangTokenType.identifier)('in') + ENUM_FIELD_DECLARATION + ENUM_FIELD_DEFINITION + PsiElement(VlangTokenType.identifier)('is') + ENUM_FIELD_DECLARATION + ENUM_FIELD_DEFINITION + PsiElement(VlangTokenType.identifier)('nil') + ENUM_FIELD_DECLARATION + ENUM_FIELD_DEFINITION + PsiElement(VlangTokenType.identifier)('true') + ENUM_FIELD_DECLARATION + ENUM_FIELD_DEFINITION + PsiElement(VlangTokenType.identifier)('false') + ENUM_FIELD_DECLARATION + ENUM_FIELD_DEFINITION + PsiElement(VlangTokenType.identifier)('none') + ENUM_FIELD_DECLARATION + ENUM_FIELD_DEFINITION + PsiElement(VlangTokenType.identifier)('pub') + ENUM_FIELD_DECLARATION + ENUM_FIELD_DEFINITION + PsiElement(VlangTokenType.identifier)('mut') + ENUM_FIELD_DECLARATION + ENUM_FIELD_DEFINITION + PsiElement(VlangTokenType.identifier)('static') + ENUM_FIELD_DECLARATION + ENUM_FIELD_DEFINITION + PsiElement(VlangTokenType.identifier)('shared') + ENUM_FIELD_DECLARATION + ENUM_FIELD_DEFINITION + PsiElement(VlangTokenType.identifier)('volatile') + ENUM_FIELD_DECLARATION + ENUM_FIELD_DEFINITION + PsiElement(VlangTokenType.identifier)('atomic') + ENUM_FIELD_DECLARATION + ENUM_FIELD_DEFINITION + PsiElement(VlangTokenType.identifier)('__global') + ENUM_FIELD_DECLARATION + ENUM_FIELD_DEFINITION + PsiElement(VlangTokenType.identifier)('dump') + ENUM_FIELD_DECLARATION + ENUM_FIELD_DEFINITION + PsiElement(VlangTokenType.identifier)('sizeof') + ENUM_FIELD_DECLARATION + ENUM_FIELD_DEFINITION + PsiElement(VlangTokenType.identifier)('typeof') + ENUM_FIELD_DECLARATION + ENUM_FIELD_DEFINITION + PsiElement(VlangTokenType.identifier)('isreftype') + ENUM_FIELD_DECLARATION + ENUM_FIELD_DEFINITION + PsiElement(VlangTokenType.identifier)('__offsetof') + PsiComment(VLANG_DOC_COMMENT) + PsiElement(VlangTokenType.)('//') + PsiElement(VlangTokenType.)('asm // tokenizer pushes ASM_BLOCK state which prevents normal tokenization') + PsiElement(VlangTokenType.})('}') + FUNCTION_DECLARATION + PsiElement(VlangTokenType.fn)('fn') + PsiElement(VlangTokenType.identifier)('main') + SIGNATURE + PARAMETERS + PsiElement(VlangTokenType.()('(') + PsiElement(VlangTokenType.))(')') + BLOCK + PsiElement(VlangTokenType.{)('{') + SIMPLE_STATEMENT + VAR_DECLARATION + VAR_DEFINITION + VAR_MODIFIERS + + PsiElement(VlangTokenType.identifier)('test') + PsiElement(VlangTokenType.:=)(':=') + REFERENCE_EXPRESSION + REFERENCE_EXPRESSION + PsiElement(VlangTokenType.identifier)('Keywords') + PsiElement(VlangTokenType..)('.') + PsiElement(VlangTokenType.identifier)('fn') + PsiElement(VlangTokenType.})('}') \ No newline at end of file diff --git a/src/test/resources/parser/enum keyword fields.v b/src/test/resources/parser/enum keyword fields.v new file mode 100644 index 00000000..610d6e7b --- /dev/null +++ b/src/test/resources/parser/enum keyword fields.v @@ -0,0 +1,55 @@ +module main + +enum Keywords { + module + import + struct + implements + union + interface + enum + const + type + fn + return + select + match + or + if + else + goto + assert + for + break + continue + unsafe + defer + go + spawn + rlock + lock + as + in + is + nil + true + false + none + pub + mut + static + shared + volatile + atomic + __global + dump + sizeof + typeof + isreftype + __offsetof + // asm // tokenizer pushes ASM_BLOCK state which prevents normal tokenization +} + +fn main() { + test := Keywords.fn +} \ No newline at end of file