* Parse a specific file * @param {String} file The file to parse * @param {Boolean} throwErr throw the error if one is encountered?
(file, throwErr = true)
| 357 | * @param {Boolean} throwErr throw the error if one is encountered? |
| 358 | */ |
| 359 | function parseFile(file, throwErr = true) { |
| 360 | try { |
| 361 | const comments = dox.parseComments(fs.readFileSync(file, 'utf8'), { raw: true }); |
| 362 | comments.file = file; |
| 363 | processFile(comments); |
| 364 | } catch (err) { |
| 365 | // show log of which file has thrown a error for easier debugging |
| 366 | console.error('Error while trying to parseComments for ', file); |
| 367 | if (throwErr) { |
| 368 | throw err; |
| 369 | } |
| 370 | } |
| 371 | } |
| 372 | |
| 373 | function processFile(props) { |
| 374 | const { docName: name, docFileName } = processName(props.file); |
no test coverage detected