void processUExtensions()

in lib/src/locale/locale_parser.dart [172:209]


  void processUExtensions() {
    if (_uExtensions != null) {
      problems.add('duplicate "u"');
      return;
    }
    _uExtensions = <String, String>{};
    var empty = true;
    final attributes = <String>[];
    while (acceptLowAlphaNumeric3to8()) {
      attributes.add(_accepted);
    }
    if (attributes.isNotEmpty) {
      empty = false;
      attributes.sort();
      _uExtensions![''] = attributes.join('-');
    }
    // unicode_locale_extensions: collect "(sep keyword)*".
    while (acceptUExtensionKey()) {
      empty = false;
      var key = _accepted;
      final typeParts = <String>[];
      while (acceptLowAlphaNumeric3to8()) {
        typeParts.add(_accepted);
      }
      if (!_uExtensions!.containsKey(key)) {
        if (typeParts.length == 1 && typeParts[0] == 'true') {
          _uExtensions![key] = '';
        } else {
          _uExtensions![key] = typeParts.join('-');
        }
      } else {
        problems.add('duplicate "$key"');
      }
    }
    if (empty) {
      problems.add('empty "u"');
    }
  }