fix(ast)!: rename all instances of BigintLiteral to BigIntLiteral. (#3898)

Notice the casing! Just for the sake of consistency.
This commit is contained in:
rzvxa 2024-06-25 14:39:42 +00:00
parent 09f4d3c4d3
commit 6796891e2e
26 changed files with 66 additions and 66 deletions

View file

@ -55,7 +55,7 @@ pub enum Expression<'a> {
BooleanLiteral(Box<'a, BooleanLiteral>) = 0,
NullLiteral(Box<'a, NullLiteral>) = 1,
NumericLiteral(Box<'a, NumericLiteral<'a>>) = 2,
BigintLiteral(Box<'a, BigIntLiteral<'a>>) = 3,
BigIntLiteral(Box<'a, BigIntLiteral<'a>>) = 3,
RegExpLiteral(Box<'a, RegExpLiteral<'a>>) = 4,
StringLiteral(Box<'a, StringLiteral<'a>>) = 5,
TemplateLiteral(Box<'a, TemplateLiteral<'a>>) = 6,
@ -110,7 +110,7 @@ macro_rules! match_expression {
$ty::BooleanLiteral(_)
| $ty::NullLiteral(_)
| $ty::NumericLiteral(_)
| $ty::BigintLiteral(_)
| $ty::BigIntLiteral(_)
| $ty::RegExpLiteral(_)
| $ty::StringLiteral(_)
| $ty::TemplateLiteral(_)

View file

@ -93,7 +93,7 @@ macro_rules! inherit_variants {
/// Inherited from [`Expression`]
NumericLiteral(Box<'a, NumericLiteral<'a>>) = 2,
/// Inherited from [`Expression`]
BigintLiteral(Box<'a, BigIntLiteral<'a>>) = 3,
BigIntLiteral(Box<'a, BigIntLiteral<'a>>) = 3,
/// Inherited from [`Expression`]
RegExpLiteral(Box<'a, RegExpLiteral<'a>>) = 4,
/// Inherited from [`Expression`]
@ -189,7 +189,7 @@ macro_rules! inherit_variants {
BooleanLiteral,
NullLiteral,
NumericLiteral,
BigintLiteral,
BigIntLiteral,
RegExpLiteral,
StringLiteral,
TemplateLiteral,

View file

@ -122,7 +122,7 @@ pub enum TSLiteral<'a> {
BooleanLiteral(Box<'a, BooleanLiteral>),
NullLiteral(Box<'a, NullLiteral>),
NumericLiteral(Box<'a, NumericLiteral<'a>>),
BigintLiteral(Box<'a, BigIntLiteral<'a>>),
BigIntLiteral(Box<'a, BigIntLiteral<'a>>),
RegExpLiteral(Box<'a, RegExpLiteral<'a>>),
StringLiteral(Box<'a, StringLiteral<'a>>),
TemplateLiteral(Box<'a, TemplateLiteral<'a>>),

View file

@ -235,7 +235,7 @@ impl<'a> AstBuilder<'a> {
#[inline]
pub fn literal_bigint_expression(self, literal: BigIntLiteral<'a>) -> Expression<'a> {
Expression::BigintLiteral(self.alloc(literal))
Expression::BigIntLiteral(self.alloc(literal))
}
#[inline]

View file

@ -94,7 +94,7 @@ impl<'a> Expression<'a> {
Self::BooleanLiteral(_)
| Self::NullLiteral(_)
| Self::NumericLiteral(_)
| Self::BigintLiteral(_)
| Self::BigIntLiteral(_)
| Self::RegExpLiteral(_)
| Self::StringLiteral(_)
)
@ -246,7 +246,7 @@ impl<'a> Expression<'a> {
Self::BooleanLiteral(lit) => Some(lit.value),
Self::NullLiteral(_) => Some(false),
Self::NumericLiteral(lit) => Some(lit.value != 0.0),
Self::BigintLiteral(lit) => Some(!lit.is_zero()),
Self::BigIntLiteral(lit) => Some(!lit.is_zero()),
Self::RegExpLiteral(_) => Some(true),
Self::StringLiteral(lit) => Some(!lit.value.is_empty()),
_ => None,
@ -265,7 +265,7 @@ impl<'a> Expression<'a> {
Self::BooleanLiteral(_)
| Self::NullLiteral(_)
| Self::NumericLiteral(_)
| Self::BigintLiteral(_)
| Self::BigIntLiteral(_)
| Self::RegExpLiteral(_)
| Self::StringLiteral(_) => true,
Self::TemplateLiteral(lit) if lit.is_no_substitution_template() => true,
@ -337,7 +337,7 @@ impl<'a> PropertyKey<'a> {
Self::StringLiteral(lit) => Some(lit.value.to_compact_str()),
Self::RegExpLiteral(lit) => Some(lit.regex.to_string().into()),
Self::NumericLiteral(lit) => Some(lit.value.to_string().into()),
Self::BigintLiteral(lit) => Some(lit.raw.to_compact_str()),
Self::BigIntLiteral(lit) => Some(lit.raw.to_compact_str()),
Self::NullLiteral(_) => Some("null".into()),
Self::TemplateLiteral(lit) => lit
.expressions

View file

@ -62,7 +62,7 @@ ast_kinds! {
StringLiteral(&'a StringLiteral<'a>),
BooleanLiteral(&'a BooleanLiteral),
NullLiteral(&'a NullLiteral),
BigintLiteral(&'a BigIntLiteral<'a>),
BigIntLiteral(&'a BigIntLiteral<'a>),
RegExpLiteral(&'a RegExpLiteral<'a>),
TemplateLiteral(&'a TemplateLiteral<'a>),
@ -271,7 +271,7 @@ impl<'a> AstKind<'a> {
| Self::StringLiteral(_)
| Self::BooleanLiteral(_)
| Self::NullLiteral(_)
| Self::BigintLiteral(_)
| Self::BigIntLiteral(_)
| Self::RegExpLiteral(_)
| Self::TemplateLiteral(_)
)
@ -316,7 +316,7 @@ impl<'a> AstKind<'a> {
Expression::BooleanLiteral(e) => Self::BooleanLiteral(e),
Expression::NullLiteral(e) => Self::NullLiteral(e),
Expression::NumericLiteral(e) => Self::NumericLiteral(e),
Expression::BigintLiteral(e) => Self::BigintLiteral(e),
Expression::BigIntLiteral(e) => Self::BigIntLiteral(e),
Expression::RegExpLiteral(e) => Self::RegExpLiteral(e),
Expression::StringLiteral(e) => Self::StringLiteral(e),
Expression::TemplateLiteral(e) => Self::TemplateLiteral(e),
@ -406,7 +406,7 @@ impl<'a> GetSpan for AstKind<'a> {
Self::StringLiteral(x) => x.span,
Self::BooleanLiteral(x) => x.span,
Self::NullLiteral(x) => x.span,
Self::BigintLiteral(x) => x.span,
Self::BigIntLiteral(x) => x.span,
Self::RegExpLiteral(x) => x.span,
Self::TemplateLiteral(x) => x.span,
@ -601,7 +601,7 @@ impl<'a> AstKind<'a> {
Self::StringLiteral(s) => format!("StringLiteral({})", s.value).into(),
Self::BooleanLiteral(b) => format!("BooleanLiteral({})", b.value).into(),
Self::NullLiteral(_) => "NullLiteral".into(),
Self::BigintLiteral(b) => format!("BigintLiteral({})", b.raw).into(),
Self::BigIntLiteral(b) => format!("BigIntLiteral({})", b.raw).into(),
Self::RegExpLiteral(r) => format!("RegExpLiteral({})", r.regex).into(),
Self::TemplateLiteral(t) => format!(
"TemplateLiteral({})",

View file

@ -61,7 +61,7 @@ impl<'a> GetSpan for Expression<'a> {
Self::BooleanLiteral(it) => it.span(),
Self::NullLiteral(it) => it.span(),
Self::NumericLiteral(it) => it.span(),
Self::BigintLiteral(it) => it.span(),
Self::BigIntLiteral(it) => it.span(),
Self::RegExpLiteral(it) => it.span(),
Self::StringLiteral(it) => it.span(),
Self::TemplateLiteral(it) => it.span(),
@ -154,7 +154,7 @@ impl<'a> GetSpan for ArrayExpressionElement<'a> {
Self::BooleanLiteral(it) => it.span(),
Self::NullLiteral(it) => it.span(),
Self::NumericLiteral(it) => it.span(),
Self::BigintLiteral(it) => it.span(),
Self::BigIntLiteral(it) => it.span(),
Self::RegExpLiteral(it) => it.span(),
Self::StringLiteral(it) => it.span(),
Self::TemplateLiteral(it) => it.span(),
@ -235,7 +235,7 @@ impl<'a> GetSpan for PropertyKey<'a> {
Self::BooleanLiteral(it) => it.span(),
Self::NullLiteral(it) => it.span(),
Self::NumericLiteral(it) => it.span(),
Self::BigintLiteral(it) => it.span(),
Self::BigIntLiteral(it) => it.span(),
Self::RegExpLiteral(it) => it.span(),
Self::StringLiteral(it) => it.span(),
Self::TemplateLiteral(it) => it.span(),
@ -365,7 +365,7 @@ impl<'a> GetSpan for Argument<'a> {
Self::BooleanLiteral(it) => it.span(),
Self::NullLiteral(it) => it.span(),
Self::NumericLiteral(it) => it.span(),
Self::BigintLiteral(it) => it.span(),
Self::BigIntLiteral(it) => it.span(),
Self::RegExpLiteral(it) => it.span(),
Self::StringLiteral(it) => it.span(),
Self::TemplateLiteral(it) => it.span(),
@ -764,7 +764,7 @@ impl<'a> GetSpan for ForStatementInit<'a> {
Self::BooleanLiteral(it) => it.span(),
Self::NullLiteral(it) => it.span(),
Self::NumericLiteral(it) => it.span(),
Self::BigintLiteral(it) => it.span(),
Self::BigIntLiteral(it) => it.span(),
Self::RegExpLiteral(it) => it.span(),
Self::StringLiteral(it) => it.span(),
Self::TemplateLiteral(it) => it.span(),
@ -1192,7 +1192,7 @@ impl<'a> GetSpan for ExportDefaultDeclarationKind<'a> {
Self::BooleanLiteral(it) => it.span(),
Self::NullLiteral(it) => it.span(),
Self::NumericLiteral(it) => it.span(),
Self::BigintLiteral(it) => it.span(),
Self::BigIntLiteral(it) => it.span(),
Self::RegExpLiteral(it) => it.span(),
Self::StringLiteral(it) => it.span(),
Self::TemplateLiteral(it) => it.span(),
@ -1275,7 +1275,7 @@ impl<'a> GetSpan for TSEnumMemberName<'a> {
Self::BooleanLiteral(it) => it.span(),
Self::NullLiteral(it) => it.span(),
Self::NumericLiteral(it) => it.span(),
Self::BigintLiteral(it) => it.span(),
Self::BigIntLiteral(it) => it.span(),
Self::RegExpLiteral(it) => it.span(),
Self::StringLiteral(it) => it.span(),
Self::TemplateLiteral(it) => it.span(),
@ -1338,7 +1338,7 @@ impl<'a> GetSpan for TSLiteral<'a> {
Self::BooleanLiteral(it) => it.span(),
Self::NullLiteral(it) => it.span(),
Self::NumericLiteral(it) => it.span(),
Self::BigintLiteral(it) => it.span(),
Self::BigIntLiteral(it) => it.span(),
Self::RegExpLiteral(it) => it.span(),
Self::StringLiteral(it) => it.span(),
Self::TemplateLiteral(it) => it.span(),
@ -2042,7 +2042,7 @@ impl<'a> GetSpan for JSXExpression<'a> {
Self::BooleanLiteral(it) => it.span(),
Self::NullLiteral(it) => it.span(),
Self::NumericLiteral(it) => it.span(),
Self::BigintLiteral(it) => it.span(),
Self::BigIntLiteral(it) => it.span(),
Self::RegExpLiteral(it) => it.span(),
Self::StringLiteral(it) => it.span(),
Self::TemplateLiteral(it) => it.span(),

View file

@ -1472,7 +1472,7 @@ pub mod walk {
pub fn walk_expression<'a, V: Visit<'a>>(visitor: &mut V, expr: &Expression<'a>) {
match expr {
Expression::BigintLiteral(lit) => visitor.visit_bigint_literal(lit),
Expression::BigIntLiteral(lit) => visitor.visit_bigint_literal(lit),
Expression::BooleanLiteral(lit) => visitor.visit_boolean_literal(lit),
Expression::NullLiteral(lit) => visitor.visit_null_literal(lit),
Expression::NumericLiteral(lit) => visitor.visit_number_literal(lit),
@ -2316,7 +2316,7 @@ pub mod walk {
}
pub fn walk_bigint_literal<'a, V: Visit<'a>>(visitor: &mut V, lit: &BigIntLiteral<'a>) {
let kind = AstKind::BigintLiteral(visitor.alloc(lit));
let kind = AstKind::BigIntLiteral(visitor.alloc(lit));
visitor.enter_node(kind);
visitor.leave_node(kind);
}
@ -3006,7 +3006,7 @@ pub mod walk {
let kind = AstKind::TSLiteralType(visitor.alloc(ty));
visitor.enter_node(kind);
match &ty.literal {
TSLiteral::BigintLiteral(lit) => visitor.visit_bigint_literal(lit),
TSLiteral::BigIntLiteral(lit) => visitor.visit_bigint_literal(lit),
TSLiteral::BooleanLiteral(lit) => visitor.visit_boolean_literal(lit),
TSLiteral::NullLiteral(lit) => visitor.visit_null_literal(lit),
TSLiteral::NumericLiteral(lit) => visitor.visit_number_literal(lit),

View file

@ -1459,7 +1459,7 @@ pub mod walk_mut {
pub fn walk_expression_mut<'a, V: VisitMut<'a>>(visitor: &mut V, expr: &mut Expression<'a>) {
match expr {
Expression::BigintLiteral(lit) => visitor.visit_bigint_literal(lit),
Expression::BigIntLiteral(lit) => visitor.visit_bigint_literal(lit),
Expression::BooleanLiteral(lit) => visitor.visit_boolean_literal(lit),
Expression::NullLiteral(lit) => visitor.visit_null_literal(lit),
Expression::NumericLiteral(lit) => visitor.visit_number_literal(lit),
@ -2402,7 +2402,7 @@ pub mod walk_mut {
visitor: &mut V,
_lit: &mut BigIntLiteral<'a>,
) {
let kind = AstType::BigintLiteral;
let kind = AstType::BigIntLiteral;
visitor.enter_node(kind);
visitor.leave_node(kind);
}
@ -3078,7 +3078,7 @@ pub mod walk_mut {
let kind = AstType::TSLiteralType;
visitor.enter_node(kind);
match &mut ty.literal {
TSLiteral::BigintLiteral(lit) => visitor.visit_bigint_literal(lit),
TSLiteral::BigIntLiteral(lit) => visitor.visit_bigint_literal(lit),
TSLiteral::BooleanLiteral(lit) => visitor.visit_boolean_literal(lit),
TSLiteral::NullLiteral(lit) => visitor.visit_null_literal(lit),
TSLiteral::NumericLiteral(lit) => visitor.visit_number_literal(lit),

View file

@ -1020,7 +1020,7 @@ impl<'a, const MINIFY: bool> GenExpr<MINIFY> for Expression<'a> {
Self::BooleanLiteral(lit) => lit.gen(p, ctx),
Self::NullLiteral(lit) => lit.gen(p, ctx),
Self::NumericLiteral(lit) => lit.gen(p, ctx),
Self::BigintLiteral(lit) => lit.gen(p, ctx),
Self::BigIntLiteral(lit) => lit.gen(p, ctx),
Self::RegExpLiteral(lit) => lit.gen(p, ctx),
Self::StringLiteral(lit) => lit.gen(p, ctx),
Self::Identifier(ident) => ident.gen(p, ctx),
@ -2958,7 +2958,7 @@ impl<'a, const MINIFY: bool> Gen<MINIFY> for TSLiteral<'a> {
Self::BooleanLiteral(decl) => decl.gen(p, ctx),
Self::NullLiteral(decl) => decl.gen(p, ctx),
Self::NumericLiteral(decl) => decl.gen(p, ctx),
Self::BigintLiteral(decl) => decl.gen(p, ctx),
Self::BigIntLiteral(decl) => decl.gen(p, ctx),
Self::RegExpLiteral(decl) => decl.gen(p, ctx),
Self::StringLiteral(decl) => decl.gen(p, ctx),
Self::TemplateLiteral(decl) => decl.gen(p, ctx),

View file

@ -17,13 +17,13 @@ impl<'a> IsolatedDeclarations<'a> {
match key {
PropertyKey::StringLiteral(_)
| PropertyKey::NumericLiteral(_)
| PropertyKey::BigintLiteral(_) => true,
| PropertyKey::BigIntLiteral(_) => true,
PropertyKey::TemplateLiteral(l) => l.expressions.is_empty(),
PropertyKey::UnaryExpression(expr) => {
expr.operator.is_arithmetic()
&& matches!(
expr.argument,
Expression::NumericLiteral(_) | Expression::BigintLiteral(_)
Expression::NumericLiteral(_) | Expression::BigIntLiteral(_)
)
}
_ => false,

View file

@ -19,7 +19,7 @@ impl<'a> IsolatedDeclarations<'a> {
Expression::BooleanLiteral(_) => Some(self.ast.ts_boolean_keyword(SPAN)),
Expression::NullLiteral(_) => Some(self.ast.ts_null_keyword(SPAN)),
Expression::NumericLiteral(_) => Some(self.ast.ts_number_keyword(SPAN)),
Expression::BigintLiteral(_) => Some(self.ast.ts_bigint_keyword(SPAN)),
Expression::BigIntLiteral(_) => Some(self.ast.ts_bigint_keyword(SPAN)),
Expression::StringLiteral(_) => Some(self.ast.ts_string_keyword(SPAN)),
Expression::TemplateLiteral(lit) => {
if lit.expressions.is_empty() {
@ -139,7 +139,7 @@ impl<'a> IsolatedDeclarations<'a> {
pub fn is_need_to_infer_type_from_expression(expr: &Expression) -> bool {
match expr {
Expression::NumericLiteral(_)
| Expression::BigintLiteral(_)
| Expression::BigIntLiteral(_)
| Expression::StringLiteral(_) => false,
Expression::TemplateLiteral(lit) => !lit.expressions.is_empty(),
_ => true,

View file

@ -178,8 +178,8 @@ impl<'a> IsolatedDeclarations<'a> {
Expression::NumericLiteral(lit) => {
Some(self.ast.ts_literal_type(SPAN, TSLiteral::NumericLiteral(self.ast.copy(lit))))
}
Expression::BigintLiteral(lit) => {
Some(self.ast.ts_literal_type(SPAN, TSLiteral::BigintLiteral(self.ast.copy(lit))))
Expression::BigIntLiteral(lit) => {
Some(self.ast.ts_literal_type(SPAN, TSLiteral::BigIntLiteral(self.ast.copy(lit))))
}
Expression::StringLiteral(lit) => {
Some(self.ast.ts_literal_type(SPAN, TSLiteral::StringLiteral(self.ast.copy(lit))))

View file

@ -193,7 +193,7 @@ fn are_literals_and_same_type(left: &Expression, right: &Expression) -> bool {
| (Expression::NullLiteral(_), Expression::NullLiteral(_))
| (Expression::StringLiteral(_), Expression::StringLiteral(_))
| (Expression::NumericLiteral(_), Expression::NumericLiteral(_))
| (Expression::BigintLiteral(_), Expression::BigintLiteral(_))
| (Expression::BigIntLiteral(_), Expression::BigIntLiteral(_))
| (Expression::RegExpLiteral(_), Expression::RegExpLiteral(_))
| (Expression::TemplateLiteral(_), Expression::TemplateLiteral(_))
)

View file

@ -63,7 +63,7 @@ fn is_neg_zero(expr: &Expression) -> bool {
}
match &unary.argument {
Expression::NumericLiteral(number) => number.value == 0.0,
Expression::BigintLiteral(bigint) => bigint.is_zero(),
Expression::BigIntLiteral(bigint) => bigint.is_zero(),
_ => false,
}
}

View file

@ -197,7 +197,7 @@ impl PreferToBe {
matches!(
expr,
Expression::BigintLiteral(_)
Expression::BigIntLiteral(_)
| Expression::BooleanLiteral(_)
| Expression::NumericLiteral(_)
| Expression::NullLiteral(_)

View file

@ -93,7 +93,7 @@ fn get_kind_from_key(key: &PropertyKey) -> MethodKind {
PropertyKey::PrivateIdentifier(_) => MethodKind::Private,
PropertyKey::StringLiteral(_) => MethodKind::Normal,
PropertyKey::NumericLiteral(_)
| PropertyKey::BigintLiteral(_)
| PropertyKey::BigIntLiteral(_)
| PropertyKey::TemplateLiteral(_)
| PropertyKey::RegExpLiteral(_)
| PropertyKey::NullLiteral(_) => MethodKind::Quoted,

View file

@ -85,7 +85,7 @@ fn not_promise(expr: &Expression) -> bool {
| Expression::BooleanLiteral(_)
| Expression::NullLiteral(_)
| Expression::NumericLiteral(_)
| Expression::BigintLiteral(_)
| Expression::BigIntLiteral(_)
| Expression::RegExpLiteral(_)
| Expression::StringLiteral(_)
| Expression::TemplateLiteral(_)

View file

@ -74,7 +74,7 @@ impl Rule for NumberLiteralCase {
fn run<'a>(&self, node: &AstNode<'a>, ctx: &LintContext<'a>) {
let (raw_literal, raw_span) = match node.kind() {
AstKind::NumericLiteral(number) => (number.raw, number.span),
AstKind::BigintLiteral(number) => {
AstKind::BigIntLiteral(number) => {
let span = number.span;
(span.source_text(ctx.source_text()), span)
}

View file

@ -101,7 +101,7 @@ impl Rule for NumericSeparatorsStyle {
);
}
}
AstKind::BigintLiteral(number) => {
AstKind::BigIntLiteral(number) => {
let raw = number.span.source_text(ctx.source_text());
if self.only_if_contains_separator && !raw.contains('_') {

View file

@ -109,7 +109,7 @@ impl<'a, 'b> CheckForStateChange<'a, 'b> for Expression<'a> {
Self::NumericLiteral(_)
| Self::BooleanLiteral(_)
| Self::StringLiteral(_)
| Self::BigintLiteral(_)
| Self::BigIntLiteral(_)
| Self::NullLiteral(_)
| Self::RegExpLiteral(_)
| Self::MetaProperty(_)
@ -395,7 +395,7 @@ pub fn get_bigint_value(expr: &Expression) -> Option<BigInt> {
None
}
}
Expression::BigintLiteral(_bigint_literal) => {
Expression::BigIntLiteral(_bigint_literal) => {
// TODO: evaluate the bigint value
None
}
@ -473,7 +473,7 @@ pub fn get_boolean_value(expr: &Expression) -> Option<bool> {
Expression::NullLiteral(_) => Some(false),
Expression::BooleanLiteral(boolean_literal) => Some(boolean_literal.value),
Expression::NumericLiteral(number_literal) => Some(number_literal.value != 0.0),
Expression::BigintLiteral(big_int_literal) => Some(!big_int_literal.is_zero()),
Expression::BigIntLiteral(big_int_literal) => Some(!big_int_literal.is_zero()),
Expression::StringLiteral(string_literal) => Some(!string_literal.value.is_empty()),
Expression::TemplateLiteral(template_literal) => {
// only for ``
@ -588,7 +588,7 @@ pub fn get_string_value<'a>(expr: &'a Expression) -> Option<Cow<'a, str>> {
Expression::NumericLiteral(number_literal) => {
Some(Cow::Owned(number_literal.value.to_string()))
}
Expression::BigintLiteral(big_int_literal) => {
Expression::BigIntLiteral(big_int_literal) => {
Some(Cow::Owned(big_int_literal.raw.to_string()))
}
Expression::NullLiteral(_) => Some(Cow::Borrowed("null")),

View file

@ -125,7 +125,7 @@ impl<'a> From<&Expression<'a>> for Ty {
fn from(expr: &Expression<'a>) -> Self {
// TODO: complete this
match expr {
Expression::BigintLiteral(_) => Self::BigInt,
Expression::BigIntLiteral(_) => Self::BigInt,
Expression::BooleanLiteral(_) => Self::Boolean,
Expression::NullLiteral(_) => Self::Null,
Expression::NumericLiteral(_) => Self::Number,
@ -616,7 +616,7 @@ impl<'a> Compressor<'a> {
let bool_literal = self.ast.boolean_literal(unary_expr.span, !boolean);
return Some(self.ast.literal_boolean_expression(bool_literal));
}
Expression::BigintLiteral(_) => {
Expression::BigIntLiteral(_) => {
let bool_literal = self.ast.boolean_literal(unary_expr.span, !boolean);
return Some(self.ast.literal_boolean_expression(bool_literal));
}
@ -676,7 +676,7 @@ impl<'a> Compressor<'a> {
);
return Some(self.ast.literal_number_expression(literal));
}
Expression::BigintLiteral(_big_int_literal) => {
Expression::BigIntLiteral(_big_int_literal) => {
// let value = big_int_literal.value.clone().neg();
// let literal =
// self.ast.bigint_literal(unary_expr.span, value, big_int_literal.base);
@ -706,7 +706,7 @@ impl<'a> Compressor<'a> {
return Some(self.ast.literal_number_expression(literal));
}
}
Expression::BigintLiteral(_big_int_literal) => {
Expression::BigIntLiteral(_big_int_literal) => {
// let value = big_int_literal.value.clone().not();
// let leteral =
// self.ast.bigint_literal(unary_expr.span, value, big_int_literal.base);

View file

@ -661,7 +661,7 @@ impl<'a> ParserImpl<'a> {
Expression::BooleanLiteral(literal) => TSLiteral::BooleanLiteral(literal),
Expression::NullLiteral(literal) => TSLiteral::NullLiteral(literal),
Expression::NumericLiteral(literal) => TSLiteral::NumericLiteral(literal),
Expression::BigintLiteral(literal) => TSLiteral::BigintLiteral(literal),
Expression::BigIntLiteral(literal) => TSLiteral::BigIntLiteral(literal),
Expression::RegExpLiteral(literal) => TSLiteral::RegExpLiteral(literal),
Expression::StringLiteral(literal) => TSLiteral::StringLiteral(literal),
Expression::TemplateLiteral(literal) => TSLiteral::TemplateLiteral(literal),

View file

@ -842,7 +842,7 @@ impl<'a> Format<'a> for TSLiteralType<'a> {
TSLiteral::BooleanLiteral(v) => v.format(p),
TSLiteral::NullLiteral(v) => v.format(p),
TSLiteral::NumericLiteral(v) => v.format(p),
TSLiteral::BigintLiteral(v) => v.format(p),
TSLiteral::BigIntLiteral(v) => v.format(p),
TSLiteral::RegExpLiteral(v) => v.format(p),
TSLiteral::StringLiteral(v) => v.format(p),
TSLiteral::TemplateLiteral(v) => v.format(p),
@ -1250,7 +1250,7 @@ impl<'a> Format<'a> for Expression<'a> {
Self::BooleanLiteral(lit) => lit.format(p),
Self::NullLiteral(lit) => lit.format(p),
Self::NumericLiteral(lit) => lit.format(p),
Self::BigintLiteral(lit) => lit.format(p),
Self::BigIntLiteral(lit) => lit.format(p),
Self::RegExpLiteral(lit) => lit.format(p),
Self::StringLiteral(lit) => lit.format(p),
Self::Identifier(ident) => ident.format(p),

View file

@ -35,7 +35,7 @@ impl<'a, 'b> DebugDotContext<'a, 'b> {
AstKind::NumericLiteral(lit) => Some(lit.value.to_string()),
AstKind::BooleanLiteral(lit) => Some(lit.value.to_string()),
AstKind::StringLiteral(lit) => Some(lit.value.to_string()),
AstKind::BigintLiteral(lit) => Some(lit.raw.to_string()),
AstKind::BigIntLiteral(lit) => Some(lit.raw.to_string()),
AstKind::NullLiteral(_) => Some("null".to_string()),
_ => None,
}

View file

@ -77,7 +77,7 @@ pub(crate) unsafe fn walk_expression<'a, Tr: Traverse<'a>>(
Expression::NumericLiteral(node) => {
walk_numeric_literal(traverser, (&mut **node) as *mut _, ctx)
}
Expression::BigintLiteral(node) => {
Expression::BigIntLiteral(node) => {
walk_big_int_literal(traverser, (&mut **node) as *mut _, ctx)
}
Expression::RegExpLiteral(node) => {
@ -264,7 +264,7 @@ pub(crate) unsafe fn walk_array_expression_element<'a, Tr: Traverse<'a>>(
ArrayExpressionElement::BooleanLiteral(_)
| ArrayExpressionElement::NullLiteral(_)
| ArrayExpressionElement::NumericLiteral(_)
| ArrayExpressionElement::BigintLiteral(_)
| ArrayExpressionElement::BigIntLiteral(_)
| ArrayExpressionElement::RegExpLiteral(_)
| ArrayExpressionElement::StringLiteral(_)
| ArrayExpressionElement::TemplateLiteral(_)
@ -398,7 +398,7 @@ pub(crate) unsafe fn walk_property_key<'a, Tr: Traverse<'a>>(
PropertyKey::BooleanLiteral(_)
| PropertyKey::NullLiteral(_)
| PropertyKey::NumericLiteral(_)
| PropertyKey::BigintLiteral(_)
| PropertyKey::BigIntLiteral(_)
| PropertyKey::RegExpLiteral(_)
| PropertyKey::StringLiteral(_)
| PropertyKey::TemplateLiteral(_)
@ -713,7 +713,7 @@ pub(crate) unsafe fn walk_argument<'a, Tr: Traverse<'a>>(
Argument::BooleanLiteral(_)
| Argument::NullLiteral(_)
| Argument::NumericLiteral(_)
| Argument::BigintLiteral(_)
| Argument::BigIntLiteral(_)
| Argument::RegExpLiteral(_)
| Argument::StringLiteral(_)
| Argument::TemplateLiteral(_)
@ -1679,7 +1679,7 @@ pub(crate) unsafe fn walk_for_statement_init<'a, Tr: Traverse<'a>>(
ForStatementInit::BooleanLiteral(_)
| ForStatementInit::NullLiteral(_)
| ForStatementInit::NumericLiteral(_)
| ForStatementInit::BigintLiteral(_)
| ForStatementInit::BigIntLiteral(_)
| ForStatementInit::RegExpLiteral(_)
| ForStatementInit::StringLiteral(_)
| ForStatementInit::TemplateLiteral(_)
@ -3057,7 +3057,7 @@ pub(crate) unsafe fn walk_export_default_declaration_kind<'a, Tr: Traverse<'a>>(
ExportDefaultDeclarationKind::BooleanLiteral(_)
| ExportDefaultDeclarationKind::NullLiteral(_)
| ExportDefaultDeclarationKind::NumericLiteral(_)
| ExportDefaultDeclarationKind::BigintLiteral(_)
| ExportDefaultDeclarationKind::BigIntLiteral(_)
| ExportDefaultDeclarationKind::RegExpLiteral(_)
| ExportDefaultDeclarationKind::StringLiteral(_)
| ExportDefaultDeclarationKind::TemplateLiteral(_)
@ -3336,7 +3336,7 @@ pub(crate) unsafe fn walk_jsx_expression<'a, Tr: Traverse<'a>>(
JSXExpression::BooleanLiteral(_)
| JSXExpression::NullLiteral(_)
| JSXExpression::NumericLiteral(_)
| JSXExpression::BigintLiteral(_)
| JSXExpression::BigIntLiteral(_)
| JSXExpression::RegExpLiteral(_)
| JSXExpression::StringLiteral(_)
| JSXExpression::TemplateLiteral(_)
@ -3693,7 +3693,7 @@ pub(crate) unsafe fn walk_ts_enum_member_name<'a, Tr: Traverse<'a>>(
TSEnumMemberName::BooleanLiteral(_)
| TSEnumMemberName::NullLiteral(_)
| TSEnumMemberName::NumericLiteral(_)
| TSEnumMemberName::BigintLiteral(_)
| TSEnumMemberName::BigIntLiteral(_)
| TSEnumMemberName::RegExpLiteral(_)
| TSEnumMemberName::StringLiteral(_)
| TSEnumMemberName::TemplateLiteral(_)
@ -3786,7 +3786,7 @@ pub(crate) unsafe fn walk_ts_literal<'a, Tr: Traverse<'a>>(
TSLiteral::NumericLiteral(node) => {
walk_numeric_literal(traverser, (&mut **node) as *mut _, ctx)
}
TSLiteral::BigintLiteral(node) => {
TSLiteral::BigIntLiteral(node) => {
walk_big_int_literal(traverser, (&mut **node) as *mut _, ctx)
}
TSLiteral::RegExpLiteral(node) => {