forked from jasder/antlr
Explicit greedy option overrides implicit greedy option
This commit is contained in:
parent
65793adfc8
commit
39c73302f6
|
@ -622,7 +622,11 @@ public class ParserATNFactory implements ATNFactory {
|
||||||
public boolean isGreedy(@NotNull BlockAST blkAST) {
|
public boolean isGreedy(@NotNull BlockAST blkAST) {
|
||||||
boolean greedy = true;
|
boolean greedy = true;
|
||||||
String greedyOption = blkAST.getOptionString("greedy");
|
String greedyOption = blkAST.getOptionString("greedy");
|
||||||
if ( blockHasWildcardAlt(blkAST) || greedyOption!=null&&greedyOption.equals("false") ) {
|
if (greedyOption != null) {
|
||||||
|
return Boolean.parseBoolean(greedyOption);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( blockHasWildcardAlt(blkAST) ) {
|
||||||
greedy = false;
|
greedy = false;
|
||||||
}
|
}
|
||||||
return greedy;
|
return greedy;
|
||||||
|
|
Loading…
Reference in New Issue