Commit graph

1796 commits

Author SHA1 Message Date
Boshen
0674899b88
Fuzz async (#257)
* fix(parser): parse `async(...null)` as call expression

relates #255

* fix(parser): parse `null?async():null`

relates #255
2023-04-05 14:36:37 +08:00
Boshen
1c2acd121c
refactor(parser): clean up parsing of ForStatement (#251)
closes #176
2023-04-04 22:36:35 +08:00
Boshen
236d53ad9d
fix(parser): fix panic on multi-byte char in ExpectCatchFinally error 2023-04-02 20:09:38 +08:00
Boshen
abcda95e8e
deps: bump deps 2023-04-02 16:48:45 +08:00
Boshen
8833a84840 feat(coverage): read typescript dts option in babel 2023-04-02 16:41:53 +08:00
Boshen
f5c7b3751c fix(coverage): babel plugin option can be an array 2023-04-02 16:41:53 +08:00
Boshen
7db1643425 fix(parser): allow non-last rest element in ambient contexts 2023-04-02 16:41:53 +08:00
Boshen
be9b3f9acc feat(coverage): add babel parser option allow_return_outside_function 2023-04-02 16:41:53 +08:00
Boshen
e6079a1b4e feat(coverage): read jsx attribute from typescript files 2023-04-02 16:41:53 +08:00
Boshen
adedc1a405 feat(parser): parse jsx element and fragment in JSXAttributeValue 2023-04-02 16:41:53 +08:00
Boshen
1130f48278 feat(parser): parse ts satisfies operator 2023-04-02 16:41:53 +08:00
Boshen
90e2d386d7 fix(parser): do not check static prototype in ambient contexts 2023-04-02 16:41:53 +08:00
Boshen
a62c9335a2 fix(parser): fix remaining errors around auto accessors 2023-04-02 16:41:53 +08:00
Boshen
adef772d6c refactor: clean up code around code coverage 2023-04-01 15:59:42 +08:00
Boshen
174330561c
fix(parser): fix panic on multi-byte characaters (#233)
* fix(oxc_parser): fix panic when EOF on a multi-byte character

relates #232

* fix(parser): fix panic on multi-byte char in private identifer

relates #232
2023-04-01 13:34:18 +08:00
Boshen
4ccb9e806b
chore(coverage): remove mention of git submodule update --remote in README
We want people to use --init.
2023-04-01 10:57:25 +08:00
Boshen
f8790d4b89
feat(semantic): can turned off ModuleRecordBuilder
relates to #224
2023-04-01 00:41:52 +08:00
Boshen
05f163f2f7
fix(coverage): fix lint on cfg feature 2023-04-01 00:02:58 +08:00
Boshen
d232199e1c
refactor(parser): return Rc<Trivias> from TriviaBuilder (#231)
closes #229
2023-03-31 09:02:48 -07:00
Boshen
1a6f508bb9
ci: add codecov 2023-03-31 22:59:14 +08:00
Boshen
de9be97f0f
chore: clean up Cargo.toml in tasks 2023-03-31 22:22:18 +08:00
Boshen
9e3675a575
chore: clean up Cargo.toml 2023-03-30 23:27:26 +08:00
yangchenye
929b0efebb
feat(linter): implement isolated_declaration (#209)
* feat(linter): implement isolated_declaration

* Implement check for class elements

* Set up Export SymbolFlag and store declaration AST in Symbol

* Fix tests and comments
2023-03-26 04:37:10 -07:00
Boshen
5a1a72204e
chore(coverage): update snapshots 2023-03-25 14:21:22 +08:00
Boshen
d095d45818
refactor(semantic): add source_text and trivias to semantic 2023-03-25 14:19:53 +08:00
yangchenye
40460dd32b
feat(rulegen): fallback to empty rule template (#208) 2023-03-24 22:36:11 -07:00
Xuan
71e575ab41
feat(linter): implement no-new-symbol rule (#201) 2023-03-23 18:29:57 +08:00
yangchenye
0d8d67b593
feat(linter): implement eslint(no-const-assign) (#199)
* feat(linter): implement eslint(no-const-assign)

* feat(semantics & linter): resolve symbols

* Use run_on_symbol

* Add resolved_reference to SymbolTable
2023-03-23 12:55:40 +08:00
Boshen
7dfaf9949c
chore(README): clean up sentences with chatGPT 2023-03-22 20:34:07 +08:00
Boshen
9dfd4cd936
chore(rust): remove unnecessary missing_const_for_fn 2023-03-22 12:35:52 +08:00
Boshen
ff9a2c3ab0
feat(linter): eslint disable comments (#196)
feat(linter): eslint disable comments

closes #100
closes #170
2023-03-22 11:27:42 +08:00
yangchenye
3487772644
feat(linter): implement eslint(no-dupe-class-members) (#195) 2023-03-21 12:43:23 +08:00
Boshen
69109286b5
chore(README): mention stage 3 skipped tests. 2023-03-19 12:47:57 +08:00
yangchenye
4549fb3cdd
fix(parser): parse decorator with separate grammar (#192) 2023-03-19 11:35:59 +08:00
Boshen
37c7b7a752
refactor(oxc_parser): simply diagnostic messages 2023-03-18 14:39:44 +08:00
Boshen
6a89f085b7
refactor(rust): add more clippy restriction rules 2023-03-17 14:51:25 +08:00
Boshen
a1315e3999
refactor(rust): add clippy::clone_on_ref_ptr 2023-03-17 14:51:25 +08:00
Boshen
57f3065d68
refactor: remove unused #[allow(clippy:..)] 2023-03-17 13:28:06 +08:00
Boshen
bee548b945
fix(coverage): correct the number on AST Parsed 2023-03-17 11:15:33 +08:00
Boshen
97d01b4ced
chore(coverage): remove stage 3 decorators from conformance tests
By looking at the grammar, separate AST nodes need to be created.
Disabling this for now because it still looks like a mess for now.
2023-03-17 10:30:18 +08:00
Boshen
9ed682a38e
fix(semantic): fix function redeclaration errors
The problem here we face here is that TypeScript does not consider Annex
B.3.2, which makes implementation a bit more difficult.

This implementation conforms to test262.
2023-03-17 10:06:02 +08:00
yangchenye
37ad6f3a15
feat(parser): support decorators in class expression (#190)
feat(parser): support decorator in class expression
2023-03-17 09:33:04 +08:00
Boshen
164c2831e1 feat(linter): report export errors in javascript 2023-03-15 18:12:34 -07:00
Boshen
326de5006b
chore: bump submodules 2023-03-15 12:46:21 +08:00
yangchenye
aaaefc8ba5
feat(linter): implement eslint(no-unsafe-negation) (#186) 2023-03-15 11:36:56 +08:00
yangchenye
74c731c415
feat(linter): Implement eslint(no-compare-neg-zero) (#185) 2023-03-15 10:44:11 +08:00
Xuan
e4d5202f52
fix(rulegen): convert the rule name to underscore case for filenames (#177) 2023-03-14 11:26:27 +08:00
Boshen
e262e18e5f
chore(coverage): remove tests for stage 3 proposal-json-modules 2023-03-14 11:02:00 +08:00
Boshen
ee31f5cc6f
feat(linter): check duplicated bound names in ImportDeclaration 2023-03-14 10:42:18 +08:00
Boshen
89f28e9f93
feat(linter): check module in javascript and skip in typescript 2023-03-14 08:53:16 +08:00
Boshen
7b1a7d47b6
feat(linter): check await in ClassStaticBlock in javascript 2023-03-14 08:08:24 +08:00
Boshen
297ce2743f
Revert "feat(linter): check await in class static block"
This reverts commit 7add71c9dd.
2023-03-14 07:56:04 +08:00
Boshen
7add71c9dd
feat(linter): check await in class static block 2023-03-14 07:46:11 +08:00
Boshen
78bd76e8d0
feat(parser): check function name for await and yield 2023-03-14 07:39:07 +08:00
Boshen
c706d1825d
feat(semantic): turn on strict mode in semantic builder 2023-03-14 00:30:22 +08:00
Boshen
76118e4901
feat(linter): check NewTarget in javascript 2023-03-14 00:05:37 +08:00
Boshen
39795dbb1b
feat(linter): check ArrayPattern in javascript 2023-03-13 23:52:36 +08:00
Boshen
76f7e58036
feat(linter): check FormalParameter in javascript 2023-03-13 23:43:31 +08:00
Boshen
f4c8cb2cde
feat(linter): check FunctionDeclaration in javascript 2023-03-13 23:35:42 +08:00
Boshen
5381fd0cf8
feat(linter): check Directive in javascript 2023-03-13 23:19:35 +08:00
Boshen
7269d32346
feat(linter): check FormalParameters in javascript 2023-03-13 23:12:42 +08:00
Boshen
040e41240b
feat(linter): check AwaitExpression and YieldExpression in javascript 2023-03-13 13:45:49 +08:00
Boshen
fce6e1ec73
feat(parser): check YieldExpression 2023-03-12 23:41:27 +08:00
Boshen
88fd0a05ec
feat(parser): check AwaitExpression 2023-03-12 23:37:21 +08:00
Boshen
d6e8c6fb2f
feat(parser): check ReturnStatement in return context 2023-03-12 23:30:32 +08:00
Boshen
84eaa0b7e3
feat(linter): check eval and arguments in JavaScript 2023-03-12 23:25:57 +08:00
Boshen
93b06e948a
feat(ast_parser): check await and yield identifier error 2023-03-12 23:22:10 +08:00
Boshen
577a86edce
chore(benchmark): increase benchmark measurement time, CI is too unstable 2023-03-12 22:05:21 +08:00
Boshen
d490ca7b31
chore(rust): bump deps 2023-03-11 23:26:45 +08:00
Boshen
b1e01d0774
feat(linter): check top level ModuleDeclaration 2023-03-11 21:09:03 +08:00
Boshen
5c2fea7702
feat(linter): check SwitchStatement in javascript 2023-03-11 20:26:50 +08:00
Boshen
021345173f
feat(linter): check expressions in javascript 2023-03-11 20:18:20 +08:00
Boshen
403682960f
feat(linter): check ForStatementLeft in javascript 2023-03-11 19:12:29 +08:00
Boshen
f22539e93f
feat(linter): check property 2023-03-11 19:12:28 +08:00
Boshen
82ef1f2944
feat(linter): check Super in javascript 2023-03-11 18:48:34 +08:00
Boshen
6c28948faf
feat(linter): check duplicate constructor in javascript 2023-03-11 18:34:05 +08:00
Boshen
d5075a95e9
fix(linter): diagnostics should not print quotes 2023-03-11 17:44:27 +08:00
Boshen
a5f00e8e1c
refactor(oxc_ast): remove unnecessary SourceTypeBuilder 2023-03-11 16:21:14 +08:00
Boshen
58e2741ec9 feat(semantic): bind Function name 2023-03-10 23:28:51 -08:00
Boshen
995e7c1767 feat(linter): bind CatchVariable 2023-03-10 23:28:51 -08:00
Boshen
34c0599db8 feat(semantic): bind FormalParameters 2023-03-10 23:28:51 -08:00
Boshen
323bb9a2b6 feat(semantic): bind VariableDeclarator 2023-03-10 23:28:51 -08:00
Boshen
b1e802cecc feat(semantic): bind Class 2023-03-10 23:28:51 -08:00
Boshen
5c8670d1c8 feat(semantic): declare symbol and reference Identifier 2023-03-10 23:28:51 -08:00
Boshen
be6fa2e7a0 chore(coverage): bump submodules 2023-03-10 23:28:51 -08:00
Boshen
2ee0b40656 chore: fix clippy warnings 2023-03-10 11:09:44 -08:00
Boshen
5b8bdaabab
feat(linter): check IdentifierReference in javascript 2023-03-09 20:20:58 +08:00
Shannon Rothe
da8355f418
feat(rulegen): refactor to visitor pattern (#162)
* feat(rulegen): refactor to visitor pattern

* convert `parse_test_code` to visitor pattern
2023-03-09 17:33:30 +08:00
Boshen
185acc49bd feat(linter): check BindingIdentifier in javascript 2023-03-09 01:27:14 -08:00
Boshen
4ea7ac373d feat(linter): check Identifier in javascript 2023-03-09 01:27:14 -08:00
Boshen
4a582f0487 feat(linter): check WithStatement in javascript 2023-03-09 01:27:14 -08:00
Boshen
0fb8887d3c feat(linter): check LabeledStatement in javascript 2023-03-09 01:27:14 -08:00
Boshen
26387c0660 feat(linter): check ContinueStatement in javascript 2023-03-09 01:27:14 -08:00
Boshen
fa8f685551 fix(coverage): fix broken typescript nagative conformance 2023-03-09 01:27:14 -08:00
Boshen
3e842667b1 feat(linter): check BreakStatement in javascript 2023-03-09 01:27:14 -08:00
Boshen
735b1241c4 feat(linter): check StringLiteral in javascript 2023-03-09 01:27:14 -08:00
Boshen
ed161cc38e feat(linter): check PrivateIdentifier in javascript 2023-03-09 01:27:14 -08:00
Boshen
44675e8cd8 feat(coverage): add always_strict mode for test262 2023-03-09 01:27:14 -08:00
Boshen
f13640e1c2 feat(linter): check NumberLiteral in javascript 2023-03-09 01:27:14 -08:00
Boshen
4e0d785b25 feat(linter): add infrastructure for handling early errors 2023-03-09 01:27:14 -08:00
yangchenye
bc2c175472
chore(rule_generator): preserve escaped string in test code (#160) 2023-03-09 12:07:55 +08:00
yangchenye
1ea463e0bb
feat(oxc_linter): implement eslint(no-mixed-operators) (#145) 2023-03-09 00:05:44 +08:00
Boshen
94fdd54368
perf(lexer): fine tune identifier checking with less redundant branches (#154)
perf(lexer): fine tune checking of identifiers with less redundant branches
2023-03-08 22:00:15 +08:00
yangchenye
b76ffb4826
feat(rule_generator): generate test options (#150) 2023-03-08 11:02:01 +08:00
Boshen
3562a49592
chore(coverage): print negative tests; enable decorators; update to the latest remote 2023-03-07 23:37:00 +08:00
Boshen
2f2c133017
fix(coverage): fix broken snapshot 2023-03-07 21:32:55 +08:00
Boshen
4d32bfb55e
refactor: remove all declarations of const fn, which is useless for us 2023-03-07 21:29:47 +08:00
Shannon Rothe
0f7edfb003
feat(rule_generator): automatically generate rules and tests (#142) 2023-03-07 18:21:58 +08:00
Boshen
e20c60d961
ci(benchmark): increase measurement time 2023-03-06 21:46:16 +08:00
Boshen
683778dfe2
feat(semantic): implement scopes (#135)
closes #119
2023-03-05 07:43:32 -08:00
Boshen
cb886d8a36
refactor(benchmark): make the benchmark run faster by using variable measurement time 2023-03-05 23:19:51 +08:00
Boshen
2f9e3832a0 chore(rust): bump deps 2023-03-05 04:51:00 -08:00
Fnll
81760da7cc
feat(parser): better diagnostic for missing semicolon in for loop statement (#133)
feat(parser): better diagnostic

Co-authored-by: kerui.lian <kerui.lian@bytedance.com>
2023-03-05 04:13:23 -08:00
Boshen
94fddffc70
chore: use fancy-no-backtrace from miette
See https://github.com/zkat/miette/issues/132
2023-03-05 15:16:26 +08:00
Boshen
7d3ce8b125
feat(benchmark): add semantic builder to benchmark (#129) 2023-03-04 23:09:19 -08:00
Ye Yangchen
d8c6caf57f feat(oxc_parser): Parse modifiers before declaration 2023-03-01 22:50:23 -08:00
Shannon Rothe
ba6414656c run coverage 2023-03-01 20:47:52 -08:00
Xuan
298e956d0d feat(oxc_cli): support ignore-path 2023-03-01 04:39:18 -08:00
Boshen
ab0b764dfc
chore(README.md): include third party licenses 2023-02-27 12:46:07 +08:00
Ye Yangchen
0bf8f817f5 feat(oxc_parser): Port isStartOfDeclaration form tsc 2023-02-27 12:27:44 +08:00
Xuan
6b43cbbe71 fix(oxc_parser): support export type with star symbol 2023-02-27 12:26:23 +08:00
Xuan
b6d09643e5 fix(oxc_parser): check access correctly 2023-02-27 03:10:02 +08:00
Boshen
f17bd87f65
fix: try disable miri with custom allocators 2023-02-25 21:04:52 +08:00
Boshen
bf76f6d8b6
chore: ignore miri on global allocators
error: unsupported operation: can't call foreign function `_rjem_malloc` on OS `linux`
   --> /home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/jemallocator-0.5.0/src/lib.rs:104:13
    |
104 |             ffi::malloc(layout.size())
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^ can't call foreign function `_rjem_malloc` on OS `linux`
    |
    = help: this is likely not a bug in the program; it indicates that the program performed an operation that the interpreter does not support
    = note: BACKTRACE:
    = note: inside `<jemallocator::Jemalloc as std::alloc::GlobalAlloc>::alloc` at /home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/jemallocator-0.5.0/src/lib.rs:104:13: 104:39
note: inside `_::__rg_alloc`
   --> tasks/benchmark/src/main.rs:13:16
    |
12  | #[global_allocator]
    | ------------------- in this procedural macro expansion
13  | static GLOBAL: jemallocator::Jemalloc = jemallocator::Jemalloc;
    |                ^^^^^^^^^^^^^^^^^^^^^^
    = note: this error originates in the attribute macro `global_allocator` (in Nightly builds, run with -Z macro-backtrace for more info)
2023-02-25 20:45:38 +08:00
Boshen
abb2f8c949 feat(rust): use mimalloc on windows 2023-02-25 11:58:57 +08:00
Boshen
21318e1fba
chore: update benchmark readme 2023-02-24 13:29:17 +08:00
Boshen
da941e8689
chore: update contribution docs 2023-02-24 13:24:42 +08:00
Boshen
5d17512b37
chore(coverage): update snapshots 2023-02-24 13:12:07 +08:00
Boshen
4b80cb2b6a
chore(tasks): update submodules 2023-02-24 13:08:22 +08:00
Xuan
457e85b4a0 fix(oxc_parser): check ambiguous for await 2023-02-24 12:46:59 +08:00
Boshen
d773187f43
ci: skip making comments from forks in benchmark
source: https://github.com/peter-evans/create-pull-request/blob/main/docs/concepts-guidelines.md#restrictions-on-repository-forks
2023-02-23 21:37:08 +08:00
Xuan
65e81ce12c fix(oxc_parser): eat decorator for export 2023-02-23 12:28:34 +08:00
Boshen
7689df3318 feat(coverage): print diagnostics to snapshots 2023-02-22 19:23:01 +08:00
Boshen
4edd3f75ce feat(benchmark): check parser before benchmark 2023-02-20 18:23:36 +08:00
Boshen
978ca362f7 feat(coverage): use test262 to test printer 2023-02-20 18:23:36 +08:00
Boshen
204ea12d6a
fix(coverage): fix empty being reported as not parsed 2023-02-12 21:24:19 +08:00
Boshen
65cfa48fe5
chore(coverage): add typescript to cargo coverage command 2023-02-12 16:27:26 +08:00
Boshen
6758b0c66c feat(coverage): add typescript conformance (currently 4287/4861 88.19%)
Some of the files are not being parsed because we are currently less
recoverable than TypeScript.
2023-02-11 23:46:28 -08:00
Boshen
a4e04d4f6f feat(coverage): add babel conformance (currently 2043/2057 99.32%) 2023-02-11 22:36:32 -08:00
Boshen
f50c067ccf fix(benchmark): fix panic on initialization 2023-02-11 18:45:50 -08:00
Boshen
fb8faedb3e perf: add jemallocator 2023-02-11 18:45:50 -08:00
Boshen
f90d660ec5 feat(tasks): add parser benchmark 2023-02-11 08:46:32 -08:00
Boshen
a339ba3f92 feat(coverage): print parsing conformance for test262 (currently 100%) 2023-02-11 08:02:42 -08:00
Boshen
62a4f2b551 feat(ast): add ast 2023-02-11 04:27:34 -08:00
Boshen
4ae70b9592 feat(parser): add lexer 2023-02-11 02:29:54 -08:00
Boshen
f4819d976b feat(tasks): add initial test262 setup 2023-02-11 00:43:09 -08:00