Loading...
Searching...
No Matches
label_type

Definition

Diagnostic label identifying a region of source text.

A label highlights a specific character range within a source line and may carry an explanatory message. Labels are used to produce compiler-style diagnostics similar to those of rustc or clang.

Labels may be primary or secondary:

  • Primary labels identify the principal cause of the diagnostic.
  • Secondary labels provide additional context.

Primary labels determine the source location shown in the diagnostic header and are rendered using '^' markers.

Secondary labels are rendered using '-' markers and provide supplementary context.

Note
Character positions are 1-based. The highlighted range spans:

first <= position < finish

where finish is exclusive.

Examples

type(string) :: s
s = 'foo'

Constructors

Initializes a new instance of the label_type class Constructor

type(label_type) function string(character(*) text, integer first, integer length, (optional) integer level)
Parameters
[in]textText displayed next to the label
[in]firstPosition of the label
[in]lengthLength of the label
[in]level(optional) Level of the label

Examples

type(label_type) :: label
label = label_type('Syntax error', 5, 7)
Returns
The constructed label_type object.

Constructor

type(label_type) function label_type(integer line, character(*) text, integer first, integer length, (optional) integer level, (optional) logical primary)
Parameters
[in]lineline number for the label
[in]textText displayed next to the label
[in]firstPosition of the label
[in]lengthLength of the label
[in]level(optional) Level of the label
[in]primary.true. if the label is the primary one

Examples

type(label_type) :: label
label = label_type(1, 'Syntax error', 5, 7, level_error, .true.)
Returns
The constructed label_type object.

Definition at line 304 of file logging.f90.


The documentation for this interface was generated from the following file:

Variables

integer, allocatable level
 Level of message.
logical primary
 Primary message.
integer line
 Line number of message.
integer first
 First character of message.
integer finish
 Last character of message.
character(:), allocatable text
 Message text.