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();
    }

    final prop = row.getField(1);
    final props = _derivedProps[prop] ?? <DeriveCodePropsItem>[]
      ..add(
        DeriveCodePropsItem(
          row.rangeStart,
          row.rangeEnd,
          row.getField(1),
          category,
          row.getField(2),
        ),
      );
    _derivedProps[prop] = props;
  });

  await parser.parse();

  _derivedProps.forEach(
    (k, v) => v.sort((a, b) => (a as UcdItemBase).start.compareTo((b as UcdItemBase).start)),
  );
}