flm_core/stdlib/features/cells/mod.rs
1//! The `cells` feature ([`Cells`]): tables of cells. A table of cells is a
2//! `cells` environment, a grid of rows and columns that an author fills one
3//! cell at a time with `\cell`, or by rows with `\celldata`.
4//!
5//! ```text
6//! \begin{cells}
7//! \celldata<H>{Name & City} % a row of two column headers
8//! \celldata<l, r>{John & Berlin \\ Anna & Zurich}
9//! \cell<green>[\merge{1-2};3]{Both} % rows 1 to 2, column 3
10//! \end{cells}
11//! ```
12//!
13//! The [language guide](crate::guide::language_syntax#tables-of-cells)
14//! describes tables of cells for authors.
15//!
16//! # Where the environment can be written
17//!
18//! The `cells` environment is declared in the scoped package
19//! [`ENVIRONMENT_PACKAGE`] (`flm.cells.environment`). A scoped package
20//! ([`ScopedPackageDef`](crate::lang::mint::ScopedPackageDef)) is a set of
21//! element declarations that can be written only inside the bodies and
22//! arguments whose declarations refer to it (see
23//! [scoped packages](crate::guide::concepts_overview#scoped-packages)). The
24//! default `table` float type of the
25//! [`floats`](crate::stdlib::features::floats) feature refers to this
26//! package, so by default a table of cells can be written inside a `table`
27//! float and nowhere else. Under the switch [`CellsConfig::global`], the same
28//! element is also declared as an ordinary environment, so that a table can
29//! be written wherever blocks can. Anywhere else, `\begin{cells}` is an
30//! unknown environment, reported as any unknown environment is. A registry
31//! that holds this feature without the `floats` feature holds, by default,
32//! an element no document can write; this is not an error.
33//!
34//! # The body
35//!
36//! The environment's body is a sequence of instructions, laid out as blocks,
37//! and holds nothing else; whitespace, blank lines and comments between the
38//! instructions are ignored.
39//!
40//! - `\cell<styles>[placement]{content}` adds one cell. Its content is laid
41//! out as blocks: paragraphs, a list, a displayed formula, a nested table.
42//! By default the cell goes in the next column of the current row.
43//! - `\celldata<styles>[mapping]{data}` adds a cell per entry of its data:
44//! rows ended by `\\`, entries separated by `&`, each entry inline content.
45//! An entry whose only content is a `\cell` is that cell, whose own styles
46//! and placement take precedence over the entry's; an empty entry adds no
47//! cell and leaves its position empty.
48//! - `\\` ends the current row: the next cell starts the next row.
49//! - `\rownames{…}` and `\colnames{…}` give the rows and the columns names:
50//! a comma-separated list whose *k*-th entry is the name of row or column
51//! *k*. A name is an ASCII letter followed by letters, digits or
52//! underscores, and can be written wherever a row or column number can,
53//! anywhere in the table.
54//!
55//! These commands can be written only in the body and, through it, in the
56//! data of a `\celldata`; `&` only in that data; `\merge` only in a
57//! placement or a mapping. Each set is a scoped package of its own
58//! ([`BODY_PACKAGE`], [`DATA_PACKAGE`], [`MERGE_PACKAGE`]).
59//!
60//! # Placements, mappings and ranges
61//!
62//! Rows and columns are numbered from 1.
63//!
64//! - A **placement** (the optional argument of `\cell`) is `[COL]` or
65//! `[ROW;COL]`, each a number, a name, `.` or nothing for the current row
66//! or column, or `\merge{RANGE}` for a cell spanning several.
67//! - A **range** is `2-4` (both included), `2+3` (three from 2), or
68//! `1,2,3` (a union, which must be contiguous). In `\merge`, a start left
69//! out is the first index, and an end left out is the last index of the
70//! table as finally built.
71//! - A **mapping** (the optional argument of `\celldata`) is `[COLS]` or
72//! `[ROWS;COLS]`, each a comma-separated list of indices, ranges and
73//! `\merge{…}`, assigned to the data's entries in order. An open range
74//! (`2-`) continues one index per entry; with no rows given, the data's
75//! rows go from the current row on.
76//!
77//! # Style tokens
78//!
79//! The angle brackets hold style tokens separated by whitespace: a name, or
80//! a name with a value in braces. Each token refers to a cell style
81//! ([`CellStyle`], see the [`styles`] module) contributed to the service slot
82//! [`STYLES_SLOT`]. In a `\celldata`, a comma separates the token lists of
83//! successive entries of a row, the last list repeated. A cell's own tokens
84//! come before its `\celldata`'s. Of the tokens that give an alignment, the
85//! first decides, and likewise for the tokens that make the cell a header;
86//! every edge line (a rule: `rule{…}`, `lvert`, `rvert`, a line drawn along
87//! an edge of the cell) and every custom style is kept.
88//!
89//! # What the feature registers
90//!
91//! The feature ([`Cells`], under a [`CellsConfig`]) registers:
92//!
93//! - the eight elements of the tables of cells ([`ENVIRONMENT`], [`CELL`],
94//! [`DATA`], [`ROW`], [`COLUMN`], [`MERGE`], [`ROWNAMES`], [`COLNAMES`])
95//! and its four scoped packages; under [`CellsConfig::global`], the
96//! environment also as an ordinary environment;
97//! - the content handler [`CellsContent`], as a peer contribution to the
98//! `floats` feature's service slot of content handlers ([`handler`]);
99//! - the service slot [`STYLES_SLOT`] of cell styles
100//! ([`service_slot`](crate::core::registry::FeatureBuilder::service_slot)),
101//! with the cell styles it ships ([`shipped`]), and a build hook
102//! ([`Finalizer`](crate::core::registry::Finalizer)) that collects every
103//! cell style once the slot is assembled;
104//! - the general lowering rules ([`lower`]) and the recomposition rule of the
105//! `latex-recomposed` backend ([`latex`]);
106//! - the style definition [`STYLE`] for HTML ([`html`]) and the definition
107//! piece [`LATEX_PIECE`] for the recomposed LaTeX ([`latex`]); the
108//! definition piece of the rendered LaTeX, which delivers [`STYLE`]
109//! ([`latex_rendered`]);
110//! - its settings: the fields of [`CellsConfig`] as data
111//! ([`crate::core::settings`]).
112//!
113//! # How a table is lowered
114//!
115//! The reader [`read_grid`] reads a table at lowering. Every rule that
116//! lowers a table calls it, and nothing stores its result. Its result is the
117//! payload of the presentation element
118//! [`flm.pres.cells`](crate::stdlib::backends::pres::CELLS)
119//! ([`CellsPayload`](crate::stdlib::backends::pres::CellsPayload)), the
120//! grid's size and one entry per cell with the facts its tokens state,
121//! together with each cell's content and the problems it found.
122//!
123//! - On every backend except `latex-recomposed`, the general rule
124//! ([`lower::CellsRule`]) stages one dropped mark (`flm.pres.dropped`) per
125//! thing left out, then the `flm.pres.cells` node, with one `cell` content
126//! slot per entry: a `\cell`'s blocks, or a `\celldata` entry's content as
127//! one paragraph with the whitespace at its edges trimmed. It requires, on
128//! the backend it runs on, the style definitions or definition pieces that
129//! the table's cell styles declare for that backend
130//! ([`CellStyle::requires`]). The text backend lays the table out in
131//! aligned columns; the HTML backend writes a `<table>` as the
132//! [HTML contract](crate::stdlib::backends::html::CONVENTIONS) states
133//! ([`html`]; see also the
134//! [rendering guide](crate::guide::rendering#the-html-contract)).
135//! - On the `latex-recomposed` backend, the recomposition rule writes one
136//! call of the LaTeX hook `\flmCellsTable`, over the `tabularray` package
137//! ([`latex`]).
138//! - A command of the tables of cells written outside its place is lowered
139//! by [`lower::OutsideRule`] on every backend.
140//!
141//! # Interactions with other features
142//!
143//! - The [`floats`](crate::stdlib::features::floats) feature's `table`
144//! float type refers to the scoped package [`ENVIRONMENT_PACKAGE`] and to
145//! the content handler `cells` ([`handler`]); without the `floats`
146//! feature, the handler is dropped with one Note, and the environment can
147//! be written only under [`CellsConfig::global`].
148//! - Any feature may contribute cell styles of its own ([`CellStyle`]); the
149//! [guide on extending FLM](crate::guide::extending#a-cell-style-of-your-own)
150//! shows how.
151//! - The LaTeX family (the [`latex`](crate::stdlib::backends::latex)
152//! helpers and the `latex-recomposed` backend) owns the constructs
153//! the recomposition rule stages; without them, that rule is set aside
154//! (excluded from rule selection; see
155//! [`PeerName`](crate::core::registry::PeerName)) and the registry still
156//! builds.
157//!
158//! # Diagnostics
159//!
160//! Every mistake is an Error with a recovery ([`diagnostics`]), reported each
161//! time a rule lowers the table, and never under the `check` workflow
162//! ([`CHECK_WORKFLOW`](crate::stdlib::CHECK_WORKFLOW)), which lowers
163//! nothing. A dropped mark (`flm.pres.dropped`; see
164//! [recovery](crate::stdlib::backends::lowering::error)) shows where
165//! something was left out:
166//!
167//! | condition | recovery |
168//! |---|---|
169//! | `flm.cells.content-outside-cell` | the content is left out; a dropped mark is placed before the table |
170//! | `flm.cells.bad-placement` | a placement is ignored, and the cell goes where the current row and column put it; a mapping is ignored whole |
171//! | `flm.cells.bad-styles` | the styles argument is ignored |
172//! | `flm.cells.unknown-style`, `flm.cells.bad-style-value` | the token is ignored, the others kept |
173//! | `flm.cells.bad-names` | the entry is ignored, the others kept |
174//! | `flm.cells.overlap` | the later cell is left out whole; a dropped mark is placed before the table |
175//! | `flm.cells.too-large` | the cell that would make the table larger than a million positions is left out; a dropped mark is placed before the table |
176//! | `flm.cells.empty` | nothing is written for the table, except the dropped marks of what was left out |
177//! | `flm.cells.outside-table` | a `\cell`'s or a `\celldata`'s content is shown where the command is written; a command without content is left out, and a dropped mark is placed where it was |
178//!
179//! # Items of this module
180//!
181//! - The feature: [`Cells`], [`feature`], [`FEATURE`]; its configuration
182//! [`CellsConfig`].
183//! - Names: the elements [`ENVIRONMENT`], [`CELL`], [`DATA`], [`ROW`],
184//! [`COLUMN`], [`MERGE`], [`ROWNAMES`], [`COLNAMES`]; the scoped packages
185//! [`ENVIRONMENT_PACKAGE`], [`BODY_PACKAGE`], [`MERGE_PACKAGE`],
186//! [`DATA_PACKAGE`]; the arguments [`STYLES_ARG`], [`PLACEMENT_ARG`],
187//! [`CONTENT_ARG`], [`MAPPING_ARG`], [`DATA_ARG`], [`RANGE_ARG`],
188//! [`NAMES_ARG`]; the service slot [`STYLES_SLOT`]; the definitions
189//! [`STYLE`] and [`LATEX_PIECE`].
190//! - Reading a table: [`read_grid`], [`Grid`], [`CellContent`], [`Problem`]
191//! ([`reader`]); the block role by position: [`stands_in_body`],
192//! [`InBody`]; the styles argument's parser: [`CellStylesParser`]
193//! ([`parser`]).
194//! - Cell styles: [`CellStyle`], [`Effect`], [`Parameter`], [`StyleForm`],
195//! [`StyleRequirement`], [`Styles`], [`shipped`] ([`styles`]).
196//! - Lowering: [`lower`]; HTML: [`html`]; the recomposed LaTeX: [`latex`];
197//! the rendered LaTeX: [`latex_rendered`]; the floats content handler:
198//! [`CellsContent`] ([`handler`]).
199//! - Conditions: [`diagnostics`].
200
201pub mod diagnostics;
202mod elements;
203pub mod handler;
204pub mod html;
205pub mod latex;
206pub mod latex_rendered;
207pub mod lower;
208pub mod parser;
209pub mod reader;
210pub mod styles;
211
212use std::sync::Arc;
213
214use crate::core::settings::SettingsDecl;
215use crate::core::registry::{BuildError, FeatureBuilder, FeatureInfo, FlmFeature};
216use crate::core::services::Arity;
217use crate::model::names::FeatureName;
218use crate::stdlib::features::floats::{CONTENT_SLOT, FloatContentHandler};
219
220pub use elements::{InBody, stands_in_body};
221pub use handler::CellsContent;
222pub use parser::CellStylesParser;
223pub use reader::{CellContent, Grid, Problem, read_grid};
224pub use styles::{CellStyle, Effect, Parameter, StyleForm, StyleRequirement, Styles, shipped};
225
226/// The feature's registered name, `cells`.
227pub const FEATURE: &str = "cells";
228
229/// The declaration of the feature's settings: the fields of [`CellsConfig`]
230/// are its keys. See [`crate::core::settings`].
231fn settings() -> SettingsDecl {
232 SettingsDecl::new(FEATURE)
233 .config::<CellsConfig>(
234 "Whether the `cells` environment can be written wherever blocks can (`global`, false \
235 by default), in addition to the bodies that refer to the scoped package \
236 `flm.cells.environment`, such as a `table` float's. Fixed when the registry is \
237 built: it cannot vary per document or per render.",
238 )
239}
240
241/// The element of the `cells` environment, `flm.cells.cells`: a table of
242/// cells.
243pub const ENVIRONMENT: &str = "flm.cells.cells";
244
245/// The element of `\cell`, `flm.cells.cell`: one cell.
246pub const CELL: &str = "flm.cells.cell";
247
248/// The element of `\celldata`, `flm.cells.data`: a cell per entry of its data.
249pub const DATA: &str = "flm.cells.data";
250
251/// The element of `\\` in a table of cells, `flm.cells.row`: the end of a
252/// row.
253pub const ROW: &str = "flm.cells.row";
254
255/// The element of `&` in the data of `\celldata`, `flm.cells.column`: the end
256/// of an entry.
257pub const COLUMN: &str = "flm.cells.column";
258
259/// The element of `\merge`, `flm.cells.merge`: a span of rows or of columns.
260pub const MERGE: &str = "flm.cells.merge";
261
262/// The element of `\rownames`, `flm.cells.rownames`.
263pub const ROWNAMES: &str = "flm.cells.rownames";
264
265/// The element of `\colnames`, `flm.cells.colnames`.
266pub const COLNAMES: &str = "flm.cells.colnames";
267
268/// The scoped package that holds the `cells` environment,
269/// `flm.cells.environment`: a table of cells can be written in a body whose
270/// declaration refers to it. A float type of the `floats` feature refers to
271/// it in its configuration; the feature declares the package under every
272/// configuration.
273pub const ENVIRONMENT_PACKAGE: &str = "flm.cells.environment";
274
275/// The scoped package of the environment's body, `flm.cells.body`: `\cell`,
276/// `\celldata`, `\\`, `\rownames` and `\colnames`, which can be written
277/// only there and, through it, in the data of a `\celldata`.
278pub const BODY_PACKAGE: &str = "flm.cells.body";
279
280/// The scoped package of a placement and a mapping, `flm.cells.merge`:
281/// `\merge`.
282pub const MERGE_PACKAGE: &str = "flm.cells.merge";
283
284/// The scoped package of the data of `\celldata`, `flm.cells.data`: `&`.
285pub const DATA_PACKAGE: &str = "flm.cells.data";
286
287/// The name of the styles argument of `\cell` and `\celldata`, `styles`.
288pub const STYLES_ARG: &str = "styles";
289
290/// The name of the placement argument of `\cell`, `placement`.
291pub const PLACEMENT_ARG: &str = "placement";
292
293/// The name of the content argument of `\cell`, `content`.
294pub const CONTENT_ARG: &str = "content";
295
296/// The name of the mapping argument of `\celldata`, `mapping`.
297pub const MAPPING_ARG: &str = "mapping";
298
299/// The name of the data argument of `\celldata`, `data`.
300pub const DATA_ARG: &str = "data";
301
302/// The name of the range argument of `\merge`, `range`.
303pub const RANGE_ARG: &str = "range";
304
305/// The name of the argument of `\rownames` and `\colnames`, `names`.
306pub const NAMES_ARG: &str = "names";
307
308/// The name of the service slot of cell styles, `flm.cells.styles`: every
309/// [`CellStyle`] that a table's tokens may refer to, in the order of
310/// contribution ([`Arity::OrderedMany`]). A service slot is the declaration, by
311/// the feature that owns an interaction, of a dotted name, the type of the
312/// values the slot takes and its arity; any feature may contribute values to
313/// it (see [services](crate::core::services)). The
314/// `cells` feature contributes the cell styles it ships ([`shipped`]); any
315/// feature may contribute its own, as a peer contribution.
316pub const STYLES_SLOT: &str = "flm.cells.styles";
317
318/// The identifier of the feature's style definition for HTML,
319/// `flm.cells.style` ([`html::stylesheet`]). The HTML contract's row for
320/// `flm.pres.cells` refers to it, and the shipped custom styles require it on
321/// HTML.
322pub const STYLE: &str = "flm.cells.style";
323
324/// The identifier of the feature's definition piece for the recomposed
325/// LaTeX, `flm.latex.def.cells` ([`latex::definition_piece`]), which the
326/// recomposition rule of a table requires, and which the shipped custom
327/// styles require on that backend.
328pub const LATEX_PIECE: &str = "flm.latex.def.cells";
329
330/// The configuration of the `cells` feature: whether the `cells` environment
331/// is also an ordinary environment of the document.
332///
333/// Under the default, `global: false`, the environment can be written only
334/// inside the bodies whose declarations refer to the scoped package
335/// [`ENVIRONMENT_PACKAGE`]: a `table` float's, where the `floats` feature is
336/// registered. Under `global: true` it is also an ordinary environment,
337/// written wherever blocks can be: between paragraphs, in a list item, in a
338/// footnote.
339///
340/// The value is the feature's configuration (see
341/// [configuration](crate::guide::concepts_overview#settings-options-and-configuration)):
342/// fixed when the registry is built, since it decides which environments the
343/// registry's parsing language ([`BuiltLang`](crate::lang::BuiltLang))
344/// holds, and fed into the registry digest
345/// ([`digest_bytes`](CellsConfig::digest_bytes)). The standard features
346/// carry it as [`StdlibConfig::cells`](crate::stdlib::StdlibConfig::cells).
347///
348/// # Examples
349///
350/// ```
351/// use flm_core::stdlib::features::cells::CellsConfig;
352///
353/// assert!(!CellsConfig::new().global);
354/// assert!(CellsConfig::new().global(true).global);
355/// ```
356#[derive(Debug, Clone, Copy, Default, PartialEq, Eq, Hash, serde::Deserialize)]
357#[derive(schemars::JsonSchema)]
358#[serde(default, deny_unknown_fields)]
359pub struct CellsConfig {
360 /// Whether the `cells` environment is an ordinary environment of the
361 /// document, in addition to its declaration in the scoped package
362 /// [`ENVIRONMENT_PACKAGE`]. `false` by default.
363 pub global: bool,
364}
365
366impl CellsConfig {
367 /// The default configuration: the environment is declared in its scoped
368 /// package only.
369 pub fn new() -> CellsConfig {
370 CellsConfig::default()
371 }
372
373 /// Builder: sets [`global`](CellsConfig::global).
374 pub fn global(mut self, global: bool) -> CellsConfig {
375 self.global = global;
376 self
377 }
378
379 /// The bytes the feature feeds into the registry digest: one byte, `1`
380 /// under `global` and `0` otherwise.
381 pub fn digest_bytes(&self) -> Vec<u8> {
382 // Taken apart by name, so a field added and not written here fails
383 // to compile.
384 let CellsConfig { global } = self;
385 vec![u8::from(*global)]
386 }
387}
388
389/// The `cells` feature ([`FlmFeature`]). Under a [`CellsConfig`], it
390/// registers the `cells` environment in its scoped package and, under
391/// [`global`](CellsConfig::global), as an ordinary environment; the commands
392/// of its body and their scoped packages; the content handler for the
393/// `floats` feature; the service slot of cell styles with the shipped ones;
394/// the lowering rules; the HTML style definition and the LaTeX definition
395/// piece. See the [module documentation](self#what-the-feature-registers).
396#[derive(Debug, Default, Clone, Copy)]
397pub struct Cells {
398 config: CellsConfig,
399}
400
401impl Cells {
402 /// The feature under `config`, which is fixed for the life of the
403 /// registry it is built into (see
404 /// [configuration](crate::guide::concepts_overview#settings-options-and-configuration)).
405 pub fn new(config: CellsConfig) -> Cells {
406 Cells { config }
407 }
408
409 /// The configuration this feature was constructed with.
410 pub fn config(&self) -> &CellsConfig {
411 &self.config
412 }
413}
414
415impl FlmFeature for Cells {
416 fn info(&self) -> FeatureInfo {
417 FeatureInfo::new(FEATURE, "Tables of cells").docs(
418 "The `cells` environment, inside a `table` float or, under `global`, wherever blocks \
419 can be written: a grid filled with `\\cell` and `\\celldata`, cells spanning rows or \
420 columns with `\\merge`, names for rows and columns with `\\rownames` and \
421 `\\colnames`, and style tokens referring to the cell styles of the service slot \
422 `flm.cells.styles`.",
423 )
424 }
425
426 fn settings(&self) -> Option<SettingsDecl> {
427 Some(settings())
428 }
429
430 fn register(&self, b: &mut FeatureBuilder<'_>) -> Result<(), BuildError> {
431 let owner: FeatureName = b.feature().clone();
432 let environment = elements::environment_spec();
433 for package in elements::packages(&owner, &environment) {
434 b.scoped_package(package)?;
435 }
436 if self.config.global {
437 // The same element, as an ordinary environment: which declaration
438 // answers inside a body naming the package is immaterial.
439 b.element(elements::environment_def(&owner, &environment))?;
440 }
441 for (element, docs) in [
442 (
443 ENVIRONMENT,
444 "A table of cells: a grid of rows and columns, each cell placed by its row and \
445 its column.",
446 ),
447 (CELL, "One cell of a table of cells, with its content, its place and its styles."),
448 (
449 DATA,
450 "Several cells of a table of cells, given as data: one cell per entry, row by row.",
451 ),
452 (ROW, "The end of a row of a table of cells: the next cell starts a new row."),
453 (COLUMN, "The end of an entry in the data of several cells of a table of cells."),
454 (MERGE, "A span of rows or of columns that one cell of a table of cells covers."),
455 (
456 ROWNAMES,
457 "Names given to the rows of a table of cells, to be written in place of their \
458 numbers.",
459 ),
460 (
461 COLNAMES,
462 "Names given to the columns of a table of cells, to be written in place of their \
463 numbers.",
464 ),
465 ] {
466 b.element_type_text(element, docs)?;
467 }
468 // Where the floats feature is absent, nobody declares the slot and
469 // the contribution is dropped with a Note.
470 b.peer_slot::<dyn FloatContentHandler>(CONTENT_SLOT, Arc::new(CellsContent))?;
471 b.service_slot::<CellStyle>(
472 STYLES_SLOT,
473 Arity::OrderedMany,
474 "the cell styles a cell's style tokens may refer to: the ones the `cells` feature \
475 ships and the ones other features contribute",
476 )?;
477 for style in shipped() {
478 b.contribute_to::<CellStyle>(STYLES_SLOT, Arc::new(style))?;
479 }
480 let styles = Arc::new(Styles::default());
481 b.finalizer(Arc::new(styles::CollectStyles { styles: Arc::clone(&styles) }))?;
482 for rule in lower::rules(Arc::clone(&styles)) {
483 b.lowering_rule(rule)?;
484 }
485 html::register(b)?;
486 latex_rendered::register(b)?;
487 latex::register(b, styles)?;
488 b.digest_input(&self.config.digest_bytes())?;
489 Ok(())
490 }
491}
492
493/// The [`Cells`] feature under the default configuration, ready to be
494/// listed in a package entry.
495pub fn feature() -> Arc<dyn FlmFeature> {
496 Arc::new(Cells::default())
497}
498
499#[cfg(test)]
500mod tests {
501 use super::*;
502
503 #[test]
504 fn the_configuration_digests_its_one_switch() {
505 assert_eq!(CellsConfig::new().digest_bytes(), [0]);
506 assert_eq!(CellsConfig::new().global(true).digest_bytes(), [1]);
507 }
508
509 #[test]
510 fn the_styles_parser_answers_what_the_language_asks() {
511 use crate::lang::mint::{DefinitionShape, FlmArgumentParser};
512 use techy::core::constructs::ArgumentParser;
513 let parser = CellStylesParser::new();
514 assert_eq!(parser.identity(), b"flm.cells.styles");
515 assert_eq!(parser.definition_shape(), DefinitionShape::NoShape { token: "cell-styles" });
516 assert_eq!(parser.description(), "an optional `<…>` group of style tokens");
517 assert!(parser.can_match_empty());
518 }
519}