module Mail::ContentLocation - mail-2.5.4 Documentation

# module Mail::ContentLocation

### Public Instance Methods

_nt_location() click to toggle source

    # File lib/mail/parsers/content_location.rb, line 71
    def _nt_location
      start_index = index
      if node_cache[:location].has_key?(index)
        cached = node_cache[:location][index]
        if cached
          cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
          @index = cached.interval.end
        end
        return cached
      end

      i0 = index
      r1 = _nt_quoted_string
      r1.extend(Location0)
      if r1
        r0 = r1
      else
        s2, i2 = [], index
        loop do
          i3 = index
          r4 = _nt_token
          if r4
            r3 = r4
          else
            if has_terminal?('\G[\x3d]', true, index)
              r5 = true
              @index += 1
            else
              r5 = nil
            end
            if r5
              r3 = r5
            else
              @index = i3
              r3 = nil
            end
          end
          if r3
            s2 << r3
          else
            break
          end
        end
        if s2.empty?
          @index = i2
          r2 = nil
        else
          r2 = instantiate_node(SyntaxNode,input, i2...index, s2)
        end
        if r2
          r0 = r2
        else
          @index = i0
          r0 = nil
        end
      end

      node_cache[:location][start_index] = r0

      r0
    end

_nt_primary() click to toggle source

    # File lib/mail/parsers/content_location.rb, line 30
    def _nt_primary
      start_index = index
      if node_cache[:primary].has_key?(index)
        cached = node_cache[:primary][index]
        if cached
          cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
          @index = cached.interval.end
        end
        return cached
      end

      i0, s0 = index, []
      r1 = _nt_CFWS
      s0 << r1
      if r1
        r2 = _nt_location
        s0 << r2
        if r2
          r3 = _nt_CFWS
          s0 << r3
        end
      end
      if s0.last
        r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
        r0.extend(Primary0)
      else
        @index = i0
        r0 = nil
      end

      node_cache[:primary][start_index] = r0

      r0
    end

root() click to toggle source

    # File lib/mail/parsers/content_location.rb, line 8
    def root
      @root ||= :primary
    end