Description
At this point the data model only has string literals:
interface Literal {
type: "literal";
value: string;
}
The parser also has number-literal
literal = quoted / unquoted
quoted = "|" *(quoted-char / quoted-escape) "|"
unquoted = name / number-literal
When we format a message we use the data model only.
Which means there is no way to tell the difference between "...{|123456789|}..."
and "...{123456789}..."
Because in the data model we only have a string, and "The presence or absence of quotes is not preserved by the data model."
But I think one would expect that {|123456.789|}
to result in "123456.789" (because it is a string),
and would expect {123456.789}
formatted as "123,456.789" (or "123.456,789", maybe with alternate digits).
Because "it is a number".
It means the placeholders without functions are not intuitive:
"...{123456789}..."
=> "...123456789..."
"...{123456789 :number}..."
=> "...123,456.789}..."
Numeric literals are also found in options: ...{$foo :function opt1=bar opt2=baz opt3=42}...
, and in decision keys.
TLDR:
We have numeric literals in syntax.
We need to know if a literal was numeric when we format to string.
But we drop that info in the data model, which sits in the middle.