Closed fm-117 closed 2 months ago
More complex example for removal:
000100 IDENTIFICATION DIVISION. 00000100
000200 PROGRAM-ID. TCOMFL06. 00000200
000300 DATA DIVISION. 00000300
000400 WORKING-STORAGE SECTION. 00000400
000500 01 group1. 00000500
000600 05 target-zone PIC X(100). 00000600
000700 05 redef2 REDEFINES target-zone. 00000700
000800 10 var2-1 PIC X(50). 00000800
000900 10 var2-2 PIC X(50). 10 FILLER 00000800
000900* And a comment right in the middle of my useless FILLER ! 00000800
001000 PIC X(5). 05 other-data PIC X. 00001000
001100 PROCEDURE DIVISION. 00001100
001200 GOBACK 00001200
001300 . 00001300
001400 END PROGRAM TCOMFL06. 00001400
Describe the bug
TextEdits
produced byrefactor/adjustFillers
may break code when applied becauseAdjustFillers
does not account for line format.To Reproduce (Type)Cobol code that cause the bug : (if any)
When applying the refactoring on this document, both edits will be incorrect :
"05 var1 PIC X(100)."
, this will result in shifting the sequence number on the next line and make it exceed 80 chars."X(50)"
with"X(100)"
which is one char longer and thus will also make the line exceed 80 chars.Expected behavior Ideally all edits should produce valid code. This may be difficult to implement when there is no space left on the line to edit.
Technical Improve
AdjustFillerVisitor
in order to reduce the probability of bad edits.How to test automatically LSR tests.