| 111 | |
| 112 | // todo: can we use parsersBundle from scroll.js? |
| 113 | buildParsersFileCommand() { |
| 114 | const parserFilenames = `parsers/atomTypes.parsers |
| 115 | parsers/root.parsers |
| 116 | parsers/build.parsers |
| 117 | parsers/comments.parsers |
| 118 | parsers/blankLine.parsers |
| 119 | parsers/measures.parsers |
| 120 | parsers/import.parsers |
| 121 | parsers/errors.parsers` |
| 122 | .split("\n") |
| 123 | .map(filepath => path.join(__dirname, filepath)) |
| 124 | parserFilenames.push(this.parsersFile) |
| 125 | |
| 126 | const code = parserFilenames |
| 127 | .map(Disk.read) |
| 128 | .join("\n\n") |
| 129 | .replace("catchAllParser catchAllParagraphParser", "catchAllParser errorParser") |
| 130 | .replace(/^importOnly\n/gm, "") |
| 131 | .replace(/^import .+/gm, "") |
| 132 | Disk.write(path.join(this.baseFolder, `${this.scrollSetName}.parsers`), code) |
| 133 | } |
| 134 | } |
| 135 | |
| 136 | module.exports = { ScrollSetCLI } |