mirror of
https://github.com/swc-project/swc.git
synced 2024-12-03 00:54:25 +03:00
perf(es/parser): Make typescript parser faster (#2483)
swc_ecma_parser: - Check for option before backtracking.
This commit is contained in:
parent
b0361caa58
commit
bf886bac73
2
Cargo.lock
generated
2
Cargo.lock
generated
@ -2710,7 +2710,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "swc_ecma_parser"
|
||||
version = "0.75.0"
|
||||
version = "0.75.1"
|
||||
dependencies = [
|
||||
"either",
|
||||
"enum_kind",
|
||||
|
@ -7,7 +7,7 @@ include = ["Cargo.toml", "src/**/*.rs", "examples/**/*.rs"]
|
||||
license = "Apache-2.0/MIT"
|
||||
name = "swc_ecma_parser"
|
||||
repository = "https://github.com/swc-project/swc.git"
|
||||
version = "0.75.0"
|
||||
version = "0.75.1"
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
all-features = true
|
||||
|
@ -35,7 +35,7 @@ impl<'a, I: Tokens> Parser<I> {
|
||||
pub(super) fn parse_assignment_expr(&mut self) -> PResult<Box<Expr>> {
|
||||
trace_cur!(self, parse_assignment_expr);
|
||||
|
||||
if self.input.syntax().typescript() {
|
||||
if self.input.syntax().typescript() && self.input.syntax().jsx() {
|
||||
// Note: When the JSX plugin is on, type assertions (`<T> x`) aren't valid
|
||||
// syntax.
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user