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

Latest release is missing type definitions #1260

Open
dummdidumm opened this issue Nov 10, 2023 · 4 comments
Open

Latest release is missing type definitions #1260

dummdidumm opened this issue Nov 10, 2023 · 4 comments

Comments

@dummdidumm
Copy link

Acorn 8.11.2 seems to have shipped with broken type definitions. Some methods like isIdentifierStart are missing from d.ts files (they exist in the actual JS code though).

@marijnh
Copy link
Member

marijnh commented Nov 10, 2023

The internal/plugin interfaces are not part of the new type definitions. The old ones accidentally had some of them in there. What kind of thing are you doing that you need isIdentifierStart?

@dummdidumm
Copy link
Author

We're using isIdentifierStart and isIdentifierChar inside Svelte's template parser to read identifiers (checking when they start and when they end)

@marijnh
Copy link
Member

marijnh commented Jan 3, 2024

Are you able to switch to a \p-based regexp ([\p{L}\p{Nl}$_][\p{L}\p{Nl}$\p{Mn}\p{Mc}\p{Nd}\p{Pc}]*) in your parser, or do you target engines that don't have a \p yet?

@RReverser
Copy link
Member

@marijnh I believe it can be even simpler with something like /^[\p{ID_Start}$_][\p{ID_Continue}$]$/u.

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

No branches or pull requests

3 participants