-
Notifications
You must be signed in to change notification settings - Fork 665
feat: unknown statements #1794
feat: unknown statements #1794
Conversation
Deploying with
|
Latest commit: |
7dc5762
|
Status: | ✅ Deploy successful! |
Preview URL: | https://f9e6a741.tools-8rn.pages.dev |
What’s the advantage of combining these parameters into a |
The parameters of the functions we use to recover from errors were becoming too many. Micha suggested to revisit it with a |
08ba1bc
to
0f599c0
Compare
29782b5
to
85fd6dd
Compare
0f599c0
to
4bf12dd
Compare
85fd6dd
to
e04b039
Compare
crates/rslint_parser/test_data/inline/err/switch_stmt_no_cases.rast
Outdated
Show resolved
Hide resolved
crates/rslint_parser/test_data/inline/err/switch_stmt_no_cases.rast
Outdated
Show resolved
Hide resolved
crates/rslint_parser/test_data/inline/err/switch_stmt_no_cases.rast
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the RecoveryBag
and overall great improvements!
There are some cases where we now insert invalid children (e.g. expressions instead of statements).
Would you mind listing in the PR summary for parser rules your changing the error recovery?
crates/rslint_parser/test_data/inline/err/do_while_stmt_err.rast
Outdated
Show resolved
Hide resolved
e0abc47
to
d3196eb
Compare
Test262 comparison coverage results on windows-latest
|
I reverted the changes I did around the parsing of |
Errors, now fixed.
Done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Please take a look at the comments from @yassere before merging.
Summary
This PR does the following:
ParseRecover
where information the information needed for recovery are created passed to the parser;err_recover
anderr_recover_no_err
in one single function;ParseRecover
and the recovery logic is inside therecover
function;ERROR
and addedJS_UNKNOWN_STATEMENT
in some particular case, specifically the parser has a function calledstmt()
that is called in those functions that tries to parse particular statements:if/else
,do/while
,while
,for
, etc., so every time this function fails, we emit an error;Test Plan