def _STRING(self):
        delimiter = self.c
        str_buf = []
        self.consume()
        while self.c != EOF:
            if self.c == '\\':
                self.consume()
                if self.c == delimiter:
                    str_buf.append(self.c)
                    self.consume()
                else:
                    str_buf.append('\\')
                    str_buf.append(self.c)
                    self.consume()
            else:
                str_buf.append(self.c)
                self.consume()
            if self.c == delimiter:
                self.consume()
                break
        return ''.join(str_buf)
dataset/ETHPy150Open guillermooo/Mercurial/shglib/parsing.py/CommandLexer._STRING/original