parse method

Map<String, String> parse(
  1. Iterable<String> lines
)

Creates a Map. Duplicate keys are silently discarded.

Implementation

Map<String, String> parse(Iterable<String> lines) {
  var out = <String, String>{};
  for (var line in lines) {
    var kv = parseOne(line, env: out);
    if (kv.isEmpty) continue;
    out.putIfAbsent(kv.keys.single, () => kv.values.single);
  }
  return out;
}