cobol.loader.picture_parser problem with precision using (#) syntax
Simple handling of numerous data file formats, even COBOL EBCDIC.
Brought to you by:
slott56
picture_parser function does not currently increment value of precision when decimal is true and c == '('
I think adding the following line before out.append( (irpt-1)*out[-1] ) would be appropriate:
if decimal: precision += irpt
correction...the above fix isn't correct.
the line SHOULD be:
if decimal: precision = irpt
To be slightly more general.
if decimal: precision += irpt
Not sure of PIC 9(5)V99(2) would ever actually happen. But.
well, that's what I thought, thus my initial recommended fix, however, precision+= irpt didn't work but precision = irpt did...I didn't do additional debugging to understand why...
Added unit test cases. Looks to be fixed.