properties method
Implementation
Map<String, List<Declaration>> properties() => _properties ??= (rules == null)
? <String, List<Declaration>>{}
: rules.fold(<String, List<Declaration>>{},
(Map<String, List<Declaration>> hash, Node r) {
if (r is Declaration && !r.variable) {
final String name =
(r.name is String) ? r.name : r.name.first.value; // :keyword
// Properties don't overwrite as they can merge
if (!hash.containsKey('\$$name')) {
hash['\$$name'] = <Declaration>[r];
} else {
hash['\$$name'].add(r);
}
}
return hash;
});