Exemple #1
0
 def unexpected(self):
     token = self.lookup()
     self.error('Unexpected: ' + JSLexer.tokenToStr(token))
Exemple #2
0
 def expect(self, token, value=None):
     if not self.match(token, value):
         if value == None: value = ''
         else: value = ' ' + value
         self.error('Expected:' + JSLexer.tokenToStr(token, value) + ' ,got \'' + self.lookup()[1] + '\'')
     return self.nextToken()