const MintParser = require('./base'); module.exports = class MintParserModules extends MintParser { parse(file) { let m; let regex = /@(.*);/gm; while ((m = regex.exec(file)) !== null) { if (m.index === regex.lastIndex) { regex.lastIndex++; } m.forEach((match, groupIndex) => { if (groupIndex === 1) { if (match.startsWith("mint.lang")) { let name = match.trim().substr(10); constructed += "const " + name + " = require(\"../_mint/internal/" + name + "\");\n"; } } }); } return file.replace(/@(.*);/gm, ""); } }