Explicit greedy option overrides implicit greedy option

This commit is contained in:
Sam Harwell 2012-10-14 12:10:56 -05:00
parent 65793adfc8
commit 39c73302f6
1 changed files with 5 additions and 1 deletions

View File

@ -622,7 +622,11 @@ public class ParserATNFactory implements ATNFactory {
public boolean isGreedy(@NotNull BlockAST blkAST) {
boolean greedy = true;
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;
}
return greedy;