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

Error "Identifier directly after number" when using "_" as number separator #5407

Closed
MarkTanashchuk opened this issue Sep 16, 2020 · 5 comments
Closed

Comments

@MarkTanashchuk
Copy link

@MarkTanashchuk MarkTanashchuk commented Sep 16, 2020

In JS you can use _ as a number separator.

However, I recently noticed that Svelte displays an error Identifier directly after number when i use _ in numbers

https://svelte.dev/repl/6612cec5c50b44cbab7f4a64ff930153?version=3.25.1

This feature is definitely useful, so it would be nice to fix this bug.

@MarkTanashchuk MarkTanashchuk changed the title Error "Identifier directly after number" when using "_" as the number separator Error "Identifier directly after number" when using "_" as number separator Sep 16, 2020
@MarkTanashchuk MarkTanashchuk changed the title Error "Identifier directly after number" when using "_" as number separator Error `Identifier directly after number` when using `_` as number separator Sep 16, 2020
@MarkTanashchuk MarkTanashchuk changed the title Error `Identifier directly after number` when using `_` as number separator Error "Identifier directly after number" when using "_" as number separator Sep 16, 2020
@antony antony added the enhancement label Sep 16, 2020
@antony
Copy link
Member

@antony antony commented Sep 16, 2020

I'm hesitant to call it a bug, Svelte is a language/DSL so it's more of an unsupported language feature.

I will agree that it's desirable however, and I think it might be an easy solve, so I'm marking it as a good first issue.

@Conduitry
Copy link
Member

@Conduitry Conduitry commented Sep 16, 2020

I'm hoping this would just be a matter of updating Acorn. It looks like ours is out of date.

@Conduitry
Copy link
Member

@Conduitry Conduitry commented Sep 16, 2020

Yep, Acorn's changelog says they were added in 7.4.0, and we're using 7.3.1. We should still update to 8.x though, and that will likely involve bumping the dependency in code-red.

@Conduitry
Copy link
Member

@Conduitry Conduitry commented Sep 22, 2020

@MarkTanashchuk
Copy link
Author

@MarkTanashchuk MarkTanashchuk commented Sep 22, 2020

Nice!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

3 participants
You can’t perform that action at this time.