def _p_string(self):
        try:
            return self._p_re(_quoted_re)[1:-1]
        except NoMatch:
            literal_length = int(self._p_re(_lit_ref_re, group = 1))
#            print "got literal length: %s" % literal_length

            # Huh. We have a literal string. This means the client sent us
            # the length of the actual string. The reader that called us
            # passed us the entire client message. This means they went and
            # asked the client for all the data for all literal strings. So
            # the value of this literal string is already on our input
            # string. The only thing we need to check for is to make sure
            # that the input string is at least as long as the literal string
            # is supposed to be.
            if literal_length > len(self.input):
                raise BadLiteral(value = "Remaining input %d characters " \
                                 "long, expected at least %d" % \
                                 (len(self.input), literal_length))
            str = self.input[:literal_length]
            self.input = self.input[literal_length:]
#            print "Literal string is: '%s'" % str
            return str

    #######################################################################
    #
A string is either a 'quoted string' or a 'literal string'
dataset/ETHPy150Open scanner/asimap/asimap/parse.py/IMAPClientCommand._p_string