Skip to content

Commit

Permalink
Fix parsing of MATCH statement in console
Browse files Browse the repository at this point in the history
Resolves: #8414
  • Loading branch information
luigidellaquila committed Jul 19, 2018
1 parent 3111a61 commit 6832971
Showing 1 changed file with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ public String nextCommand() {
case RIGHT_BRAKET:
result.append(c);
nestingLevel--;
if (nestingLevel <= 0) {
if (nestingLevel <= 0 && !isMatch(result)) {
return result.toString().trim();
}
break;
Expand Down Expand Up @@ -266,6 +266,17 @@ public String nextCommand() {
}
}

private boolean isMatch(StringBuilder result) {
String cmd = result.toString().trim();
if (cmd.length() < 6) {
return false;
}
if (cmd.substring(0, 6).equalsIgnoreCase("match ")) {
return true;
}
return false;
}

@Override
public void close() {
try {
Expand Down

0 comments on commit 6832971

Please sign in to comment.