Skip to content

fix(css_parser): parse unary and identifier-led SCSS list expressions - #12096

Merged
denbezrukov merged 2 commits into
mainfrom
dbezrukov/scss-p04-list-operands
Oct 3, 2026
Merged

denbezrukov merged 2 commits into
mainfrom
dbezrukov/scss-p04-list-operands

Conversation

@denbezrukov

Copy link
Copy Markdown
Contributor

AI assistance was used for implementation, tests, and this description.

Summary

Fix parsing of unary and identifier-led binary expressions inside SCSS bracketed lists:

$gap: 8px;
$offsets: [-$gap, +$gap];
$flags: [not false, true and not false, foo == foo];

Test Plan

  • cargo test -p biome_css_parser
  • cargo test -p biome_css_formatter

@agentscanapp

agentscanapp Bot commented Oct 3, 2026

Copy link
Copy Markdown

A maintainer will take a look as soon as they can. In the meantime, please make sure that:

  • the description follows our PR template
  • any related issues are linked
  • existing tests still pass

@changeset-bot

changeset-bot Bot commented Oct 3, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: b6d5f35

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions github-actions Bot added A-Parser Area: parser A-Formatter Area: formatter L-CSS Language: CSS and super languages labels Oct 3, 2026
@coderabbitai

coderabbitai Bot commented Oct 3, 2026

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: biomejs/biome/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: c4be97ad-dce7-496a-97eb-d02013220584
📥 Commits

Reviewing files that changed from the base of the PR and between 4db3f58 and b6d5f35.

⛔ Files ignored due to path filters (6)
  • crates/biome_css_formatter/tests/specs/scss/expression/parity-core-list-operands-identifier-operators.scss.snap is excluded by !**/*.snap and included by **
  • crates/biome_css_formatter/tests/specs/scss/expression/parity-core-list-operands.scss.snap is excluded by !**/*.snap and included by **
  • crates/biome_css_parser/tests/css_test_suite/error/scss/expression/parity-core-list-operands-recovery.scss.snap is excluded by !**/*.snap and included by **
  • crates/biome_css_parser/tests/css_test_suite/ok/scss/expression/parity-core-list-operands-identifier-operators.scss.snap is excluded by !**/*.snap and included by **
  • crates/biome_css_parser/tests/css_test_suite/ok/scss/expression/parity-core-list-operands.scss.snap is excluded by !**/*.snap and included by **
  • crates/biome_css_parser/tests/css_test_suite/ok/value/parity-core-list-operands.css.snap is excluded by !**/*.snap and included by **
📒 Files selected for processing (11)
  • crates/biome_css_formatter/tests/specs/scss/expression/parity-core-list-operands-identifier-operators.scss
  • crates/biome_css_formatter/tests/specs/scss/expression/parity-core-list-operands.scss
  • crates/biome_css_parser/src/syntax/mod.rs
  • crates/biome_css_parser/src/syntax/scss/expression/mod.rs
  • crates/biome_css_parser/src/syntax/scss/expression/precedence.rs
  • crates/biome_css_parser/src/syntax/scss/mod.rs
  • crates/biome_css_parser/src/syntax/scss/value/mod.rs
  • crates/biome_css_parser/tests/css_test_suite/error/scss/expression/parity-core-list-operands-recovery.scss
  • crates/biome_css_parser/tests/css_test_suite/ok/scss/expression/parity-core-list-operands-identifier-operators.scss
  • crates/biome_css_parser/tests/css_test_suite/ok/scss/expression/parity-core-list-operands.scss
  • crates/biome_css_parser/tests/css_test_suite/ok/value/parity-core-list-operands.css

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.


Walkthrough

The parser now recognises unary and identifier-led SCSS expressions in bracketed values, while preserving CSS grid-line identifiers. New fixtures cover parsing, malformed-expression recovery, and formatting.

Priority: ⬇️ Low

Change: Bug fix

Merge Risk: ⚪ Minimal · up to b6d5f

No concrete merge-blocking behavior is established by the supplied change context; the added fixtures cover the stated parsing and formatting cases.

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the fix for unary and identifier-led SCSS list expressions.
Description check ✅ Passed The description explains the SCSS parsing fix, gives examples and lists the test commands.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@codspeed

codspeed Bot commented Oct 3, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 65 untouched benchmarks
⏩ 348 skipped benchmarks1


Comparing dbezrukov/scss-p04-list-operands (b6d5f35) with main (aaf4c81)

Open in CodSpeed

Footnotes

  1. 348 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

@denbezrukov
denbezrukov merged commit 94e0f81 into main Oct 3, 2026
34 checks passed
@denbezrukov
denbezrukov deleted the dbezrukov/scss-p04-list-operands branch October 3, 2026 08:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Formatter Area: formatter A-Parser Area: parser L-CSS Language: CSS and super languages

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants