diff options
Diffstat (limited to 'pkgs/development/tools/parsing/tree-sitter/update.nix')
-rw-r--r-- | pkgs/development/tools/parsing/tree-sitter/update.nix | 80 |
1 files changed, 47 insertions, 33 deletions
diff --git a/pkgs/development/tools/parsing/tree-sitter/update.nix b/pkgs/development/tools/parsing/tree-sitter/update.nix index 39b064cf4b3..b2f301aee54 100644 --- a/pkgs/development/tools/parsing/tree-sitter/update.nix +++ b/pkgs/development/tools/parsing/tree-sitter/update.nix @@ -126,6 +126,10 @@ let orga = "MDeiml"; repo = "tree-sitter-markdown"; }; + "tree-sitter-proto" = { + orga = "mitchellh"; + repo = "tree-sitter-proto"; + }; "tree-sitter-rego" = { orga = "FallenAngel97"; repo = "tree-sitter-rego"; @@ -143,6 +147,10 @@ let repo = "tree-sitter-sql"; branch = "gh-pages"; }; + "tree-sitter-typst" = { + orga = "uben0"; + repo = "tree-sitter-typst"; + }; "tree-sitter-vim" = { orga = "vigoux"; repo = "tree-sitter-viml"; @@ -375,6 +383,10 @@ let orga = "winglang"; repo = "wing"; }; + "tree-sitter-wgsl" = { + orga = "szebniok"; + repo = "tree-sitter-wgsl"; + }; }; allGrammars = @@ -399,7 +411,8 @@ let jsonFile = name: val: (formats.json { }).generate name val; # implementation of the updater - updateImpl = passArgs "updateImpl-with-args" { + updateImpl = passArgs "updateImpl-with-args" + { binaries = { curl = "${curl}/bin/curl"; nix-prefetch-git = "${nix-prefetch-git}/bin/nix-prefetch-git"; @@ -410,9 +423,10 @@ let ignoredTreeSitterOrgRepos ; } - (writers.writePython3 "updateImpl" { - flakeIgnore = ["E501"]; - } ./update_impl.py); + (writers.writePython3 "updateImpl" + { + flakeIgnore = [ "E501" ]; + } ./update_impl.py); # Pass the given arguments to the command, in the ARGS environment variable. # The arguments are just a json object that should be available in the script. @@ -425,7 +439,7 @@ let lib.concatMapStringsSep "\n" f (lib.mapAttrsToList (k: v: { name = k; } // v) attrs); - jsonNewlines = lib.concatMapStringsSep "\n" (lib.generators.toJSON {}); + jsonNewlines = lib.concatMapStringsSep "\n" (lib.generators.toJSON { }); # Run the given script for each of the attr list. # The attrs are passed to the script as a json value. @@ -439,34 +453,34 @@ let outputDir = "${toString ./.}/grammars"; update-all-grammars = writeShellScript "update-all-grammars.sh" '' - set -euo pipefail - ${updateImpl} fetch-and-check-tree-sitter-repos '{}' - echo "writing files to ${outputDir}" 1>&2 - mkdir -p "${outputDir}" - ${forEachParallel - "repos-to-fetch" - (writeShellScript "fetch-repo" '' - ${updateImpl} fetch-repo "$1" - '') - (lib.mapAttrsToList - (nixRepoAttrName: attrs: attrs // { - inherit - nixRepoAttrName - outputDir; - }) - allGrammars) - } - ${updateImpl} print-all-grammars-nix-file "$(< ${ - jsonFile "all-grammars.json" { - allGrammars = - (lib.mapAttrsToList - (nixRepoAttrName: attrs: attrs // { - inherit nixRepoAttrName; - }) - allGrammars); - inherit outputDir; - } - })" + set -euo pipefail + ${updateImpl} fetch-and-check-tree-sitter-repos '{}' + echo "writing files to ${outputDir}" 1>&2 + mkdir -p "${outputDir}" + ${forEachParallel + "repos-to-fetch" + (writeShellScript "fetch-repo" '' + ${updateImpl} fetch-repo "$1" + '') + (lib.mapAttrsToList + (nixRepoAttrName: attrs: attrs // { + inherit + nixRepoAttrName + outputDir; + }) + allGrammars) + } + ${updateImpl} print-all-grammars-nix-file "$(< ${ + jsonFile "all-grammars.json" { + allGrammars = + (lib.mapAttrsToList + (nixRepoAttrName: attrs: attrs // { + inherit nixRepoAttrName; + }) + allGrammars); + inherit outputDir; + } + })" ''; |