attachProperties function

void attachProperties(
  1. Iterable<RegExpMatch> match,
  2. Map<String, dynamic> location,
  3. dynamic names,
  4. dynamic rawName,
)

Implementation

void attachProperties(Iterable<RegExpMatch> match,
    Map<String, dynamic> location, names, rawName) {
  if ((rawName != null && rawName.length > 0) &&
      (names == null || names.length == 0)) {
    match.forEach((m) {
      assert(rawName != null);
      location[rawName] = toIntIfInt(m.groupCount == 0 ? m.input : m.group(1));
    });
  } else {
    match.forEach((m) {
      for (var i = 0; i < m.groupCount; i++) {
        assert(names[i] != null);
        location[names[i].toString()] = toIntIfInt(m.group(i + 1));
      }
    });
  }
}