mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[groovy] parser: update class body declarations (IDEA-191728)
This also fixes IDEA-192435.
This commit is contained in:
+251
-358
@@ -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
|
||||
// <<mb_nl_group (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;
|
||||
}
|
||||
|
||||
/* ********************************************************** */
|
||||
// <<mb_nl_group (method | variable_declaration_tail)>>
|
||||
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, "<type>");
|
||||
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
|
||||
// <<mb_nl_group (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, "<class initializer 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, "<type>");
|
||||
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;
|
||||
}
|
||||
|
||||
/* ********************************************************** */
|
||||
// <<noTypeArgsReference code_reference>>
|
||||
static boolean no_type_args_code_reference(PsiBuilder b, int l) {
|
||||
@@ -4855,13 +4733,13 @@ public class GroovyBnfParser implements PsiParser, LightPsiParser {
|
||||
|
||||
/* ********************************************************** */
|
||||
// <<parseTailLeftFlat class_declaration_start annotation_tails>>
|
||||
// | <<parseTailLeftFlat constructor_start annotation_method>>
|
||||
static boolean parse_annotation_member(PsiBuilder b, int l) {
|
||||
if (!recursion_guard_(b, l, "parse_annotation_member")) return false;
|
||||
// | <<parseTailLeftFlat naked_method_declaration_start annotation_method>>
|
||||
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 {
|
||||
}
|
||||
|
||||
/* ********************************************************** */
|
||||
// <<parseTailLeftFlat declaration_start declaration_tail>>
|
||||
// <<parseTailLeftFlat block_declaration_start block_declaration_tail>>
|
||||
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 {
|
||||
|
||||
/* ********************************************************** */
|
||||
// <<parseTailLeftFlat class_declaration_start class_declaration_tail>>
|
||||
// | <<parseTailLeftFlat constructor_start methods_tail>>
|
||||
// | <<parseTailLeftFlat naked_method_declaration_start methods_tail>>
|
||||
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);
|
||||
|
||||
@@ -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 ::= <<class_level_item annotation_level>>
|
||||
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 ::= <<parseTailLeftFlat class_declaration_start class_declaration_tail>>
|
||||
| <<parseTailLeftFlat constructor_start methods_tail>>
|
||||
private class_declaration_start ::= class_declaration_start1 | class_declaration_start2 | class_declaration_start3
|
||||
private class_declaration_tail ::= methods_tail | field_declaration
|
||||
| <<parseTailLeftFlat naked_method_declaration_start methods_tail>>
|
||||
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 ::= <<mb_nl_group (methods_tail | field_declaration)>>
|
||||
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 ::= <<parseTailLeftFlat class_declaration_start annotation_tails>>
|
||||
| <<parseTailLeftFlat constructor_start annotation_method>>
|
||||
private annotation_tails ::= annotation_method | field_declaration
|
||||
private parse_annotation_declaration ::= <<parseTailLeftFlat class_declaration_start annotation_tails>>
|
||||
| <<parseTailLeftFlat naked_method_declaration_start annotation_method>>
|
||||
private annotation_tails ::= <<mb_nl_group (annotation_method | field_declaration)>>
|
||||
// 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 ::= <<constructorIdentifier>>
|
||||
// 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 ::= <<parseTailLeftFlat declaration_start declaration_tail>>
|
||||
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 ::= <<parseTailLeftFlat block_declaration_start block_declaration_tail>>
|
||||
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 ::= <<mb_nl_group (method | variable_declaration_tail)>>
|
||||
|
||||
variable_declaration_tail ::= variable (',' mb_nl variable)*
|
||||
{
|
||||
|
||||
+3
-1
@@ -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 {
|
||||
|
||||
+1
-3
@@ -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; de<caret>foo = 2', 'f ', "int defInt; def <caret>foo = 2" }
|
||||
|
||||
@Bombed(month = 6, day = 10, user = "daniil")
|
||||
void testEnumPropertyType() {
|
||||
checkSingleItemCompletion 'enum Foo {a,b; static List<StringBui<caret>>', "enum Foo {a,b; static List<StringBuilder<caret>>"
|
||||
}
|
||||
|
||||
@Bombed(month = 6, day = 10, user = "daniil")
|
||||
void testEnumPropertyType2() {
|
||||
checkSingleItemCompletion 'enum Foo {a,b; static List<StringBui<caret>', "enum Foo {a,b; static List<StringBuilder<caret>"
|
||||
}
|
||||
|
||||
+2
@@ -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() }
|
||||
|
||||
@@ -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() }
|
||||
}
|
||||
Vendored
+3
@@ -0,0 +1,3 @@
|
||||
class Test {
|
||||
FoBa<caret>
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
import a.FooBar
|
||||
|
||||
class Test {
|
||||
FooBar<caret>
|
||||
}
|
||||
@@ -19,7 +19,7 @@ Groovy script
|
||||
PsiWhiteSpace('\n ')
|
||||
Modifiers
|
||||
PsiElement(def)('def')
|
||||
PsiElement(new line)('\n')
|
||||
PsiErrorElement:identifier expected, got '}'
|
||||
PsiErrorElement:identifier expected
|
||||
<empty list>
|
||||
PsiElement(new line)('\n')
|
||||
PsiElement(})('}')
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
@Anno
|
||||
var
|
||||
-----
|
||||
Groovy script
|
||||
Variable definitions
|
||||
Modifiers
|
||||
Annotation
|
||||
PsiElement(@)('@')
|
||||
Reference element
|
||||
PsiElement(identifier)('Anno')
|
||||
Annotation arguments
|
||||
<empty list>
|
||||
PsiElement(new line)('\n')
|
||||
Variable
|
||||
PsiElement(identifier)('var')
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
class A {
|
||||
Foo(
|
||||
}
|
||||
-----
|
||||
Groovy script
|
||||
Class definition
|
||||
Modifiers
|
||||
<empty list>
|
||||
PsiElement(class)('class')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(identifier)('A')
|
||||
Extends clause
|
||||
<empty list>
|
||||
Implements clause
|
||||
<empty list>
|
||||
PsiWhiteSpace(' ')
|
||||
Type definition body
|
||||
PsiElement({)('{')
|
||||
PsiWhiteSpace('\n ')
|
||||
Method
|
||||
Modifiers
|
||||
<empty list>
|
||||
PsiElement(identifier)('Foo')
|
||||
PsiElement(()('(')
|
||||
PsiWhiteSpace('\n')
|
||||
Parameter list
|
||||
PsiErrorElement:')' or identifier expected, got '}'
|
||||
<empty list>
|
||||
Throw clause
|
||||
<empty list>
|
||||
PsiElement(})('}')
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
class A {
|
||||
Foo
|
||||
}
|
||||
-----
|
||||
Groovy script
|
||||
Class definition
|
||||
Modifiers
|
||||
<empty list>
|
||||
PsiElement(class)('class')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(identifier)('A')
|
||||
Extends clause
|
||||
<empty list>
|
||||
Implements clause
|
||||
<empty list>
|
||||
PsiWhiteSpace(' ')
|
||||
Type definition body
|
||||
PsiElement({)('{')
|
||||
PsiWhiteSpace('\n ')
|
||||
Modifiers
|
||||
<empty list>
|
||||
Type element
|
||||
Reference element
|
||||
PsiElement(identifier)('Foo')
|
||||
PsiErrorElement:identifier expected
|
||||
<empty list>
|
||||
PsiElement(new line)('\n')
|
||||
PsiElement(})('}')
|
||||
Vendored
+31
@@ -0,0 +1,31 @@
|
||||
class A {
|
||||
A(
|
||||
}
|
||||
-----
|
||||
Groovy script
|
||||
Class definition
|
||||
Modifiers
|
||||
<empty list>
|
||||
PsiElement(class)('class')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(identifier)('A')
|
||||
Extends clause
|
||||
<empty list>
|
||||
Implements clause
|
||||
<empty list>
|
||||
PsiWhiteSpace(' ')
|
||||
Type definition body
|
||||
PsiElement({)('{')
|
||||
PsiWhiteSpace('\n ')
|
||||
Constructor
|
||||
Modifiers
|
||||
<empty list>
|
||||
PsiElement(identifier)('A')
|
||||
PsiElement(()('(')
|
||||
PsiWhiteSpace('\n')
|
||||
Parameter list
|
||||
PsiErrorElement:')' or identifier expected, got '}'
|
||||
<empty list>
|
||||
Throw clause
|
||||
<empty list>
|
||||
PsiElement(})('}')
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
class A {
|
||||
A
|
||||
}
|
||||
-----
|
||||
Groovy script
|
||||
Class definition
|
||||
Modifiers
|
||||
<empty list>
|
||||
PsiElement(class)('class')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(identifier)('A')
|
||||
Extends clause
|
||||
<empty list>
|
||||
Implements clause
|
||||
<empty list>
|
||||
PsiWhiteSpace(' ')
|
||||
Type definition body
|
||||
PsiElement({)('{')
|
||||
PsiWhiteSpace('\n ')
|
||||
Modifiers
|
||||
<empty list>
|
||||
Type element
|
||||
Reference element
|
||||
PsiElement(identifier)('A')
|
||||
PsiErrorElement:identifier expected
|
||||
<empty list>
|
||||
PsiElement(new line)('\n')
|
||||
PsiElement(})('}')
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
class A {
|
||||
foo(
|
||||
}
|
||||
-----
|
||||
Groovy script
|
||||
Class definition
|
||||
Modifiers
|
||||
<empty list>
|
||||
PsiElement(class)('class')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(identifier)('A')
|
||||
Extends clause
|
||||
<empty list>
|
||||
Implements clause
|
||||
<empty list>
|
||||
PsiWhiteSpace(' ')
|
||||
Type definition body
|
||||
PsiElement({)('{')
|
||||
PsiWhiteSpace('\n ')
|
||||
Method
|
||||
Modifiers
|
||||
<empty list>
|
||||
PsiElement(identifier)('foo')
|
||||
PsiElement(()('(')
|
||||
PsiWhiteSpace('\n')
|
||||
Parameter list
|
||||
PsiErrorElement:')' or identifier expected, got '}'
|
||||
<empty list>
|
||||
Throw clause
|
||||
<empty list>
|
||||
PsiElement(})('}')
|
||||
@@ -0,0 +1,24 @@
|
||||
class A {
|
||||
foo
|
||||
}
|
||||
-----
|
||||
Groovy script
|
||||
Class definition
|
||||
Modifiers
|
||||
<empty list>
|
||||
PsiElement(class)('class')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(identifier)('A')
|
||||
Extends clause
|
||||
<empty list>
|
||||
Implements clause
|
||||
<empty list>
|
||||
PsiWhiteSpace(' ')
|
||||
Type definition body
|
||||
PsiElement({)('{')
|
||||
PsiWhiteSpace('\n ')
|
||||
PsiElement(identifier)('foo')
|
||||
PsiErrorElement:'(' expected
|
||||
<empty list>
|
||||
PsiElement(new line)('\n')
|
||||
PsiElement(})('}')
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
class A {
|
||||
final static Foo
|
||||
}
|
||||
-----
|
||||
Groovy script
|
||||
Class definition
|
||||
Modifiers
|
||||
<empty list>
|
||||
PsiElement(class)('class')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(identifier)('A')
|
||||
Extends clause
|
||||
<empty list>
|
||||
Implements clause
|
||||
<empty list>
|
||||
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(})('}')
|
||||
Vendored
+29
@@ -0,0 +1,29 @@
|
||||
class A {
|
||||
final static A
|
||||
}
|
||||
-----
|
||||
Groovy script
|
||||
Class definition
|
||||
Modifiers
|
||||
<empty list>
|
||||
PsiElement(class)('class')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(identifier)('A')
|
||||
Extends clause
|
||||
<empty list>
|
||||
Implements clause
|
||||
<empty list>
|
||||
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(})('}')
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
class A {
|
||||
final static foo
|
||||
}
|
||||
-----
|
||||
Groovy script
|
||||
Class definition
|
||||
Modifiers
|
||||
<empty list>
|
||||
PsiElement(class)('class')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(identifier)('A')
|
||||
Extends clause
|
||||
<empty list>
|
||||
Implements clause
|
||||
<empty list>
|
||||
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(})('}')
|
||||
+35
@@ -0,0 +1,35 @@
|
||||
class A {
|
||||
final static <T>
|
||||
}
|
||||
-----
|
||||
Groovy script
|
||||
Class definition
|
||||
Modifiers
|
||||
<empty list>
|
||||
PsiElement(class)('class')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(identifier)('A')
|
||||
Extends clause
|
||||
<empty list>
|
||||
Implements clause
|
||||
<empty list>
|
||||
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
|
||||
<empty list>
|
||||
PsiElement(>)('>')
|
||||
PsiErrorElement:identifier expected
|
||||
<empty list>
|
||||
PsiElement(new line)('\n')
|
||||
PsiElement(})('}')
|
||||
@@ -0,0 +1,27 @@
|
||||
class A {
|
||||
final static
|
||||
}
|
||||
-----
|
||||
Groovy script
|
||||
Class definition
|
||||
Modifiers
|
||||
<empty list>
|
||||
PsiElement(class)('class')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(identifier)('A')
|
||||
Extends clause
|
||||
<empty list>
|
||||
Implements clause
|
||||
<empty list>
|
||||
PsiWhiteSpace(' ')
|
||||
Type definition body
|
||||
PsiElement({)('{')
|
||||
PsiWhiteSpace('\n ')
|
||||
Modifiers
|
||||
PsiElement(final)('final')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(static)('static')
|
||||
PsiErrorElement:identifier expected
|
||||
<empty list>
|
||||
PsiElement(new line)('\n')
|
||||
PsiElement(})('}')
|
||||
+37
@@ -0,0 +1,37 @@
|
||||
class A {
|
||||
final static <T> Foo
|
||||
}
|
||||
-----
|
||||
Groovy script
|
||||
Class definition
|
||||
Modifiers
|
||||
<empty list>
|
||||
PsiElement(class)('class')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(identifier)('A')
|
||||
Extends clause
|
||||
<empty list>
|
||||
Implements clause
|
||||
<empty list>
|
||||
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
|
||||
<empty list>
|
||||
PsiElement(>)('>')
|
||||
PsiWhiteSpace(' ')
|
||||
Field
|
||||
PsiElement(identifier)('Foo')
|
||||
PsiElement(new line)('\n')
|
||||
PsiElement(})('}')
|
||||
+37
@@ -0,0 +1,37 @@
|
||||
class A {
|
||||
final static <T> A
|
||||
}
|
||||
-----
|
||||
Groovy script
|
||||
Class definition
|
||||
Modifiers
|
||||
<empty list>
|
||||
PsiElement(class)('class')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(identifier)('A')
|
||||
Extends clause
|
||||
<empty list>
|
||||
Implements clause
|
||||
<empty list>
|
||||
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
|
||||
<empty list>
|
||||
PsiElement(>)('>')
|
||||
PsiWhiteSpace(' ')
|
||||
Field
|
||||
PsiElement(identifier)('A')
|
||||
PsiElement(new line)('\n')
|
||||
PsiElement(})('}')
|
||||
Vendored
+37
@@ -0,0 +1,37 @@
|
||||
class A {
|
||||
final static <T> foo
|
||||
}
|
||||
-----
|
||||
Groovy script
|
||||
Class definition
|
||||
Modifiers
|
||||
<empty list>
|
||||
PsiElement(class)('class')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(identifier)('A')
|
||||
Extends clause
|
||||
<empty list>
|
||||
Implements clause
|
||||
<empty list>
|
||||
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
|
||||
<empty list>
|
||||
PsiElement(>)('>')
|
||||
PsiWhiteSpace(' ')
|
||||
Field
|
||||
PsiElement(identifier)('foo')
|
||||
PsiElement(new line)('\n')
|
||||
PsiElement(})('}')
|
||||
+42
@@ -0,0 +1,42 @@
|
||||
class A {
|
||||
final static <T> Foo(
|
||||
}
|
||||
-----
|
||||
Groovy script
|
||||
Class definition
|
||||
Modifiers
|
||||
<empty list>
|
||||
PsiElement(class)('class')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(identifier)('A')
|
||||
Extends clause
|
||||
<empty list>
|
||||
Implements clause
|
||||
<empty list>
|
||||
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
|
||||
<empty list>
|
||||
PsiElement(>)('>')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(identifier)('Foo')
|
||||
PsiElement(()('(')
|
||||
PsiWhiteSpace('\n')
|
||||
Parameter list
|
||||
PsiErrorElement:')' or identifier expected, got '}'
|
||||
<empty list>
|
||||
Throw clause
|
||||
<empty list>
|
||||
PsiElement(})('}')
|
||||
+42
@@ -0,0 +1,42 @@
|
||||
class A {
|
||||
final static <T> A(
|
||||
}
|
||||
-----
|
||||
Groovy script
|
||||
Class definition
|
||||
Modifiers
|
||||
<empty list>
|
||||
PsiElement(class)('class')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(identifier)('A')
|
||||
Extends clause
|
||||
<empty list>
|
||||
Implements clause
|
||||
<empty list>
|
||||
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
|
||||
<empty list>
|
||||
PsiElement(>)('>')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(identifier)('A')
|
||||
PsiElement(()('(')
|
||||
PsiWhiteSpace('\n')
|
||||
Parameter list
|
||||
PsiErrorElement:')' or identifier expected, got '}'
|
||||
<empty list>
|
||||
Throw clause
|
||||
<empty list>
|
||||
PsiElement(})('}')
|
||||
+42
@@ -0,0 +1,42 @@
|
||||
class A {
|
||||
final static <T> foo(
|
||||
}
|
||||
-----
|
||||
Groovy script
|
||||
Class definition
|
||||
Modifiers
|
||||
<empty list>
|
||||
PsiElement(class)('class')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(identifier)('A')
|
||||
Extends clause
|
||||
<empty list>
|
||||
Implements clause
|
||||
<empty list>
|
||||
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
|
||||
<empty list>
|
||||
PsiElement(>)('>')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(identifier)('foo')
|
||||
PsiElement(()('(')
|
||||
PsiWhiteSpace('\n')
|
||||
Parameter list
|
||||
PsiErrorElement:')' or identifier expected, got '}'
|
||||
<empty list>
|
||||
Throw clause
|
||||
<empty list>
|
||||
PsiElement(})('}')
|
||||
Reference in New Issue
Block a user