TypeCobol
TypeCobol copied to clipboard
During a replace the Scanner use a text with original column lost
Describe the bug
LINK WITH #2217
Method ScanIsolatedToken
in the Scanner
receive a string which contains the text without the original spaces before the text. It means the new token generated is align to the left. The original column is lost. It means we cannot check the Area of declaration.
To Reproduce Cobol code that cause the bug : (if any)
IDENTIFICATION DIVISION.
PROGRAM-ID. MyPgm.
procedure division.
REPLACE ==:-MAJ:== BY ====.
PERFORM EACGAPEL-C0001:-MAJ:.
.
END PROGRAM MyPgm.
ScanIsolatedToken
will receive string
EACGAPEL-C0001
not
EACGAPEL-C0001
Expected behavior The original column of the text to scan is not lost.
Technical Add spaces before the text to rescan so the column is preserved.
How to test automatically
We need a test in the Scanner that rely on the column.
We could do that to detect paragraph
and section token
.
The sample provided does not show any problem on develop. We'll have to find a new test case where the bug is shown or close this issue (?)