Skip to content

Commit f19b35e

Browse files
committed
parser fix
1 parent 681593e commit f19b35e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

icu4c/source/i18n/messageformat2_parser.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1973,7 +1973,8 @@ void Parser::parseSelectors(UErrorCode& status) {
19731973
// "Backtracking" is required here. It's not clear if whitespace is
19741974
// (`[s]` selector) or (`[s]` variant)
19751975
while (isWhitespace(peek()) || peek() == DOLLAR) {
1976-
parseOptionalWhitespace();
1976+
int32_t whitespaceStart = index;
1977+
parseRequiredWhitespace(status);
19771978
// Restore precondition
19781979
CHECK_BOUNDS(status);
19791980
if (peek() != DOLLAR) {
@@ -2004,6 +2005,9 @@ void Parser::parseSelectors(UErrorCode& status) {
20042005
break; \
20052006
} \
20062007

2008+
// Parse required whitespace before first variant
2009+
parseRequiredWhitespace(status);
2010+
20072011
// Parse variants
20082012
while (isWhitespace(peek()) || isBidiControl(peek()) || isKeyStart(peek())) {
20092013
// Trailing whitespace is allowed

0 commit comments

Comments
 (0)