Make tokens optional (#563)
Adding tokens to the ast is significant slower and most tools don't ever use them anyway
This commit is contained in:
committed by
Henry Zhu
parent
3d03414c05
commit
fecdb6feeb
@@ -28,9 +28,10 @@ export default class StatementParser extends ExpressionParser {
|
||||
|
||||
this.parseBlockBody(program, true, true, tt.eof);
|
||||
|
||||
file.program = this.finishNode(program, "Program");
|
||||
file.program = this.finishNode(program, "Program");
|
||||
file.comments = this.state.comments;
|
||||
file.tokens = this.state.tokens;
|
||||
|
||||
if (this.options.tokens) file.tokens = this.state.tokens;
|
||||
|
||||
return this.finishNode(file, "File");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user