Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const defaultOptions = {
parser: {
extractDoc: true,
},
ast: {
withPositions: true,
},
};
export default {
...defaultParserInterface,
id: ID,
displayName: ID,
version: pkg.version,
homepage: pkg.homepage,
locationProps: new Set(['loc']),
typeProps: new Set(['kind']),
loadParser(callback) {
require(['php-parser'], callback);
},
parse(Engine, code) {
const parser = new Engine(defaultOptions);
return parser.parseCode(code, '');
},
getNodeName(node) {
return node.kind;
},