# Path: actrie/util.py
# def convert2unicode(string):
#     # type: (AnyStr) -> str
#     if isinstance(string, bytes):
#         return string.decode("utf-8")
#     return string


from .util import convert2unicode
                if ch == u"\\":
                    is_escape = True
                    continue

                if ch in stop and (ch != u"." or self.cur >= len(self.text) or self.text[self.cur] == "{"):
                    return s, ch

            s += ch

        return s, -1

    def consume_integer(self):
        s = u""
        while self.cur < len(self.text):
            ch = self.text[self.cur]
            if ch not in number_char:
                break
            s += ch
            self.cur += 1
        return int(s) if s else None

    def expect(self, s, move=True):
        wlen = len(s)
        if len(self.text) - self.cur >= wlen and self.text[self.cur : (self.cur + wlen)] == s:
            if move:
                self.cur += wlen
            return True
        return False

    def eof(self):

# Path: actrie/util.py
# def convert2unicode(string):
#     # type: (AnyStr) -> str
#     if isinstance(string, bytes):
#         return string.decode("utf-8")
#     return string


# Path: actrie/tokenizer.py
from .util import convert2unicode

                if ch == u"\\":
                    is_escape = True
                    continue

                if ch in stop and (ch != u"." or self.cur >= len(self.text) or self.text[self.cur] == "{"):
                    return s, ch

            s += ch

        return s, -1

    def consume_integer(self):
        s = u""
        while self.cur < len(self.text):
            ch = self.text[self.cur]
            if ch not in number_char:
                break
            s += ch
            self.cur += 1
        return int(s) if s else None

    def expect(self, s, move=True):
        wlen = len(s)
        if len(self.text) - self.cur >= wlen and self.text[self.cur : (self.cur + wlen)] == s:
            if move:
                self.cur += wlen
            return True
        return False

    def eof(self):

        return self.cur == len(self.text)