'Parse a template expression starting at ``pos``. Resulting
components (Unicode strings, Symbols, and Calls) are added to
the ``parts`` field, a list.  The ``pos`` field is updated to be
the next character after the expression.'

def parse_expression(self):

    extra_special_chars = ()
    special_char_re = self.special_char_re
    if self.in_argument:
        extra_special_chars = (ARG_SEP,)
        special_char_re = re.compile(('[%s]|$' % u''.join((re.escape(c) for c in (self.special_chars + extra_special_chars)))))
    text_parts = []
    while (self.pos < len(self.string)):
        char = self.string[self.pos]
        if (char not in (self.special_chars + extra_special_chars)):
            next_pos = (special_char_re.search(self.string[self.pos:]).start() + self.pos)
            text_parts.append(self.string[self.pos:next_pos])
            self.pos = next_pos
            continue
        if (self.pos == (len(self.string) - 1)):
            if (char not in (self.terminator_chars + extra_special_chars)):
                text_parts.append(char)
                self.pos += 1
            break
        next_char = self.string[(self.pos + 1)]
        if ((char == ESCAPE_CHAR) and (next_char in (self.escapable_chars + extra_special_chars))):
            text_parts.append(next_char)
            self.pos += 2
            continue
        if text_parts:
            self.parts.append(u''.join(text_parts))
            text_parts = []
        if (char == SYMBOL_DELIM):
            self.parse_symbol()
        elif (char == FUNC_DELIM):
            self.parse_call()
        elif (char in (self.terminator_chars + extra_special_chars)):
            break
        elif (char == GROUP_OPEN):
            text_parts.append(char)
            self.pos += 1
        else:
            assert False
    if text_parts:
        self.parts.append(u''.join(text_parts))
