Open NeoKaios opened 1 month ago
I report here some issues I found with the gixsql test suite:
Internal warning: unable to join locations via limits in
`Cobol_preproc__Src_overlay.join_limits`
is emitted a lot of time. For instance with TSQL001A.cbl
:
EXEC SQL found at line 51
END-EXEC found at 53
:1.22-1.29: Internal warning: unable to join locations via limits in
`Cobol_preproc__Src_overlay.join_limits`
[ctx=Sql_parser__Sql_overlay_manager-2]
:1.37-1.42: Internal warning: unable to join locations via limits in
`Cobol_preproc__Src_overlay.join_limits`
[ctx=Sql_parser__Sql_overlay_manager-2]
:1.51-1.56: Internal warning: unable to join locations via limits in
`Cobol_preproc__Src_overlay.join_limits`
[ctx=Sql_parser__Sql_overlay_manager-2]
EXEC SQL found at line 67
END-EXEC found at 69
:1.16-1.21: Internal warning: unable to join locations via limits in
`Cobol_preproc__Src_overlay.join_limits`
[ctx=Sql_parser__Sql_overlay_manager-2]
:1.35-1.37: Internal warning: unable to join locations via limits in
`Cobol_preproc__Src_overlay.join_limits`
[ctx=Sql_parser__Sql_overlay_manager-2]
:1.43-1.51: Internal warning: unable to join locations via limits in
`Cobol_preproc__Src_overlay.join_limits`
[ctx=Sql_parser__Sql_overlay_manager-2]
EXEC SQL found at line 79
END-EXEC found at 79
TSQL042A.cbsql
and TSQL009A.cbsql
too:
TSQL042A.cbsql: in paragraph '100-MAIN':
TSQL042A.cbsql:179: error: syntax error, unexpected Identifier, expecting SECTION or .
177 | SQLBOL* START TRANSACTION
178 | SQLBOL* END-EXEC.
179 > SQLBOL ENDCALL STATIC "GIXSQLStartSQL"
180 | SQLBOL ENDEND-CALL
181 | SQLBOL ENDCALL STATIC "GIXSQLExec" USING
TSQL042A.cbsql:179: note: unknown statement 'ENDCALL'
TSQL040A.cbsql
:
TSQL040A.cbsql:50: error: PROCEDURE DIVISION header missing
48 | SQLBOL* FILENAME VARCHAR(60) NOT NULL 0..
49 | SQLBOL* ) END-EXEC. 0..
50 > SQLBOL TODO.
51 | ******************************************************************0..
52 | * COBOL DECLARATION FOR TABLE AEPT.P_HISTORY_TD *0..
TSQL040A.cbsql:50: error: syntax error, unexpected Identifier
TSQL040A.cbsql:54: error: syntax error, unexpected Identifier, expecting SECTION or .
52 | * COBOL DECLARATION FOR TABLE AEPT.P_HISTORY_TD *0..
53 | ******************************************************************0..
54 > 01 DCLP-HISTORY-TD. 0..
55 | * DATAVAL 0..
56 | 10 P014-DATAVAL PIC X(10). 0..
TSQL040A.cbsql:54: note: unknown statement '01'
TSQL040A.cbsql:56: error: syntax error, unexpected Identifier, expecting SECTION or .
54 | 01 DCLP-HISTORY-TD. 0..
55 | * DATAVAL 0..
56 > 10 P014-DATAVAL PIC X(10). 0..
57 | * DATARIL 0..
58 | 10 P014-DATARIL PIC X(10). 0..
....
TSQL015A.cbsql
:
TSQL015A.cbsql:83: warning: OCCURS DEPENDING ON without TO phrase used [-Wdialect]
81 | DEPENDING ON Z-MY-ELEMENTS
82 | ASCENDING KEY IS MY-ID
83 > INDEXED BY I-TAB.
84 | 07 MY-ELEMENT.
85 | 10 MY-ID PIC 9(009) COMP-5 VALUE ZERO.
The starting point for this should be #370. And using OCamlPro Gixsql fork : https://github.com/OCamlPro/gixsql
Preproc file generation issues
cobol_indent
when there is a tabulation as a first character : TSQL009A TSQL042A This causes errors when computing the variable prefix of statementsTAB00-REC
is passed as is toGIXSQLSetSQLParams
where it should be the 3 elementary varsCID
,FLD01
andFLD02
.01 v SQL TYPE VARCHAR(100).
but it can be the case from normal COBOL variable.is_varying_len
method by adding support toCOMP-5
to usageINCLUDE
d parts of the working-storage should be accessible to (at least) theSql_typeck
module: TSQL0042A The absence of the copy file in the compilation unit cause the typeck to return an unknown type/length/flags for all variable originating from such a file, but those value are passed toGIXSQLSetSQLParams
.Grammar issues
--cobol85
is remove, a grammar error appears in test TSQL018B : apparentlyLOREM IPSUM
is a validEXEC SQL
bloc...Parser issues
VARYING
keyword not supported : TSQL022 NB the test depends on preprocess file contentEXEC SQL IGNORE
block should be handle by another preproc, (the default cobol one ?) as the token inside are to be copied as is in the generated file (I hacked a safeguard to avoid parsing such blocks) (TSQL011A)