code: def _handle_template_param(self):
          
          if self._context & contexts.TEMPLATE_NAME:
              if not self._context & (contexts.HAS_TEXT | contexts.HAS_TEMPLATE):
                  self._fail_route()
              self._context ^= contexts.TEMPLATE_NAME
          elif self._context & contexts.TEMPLATE_PARAM_VALUE:
              self._context ^= contexts.TEMPLATE_PARAM_VALUE
          else:
              self._emit_all(self._pop())
          self._context |= contexts.TEMPLATE_PARAM_KEY
          self._emit(tokens.TemplateParamSeparator())
          self._push(self._context)
docs: Handle a template parameter at the head of the string.