Merge pull request #206527 from ncfavier/tree-sitter-unionOfDisjoint

This commit is contained in:
Naïm Favier 2022-12-27 16:29:49 +01:00 committed by GitHub
commit 21f61857ae
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -375,19 +375,7 @@ let
knownTreeSitterOrgGrammarRepos);
in
mergeAttrsUnique otherGrammars treeSitterOrgaGrammars;
# TODO: move to lib
mergeAttrsUnique = left: right:
let intersect = lib.intersectLists (lib.attrNames left) (lib.attrNames right); in
assert
lib.assertMsg (intersect == [ ])
(lib.concatStringsSep "\n" [
"mergeAttrsUnique: keys in attrset overlapping:"
"left: ${lib.generators.toPretty {} (lib.getAttrs intersect left)}"
"right: ${lib.generators.toPretty {} (lib.getAttrs intersect right)}"
]);
left // right;
lib.attrsets.unionOfDisjoint otherGrammars treeSitterOrgaGrammars;