merge method
This table with other's entries added; where both name a word,
other's is the one read (a design system's over the built-in one).
Implementation
NotationVocabulary merge(NotationVocabulary other) {
Map<String, Map<String, String>> both(Map<String, Map<String, String>> a, Map<String, Map<String, String>> b) => {
for (final k in {...a.keys, ...b.keys}) k: {...?a[k], ...?b[k]},
};
return NotationVocabulary(
types: {...types, ...other.types},
parameters: both(parameters, other.parameters),
flags: both(flags, other.flags),
events: both(events, other.events),
verbs: {...verbs, ...other.verbs},
definitions: {...definitions, ...other.definitions},
dictionary: {...dictionary, ...other.dictionary},
);
}