peterazmanov / enaml

[Python 3.4] Declarative User Interfaces for Python fork (separate branch for Qt5)
Other
5 stars 2 forks source link

Update parser: decision regarding grammar #13

Open penenkel opened 8 years ago

penenkel commented 8 years ago

The Enaml grammar is designed as an extension of the python grammar and relies on the python compiler to process the pure python portions. This means that the pure python portions of the .enaml files must be parsed into an AST which conforms to the used python version.

The question is now, should the Enaml grammar be an extension of the python 2 or the python 3 grammar. Or should it depend on the current python version (which would mean, that .enaml files and perhaps widgets might not be compatible across python versions). An other possibility would be to define a "special" python grammar for Enaml. Basically that is what it is atm, as I'm not quite certain how faithfully the python grammar has been replicated by Enaml.

In any of the above cases the AST construction has to be modified so that it conforms to the python version which is being used to run the application.

peterazmanov commented 8 years ago

I think the most straightforward way would be to support the same python version as of package. In case package supports both versions of python we can make setting to override python version for Enaml grammar (if someone really needs it).