In some cases (reported in SQL scanner but to be confirmed in Cobol scanner), the scanner may be stuck in an infinte loop creating empty tokens and not advancing its index.
While this should not happen, it is safer to protect against empty tokens.
Example code reproducing the problem:
IDENTIFICATION DIVISION.
PROGRAM-ID. UnsupportedBySqlScanner.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 WS-DATE-FIN PIC X(10).
PROCEDURE DIVISION.
EXEC SQL
SELECT * FROM PROJECTS
* KO: operator '<' is not supported by SQL scanner
WHERE DATE_FIN < :WS-DATE-FIN
END-EXEC
END PROGRAM UnsupportedBySqlScanner.
In some cases (reported in SQL scanner but to be confirmed in Cobol scanner), the scanner may be stuck in an infinte loop creating empty tokens and not advancing its index.
While this should not happen, it is safer to protect against empty tokens.
Example code reproducing the problem: