* Parse a specific file * @param {String} file The file to parse * @param {Boolean} throwErr throw the error if one is encountered?
(file, throwErr = true)
| 226 | * @param {Boolean} throwErr throw the error if one is encountered? |
| 227 | */ |
| 228 | function parseFile(file, throwErr = true) { |
| 229 | try { |
| 230 | const comments = dox.parseComments(fs.readFileSync(file, 'utf8'), { raw: true }); |
| 231 | comments.file = file; |
| 232 | processFile(comments); |
| 233 | } catch (err) { |
| 234 | // show log of which file has thrown a error for easier debugging |
| 235 | console.error('Error while trying to parseComments for ', file); |
| 236 | if (throwErr) { |
| 237 | throw err; |
| 238 | } |
| 239 | } |
| 240 | } |
| 241 | |
| 242 | function processFile(props) { |
| 243 | const { docName: name, docFileName } = processName(props.file); |
no test coverage detected