Commit graph

177 commits

Author SHA1 Message Date
Boshen
567c6ed757
feat(prettier): print directives (#1497) 2023-11-22 19:39:25 +08:00
JonaAnders
08164b0e18
refactor(parser) Updated comments mentioning the ecma specification section 12.x (#1496)
The ECMA specification seems to added the "Tokens" section to the
specification as 12.6. This pushed all the other sections down,
resulting in e.g. former 12.6 now being 12.7. Comments in the parser
mention this part of the specification. All the mentions of section
12.6+ therefor are outdated now. This pull request tries to fix that by
updating all the comments.
2023-11-22 19:29:04 +08:00
Boshen
07b010912a
feat(parser): add preserve_parens option (default: true) (#1474)
closes #1461
2023-11-21 11:16:30 +08:00
magic-akari
a7e0706dbc
fix(parser): correct import_kind of TSImportEqualsDeclaration (#1449) 2023-11-20 16:57:38 +08:00
Boshen
0218ae8641
feat(prettier): print leading comments with newlines (#1434) 2023-11-19 22:46:55 +08:00
Jon Surrell
cb804d3cd2
Add base to AST BigintLiteral (#1416) 2023-11-19 11:11:19 +08:00
magic-akari
445352991f
fix(parser): Fix type import (#1291)
- fix: #1288 
- fix: #1289
2023-11-14 15:17:58 +08:00
magic-akari
9c0aafcd1c
fix(parser): Disallow ReservedWord in NamedExports (#1230)
- fix: #1222

---------

Co-authored-by: Boshen <boshenc@gmail.com>
2023-11-12 10:52:02 +00:00
magic-akari
8afb81aa34
fix(parser): ASI of async class member (#1214)
Co-authored-by: Boshen <boshenc@gmail.com>
2023-11-10 16:21:51 +00:00
Boshen
a455c81db6
fix(linter): revert changes to JSX attribute strings (#1101) 2023-10-30 15:26:04 +08:00
Boshen
6295f9ce18
fix(ast): jsx attribute value and text child should be jsx string (#1089) 2023-10-29 15:32:24 +08:00
Boshen
af1a76bafa
feat(transformer): implement some of needs_explicit_esm for typescript (#1047)
Co-authored-by: magic-akari <akari.ccino@gmail.com>
2023-10-24 17:30:01 +08:00
Boshen
854b55a3e6
feat(codegen): json strings proposal (#1039) 2023-10-23 18:29:30 +08:00
Cameron
76ac9cd4c5
fix(lexer) Fix spans for jsx children (#1030)
Closes #1026
2023-10-22 22:44:19 +08:00
Boshen
4886d408eb
chore(clippy): enable undocumented_unsafe_blocks 2023-10-16 15:18:14 +08:00
Boshen
db5417f9a9
refactor(clippy): allow clippy::too_many_lines 2023-10-16 15:18:11 +08:00
Boshen
47872200e5
refactor(ast): clean up some methods 2023-10-15 10:49:35 +08:00
Boshen
55b2f031df
feat(minifier): partially re-enable minifier (#963)
closes #949
closes #950
closes #951

All minifier tests are disable from this PR.

We are going to fix the compilation errors first, then the behavioral
errors.
2023-10-08 11:06:42 +08:00
Boshen
5045853b9a
Rust 1.73.0 (#958) 2023-10-06 17:56:14 +13:00
Cameron
5b1e1e5408
feat(parser): TypeScript 5.2 (#811)
- adds support for [Using
Declarations](https://devblogs.microsoft.com/typescript/announcing-typescript-5-2/#using-declarations-and-explicit-resource-management)

Closes #786
2023-10-05 12:52:14 +13:00
IWANABETHATGUY
266253c142
fix: ts parsing error (#940)
Fixed https://github.com/web-infra-dev/oxc/issues/932
2023-09-29 22:02:56 +13:00
Boshen
70189f9758
refactor(ast): change the arguments order for some new functions 2023-09-16 16:07:52 +08:00
Boshen
f447cf3a3b
perf(lexer): only check the first lower case for match_keyword (#913) 2023-09-14 23:19:16 +08:00
Boshen
7962e81a43
perf(lexer): remove an extra branch from identifier_name_handler (#912) 2023-09-14 22:42:38 +08:00
Boshen
babbc47d61
perf(parser): lazily build trivia map instead of build in-place (#903)
closes #898
2023-09-12 23:23:56 +08:00
Boshen
1793397f20
perf(parser): remove an extra branch from parse_member_expression_rhs hot path (#896) 2023-09-11 23:25:19 +08:00
Boshen
7c8e6ab6f6
fix(parser): parse [+In] in object binding initializer (#874)
closes #873
2023-09-09 14:54:20 +08:00
Boshen
d25355c9e8
perf(lexer): reduce an extra branch from peek (#841) 2023-09-03 00:02:42 +08:00
EliLichtblau
6a9d57061c
TSTypeName change identifer name to identifier reference (#804)
When initially written types were not in the symbol table. Now that
types are in the symbol table it makes sense given
```ts
type A = 1
type B = A
```
that you can get to the symbol id for for A from type B = A.

Please correct me if I'm wrong about how I implemented this. I also
verified that occurrence (I believe this is the correct word) behaves
how I would expect.

```ts
type RecursiveType = string | {[x: string]: RecursiveType}
```
Does populate a reference.

---------

Co-authored-by: Boshen <boshenc@gmail.com>
2023-08-28 11:42:21 +08:00
Boshen
dd7749f949
improve README (#800)
closes #686

Rendered: https://github.com/web-infra-dev/oxc/blob/readme/README.md

This is a refinement for the README, which should include information
for different interests: first time reader, explorer, rust crate / napi
user etc.
2023-08-27 22:36:17 +08:00
Boshen
12798e075f
refactor: improve code coverage a little bit 2023-08-25 23:07:14 +08:00
Boshen
a272c1ffe4
perf(lexer): reduce checks on ident -> keyword (#783) 2023-08-24 18:43:03 +08:00
Boshen
c8a215ea5e
perf(lexer): jump table (#779) 2023-08-24 15:02:06 +08:00
Yunfei He
e7c2313817
feat(ast): add SymbolId and ReferenceId (#755)
Closes #510
2023-08-19 18:09:47 +08:00
Boshen
2f48bdf26f
fix(parser,semantic): make semantic own Trivias (#711)
closes #708

Making the parser return Rc<Trivias> is not a good API, and ideally
`Semantic` should just own `Trivias` so it can process or mutate it.
2023-08-10 15:30:32 +08:00
Yunfei He
35167599bc
refactor(ast): use atom for Directive and Hashbang (#701)
The main reason is using Atom to remove the lifetime for convenience.

And after removing the lifetime of these nodes, the `Program<'a>`
doesn't rely on `&'a source` anymore, which allows us to [specify more
accurate
lifetimes](https://github.com/web-infra-dev/oxc/discussions/700).
2023-08-09 13:52:56 +08:00
EliLichtblau
5e54bd0537
Adding types to the symbol table - consistent export type sample rule implemented (#667)
Fixes 11 TS conformance tests and 18 babel tests.

Adds types to the symbol table functionally conformant to TS behavior
but symbol flags implemented slightly differently.

Symbol redeclaration check is also not entirely conformant but fixing
this seems like a separate PR.

For testing purposes - consistent-export-type was also implemented
(WIP).
2023-07-31 12:33:47 +08:00
Boshen
b34ef4f07a chore: reformat 2023-07-27 13:11:46 +08:00
Boshen
608ee9116b
refactor(parser): remove portable simd because it is not stable Rust (#645)
related #626
2023-07-27 12:43:11 +08:00
Sg
2203d08199
refactor: remove unstable feature slice_as_chunks (#632) 2023-07-26 19:21:35 +08:00
Boshen
8aba8bcbb5
feat(oxc): a single oxc crate (#522) 2023-07-06 13:35:25 +08:00
Boshen
6428139b76
fix(parser): fix re_lex_jsx_identifier not omitting whitespaces
closes #518
2023-07-05 12:53:21 +08:00
Boshen
e25f6e2dd4
chore(rust): rust cargo fmt and fix clippy warnings 2023-07-04 15:41:30 +08:00
Boshen
2be637c6ea
feat(linter): implement no_sparse_arrays 2023-06-28 23:03:40 +08:00
阿良仔
26c3ece37c
feat: handle UnaryOpsWithBigInt (#475) 2023-06-25 22:37:36 +08:00
Boshen
925cee20c1
feat(parser): parse TypeScript this function parameter (#464) 2023-06-20 21:56:28 +08:00
Boshen
19b839efe9
perf(semantic): use IndexVec instead of indextree for ast nodes (#462) 2023-06-20 15:21:58 +08:00
Boshen
166af12b9d
fix(parser): compile in wasm 2023-06-13 17:42:40 +08:00
Carter Snook
c0726e444f
feat(lexer): use linear lexing on WASM (#436)
Co-authored-by: Boshen <boshenc@gmail.com>
2023-06-13 15:18:02 +08:00
Carter Snook
985b8f21d9
feat: support hashbang interpreter comments (#431) 2023-06-11 23:55:58 +08:00