Commit Graph

252 Commits

Author SHA1 Message Date
Donny/강동윤
6f81cb9c32
fix(es/parser): Fix handling of in and out of typescript (#7308)
**Related issue:**

 - Closes #7305.
2023-04-21 15:11:18 +09:00
Cong-Cong Pan
635bf8116b
refactor(es/parser): Remove :: token as it's not used (#7268) 2023-04-15 02:17:37 +00:00
David Sherret
6614886192
fix(es/parser): Parse const type parameters in arrow function expressions (#7242) 2023-04-11 02:11:04 +00:00
Donny/강동윤
01db30f91e
fix(es/parser): Reset ctx for cond while parsing a stmt (#7232) 2023-04-10 10:45:49 +00:00
Yukang
b1c40a411f
fix(es/parser): Use a hard error for missing r-paren in an if stmt (#7223)
**Related issue:**

 - Closes https://github.com/swc-project/swc/issues/7104.
2023-04-10 08:46:01 +00:00
Marvin Hagemeister
414e66910d
fix(es/parser): Fix infinite loop on jsx in js (#7191) 2023-04-02 22:14:29 +00:00
Donny/강동윤
0259a7465f
build(cargo): Update rustc to nightly-2023-03-20 (#7170)
**Description:**

This PR also updates `rkyv` to `=0.7.40`.

**Related issue:**

 - Closes https://github.com/swc-project/swc/issues/6807.
2023-03-30 08:06:02 +00:00
Donny/강동윤
12546c853a
build(cargo): Revert rustc upgrade (#7162)
**Description:**

The `rkyv` bug is not fixed.
2023-03-29 17:48:45 +09:00
Donny/강동윤
e445502072
build(cargo): Update rustc to nightly-2023-03-28 (#7154)
**Description:**

This PR also updates `rkyv` to `=0.7.40`.

**Related issue:**

 - Closes https://github.com/swc-project/swc/issues/6807.
2023-03-29 06:24:19 +00:00
Donny/강동윤
915f747cb7
refactor(es/parser): Remove EnumKind to reduce compile time (#7137) 2023-03-24 11:40:26 +09:00
Crayon
dd2b16db9e
fix(es/parser): Fix parsing of static accessors (#7108)
**Related issue:**

 - Closes https://github.com/swc-project/swc/issues/7107.
2023-03-21 07:19:45 +00:00
Donny/강동윤
963c460613
refactor: Fix lints using clippy from nightly-2023-03-13 (#6920) 2023-03-14 04:56:21 +00:00
Donny/강동윤
f854d51343
perf(es/lexer): Use jump table for skip_space (#7073) 2023-03-13 08:32:49 +00:00
Donny/강동윤
085c6f35f1
fix(es/ast): Fix memory layout (#7062)
**Related issue:**

 - Closes https://github.com/swc-project/swc/issues/7061.
2023-03-12 04:50:28 +00:00
Donny/강동윤
9beefaa1d5
perf(es/lexer): Use jump table for read_token (#7058) 2023-03-11 12:13:00 +00:00
Donny/강동윤
d1d0607158
perf(es/lexer): Make lexer faster (#7052) 2023-03-11 03:43:06 +00:00
suxin2017
9acaf4deeb
fix(es/parser): Handle class members with accessor as the name (#7046)
**Related issue:**

 - Closes https://github.com/swc-project/swc/issues/7042.
2023-03-10 06:26:14 +00:00
Donny/강동윤
962b0fc8af
perf(es/lexer): Use string searcher for lexing line comments (#7043) 2023-03-10 03:52:14 +00:00
Donny/강동윤
a9fe1d2d22
perf(es/ast): Shrink size of Expr (#7041)
**Related issue:**

 - Closes https://github.com/swc-project/swc/issues/7019.
2023-03-09 13:34:11 +00:00
Donny/강동윤
f378a14888
perf(es/parser): Use SmartString as the buffer (#7033) 2023-03-09 08:07:40 +00:00
Donny/강동윤
30546a28f2
perf(es/parser): Use Cow for _ in numeric literals (#7031) 2023-03-08 04:54:28 +00:00
IWANABETHATGUY
6d6731f355
fix(es/parser): Fix parsing of an array spread in tsx properties (#7011) 2023-03-05 07:28:01 +00:00
Daiki Nishikawa
a6471f34c0
feat(es/parser): Add an option to disallow ambiguous jsx (#6913) 2023-03-03 02:47:09 +00:00
Donny/강동윤
367ac825f6
refactor(es/parser): Make lexer not generic over Input (#6993)
**Description:**

Currently, it uses `StringInput` as the input type, but I'll refactor it to use `String` or `Vec<u8>` directly to optimize it further.

**Related issue:**

 - https://github.com/swc-project/swc/discussions/6991
2023-02-28 08:20:29 +00:00
Donny/강동윤
37533a23fd
feat(es/parser): Support auto accessors (#6981) 2023-02-28 06:39:25 +00:00
magic-akari
beb38d34a2
feat(es/typescript): Support export type * from "mod" (#6867) 2023-02-28 06:01:37 +00:00
IWANABETHATGUY
f1e7a2a9cc
chore(es/parser): Reduce pre-allocation to reduce memory usage (#6979)
**Related issue:**

 - Closes https://github.com/swc-project/swc/issues/6966.
2023-02-22 14:17:45 +00:00
Donny/강동윤
4c5d5a6fca
fix(es/parser): Don't use stacker for armv7 (#6916) 2023-02-08 05:14:41 +00:00
Donny/강동윤
f36d945a33
fix(es/parser): Fix stack overflow due to deeply nested if (#6910)
**Related issue:**

 - Closes https://github.com/swc-project/swc/issues/6813.
2023-02-07 14:33:13 +00:00
Donny/강동윤
60d9403073
fix(es/parser): Fix parsing of generics (#6859)
**Related issue:**

 - Closes https://github.com/swc-project/swc/issues/6851.
2023-01-27 06:57:19 +00:00
HeYunfei
ff8facef64
fix(es/parser): Allow parsing import.meta as an expression (#6783) 2023-01-11 02:58:25 +00:00
magic-akari
019cf37199
feat(es/typescript): Support const modifier on type parameters (#6672)
**Related issue:**

 - https://github.com/microsoft/TypeScript/pull/51865.
2023-01-10 05:08:29 +00:00
Donny/강동윤
65a0d3a310
fix(es/parser): Fix priority of >>> (#6748)
**Related issue:**

 - Closes https://github.com/swc-project/swc/issues/6739.
2023-01-04 07:27:08 +00:00
Alexander Akait
c44f1d0a7f
fix(es/parser): Parse types in CallExpression inside templates (#6611)
**Related issue:**

 - Closes https://github.com/swc-project/swc/issues/6601.
2022-12-10 00:05:25 +00:00
Alexander Akait
ad95ead291
fix(es/parser): Fix parsing of JSX with ASI (#6577)
**Related issue:**

 - Closes https://github.com/swc-project/swc/issues/6522.
2022-12-06 09:50:26 +09:00
Alexander Akait
aa28aa0c7f
fix(es/parser): Fix typeof in TSCallSignatureDeclaration (#6553)
**Related issue:**

 - Closes https://github.com/swc-project/swc/issues/6430
2022-11-30 17:09:53 +00:00
Donny/강동윤
cb157215d2
feat(es/parser): Make error message helpful (#6535)
**Related issue:**

 - Closes https://github.com/swc-project/swc/issues/6525.
2022-11-29 05:57:23 +00:00
Austaras
c57307d002
refactor(es): Remove settings related to privateInObject (#6468) 2022-11-21 08:34:20 +09:00
Alexander Akait
3e702b9804
fix(es/parser): Fix parsing of regexp (#6469)
**Related issue:**

 - Closes https://github.com/swc-project/swc/issues/6322.
 - Closes https://github.com/swc-project/swc/issues/6323.
2022-11-18 07:16:22 +00:00
Daiki Nishikawa
f6faeb3bad
fix(es/parser): Fix parsing of TS satisfies expressions (#6354) 2022-11-07 03:56:15 +00:00
Alexander Akait
28af15e475
fix(es/parser): Fix parsing of await (#6316) 2022-11-03 04:52:11 +00:00
Maxime
61e63df0a0
chore(es/parser): Typo (#6228) 2022-10-21 23:48:15 +00:00
Donny/강동윤
0ca5ded618
fix(es/parser): Fix parsing of arrow in cond (#6067)
**Related issue:**

 - Closes https://github.com/swc-project/swc/issues/4911.
2022-10-17 08:31:11 +00:00
John Daly
cdd69d0145
fix(es/parser): Allow as in destructuring assignment (#5948) 2022-09-25 10:29:33 +09:00
Donny/강동윤
5cddb4c734
feat(es/typescript): Support TS 4.9 (#5938)
**Description:**

This PR adds satisfaction expression to the AST and parser.
2022-09-23 16:41:56 +09:00
Donny/강동윤
1a182ef8d9
perf(es): Optimize memory layout of AST (#5829) 2022-09-20 12:47:21 +09:00
Donny/강동윤
dfb01bde71
refactor: Refactor code using clippy (#5863)
**Description:**

I temporarily updated rustc to use newer version of `cargo clippy`.
2022-09-14 15:05:59 +00:00
magic-akari
10637b006f
fix(es/parser): Handle more TS1185 (#5834) 2022-09-13 02:16:22 +00:00
Donny/강동윤
10484edbf7
perf(es/parser): Optimize memory layout (#5833)
**Description:**

I boxed `BigIntValue` in the `Token` type to make `TokenAndSpan` smaller and made the parser use `Vec` instead of `SmallVec` for token contexts.
2022-09-12 05:14:09 +00:00
RiESAEX
8adbe1675e
fix(es/parser): Keep comments of the RHS of a binary expression (#5812) 2022-09-11 02:58:06 +00:00
IWANABETHATGUY
97729e5d2b
feat(es/parser): Improve jsx lexer (#5805) 2022-09-11 00:03:51 +09:00
magic-akari
9c998d4406
fix(es): Use paren_remover pass (#5753)
**Description:**

We now apply the paren_remover pass before applying other transforms.

**Related issue:**
 - Closes #5652 
 - Closes #5752
2022-09-09 05:02:24 +00:00
magic-akari
7deadd8667
feat(es/lexer): Recover from git merge conflict (#5775) 2022-09-08 04:24:44 +00:00
Donny/강동윤
c10d55780e
perf(es/parser): Operate on u8 (#5774) 2022-09-07 06:13:32 +00:00
IWANABETHATGUY
9fc6eda89a
fix(es/parser): Fix detection of wrong delete targets (#5754) 2022-09-05 13:36:24 +00:00
magic-akari
a3a7277909
fix(es/lexer): Drop ClassExpr context in object properties (#5729) 2022-09-03 15:08:13 +00:00
IWANABETHATGUY
383aa8510c
fix(es/parser): Improve error message (#5719) 2022-09-02 07:40:52 +00:00
magic-akari
6c2c2587ff
perf(es/lexer): Improve keyword tokenizer (#5658) 2022-08-29 11:27:11 +00:00
magic-akari
0f0d1db301
feat(es/parser): Handle async in for...of (#5646) 2022-08-27 15:44:51 +00:00
magic-akari
838438dc9d
fix(es/parser): Handle more TS2406 errors (#5640) 2022-08-26 14:13:38 +00:00
magic-akari
c3f62586bf
fix(es/parser): Fix false-positives of yield used as a parameter in generator (#5564) 2022-08-21 08:30:54 +00:00
magic-akari
78dd071dab
fix(es/parser): Allow expr to follow ClassExpr (#5572) 2022-08-20 16:15:47 +00:00
Alexander van Ratingen
75c8e09d6d
feat(api/rust): Implement more traits for public types (#5488) 2022-08-17 06:43:32 +00:00
Donny/강동윤
3eb1f4b2b1
chore(ci): Fix lints (#5462) 2022-08-12 13:13:35 +00:00
Donny/강동윤
037a53d5d1
perf(es/ast): Use Atom in some places (#5271) 2022-07-22 20:09:25 +09:00
magic-akari
ec9378370d
fix(es/parser): Fix parsing of export specifiers (#5190) 2022-07-13 10:55:55 +00:00
Austaras
375774d31e
fix(es): Check the syntax context of arguments (#5174) 2022-07-13 10:29:03 +00:00
三丝
9d4be11f2e
doc(es/parser): Typo (#5136) 2022-07-07 07:23:21 +00:00
Edwin Coronado
2d94797975
feat(es/parser): Support d in regex flag for es2022 (#5127) 2022-07-07 04:35:49 +00:00
magic-akari
fbfca36f58 fix(es/parser): Support type-only export-import declarations (#5122) 2022-07-06 16:51:18 +09:00
Austaras
b62fd3e6cc
feat(es/parser): Support labelled function from annex B (#5078) 2022-07-02 04:45:22 +00:00
Alexander Akait
37eb366a1f
feat(es/parser): Add allow_return_outside_function to options (#5046) 2022-06-29 11:02:05 +00:00
magic-akari
f238093c3b
fix(es/parser): Allow initializer of the var of for-in loop in non-strict mode (#5038) 2022-06-25 10:02:43 +00:00
Pig Fang
a62b2b3244
fix(es/parser): Allow instantiation expression followed by a line break or a binary operator (#5000) 2022-06-19 17:52:05 +00:00
magic-akari
53a8cb1209
fix(es/parser): Don't panic on an invalid import meta property (#4994) 2022-06-18 10:00:52 +00:00
Pig Fang
36ef3e4507
fix(es/parser): Fix binary operator parsed as an instantiation expression (#4992) 2022-06-18 03:26:39 +00:00
LongYinan
db9f7a5ad4
chore(ci): Fix publish build on Windows (#4970) 2022-06-14 15:58:10 +00:00
Donny/강동윤
3e03ebf8bb
fix(es/parser): Don't assume the length of char (#4967) 2022-06-14 07:05:35 +00:00
magic-akari
381d273f11
fix(es/parser): Check for line break after async (#4940) 2022-06-11 08:10:49 +00:00
magic-akari
11db191af5
fix(es/parser): Allow negative bigint literal in types (#4938) 2022-06-11 04:15:21 +00:00
Donny/강동윤
fd3501bf87
feat(wasm): Add json error (#4853) 2022-06-01 11:51:24 +09:00
Donny/강동윤
f847709787
chore(common): Update rustc (#4828) 2022-05-28 07:07:58 +00:00
Donny/강동윤
b7a195a1cf
refactor(es/parser): Remove duplicate (#4750) 2022-05-23 09:42:29 +00:00
Donny/강동윤
98df64517e
perf(common): Add more methods to Spanned (#4749)
- Lots of code only needs `lo` or `hi`, but they call `span()`, which is inefficient in some cases.
 - This PR only adds a trivial amount of optimization. I may add full optimization in future.
 - This PR improves codegen performance of `ExprOrSpread` and `Option<ExprOrSpread>`.
2022-05-23 09:18:40 +00:00
Donny/강동윤
98e4845fce
build(repo): Update rustc (#4667) 2022-05-15 09:03:54 +00:00
Donny/강동윤
11726cc0e1
perf(es/parser): Optimize for cpu code cache (#4666) 2022-05-15 08:39:09 +00:00
Donny/강동윤
67942d5731
feat(common): Reserve BytePos(0) for dummy spans (#4616) 2022-05-11 16:14:42 +00:00
William Tetlow
e2fde1a9a7
fix(es/parser): Revert #4287 (#4542) 2022-05-06 04:07:00 +00:00
William Tetlow
28310596a6
fix(es/parser): Revert #4067 (#4540) 2022-05-06 12:46:15 +09:00
Pig Fang
0e0ded121c
feat(es/parser): Reject accessors named constructor (#4520) 2022-05-04 05:45:57 +00:00
Pig Fang
857e798194
feat(es/parser): Reject private field called #constructor (#4491) 2022-04-30 12:56:55 +00:00
Pig Fang
393cfa84b6
fix(es/parser): Throw syntax error for missing function expr body (#4462) 2022-04-28 02:08:17 +00:00
Pig Fang
df7b3f611a
feat(es/parser): Reject indirect opt chain in assignment (#4447) 2022-04-27 03:07:57 +00:00
Pig Fang
465cc2f929
fix(es/parser): Fix top-level await with binary expr (#4426) 2022-04-25 23:10:59 +00:00
Pig Fang
6dc64c9ca0
feat(es/parser): Reject 'use strict' with non-simple params list in TS (#4416) 2022-04-24 03:04:38 +00:00
Pig Fang
da02c9dc50
feat(es/parser): Reject invalid new.target (#4406) 2022-04-23 14:45:11 +00:00
Pig Fang
c96e32243c
feat(es/parser): Reject invalid regex flags (#4404) 2022-04-23 05:43:52 +00:00
Pig Fang
59f63da560
feat(es/parser): Reject await expr with ** (#4395) 2022-04-22 01:40:14 +00:00
Hannes Bornö
3bdf5a8960
fix(es/lexer): Fix handling of object properties with the name function (#4374) 2022-04-20 07:14:20 +09:00
Pig Fang
31b3336cd5
fix(es/parser): Reject optional constructor call (#4340) 2022-04-16 15:18:14 +00:00