|
|
|
@ -118,10 +118,44 @@ var parseExpressions = function(expr){ |
|
|
|
return expressions; |
|
|
|
}; |
|
|
|
|
|
|
|
/* |
|
|
|
* comment: | |
|
|
|
* Parse documentation information from the provided filename argument |
|
|
|
* params: |
|
|
|
* - name: filename |
|
|
|
* type: String |
|
|
|
* comment: filename of the script you wish to parse |
|
|
|
* - name: options |
|
|
|
* type: Object |
|
|
|
* comment: | |
|
|
|
* Available options: |
|
|
|
* - tolerant: try to keep parsing the file even if errors are encountered [default: true] |
|
|
|
* returns: |
|
|
|
* type: Array |
|
|
|
* comment: a list of doc comments parsed from the source filename |
|
|
|
*/ |
|
|
|
module.exports.parseFile = function(filename, options){ |
|
|
|
return module.exports.parseContents(fs.readFileSync(filename, 'utf-8'), options); |
|
|
|
}; |
|
|
|
|
|
|
|
/* |
|
|
|
* comment: | |
|
|
|
* Parse documentation information from the provided string content |
|
|
|
* |
|
|
|
* This function is also available under `docast.parse(contents, options)` |
|
|
|
* params: |
|
|
|
* - name: contents |
|
|
|
* type: String |
|
|
|
* comment: string content to parse docs from |
|
|
|
* - name: options |
|
|
|
* type: Object |
|
|
|
* comment: | |
|
|
|
* Available options: |
|
|
|
* - tolerant: try to keep parsing the file even if errors are encountered [default: true] |
|
|
|
* returns: |
|
|
|
* type: Array |
|
|
|
* comment: a list of doc comments parsed from the source string contents |
|
|
|
*/ |
|
|
|
module.exports.parseContents = function(contents, options){ |
|
|
|
options = options || {}; |
|
|
|
var tolerant = (options.tolerant === undefined)? true: options.tolerant; |
|
|
|
|