getNumberCases method

Map<int, Message> getNumberCases(
  1. List<Node> parts,
  2. List<String> arguments
)

Implementation

Map<int, Message> getNumberCases(List<Node> parts, List<String> arguments) {
  final numberCases = parts
      .where((node) =>
          node.children[0].type == ST.equalSign &&
          node.children[1].type == ST.number)
      .map((node) => getPluralCaseFrom(
            int.parse(node.children[1].value ?? ''),
            node,
            arguments,
          ))
      .whereType<MapEntry<int, Message>>();
  return Map.fromEntries(numberCases);
}