@ -16,6 +16,9 @@ This is a {{ site.pmd.release_type }} release.
|
||||
|
||||
### Fixed Issues
|
||||
|
||||
* plsql
|
||||
* [#1828](https://github.com/pmd/pmd/issues/1828): \[plsql] Parentheses stopped working
|
||||
|
||||
### API Changes
|
||||
|
||||
### External Contributions
|
||||
|
@ -1440,11 +1440,11 @@ ASTCompoundCondition CompoundCondition() :
|
||||
{}
|
||||
{
|
||||
(
|
||||
LOOKAHEAD(3) "(" Condition() ")" (LOOKAHEAD(2) ( <AND> | <OR> ) { jjtThis.setType(token.getImage()); } Condition() )*
|
||||
LOOKAHEAD(1) "(" Condition() ")" (LOOKAHEAD(2) ( <AND> | <OR> ) { jjtThis.setType(token.getImage()); } Condition() )*
|
||||
|
|
||||
LOOKAHEAD(3) <NOT> { jjtThis.setType(token.getImage()); } Condition()
|
||||
LOOKAHEAD(1) <NOT> { jjtThis.setType(token.getImage()); } Condition()
|
||||
|
|
||||
LOOKAHEAD(3) Condition2() (LOOKAHEAD(2) ( <AND> | <OR> ) { jjtThis.setType(token.getImage()); } Condition() )*
|
||||
Condition2() (LOOKAHEAD(2) ( <AND> | <OR> ) { jjtThis.setType(token.getImage()); } Condition() )*
|
||||
)
|
||||
{ return jjtThis; }
|
||||
}
|
||||
|
@ -104,4 +104,11 @@ public class WhereClauseTest extends AbstractPLSQLParserTst {
|
||||
StandardCharsets.UTF_8);
|
||||
ASTInput input = parsePLSQL(code);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testParentheses() throws Exception {
|
||||
String code = IOUtils.toString(this.getClass().getResourceAsStream("WhereClauseParens.pls"),
|
||||
StandardCharsets.UTF_8);
|
||||
parsePLSQL(code);
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,14 @@
|
||||
--
|
||||
-- Where Clause With Parentheses
|
||||
-- See https://github.com/pmd/pmd/issues/1828
|
||||
--
|
||||
|
||||
BEGIN
|
||||
|
||||
select *
|
||||
from dual
|
||||
where (dummy = X or 1 = 2)
|
||||
and 1=1;
|
||||
|
||||
END;
|
||||
/
|
Reference in New Issue
Block a user