Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix parse failures when using ?? just after the end of a type #721

Merged
merged 4 commits into from Jul 14, 2022

Conversation

alangpierce
Copy link
Owner

This was detected when running Sucrase on the Babel test suite.

This was detected when running Sucrase on the Babel test suite.
@codecov
Copy link

codecov bot commented Jul 13, 2022

Codecov Report

Merging #721 (eedf180) into main (d304d24) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main     #721   +/-   ##
=======================================
  Coverage   87.03%   87.03%           
=======================================
  Files          54       54           
  Lines        5700     5702    +2     
  Branches     1341     1343    +2     
=======================================
+ Hits         4961     4963    +2     
  Misses        470      470           
  Partials      269      269           
Impacted Files Coverage Δ
src/parser/plugins/typescript.ts 87.23% <ø> (ø)
src/parser/tokenizer/index.ts 86.11% <100.00%> (+0.05%) ⬆️

📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more

@github-actions
Copy link

github-actions bot commented Jul 13, 2022

Benchmark results

Before this PR: 258.7 thousand lines per second
After this PR: 259.7 thousand lines per second

Measured change: 0.39% faster (0.16% slower to 1.54% faster)
Summary: Likely no significant difference

The conditional tokenization is only necessary for Flow and only causes issuse
in TypeScript, so separating the cases out fixes this issue in a more
fundamental way.
@alangpierce alangpierce merged commit f9aeb43 into main Jul 14, 2022
@alangpierce alangpierce deleted the fix-question-question-parse-failure branch July 14, 2022 00:24
1Lighty pushed a commit to Astra-mod/sucrase that referenced this pull request Aug 14, 2022
…ierce#721)

This was detected when running Sucrase on the Babel test suite.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant