singleUnitParser property

Parser<Unit> singleUnitParser

Returns a typed parser that produces a single unit.

Implementation

Parser<Unit> get singleUnitParser =>
    _mapParser(_unitIdentifier, (dynamic name) {
      var unit = unitFor(name);
      if (unit == null) return failure('$name not recognized');
      return EpsilonParser(unit);
    });