Skip to content
This repository has been archived by the owner on Aug 31, 2023. It is now read-only.

fix(syntax): Remove quotes from tokens in JsSyntaxKind::to_string #2665

Merged
merged 1 commit into from
Jun 7, 2022

Conversation

MichaReiser
Copy link
Contributor

@MichaReiser MichaReiser commented Jun 7, 2022

Summary

JsSyntaxKind::to_string should return the token's string representation without any additional quotes.
Quoting should happen at the call side if necessary.

This fixes some double-quoting of parentheses inside of parser diagnostic messages for different parentheses.

Needed for #2447

Test Plan

cargo test

@MichaReiser MichaReiser requested review from ematipico and leops June 7, 2022 07:35
@MichaReiser MichaReiser temporarily deployed to aws June 7, 2022 07:35 Inactive
@MichaReiser MichaReiser marked this pull request as draft June 7, 2022 07:36
@github-actions
Copy link

github-actions bot commented Jun 7, 2022

Parser conformance results on ubuntu-latest

js/262

Test result main count This PR count Difference
Total 45878 45878 0
Passed 44938 44938 0
Failed 940 940 0
Panics 0 0 0
Coverage 97.95% 97.95% 0.00%

jsx/babel

Test result main count This PR count Difference
Total 39 39 0
Passed 36 36 0
Failed 3 3 0
Panics 0 0 0
Coverage 92.31% 92.31% 0.00%

symbols/microsoft

Test result main count This PR count Difference
Total 5946 5946 0
Passed 350 350 0
Failed 5591 5590 ✅ ⏬ -1
Panics 5 6 ❌ ⏫ +1
Coverage 5.89% 5.89% 0.00%
💥 Failed to Panic (1):
moduleAugmentationNoNewNames.symbols

ts/babel

Test result main count This PR count Difference
Total 588 588 0
Passed 519 519 0
Failed 69 69 0
Panics 0 0 0
Coverage 88.27% 88.27% 0.00%

ts/microsoft

Test result main count This PR count Difference
Total 16257 16257 0
Passed 12391 12391 0
Failed 3866 3866 0
Panics 0 0 0
Coverage 76.22% 76.22% 0.00%

`JsSyntaxKind::to_string` should return the token's string representation without any additional quotes.
Quoting should happen at the call side if necessary.

This fixes some double-quoting of parentheses inside of parser diagnostic messages for different parentheses.
@MichaReiser MichaReiser force-pushed the fix/kind-to-string-escape branch from 51799e7 to 4efdfe1 Compare June 7, 2022 07:39
@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Jun 7, 2022

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: 4efdfe1
Status: ✅  Deploy successful!
Preview URL: https://7268f4b6.tools-8rn.pages.dev

View logs

@MichaReiser MichaReiser marked this pull request as ready for review June 7, 2022 07:39
@MichaReiser MichaReiser temporarily deployed to aws June 7, 2022 07:39 Inactive
@github-actions
Copy link

github-actions bot commented Jun 7, 2022

@MichaReiser
Copy link
Contributor Author

@xunilrj why is it that there's always one symbol test that changes from panic to failed?

Copy link
Contributor

@leops leops left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Incidentally this was an issue for the linter too since make::token(T!["{"]) would create a token with the text "{" for instance

@MichaReiser MichaReiser merged commit c173b0c into main Jun 7, 2022
@MichaReiser MichaReiser deleted the fix/kind-to-string-escape branch June 7, 2022 09:20
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants