The abstract syntax tree for an ICU MessageFormat message.
A parsed message is a list of Parts. This module is the shared
representation that a parser produces and that a formatter or code generator
consumes — it deliberately mirrors the structure of the
ICU syntax.
A single piece of a message.
Literal — raw text, e.g. Hello. ICU quoting ('', '{') is resolved
by the parser, so a Literal holds the already-unescaped text.Argument — a bare placeholder {name}.Number / Date / Time — a typed placeholder such as {n, number} or
{d, date, long}, with an optional style/skeleton string.Select — {g, select, ...}, a plain keyword switch with a mandatory
other branch.Plural — {n, plural, ...} or {n, selectordinal, ...}. ordinal
distinguishes the two; offset carries offset:N.Pound — the # placeholder inside a plural branch, replaced by the
(offset-adjusted) argument value.One branch of a plural / selectordinal block, e.g. one {...} or
=0 {...}.
Selects which plural branch applies: either an exact literal match
(=0, =1, ...) or a CLDR plural keyword (zero, one, two, few,
many). The other branch is stored separately on Part.Plural.
Collect every argument name referenced anywhere in a message, including
those nested inside select and plural branches. Order of first appearance
is preserved and duplicates are removed.
A message is an ordered sequence of parts. Rendering the message means rendering each part in turn and concatenating the results.