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 category = '';
    if (row.comment.isNotEmpty && row.comment.length > 3) {
      category = row.comment.substring(0, 2).trim();
    }

    codePoints.add(
      EastAsianWidthItem(
        row.rangeStart,
        row.rangeEnd,
        row.getField(1),
        category,
      ),
    );
  });

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