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

read_pattern fails if brackets are in strings etc #12131

Open
Rich-Harris opened this issue Jun 21, 2024 · 2 comments
Open

read_pattern fails if brackets are in strings etc #12131

Rich-Harris opened this issue Jun 21, 2024 · 2 comments
Labels
Milestone

Comments

@Rich-Harris
Copy link
Member

Describe the bug

At a couple of places during parsing, we need to skip ahead to figure out what to feed Acorn — inside read_pattern, and as of #12070 inside snippets using a separate mechanism. The logic fails if characters like { appear inside strings, comments or regular expressions and are not balanced:

<!-- ok -->
{#each x as { y = 'z' }}{/each}

<!-- not ok -->
{#each x as { y = '{' }}{/each}

Reproduction

link

Logs

No response

System Info

next

Severity

annoyance

@paoloricciuti
Copy link
Member

Speaking of which it just occured to me: right now if the function parsing fail we just silently fail...we should probably throw (same for unbalanced parentheses) right?

Currently is possible to do something like this. Should I open a new issue?

@Rich-Harris
Copy link
Member Author

Ah yep, that definitely warrants an issue. Good catch

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

No branches or pull requests

2 participants