read_label Subroutine

private pure subroutine read_label(text, label)

Set label to the value of text, unless that is not a statement label. This is not an internal read, because it runs in parallel, where those take a lock in the runtime library.

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: text

the label

integer, intent(inout) :: label

its value, or as it was


Called by

proc~~read_label~~CalledByGraph proc~read_label read_label proc~classify_statement classify_statement proc~classify_statement->proc~read_label proc~analyze_structure analyze_structure proc~analyze_structure->proc~classify_statement proc~format_pass format_pass proc~format_pass->proc~analyze_structure proc~format_text format_text proc~format_text->proc~format_pass proc~relayout relayout proc~format_text->proc~relayout proc~relayout->proc~format_pass proc~process_text process_text proc~process_text->proc~format_text proc~process_file process_file proc~process_file->proc~process_text proc~process_stdin process_stdin proc~process_stdin->proc~process_text proc~run run proc~run->proc~process_file proc~run->proc~process_stdin

Source Code

pure subroutine read_label(text, label)
    !! Set `label` to the value of `text`, unless that is not a statement label. This is not an internal
    !! `read`, because it runs in parallel, where those take a lock in the runtime library.
    character(len=*), intent(in) :: text    !! the label
    integer, intent(inout) :: label         !! its value, or as it was
    integer :: k, n, value

    n = len_trim(text)
    if (n == 0 .or. n > 9) return
    value = 0
    do k = 1, n
        if (text(k:k) < '0' .or. text(k:k) > '9') return
        value = 10*value + iachar(text(k:k)) - iachar('0')
    end do
    label = value
end subroutine read_label