@ -61,6 +61,8 @@ The designer will still be shipped with PMD's binaries.
|
||||
* [#1701](https://github.com/pmd/pmd/issues/1701): \[java] UseTryWithResources does not handle multiple argument close methods
|
||||
* java-codestyle
|
||||
* [#1674](https://github.com/pmd/pmd/issues/1674): \[java] documentation of CommentDefaultAccessModifier is wrong
|
||||
* plsql
|
||||
* [#1731](https://github.com/pmd/pmd/issues/1731): \[pslql] ParseException when parsing ELSIF
|
||||
|
||||
### API Changes
|
||||
|
||||
|
@ -2085,7 +2085,7 @@ ASTElseClause ElseClause() :
|
||||
ASTElsifClause ElsifClause() :
|
||||
{}
|
||||
{
|
||||
<ELSIF> Expression() <THEN> (Statement())+
|
||||
<ELSIF> Expression() <THEN> (LOOKAHEAD(1, {!(getToken(1).kind == ELSIF)}) Statement())+
|
||||
{ return jjtThis ; }
|
||||
}
|
||||
|
||||
@ -2280,7 +2280,7 @@ ASTWhileStatement WhileStatement() :
|
||||
ASTIfStatement IfStatement() :
|
||||
{}
|
||||
{
|
||||
<IF> Expression() <THEN> (Statement())+
|
||||
<IF> Expression() <THEN> (LOOKAHEAD(1, {!(getToken(1).kind == ELSIF)}) Statement())+
|
||||
( ElsifClause() {jjtThis.setHasElse();} )*
|
||||
[ ElseClause() {jjtThis.setHasElse();} ]
|
||||
<END> <IF>
|
||||
@ -6095,7 +6095,6 @@ ASTID ID(): {}
|
||||
//| <DISTINCT> //RESERVED WORD
|
||||
| <DO>
|
||||
| <DROP> //RESERVED WORD
|
||||
//| <ELSE> //SYNTAX //RESERVED WORD
|
||||
| <ELSIF> //SYNTAX
|
||||
|
||||
//| <END> |<CURRENT_USER>
|
||||
@ -6339,7 +6338,6 @@ ASTQualifiedID QualifiedID(): {}
|
||||
//<DISTINCT>
|
||||
| <DO>
|
||||
//<DROP>
|
||||
//<ELSE>
|
||||
| <ELSIF>
|
||||
//<END>
|
||||
//<EXCEPTION>
|
||||
|
@ -0,0 +1,20 @@
|
||||
/**
|
||||
* BSD-style license; for more info see http://pmd.sourceforge.net/license.html
|
||||
*/
|
||||
|
||||
package net.sourceforge.pmd.lang.plsql.ast;
|
||||
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
import net.sourceforge.pmd.lang.plsql.AbstractPLSQLParserTst;
|
||||
|
||||
public class IfStatementTest extends AbstractPLSQLParserTst {
|
||||
|
||||
@Test
|
||||
public void parseIfWithElseIf() throws Exception {
|
||||
String code = "BEGIN\nIF 1 = 1 THEN null;\nELSIF (2 = 2) THEN null;\nELSE null;\nEND IF;\nEND;\n/\n";
|
||||
ASTInput input = parsePLSQL(code);
|
||||
Assert.assertNotNull(input);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user