tree_graph__unicode_property Subroutine

private pure subroutine tree_graph__unicode_property(self, seglist)

Type Bound

tree_t

Arguments

Type IntentOptional Attributes Name
class(tree_t), intent(inout) :: self
type(segment_t), intent(inout), allocatable :: seglist(:)

Source Code

   pure subroutine tree_graph__unicode_property(self, seglist)
      implicit none
      class(tree_t), intent(inout) :: self
      type(segment_t), intent(inout), allocatable :: seglist(:)

      character(:), allocatable :: property
      integer :: i
      logical :: is_single_prop, is_longer_prop

      self%code = SYNTAX_ERR_UNICODE_PROPERTY_NOT_IMPLEMENTED
      return
      
      property = ''

      call self%tape%get_token()

      is_longer_prop = self%tape%current_token == tk_lcurlybrace
      is_single_prop = .not. is_longer_prop

      if (is_longer_prop) call self%tape%get_token()

      property = self%tape%token_char(1:1)
      
      if (is_longer_prop) then
         i = 2
         reader: do while (.true.)
            call self%tape%get_token()

            if (self%tape%current_token /= tk_rcurlybrace .and.  self%tape%current_token /= tk_char) then
               self%is_valid = .false.
               self%code = SYNTAX_ERR_CURLYBRACE_MISSING
               return
            end if

            if (self%tape%current_token == tk_rcurlybrace) exit
            property = property//self%tape%token_char(1:1)
            i = i + 1
         end do reader
      end if

      ! call prop2seg(property, seglist, self%code)

   end subroutine tree_graph__unicode_property