Commit graph

149 commits

Author SHA1 Message Date
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
Boshen
1ed8df2d83
feat(parser): parse const type parameter from TypeScript v5.0 (#416) 2023-06-08 22:26:35 +08:00
Carter Snook
23d2a9f6d7
chore(typo): expect -> except (#415) 2023-06-08 14:28:29 +08:00
Wenzhe Wang
1a31c76ee9
refactor(minifier): reduce and clean match checks (#406) 2023-06-06 12:46:13 +08:00
Boshen
f8125af850 feat(minimizer): print parentheses 2023-06-01 22:45:26 +08:00
Wenzhe Wang
4109c8b8a5
feat(parser): distinguish exponential number (#399) 2023-06-01 15:15:22 +08:00
Boshen
c01df484db
refactor(hir,syntax): define Precedence for hir expressions 2023-05-29 14:15:14 +08:00
Boshen
4706427575
refactor(syntax): move expression precedence from parser 2023-05-29 12:25:22 +08:00
Boshen
24f11a4ea8
refactor(syntax): move identifier related code from lexer to syntax 2023-05-27 11:00:02 +08:00
Boshen
a31c7ac77a
refactor(index): use static_assertions 2023-05-24 22:53:11 +08:00
Boshen
6811d67eb3
refactor(ast): move NumberBase to oxc_syntax; add NumberBase::Float 2023-05-24 18:33:19 +08:00
Boshen
ad33954f52
refactor(ast): remove redundant prefix field from UnaryExpression 2023-05-22 22:32:47 +08:00
Boshen
a8641b9921
chore(parser): move inline tests to snapshot testing 2023-05-21 12:05:25 +08:00
Boshen
ad2835f11b
chore(rustfmt): run cargo fmt 2023-05-21 11:52:26 +08:00
Boshen
a0b09a3f27
refactor(ast): remove RestElement from BindingPattern 2023-05-16 22:25:52 +08:00
Boshen
e52ee63cbb
refactor(ast): clean up BindingProperty 2023-05-16 22:24:34 +08:00
Boshen
af95b59a0e
feat(ast): split Property into ObjectProperty and BindingProperty (#361) 2023-05-16 15:51:50 +08:00
Boshen
2812591e4a
chore(rust): allow clippy::new_without_default 2023-05-13 15:07:00 +08:00
Boshen
14720e7c69
refactor: move SourceType from oxc_ast to oxc_span (#351)
related #350
2023-05-12 23:16:14 +08:00
Boshen
7f93e58f10
chore: remove all #[must_use] 2023-05-11 21:08:00 +08:00
Boshen
1b83e6c16e
feat(oxc_index): add static_assert_size for compile time evaluation (#343) 2023-05-08 22:20:54 +08:00
Boshen
65a445f512
refactor: move operator to oxc_syntax (#341) 2023-05-08 15:35:01 +08:00
Boshen
7e130e56f8
refactor(ast): remove Option around all ImportOrExportKind 2023-05-05 22:39:29 +08:00
Boshen
a2be3bd227
refactor(ast): remove unnecessary ModuleDeclarationKind 2023-05-05 22:04:26 +08:00
Boshen
64ed8613a4
refactor(ast): remove unnecessary box from AssignmentTargetMaybeDefault::AssignmentTarget 2023-05-04 22:56:20 +08:00
Wenzhe Wang
638576c323
fix(ast): replace ArrayElementType (#330) 2023-05-04 20:33:58 +08:00
Boshen
99fdaad03a
chore(rust): bump bitflags to v2 2023-05-04 12:24:47 +08:00
Boshen
cd276c2850
feat: add oxc_span crate (#323) 2023-04-27 21:51:15 +08:00
Boshen
08dfbc98b2
fix(oxc_ast,oxc_parser): fix clippy warnings 2023-04-22 16:24:50 +08:00