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

add CLI + API option to enable/disable/pick-a-mode for (action) code snippets' validation #26

Open GerHobbelt opened 7 years ago

GerHobbelt commented 7 years ago

I.e. add ability to manipulate the jison-helpers-lib::checkActionBlock() behaviour.

Currently all code blocks MUST pass JavaScript validation performed by that API through using esprima/recast, but several examples exist which showcase grammars with admittedly non-working, non-compiling code and we don't want to bother about that.

Food For Thought

The other, more sensible?, use case is when you create parsers/lexers and code your action blocks and/or other code sections in there in another language that compiles to JavaScript, say TypeScript. Currently jison does NOT support that mode of usage; it MAY be useful to provide a pre-compile/pre-process plugin interface for said API so that a user-determined and user-specified toolchain CAN be applied to every chunk of code and thus help produce a validated parser/lexer instance or sourcecode. 🎉

GerHobbelt commented 7 years ago

Related to #17

GerHobbelt commented 5 years ago

Related: #46