Cobol parser continues despite lexer errors and allows literal MOVEs.
Cobol compiler now reports more errors by continuing parsing after lexer issues and permits MOVEs from literals to numeric-edited fields.
The Cobol compiler’s parser will now continue processing even if the lexer encounters errors, allowing for more comprehensive error reporting. Additionally, the compiler now permits moving a literal value to a numeric-edited data item, aligning with COBOL’s preference for late-binding and ensuring MOVE operations always succeed, with potential issues arising only when using the results.
In Details
The Cobol parser has been modified to persist in the face of lexio errors, enabling the reporting of more diagnostics. The valid_move function has been updated to allow MOVE literal TO numeric-edited, which is permissible in COBOL. This change relates to the compiler's handling of data movement and diagnostic reporting, particularly when input text preparation errors occur.
- lexer
- A component of a compiler that breaks the input source code into a sequence of tokens (lexemes). It's also known as a scanner.
- late-binding
- A programming concept where the type or behavior of an object is determined at runtime rather than at compile time. In this context, it means MOVE operations are allowed even if the destination might cause issues later.
- numeric-edited
- A data item in COBOL that has been formatted for display, typically including currency symbols, commas, or decimal points. While it appears edited, it may still be treated as numeric for certain operations.