lepu-test-platform-web/node_modules/regjsgen
zhangbo db3ebd0df0 把之前百度云的代码移植过来 2024-01-03 15:23:47 +08:00
..
LICENSE.txt 把之前百度云的代码移植过来 2024-01-03 15:23:47 +08:00
README.md 把之前百度云的代码移植过来 2024-01-03 15:23:47 +08:00
package.json 把之前百度云的代码移植过来 2024-01-03 15:23:47 +08:00
regjsgen.js 把之前百度云的代码移植过来 2024-01-03 15:23:47 +08:00

README.md

RegJSGen

Generate RegExps from RegJSParsers AST.

Installation

npm install --save regjsgen

Usage

var regjsgen = require('regjsgen');
// With `regjsparser`
var regjsparser = require('regjsparser');
var regex = '^a$';
var ast = regjsparser.parse(regex);
// Modify AST
// ...
// Regenerate `RegExp`
regex = regjsgen.generate(ast);

See Also

Testing

Run the command

npm test

To create a new reference file, execute

node test/update-fixture.js

from the repo top directory.

Support

Tested in Node.js 0.8.26~0.10.30.

Author

twitter/demoneaux
Benjamin Tan

Contributors

twitter/mathias
Mathias Bynens