Skip to content
New issue

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

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

Already on GitHub? # to your account

fix: resolve bug with unrecognized keywords in the REPL's syntax-highlighter #2284

Merged
merged 1 commit into from
May 31, 2024

Conversation

Snehil-Shah
Copy link
Member

@Snehil-Shah Snehil-Shah commented May 31, 2024

Description

What is the purpose of this pull request?

This pull request fixes a small bug with unrecognized keywords (that acorn doesn't recognize as a keyword token), ie. let, async & await, in the syntax highlighter.
We were checking if it's a keyword inside the Identifier visitor and hence it wasn't working as expected. I have moved the logic to the onToken callback.

@Planeshifter sorry for the oversight. This patch PR fixes it.

Example:

let : let is highlighted
let a: let is not highlighted

Questions

Any questions for reviewers of this pull request?

No.

Other

Any other information relevant to this pull request? This may include screenshots, references, and/or implementation notes.

No.

Checklist

Please ensure the following tasks are completed before submitting this pull request.


@stdlib-js/reviewers

Signed-off-by: Snehil Shah <snehilshah.989@gmail.com>
Copy link
Member

@Planeshifter Planeshifter left a comment

Choose a reason for hiding this comment

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

Thanks, @Snehil-Shah!

@Planeshifter Planeshifter changed the title fix: bug with unrecognized keywords in the REPL's syntax-highlighter fix: resolve bug with unrecognized keywords in the REPL's syntax-highlighter May 31, 2024
@Planeshifter Planeshifter merged commit 8716bc6 into stdlib-js:develop May 31, 2024
6 checks passed
aman-095 pushed a commit to aman-095/stdlib that referenced this pull request Jun 13, 2024
PR-URL: stdlib-js#2284

Signed-off-by: Snehil Shah <snehilshah.989@gmail.com>
Reviewed-by: Philipp Burckhardt <pburckhardt@outlook.com>
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants