bad_name_error Function

public function bad_name_error(error, label, name)

Arguments

Type IntentOptional AttributesName
type(error_t), intent(out), allocatable:: error

Instance of the error data

character(len=*), intent(in) :: label

Error message label to add to message

character(len=*), intent(in) :: name

name value to check

Return Value logical


Contents

Source Code


Source Code

    function bad_name_error(error, label,name)

        !> Instance of the error data
        type(error_t), allocatable, intent(out) :: error

        !> Error message label to add to message
        character(len=*), intent(in) :: label

        !> name value to check
        character(len=*), intent(in) :: name

        logical :: bad_name_error

        if(.not.is_fortran_name(to_fortran_name(name)))then
           bad_name_error=.true.
           allocate(error)
           error%message = 'manifest file syntax error: '//label//' name must be composed only of &
           &alphanumerics, "-" and "_"  and start with a letter ::'//name
        else
          bad_name_error=.false.
        endif

    end function bad_name_error