ES RegExp processor
dmitry.soshnikov at gmail.com
Sat Apr 15 20:41:42 UTC 2017
(this is mostly an FYI post on JS regexes processing tool)
Recently I've been posting about ES RegExp parser, which eventually got
evolved into a generic ES RegExp processor (called `regexp-tree`). This can
be used for different kinds of purposes, and regarding ECMAScript spec --
it can be used to check/implement new proposals, new syntax, etc.
Currently the tool includes the following modules:
- Parser (including support for recent stage 3 proposals)
- Generic transformer
- Interpreter (work in progress)
For example, the `optimizer` module is capable of translating, and
fixing your regexes from:
There is also an ESLint plugin with auto-fixing exist for it.
And the `compat-transpiler` can be used to run/translate named capturing
groups, "dotAll" flag, etc.
Translated into (with tracking group names for further runtime purposes):
The `interpreter` module can be used to actually run new regexes, or check
semantics of the spec, when new features are added. This may follow at
implementation an actual ES spec (and other DFA/NFA engines can be built).
Note: there is also a way to run newer regexes using compat-transpiler.
Please feel free to reach me in case you have any questions, or would like
to add/implement any new feature in the tool.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the es-discuss