rspivak / slimit

SlimIt - a JavaScript minifier/parser in Python
MIT License
550 stars 94 forks source link

Unexpected token (ID, 'params') #104

Open FVolral opened 6 years ago

FVolral commented 6 years ago

I've the following error when I'm trying to parse a file:

Illegal character '\xa0' at 1:2065 after LexToken(ID,'Â',1,2064)
  File "<string>", line unknown
SyntaxError: Unexpected token (ID, 'params') at 1:2066 between LexToken(ID,'Â',1,2064) and LexToken(PERIOD,'.',1,2072)

It comes from these lines of code:

if (!(params.args && params.args[0] !== undefined)) {
    params.kwargs.domain = options.domain || params.domain || params.kwargs.domain || [];
}
metatoaster commented 6 years ago

Looks like you have other code or stale state in the lexer/parser that is actually triggering these errors, as the 'Â' is not present in the code fragment that you have provided here.