mirror of
https://github.com/danbulant/oxc
synced 2026-05-24 12:21:58 +00:00
refactor(parser): remove some unused expression branchings
This commit is contained in:
parent
6cbfc29c90
commit
d29bf62904
1 changed files with 2 additions and 7 deletions
|
|
@ -141,8 +141,8 @@ impl<'a> Parser<'a> {
|
||||||
self.eat_decorators()?;
|
self.eat_decorators()?;
|
||||||
}
|
}
|
||||||
|
|
||||||
// AsyncFunctionExpression
|
// FunctionExpression, GeneratorExpression
|
||||||
// AsyncGeneratorExpression
|
// AsyncFunctionExpression, AsyncGeneratorExpression
|
||||||
if self.at_function_with_async() {
|
if self.at_function_with_async() {
|
||||||
let r#async = self.eat(Kind::Async);
|
let r#async = self.eat(Kind::Async);
|
||||||
return self.parse_function_expression(span, r#async);
|
return self.parse_function_expression(span, r#async);
|
||||||
|
|
@ -156,8 +156,6 @@ impl<'a> Parser<'a> {
|
||||||
Kind::LBrack => self.parse_array_expression(),
|
Kind::LBrack => self.parse_array_expression(),
|
||||||
// ObjectLiteral
|
// ObjectLiteral
|
||||||
Kind::LCurly => self.parse_object_expression(),
|
Kind::LCurly => self.parse_object_expression(),
|
||||||
// FunctionExpression, GeneratorExpression
|
|
||||||
Kind::Function => self.parse_function_expression(span, false),
|
|
||||||
// ClassExpression
|
// ClassExpression
|
||||||
Kind::Class => self.parse_class_expression(),
|
Kind::Class => self.parse_class_expression(),
|
||||||
// This
|
// This
|
||||||
|
|
@ -235,9 +233,6 @@ impl<'a> Parser<'a> {
|
||||||
let literal = self.parse_literal_null();
|
let literal = self.parse_literal_null();
|
||||||
Ok(self.ast.literal_null_expression(literal))
|
Ok(self.ast.literal_null_expression(literal))
|
||||||
}
|
}
|
||||||
Kind::RegExp => self
|
|
||||||
.parse_literal_regexp()
|
|
||||||
.map(|literal| self.ast.literal_regexp_expression(literal)),
|
|
||||||
kind if kind.is_number() => {
|
kind if kind.is_number() => {
|
||||||
if self.cur_src().ends_with('n') {
|
if self.cur_src().ends_with('n') {
|
||||||
self.parse_literal_bigint()
|
self.parse_literal_bigint()
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue