File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
subprojects/groovy-groovysh/src/main/groovy/org/apache/groovy/groovysh/jline Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -111,15 +111,15 @@ public enum Format {
111
111
private static final String BASE_REGEX_VAR = "[\\ p{L}_$][\\ p{L}\\ p{N}_$]*" ;
112
112
private static final String REGEX_VAR = "(" + BASE_REGEX_VAR + ")" ;
113
113
private static final String METHOD_REGEX_VAR = "(" + BASE_REGEX_VAR + "|\" (?:[^\" \\ \\ ]|\\ \\ .)*\" )" ;
114
- private static final String ANNOTATIONS = "((?:@(?!interface)(?:[\\ p{L}_$][\\ p{L}\\ p{N}_$]*\\ .)*[\\ p{L}_$][\\ p{L}\\ p{N}_$]*(?:\\ ([^)]*\\ ))?\\ s*)*\\ s+)?" ;
114
+ private static final String ANNOTATIONS = "(?: (?:@(?!interface)(?:[\\ p{L}_$][\\ p{L}\\ p{N}_$]*\\ .)*[\\ p{L}_$][\\ p{L}\\ p{N}_$]*(?:\\ ([^)]*\\ ))?\\ s*)*\\ s+)?" ;
115
115
private static final String MODIFIERS = "(?:(?:public|protected|private|abstract|final|static|sealed|non-sealed|strictfp)\\ s+)*" ;
116
116
private static final String BODY = "\\ s*(.*?\\ {.*?})(|;|\n )$" ;
117
117
private static final String PARAMS = "\\ (([\\ p{L}\\ p{N}_ ,]*)\\ )" ;
118
118
private static final Pattern PATTERN_METHOD_DEF = Pattern .compile (
119
119
"(?ms)" + ANNOTATIONS + MODIFIERS + "(?!record)" + REGEX_VAR + "\\ s+(" + METHOD_REGEX_VAR + "\\ s*" + PARAMS + ")" + BODY );
120
120
private static final Pattern PATTERN_VAR_DEF = Pattern .compile ("^\\ s*" + ANNOTATIONS + BASE_REGEX_VAR + "\\ s+" + REGEX_VAR + "\\ s*=[^=~].*" );
121
121
private static final Pattern PATTERN_TYPE_DEF =
122
- Pattern .compile ("(?ms)" + ANNOTATIONS + MODIFIERS + "((?:(?: \\ bclass|@?\\ binterface|\\ benum|\\ btrait)\\ s+" + REGEX_VAR + ") |(?:\\ brecord\\ s+" + REGEX_VAR + "\\ s*" + PARAMS + "))" + BODY );
122
+ Pattern .compile ("(?ms)" + ANNOTATIONS + MODIFIERS + "((?:\\ bclass|@?\\ binterface|\\ benum|\\ btrait)\\ s+" + REGEX_VAR + "|(?:\\ brecord\\ s+" + REGEX_VAR + "\\ s*" + PARAMS + "))" + BODY );
123
123
private static final String REGEX_CLASS = "(.*?)\\ .([A-Z_].*)" ;
124
124
private static final Pattern PATTERN_CLASS = Pattern .compile (REGEX_CLASS );
125
125
private static final String REGEX_PACKAGE = "([a-z][a-z_0-9]*\\ .)*" ;
You can’t perform that action at this time.
0 commit comments