-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request pmd#3928 from LiGaOg:master
[plsql] Fix plsql parsing error in parenthesis groups pmd#3928
- Loading branch information
Showing
11 changed files
with
826 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
pmd-plsql/src/test/java/net/sourceforge/pmd/lang/plsql/ast/ParenthesisGroupTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/** | ||
* BSD-style license; for more info see http://pmd.sourceforge.net/license.html | ||
*/ | ||
|
||
package net.sourceforge.pmd.lang.plsql.ast; | ||
|
||
import org.junit.Test; | ||
|
||
import net.sourceforge.pmd.lang.ast.test.BaseParsingHelper; | ||
import net.sourceforge.pmd.lang.ast.test.BaseTreeDumpTest; | ||
import net.sourceforge.pmd.lang.ast.test.RelevantAttributePrinter; | ||
import net.sourceforge.pmd.lang.plsql.PlsqlParsingHelper; | ||
|
||
public class ParenthesisGroupTest extends BaseTreeDumpTest { | ||
|
||
public ParenthesisGroupTest() { | ||
super(new RelevantAttributePrinter(), ".pls"); | ||
} | ||
|
||
@Override | ||
public BaseParsingHelper<?, ?> getParser() { | ||
return PlsqlParsingHelper.WITH_PROCESSING.withResourceContext(getClass()); | ||
} | ||
|
||
@Test | ||
public void parseParenthesisGroup0() { | ||
doTest("ParenthesisGroup0"); | ||
} | ||
|
||
@Test | ||
public void parseParenthesisGroup1() { | ||
doTest("ParenthesisGroup1"); | ||
} | ||
|
||
@Test | ||
public void parseParenthesisGroup2() { | ||
doTest("ParenthesisGroup2"); | ||
} | ||
|
||
} |
21 changes: 21 additions & 0 deletions
21
pmd-plsql/src/test/resources/net/sourceforge/pmd/lang/plsql/ast/ParenthesisGroup0.pls
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
CREATE OR REPLACE PROCEDURE EXAMPLE_PROCEDURE IS | ||
-- | ||
CURSOR c_example IS | ||
SELECT a.owner, u.object_name, p.aggregate | ||
FROM (USER_OBJECTS u) INNER JOIN (ALL_OBJECTS a) ON | ||
u.object_name = a.object_name AND u.object_type = a.object_type AND u.object_id = a.object_id | ||
INNER JOIN (ALL_PROCEDURES p) ON | ||
p.owner = a.owner AND p.object_name = a.object_name AND p.object_type = a.object_type | ||
WHERE a.owner = USER; | ||
-- | ||
BEGIN | ||
-- | ||
FOR l_object IN c_example LOOP | ||
-- | ||
DBMS_OUTPUT.Put_Line(l_object.owner); | ||
DBMS_OUTPUT.Put_Line(l_object.object_name); | ||
DBMS_OUTPUT.Put_Line(l_object.aggregate); | ||
-- | ||
END LOOP; | ||
-- | ||
END EXAMPLE_PROCEDURE; |
250 changes: 250 additions & 0 deletions
250
pmd-plsql/src/test/resources/net/sourceforge/pmd/lang/plsql/ast/ParenthesisGroup0.txt
Large diffs are not rendered by default.
Oops, something went wrong.
21 changes: 21 additions & 0 deletions
21
pmd-plsql/src/test/resources/net/sourceforge/pmd/lang/plsql/ast/ParenthesisGroup1.pls
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
CREATE OR REPLACE PROCEDURE EXAMPLE_PROCEDURE IS | ||
-- | ||
CURSOR c_example IS | ||
SELECT a.owner, u.object_name, p.aggregate | ||
FROM (((USER_OBJECTS u) INNER JOIN (ALL_OBJECTS a) ON | ||
u.object_name = a.object_name AND u.object_type = a.object_type AND u.object_id = a.object_id) | ||
INNER JOIN (ALL_PROCEDURES p) ON | ||
p.owner = a.owner AND p.object_name = a.object_name AND p.object_type = a.object_type) | ||
WHERE a.owner = USER; | ||
-- | ||
BEGIN | ||
-- | ||
FOR l_object IN c_example LOOP | ||
-- | ||
DBMS_OUTPUT.Put_Line(l_object.owner); | ||
DBMS_OUTPUT.Put_Line(l_object.object_name); | ||
DBMS_OUTPUT.Put_Line(l_object.aggregate); | ||
-- | ||
END LOOP; | ||
-- | ||
END EXAMPLE_PROCEDURE; |
Oops, something went wrong.