Skip to content

Commit a919798

Browse files
committed
GROOVY-8162: Update Groovysh to JLine3 (tweak variable regex)
1 parent e878651 commit a919798

File tree

1 file changed

+2
-2
lines changed
  • subprojects/groovy-groovysh/src/main/groovy/org/apache/groovy/groovysh/jline

1 file changed

+2
-2
lines changed

subprojects/groovy-groovysh/src/main/groovy/org/apache/groovy/groovysh/jline/GroovyEngine.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,10 +108,10 @@ public enum Format {
108108
private static final String VAR_GROOVY_OPTIONS = "GROOVY_OPTIONS";
109109
private static final String DEFAULT_NANORC_SYNTAX = "classpath:/nanorc/jnanorc";
110110
private static final String REGEX_SYSTEM_VAR = "[A-Z]+[A-Z_]*";
111-
private static final String BASE_REGEX_VAR = "[\\p{L}_$][\\p{L}\\p{N}_$]+";
111+
private static final String BASE_REGEX_VAR = "[\\p{L}_$][\\p{L}\\p{N}_$]*";
112112
private static final String REGEX_VAR = "(" + BASE_REGEX_VAR + ")";
113113
private static final String METHOD_REGEX_VAR = "(" + BASE_REGEX_VAR + "|\"(?:[^\"\\\\]|\\\\.)*\")";
114-
private static final String ANNOTATIONS = "^\\s*(?:@(?!interface)(?:[\\p{L}_$][\\p{L}\\p{N}_$]*\\.)*[\\p{L}_$][\\p{L}\\p{N}_$]*(?:\\([^)]*\\))?\\s*)*";
114+
private static final String ANNOTATIONS = "((?:@(?!interface)(?:[\\p{L}_$][\\p{L}\\p{N}_$]*\\.)*[\\p{L}_$][\\p{L}\\p{N}_$]*(?:\\([^)]*\\))?\\s*)*\\s+)?";
115115
private static final String MODIFIERS = "(?:(?:public|protected|private|abstract|final|static|sealed|non-sealed|strictfp)\\s+)*";
116116
private static final String BODY = "\\s*(.*?\\{.*?})(|;|\n)$";
117117
private static final String PARAMS = "\\(([\\p{L}\\p{N}_ ,]*)\\)";

0 commit comments

Comments
 (0)