diff --git a/plugins/groovy/groovy-psi/gen/org/jetbrains/plugins/groovy/lang/parser/GroovyBnfParser.java b/plugins/groovy/groovy-psi/gen/org/jetbrains/plugins/groovy/lang/parser/GroovyBnfParser.java index 9051caf991bd..3b01390e4671 100644 --- a/plugins/groovy/groovy-psi/gen/org/jetbrains/plugins/groovy/lang/parser/GroovyBnfParser.java +++ b/plugins/groovy/groovy-psi/gen/org/jetbrains/plugins/groovy/lang/parser/GroovyBnfParser.java @@ -519,12 +519,12 @@ public class GroovyBnfParser implements PsiParser, LightPsiParser { } /* ********************************************************** */ - // type_definition | parse_annotation_member + // type_definition | parse_annotation_declaration static boolean annotation_level(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "annotation_level")) return false; boolean r; r = type_definition(b, l + 1); - if (!r) r = parse_annotation_member(b, l + 1); + if (!r) r = parse_annotation_declaration(b, l + 1); return r; } @@ -641,9 +641,14 @@ public class GroovyBnfParser implements PsiParser, LightPsiParser { } /* ********************************************************** */ - // annotation_method | field_declaration + // <> static boolean annotation_tails(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "annotation_tails")) return false; + return mb_nl_group(b, l + 1, annotation_tails_0_0_parser_); + } + + // annotation_method | field_declaration + private static boolean annotation_tails_0_0(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "annotation_tails_0_0")) return false; boolean r; r = annotation_method(b, l + 1); if (!r) r = field_declaration(b, l + 1); @@ -1144,6 +1149,74 @@ public class GroovyBnfParser implements PsiParser, LightPsiParser { return r; } + /* ********************************************************** */ + // declaration_start_modifiers | block_declaration_start_no_modifiers + static boolean block_declaration_start(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "block_declaration_start")) return false; + boolean r; + r = declaration_start_modifiers(b, l + 1); + if (!r) r = block_declaration_start_no_modifiers(b, l + 1); + return r; + } + + /* ********************************************************** */ + // empty_modifier_list block_declaration_type_element + static boolean block_declaration_start_no_modifiers(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "block_declaration_start_no_modifiers")) return false; + boolean r; + Marker m = enter_section_(b); + r = empty_modifier_list(b, l + 1); + r = r && block_declaration_type_element(b, l + 1); + exit_section_(b, m, null, r); + return r; + } + + /* ********************************************************** */ + // <> + static boolean block_declaration_tail(PsiBuilder b, int l) { + return mb_nl_group(b, l + 1, block_declaration_tail_0_0_parser_); + } + + // method | variable_declaration_tail + private static boolean block_declaration_tail_0_0(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "block_declaration_tail_0_0")) return false; + boolean r; + r = method(b, l + 1); + if (!r) r = variable_declaration_tail(b, l + 1); + return r; + } + + /* ********************************************************** */ + // (capital_type_element | clear_variants_and_fail) &declaration_lookahead + static boolean block_declaration_type_element(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "block_declaration_type_element")) return false; + boolean r; + Marker m = enter_section_(b, l, _NONE_, null, ""); + r = block_declaration_type_element_0(b, l + 1); + r = r && block_declaration_type_element_1(b, l + 1); + exit_section_(b, l, m, r, false, null); + return r; + } + + // capital_type_element | clear_variants_and_fail + private static boolean block_declaration_type_element_0(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "block_declaration_type_element_0")) return false; + boolean r; + r = capital_type_element(b, l + 1); + if (!r) r = clear_variants_and_fail(b, l + 1); + return r; + } + + // &declaration_lookahead + private static boolean block_declaration_type_element_1(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "block_declaration_type_element_1")) return false; + boolean r; + Marker m = enter_section_(b, l, _AND_); + r = declaration_lookahead(b, l + 1); + exit_section_(b, l, m, r, false, null); + return r; + } + /* ********************************************************** */ // type_definition | tuple_var_declaration | statement static boolean block_level(PsiBuilder b, int l) { @@ -1805,205 +1878,75 @@ public class GroovyBnfParser implements PsiParser, LightPsiParser { } /* ********************************************************** */ - // class_declaration_start1 | class_declaration_start2 | class_declaration_start3 + // declaration_start_modifiers | class_declaration_start_no_modifiers static boolean class_declaration_start(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "class_declaration_start")) return false; boolean r; - r = class_declaration_start1(b, l + 1); - if (!r) r = class_declaration_start2(b, l + 1); - if (!r) r = class_declaration_start3(b, l + 1); + r = declaration_start_modifiers(b, l + 1); + if (!r) r = class_declaration_start_no_modifiers(b, l + 1); return r; } /* ********************************************************** */ - // non_empty_modifier_list - // [mb_nl type_parameter_list] - // [mb_nl (type_element | clear_variants_and_fail) &declaration_lookahead] - // mb_nl &declaration_lookahead - static boolean class_declaration_start1(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "class_declaration_start1")) return false; - boolean r, p; - Marker m = enter_section_(b, l, _NONE_); - r = non_empty_modifier_list(b, l + 1); - p = r; // pin = 1 - r = r && report_error_(b, class_declaration_start1_1(b, l + 1)); - r = p && report_error_(b, class_declaration_start1_2(b, l + 1)) && r; - r = p && report_error_(b, mb_nl(b, l + 1)) && r; - r = p && class_declaration_start1_4(b, l + 1) && r; - exit_section_(b, l, m, r, p, null); - return r || p; + // class_declaration_start_after_no_modifiers1 + // | class_declaration_start_after_no_modifiers2 + static boolean class_declaration_start_after_no_modifiers(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "class_declaration_start_after_no_modifiers")) return false; + boolean r; + r = class_declaration_start_after_no_modifiers1(b, l + 1); + if (!r) r = class_declaration_start_after_no_modifiers2(b, l + 1); + return r; } - // [mb_nl type_parameter_list] - private static boolean class_declaration_start1_1(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "class_declaration_start1_1")) return false; - class_declaration_start1_1_0(b, l + 1); - return true; - } - - // mb_nl type_parameter_list - private static boolean class_declaration_start1_1_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "class_declaration_start1_1_0")) return false; + /* ********************************************************** */ + // capital_type_element !'(' + static boolean class_declaration_start_after_no_modifiers1(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "class_declaration_start_after_no_modifiers1")) return false; boolean r; Marker m = enter_section_(b); - r = mb_nl(b, l + 1); - r = r && type_parameter_list(b, l + 1); + r = capital_type_element(b, l + 1); + r = r && class_declaration_start_after_no_modifiers1_1(b, l + 1); exit_section_(b, m, null, r); return r; } - // [mb_nl (type_element | clear_variants_and_fail) &declaration_lookahead] - private static boolean class_declaration_start1_2(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "class_declaration_start1_2")) return false; - class_declaration_start1_2_0(b, l + 1); - return true; - } - - // mb_nl (type_element | clear_variants_and_fail) &declaration_lookahead - private static boolean class_declaration_start1_2_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "class_declaration_start1_2_0")) return false; + // !'(' + private static boolean class_declaration_start_after_no_modifiers1_1(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "class_declaration_start_after_no_modifiers1_1")) return false; boolean r; - Marker m = enter_section_(b); - r = mb_nl(b, l + 1); - r = r && class_declaration_start1_2_0_1(b, l + 1); - r = r && class_declaration_start1_2_0_2(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - // type_element | clear_variants_and_fail - private static boolean class_declaration_start1_2_0_1(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "class_declaration_start1_2_0_1")) return false; - boolean r; - r = type_element(b, l + 1); - if (!r) r = clear_variants_and_fail(b, l + 1); - return r; - } - - // &declaration_lookahead - private static boolean class_declaration_start1_2_0_2(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "class_declaration_start1_2_0_2")) return false; - boolean r; - Marker m = enter_section_(b, l, _AND_); - r = declaration_lookahead(b, l + 1); - exit_section_(b, l, m, r, false, null); - return r; - } - - // &declaration_lookahead - private static boolean class_declaration_start1_4(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "class_declaration_start1_4")) return false; - boolean r; - Marker m = enter_section_(b, l, _AND_); - r = declaration_lookahead(b, l + 1); + Marker m = enter_section_(b, l, _NOT_); + r = !consumeToken(b, T_LPAREN); exit_section_(b, l, m, r, false, null); return r; } /* ********************************************************** */ - // empty_modifier_list - // type_parameter_list - // [mb_nl (type_element | clear_variants_and_fail) &declaration_lookahead] - // mb_nl &declaration_lookahead - static boolean class_declaration_start2(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "class_declaration_start2")) return false; - if (!nextTokenIs(b, T_LT)) return false; - boolean r, p; - Marker m = enter_section_(b, l, _NONE_); - r = empty_modifier_list(b, l + 1); - r = r && type_parameter_list(b, l + 1); - p = r; // pin = 2 - r = r && report_error_(b, class_declaration_start2_2(b, l + 1)); - r = p && report_error_(b, mb_nl(b, l + 1)) && r; - r = p && class_declaration_start2_4(b, l + 1) && r; - exit_section_(b, l, m, r, p, null); - return r || p; - } - - // [mb_nl (type_element | clear_variants_and_fail) &declaration_lookahead] - private static boolean class_declaration_start2_2(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "class_declaration_start2_2")) return false; - class_declaration_start2_2_0(b, l + 1); - return true; - } - - // mb_nl (type_element | clear_variants_and_fail) &declaration_lookahead - private static boolean class_declaration_start2_2_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "class_declaration_start2_2_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = mb_nl(b, l + 1); - r = r && class_declaration_start2_2_0_1(b, l + 1); - r = r && class_declaration_start2_2_0_2(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - // type_element | clear_variants_and_fail - private static boolean class_declaration_start2_2_0_1(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "class_declaration_start2_2_0_1")) return false; - boolean r; - r = type_element(b, l + 1); - if (!r) r = clear_variants_and_fail(b, l + 1); - return r; - } - - // &declaration_lookahead - private static boolean class_declaration_start2_2_0_2(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "class_declaration_start2_2_0_2")) return false; - boolean r; - Marker m = enter_section_(b, l, _AND_); - r = declaration_lookahead(b, l + 1); - exit_section_(b, l, m, r, false, null); - return r; - } - - // &declaration_lookahead - private static boolean class_declaration_start2_4(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "class_declaration_start2_4")) return false; - boolean r; - Marker m = enter_section_(b, l, _AND_); - r = declaration_lookahead(b, l + 1); - exit_section_(b, l, m, r, false, null); - return r; + // declaration_type_element + static boolean class_declaration_start_after_no_modifiers2(PsiBuilder b, int l) { + return declaration_type_element(b, l + 1); } /* ********************************************************** */ - // empty_modifier_list (type_element | clear_variants_and_fail) &declaration_lookahead - static boolean class_declaration_start3(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "class_declaration_start3")) return false; + // empty_modifier_list class_declaration_start_after_no_modifiers + static boolean class_declaration_start_no_modifiers(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "class_declaration_start_no_modifiers")) return false; boolean r; Marker m = enter_section_(b); r = empty_modifier_list(b, l + 1); - r = r && class_declaration_start3_1(b, l + 1); - r = r && class_declaration_start3_2(b, l + 1); + r = r && class_declaration_start_after_no_modifiers(b, l + 1); exit_section_(b, m, null, r); return r; } - // type_element | clear_variants_and_fail - private static boolean class_declaration_start3_1(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "class_declaration_start3_1")) return false; - boolean r; - r = type_element(b, l + 1); - if (!r) r = clear_variants_and_fail(b, l + 1); - return r; - } - - // &declaration_lookahead - private static boolean class_declaration_start3_2(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "class_declaration_start3_2")) return false; - boolean r; - Marker m = enter_section_(b, l, _AND_); - r = declaration_lookahead(b, l + 1); - exit_section_(b, l, m, r, false, null); - return r; - } - /* ********************************************************** */ - // methods_tail | field_declaration + // <> static boolean class_declaration_tail(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "class_declaration_tail")) return false; + return mb_nl_group(b, l + 1, class_declaration_tail_0_0_parser_); + } + + // methods_tail | field_declaration + private static boolean class_declaration_tail_0_0(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "class_declaration_tail_0_0")) return false; boolean r; r = methods_tail(b, l + 1); if (!r) r = field_declaration(b, l + 1); @@ -2045,32 +1988,21 @@ public class GroovyBnfParser implements PsiParser, LightPsiParser { } /* ********************************************************** */ - // 'static' | empty !nl + // 'static' | !nl public static boolean class_initializer_modifier_list(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "class_initializer_modifier_list")) return false; boolean r; Marker m = enter_section_(b, l, _NONE_, MODIFIER_LIST, ""); - r = consumeToken(b, KW_STATIC); + r = consumeTokenFast(b, KW_STATIC); if (!r) r = class_initializer_modifier_list_1(b, l + 1); exit_section_(b, l, m, r, false, null); return r; } - // empty !nl + // !nl private static boolean class_initializer_modifier_list_1(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "class_initializer_modifier_list_1")) return false; boolean r; - Marker m = enter_section_(b); - r = empty(b, l + 1); - r = r && class_initializer_modifier_list_1_1(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - // !nl - private static boolean class_initializer_modifier_list_1_1(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "class_initializer_modifier_list_1_1")) return false; - boolean r; Marker m = enter_section_(b, l, _NOT_); r = !nl(b, l + 1); exit_section_(b, l, m, r, false, null); @@ -2559,28 +2491,6 @@ public class GroovyBnfParser implements PsiParser, LightPsiParser { return constructorIdentifier(b, l + 1); } - /* ********************************************************** */ - // empty_modifier_list &method_lookahead - static boolean constructor_start(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "constructor_start")) return false; - boolean r; - Marker m = enter_section_(b); - r = empty_modifier_list(b, l + 1); - r = r && constructor_start_1(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - // &method_lookahead - private static boolean constructor_start_1(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "constructor_start_1")) return false; - boolean r; - Marker m = enter_section_(b, l, _AND_); - r = method_lookahead(b, l + 1); - exit_section_(b, l, m, r, false, null); - return r; - } - /* ********************************************************** */ // 'continue' IDENTIFIER? public static boolean continue_statement(PsiBuilder b, int l) { @@ -2612,22 +2522,47 @@ public class GroovyBnfParser implements PsiParser, LightPsiParser { } /* ********************************************************** */ - // modifiers_declaration_start | no_modifiers_start - static boolean declaration_start(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "declaration_start")) return false; - boolean r; - r = modifiers_declaration_start(b, l + 1); - if (!r) r = no_modifiers_start(b, l + 1); - return r; + // non_empty_modifier_list mb_type_parameter_list mb_declaration_type_element + static boolean declaration_start_modifiers(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "declaration_start_modifiers")) return false; + boolean r, p; + Marker m = enter_section_(b, l, _NONE_); + r = non_empty_modifier_list(b, l + 1); + p = r; // pin = 1 + r = r && report_error_(b, mb_type_parameter_list(b, l + 1)); + r = p && mb_declaration_type_element(b, l + 1) && r; + exit_section_(b, l, m, r, p, null); + return r || p; } /* ********************************************************** */ - // method | variable_declaration_tail - static boolean declaration_tail(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "declaration_tail")) return false; + // (type_element | clear_variants_and_fail) &declaration_lookahead + static boolean declaration_type_element(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "declaration_type_element")) return false; boolean r; - r = method(b, l + 1); - if (!r) r = variable_declaration_tail(b, l + 1); + Marker m = enter_section_(b, l, _NONE_, null, ""); + r = declaration_type_element_0(b, l + 1); + r = r && declaration_type_element_1(b, l + 1); + exit_section_(b, l, m, r, false, null); + return r; + } + + // type_element | clear_variants_and_fail + private static boolean declaration_type_element_0(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "declaration_type_element_0")) return false; + boolean r; + r = type_element(b, l + 1); + if (!r) r = clear_variants_and_fail(b, l + 1); + return r; + } + + // &declaration_lookahead + private static boolean declaration_type_element_1(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "declaration_type_element_1")) return false; + boolean r; + Marker m = enter_section_(b, l, _AND_); + r = declaration_lookahead(b, l + 1); + exit_section_(b, l, m, r, false, null); return r; } @@ -3848,6 +3783,25 @@ public class GroovyBnfParser implements PsiParser, LightPsiParser { return r || p; } + /* ********************************************************** */ + // [mb_nl declaration_type_element] + static boolean mb_declaration_type_element(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "mb_declaration_type_element")) return false; + mb_declaration_type_element_0(b, l + 1); + return true; + } + + // mb_nl declaration_type_element + private static boolean mb_declaration_type_element_0(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "mb_declaration_type_element_0")) return false; + boolean r; + Marker m = enter_section_(b); + r = mb_nl(b, l + 1); + r = r && declaration_type_element(b, l + 1); + exit_section_(b, m, null, r); + return r; + } + /* ********************************************************** */ // ['=' mb_nl expression_or_application] static boolean mb_initializer(PsiBuilder b, int l) { @@ -3917,6 +3871,25 @@ public class GroovyBnfParser implements PsiParser, LightPsiParser { return true; } + /* ********************************************************** */ + // [mb_nl type_parameter_list] + static boolean mb_type_parameter_list(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "mb_type_parameter_list")) return false; + mb_type_parameter_list_0(b, l + 1); + return true; + } + + // mb_nl type_parameter_list + private static boolean mb_type_parameter_list_0(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "mb_type_parameter_list_0")) return false; + boolean r; + Marker m = enter_section_(b); + r = mb_nl(b, l + 1); + r = r && type_parameter_list(b, l + 1); + exit_section_(b, m, null, r); + return r; + } + /* ********************************************************** */ // method_identifier parse_parameter_list nl_throws [mb_nl lazy_block] public static boolean method(PsiBuilder b, int l) { @@ -4062,91 +4035,6 @@ public class GroovyBnfParser implements PsiParser, LightPsiParser { return r; } - /* ********************************************************** */ - // non_empty_modifier_list [mb_nl type_parameter_list] (mb_nl (type_element &declaration_lookahead | &declaration_lookahead)) - static boolean modifiers_declaration_start(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "modifiers_declaration_start")) return false; - boolean r, p; - Marker m = enter_section_(b, l, _NONE_); - r = non_empty_modifier_list(b, l + 1); - p = r; // pin = 1 - r = r && report_error_(b, modifiers_declaration_start_1(b, l + 1)); - r = p && modifiers_declaration_start_2(b, l + 1) && r; - exit_section_(b, l, m, r, p, null); - return r || p; - } - - // [mb_nl type_parameter_list] - private static boolean modifiers_declaration_start_1(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "modifiers_declaration_start_1")) return false; - modifiers_declaration_start_1_0(b, l + 1); - return true; - } - - // mb_nl type_parameter_list - private static boolean modifiers_declaration_start_1_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "modifiers_declaration_start_1_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = mb_nl(b, l + 1); - r = r && type_parameter_list(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - // mb_nl (type_element &declaration_lookahead | &declaration_lookahead) - private static boolean modifiers_declaration_start_2(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "modifiers_declaration_start_2")) return false; - boolean r; - Marker m = enter_section_(b); - r = mb_nl(b, l + 1); - r = r && modifiers_declaration_start_2_1(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - // type_element &declaration_lookahead | &declaration_lookahead - private static boolean modifiers_declaration_start_2_1(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "modifiers_declaration_start_2_1")) return false; - boolean r; - Marker m = enter_section_(b); - r = modifiers_declaration_start_2_1_0(b, l + 1); - if (!r) r = modifiers_declaration_start_2_1_1(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - // type_element &declaration_lookahead - private static boolean modifiers_declaration_start_2_1_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "modifiers_declaration_start_2_1_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = type_element(b, l + 1); - r = r && modifiers_declaration_start_2_1_0_1(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - // &declaration_lookahead - private static boolean modifiers_declaration_start_2_1_0_1(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "modifiers_declaration_start_2_1_0_1")) return false; - boolean r; - Marker m = enter_section_(b, l, _AND_); - r = declaration_lookahead(b, l + 1); - exit_section_(b, l, m, r, false, null); - return r; - } - - // &declaration_lookahead - private static boolean modifiers_declaration_start_2_1_1(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "modifiers_declaration_start_2_1_1")) return false; - boolean r; - Marker m = enter_section_(b, l, _AND_); - r = declaration_lookahead(b, l + 1); - exit_section_(b, l, m, r, false, null); - return r; - } - /* ********************************************************** */ // tuple tuple_initializer static boolean multi_tuple_assignment(PsiBuilder b, int l) { @@ -4161,6 +4049,28 @@ public class GroovyBnfParser implements PsiParser, LightPsiParser { return r || p; } + /* ********************************************************** */ + // empty_modifier_list &method_lookahead + static boolean naked_method_declaration_start(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "naked_method_declaration_start")) return false; + boolean r; + Marker m = enter_section_(b); + r = empty_modifier_list(b, l + 1); + r = r && naked_method_declaration_start_1(b, l + 1); + exit_section_(b, m, null, r); + return r; + } + + // &method_lookahead + private static boolean naked_method_declaration_start_1(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "naked_method_declaration_start_1")) return false; + boolean r; + Marker m = enter_section_(b, l, _AND_); + r = method_lookahead(b, l + 1); + exit_section_(b, l, m, r, false, null); + return r; + } + /* ********************************************************** */ // argument_label named_argument_tail public static boolean named_argument(PsiBuilder b, int l) { @@ -4299,38 +4209,6 @@ public class GroovyBnfParser implements PsiParser, LightPsiParser { return r; } - /* ********************************************************** */ - // empty_modifier_list (capital_type_element | clear_variants_and_fail) &declaration_lookahead - static boolean no_modifiers_start(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "no_modifiers_start")) return false; - boolean r; - Marker m = enter_section_(b); - r = empty_modifier_list(b, l + 1); - r = r && no_modifiers_start_1(b, l + 1); - r = r && no_modifiers_start_2(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - // capital_type_element | clear_variants_and_fail - private static boolean no_modifiers_start_1(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "no_modifiers_start_1")) return false; - boolean r; - r = capital_type_element(b, l + 1); - if (!r) r = clear_variants_and_fail(b, l + 1); - return r; - } - - // &declaration_lookahead - private static boolean no_modifiers_start_2(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "no_modifiers_start_2")) return false; - boolean r; - Marker m = enter_section_(b, l, _AND_); - r = declaration_lookahead(b, l + 1); - exit_section_(b, l, m, r, false, null); - return r; - } - /* ********************************************************** */ // <> static boolean no_type_args_code_reference(PsiBuilder b, int l) { @@ -4855,13 +4733,13 @@ public class GroovyBnfParser implements PsiParser, LightPsiParser { /* ********************************************************** */ // <> - // | <> - static boolean parse_annotation_member(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "parse_annotation_member")) return false; + // | <> + static boolean parse_annotation_declaration(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "parse_annotation_declaration")) return false; boolean r; Marker m = enter_section_(b); r = parseTailLeftFlat(b, l + 1, class_declaration_start_parser_, annotation_tails_parser_); - if (!r) r = parseTailLeftFlat(b, l + 1, constructor_start_parser_, annotation_method_parser_); + if (!r) r = parseTailLeftFlat(b, l + 1, naked_method_declaration_start_parser_, annotation_method_parser_); exit_section_(b, m, null, r); return r; } @@ -4873,9 +4751,9 @@ public class GroovyBnfParser implements PsiParser, LightPsiParser { } /* ********************************************************** */ - // <> + // <> static boolean parse_block_declaration(PsiBuilder b, int l) { - return parseTailLeftFlat(b, l + 1, declaration_start_parser_, declaration_tail_parser_); + return parseTailLeftFlat(b, l + 1, block_declaration_start_parser_, block_declaration_tail_parser_); } /* ********************************************************** */ @@ -4886,13 +4764,13 @@ public class GroovyBnfParser implements PsiParser, LightPsiParser { /* ********************************************************** */ // <> - // | <> + // | <> static boolean parse_class_declaration(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "parse_class_declaration")) return false; boolean r; Marker m = enter_section_(b); r = parseTailLeftFlat(b, l + 1, class_declaration_start_parser_, class_declaration_tail_parser_); - if (!r) r = parseTailLeftFlat(b, l + 1, constructor_start_parser_, methods_tail_parser_); + if (!r) r = parseTailLeftFlat(b, l + 1, naked_method_declaration_start_parser_, methods_tail_parser_); exit_section_(b, m, null, r); return r; } @@ -7357,6 +7235,11 @@ public class GroovyBnfParser implements PsiParser, LightPsiParser { return annotation(b, l + 1); } }; + final static Parser annotation_tails_0_0_parser_ = new Parser() { + public boolean parse(PsiBuilder b, int l) { + return annotation_tails_0_0(b, l + 1); + } + }; final static Parser annotation_tails_parser_ = new Parser() { public boolean parse(PsiBuilder b, int l) { return annotation_tails(b, l + 1); @@ -7397,6 +7280,21 @@ public class GroovyBnfParser implements PsiParser, LightPsiParser { return argument(b, l + 1); } }; + final static Parser block_declaration_start_parser_ = new Parser() { + public boolean parse(PsiBuilder b, int l) { + return block_declaration_start(b, l + 1); + } + }; + final static Parser block_declaration_tail_0_0_parser_ = new Parser() { + public boolean parse(PsiBuilder b, int l) { + return block_declaration_tail_0_0(b, l + 1); + } + }; + final static Parser block_declaration_tail_parser_ = new Parser() { + public boolean parse(PsiBuilder b, int l) { + return block_declaration_tail(b, l + 1); + } + }; final static Parser block_level_end_parser_ = new Parser() { public boolean parse(PsiBuilder b, int l) { return block_level_end(b, l + 1); @@ -7447,6 +7345,11 @@ public class GroovyBnfParser implements PsiParser, LightPsiParser { return class_declaration_start(b, l + 1); } }; + final static Parser class_declaration_tail_0_0_parser_ = new Parser() { + public boolean parse(PsiBuilder b, int l) { + return class_declaration_tail_0_0(b, l + 1); + } + }; final static Parser class_declaration_tail_parser_ = new Parser() { public boolean parse(PsiBuilder b, int l) { return class_declaration_tail(b, l + 1); @@ -7492,21 +7395,6 @@ public class GroovyBnfParser implements PsiParser, LightPsiParser { return constructor_block(b, l + 1); } }; - final static Parser constructor_start_parser_ = new Parser() { - public boolean parse(PsiBuilder b, int l) { - return constructor_start(b, l + 1); - } - }; - final static Parser declaration_start_parser_ = new Parser() { - public boolean parse(PsiBuilder b, int l) { - return declaration_start(b, l + 1); - } - }; - final static Parser declaration_tail_parser_ = new Parser() { - public boolean parse(PsiBuilder b, int l) { - return declaration_tail(b, l + 1); - } - }; final static Parser expression_or_application_inner_parser_ = new Parser() { public boolean parse(PsiBuilder b, int l) { return expression_or_application_inner(b, l + 1); @@ -7567,6 +7455,11 @@ public class GroovyBnfParser implements PsiParser, LightPsiParser { return methods_tail(b, l + 1); } }; + final static Parser naked_method_declaration_start_parser_ = new Parser() { + public boolean parse(PsiBuilder b, int l) { + return naked_method_declaration_start(b, l + 1); + } + }; final static Parser non_empty_modifier_list_0_0_parser_ = new Parser() { public boolean parse(PsiBuilder b, int l) { return non_empty_modifier_list_0_0(b, l + 1); diff --git a/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/parser/groovy.bnf b/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/parser/groovy.bnf index 1526f4cb0e7d..a5badad0a3ac 100644 --- a/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/parser/groovy.bnf +++ b/plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/parser/groovy.bnf @@ -345,43 +345,45 @@ private enum_constants_separated ::= enum_constants class_level_end { pin = 1 } private annotation_members ::= annotation_level_item* private annotation_level_item ::= <> -private annotation_level ::= type_definition | parse_annotation_member +private annotation_level ::= type_definition | parse_annotation_declaration +// endregion + + +// region Declarations +private declaration_start_modifiers ::= non_empty_modifier_list mb_type_parameter_list mb_declaration_type_element { pin = 1 } +private mb_type_parameter_list ::= [mb_nl type_parameter_list] +private mb_declaration_type_element ::= [mb_nl declaration_type_element] +private declaration_type_element ::= (type_element | clear_variants_and_fail) &declaration_lookahead + +private declaration_lookahead ::= method_lookahead | IDENTIFIER { consumeTokenMethod = 'consumeTokenFast' } +private method_lookahead ::= method_identifier '(' // endregion // region Class level declarations private parse_class_declaration ::= <> - | <> -private class_declaration_start ::= class_declaration_start1 | class_declaration_start2 | class_declaration_start3 -private class_declaration_tail ::= methods_tail | field_declaration + | <> +private class_declaration_start ::= declaration_start_modifiers | class_declaration_start_no_modifiers + +private class_declaration_start_no_modifiers ::= empty_modifier_list class_declaration_start_after_no_modifiers +private class_declaration_start_after_no_modifiers ::= class_declaration_start_after_no_modifiers1 + | class_declaration_start_after_no_modifiers2 +private class_declaration_start_after_no_modifiers1 ::= capital_type_element !'(' +private class_declaration_start_after_no_modifiers2 ::= declaration_type_element +private naked_method_declaration_start ::= empty_modifier_list &method_lookahead + +private class_declaration_tail ::= <> private methods_tail ::= constructor | method -private class_declaration_start1 ::= non_empty_modifier_list - [mb_nl type_parameter_list] - [mb_nl (type_element | clear_variants_and_fail) &declaration_lookahead] - mb_nl &declaration_lookahead -{ - pin = 1 -} -private class_declaration_start2 ::= empty_modifier_list - type_parameter_list - [mb_nl (type_element | clear_variants_and_fail) &declaration_lookahead] - mb_nl &declaration_lookahead -{ - pin = 2 -} -private class_declaration_start3 ::= empty_modifier_list (type_element | clear_variants_and_fail) &declaration_lookahead -private constructor_start ::= empty_modifier_list &method_lookahead - -private parse_annotation_member ::= <> - | <> -private annotation_tails ::= annotation_method | field_declaration +private parse_annotation_declaration ::= <> + | <> +private annotation_tails ::= <> // endregion // region Class initializers class_initializer ::= class_initializer_modifier_list mb_nl lazy_block -class_initializer_modifier_list ::= 'static' | empty !nl +class_initializer_modifier_list ::= 'static' | !nl { consumeTokenMethod = 'consumeTokenFast' } // endregion @@ -431,7 +433,6 @@ annotation_method ::= method_identifier parse_parameter_list [mb_nl annotation_m } private annotation_method_default ::= 'default' annotation_value { pin = 1 } -private method_lookahead ::= method_identifier '(' private method_identifier ::= IDENTIFIER | STR_SQ | STR_DQ { consumeTokenMethod = 'consumeTokenFast' } private constructor_identifier ::= <> // endregion @@ -591,13 +592,11 @@ private case_level_end ::= block_level_end | &('case' | 'default') // region Block level declarations fake variable_declaration ::= { elementTypeClass = 'org.jetbrains.plugins.groovy.lang.psi.stubs.elements.GrVariableDeclarationElementType' } -private parse_block_declaration ::= <> -private declaration_start ::= modifiers_declaration_start | no_modifiers_start - -private modifiers_declaration_start ::= non_empty_modifier_list [mb_nl type_parameter_list] (mb_nl (type_element &declaration_lookahead | &declaration_lookahead)) { pin = 1 } -private no_modifiers_start ::= empty_modifier_list (capital_type_element | clear_variants_and_fail) &declaration_lookahead -private declaration_lookahead ::= method_lookahead | IDENTIFIER { consumeTokenMethod = 'consumeTokenFast' } -private declaration_tail ::= method | variable_declaration_tail +private parse_block_declaration ::= <> +private block_declaration_start ::= declaration_start_modifiers | block_declaration_start_no_modifiers +private block_declaration_start_no_modifiers ::= empty_modifier_list block_declaration_type_element +private block_declaration_type_element ::= (capital_type_element | clear_variants_and_fail) &declaration_lookahead +private block_declaration_tail ::= <> variable_declaration_tail ::= variable (',' mb_nl variable)* { diff --git a/plugins/groovy/test/org/jetbrains/plugins/groovy/completion/GroovyClassNameCompletionTest.groovy b/plugins/groovy/test/org/jetbrains/plugins/groovy/completion/GroovyClassNameCompletionTest.groovy index 2bfd94d1b5ab..ca98a3878feb 100644 --- a/plugins/groovy/test/org/jetbrains/plugins/groovy/completion/GroovyClassNameCompletionTest.groovy +++ b/plugins/groovy/test/org/jetbrains/plugins/groovy/completion/GroovyClassNameCompletionTest.groovy @@ -1,4 +1,4 @@ -// Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. +// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package org.jetbrains.plugins.groovy.completion @@ -36,6 +36,8 @@ class GroovyClassNameCompletionTest extends LightCodeInsightFixtureTestCase { void testInFieldDeclaration() throws Exception { doTest() } + void testInFieldDeclarationNoModifiers() throws Exception { doTest() } + void testInParameter() throws Exception { doTest() } void testInImport() throws Exception { diff --git a/plugins/groovy/test/org/jetbrains/plugins/groovy/completion/GroovyCompletionTest.groovy b/plugins/groovy/test/org/jetbrains/plugins/groovy/completion/GroovyCompletionTest.groovy index 5e7d3b722907..7695787ec493 100644 --- a/plugins/groovy/test/org/jetbrains/plugins/groovy/completion/GroovyCompletionTest.groovy +++ b/plugins/groovy/test/org/jetbrains/plugins/groovy/completion/GroovyCompletionTest.groovy @@ -11,7 +11,6 @@ import com.intellij.codeInsight.lookup.LookupElement import com.intellij.codeInsight.lookup.LookupElementPresentation import com.intellij.codeInsight.lookup.PsiTypeLookupItem import com.intellij.idea.Bombed -import com.intellij.psi.codeStyle.CodeStyleSettingsManager import com.intellij.psi.statistics.StatisticsManager import com.intellij.psi.statistics.impl.StatisticsManagerImpl import com.intellij.psi.util.PsiTreeUtil @@ -21,6 +20,7 @@ import org.jetbrains.plugins.groovy.codeStyle.GrReferenceAdjuster import org.jetbrains.plugins.groovy.codeStyle.GroovyCodeStyleSettings import org.jetbrains.plugins.groovy.lang.psi.api.types.GrCodeReferenceElement import org.jetbrains.plugins.groovy.util.TestUtils + /** * @author Maxim.Medvedev */ @@ -995,12 +995,10 @@ println "abcd" void testMakingDefFromAssignment() { checkCompletion 'int defInt; defoo = 2', 'f ', "int defInt; def foo = 2" } - @Bombed(month = 6, day = 10, user = "daniil") void testEnumPropertyType() { checkSingleItemCompletion 'enum Foo {a,b; static List>', "enum Foo {a,b; static List>" } - @Bombed(month = 6, day = 10, user = "daniil") void testEnumPropertyType2() { checkSingleItemCompletion 'enum Foo {a,b; static List', "enum Foo {a,b; static List" } diff --git a/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/parser/StatementsParsingTest.groovy b/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/parser/StatementsParsingTest.groovy index c0d65abc33dc..5150aa867f88 100644 --- a/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/parser/StatementsParsingTest.groovy +++ b/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/parser/StatementsParsingTest.groovy @@ -412,6 +412,8 @@ class StatementsParsingTest extends GroovyParsingTestCase { void testVardef$vardeferrsingle4() throws Throwable { doTest() } + void testVardef$newlineAfterModifiers() { doTest() } + void testWith$with1() throws Throwable { doTest() } void testWith$with2() throws Throwable { doTest() } diff --git a/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/parser/TypesParsingTest.groovy b/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/parser/TypesParsingTest.groovy index 447ca826246e..475e1bf3fe3e 100644 --- a/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/parser/TypesParsingTest.groovy +++ b/plugins/groovy/test/org/jetbrains/plugins/groovy/lang/parser/TypesParsingTest.groovy @@ -89,4 +89,38 @@ class TypesParsingTest extends GroovyParsingTestCase { void testEmptyTypeArgs() { doTest() } void testIncompleteConstructor() { doTest() } + + void testmembers$identifierOnly() { doTest() } + + void testmembers$capitalIdentifierOnly() { doTest() } + + void testmembers$constructorIdentifierOnly() { doTest() } + + void testmembers$modifierListOnly() { doTest() } + + void testmembers$modifierListAndIdentifier() { doTest() } + + void testmembers$modifierListAndCapitalIdentifier() { doTest() } + + void testmembers$modifierListAndConstructorIdentifier() { doTest() } + + void testmembers$modifierListAndTypeParameters() { doTest() } + + void testmembers$modifierListTypeParametersAndIdentifier() { doTest() } + + void testmembers$modifierListTypeParametersAndCapitalIdentifier() { doTest() } + + void testmembers$modifierListTypeParametersAndConstructorIdentifier() { doTest() } + + void testmembers$modifierListTypeParametersIdentifierAndLeftParen() { doTest() } + + void testmembers$modifierListTypeParametersCapitalIdentifierAndLeftParen() { doTest() } + + void testmembers$modifierListTypeParametersConstructorIdentifierAndLeftParen() { doTest() } + + void testmembers$capitalIdentifierAndLeftParen() { doTest() } + + void testmembers$constructorIdentifierAndLeftParen() { doTest() } + + void testmembers$identifierAndLeftParen() { doTest() } } \ No newline at end of file diff --git a/plugins/groovy/testdata/groovy/completion/classNameCompletion/InFieldDeclarationNoModifiers.groovy b/plugins/groovy/testdata/groovy/completion/classNameCompletion/InFieldDeclarationNoModifiers.groovy new file mode 100644 index 000000000000..ac7f393a7525 --- /dev/null +++ b/plugins/groovy/testdata/groovy/completion/classNameCompletion/InFieldDeclarationNoModifiers.groovy @@ -0,0 +1,3 @@ +class Test { + FoBa +} \ No newline at end of file diff --git a/plugins/groovy/testdata/groovy/completion/classNameCompletion/InFieldDeclarationNoModifiers_after.groovy b/plugins/groovy/testdata/groovy/completion/classNameCompletion/InFieldDeclarationNoModifiers_after.groovy new file mode 100644 index 000000000000..aac07dc63ca1 --- /dev/null +++ b/plugins/groovy/testdata/groovy/completion/classNameCompletion/InFieldDeclarationNoModifiers_after.groovy @@ -0,0 +1,5 @@ +import a.FooBar + +class Test { + FooBar +} \ No newline at end of file diff --git a/plugins/groovy/testdata/parsing/groovy/statements/unnamedField.test b/plugins/groovy/testdata/parsing/groovy/statements/unnamedField.test index 11d8a6cc3e47..24d163483ae7 100644 --- a/plugins/groovy/testdata/parsing/groovy/statements/unnamedField.test +++ b/plugins/groovy/testdata/parsing/groovy/statements/unnamedField.test @@ -19,7 +19,7 @@ Groovy script PsiWhiteSpace('\n ') Modifiers PsiElement(def)('def') - PsiElement(new line)('\n') - PsiErrorElement:identifier expected, got '}' + PsiErrorElement:identifier expected + PsiElement(new line)('\n') PsiElement(})('}') \ No newline at end of file diff --git a/plugins/groovy/testdata/parsing/groovy/statements/vardef/newlineAfterModifiers.test b/plugins/groovy/testdata/parsing/groovy/statements/vardef/newlineAfterModifiers.test new file mode 100644 index 000000000000..ca1eb6ca59c3 --- /dev/null +++ b/plugins/groovy/testdata/parsing/groovy/statements/vardef/newlineAfterModifiers.test @@ -0,0 +1,15 @@ +@Anno +var +----- +Groovy script + Variable definitions + Modifiers + Annotation + PsiElement(@)('@') + Reference element + PsiElement(identifier)('Anno') + Annotation arguments + + PsiElement(new line)('\n') + Variable + PsiElement(identifier)('var') \ No newline at end of file diff --git a/plugins/groovy/testdata/parsing/groovy/types/members/capitalIdentifierAndLeftParen.test b/plugins/groovy/testdata/parsing/groovy/types/members/capitalIdentifierAndLeftParen.test new file mode 100644 index 000000000000..dace4fdf9320 --- /dev/null +++ b/plugins/groovy/testdata/parsing/groovy/types/members/capitalIdentifierAndLeftParen.test @@ -0,0 +1,31 @@ +class A { + Foo( +} +----- +Groovy script + Class definition + Modifiers + + PsiElement(class)('class') + PsiWhiteSpace(' ') + PsiElement(identifier)('A') + Extends clause + + Implements clause + + PsiWhiteSpace(' ') + Type definition body + PsiElement({)('{') + PsiWhiteSpace('\n ') + Method + Modifiers + + PsiElement(identifier)('Foo') + PsiElement(()('(') + PsiWhiteSpace('\n') + Parameter list + PsiErrorElement:')' or identifier expected, got '}' + + Throw clause + + PsiElement(})('}') \ No newline at end of file diff --git a/plugins/groovy/testdata/parsing/groovy/types/members/capitalIdentifierOnly.test b/plugins/groovy/testdata/parsing/groovy/types/members/capitalIdentifierOnly.test new file mode 100644 index 000000000000..fb0931b5d12f --- /dev/null +++ b/plugins/groovy/testdata/parsing/groovy/types/members/capitalIdentifierOnly.test @@ -0,0 +1,28 @@ +class A { + Foo +} +----- +Groovy script + Class definition + Modifiers + + PsiElement(class)('class') + PsiWhiteSpace(' ') + PsiElement(identifier)('A') + Extends clause + + Implements clause + + PsiWhiteSpace(' ') + Type definition body + PsiElement({)('{') + PsiWhiteSpace('\n ') + Modifiers + + Type element + Reference element + PsiElement(identifier)('Foo') + PsiErrorElement:identifier expected + + PsiElement(new line)('\n') + PsiElement(})('}') \ No newline at end of file diff --git a/plugins/groovy/testdata/parsing/groovy/types/members/constructorIdentifierAndLeftParen.test b/plugins/groovy/testdata/parsing/groovy/types/members/constructorIdentifierAndLeftParen.test new file mode 100644 index 000000000000..d5c3a0647e09 --- /dev/null +++ b/plugins/groovy/testdata/parsing/groovy/types/members/constructorIdentifierAndLeftParen.test @@ -0,0 +1,31 @@ +class A { + A( +} +----- +Groovy script + Class definition + Modifiers + + PsiElement(class)('class') + PsiWhiteSpace(' ') + PsiElement(identifier)('A') + Extends clause + + Implements clause + + PsiWhiteSpace(' ') + Type definition body + PsiElement({)('{') + PsiWhiteSpace('\n ') + Constructor + Modifiers + + PsiElement(identifier)('A') + PsiElement(()('(') + PsiWhiteSpace('\n') + Parameter list + PsiErrorElement:')' or identifier expected, got '}' + + Throw clause + + PsiElement(})('}') \ No newline at end of file diff --git a/plugins/groovy/testdata/parsing/groovy/types/members/constructorIdentifierOnly.test b/plugins/groovy/testdata/parsing/groovy/types/members/constructorIdentifierOnly.test new file mode 100644 index 000000000000..0625726bdfad --- /dev/null +++ b/plugins/groovy/testdata/parsing/groovy/types/members/constructorIdentifierOnly.test @@ -0,0 +1,28 @@ +class A { + A +} +----- +Groovy script + Class definition + Modifiers + + PsiElement(class)('class') + PsiWhiteSpace(' ') + PsiElement(identifier)('A') + Extends clause + + Implements clause + + PsiWhiteSpace(' ') + Type definition body + PsiElement({)('{') + PsiWhiteSpace('\n ') + Modifiers + + Type element + Reference element + PsiElement(identifier)('A') + PsiErrorElement:identifier expected + + PsiElement(new line)('\n') + PsiElement(})('}') \ No newline at end of file diff --git a/plugins/groovy/testdata/parsing/groovy/types/members/identifierAndLeftParen.test b/plugins/groovy/testdata/parsing/groovy/types/members/identifierAndLeftParen.test new file mode 100644 index 000000000000..e0a7183ac93d --- /dev/null +++ b/plugins/groovy/testdata/parsing/groovy/types/members/identifierAndLeftParen.test @@ -0,0 +1,31 @@ +class A { + foo( +} +----- +Groovy script + Class definition + Modifiers + + PsiElement(class)('class') + PsiWhiteSpace(' ') + PsiElement(identifier)('A') + Extends clause + + Implements clause + + PsiWhiteSpace(' ') + Type definition body + PsiElement({)('{') + PsiWhiteSpace('\n ') + Method + Modifiers + + PsiElement(identifier)('foo') + PsiElement(()('(') + PsiWhiteSpace('\n') + Parameter list + PsiErrorElement:')' or identifier expected, got '}' + + Throw clause + + PsiElement(})('}') \ No newline at end of file diff --git a/plugins/groovy/testdata/parsing/groovy/types/members/identifierOnly.test b/plugins/groovy/testdata/parsing/groovy/types/members/identifierOnly.test new file mode 100644 index 000000000000..08143038d79c --- /dev/null +++ b/plugins/groovy/testdata/parsing/groovy/types/members/identifierOnly.test @@ -0,0 +1,24 @@ +class A { + foo +} +----- +Groovy script + Class definition + Modifiers + + PsiElement(class)('class') + PsiWhiteSpace(' ') + PsiElement(identifier)('A') + Extends clause + + Implements clause + + PsiWhiteSpace(' ') + Type definition body + PsiElement({)('{') + PsiWhiteSpace('\n ') + PsiElement(identifier)('foo') + PsiErrorElement:'(' expected + + PsiElement(new line)('\n') + PsiElement(})('}') \ No newline at end of file diff --git a/plugins/groovy/testdata/parsing/groovy/types/members/modifierListAndCapitalIdentifier.test b/plugins/groovy/testdata/parsing/groovy/types/members/modifierListAndCapitalIdentifier.test new file mode 100644 index 000000000000..1a538a00afbd --- /dev/null +++ b/plugins/groovy/testdata/parsing/groovy/types/members/modifierListAndCapitalIdentifier.test @@ -0,0 +1,29 @@ +class A { + final static Foo +} +----- +Groovy script + Class definition + Modifiers + + PsiElement(class)('class') + PsiWhiteSpace(' ') + PsiElement(identifier)('A') + Extends clause + + Implements clause + + PsiWhiteSpace(' ') + Type definition body + PsiElement({)('{') + PsiWhiteSpace('\n ') + Variable definitions + Modifiers + PsiElement(final)('final') + PsiWhiteSpace(' ') + PsiElement(static)('static') + PsiWhiteSpace(' ') + Field + PsiElement(identifier)('Foo') + PsiElement(new line)('\n') + PsiElement(})('}') \ No newline at end of file diff --git a/plugins/groovy/testdata/parsing/groovy/types/members/modifierListAndConstructorIdentifier.test b/plugins/groovy/testdata/parsing/groovy/types/members/modifierListAndConstructorIdentifier.test new file mode 100644 index 000000000000..1e8a37c1c48c --- /dev/null +++ b/plugins/groovy/testdata/parsing/groovy/types/members/modifierListAndConstructorIdentifier.test @@ -0,0 +1,29 @@ +class A { + final static A +} +----- +Groovy script + Class definition + Modifiers + + PsiElement(class)('class') + PsiWhiteSpace(' ') + PsiElement(identifier)('A') + Extends clause + + Implements clause + + PsiWhiteSpace(' ') + Type definition body + PsiElement({)('{') + PsiWhiteSpace('\n ') + Variable definitions + Modifiers + PsiElement(final)('final') + PsiWhiteSpace(' ') + PsiElement(static)('static') + PsiWhiteSpace(' ') + Field + PsiElement(identifier)('A') + PsiElement(new line)('\n') + PsiElement(})('}') \ No newline at end of file diff --git a/plugins/groovy/testdata/parsing/groovy/types/members/modifierListAndIdentifier.test b/plugins/groovy/testdata/parsing/groovy/types/members/modifierListAndIdentifier.test new file mode 100644 index 000000000000..1171e9a4e5db --- /dev/null +++ b/plugins/groovy/testdata/parsing/groovy/types/members/modifierListAndIdentifier.test @@ -0,0 +1,29 @@ +class A { + final static foo +} +----- +Groovy script + Class definition + Modifiers + + PsiElement(class)('class') + PsiWhiteSpace(' ') + PsiElement(identifier)('A') + Extends clause + + Implements clause + + PsiWhiteSpace(' ') + Type definition body + PsiElement({)('{') + PsiWhiteSpace('\n ') + Variable definitions + Modifiers + PsiElement(final)('final') + PsiWhiteSpace(' ') + PsiElement(static)('static') + PsiWhiteSpace(' ') + Field + PsiElement(identifier)('foo') + PsiElement(new line)('\n') + PsiElement(})('}') \ No newline at end of file diff --git a/plugins/groovy/testdata/parsing/groovy/types/members/modifierListAndTypeParameters.test b/plugins/groovy/testdata/parsing/groovy/types/members/modifierListAndTypeParameters.test new file mode 100644 index 000000000000..69171d8e221a --- /dev/null +++ b/plugins/groovy/testdata/parsing/groovy/types/members/modifierListAndTypeParameters.test @@ -0,0 +1,35 @@ +class A { + final static +} +----- +Groovy script + Class definition + Modifiers + + PsiElement(class)('class') + PsiWhiteSpace(' ') + PsiElement(identifier)('A') + Extends clause + + Implements clause + + PsiWhiteSpace(' ') + Type definition body + PsiElement({)('{') + PsiWhiteSpace('\n ') + Modifiers + PsiElement(final)('final') + PsiWhiteSpace(' ') + PsiElement(static)('static') + PsiWhiteSpace(' ') + Type parameter list + PsiElement(<)('<') + Type parameter + PsiElement(identifier)('T') + Type extends bounds list + + PsiElement(>)('>') + PsiErrorElement:identifier expected + + PsiElement(new line)('\n') + PsiElement(})('}') \ No newline at end of file diff --git a/plugins/groovy/testdata/parsing/groovy/types/members/modifierListOnly.test b/plugins/groovy/testdata/parsing/groovy/types/members/modifierListOnly.test new file mode 100644 index 000000000000..e0884652e16e --- /dev/null +++ b/plugins/groovy/testdata/parsing/groovy/types/members/modifierListOnly.test @@ -0,0 +1,27 @@ +class A { + final static +} +----- +Groovy script + Class definition + Modifiers + + PsiElement(class)('class') + PsiWhiteSpace(' ') + PsiElement(identifier)('A') + Extends clause + + Implements clause + + PsiWhiteSpace(' ') + Type definition body + PsiElement({)('{') + PsiWhiteSpace('\n ') + Modifiers + PsiElement(final)('final') + PsiWhiteSpace(' ') + PsiElement(static)('static') + PsiErrorElement:identifier expected + + PsiElement(new line)('\n') + PsiElement(})('}') \ No newline at end of file diff --git a/plugins/groovy/testdata/parsing/groovy/types/members/modifierListTypeParametersAndCapitalIdentifier.test b/plugins/groovy/testdata/parsing/groovy/types/members/modifierListTypeParametersAndCapitalIdentifier.test new file mode 100644 index 000000000000..6b244e8c0994 --- /dev/null +++ b/plugins/groovy/testdata/parsing/groovy/types/members/modifierListTypeParametersAndCapitalIdentifier.test @@ -0,0 +1,37 @@ +class A { + final static Foo +} +----- +Groovy script + Class definition + Modifiers + + PsiElement(class)('class') + PsiWhiteSpace(' ') + PsiElement(identifier)('A') + Extends clause + + Implements clause + + PsiWhiteSpace(' ') + Type definition body + PsiElement({)('{') + PsiWhiteSpace('\n ') + Variable definitions + Modifiers + PsiElement(final)('final') + PsiWhiteSpace(' ') + PsiElement(static)('static') + PsiWhiteSpace(' ') + Type parameter list + PsiElement(<)('<') + Type parameter + PsiElement(identifier)('T') + Type extends bounds list + + PsiElement(>)('>') + PsiWhiteSpace(' ') + Field + PsiElement(identifier)('Foo') + PsiElement(new line)('\n') + PsiElement(})('}') \ No newline at end of file diff --git a/plugins/groovy/testdata/parsing/groovy/types/members/modifierListTypeParametersAndConstructorIdentifier.test b/plugins/groovy/testdata/parsing/groovy/types/members/modifierListTypeParametersAndConstructorIdentifier.test new file mode 100644 index 000000000000..bea8523dbdc5 --- /dev/null +++ b/plugins/groovy/testdata/parsing/groovy/types/members/modifierListTypeParametersAndConstructorIdentifier.test @@ -0,0 +1,37 @@ +class A { + final static A +} +----- +Groovy script + Class definition + Modifiers + + PsiElement(class)('class') + PsiWhiteSpace(' ') + PsiElement(identifier)('A') + Extends clause + + Implements clause + + PsiWhiteSpace(' ') + Type definition body + PsiElement({)('{') + PsiWhiteSpace('\n ') + Variable definitions + Modifiers + PsiElement(final)('final') + PsiWhiteSpace(' ') + PsiElement(static)('static') + PsiWhiteSpace(' ') + Type parameter list + PsiElement(<)('<') + Type parameter + PsiElement(identifier)('T') + Type extends bounds list + + PsiElement(>)('>') + PsiWhiteSpace(' ') + Field + PsiElement(identifier)('A') + PsiElement(new line)('\n') + PsiElement(})('}') \ No newline at end of file diff --git a/plugins/groovy/testdata/parsing/groovy/types/members/modifierListTypeParametersAndIdentifier.test b/plugins/groovy/testdata/parsing/groovy/types/members/modifierListTypeParametersAndIdentifier.test new file mode 100644 index 000000000000..b8355874d169 --- /dev/null +++ b/plugins/groovy/testdata/parsing/groovy/types/members/modifierListTypeParametersAndIdentifier.test @@ -0,0 +1,37 @@ +class A { + final static foo +} +----- +Groovy script + Class definition + Modifiers + + PsiElement(class)('class') + PsiWhiteSpace(' ') + PsiElement(identifier)('A') + Extends clause + + Implements clause + + PsiWhiteSpace(' ') + Type definition body + PsiElement({)('{') + PsiWhiteSpace('\n ') + Variable definitions + Modifiers + PsiElement(final)('final') + PsiWhiteSpace(' ') + PsiElement(static)('static') + PsiWhiteSpace(' ') + Type parameter list + PsiElement(<)('<') + Type parameter + PsiElement(identifier)('T') + Type extends bounds list + + PsiElement(>)('>') + PsiWhiteSpace(' ') + Field + PsiElement(identifier)('foo') + PsiElement(new line)('\n') + PsiElement(})('}') \ No newline at end of file diff --git a/plugins/groovy/testdata/parsing/groovy/types/members/modifierListTypeParametersCapitalIdentifierAndLeftParen.test b/plugins/groovy/testdata/parsing/groovy/types/members/modifierListTypeParametersCapitalIdentifierAndLeftParen.test new file mode 100644 index 000000000000..c62aa012e935 --- /dev/null +++ b/plugins/groovy/testdata/parsing/groovy/types/members/modifierListTypeParametersCapitalIdentifierAndLeftParen.test @@ -0,0 +1,42 @@ +class A { + final static Foo( +} +----- +Groovy script + Class definition + Modifiers + + PsiElement(class)('class') + PsiWhiteSpace(' ') + PsiElement(identifier)('A') + Extends clause + + Implements clause + + PsiWhiteSpace(' ') + Type definition body + PsiElement({)('{') + PsiWhiteSpace('\n ') + Method + Modifiers + PsiElement(final)('final') + PsiWhiteSpace(' ') + PsiElement(static)('static') + PsiWhiteSpace(' ') + Type parameter list + PsiElement(<)('<') + Type parameter + PsiElement(identifier)('T') + Type extends bounds list + + PsiElement(>)('>') + PsiWhiteSpace(' ') + PsiElement(identifier)('Foo') + PsiElement(()('(') + PsiWhiteSpace('\n') + Parameter list + PsiErrorElement:')' or identifier expected, got '}' + + Throw clause + + PsiElement(})('}') \ No newline at end of file diff --git a/plugins/groovy/testdata/parsing/groovy/types/members/modifierListTypeParametersConstructorIdentifierAndLeftParen.test b/plugins/groovy/testdata/parsing/groovy/types/members/modifierListTypeParametersConstructorIdentifierAndLeftParen.test new file mode 100644 index 000000000000..a31edc97633f --- /dev/null +++ b/plugins/groovy/testdata/parsing/groovy/types/members/modifierListTypeParametersConstructorIdentifierAndLeftParen.test @@ -0,0 +1,42 @@ +class A { + final static A( +} +----- +Groovy script + Class definition + Modifiers + + PsiElement(class)('class') + PsiWhiteSpace(' ') + PsiElement(identifier)('A') + Extends clause + + Implements clause + + PsiWhiteSpace(' ') + Type definition body + PsiElement({)('{') + PsiWhiteSpace('\n ') + Constructor + Modifiers + PsiElement(final)('final') + PsiWhiteSpace(' ') + PsiElement(static)('static') + PsiWhiteSpace(' ') + Type parameter list + PsiElement(<)('<') + Type parameter + PsiElement(identifier)('T') + Type extends bounds list + + PsiElement(>)('>') + PsiWhiteSpace(' ') + PsiElement(identifier)('A') + PsiElement(()('(') + PsiWhiteSpace('\n') + Parameter list + PsiErrorElement:')' or identifier expected, got '}' + + Throw clause + + PsiElement(})('}') \ No newline at end of file diff --git a/plugins/groovy/testdata/parsing/groovy/types/members/modifierListTypeParametersIdentifierAndLeftParen.test b/plugins/groovy/testdata/parsing/groovy/types/members/modifierListTypeParametersIdentifierAndLeftParen.test new file mode 100644 index 000000000000..3e5fd22c3ad7 --- /dev/null +++ b/plugins/groovy/testdata/parsing/groovy/types/members/modifierListTypeParametersIdentifierAndLeftParen.test @@ -0,0 +1,42 @@ +class A { + final static foo( +} +----- +Groovy script + Class definition + Modifiers + + PsiElement(class)('class') + PsiWhiteSpace(' ') + PsiElement(identifier)('A') + Extends clause + + Implements clause + + PsiWhiteSpace(' ') + Type definition body + PsiElement({)('{') + PsiWhiteSpace('\n ') + Method + Modifiers + PsiElement(final)('final') + PsiWhiteSpace(' ') + PsiElement(static)('static') + PsiWhiteSpace(' ') + Type parameter list + PsiElement(<)('<') + Type parameter + PsiElement(identifier)('T') + Type extends bounds list + + PsiElement(>)('>') + PsiWhiteSpace(' ') + PsiElement(identifier)('foo') + PsiElement(()('(') + PsiWhiteSpace('\n') + Parameter list + PsiErrorElement:')' or identifier expected, got '}' + + Throw clause + + PsiElement(})('}') \ No newline at end of file