Initial commit
This commit is contained in:
commit
b3a51a4115
10336 changed files with 2381973 additions and 0 deletions
23
node_modules/chevrotain/lib/src/scan/reg_exp_parser.js
generated
vendored
Normal file
23
node_modules/chevrotain/lib/src/scan/reg_exp_parser.js
generated
vendored
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.clearRegExpParserCache = exports.getRegExpAst = void 0;
|
||||
var regexp_to_ast_1 = require("regexp-to-ast");
|
||||
var regExpAstCache = {};
|
||||
var regExpParser = new regexp_to_ast_1.RegExpParser();
|
||||
function getRegExpAst(regExp) {
|
||||
var regExpStr = regExp.toString();
|
||||
if (regExpAstCache.hasOwnProperty(regExpStr)) {
|
||||
return regExpAstCache[regExpStr];
|
||||
}
|
||||
else {
|
||||
var regExpAst = regExpParser.pattern(regExpStr);
|
||||
regExpAstCache[regExpStr] = regExpAst;
|
||||
return regExpAst;
|
||||
}
|
||||
}
|
||||
exports.getRegExpAst = getRegExpAst;
|
||||
function clearRegExpParserCache() {
|
||||
regExpAstCache = {};
|
||||
}
|
||||
exports.clearRegExpParserCache = clearRegExpParserCache;
|
||||
//# sourceMappingURL=reg_exp_parser.js.map
|
||||
Loading…
Add table
Add a link
Reference in a new issue