export<M> method

List<Defi<M>> export<M>()

Implementation

List<Defi<M>> export<M>() {
  switch (M) {
    case const (SPI):
      final exports = <Defi<SPI>>[];
      final seen = <Defi<SPI>>{};
      for (final named in _spi.values) {
        for (final defs in named.values) {
          for (final defi in defs) {
            if (seen.add(defi)) {
              exports.add(defi);
            }
          }
        }
      }
      return exports as List<Defi<M>>;
    case const (MPI):
      return _mpi.values.toList() as List<Defi<M>>;
    default:
      throw Exception('unknown macro: $M');
  }
}