File tree 1 file changed +4
-4
lines changed
reader/src/main/java/org/jline/reader
1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright (c) 2002-2020 , the original author or authors.
2
+ * Copyright (c) 2002-2021 , the original author or authors.
3
3
*
4
4
* This software is distributable under the BSD license. See the terms of the
5
5
* BSD license in the documentation provided with this software.
12
12
import java .util .regex .Pattern ;
13
13
14
14
public interface Parser {
15
- static final String REGEX_VARIABLE = "[a-zA-Z_]{1,} [a-zA-Z0-9_-]*" ;
16
- static final String REGEX_COMMAND = "[:]{0,1} [a-zA-Z]{1,} [a-zA-Z0-9_-]*" ;
15
+ String REGEX_VARIABLE = "[a-zA-Z_]+ [a-zA-Z0-9_-]*" ;
16
+ String REGEX_COMMAND = "[:]? [a-zA-Z]+ [a-zA-Z0-9_-]*" ;
17
17
18
18
ParsedLine parse (String line , int cursor , ParseContext context ) throws SyntaxError ;
19
19
@@ -34,7 +34,7 @@ default boolean validVariableName(String name) {
34
34
}
35
35
36
36
default String getCommand (final String line ) {
37
- String out = "" ;
37
+ String out ;
38
38
Pattern patternCommand = Pattern .compile ("^\\ s*" + REGEX_VARIABLE + "=(" + REGEX_COMMAND + ")(\\ s+|$)" );
39
39
Matcher matcher = patternCommand .matcher (line );
40
40
if (matcher .find ()) {
You can’t perform that action at this time.
0 commit comments