diff --git a/docs/ldml/tr35-general.md b/docs/ldml/tr35-general.md index c02953df8a4..cf744bcc0e0 100644 --- a/docs/ldml/tr35-general.md +++ b/docs/ldml/tr35-general.md @@ -68,7 +68,7 @@ The LDML specification is divided into the following parts: * [Unit Preference and Conversion Data](#Unit_Preference_and_Conversion) * [Unit Identifiers](#Unit_Identifiers) * [Nomenclature](#nomenclature) - * [Syntax](#syntax) + * [Unit Syntax](#unit-syntax) * [Unit Identifier Uniqueness](#Unit_Identifier_Uniqueness) * [Example Units](#Example_Units) * [Compound Units](#compound-units) @@ -902,157 +902,160 @@ As with other identifiers in CLDR, the American English spelling is used for uni > In keeping with U.S. and International practice (see Sec. C.2), this Guide uses the dot on the line as the decimal marker. In addition this Guide utilizes the American spellings “meter,” “liter,” and “deka” rather than “metre,” “litre,” and “deca,” and the name “metric ton” rather than “tonne.” -#### Syntax - -The formal syntax for identifiers is provided below. -Some of the constraints reference data from the unitIdComponents in [Unit_Conversion](tr35-info.md#Unit_Conversion). - - - -
unit_identifier | := | -core_unit_identifier - | mixed_unit_identifier - | long_unit_identifier |
core_unit_identifier | := | -product_unit ("-" per "-" product_unit)* - | per "-" product_unit ("-" per "-" product_unit)* -
|
per | := | -"per"
-
|
product_unit | := | -single_unit ("-" single_unit)* ("-" pu_single_unit)* - | pu_single_unit ("-" pu_single_unit)* -
|
single_unit | := | -dimensionality_prefix? simple_unit | unit_constant
-
|
pu_single_unit | := | -"xxx-" single_unit | "x-" single_unit
-
|
unit_constant | := | -[1-9][0-9]* ("e" [1-9][0-9]*)?
-
|
dimensionality_prefix | := | -"square-" | "cubic-" | "pow" ([2-9]|1[0-5]) "-" -
|
simple_unit | := | -(prefix_component "-")* (prefixed_unit | base_component) ("-" suffix_component)* - | currency_unit - | "em" | "g" | "us" | "hg" | "of" -
|
prefixed_unit | - | prefix base_component
|
prefix | - | si_prefix | binary_prefix |
si_prefix | := | -"deka" | "hecto" | "kilo", …
-
|
binary_prefix | := | -"kibi", "mebi", …
-
|
prefix_component | := | -[a-z]{3,∞}
-
|
base_component | := | -[a-z]{3,∞}
-
|
suffix_component | := | -[a-z]{3,∞}
-
|
:= | -(single_unit | pu_single_unit) ("-" and "-" (single_unit | pu_single_unit ))*
-
| |
and | := | -"and"
-
|
long_unit_identifier | := | -grouping "-" core_unit_identifier |
grouping | := | -[a-z]{3,∞} |
currency_unit | := | -"curr-" [a-z]{3}
-
|
plus others in common use
Codes consisting of 3 ASCII letters that are or have been valid in ISO 4217, plus certain additional codes that are or have been in common use. The list of countries and time periods associated with each currency value is available in Supplemental Currency Data, plus the default number of decimals.
The XXX code is given a broader interpretation as Unknown or Invalid Currency.
Well-formed codes are of the form [A-Za-z]{3}
, with the canonical format being [A-Z]{3}
.
+ The valid codes are ones that are or have been valid in ISO 4217, plus certain additional codes that are or have been in common use.
+ Supplemental Currency Data provides the list of countries (regions) and time periods associated with each currency code.
+ It also supplies the default number of decimals.
The XXX code is given a broader interpretation than in ISO 4217, as Unknown or Invalid Currency.