cube_t__symbol_in_cube Function

private pure function cube_t__symbol_in_cube(symbol, cube) result(ret)

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: symbol
type(cube_t), intent(in) :: cube

Return Value logical


Source Code

   pure function cube_t__symbol_in_cube (symbol, cube) result(ret)
      implicit none
      character(*), intent(in) :: symbol
      type(cube_t), intent(in) :: cube
      logical :: ret

      integer :: cp

      cp = ichar_utf8(symbol)

      if (cp < ASCII_SIZE_BIT .and. .not. cube%is_switched_to_bmp) then
         ret = iand(cube%ascii%a(cp/bits_64), ishft(1_int64, mod(cp, bits_64))) /= 0_int64

      else if (cp < BMP_SIZE_BIT .and. cube%is_switched_to_bmp) then
         ret = iand(cube%bmp%b(cp/bits_64), ishft(1_int64, mod(cp, bits_64))) /= 0_int64

      else if (cp >= ASCII_SIZE_BIT .and. cp < BMP_SIZE_BIT .and. .not. cube%is_switched_to_bmp) then
            ret = .false.
      else
         if (allocated(cube%sps)) then
            ret = symbol_to_segment(symbol) .in. cube%sps(:)
         else
            ret = .false.
         end if
      end if

   end function cube_t__symbol_in_cube