When I try to parse Javascript with const declaration
js2xml.parse('const FOO;')
I get this SyntaxError:
Traceback (most recent call last):
File "<console>", line 1, in <module>
File "/usr/local/lib/python3.7/dist-packages/js2xml/__init__.py", line 17, in parse
tree = _parser.parse(text, debug=debug)
File "/usr/local/lib/python3.7/dist-packages/js2xml/parser.py", line 36, in parse
result = super(CustomParser, self).parse(text, debug=debug)
File "/usr/local/lib/python3.7/dist-packages/slimit/parser.py", line 93, in parse
return self.parser.parse(text, lexer=self.lexer, debug=debug)
File "/usr/local/lib/python3.7/dist-packages/ply/yacc.py", line 333, in parse
return self.parseopt_notrack(input, lexer, debug, tracking, tokenfunc)
File "/usr/local/lib/python3.7/dist-packages/ply/yacc.py", line 1201, in parseopt_notrack
tok = call_errorfunc(self.errorfunc, errtoken, self)
File "/usr/local/lib/python3.7/dist-packages/ply/yacc.py", line 192, in call_errorfunc
r = errorfunc(token)
File "/usr/local/lib/python3.7/dist-packages/slimit/parser.py", line 116, in p_error
self._raise_syntax_error(token)
File "/usr/local/lib/python3.7/dist-packages/slimit/parser.py", line 89, in _raise_syntax_error
self.lexer.prev_token, self.lexer.token())
File "<string>", line None
SyntaxError: Unexpected token (CONST, 'const') at 1:0 between LexToken(ID,'FOO',1,6) and LexToken(ID,'FOO',1,6)
When I try to parse Javascript with
const
declarationjs2xml.parse('const FOO;')
I get this SyntaxError: