pintariching/rustle

Replacements for acorn functions

pintariching opened this issue · 4 comments

Are there any functions in swc that do the same functionality as the ones used in svelte from the package acorn.
Specifically, here are the functions that are used from acorn:

These functions are used internally in acorn and also exported so swc might have a version written internally for errors. The functions are also used in svelte for custom errors and parsing mustache tags. I think the only way is to implement our own, gonna keep digging to see if I see anything

I think I found something similar is_valid_start

And perhaps verify_simbol to replace isIdentifierChar?
As for implementing our own, acorn uses some auto generated regex. I think it shouldn't be a problem implementing it.

I think the alternative to isIdentiferChar is is_valid_continue