UNPKG

453 BJavaScriptView Raw
1const {parse} = require('meriyah');
2const astMatcher = require('ast-matcher');
3
4function _parser(contents) {
5 // Turn on range to get position info in scope analysis.
6 return parse(contents, {
7 module: true,
8 next: true,
9 ranges: true,
10 webcompact: true,
11 specDeviation: true
12 });
13}
14
15module.exports = function() {
16 if (!astMatcher.__amd_parser_set) {
17 astMatcher.setParser(_parser);
18 astMatcher.__amd_parser_set = true;
19 }
20};
21