Update spec tests to current version from message-format-wg
- Update parser for changed name-start grammar rule
- Validate number literals in :number implementation (since parser no longer does this)
- Disallow `:number`/`:integer` select option set from variable
See https://github.com/unicode-org/message-format-wg/pull/1016
As part of this, un-skip tests where the `bad-option` error is
expected, and implement validating digit size options
(pending PR https://github.com/unicode-org/icu/pull/2973 is intended
to do this more fully)
Matching PR #883 in the message-format-wg repo.
Also move spec tests for unsupported statements and expressions into new files
to serve as syntax error tests.
Add MessageFormatter::Builder::setErrorHandlingBehavior() method
and a new enum type MessageFormatter::UMFErrorHandlingBehavior
to denote strict or best-effort behavior.
The reason for adding a single method that takes an enum is to allow
for the possibility of more error handling modes in the future.
Co-authored-by: Markus Scherer <markus.icu@gmail.com>
This also updates the spec tests from the current version of the MFWG
repository and removes some duplicate tests.
Spec tests now reflect the message-format-wg repo as of
5612f3b050
It also updates both the ICU4C and ICU4J parsers to follow the
current test schema in the conformance repository.
This includes adding code to both parsers to allow `src` to be
either a single string or an array of strings (per
https://github.com/unicode-org/conformance/pull/255 ),
and eliminating `srcs` in tests.
It also includes other changes to make updated spec tests pass:
ICU4C: Allow trailing whitespace for complex messages, due to spec change
ICU4C: Parse number literals correctly in Number::format
ICU4J: Allow trailing whitespace after complex body, per spec change
ICU4C: Fix bug that was assuming an .input variable can't have a reserved annotation
ICU4C: Fix bug where unsupported '.i' was parsed as an '.input'
ICU4C/ICU4J: Handle markup with space after the initial left curly brace
ICU4C: Check for duplicate variant errors
ICU4C/ICU4J: Handle leading whitespace in complex messages
ICU4J: Treat whitespace after .input keyword as optional
ICU4J: Don't format unannotated number literals as numbers