docs: def parse_tag(template, l_del, r_del):
      """Parse a tag from a template"""
      global _CURRENT_LINE
      global _LAST_TAG_LINE
  
      tag_types = {
          '!': 'comment',
          '#': 'section',
          '^': 'inverted section',
          '/': 'end',
          '>': 'partial',
          '=': 'set delimiter?',
          '{': 'no escape?',
          '&': 'no escape'
      }
  
      # Get the tag
      try:
          tag, template = template.split(r_del, 1)
      except ValueError:
          raise ChevronError('unclosed tag '
                             'at line {0}'.format(_CURRENT_LINE))
  
      # Find the type meaning of the first character
      tag_type = tag_types.get(tag[0], 'variable')
  
      # If the type is not a variable
      if tag_type != 'variable':
          # Then that first character is not needed
          tag = tag[1:]
  
      # If we might be a set delimiter tag
      if tag_type == 'set delimiter?':
          # Double check to make sure we are
          if tag.endswith('='):
              tag_type = 'set delimiter'
              # Remove the equal sign
              tag = tag[:-1]
  
          # Otherwise we should complain
          else:
              raise ChevronError('unclosed set delimiter tag\n'
                                 'at line {0}'.format(_CURRENT_LINE))
  
      # If we might be a no html escape tag
      elif tag_type == 'no escape?':
          # And we have a third curly brace
          # (And are using curly braces as delimiters)
          if l_del == '{{' and r_del == '}}' and template.startswith('}'):
              # Then we are a no html escape tag
              template = template[1:]
              tag_type = 'no escape'
  
      # Strip the whitespace off the key and return
      return ((tag_type, tag.strip()), template)