TypeCobol icon indicating copy to clipboard operation
TypeCobol copied to clipboard

During a replace the Scanner use a text with original column lost

Open smedilol opened this issue 2 years ago • 1 comments

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.

smedilol avatar Apr 22 '22 12:04 smedilol

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 (?)

fm-117 avatar Oct 12 '22 13:10 fm-117