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

Nicer Error location ? #390

Open
MarcWeber opened this issue Apr 5, 2024 · 0 comments
Open

Nicer Error location ? #390

MarcWeber opened this issue Apr 5, 2024 · 0 comments

Comments

@MarcWeber
Copy link

While pos 50 is nice its nicer to just see where something goes wrong.

So it would be nice if there was a second parser which returend left/right or such
where left contains something like

TEXT:
abc<ERROR HERE>def

Catching the exception and using this works for me for the time being:

if (m = e.toString().match(/at char ([^ ]+)/)){
    const p = parseInt(m[1])
    text = text.slice(0, p)+"HERE"+text.slice(p)
}
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

1 participant