cube_add__symbol Subroutine

private pure subroutine cube_add__symbol(self, symbol)

Type Bound

cube_t

Arguments

Type IntentOptional Attributes Name
class(cube_t), intent(inout) :: self
character(len=*), intent(in) :: symbol

Source Code

   pure subroutine cube_add__symbol(self, symbol)
      implicit none
      class(cube_t), intent(inout) :: self
      character(*), intent(in) :: symbol

      integer :: cp
      cp = ichar_utf8(symbol)
      if (cp == -1) return ! WARNING: magic nubmer
      if (cp < ASCII_SIZE_BIT .and. .not. self%is_switched_to_bmp) then
         call self%ascii%add(cp)

      else if (cp < BMP_SIZE_BIT) then
         call self%switch_bmp()
         call self%bmp%add(cp)

      else
         call self%switch_bmp()
         call cube_add__segment(self, segment_t(cp, cp))
      end if

      if (self%single_flag) self%single_flag = self%num() == 1

   end subroutine cube_add__symbol