'A microparser that parses for a value: some string constant or
variable name.'

def value(self):

    subject = self.subject
    i = self.pointer
    def next_space_index(subject, i):
        u'\n                                                Increment    pointer    until    a    real    space    (i.e.    a    space    not    within\n                                                quotes)    is    encountered\n                                                '
        while ((i < len(subject)) and (subject[i] not in (u'    ', u' DCTB '))):
            if (subject[i] in (u'"', u"'")):
                c = subject[i]
                i += 1
                while ((i < len(subject)) and (subject[i] != c)):
                    i += 1
                if (i >= len(subject)):
                    raise TemplateSyntaxError((u'Searching    for    value.    Unexpected    end    of    string    in    column    %d:    %s' % (i, subject)))
            i += 1
        return i
    if (i >= len(subject)):
        raise TemplateSyntaxError((u'Searching    for    value.    Expected    another    value    but    found    end    of    string:    %s' % subject))
    if (subject[i] in (u'"', u"'")):
        p = i
        i += 1
        while ((i < len(subject)) and (subject[i] != subject[p])):
            i += 1
        if (i >= len(subject)):
            raise TemplateSyntaxError((u'Searching    for    value.    Unexpected    end    of    string    in    column    %d:    %s' % (i, subject)))
        i += 1
        i = next_space_index(subject, i)
        res = subject[p:i]
        while ((i < len(subject)) and (subject[i] in (u'    ', u' DCTB '))):
            i += 1
        self.backout.append(self.pointer)
        self.pointer = i
        return res
    else:
        p = i
        i = next_space_index(subject, i)
        s = subject[p:i]
        while ((i < len(subject)) and (subject[i] in (u'    ', u' DCTB '))):
            i += 1
        self.backout.append(self.pointer)
        self.pointer = i
        return s
