Validate and improve numeric-edited PICTURE handling in COBOL.
Enhances COBOL compiler's validation of numeric-edited PICTURE clauses and corrects MOVE/comparison handling.
This commit introduces comprehensive validation for numeric-edited PICTURE strings in the COBOL compiler, providing better error messages for incorrect formats. It also aligns the handling of MOVE operations and comparisons involving numeric-display and numeric-edited variables with ISO specifications. These changes improve the compiler’s adherence to standards and robustness when processing numeric data.
In Details
This change improves the Cobol front-end's handling of numeric-edited data items. It adds exhaustive validation for PICTURE strings used in numeric-edited variables, catching errors earlier in the compilation process. Additionally, it corrects the implementation of MOVE and comparison operations for numeric-edited types to conform to the ISO COBOL standard, ensuring correct behavior for data manipulation and comparisons.
- numeric-edited
- A COBOL data type that presents a numeric value with formatting characters (e.g., currency symbols, decimal points, commas) for display purposes. The underlying storage may be character-based or binary, depending on implementation.
- PICTURE string
- A clause in COBOL that defines the format and type of data a data item can hold. For numeric-edited items, it specifies editing symbols like '$', '.', ',', 'Z', '0', etc.
- MOVE operation
- In COBOL, this verb copies data from a sending data item to a receiving data item. The compiler must handle type conversions and editing rules during this process.