Add comments property to babylon.parseExpression() result
This commit is contained in:
parent
688a1e523e
commit
f9b8fa1ddf
@ -73,6 +73,7 @@ export default class ExpressionParser extends LValParser {
|
||||
if (!this.match(tt.eof)) {
|
||||
this.unexpected();
|
||||
}
|
||||
expr.comments = this.state.comments;
|
||||
return expr;
|
||||
}
|
||||
|
||||
|
||||
@ -32,5 +32,23 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"comments": [
|
||||
{
|
||||
"type": "CommentLine",
|
||||
"value": " my comment",
|
||||
"start": 4,
|
||||
"end": 17,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 4
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 17
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user