From e2dd8cee5fcb16d87e1e389ae2aac6d44d14ee9a Mon Sep 17 00:00:00 2001 From: Edward Faulkner Date: Sat, 2 Mar 2024 11:12:40 -0500 Subject: [PATCH] post-merge cleanup --- crates/swc_ecma_ast/src/lib.rs | 8 -- crates/swc_ecma_parser/src/lexer/mod.rs | 5 +- crates/swc_ecma_parser/src/macros.rs | 122 ------------------------ 3 files changed, 3 insertions(+), 132 deletions(-) diff --git a/crates/swc_ecma_ast/src/lib.rs b/crates/swc_ecma_ast/src/lib.rs index 4d57baf28a54..300c1e664e12 100644 --- a/crates/swc_ecma_ast/src/lib.rs +++ b/crates/swc_ecma_ast/src/lib.rs @@ -19,14 +19,6 @@ pub use self::{ Decorator, Key, MethodKind, PrivateMethod, PrivateProp, StaticBlock, }, decl::{ClassDecl, Decl, FnDecl, UsingDecl, VarDecl, VarDeclKind, VarDeclarator}, - expr::{ - ArrayLit, ArrowExpr, AssignExpr, AwaitExpr, BinExpr, BlockStmtOrExpr, CallExpr, Callee, - ClassExpr, CondExpr, ContentTagContent, ContentTagEnd, ContentTagExpression, - ContentTagStart, Expr, ExprOrSpread, FnExpr, Import, MemberExpr, MemberProp, MetaPropExpr, - MetaPropKind, NewExpr, ObjectLit, OptCall, OptChainBase, OptChainExpr, ParenExpr, - PatOrExpr, PropOrSpread, SeqExpr, SpreadElement, Super, SuperProp, SuperPropExpr, - TaggedTpl, ThisExpr, Tpl, TplElement, UnaryExpr, UpdateExpr, YieldExpr, - }, expr::*, function::{Function, Param, ParamOrTsParamProp}, ident::{BindingIdent, Id, Ident, IdentExt, PrivateName}, diff --git a/crates/swc_ecma_parser/src/lexer/mod.rs b/crates/swc_ecma_parser/src/lexer/mod.rs index 57934af0b964..ba8eb3d3df58 100644 --- a/crates/swc_ecma_parser/src/lexer/mod.rs +++ b/crates/swc_ecma_parser/src/lexer/mod.rs @@ -22,8 +22,9 @@ pub use self::{ use crate::{ error::{Error, SyntaxError}, lexer::state::ContentTagState, - token::{BinOpToken, Token, Word, *}, - token::{BinOpToken, IdentLike, Token, Word}, + token::{ + BinOpToken, ContentTagContent, ContentTagEnd, ContentTagStart, IdentLike, Token, Word, + }, Context, Syntax, }; diff --git a/crates/swc_ecma_parser/src/macros.rs b/crates/swc_ecma_parser/src/macros.rs index f726edc68ad2..a3a1b8e16f50 100644 --- a/crates/swc_ecma_parser/src/macros.rs +++ b/crates/swc_ecma_parser/src/macros.rs @@ -290,128 +290,6 @@ macro_rules! tok { crate::token::Token::ContentTagEnd }; - // ---------- - // Typescript - // ---------- - ("asserts") => { - crate::token::Token::Word(crate::token::Word::Ident(swc_atoms::js_word!("asserts"))) - }; - ("implements") => { - crate::token::Token::Word(crate::token::Word::Ident(swc_atoms::js_word!("implements"))) - }; - ("is") => { - crate::token::Token::Word(crate::token::Word::Ident(swc_atoms::js_word!("is"))) - }; - ("new") => { - crate::token::Token::Word(crate::token::Word::Ident(swc_atoms::js_word!("new"))) - }; - ("keyof") => { - crate::token::Token::Word(crate::token::Word::Ident(swc_atoms::js_word!("keyof"))) - }; - ("unique") => { - crate::token::Token::Word(crate::token::Word::Ident(swc_atoms::js_word!("unique"))) - }; - ("object") => { - crate::token::Token::Word(crate::token::Word::Ident(swc_atoms::js_word!("object"))) - }; - ("global") => { - crate::token::Token::Word(crate::token::Word::Ident(swc_atoms::js_word!("global"))) - }; - ("require") => { - crate::token::Token::Word(crate::token::Word::Ident(swc_atoms::js_word!("require"))) - }; - ("enum") => { - crate::token::Token::Word(crate::token::Word::Ident(swc_atoms::js_word!("enum"))) - }; - ("readonly") => { - crate::token::Token::Word(crate::token::Word::Ident(swc_atoms::js_word!("readonly"))) - }; - ("as") => { - crate::token::Token::Word(crate::token::Word::Ident(swc_atoms::js_word!("as"))) - }; - ("satisfies") => { - crate::token::Token::Word(crate::token::Word::Ident(swc_atoms::js_word!("satisfies"))) - }; - ("namespace") => { - crate::token::Token::Word(crate::token::Word::Ident(swc_atoms::js_word!("namespace"))) - }; - ("abstract") => { - crate::token::Token::Word(crate::token::Word::Ident(swc_atoms::js_word!("abstract"))) - }; - ("infer") => { - crate::token::Token::Word(crate::token::Word::Ident(swc_atoms::js_word!("infer"))) - }; - ("any") => { - crate::token::Token::Word(crate::token::Word::Ident(swc_atoms::js_word!("any"))) - }; - ("boolean") => { - crate::token::Token::Word(crate::token::Word::Ident(swc_atoms::js_word!("boolean"))) - }; - ("bigint") => { - crate::token::Token::Word(crate::token::Word::Ident(swc_atoms::js_word!("bigint"))) - }; - ("intrinsic") => { - crate::token::Token::Word(crate::token::Word::Ident(swc_atoms::js_word!("intrinsic"))) - }; - ("never") => { - crate::token::Token::Word(crate::token::Word::Ident(swc_atoms::js_word!("never"))) - }; - ("number") => { - crate::token::Token::Word(crate::token::Word::Ident(swc_atoms::js_word!("number"))) - }; - ("string") => { - crate::token::Token::Word(crate::token::Word::Ident(swc_atoms::js_word!("string"))) - }; - ("symbol") => { - crate::token::Token::Word(crate::token::Word::Ident(swc_atoms::js_word!("symbol"))) - }; - ("unknown") => { - crate::token::Token::Word(crate::token::Word::Ident(swc_atoms::js_word!("unknown"))) - }; - ("require") => { - crate::token::Token::Word(crate::token::Word::Ident(swc_atoms::js_word!("require"))) - }; - ("interface") => { - crate::token::Token::Word(crate::token::Word::Ident(swc_atoms::js_word!("interface"))) - }; - ("declare") => { - crate::token::Token::Word(crate::token::Word::Ident(swc_atoms::js_word!("declare"))) - }; - ("override") => { - crate::token::Token::Word(crate::token::Word::Ident(swc_atoms::js_word!("override"))) - }; - ("undefined") => { - crate::token::Token::Word(crate::token::Word::Ident(swc_atoms::js_word!("undefined"))) - }; - ("meta") => { - crate::token::Token::Word(crate::token::Word::Ident(swc_atoms::js_word!("meta"))) - }; - ("type") => { - crate::token::Token::Word(crate::token::Word::Ident(swc_atoms::js_word!("type"))) - }; - ("assert") => { - crate::token::Token::Word(crate::token::Word::Ident(swc_atoms::js_word!("assert"))) - }; - ("get") => { - crate::token::Token::Word(crate::token::Word::Ident(swc_atoms::js_word!("get"))) - }; - ("set") => { - crate::token::Token::Word(crate::token::Word::Ident(swc_atoms::js_word!("set"))) - }; - ("out") => { - crate::token::Token::Word(crate::token::Word::Ident(swc_atoms::js_word!("out"))) - }; - ("public") => { - crate::token::Token::Word(crate::token::Word::Ident(swc_atoms::js_word!("public"))) - }; - ("private") => { - crate::token::Token::Word(crate::token::Word::Ident(swc_atoms::js_word!("private"))) - }; - ("protected") => { - crate::token::Token::Word(crate::token::Word::Ident(swc_atoms::js_word!("protected"))) - }; - ("using") => { - crate::token::Token::Word(crate::token::Word::Ident(swc_atoms::js_word!("using"))) ($tt:tt) => { crate::token::Token::Word(crate::token::Word::Ident(crate::token::IdentLike::Known( known_ident!($tt),