Skip to content

Commit

Permalink
Set else if then statement' parent to be else if
Browse files Browse the repository at this point in the history
  • Loading branch information
ZhengguanLi authored and lizongbo committed May 11, 2024
1 parent 70c3bcf commit b713c5a
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -686,7 +686,7 @@ public void parseStatementList(List<SQLStatement> statementList, int max, SQLObj
}

if (lexer.token() == Token.ELSIF
&& parent instanceof SQLIfStatement) {
&& (parent instanceof SQLIfStatement || parent instanceof SQLIfStatement.ElseIf)) {
break;
}

Expand Down Expand Up @@ -1165,7 +1165,7 @@ public SQLStatement parseIf() {
elseIf.setParent(stmt);

accept(Token.THEN);
this.parseStatementList(elseIf.getStatements(), -1, stmt);
this.parseStatementList(elseIf.getStatements(), -1, elseIf);

stmt.getElseIfList().add(elseIf);
}
Expand Down

0 comments on commit b713c5a

Please sign in to comment.