File tree 2 files changed +13
-1
lines changed
main/antlr4/org/eclipse/lsp/cobol/core/parser
test/java/org/eclipse/lsp/cobol/usecases/sql
2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ procedureDivisionRules: ((dbs_allocate | dbs_alter | dbs_associate | dbs_call |
24
24
dbs_label | dbs_lock | dbs_merge | dbs_open | dbs_prepare | dbs_refresh | dbs_release | dbs_rename |
25
25
dbs_revoke | dbs_rollback | dbs_savepoint | dbs_select | dbs_set | dbs_signal | dbs_transfer | dbs_truncate |
26
26
dbs_update | dbs_values | dbs_whenever) dbs_semicolon_end?)+ EOF ;
27
- rulesAllowedInDataDivision : ((dbs_declare_cursor | dbs_declare_table | dbs_include) dbs_semicolon_end?)+;
27
+ rulesAllowedInDataDivision : ((dbs_declare_cursor | dbs_whenever | dbs_declare_table | dbs_include) dbs_semicolon_end?)+;
28
28
rulesAllowedInWorkingStorageAndLinkageSection : ((dbs_begin | dbs_end | dbs_include_sqlca | dbs_include_sqlda) dbs_semicolon_end?)+;
29
29
30
30
// used in working-storage section of cobol program
Original file line number Diff line number Diff line change 23
23
* Test EXEC SQL in data definition section
24
24
*/
25
25
class TestSqlExecInDataSection {
26
+ private static final String TEXT_WHENEVER = " IDENTIFICATION DIVISION.\n "
27
+ + " PROGRAM-ID. WE.\n "
28
+ + " ENVIRONMENT DIVISION.\n "
29
+ + " DATA DIVISION.\n "
30
+ + " WORKING-STORAGE SECTION.\n "
31
+ + " EXEC SQL \n "
32
+ + " WHENEVER SQLERROR GO TO 1000-ABEND-RTN \n " // FIXME 1000-ABEND-RTN should cause an error
33
+ + " END-EXEC." ;
26
34
private static final String TEXT = " IDENTIFICATION DIVISION.\n "
27
35
+ " PROGRAM-ID. SQLISSUE.\n "
28
36
+ " ENVIRONMENT DIVISION.\n "
@@ -41,4 +49,8 @@ class TestSqlExecInDataSection {
41
49
void test () {
42
50
UseCaseEngine .runTest (TEXT , ImmutableList .of (), ImmutableMap .of ());
43
51
}
52
+ @ Test
53
+ void testWhenever () {
54
+ UseCaseEngine .runTest (TEXT_WHENEVER , ImmutableList .of (), ImmutableMap .of ());
55
+ }
44
56
}
You can’t perform that action at this time.
0 commit comments