GerHobbelt / jison

bison / YACC / LEX in JavaScript (LALR(1), SLR(1), etc. lexer/parser generator)
https://gerhobbelt.github.io/jison/
MIT License
118 stars 20 forks source link

Compile to ES5? #14

Closed GerHobbelt closed 6 years ago

GerHobbelt commented 6 years ago

Latest jison 0.6.0-191 uses a few ES2016 features (string templates, ...args) which are not supported in older NodeJS and/or browsers (Node 5.0 and older: TravisCI fails ATM: https://travis-ci.org/GerHobbelt/jison )

It might be advisable to pull jison et al through babel before publishing in order to prevent issues stemming from running jison in older environments.

Note: extra checks required to ensure the generated parsers and lexers are ES5 safe!

GerHobbelt commented 6 years ago

Relevant common code which was done in ES6 (at least some bits of it) has been moved to a separate subrepo: https://github.com/GerHobbelt/jison-helpers-lib and is babel-compiled in the build process there.

That at least covers it for the TravisCI tests in Node 4 and Node 5 environments.

Which leaves rollup+babel support for the entire thing...

GerHobbelt commented 6 years ago

Done. jison and its libraries/packages are now processed through rollup+babel and the monolithic results are presented in the various dist/ distribution directories.

The only thing that still bothers me is compiling ES6-action-code-carrying grammars in non-ES6 environments (NodeJS, among others) but that is a different issue.