Skip to content

Parse parameterized data types and combined multipliers in CSS value syntax#332

Draft
Copilot wants to merge 3 commits intomainfrom
copilot/implement-parsing-and-remove-entries
Draft

Parse parameterized data types and combined multipliers in CSS value syntax#332
Copilot wants to merge 3 commits intomainfrom
copilot/implement-parsing-and-remove-entries

Conversation

Copy link
Copy Markdown

Copilot AI commented Mar 17, 2026

Three CSS value syntax patterns were unparseable and skipped in tests: <boolean-expr[ <if-test> ]>, <number>{2}?, and <custom-arg>+#?.

Parser changes (value-syntax-parser.ts)

  • Parameterized data types: When [ appears inside <>, peek ahead to distinguish numeric ranges ([1, 1000] — first token is text) from type constraints ([ <if-test> ] — first token is <). Constraints are folded into the data type name via depth-tracked bracket matching.

  • ? after existing range multiplier: Instead of throwing "multiple multipliers on same node", ? now sets the range minimum to 0. This handles {2}?[0, 2] and +#?[0, ∞] with list: true.

// Previously threw errors, now parses correctly:
parseValueSyntax(`<boolean-expr[ <if-test> ]>`)  // → dataType('boolean-expr[ <if-test> ]')
parseValueSyntax(`<name>{2}?`)                    // → dataType('name', undefined, { range: [0, 2] })
parseValueSyntax(`<name>+#?`)                     // → dataType('name', undefined, { range: [0, ∞], list: true })

Test changes (css-value-syntax.spec.ts)

  • Removed knownProblemticValuespacesCases skip list — all three cases now run in the spec-driven sanity suite
  • Added targeted unit tests for parameterized types and combined multipliers

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits March 17, 2026 12:54
…al multiplier after range

Co-authored-by: barak007 <2240471+barak007@users.noreply.github.com>
Co-authored-by: barak007 <2240471+barak007@users.noreply.github.com>
Copilot AI changed the title [WIP] Implement parsing for known problematic values in value parser Parse parameterized data types and combined multipliers in CSS value syntax Mar 17, 2026
Copilot AI requested a review from barak007 March 17, 2026 12:56
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

Successfully merging this pull request may close these issues.

2 participants