Repository navigation
Conversation
The outer `LayerReferenceList` ended only at `{` and `;`, while the
inner `LayerNameList` also terminates at `)`. For input like `@layer)`,
the inner list completed an empty element at the `)` without consuming
any token, so the outer separated list looped forever and tripped the
parser's `assert_progressing` panic.
Add `)` to `LAYER_REFERENCE_LIST_END_SET` (which also feeds the list's
recovery set) so the prelude terminates at the stray paren and the
parser emits a proper diagnostic instead of panicking. The inner
`LAYER_NAME_LIST_END_SET` keeps its `)` entry, which is needed for
nested contexts such as `@import ... layer(name)`.
Fixes biomejs#12991
|
A maintainer will take a look as soon as they can. In the meantime, please make sure that:
|
Automation signalsActivity patterns show signs of automation. Evidence
Last 2 PRs: This is an automated analysis by AgentScan |
🦋 Changeset detectedLatest commit: 6416b4a The changes in this PR will be included in the next version bump. This PR includes changesets to release 16 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR'%20in%20%40layer%20prelude%0A) |
|
No actionable comments were generated in the recent review. WalkthroughThe CSS parser now treats Possibly related issues Possibly related PRs
Suggested labels: Suggested reviewers: Change: Bug fix · Severity of issue fixed: Medium Merge Risk:
|
|
I am going to withdraw this one - no longer planning to move it forward here. Thanks for everything you are doing on Biome! |
Summary
Fixes #12991.
The CSS parser panicked (
assert_progressingincrates/biome_parser/src/lib.rs: "The parser is no longer progressing. Stuck at ')'") when a stray)appeared in the prelude of an@layerat-rule, e.g.:Root cause
The outer
LayerReferenceListended only at{and;, while the innerLayerNameListadditionally terminates at). For@layer), the inner list completed an emptyCssLayerNameListelement at the)without consuming any token, so the outerParseSeparatedListloop made no progress and trippedassert_progressing.Fix
Add
)toLAYER_REFERENCE_LIST_END_SETincrates/biome_css_parser/src/syntax/at_rule/layer.rsso the outer prelude list terminates at the stray paren; the parser now emits aexpected ';' but instead found ')'diagnostic (and bogus nodes) instead of panicking. The recovery set derives from this set, so it picks up)as well.The
)entry in the innerLAYER_NAME_LIST_END_SETis left untouched — it is needed for nested contexts such as@import url(...) layer(name)(seeimport.rs).Test evidence
New fixture
crates/biome_css_parser/tests/css_test_suite/error/at_rule/at_rule_layer_paren.csscovering@layer),@layer a b)and@layer){}:All three now produce diagnostics and a sane CST (
CssBogusLayer/CssBogusRule) — see the committed snapshot. No existing snapshots changed.cargo test -p biome_css_parseris fully green: 93 unit + 3 custom-property + 690 spec + 2 doc tests, 0 failed.cargo fmt --checkclean;cargo clippy -p biome_css_parser --all-features --all-targets -- --deny warningsclean.