Skip to content

read_pattern fails if brackets are in strings etc #12131

Closed
@Rich-Harris

Description

@Rich-Harris

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions