Skip to content

Commit a4bfe38

Browse files
committed
[css-values-4] Add definition of grammar production blocks. #2921
1 parent 5428488 commit a4bfe38

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

css-values-4/Overview.bs

+37
Original file line numberDiff line numberDiff line change
@@ -479,6 +479,41 @@ Property Value Examples</h3>
479479
</table>
480480
</div>
481481

482+
<h3 id="production-blocks">
483+
Non-Terminal Definitions and Grammar Production Blocks</h3>
484+
485+
The precise grammar of non-terminals, like <<position>> or <<calc()>>,
486+
is often specified in a <dfn export>CSS grammar production block</dfn>.
487+
These are conventionally represented in a preformatted block of definitions
488+
like this:
489+
490+
<div class="example">
491+
The <css>&lt;foo></css> syntax is defined as follows:
492+
493+
<xmp class=prod>
494+
<foo> = keyword | <bar> |
495+
some-really-long-pattern-of-stuff
496+
<bar> = <length>
497+
</xmp>
498+
</div>
499+
500+
Each definition starts on its own line,
501+
and consists of the non-terminal to be defined,
502+
followed by an <code>=</code>,
503+
followed by the fragment of [=value definition syntax=] to which it expands.
504+
A definition can stretch across multiple lines,
505+
and terminates before the next line that starts a new grammar production
506+
or at the end of the grammar production block
507+
(whichever comes first).
508+
509+
<div class="example">
510+
In the above example, the <css>&lt;foo></css> definition covers two lines.
511+
The third line starts a new definition for <css>&lt;bar></css>.
512+
(A naked <code>=</code> is never valid in [=value definition syntax=],
513+
so it's unambiguous when a new line starts a fresh definition.)
514+
</div>
515+
516+
482517
<h2 id="combining-values">
483518
Combining Values: Interpolation, Addition, and Accumulation</h2>
484519

@@ -5196,6 +5231,8 @@ Recent Changes</h3>
51965231
despite violation of the “avoid dataloss by default principle”--
51975232
given existing interoperability and presumed Web-compat restriction.
51985233
(<a href="https://github.com/w3c/csswg-drafts/issues/6454">Issue 6452</a>)
5234+
* Added an explicit definition for the [=CSS grammar production block=] convention.
5235+
(<a href="https://github.com/w3c/csswg-drafts/issues/2921">Issue 2921</a>)
51995236

52005237
Substantial changes since <a href="https://www.w3.org/TR/2023/WD-css-values-4-20230406/">6 April 2023 WD</a>:
52015238

0 commit comments

Comments
 (0)