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:
Daniel Tschinder
2017-06-27 20:26:24 -07:00
committed by Henry Zhu
parent 3d03414c05
commit fecdb6feeb
12 changed files with 786 additions and 7 deletions

View File

@@ -13,6 +13,7 @@ export type Options = {
plugins: $ReadOnlyArray<string>;
strictMode: ?boolean;
ranges: boolean;
tokens: boolean;
};
export const defaultOptions: Options = {
@@ -44,6 +45,8 @@ export const defaultOptions: Options = {
//
// [range]: https://bugzilla.mozilla.org/show_bug.cgi?id=745678
ranges: false,
// Adds all parsed tokens to a `tokens` property on the `File` node
tokens: false,
};
// Interpret and default an options object