parse method

  1. @override
Future<void> parse()

Initiates the parsing of the UCD file

Implementation

@override
Future<void> parse() async {
  final parser = UcdParser.parseFile(filename, (row) {
    if (row.error.isNotEmpty) {
      throw UcdException(row.error);
    }

    var version = 0.0;
    if (row.comment.isNotEmpty) {
      final rx = RegExp(r'^\s*E(\d+\.\d+)');
      version = double.parse(rx.firstMatch(row.comment)?[1] ?? '0.0');
    }

    codePoints.add(
      EmojiDataItem(
        row.rangeStart,
        row.rangeEnd,
        row.getField(1),
        version,
      ),
    );
  });

  await parser.parse();
  sort();
}