parser_obj_ReformatLine Subroutine

private pure subroutine parser_obj_ReformatLine(line)

Fomats a line by removing comments and replacing tabs with spaces.

Type Bound

parser_obj

Arguments

Type IntentOptional Attributes Name
character(len=MAX_LINE_SIZE), intent(inout) :: line

A line from the input file


Called by

proc~~parser_obj_reformatline~~CalledByGraph proc~parser_obj_reformatline parser_obj%parser_obj_ReformatLine proc~parser_obj_parseline parser_obj%parser_obj_ParseLine proc~parser_obj_parseline->proc~parser_obj_reformatline proc~parser_obj_parsefile parser_obj%parser_obj_ParseFile proc~parser_obj_parsefile->proc~parser_obj_parseline program~main main program~main->proc~parser_obj_parsefile

Source Code

  pure subroutine parser_obj_ReformatLine(line)
    !> Fomats a line by removing comments and replacing
    ! tabs with spaces.
    implicit none
    character(MAX_LINE_SIZE),intent(inout):: line                              !! A line from the input file
    ! Work variables
    integer :: comment_index                                                   !! Left most position of a comment symbol
    integer :: n

    ! Remove the tabs
    do n=1,MAX_LINE_SIZE
      if (ichar(line(n:n)).EQ.TAB_ICHAR) line(n:n)=' '
    end do

    ! Remove comments
    comment_index = scan(line,COMMENT_SYMBOLS)
    if (comment_index.ne.0) line(comment_index:) = ''

    ! Trim
    line = adjustl(line)

    return
  end subroutine parser_obj_ReformatLine