Standard-compliant handling of the #line directive.
This module implements support for the ISO C preprocessor #line directive, allowing the logical source location used by the preprocessor to be modified during preprocessing.
The directive affects the information stored in the active context object and therefore influences:
This functionality is particularly useful for:
The following standard forms are supported:
When encountered, the directive immediately updates the logical source position used for all subsequent processing.
| subroutine, public handle_line | ( | type(context), intent(inout) | ctx, |
| character(*), intent(in) | token ) |
Process a #line directive.
Parses the directive arguments, validates the requested logical line number, and updates the active context object.
Supported forms are:
The specified line number becomes the number associated with the source line immediately following the directive.
If a filename is supplied, subsequent diagnostics and predefined file-related macros use the new filename.
Invalid directives produce warnings and leave the current context unchanged.
| [in,out] | ctx | Current source context. Its logical line number and optional filename are updated in place. |
| [in] | token | Directive keyword used to identify the #line directive, typically "line". |