Store token type as number (#13768)
* refactor: abstract token metadata access * refactor: move token-specific update context logic * refactor: centralize token definitions * refactor: abstract token type creation * refactor: use number as token storage * build: replace tt.* as number * fix flow errors * fix: build on Node 12 * Update packages/babel-parser/src/tokenizer/types.js Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com> * refactor: rename token types exports to tt * update unit test * test: update Babel 8 test fixtures * fix: centralize obsolete token type updateContext * fix flow errors Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
This commit is contained in:
@@ -6,7 +6,7 @@ import type { CommentWhitespace } from "../parser/comments";
|
||||
import { Position } from "../util/location";
|
||||
|
||||
import { types as ct, type TokContext } from "./context";
|
||||
import { types as tt, type TokenType } from "./types";
|
||||
import { tt, type TokenType } from "./types";
|
||||
import type { ParsingError, ErrorTemplate } from "../parser/error";
|
||||
|
||||
type TopicContextState = {
|
||||
|
||||
Reference in New Issue
Block a user