# Path: bigrig/interpreter/exceptions.py
# class ESSyntaxError(ESError):
#     """
#     Invalid syntax.
#     """
#     pass


from .exceptions import ESSyntaxError
        return self.string[index]

    def advance(self):
        self.pos = self.pos + 1
        if self.pos < len(self.string):
            return self.string[self.pos]
        return u''

    def expect(self, char):
        next_char = self.peek()
        if next_char != char:
            raise LiteralParseError('Unexpected char')
        return self.advance()

    @classmethod
    def parse_string(cls, string, **kwargs):
        parser = cls(string, **kwargs)
        return parser.parse()


class IdentifierParser(LiteralParser):
    """
    Parse and return identifier value with escapes computed.
    """
    def parse_unicode_escape(self):
        self.expect(u'\\')
        self.expect(u'u')
        chars = []
        for i in range(4):
            if self.peek() not in HEX_DIGITS:

# Path: bigrig/interpreter/exceptions.py
# class ESSyntaxError(ESError):
#     """
#     Invalid syntax.
#     """
#     pass


# Path: bigrig/interpreter/literals.py
from .exceptions import ESSyntaxError

        return self.string[index]

    def advance(self):
        self.pos = self.pos + 1
        if self.pos < len(self.string):
            return self.string[self.pos]
        return u''

    def expect(self, char):
        next_char = self.peek()
        if next_char != char:
            raise LiteralParseError('Unexpected char')
        return self.advance()

    @classmethod
    def parse_string(cls, string, **kwargs):
        parser = cls(string, **kwargs)
        return parser.parse()


class IdentifierParser(LiteralParser):
    """
    Parse and return identifier value with escapes computed.
    """
    def parse_unicode_escape(self):
        self.expect(u'\\')
        self.expect(u'u')
        chars = []
        for i in range(4):
            if self.peek() not in HEX_DIGITS:

                raise ESSyntaxError('Invalid identifier: %s' % self.string)