mirror of
https://github.com/jsdoc/jsdoc.git
synced 2025-12-08 19:46:11 +00:00
parse do expressions
This commit is contained in:
parent
af5d169673
commit
b719e68907
@ -8,6 +8,7 @@ var parserOptions = exports.parserOptions = {
|
||||
ranges: true,
|
||||
sourceType: 'module',
|
||||
plugins: [
|
||||
'doExpressions',
|
||||
'estree',
|
||||
'jsx',
|
||||
'objectRestSpread'
|
||||
@ -22,6 +23,7 @@ function parse(source, filename) {
|
||||
|
||||
try {
|
||||
ast = babylon.parse(source, parserOptions);
|
||||
// console.log(JSON.stringify(ast, null, 2));
|
||||
}
|
||||
catch (e) {
|
||||
logger.error('Unable to parse %s: %s', filename, e.message);
|
||||
|
||||
@ -21,6 +21,7 @@ exports.Syntax = {
|
||||
ConditionalExpression: 'ConditionalExpression',
|
||||
ContinueStatement: 'ContinueStatement',
|
||||
DebuggerStatement: 'DebuggerStatement',
|
||||
DoExpression: 'DoExpression',
|
||||
DoWhileStatement: 'DoWhileStatement',
|
||||
EmptyStatement: 'EmptyStatement',
|
||||
ExperimentalRestProperty: 'ExperimentalRestProperty',
|
||||
|
||||
@ -179,6 +179,10 @@ walkers[Syntax.ContinueStatement] = leafNode;
|
||||
|
||||
walkers[Syntax.DebuggerStatement] = leafNode;
|
||||
|
||||
walkers[Syntax.DoExpression] = function(node, parent, state, cb) {
|
||||
cb(node.body, node, state);
|
||||
};
|
||||
|
||||
walkers[Syntax.DoWhileStatement] = function(node, parent, state, cb) {
|
||||
cb(node.test, node, state);
|
||||
cb(node.body, node, state);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user