fkling / astexplorer

A web tool to explore the ASTs generated by various parsers.
https://astexplorer.net/
MIT License
6.04k stars 711 forks source link

python - "Unexpected token" error on ellipsis #709

Open DetachHead opened 5 months ago

DetachHead commented 5 months ago

Describe the bug a "Unexpected token" error occurs on an ellipsis literal (...), which is valid python syntax: see https://docs.python.org/3/library/constants.html#Ellipsis

To Reproduce Steps to reproduce the behavior:

  1. Go to the ast viewer site
  2. change language to python
  3. input an ellipsis (...)

Expected behavior no error

Screenshots image

Browser (please complete the following information):

astexplorer settings:

Scipion commented 5 months ago

Parser used for python is filbert which is fairly old (8 years old) and it seems that syntax is not supported by filbert. We could try to integrate another python parser.

Just in a quick search I could find: https://www.npmjs.com/package/dt-python-parser (Published 2 years ago) https://www.npmjs.com/package/jspython-interpreter (Published 4 months ago) https://www.npmjs.com/package/python-ast (Published 3 years ago)