diff options
Diffstat (limited to 'nixpkgs/pkgs/development/tools/parsing')
71 files changed, 1878 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/tools/parsing/antlr/2.7.7-fixes.patch b/nixpkgs/pkgs/development/tools/parsing/antlr/2.7.7-fixes.patch new file mode 100644 index 000000000000..a71b7718e3bf --- /dev/null +++ b/nixpkgs/pkgs/development/tools/parsing/antlr/2.7.7-fixes.patch @@ -0,0 +1,26 @@ +diff --git a/lib/cpp/antlr/CharScanner.hpp b/lib/cpp/antlr/CharScanner.hpp +index 8a97e97..1835a3e 100644 +--- a/lib/cpp/antlr/CharScanner.hpp ++++ b/lib/cpp/antlr/CharScanner.hpp +@@ -11,6 +11,8 @@ + #include <antlr/config.hpp> + + #include <map> ++#include <cstdio> ++#include <cstring> + + #ifdef HAS_NOT_CCTYPE_H + #include <ctype.h> +diff --git a/scripts/config.make.in b/scripts/config.make.in +index c23dd5c..6057309 100644 +--- a/scripts/config.make.in ++++ b/scripts/config.make.in +@@ -38,7 +38,7 @@ MAKEOVERRIDES := $(patsubst SUBDIRS=%,,$(MAKEOVERRIDES)) + all clean distclean test install force-target clean-target :: + @dirs="$(SUBDIRS)" ; \ + test -z "$${dirs}" && { \ +- dirs=`/bin/ls` ; \ ++ dirs=`ls` ; \ + } ; \ + for d in . $${dirs} ; do \ + case $${d} in \ diff --git a/nixpkgs/pkgs/development/tools/parsing/antlr/2.7.7.nix b/nixpkgs/pkgs/development/tools/parsing/antlr/2.7.7.nix new file mode 100644 index 000000000000..fed96e954751 --- /dev/null +++ b/nixpkgs/pkgs/development/tools/parsing/antlr/2.7.7.nix @@ -0,0 +1,26 @@ +{ lib, stdenv, fetchurl, jdk, python2 }: + +stdenv.mkDerivation { + name = "antlr-2.7.7"; + src = fetchurl { + url = "https://www.antlr2.org/download/antlr-2.7.7.tar.gz"; + sha256 = "1ffvcwdw73id0dk6pj2mlxjvbg0662qacx4ylayqcxgg381fnfl5"; + }; + patches = [ ./2.7.7-fixes.patch ]; + buildInputs = [ jdk ]; + nativeBuildInputs = [ python2 ]; + + meta = with lib; { + description = "Powerful parser generator"; + longDescription = '' + ANTLR (ANother Tool for Language Recognition) is a powerful parser + generator for reading, processing, executing, or translating structured + text or binary files. It's widely used to build languages, tools, and + frameworks. From a grammar, ANTLR generates a parser that can build and + walk parse trees. + ''; + homepage = "https://www.antlr.org/"; + license = licenses.bsd3; + platforms = platforms.unix; + }; +} diff --git a/nixpkgs/pkgs/development/tools/parsing/antlr/3.4.nix b/nixpkgs/pkgs/development/tools/parsing/antlr/3.4.nix new file mode 100644 index 000000000000..962cd079a8e9 --- /dev/null +++ b/nixpkgs/pkgs/development/tools/parsing/antlr/3.4.nix @@ -0,0 +1,39 @@ +{lib, stdenv, fetchurl, jre}: + +stdenv.mkDerivation rec { + pname = "antlr"; + version = "3.4"; + src = fetchurl { + url ="https://www.antlr3.org/download/antlr-${version}-complete.jar"; + sha256 = "1xqbam8vf04q5fasb0m2n1pn5dbp2yw763sj492ncq04c5mqcglx"; + }; + + dontUnpack = true; + + installPhase = '' + mkdir -p "$out"/{lib/antlr,bin} + cp "$src" "$out/lib/antlr/antlr-${version}-complete.jar" + + echo "#! ${stdenv.shell}" >> "$out/bin/antlr" + echo "'${jre}/bin/java' -cp '$out/lib/antlr/antlr-${version}-complete.jar' -Xms200M -Xmx400M org.antlr.Tool \"\$@\"" >> "$out/bin/antlr" + + chmod a+x "$out/bin/antlr" + ln -s "$out/bin/antlr"{,3} + ''; + + inherit jre; + + meta = with lib; { + description = "Powerful parser generator"; + longDescription = '' + ANTLR (ANother Tool for Language Recognition) is a powerful parser + generator for reading, processing, executing, or translating structured + text or binary files. It's widely used to build languages, tools, and + frameworks. From a grammar, ANTLR generates a parser that can build and + walk parse trees. + ''; + homepage = "https://www.antlr.org/"; + license = licenses.bsd3; + platforms = platforms.linux ++ platforms.darwin; + }; +} diff --git a/nixpkgs/pkgs/development/tools/parsing/antlr/3.5.nix b/nixpkgs/pkgs/development/tools/parsing/antlr/3.5.nix new file mode 100644 index 000000000000..cb6263aca424 --- /dev/null +++ b/nixpkgs/pkgs/development/tools/parsing/antlr/3.5.nix @@ -0,0 +1,52 @@ +{lib, stdenv, fetchpatch, fetchurl, fetchFromGitHub, jre}: + +stdenv.mkDerivation rec { + pname = "antlr"; + version = "3.5.2"; + jar = fetchurl { + url = "https://www.antlr3.org/download/antlr-${version}-complete.jar"; + sha256 = "0srjwxipwsfzmpi0v32d1l5lzk9gi5in8ayg33sq8wyp8ygnbji6"; + }; + src = fetchFromGitHub { + owner = "antlr"; + repo = "antlr3"; + rev = "5c2a916a10139cdb5c7c8851ee592ed9c3b3d4ff"; + sha256 = "1i0w2v9prrmczlwkfijfp4zfqfgrss90a7yk2hg3y0gkg2s4abbk"; + }; + + patches = [ + (fetchpatch { + url = "https://src.fedoraproject.org/rpms/antlr3/raw/f1bb8d639678047935e1761c3bf3c1c7da8d0f1d/f/0006-antlr3memory.hpp-fix-for-C-20-mode.patch"; + sha256 = "0apk904afjqbad6c7z9r72a9lkbz69vwrl8j2a6zgxjn8dfb2p8b"; + }) + ]; + + installPhase = '' + mkdir -p "$out"/{lib/antlr,bin,include} + cp "$jar" "$out/lib/antlr/antlr-${version}-complete.jar" + cp runtime/Cpp/include/* $out/include/ + + echo "#! ${stdenv.shell}" >> "$out/bin/antlr" + echo "'${jre}/bin/java' -cp '$out/lib/antlr/antlr-${version}-complete.jar' -Xms200M -Xmx400M org.antlr.Tool \"\$@\"" >> "$out/bin/antlr" + + chmod a+x "$out/bin/antlr" + ln -s "$out/bin/antlr"{,3} + ''; + + inherit jre; + + meta = with lib; { + description = "Powerful parser generator"; + longDescription = '' + ANTLR (ANother Tool for Language Recognition) is a powerful parser + generator for reading, processing, executing, or translating structured + text or binary files. It's widely used to build languages, tools, and + frameworks. From a grammar, ANTLR generates a parser that can build and + walk parse trees. + ''; + homepage = "https://www.antlr.org/"; + license = licenses.bsd3; + platforms = platforms.linux; + maintainers = [ lib.maintainers.farlion ]; + }; +} diff --git a/nixpkgs/pkgs/development/tools/parsing/antlr/4.8.nix b/nixpkgs/pkgs/development/tools/parsing/antlr/4.8.nix new file mode 100644 index 000000000000..0708ba754b2a --- /dev/null +++ b/nixpkgs/pkgs/development/tools/parsing/antlr/4.8.nix @@ -0,0 +1,84 @@ +{ lib, stdenv, fetchurl, jre +, fetchFromGitHub, cmake, ninja, pkg-config, libuuid, darwin }: + +let + version = "4.8"; + source = fetchFromGitHub { + owner = "antlr"; + repo = "antlr4"; + rev = version; + sha256 = "1qal3add26qxskm85nk7r758arladn5rcyjinmhlhznmpbbv9j8m"; + }; + + runtime = { + cpp = stdenv.mkDerivation { + pname = "antlr-runtime-cpp"; + inherit version; + src = source; + + outputs = [ "out" "dev" "doc" ]; + + nativeBuildInputs = [ cmake ninja pkg-config ]; + buildInputs = lib.optional stdenv.isLinux libuuid + ++ lib.optional stdenv.isDarwin darwin.apple_sdk.frameworks.CoreFoundation; + + postUnpack = '' + export sourceRoot=$sourceRoot/runtime/Cpp + ''; + + meta = with lib; { + description = "C++ target for ANTLR 4"; + homepage = "https://www.antlr.org/"; + license = licenses.bsd3; + platforms = platforms.unix; + }; + }; + }; + + antlr = stdenv.mkDerivation { + pname = "antlr"; + inherit version; + + src = fetchurl { + url ="https://www.antlr.org/download/antlr-${version}-complete.jar"; + sha256 = "0nms976cnqyr1ndng3haxkmknpdq6xli4cpf4x4al0yr21l9v93k"; + }; + + dontUnpack = true; + + installPhase = '' + mkdir -p "$out"/{share/java,bin} + cp "$src" "$out/share/java/antlr-${version}-complete.jar" + + echo "#! ${stdenv.shell}" >> "$out/bin/antlr" + echo "'${jre}/bin/java' -cp '$out/share/java/antlr-${version}-complete.jar:$CLASSPATH' -Xmx500M org.antlr.v4.Tool \"\$@\"" >> "$out/bin/antlr" + + echo "#! ${stdenv.shell}" >> "$out/bin/grun" + echo "'${jre}/bin/java' -cp '$out/share/java/antlr-${version}-complete.jar:$CLASSPATH' org.antlr.v4.gui.TestRig \"\$@\"" >> "$out/bin/grun" + + chmod a+x "$out/bin/antlr" "$out/bin/grun" + ln -s "$out/bin/antlr"{,4} + ''; + + inherit jre; + + passthru = { + inherit runtime; + jarLocation = "${antlr}/share/java/antlr-${version}-complete.jar"; + }; + + meta = with lib; { + description = "Powerful parser generator"; + longDescription = '' + ANTLR (ANother Tool for Language Recognition) is a powerful parser + generator for reading, processing, executing, or translating structured + text or binary files. It's widely used to build languages, tools, and + frameworks. From a grammar, ANTLR generates a parser that can build and + walk parse trees. + ''; + homepage = "https://www.antlr.org/"; + license = licenses.bsd3; + platforms = platforms.unix; + }; + }; +in antlr diff --git a/nixpkgs/pkgs/development/tools/parsing/antlr/builder.sh b/nixpkgs/pkgs/development/tools/parsing/antlr/builder.sh new file mode 100644 index 000000000000..b8e7791b6fc9 --- /dev/null +++ b/nixpkgs/pkgs/development/tools/parsing/antlr/builder.sh @@ -0,0 +1,23 @@ +source $stdenv/setup + +tar zxvf $src +cd antlr-* +cd lib + +mkdir -p $out/lib/antlr +mkdir -p $out/bin + +cp *.jar $out/lib/antlr + +classpath="" +for jar in $out/lib/antlr/*.jar; do + classpath="$classpath:$jar" +done + +cat > $out/bin/antlr <<EOF +#! $SHELL + +$jre/bin/java -cp $classpath -Xms200M -Xmx400M org.antlr.Tool \$* +EOF + +chmod u+x $out/bin/antlr diff --git a/nixpkgs/pkgs/development/tools/parsing/bison/default.nix b/nixpkgs/pkgs/development/tools/parsing/bison/default.nix new file mode 100644 index 000000000000..1de45b08447b --- /dev/null +++ b/nixpkgs/pkgs/development/tools/parsing/bison/default.nix @@ -0,0 +1,46 @@ +{ lib, stdenv, fetchurl, m4, perl, help2man }: + +# Note: this package is used for bootstrapping fetchurl, and thus +# cannot use fetchpatch! All mutable patches (generated by GitHub or +# cgit) that are needed here should be included directly in Nixpkgs as +# files. + +stdenv.mkDerivation rec { + pname = "bison"; + version = "3.7.6"; + + src = fetchurl { + url = "mirror://gnu/${pname}/${pname}-${version}.tar.gz"; + sha256 = "sha256-adwLtG6o/DB9TKHgthyMNV6yB9Cwxp9PhGIyjnTXueo="; + }; + + nativeBuildInputs = [ m4 perl ] ++ lib.optional stdenv.isSunOS help2man; + propagatedBuildInputs = [ m4 ]; + + doCheck = false; # fails + doInstallCheck = false; # fails + + meta = { + homepage = "https://www.gnu.org/software/bison/"; + description = "Yacc-compatible parser generator"; + license = lib.licenses.gpl3Plus; + + longDescription = '' + Bison is a general-purpose parser generator that converts an + annotated context-free grammar into an LALR(1) or GLR parser for + that grammar. Once you are proficient with Bison, you can use + it to develop a wide range of language parsers, from those used + in simple desk calculators to complex programming languages. + + Bison is upward compatible with Yacc: all properly-written Yacc + grammars ought to work with Bison with no change. Anyone + familiar with Yacc should be able to use Bison with little + trouble. You need to be fluent in C or C++ programming in order + to use Bison. + ''; + + platforms = lib.platforms.unix; + }; + + passthru = { glrSupport = true; }; +} diff --git a/nixpkgs/pkgs/development/tools/parsing/bisonc++/default.nix b/nixpkgs/pkgs/development/tools/parsing/bisonc++/default.nix new file mode 100644 index 000000000000..5a38c6679eb2 --- /dev/null +++ b/nixpkgs/pkgs/development/tools/parsing/bisonc++/default.nix @@ -0,0 +1,55 @@ +{lib, stdenv, fetchurl, fetchFromGitLab +, yodl, icmake, flexcpp, bobcat +}: +stdenv.mkDerivation rec { + pname = "bisonc++"; + version = "6.04.00"; + + src = fetchFromGitLab { + domain = "gitlab.com"; + owner = "fbb-git"; + repo = "bisoncpp"; + rev = "6.04.00"; + sha256 = "sha256:0aa9bij4g08ilsk6cgrbgi03vyhqr9fn6j2164sjin93m63212wl"; + }; + + buildInputs = [ bobcat ]; + + nativeBuildInputs = [ yodl icmake flexcpp ]; + + setSourceRoot = '' + sourceRoot="$(echo */bisonc++)" + ''; + + gpl = fetchurl { + url = "https://www.gnu.org/licenses/old-licenses/gpl-2.0.txt"; + sha256 = "sha256:0hq6i0dm4420825fdm0lnnppbil6z67ls67n5kgjcd912dszjxw1"; + }; + + postPatch = '' + substituteInPlace INSTALL.im --replace /usr $out + patchShebangs . + for file in $(find documentation -type f); do + substituteInPlace "$file" --replace /usr/share/common-licenses/GPL ${gpl} + substituteInPlace "$file" --replace /usr $out + done + ''; + + buildPhase = '' + ./build program + ./build man + ./build manual + ''; + + installPhase = '' + ./build install x + ''; + + meta = with lib; { + description = "A parser generator like bison, but it generates C++ code"; + license = licenses.gpl2Plus; + maintainers = with maintainers; [ raskin ]; + platforms = platforms.linux; + homepage = "https://fbb-git.gitlab.io/bisoncpp/"; + }; +} diff --git a/nixpkgs/pkgs/development/tools/parsing/byacc/default.nix b/nixpkgs/pkgs/development/tools/parsing/byacc/default.nix new file mode 100644 index 000000000000..7f9aacd8ce78 --- /dev/null +++ b/nixpkgs/pkgs/development/tools/parsing/byacc/default.nix @@ -0,0 +1,31 @@ +{ lib, stdenv, fetchurl }: + +stdenv.mkDerivation rec { + pname = "byacc"; + version = "20210808"; + + src = fetchurl { + urls = [ + "ftp://ftp.invisible-island.net/byacc/${pname}-${version}.tgz" + "https://invisible-mirror.net/archives/byacc/${pname}-${version}.tgz" + ]; + sha256 = "sha256-8VhSm+nQWUJjx/Eah2FqSeoj5VrGNpElKiME+7x9OoM="; + }; + + configureFlags = [ + "--program-transform-name='s,^,b,'" + ]; + + doCheck = true; + + postInstall = '' + ln -s $out/bin/byacc $out/bin/yacc + ''; + + meta = with lib; { + description = "Berkeley YACC"; + homepage = "https://invisible-island.net/byacc/byacc.html"; + license = licenses.publicDomain; + platforms = platforms.unix; + }; +} diff --git a/nixpkgs/pkgs/development/tools/parsing/flex/2.5.35.nix b/nixpkgs/pkgs/development/tools/parsing/flex/2.5.35.nix new file mode 100644 index 000000000000..ec2c9eeb2d1c --- /dev/null +++ b/nixpkgs/pkgs/development/tools/parsing/flex/2.5.35.nix @@ -0,0 +1,33 @@ +{ lib, stdenv, fetchurl, autoreconfHook, flex, bison, texinfo, help2man, m4 }: + +stdenv.mkDerivation { + name = "flex-2.5.35"; + + src = fetchurl { + url = "https://github.com/westes/flex/archive/flex-2-5-35.tar.gz"; + sha256 = "0wh06nix8bd4w1aq4k2fbbkdq5i30a9lxz3xczf3ff28yy0kfwzm"; + }; + + postPatch = '' + patchShebangs tests + ''; + + nativeBuildInputs = [ flex bison texinfo help2man autoreconfHook ]; + + propagatedBuildInputs = [ m4 ]; + + preConfigure = lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) '' + ac_cv_func_malloc_0_nonnull=yes + ac_cv_func_realloc_0_nonnull=yes + ''; + + doCheck = false; # fails 2 out of 46 tests + + meta = with lib; { + branch = "2.5.35"; + homepage = "http://flex.sourceforge.net/"; + description = "A fast lexical analyser generator"; + license = licenses.bsd2; + platforms = platforms.unix; + }; +} diff --git a/nixpkgs/pkgs/development/tools/parsing/flex/2.6.1.nix b/nixpkgs/pkgs/development/tools/parsing/flex/2.6.1.nix new file mode 100644 index 000000000000..aeb141649772 --- /dev/null +++ b/nixpkgs/pkgs/development/tools/parsing/flex/2.6.1.nix @@ -0,0 +1,36 @@ +{ lib, stdenv, fetchurl, bison, m4 }: + +stdenv.mkDerivation { + name = "flex-2.6.1"; + + src = fetchurl { + url = "https://github.com/westes/flex/releases/download/v2.6.1/flex-2.6.1.tar.gz"; + sha256 = "0fy14c35yz2m1n1m4f02by3501fn0cca37zn7jp8lpp4b3kgjhrw"; + }; + + postPatch = '' + patchShebangs tests + '' + lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) '' + substituteInPlace Makefile.in --replace "tests" " "; + ''; + + buildInputs = [ bison ]; + + propagatedBuildInputs = [ m4 ]; + + preConfigure = lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) '' + ac_cv_func_malloc_0_nonnull=yes + ac_cv_func_realloc_0_nonnull=yes + ''; + + postConfigure = lib.optionalString (stdenv.isDarwin || stdenv.isCygwin) '' + sed -i Makefile -e 's/-no-undefined//;' + ''; + + meta = with lib; { + homepage = "https://github.com/westes/flex"; + description = "A fast lexical analyser generator"; + license = licenses.bsd2; + platforms = platforms.unix; + }; +} diff --git a/nixpkgs/pkgs/development/tools/parsing/flex/default.nix b/nixpkgs/pkgs/development/tools/parsing/flex/default.nix new file mode 100644 index 000000000000..e0895bab68d8 --- /dev/null +++ b/nixpkgs/pkgs/development/tools/parsing/flex/default.nix @@ -0,0 +1,53 @@ +{ lib, stdenv, buildPackages, fetchurl, bison, m4 +, fetchpatch, autoreconfHook, help2man +}: + +stdenv.mkDerivation rec { + pname = "flex"; + version = "2.6.4"; + + src = fetchurl { + url = "https://github.com/westes/flex/releases/download/v${version}/flex-${version}.tar.gz"; + sha256 = "15g9bv236nzi665p9ggqjlfn4dwck5835vf0bbw2cz7h5c1swyp8"; + }; + + # Also upstream, will be part of 2.6.5 + # https://github.com/westes/flex/commit/24fd0551333e + patches = [(fetchpatch { + name = "glibc-2.26.patch"; + url = "https://raw.githubusercontent.com/lede-project/source/0fb14a2b1ab2f82c" + + "/tools/flex/patches/200-build-AC_USE_SYSTEM_EXTENSIONS-in-configure.ac.patch"; + sha256 = "1aarhcmz7mfrgh15pkj6f7ikxa2m0mllw1i1vscsf1kw5d05lw6f"; + })]; + + postPatch = '' + patchShebangs tests + '' + lib.optionalString (stdenv.buildPlatform != stdenv.hostPlatform) '' + substituteInPlace Makefile.in --replace "tests" " " + + substituteInPlace doc/Makefile.am --replace 'flex.1: $(top_srcdir)/configure.ac' 'flex.1: ' + ''; + + depsBuildBuild = [ buildPackages.stdenv.cc ]; + nativeBuildInputs = [ autoreconfHook help2man ]; + buildInputs = [ bison ]; + propagatedBuildInputs = [ m4 ]; + + preConfigure = lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) '' + export ac_cv_func_malloc_0_nonnull=yes + export ac_cv_func_realloc_0_nonnull=yes + ''; + + postConfigure = lib.optionalString (stdenv.isDarwin || stdenv.isCygwin) '' + sed -i Makefile -e 's/-no-undefined//;' + ''; + + dontDisableStatic = stdenv.buildPlatform != stdenv.hostPlatform; + + meta = with lib; { + homepage = "https://github.com/westes/flex"; + description = "A fast lexical analyser generator"; + license = licenses.bsd2; + platforms = platforms.unix; + }; +} diff --git a/nixpkgs/pkgs/development/tools/parsing/flexc++/default.nix b/nixpkgs/pkgs/development/tools/parsing/flexc++/default.nix new file mode 100644 index 000000000000..e4db5631e7fe --- /dev/null +++ b/nixpkgs/pkgs/development/tools/parsing/flexc++/default.nix @@ -0,0 +1,47 @@ +{ lib, stdenv, fetchFromGitHub, bobcat, icmake, yodl }: + +stdenv.mkDerivation rec { + pname = "flexc++"; + version = "2.05.00"; + + src = fetchFromGitHub { + sha256 = "0s25d9jsfsqvm34rwf48cxwz23aq1zja3cqlzfz3z33p29wwazwz"; + rev = version; + repo = "flexcpp"; + owner = "fbb-git"; + }; + + setSourceRoot = '' + sourceRoot=$(echo */flexc++) + ''; + + buildInputs = [ bobcat ]; + nativeBuildInputs = [ icmake yodl ]; + + postPatch = '' + substituteInPlace INSTALL.im --replace /usr $out + patchShebangs . + ''; + + buildPhase = '' + ./build man + ./build manual + ./build program + ''; + + installPhase = '' + ./build install x + ''; + + meta = with lib; { + description = "C++ tool for generating lexical scanners"; + longDescription = '' + Flexc++ was designed after `flex'. Flexc++ offers a cleaner class design + and requires simpler specification files than offered by flex's C++ + option. + ''; + homepage = "https://fbb-git.github.io/flexcpp/"; + license = licenses.gpl3; + platforms = platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/development/tools/parsing/hammer/default.nix b/nixpkgs/pkgs/development/tools/parsing/hammer/default.nix new file mode 100644 index 000000000000..402f83bea16b --- /dev/null +++ b/nixpkgs/pkgs/development/tools/parsing/hammer/default.nix @@ -0,0 +1,32 @@ +{ lib, stdenv, fetchgit, glib, pkg-config, scons }: + +stdenv.mkDerivation { + pname = "hammer"; + version = "e7aa734"; + + src = fetchgit { + url = "git://github.com/UpstandingHackers/hammer"; + sha256 = "01l0wbhz7dymxlndacin2vi8sqwjlw81ds2i9xyi200w51nsdm38"; + rev = "47f34b81e4de834fd3537dd71928c4f3cdb7f533"; + }; + + nativeBuildInputs = [ pkg-config scons ]; + buildInputs = [ glib ]; + + strictDeps = true; + + meta = with lib; { + description = "A bit-oriented parser combinator library"; + longDescription = '' + Hammer is a parsing library. Like many modern parsing libraries, + it provides a parser combinator interface for writing grammars + as inline domain-specific languages, but Hammer also provides a + variety of parsing backends. It's also bit-oriented rather than + character-oriented, making it ideal for parsing binary data such + as images, network packets, audio, and executables. + ''; + homepage = "https://github.com/UpstandingHackers/hammer"; + license = licenses.gpl2; + platforms = platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/development/tools/parsing/javacc/default.nix b/nixpkgs/pkgs/development/tools/parsing/javacc/default.nix new file mode 100644 index 000000000000..d074e3dda93e --- /dev/null +++ b/nixpkgs/pkgs/development/tools/parsing/javacc/default.nix @@ -0,0 +1,32 @@ +{ stdenv, lib, fetchFromGitHub, ant, jdk }: + +stdenv.mkDerivation rec { + pname = "javacc"; + version = "7.0.10"; + + src = fetchFromGitHub { + owner = pname; + repo = pname; + rev = "${pname}-${version}"; + sha256 = "120jva4sw1kylkwgqf869zxddss01mcn1nmimx9vmd4xaadz7cf2"; + }; + + nativeBuildInputs = [ ant jdk ]; + + buildPhase = '' + ant jar + ''; + + installPhase = '' + mkdir -p $out/target + mv scripts $out/bin + mv target/javacc.jar $out/target/ + ''; + + meta = with lib; { + homepage = "https://javacc.github.io/javacc"; + description = "A parser generator for building parsers from grammars"; + license = licenses.bsd2; + maintainers = [ teams.deshaw.members ]; + }; +} diff --git a/nixpkgs/pkgs/development/tools/parsing/jikespg/default.nix b/nixpkgs/pkgs/development/tools/parsing/jikespg/default.nix new file mode 100644 index 000000000000..8179855e6ebc --- /dev/null +++ b/nixpkgs/pkgs/development/tools/parsing/jikespg/default.nix @@ -0,0 +1,29 @@ +{lib, stdenv, fetchurl}: + +stdenv.mkDerivation rec { + pname = "jikespg"; + version = "1.3"; + + src = fetchurl { + url = "mirror://sourceforge/jikes/${pname}-${version}.tar.gz"; + sha256 = "083ibfxaiw1abxmv1crccx1g6sixkbyhxn2hsrlf6fwii08s6rgw"; + }; + + postPatch = '' + substituteInPlace Makefile --replace "gcc" "${stdenv.cc.targetPrefix}cc" + ''; + + sourceRoot = "jikespg/src"; + + installPhase = '' + install -Dm755 -t $out/bin jikespg + ''; + + meta = with lib; { + homepage = "http://jikes.sourceforge.net/"; + description = "The Jikes Parser Generator"; + platforms = platforms.all; + license = licenses.ipl10; + maintainers = with maintainers; [ pSub ]; + }; +} diff --git a/nixpkgs/pkgs/development/tools/parsing/jshon/default.nix b/nixpkgs/pkgs/development/tools/parsing/jshon/default.nix new file mode 100644 index 000000000000..04a1a637207d --- /dev/null +++ b/nixpkgs/pkgs/development/tools/parsing/jshon/default.nix @@ -0,0 +1,41 @@ +{ stdenv, lib, fetchFromGitHub, fetchpatch, jansson }: + +stdenv.mkDerivation rec { + pname = "jshon"; + version = "20170302"; + + src = fetchFromGitHub { + owner = "keenerd"; + repo = "jshon"; + rev = "d919aeaece37962251dbe6c1ee50f0028a5c90e4"; + sha256 = "1x4zfmsjq0l2y994bxkhx3mn5vzjxxr39iib213zjchi9h6yxvnc"; + }; + + buildInputs = [ jansson ]; + + patches = [ + (fetchpatch { + # https://github.com/keenerd/jshon/pull/62 + url = "https://github.com/keenerd/jshon/commit/96b4e9dbf578be7b31f29740b608aa7b34df3318.patch"; + sha256 = "0kwbn3xb37iqb5y1n8vhzjiwlbg5jmki3f38pzakc24kzc5ksmaa"; + }) + ]; + + postPatch = + '' + substituteInPlace Makefile --replace "/usr/" "/" + ''; + + preInstall = + '' + export DESTDIR=$out + ''; + + meta = with lib; { + homepage = "http://kmkeen.com/jshon"; + description = "JSON parser designed for maximum convenience within the shell"; + license = licenses.free; + platforms = platforms.all; + maintainers = with maintainers; [ rushmorem ]; + }; +} diff --git a/nixpkgs/pkgs/development/tools/parsing/lemon/default.nix b/nixpkgs/pkgs/development/tools/parsing/lemon/default.nix new file mode 100644 index 000000000000..9c8786950d22 --- /dev/null +++ b/nixpkgs/pkgs/development/tools/parsing/lemon/default.nix @@ -0,0 +1,45 @@ +{ lib, stdenv, fetchurl }: + +let + + srcs = { + lemon = fetchurl { + sha256 = "1c5pk2hz7j9hix5mpc38rwnm8dnlr2jqswf4lan6v78ccbyqzkjx"; + url = "http://www.sqlite.org/src/raw/tool/lemon.c?name=680980c7935bfa1edec20c804c9e5ba4b1dd96f5"; + name = "lemon.c"; + }; + lempar = fetchurl { + sha256 = "1ba13a6yh9j2cs1aw2fh4dxqvgf399gxq1gpp4sh8q0f2w6qiw3i"; + url = "http://www.sqlite.org/src/raw/tool/lempar.c?name=01ca97f87610d1dac6d8cd96ab109ab1130e76dc"; + name = "lempar.c"; + }; + }; + +in stdenv.mkDerivation { + pname = "lemon"; + version = "1.69"; + + dontUnpack = true; + + buildPhase = '' + sh -xc "$CC ${srcs.lemon} -o lemon" + ''; + + installPhase = '' + install -Dvm755 lemon $out/bin/lemon + install -Dvm644 ${srcs.lempar} $out/bin/lempar.c + ''; + + meta = with lib; { + description = "An LALR(1) parser generator"; + longDescription = '' + The Lemon program is an LALR(1) parser generator that takes a + context-free grammar and converts it into a subroutine that will parse a + file using that grammar. Lemon is similar to the much more famous + programs "yacc" and "bison", but is not compatible with either. + ''; + homepage = "http://www.hwaci.com/sw/lemon/"; + license = licenses.publicDomain; + platforms = platforms.unix; + }; +} diff --git a/nixpkgs/pkgs/development/tools/parsing/peg/default.nix b/nixpkgs/pkgs/development/tools/parsing/peg/default.nix new file mode 100644 index 000000000000..d53eec12e806 --- /dev/null +++ b/nixpkgs/pkgs/development/tools/parsing/peg/default.nix @@ -0,0 +1,20 @@ +{ lib, stdenv, fetchurl }: + +stdenv.mkDerivation rec { + pname = "peg"; + version = "0.1.18"; + + src = fetchurl { + url = "${meta.homepage}/${pname}-${version}.tar.gz"; + sha256 = "114h1y4k8fwcq9m0hfk33dsp7ah8zxzjjzlk71x4iirzczfkn690"; + }; + + preBuild="makeFlagsArray+=( PREFIX=$out )"; + + meta = with lib; { + homepage = "http://piumarta.com/software/peg/"; + description = "Tools for generating recursive-descent parsers: programs that perform pattern matching on text"; + platforms = platforms.all; + license = licenses.mit; + }; +} diff --git a/nixpkgs/pkgs/development/tools/parsing/ragel/default.nix b/nixpkgs/pkgs/development/tools/parsing/ragel/default.nix new file mode 100644 index 000000000000..c23b352decea --- /dev/null +++ b/nixpkgs/pkgs/development/tools/parsing/ragel/default.nix @@ -0,0 +1,51 @@ +{ lib, stdenv, fetchurl, transfig, tex, ghostscript, colm +, build-manual ? false +}: + +let + generic = { version, sha256, license }: + stdenv.mkDerivation rec { + pname = "ragel"; + inherit version; + + src = fetchurl { + url = "https://www.colm.net/files/ragel/${pname}-${version}.tar.gz"; + inherit sha256; + }; + + buildInputs = lib.optional build-manual [ transfig ghostscript tex ]; + + preConfigure = lib.optionalString build-manual '' + sed -i "s/build_manual=no/build_manual=yes/g" DIST + ''; + + configureFlags = [ "--with-colm=${colm}" ]; + + NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isGNU "-std=gnu++98"; + + doCheck = true; + + meta = with lib; { + homepage = "https://www.colm.net/open-source/ragel/"; + description = "State machine compiler"; + inherit license; + platforms = platforms.unix; + maintainers = with maintainers; [ pSub ]; + }; + }; + +in + +{ + ragelStable = generic { + version = "6.10"; + sha256 = "0gvcsl62gh6sg73nwaxav4a5ja23zcnyxncdcdnqa2yjcpdnw5az"; + license = lib.licenses.gpl2; + }; + + ragelDev = generic { + version = "7.0.0.12"; + sha256 = "0x3si355lv6q051lgpg8bpclpiq5brpri5lv3p8kk2qhzfbyz69r"; + license = lib.licenses.mit; + }; +} diff --git a/nixpkgs/pkgs/development/tools/parsing/re2c/default.nix b/nixpkgs/pkgs/development/tools/parsing/re2c/default.nix new file mode 100644 index 000000000000..c3b09b71d173 --- /dev/null +++ b/nixpkgs/pkgs/development/tools/parsing/re2c/default.nix @@ -0,0 +1,38 @@ +{ lib +, stdenv +, fetchFromGitHub +, autoreconfHook +, python3 +}: + +stdenv.mkDerivation rec { + pname = "re2c"; + version = "2.2"; + + src = fetchFromGitHub { + owner = "skvadrik"; + repo = "re2c"; + rev = version; + sha256 = "0snfxk1cf2f4dy4hcxd1fx1grav3di0qjgqqn97k85zsf9f6ys78"; + }; + + nativeBuildInputs = [ + autoreconfHook + python3 + ]; + + doCheck = true; + enableParallelBuilding = true; + + preCheck = '' + patchShebangs run_tests.py + ''; + + meta = with lib; { + description = "Tool for writing very fast and very flexible scanners"; + homepage = "https://re2c.org"; + license = licenses.publicDomain; + platforms = platforms.all; + maintainers = with maintainers; [ thoughtpolice ]; + }; +} diff --git a/nixpkgs/pkgs/development/tools/parsing/tree-sitter/default.nix b/nixpkgs/pkgs/development/tools/parsing/tree-sitter/default.nix new file mode 100644 index 000000000000..0b38d1d8e267 --- /dev/null +++ b/nixpkgs/pkgs/development/tools/parsing/tree-sitter/default.nix @@ -0,0 +1,169 @@ +{ lib +, stdenv +, fetchgit +, fetchFromGitHub +, fetchurl +, writeShellScript +, runCommand +, which +, formats +, rustPlatform +, jq +, nix-prefetch-git +, xe +, curl +, emscripten +, Security +, callPackage +, linkFarm + +, enableShared ? !stdenv.hostPlatform.isStatic +, enableStatic ? stdenv.hostPlatform.isStatic +, webUISupport ? false +}: + +# TODO: move to carnix or https://github.com/kolloch/crate2nix +let + # to update: + # 1) change all these hashes + # 2) nix-build -A tree-sitter.updater.update-all-grammars + # 3) run the ./result script that is output by that (it updates ./grammars) + version = "0.20.0"; + sha256 = "0hrcisvw44fjxix09lfbrz7majaj6njbnr6c92a6a5748p2jvyng"; + cargoSha256 = "029db3yy6nj18vxfvj0ra568a9k4x7znfj08spvzl5sxfbx6442r"; + + src = fetchFromGitHub { + owner = "tree-sitter"; + repo = "tree-sitter"; + rev = "v${version}"; + inherit sha256; + fetchSubmodules = true; + }; + + update-all-grammars = import ./update.nix { + inherit writeShellScript nix-prefetch-git curl jq xe src formats lib; + }; + + fetchGrammar = (v: fetchgit { inherit (v) url rev sha256 fetchSubmodules; }); + + grammars = + runCommand "grammars" { } ('' + mkdir $out + '' + (lib.concatStrings (lib.mapAttrsToList + (name: grammar: "ln -s ${fetchGrammar grammar} $out/${name}\n") + (import ./grammars)))); + + builtGrammars = + let + change = name: grammar: + callPackage ./grammar.nix { } { + language = name; + inherit version; + source = fetchGrammar grammar; + location = if grammar ? location then grammar.location else null; + }; + grammars' = (import ./grammars); + grammars = grammars' // + { tree-sitter-ocaml = grammars'.tree-sitter-ocaml // { location = "ocaml"; }; } // + { tree-sitter-ocaml-interface = grammars'.tree-sitter-ocaml // { location = "interface"; }; } // + { tree-sitter-typescript = grammars'.tree-sitter-typescript // { location = "typescript"; }; } // + { tree-sitter-tsx = grammars'.tree-sitter-typescript // { location = "tsx"; }; }; + in + lib.mapAttrs change grammars; + + # Usage: + # pkgs.tree-sitter.withPlugins (p: [ p.tree-sitter-c p.tree-sitter-java ... ]) + # + # or for all grammars: + # pkgs.tree-sitter.withPlugins (_: allGrammars) + # which is equivalent to + # pkgs.tree-sitter.withPlugins (p: builtins.attrValues p) + withPlugins = grammarFn: + let + grammars = grammarFn builtGrammars; + in + linkFarm "grammars" + (map + (drv: + let + name = lib.strings.getName drv; + in + { + name = + (lib.strings.replaceStrings ["-"] ["_"] + (lib.strings.removePrefix "tree-sitter-" + (lib.strings.removeSuffix "-grammar" name))) + + stdenv.hostPlatform.extensions.sharedLibrary; + path = "${drv}/parser"; + } + ) + grammars); + + allGrammars = builtins.attrValues builtGrammars; + +in +rustPlatform.buildRustPackage { + pname = "tree-sitter"; + inherit src version cargoSha256; + + buildInputs = + lib.optionals stdenv.isDarwin [ Security ]; + nativeBuildInputs = + [ which ] + ++ lib.optionals webUISupport [ emscripten ]; + + postPatch = lib.optionalString (!webUISupport) '' + # remove web interface + sed -e '/pub mod web_ui/d' \ + -i cli/src/lib.rs + sed -e 's/web_ui,//' \ + -e 's/web_ui::serve(¤t_dir.*$/println!("ERROR: web-ui is not available in this nixpkgs build; enable the webUISupport"); std::process::exit(1);/' \ + -i cli/src/main.rs + ''; + + # Compile web assembly with emscripten. The --debug flag prevents us from + # minifying the JavaScript; passing it allows us to side-step more Node + # JS dependencies for installation. + preBuild = lib.optionalString webUISupport '' + bash ./script/build-wasm --debug + ''; + + postInstall = '' + PREFIX=$out make install + ${lib.optionalString (!enableShared) "rm $out/lib/*.so{,.*}"} + ${lib.optionalString (!enableStatic) "rm $out/lib/*.a"} + ''; + + # test result: FAILED. 120 passed; 13 failed; 0 ignored; 0 measured; 0 filtered out + doCheck = false; + + passthru = { + updater = { + inherit update-all-grammars; + }; + inherit grammars builtGrammars withPlugins allGrammars; + + tests = { + # make sure all grammars build + builtGrammars = lib.recurseIntoAttrs builtGrammars; + }; + }; + + meta = with lib; { + homepage = "https://github.com/tree-sitter/tree-sitter"; + description = "A parser generator tool and an incremental parsing library"; + longDescription = '' + Tree-sitter is a parser generator tool and an incremental parsing library. + It can build a concrete syntax tree for a source file and efficiently update the syntax tree as the source file is edited. + + Tree-sitter aims to be: + + * General enough to parse any programming language + * Fast enough to parse on every keystroke in a text editor + * Robust enough to provide useful results even in the presence of syntax errors + * Dependency-free so that the runtime library (which is written in pure C) can be embedded in any application + ''; + license = licenses.mit; + maintainers = with maintainers; [ Profpatsch ]; + }; +} diff --git a/nixpkgs/pkgs/development/tools/parsing/tree-sitter/grammar.nix b/nixpkgs/pkgs/development/tools/parsing/tree-sitter/grammar.nix new file mode 100644 index 000000000000..d4782b37b6a3 --- /dev/null +++ b/nixpkgs/pkgs/development/tools/parsing/tree-sitter/grammar.nix @@ -0,0 +1,57 @@ +{ stdenv +, tree-sitter +, libcxx +, lib +}: + +# Build a parser grammar and put the resulting shared object in `$out/parser` + +{ + # language name + language + # version of tree-sitter +, version + # source for the language grammar +, source +, location ? null +}: + +stdenv.mkDerivation { + + pname = "${language}-grammar"; + inherit version; + + src = + if location == null + then + source + else + "${source}/${location}" + ; + + NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-I${lib.getDev libcxx}/include/c++/v1"; + buildInputs = [ tree-sitter ]; + + dontUnpack = true; + dontConfigure = true; + + buildPhase = '' + runHook preBuild + scanner_cc="$src/src/scanner.cc" + if [ ! -f "$scanner_cc" ]; then + scanner_cc="" + fi + scanner_c="$src/src/scanner.c" + if [ ! -f "$scanner_c" ]; then + scanner_c="" + fi + $CC -I$src/src/ -shared -o parser -Os $src/src/parser.c $scanner_cc $scanner_c -lstdc++ + runHook postBuild + ''; + installPhase = '' + runHook preInstall + mkdir $out + mv parser $out/ + runHook postInstall + ''; +} diff --git a/nixpkgs/pkgs/development/tools/parsing/tree-sitter/grammars/default.nix b/nixpkgs/pkgs/development/tools/parsing/tree-sitter/grammars/default.nix new file mode 100644 index 000000000000..01108d1501aa --- /dev/null +++ b/nixpkgs/pkgs/development/tools/parsing/tree-sitter/grammars/default.nix @@ -0,0 +1,47 @@ +{ + tree-sitter-agda = (builtins.fromJSON (builtins.readFile ./tree-sitter-agda.json)); + tree-sitter-bash = (builtins.fromJSON (builtins.readFile ./tree-sitter-bash.json)); + tree-sitter-c = (builtins.fromJSON (builtins.readFile ./tree-sitter-c.json)); + tree-sitter-c-sharp = (builtins.fromJSON (builtins.readFile ./tree-sitter-c-sharp.json)); + tree-sitter-clojure = (builtins.fromJSON (builtins.readFile ./tree-sitter-clojure.json)); + tree-sitter-comment = (builtins.fromJSON (builtins.readFile ./tree-sitter-comment.json)); + tree-sitter-cpp = (builtins.fromJSON (builtins.readFile ./tree-sitter-cpp.json)); + tree-sitter-css = (builtins.fromJSON (builtins.readFile ./tree-sitter-css.json)); + tree-sitter-dart = (builtins.fromJSON (builtins.readFile ./tree-sitter-dart.json)); + tree-sitter-dot = (builtins.fromJSON (builtins.readFile ./tree-sitter-dot.json)); + tree-sitter-elisp = (builtins.fromJSON (builtins.readFile ./tree-sitter-elisp.json)); + tree-sitter-embedded-template = (builtins.fromJSON (builtins.readFile ./tree-sitter-embedded-template.json)); + tree-sitter-fennel = (builtins.fromJSON (builtins.readFile ./tree-sitter-fennel.json)); + tree-sitter-fish = (builtins.fromJSON (builtins.readFile ./tree-sitter-fish.json)); + tree-sitter-fluent = (builtins.fromJSON (builtins.readFile ./tree-sitter-fluent.json)); + tree-sitter-go = (builtins.fromJSON (builtins.readFile ./tree-sitter-go.json)); + tree-sitter-haskell = (builtins.fromJSON (builtins.readFile ./tree-sitter-haskell.json)); + tree-sitter-html = (builtins.fromJSON (builtins.readFile ./tree-sitter-html.json)); + tree-sitter-java = (builtins.fromJSON (builtins.readFile ./tree-sitter-java.json)); + tree-sitter-javascript = (builtins.fromJSON (builtins.readFile ./tree-sitter-javascript.json)); + tree-sitter-jsdoc = (builtins.fromJSON (builtins.readFile ./tree-sitter-jsdoc.json)); + tree-sitter-json = (builtins.fromJSON (builtins.readFile ./tree-sitter-json.json)); + tree-sitter-julia = (builtins.fromJSON (builtins.readFile ./tree-sitter-julia.json)); + tree-sitter-latex = (builtins.fromJSON (builtins.readFile ./tree-sitter-latex.json)); + tree-sitter-lua = (builtins.fromJSON (builtins.readFile ./tree-sitter-lua.json)); + tree-sitter-markdown = (builtins.fromJSON (builtins.readFile ./tree-sitter-markdown.json)); + tree-sitter-nix = (builtins.fromJSON (builtins.readFile ./tree-sitter-nix.json)); + tree-sitter-ocaml = (builtins.fromJSON (builtins.readFile ./tree-sitter-ocaml.json)); + tree-sitter-php = (builtins.fromJSON (builtins.readFile ./tree-sitter-php.json)); + tree-sitter-python = (builtins.fromJSON (builtins.readFile ./tree-sitter-python.json)); + tree-sitter-ql = (builtins.fromJSON (builtins.readFile ./tree-sitter-ql.json)); + tree-sitter-regex = (builtins.fromJSON (builtins.readFile ./tree-sitter-regex.json)); + tree-sitter-rst = (builtins.fromJSON (builtins.readFile ./tree-sitter-rst.json)); + tree-sitter-ruby = (builtins.fromJSON (builtins.readFile ./tree-sitter-ruby.json)); + tree-sitter-rust = (builtins.fromJSON (builtins.readFile ./tree-sitter-rust.json)); + tree-sitter-scala = (builtins.fromJSON (builtins.readFile ./tree-sitter-scala.json)); + tree-sitter-svelte = (builtins.fromJSON (builtins.readFile ./tree-sitter-svelte.json)); + tree-sitter-swift = (builtins.fromJSON (builtins.readFile ./tree-sitter-swift.json)); + tree-sitter-toml = (builtins.fromJSON (builtins.readFile ./tree-sitter-toml.json)); + tree-sitter-tsq = (builtins.fromJSON (builtins.readFile ./tree-sitter-tsq.json)); + tree-sitter-typescript = (builtins.fromJSON (builtins.readFile ./tree-sitter-typescript.json)); + tree-sitter-verilog = (builtins.fromJSON (builtins.readFile ./tree-sitter-verilog.json)); + tree-sitter-vim = (builtins.fromJSON (builtins.readFile ./tree-sitter-vim.json)); + tree-sitter-yaml = (builtins.fromJSON (builtins.readFile ./tree-sitter-yaml.json)); + tree-sitter-zig = (builtins.fromJSON (builtins.readFile ./tree-sitter-zig.json)); +} diff --git a/nixpkgs/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-agda.json b/nixpkgs/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-agda.json new file mode 100644 index 000000000000..36dd834d4d0f --- /dev/null +++ b/nixpkgs/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-agda.json @@ -0,0 +1,11 @@ +{ + "url": "https://github.com/tree-sitter/tree-sitter-agda", + "rev": "d710ff14d15ddee3764fd73a0837c6c4c8c913e9", + "date": "2019-09-20T18:06:06+08:00", + "path": "/nix/store/wqz9v9znaiwhhqi19hgig9bn0yvl4i9s-tree-sitter-agda", + "sha256": "1wpfj47l97pxk3i9rzdylqipy849r482fnj3lmx8byhalv7z1vm6", + "fetchLFS": false, + "fetchSubmodules": false, + "deepClone": false, + "leaveDotGit": false +} diff --git a/nixpkgs/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-bash.json b/nixpkgs/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-bash.json new file mode 100644 index 000000000000..090ee63616ec --- /dev/null +++ b/nixpkgs/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-bash.json @@ -0,0 +1,11 @@ +{ + "url": "https://github.com/tree-sitter/tree-sitter-bash", + "rev": "b6667bed364733c8a8f8e5973749f86cfa04ba2a", + "date": "2021-03-04T14:15:26-08:00", + "path": "/nix/store/nvlvdv02wdy4dq4w19bvzq6nlkgvpj20-tree-sitter-bash", + "sha256": "18c030bb65r50i6z37iy7jb9z9i8i36y7b08dbc9bchdifqsijs5", + "fetchLFS": false, + "fetchSubmodules": false, + "deepClone": false, + "leaveDotGit": false +} diff --git a/nixpkgs/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-c-sharp.json b/nixpkgs/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-c-sharp.json new file mode 100644 index 000000000000..8a9dd7be6db7 --- /dev/null +++ b/nixpkgs/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-c-sharp.json @@ -0,0 +1,11 @@ +{ + "url": "https://github.com/tree-sitter/tree-sitter-c-sharp", + "rev": "c9e1952d311cf87762a42a79cb801c7bef1af815", + "date": "2021-09-09T23:38:47+01:00", + "path": "/nix/store/cl05d3zpbbkhms5fmd6wc4jhasjhg12l-tree-sitter-c-sharp", + "sha256": "0kn7p203ij8vz1cdxmxvn85mf3hpmz08l5psza96xxif2lcz8li8", + "fetchLFS": false, + "fetchSubmodules": false, + "deepClone": false, + "leaveDotGit": false +} diff --git a/nixpkgs/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-c.json b/nixpkgs/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-c.json new file mode 100644 index 000000000000..2f589a92d2d8 --- /dev/null +++ b/nixpkgs/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-c.json @@ -0,0 +1,11 @@ +{ + "url": "https://github.com/tree-sitter/tree-sitter-c", + "rev": "f71e80b9f20c3968c131518ae8d272a3cf81a60b", + "date": "2021-09-18T14:26:00-05:00", + "path": "/nix/store/22iw8rdpmvxmyrsmxxbyx8yi44jq05qd-tree-sitter-c", + "sha256": "13qr8ms8w7y92a33p0wisg4kzj4q3dzi2bn7wd6x815j8hfz627q", + "fetchLFS": false, + "fetchSubmodules": false, + "deepClone": false, + "leaveDotGit": false +} diff --git a/nixpkgs/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-clojure.json b/nixpkgs/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-clojure.json new file mode 100644 index 000000000000..3fccfc5f7b01 --- /dev/null +++ b/nixpkgs/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-clojure.json @@ -0,0 +1,11 @@ +{ + "url": "https://github.com/sogaiu/tree-sitter-clojure", + "rev": "39bf0977d223879436c1425fe6bfeb3bcfd86f92", + "date": "2021-08-15T13:16:31+09:00", + "path": "/nix/store/7kpf74gw4a68fby6jiw4n7lc4jfkgcf4-tree-sitter-clojure", + "sha256": "0ryj75znysvyvv4qaghygx1srrhlwhfmzmdilm652prkgj6yzh6b", + "fetchLFS": false, + "fetchSubmodules": false, + "deepClone": false, + "leaveDotGit": false +} diff --git a/nixpkgs/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-comment.json b/nixpkgs/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-comment.json new file mode 100644 index 000000000000..3da60411f95c --- /dev/null +++ b/nixpkgs/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-comment.json @@ -0,0 +1,11 @@ +{ + "url": "https://github.com/stsewd/tree-sitter-comment", + "rev": "8d480c0a86e3b95812252d29292b2686eb92418d", + "date": "2021-08-13T15:03:50-05:00", + "path": "/nix/store/4aqsac34f0pzpa889067dqci743axrmx-tree-sitter-comment", + "sha256": "0fqhgvpd391nxrpyhxcp674h8qph280ax6rm6dz1pj3lqs3grdka", + "fetchLFS": false, + "fetchSubmodules": false, + "deepClone": false, + "leaveDotGit": false +} diff --git a/nixpkgs/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-cpp.json b/nixpkgs/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-cpp.json new file mode 100644 index 000000000000..394040a79da0 --- /dev/null +++ b/nixpkgs/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-cpp.json @@ -0,0 +1,11 @@ +{ + "url": "https://github.com/tree-sitter/tree-sitter-cpp", + "rev": "8b112a131b910ec009853fc9dd1c27eae267a7a6", + "date": "2021-09-18T10:53:12-05:00", + "path": "/nix/store/bpfw6wckk0yfpr99nrv473g3r3b84vbv-tree-sitter-cpp", + "sha256": "0rskvx5krakfkkcmiv9qd0zf8rf63iaigv76x3dq7v00sj8m0xsn", + "fetchLFS": false, + "fetchSubmodules": false, + "deepClone": false, + "leaveDotGit": false +} diff --git a/nixpkgs/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-css.json b/nixpkgs/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-css.json new file mode 100644 index 000000000000..d1d55711895c --- /dev/null +++ b/nixpkgs/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-css.json @@ -0,0 +1,11 @@ +{ + "url": "https://github.com/tree-sitter/tree-sitter-css", + "rev": "a03f1d2d1dfbf6f8e0fdca5f9ff030228241eb57", + "date": "2021-09-15T14:32:51-07:00", + "path": "/nix/store/zamdl9ixsmgi7rdsb7mx2a1g0i8gfvdy-tree-sitter-css", + "sha256": "0i5xf97m6vxgcpa21h2gzlgj9n5rlv9mz3w738bwvcz5k6nbx6np", + "fetchLFS": false, + "fetchSubmodules": false, + "deepClone": false, + "leaveDotGit": false +} diff --git a/nixpkgs/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-dart.json b/nixpkgs/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-dart.json new file mode 100644 index 000000000000..6d79d851fd4d --- /dev/null +++ b/nixpkgs/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-dart.json @@ -0,0 +1,11 @@ +{ + "url": "https://github.com/usernobody14/tree-sitter-dart", + "rev": "6a25376685d1d47968c2cef06d4db8d84a70025e", + "date": "2021-06-04T09:39:40-06:00", + "path": "/nix/store/vdygn1702kn92k222kygk9i50h10z9km-tree-sitter-dart", + "sha256": "0z06sphmgjggx5j2rjfy3f85fh1m9s79sql8a7d4kvsamz9rwakl", + "fetchLFS": false, + "fetchSubmodules": false, + "deepClone": false, + "leaveDotGit": false +} diff --git a/nixpkgs/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-dot.json b/nixpkgs/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-dot.json new file mode 100644 index 000000000000..7adb92cdd601 --- /dev/null +++ b/nixpkgs/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-dot.json @@ -0,0 +1,11 @@ +{ + "url": "https://github.com/rydesun/tree-sitter-dot", + "rev": "e6f55c43b87b81cc982e38d414f0147fefa2515c", + "date": "2021-09-01T14:36:57+08:00", + "path": "/nix/store/n5a6bzh8rf35865wvcr3cis9r0fn2047-tree-sitter-dot", + "sha256": "1s3fpd0lnbm3gk9nbskdkdjlmdm7kz0l0g2zipv1m7qkc05nnkfy", + "fetchLFS": false, + "fetchSubmodules": false, + "deepClone": false, + "leaveDotGit": false +} diff --git a/nixpkgs/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-elisp.json b/nixpkgs/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-elisp.json new file mode 100644 index 000000000000..43d38746c46f --- /dev/null +++ b/nixpkgs/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-elisp.json @@ -0,0 +1,11 @@ +{ + "url": "https://github.com/wilfred/tree-sitter-elisp", + "rev": "166777abacfe5821d3b7b6873e6d2fd70a99f348", + "date": "2021-09-05T23:34:46-07:00", + "path": "/nix/store/gfyr8hl9pj2i0dj0qqpwh53jphff2bcd-tree-sitter-elisp", + "sha256": "18798jb3cisrvhkmzhq2qxly19hxvznf9k1n5pzl8l1dhw1yvl2a", + "fetchLFS": false, + "fetchSubmodules": false, + "deepClone": false, + "leaveDotGit": false +} diff --git a/nixpkgs/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-embedded-template.json b/nixpkgs/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-embedded-template.json new file mode 100644 index 000000000000..53cac3040afc --- /dev/null +++ b/nixpkgs/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-embedded-template.json @@ -0,0 +1,11 @@ +{ + "url": "https://github.com/tree-sitter/tree-sitter-embedded-template", + "rev": "1c03594a44df1fc2020b989d503cb084abd5fd01", + "date": "2021-03-04T10:06:18-08:00", + "path": "/nix/store/09b9drfnywcy1i8wlw6slnn76ch40kqk-tree-sitter-embedded-template", + "sha256": "0c9l4i6kwb29zp05h616y3vk2hhcfc8bhdf9m436bk47pfy2zabg", + "fetchLFS": false, + "fetchSubmodules": false, + "deepClone": false, + "leaveDotGit": false +} diff --git a/nixpkgs/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-fennel.json b/nixpkgs/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-fennel.json new file mode 100644 index 000000000000..df550680b451 --- /dev/null +++ b/nixpkgs/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-fennel.json @@ -0,0 +1,11 @@ +{ + "url": "https://github.com/travonted/tree-sitter-fennel", + "rev": "42823442a18dd2aa7b0b22dc719abb54abb3fe2e", + "date": "2021-09-08T19:22:08-04:00", + "path": "/nix/store/2v174r3fc3cqsy8yanq2kdcjqvzl1jx9-tree-sitter-fennel", + "sha256": "0a59hgx7mmdicw9fq2q8dcd2ffmcgjdkk3rpwj84ya1qiyvs5x5s", + "fetchLFS": false, + "fetchSubmodules": false, + "deepClone": false, + "leaveDotGit": false +} diff --git a/nixpkgs/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-fish.json b/nixpkgs/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-fish.json new file mode 100644 index 000000000000..b32445c2804c --- /dev/null +++ b/nixpkgs/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-fish.json @@ -0,0 +1,11 @@ +{ + "url": "https://github.com/ram02z/tree-sitter-fish", + "rev": "04e54ab6585dfd4fee6ddfe5849af56f101b6d4f", + "date": "2021-08-02T21:46:56+01:00", + "path": "/nix/store/0n3jfh7gk16bmikix34y5m534ac12xgc-tree-sitter-fish", + "sha256": "1810z8ah1b09qpxcr4bh63bxsnxx24r6d2h46v2cpqv1lg0g4z14", + "fetchLFS": false, + "fetchSubmodules": false, + "deepClone": false, + "leaveDotGit": false +} diff --git a/nixpkgs/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-fluent.json b/nixpkgs/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-fluent.json new file mode 100644 index 000000000000..6eeb5ccfe0a5 --- /dev/null +++ b/nixpkgs/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-fluent.json @@ -0,0 +1,11 @@ +{ + "url": "https://github.com/tree-sitter/tree-sitter-fluent", + "rev": "858fdd6f1e81992e00d3541bfb31bac9365d7a47", + "date": "2018-06-18T13:00:38-07:00", + "path": "/nix/store/zbj8abdlrqi9swm8qn8rhpqmjwcz145f-tree-sitter-fluent", + "sha256": "0528v9w0cs73p9048xrddb1wpdhr92sn1sw8yyqfrq5sq0danr9k", + "fetchLFS": false, + "fetchSubmodules": false, + "deepClone": false, + "leaveDotGit": false +} diff --git a/nixpkgs/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-go.json b/nixpkgs/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-go.json new file mode 100644 index 000000000000..02fff8098ad6 --- /dev/null +++ b/nixpkgs/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-go.json @@ -0,0 +1,11 @@ +{ + "url": "https://github.com/tree-sitter/tree-sitter-go", + "rev": "42b1e657c3a394c01df51dd3eadc8b214274a73c", + "date": "2021-08-16T18:29:17+02:00", + "path": "/nix/store/a1crqhfrd8v9g9w0565aca7nc9k2x7a0-tree-sitter-go", + "sha256": "1khsl8qz6r4dqw7h43m3jw3iqhh79sgpnsps0jy95f165iy496z3", + "fetchLFS": false, + "fetchSubmodules": false, + "deepClone": false, + "leaveDotGit": false +} diff --git a/nixpkgs/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-haskell.json b/nixpkgs/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-haskell.json new file mode 100644 index 000000000000..807c09a70fe5 --- /dev/null +++ b/nixpkgs/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-haskell.json @@ -0,0 +1,11 @@ +{ + "url": "https://github.com/tree-sitter/tree-sitter-haskell", + "rev": "bf7d643b494b7c7eed909ed7fbd8447231152cb0", + "date": "2021-09-09T20:07:38+02:00", + "path": "/nix/store/nkx9qf63nwl1ql6gl3q1fm4ykqax1isx-tree-sitter-haskell", + "sha256": "1wlp6kncjadhfz8y2wn90gkbqf35iidrn0y1ga360l5wyzx1mpid", + "fetchLFS": false, + "fetchSubmodules": false, + "deepClone": false, + "leaveDotGit": false +} diff --git a/nixpkgs/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-html.json b/nixpkgs/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-html.json new file mode 100644 index 000000000000..211e170adced --- /dev/null +++ b/nixpkgs/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-html.json @@ -0,0 +1,11 @@ +{ + "url": "https://github.com/tree-sitter/tree-sitter-html", + "rev": "161a92474a7bb2e9e830e48e76426f38299d99d1", + "date": "2021-08-17T11:20:56-07:00", + "path": "/nix/store/pv8x73j4sbngsqplwfm73jlpwc31mc17-tree-sitter-html", + "sha256": "1gwvgwk0py09pp65vnga522l5r16dvgwxsc76fg66y07k2i63cfk", + "fetchLFS": false, + "fetchSubmodules": false, + "deepClone": false, + "leaveDotGit": false +} diff --git a/nixpkgs/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-java.json b/nixpkgs/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-java.json new file mode 100644 index 000000000000..62bec402bd76 --- /dev/null +++ b/nixpkgs/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-java.json @@ -0,0 +1,11 @@ +{ + "url": "https://github.com/tree-sitter/tree-sitter-java", + "rev": "2efe37f92d2e6aeb25186e9da07455bb4a30163c", + "date": "2021-05-04T14:05:05-07:00", + "path": "/nix/store/bzljwaraqj6zqpq85cz9xb0vwh7c10yj-tree-sitter-java", + "sha256": "09v3xg1356ghc2n0yi8iqkp80lbkav0jpfgz8iz2j1sl7ihbvkyw", + "fetchLFS": false, + "fetchSubmodules": false, + "deepClone": false, + "leaveDotGit": false +} diff --git a/nixpkgs/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-javascript.json b/nixpkgs/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-javascript.json new file mode 100644 index 000000000000..a5d506dc2420 --- /dev/null +++ b/nixpkgs/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-javascript.json @@ -0,0 +1,11 @@ +{ + "url": "https://github.com/tree-sitter/tree-sitter-javascript", + "rev": "435db852fbeff8fe298e25ad967c634d9698eec0", + "date": "2021-09-13T13:32:20-07:00", + "path": "/nix/store/idvb37g3nqpidw0jviiw4b71sqpihhs0-tree-sitter-javascript", + "sha256": "0plc5jxxh1bm1dig6gsk1ma7gp29ad3p0169jd9xlagc4vysfgc3", + "fetchLFS": false, + "fetchSubmodules": false, + "deepClone": false, + "leaveDotGit": false +} diff --git a/nixpkgs/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-jsdoc.json b/nixpkgs/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-jsdoc.json new file mode 100644 index 000000000000..3f9b7203f3ff --- /dev/null +++ b/nixpkgs/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-jsdoc.json @@ -0,0 +1,11 @@ +{ + "url": "https://github.com/tree-sitter/tree-sitter-jsdoc", + "rev": "189a6a4829beb9cdbe837260653b4a3dfb0cc3db", + "date": "2021-03-04T14:39:14-08:00", + "path": "/nix/store/dpm11vziss6jbgp3dxvmgkb0dgg1ygc8-tree-sitter-jsdoc", + "sha256": "0qpsy234p30j6955wpjlaqwbr21bi56p0ln5vhrd84s99ac7s6b6", + "fetchLFS": false, + "fetchSubmodules": false, + "deepClone": false, + "leaveDotGit": false +} diff --git a/nixpkgs/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-json.json b/nixpkgs/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-json.json new file mode 100644 index 000000000000..13e67533f401 --- /dev/null +++ b/nixpkgs/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-json.json @@ -0,0 +1,11 @@ +{ + "url": "https://github.com/tree-sitter/tree-sitter-json", + "rev": "203e239408d642be83edde8988d6e7b20a19f0e8", + "date": "2021-08-18T10:35:07-07:00", + "path": "/nix/store/yqbmn17vs2lxqg5wa8b269fcsd5wr4bv-tree-sitter-json", + "sha256": "08igb9ylfdsjasyn0p9j4sqpp0i2x1qcdzacbmsag02jmkyi6s7f", + "fetchLFS": false, + "fetchSubmodules": false, + "deepClone": false, + "leaveDotGit": false +} diff --git a/nixpkgs/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-julia.json b/nixpkgs/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-julia.json new file mode 100644 index 000000000000..9f093a4d4e37 --- /dev/null +++ b/nixpkgs/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-julia.json @@ -0,0 +1,11 @@ +{ + "url": "https://github.com/tree-sitter/tree-sitter-julia", + "rev": "12ea597262125fc22fd2e91aa953ac69b19c26ca", + "date": "2021-05-03T17:44:45-07:00", + "path": "/nix/store/lbz23r698hn7cha09qq0dbfay7dh74gg-tree-sitter-julia", + "sha256": "0rmd7k3rv567psxrlqv17gvckijs19xs6mxni045rpayxmk441sk", + "fetchLFS": false, + "fetchSubmodules": false, + "deepClone": false, + "leaveDotGit": false +} diff --git a/nixpkgs/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-latex.json b/nixpkgs/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-latex.json new file mode 100644 index 000000000000..c41e4237b767 --- /dev/null +++ b/nixpkgs/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-latex.json @@ -0,0 +1,11 @@ +{ + "url": "https://github.com/latex-lsp/tree-sitter-latex", + "rev": "2c0d03a36ee979bc697f6a9dd119174cf0ef15e0", + "date": "2021-07-19T17:50:34+02:00", + "path": "/nix/store/vrpfbjfps3bd9vrx8760l0vx7m7ijhja-tree-sitter-latex", + "sha256": "0dfpdv5sibvajf2grlc0mqhyggjf6ip9j01jikk58n1yc9va88ib", + "fetchLFS": false, + "fetchSubmodules": false, + "deepClone": false, + "leaveDotGit": false +} diff --git a/nixpkgs/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-lua.json b/nixpkgs/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-lua.json new file mode 100644 index 000000000000..988f76792273 --- /dev/null +++ b/nixpkgs/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-lua.json @@ -0,0 +1,11 @@ +{ + "url": "https://github.com/nvim-treesitter/tree-sitter-lua", + "rev": "6f5d40190ec8a0aa8c8410699353d820f4f7d7a6", + "date": "2021-08-02T15:13:28+02:00", + "path": "/nix/store/h1bhl291jac001w2c8fxi9w7dsqxq5q0-tree-sitter-lua", + "sha256": "05ash0l46s66q9yamzzh6ghk8yv0vas13c7dmz0c9xljbjk5ab1d", + "fetchLFS": false, + "fetchSubmodules": false, + "deepClone": false, + "leaveDotGit": false +} diff --git a/nixpkgs/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-markdown.json b/nixpkgs/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-markdown.json new file mode 100644 index 000000000000..c908bde0dfff --- /dev/null +++ b/nixpkgs/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-markdown.json @@ -0,0 +1,11 @@ +{ + "url": "https://github.com/ikatyang/tree-sitter-markdown", + "rev": "8b8b77af0493e26d378135a3e7f5ae25b555b375", + "date": "2021-04-18T20:49:21+08:00", + "path": "/nix/store/4z2k0q6rwqmb7vbqr4vgc26w28szlan3-tree-sitter-markdown", + "sha256": "1a2899x7i6dgbsrf13qzmh133hgfrlvmjsr3bbpffi1ixw1h7azk", + "fetchLFS": false, + "fetchSubmodules": false, + "deepClone": false, + "leaveDotGit": false +} diff --git a/nixpkgs/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-nix.json b/nixpkgs/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-nix.json new file mode 100644 index 000000000000..e04d8f81ff63 --- /dev/null +++ b/nixpkgs/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-nix.json @@ -0,0 +1,11 @@ +{ + "url": "https://github.com/cstrahan/tree-sitter-nix", + "rev": "83ee5993560bf15854c69b77d92e34456f8fb655", + "date": "2021-07-21T20:36:40-05:00", + "path": "/nix/store/n5pq9gba570874akpwpvs052d7vyalhh-tree-sitter-nix", + "sha256": "03jhvyrsxq49smk9p2apjj839wmzjmrzy045wcxawz1g7xssp9pr", + "fetchLFS": false, + "fetchSubmodules": false, + "deepClone": false, + "leaveDotGit": false +} diff --git a/nixpkgs/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-ocaml.json b/nixpkgs/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-ocaml.json new file mode 100644 index 000000000000..abf7df917efe --- /dev/null +++ b/nixpkgs/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-ocaml.json @@ -0,0 +1,11 @@ +{ + "url": "https://github.com/tree-sitter/tree-sitter-ocaml", + "rev": "23d419ba45789c5a47d31448061557716b02750a", + "date": "2021-08-26T21:21:27+02:00", + "path": "/nix/store/942q4rv9vs77wwvvw46yx0jnqja2cbig-tree-sitter-ocaml", + "sha256": "1bh3afd3iix0gf6ldjngf2c65nyfdwvbmsq25gcxm04jwbg9c6k8", + "fetchLFS": false, + "fetchSubmodules": false, + "deepClone": false, + "leaveDotGit": false +} diff --git a/nixpkgs/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-php.json b/nixpkgs/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-php.json new file mode 100644 index 000000000000..6c288b7cdae5 --- /dev/null +++ b/nixpkgs/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-php.json @@ -0,0 +1,11 @@ +{ + "url": "https://github.com/tree-sitter/tree-sitter-php", + "rev": "d1bdb1e535d39d4f93f7373f406e1837c8a7bb25", + "date": "2021-09-10T08:16:50+02:00", + "path": "/nix/store/4zzs4f1hz5il35pqyf355aps6k4a83i8-tree-sitter-php", + "sha256": "0ymkwlh1japlwsajxd06254qadzq9bvm5db02cg4n3zv0pkvyrzz", + "fetchLFS": false, + "fetchSubmodules": false, + "deepClone": false, + "leaveDotGit": false +} diff --git a/nixpkgs/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-python.json b/nixpkgs/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-python.json new file mode 100644 index 000000000000..67800f5081a5 --- /dev/null +++ b/nixpkgs/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-python.json @@ -0,0 +1,11 @@ +{ + "url": "https://github.com/tree-sitter/tree-sitter-python", + "rev": "9b84b7fd9da1aa74c8a8afae58b7dcc4c109cda4", + "date": "2021-09-16T13:02:06+02:00", + "path": "/nix/store/vxh1bdkdqj3n6knlz6bbdyl5l4qj2a2v-tree-sitter-python", + "sha256": "0r5daw3pbqcaf08gnhghjr15n7vv43njvh4ky6vz985sjzdnjz02", + "fetchLFS": false, + "fetchSubmodules": false, + "deepClone": false, + "leaveDotGit": false +} diff --git a/nixpkgs/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-ql.json b/nixpkgs/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-ql.json new file mode 100644 index 000000000000..d1a73a02c0b4 --- /dev/null +++ b/nixpkgs/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-ql.json @@ -0,0 +1,11 @@ +{ + "url": "https://github.com/tree-sitter/tree-sitter-ql", + "rev": "8e7fd7e638d4a0ec7a792ee16b19dbc6407aa810", + "date": "2021-06-02T18:46:47+02:00", + "path": "/nix/store/yhyi9y09shv1fm87gka43vnv9clvyd92-tree-sitter-ql", + "sha256": "0x5f9989ymqvw3g8acckyk4j7zpmnc667qishbgly9icl9rkmv7w", + "fetchLFS": false, + "fetchSubmodules": false, + "deepClone": false, + "leaveDotGit": false +} diff --git a/nixpkgs/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-razor.json b/nixpkgs/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-razor.json new file mode 100644 index 000000000000..6905f4145aaf --- /dev/null +++ b/nixpkgs/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-razor.json @@ -0,0 +1,10 @@ +{ + "url": "https://github.com/tree-sitter/tree-sitter-razor", + "rev": "60edbd8e798e416f5226a746396efa6a8614fa9b", + "date": "2016-07-08T15:17:50-07:00", + "path": "/nix/store/2vkxw48wc0xf07awi65r4rg2m1lpqq6c-tree-sitter-razor", + "sha256": "1ldsn9nxldxkxdy7irywx88d6a56q05f6907lypzass07piyqp2i", + "fetchSubmodules": false, + "deepClone": false, + "leaveDotGit": false +} diff --git a/nixpkgs/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-regex.json b/nixpkgs/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-regex.json new file mode 100644 index 000000000000..b07344339855 --- /dev/null +++ b/nixpkgs/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-regex.json @@ -0,0 +1,11 @@ +{ + "url": "https://github.com/tree-sitter/tree-sitter-regex", + "rev": "7b97502cfc3ffa7110f6b68bb39fb259c9a0500c", + "date": "2021-08-17T11:21:39-07:00", + "path": "/nix/store/3lpj820c141i26p20kin465xlr5jpyjs-tree-sitter-regex", + "sha256": "0n9lmwwgij00078v3fr19vfn1g3wh3agm8jqp80v1cnrcsmpn97p", + "fetchLFS": false, + "fetchSubmodules": false, + "deepClone": false, + "leaveDotGit": false +} diff --git a/nixpkgs/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-rst.json b/nixpkgs/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-rst.json new file mode 100644 index 000000000000..3e2a463b54f4 --- /dev/null +++ b/nixpkgs/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-rst.json @@ -0,0 +1,11 @@ +{ + "url": "https://github.com/stsewd/tree-sitter-rst", + "rev": "a9281c2250e0d32750de159413cdd87120407389", + "date": "2021-09-17T19:21:59-05:00", + "path": "/nix/store/3cnj1q9xfl0yh096pahqvlrf66azyhsr-tree-sitter-rst", + "sha256": "1fxknsmkn3pz1km77mii3w917fdl6h57h4mnw20b0syn4v1ag07d", + "fetchLFS": false, + "fetchSubmodules": false, + "deepClone": false, + "leaveDotGit": false +} diff --git a/nixpkgs/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-ruby.json b/nixpkgs/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-ruby.json new file mode 100644 index 000000000000..86320373d7ea --- /dev/null +++ b/nixpkgs/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-ruby.json @@ -0,0 +1,11 @@ +{ + "url": "https://github.com/tree-sitter/tree-sitter-ruby", + "rev": "fe6a2d634da0e16b11b5aa255cc3df568a4572fd", + "date": "2021-03-03T16:54:30-08:00", + "path": "/nix/store/ragrvqj7hm98r74v5b3fljvc47gd3nhj-tree-sitter-ruby", + "sha256": "0m3h4928rbs300wcb6776h9r88hi32rybbhcaf6rdympl5nzi83v", + "fetchLFS": false, + "fetchSubmodules": false, + "deepClone": false, + "leaveDotGit": false +} diff --git a/nixpkgs/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-rust.json b/nixpkgs/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-rust.json new file mode 100644 index 000000000000..8e8af00423b8 --- /dev/null +++ b/nixpkgs/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-rust.json @@ -0,0 +1,11 @@ +{ + "url": "https://github.com/tree-sitter/tree-sitter-rust", + "rev": "cc7bdd3e6d14677e8aa77da64f6a3f57b6f8b00a", + "date": "2021-08-17T11:21:11-07:00", + "path": "/nix/store/aw8bi91hz7a26swc5qrfqwn2lrdmiymr-tree-sitter-rust", + "sha256": "15qz4rwz1fkpcy78g0aspfgk9pgykvzv5sxmhgm37nfpgyi7vlg1", + "fetchLFS": false, + "fetchSubmodules": false, + "deepClone": false, + "leaveDotGit": false +} diff --git a/nixpkgs/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-scala.json b/nixpkgs/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-scala.json new file mode 100644 index 000000000000..e721ed08eee0 --- /dev/null +++ b/nixpkgs/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-scala.json @@ -0,0 +1,11 @@ +{ + "url": "https://github.com/tree-sitter/tree-sitter-scala", + "rev": "449b6baa6b1cd0c2403636459af1571e075dbaa8", + "date": "2021-08-31T13:42:29-07:00", + "path": "/nix/store/8m3s0ndhmns8435g2mlbcz9sdbqgmjz7-tree-sitter-scala", + "sha256": "1lmiljsd5irzc0pabxdcjgfq98xyqm76fracglq68p106mngia07", + "fetchLFS": false, + "fetchSubmodules": false, + "deepClone": false, + "leaveDotGit": false +} diff --git a/nixpkgs/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-svelte.json b/nixpkgs/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-svelte.json new file mode 100644 index 000000000000..d3ea25aad8f2 --- /dev/null +++ b/nixpkgs/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-svelte.json @@ -0,0 +1,11 @@ +{ + "url": "https://github.com/Himujjal/tree-sitter-svelte", + "rev": "c696a13a587b0595baf7998f1fb9e95c42750263", + "date": "2021-03-20T16:45:11+05:30", + "path": "/nix/store/8krdxqwpi95ljrb5jgalwgygz3aljqr8-tree-sitter-svelte", + "sha256": "0ckmss5gmvffm6danlsvgh6gwvrlznxsqf6i6ipkn7k5lxg1awg3", + "fetchLFS": false, + "fetchSubmodules": false, + "deepClone": false, + "leaveDotGit": false +} diff --git a/nixpkgs/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-swift.json b/nixpkgs/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-swift.json new file mode 100644 index 000000000000..0c7fbb0d1add --- /dev/null +++ b/nixpkgs/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-swift.json @@ -0,0 +1,11 @@ +{ + "url": "https://github.com/tree-sitter/tree-sitter-swift", + "rev": "a22fa5e19bae50098e2252ea96cba3aba43f4c58", + "date": "2019-10-24T19:04:02-06:00", + "path": "/nix/store/pk5xk8yp6vanbar75bhfrs104w0k1ph0-tree-sitter-swift", + "sha256": "14b40lmwrnyvdz2wiv684kfh4fvqfhbj1dgrx81ppmy7hsz7jcq7", + "fetchLFS": false, + "fetchSubmodules": false, + "deepClone": false, + "leaveDotGit": false +} diff --git a/nixpkgs/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-toml.json b/nixpkgs/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-toml.json new file mode 100644 index 000000000000..ae182486506a --- /dev/null +++ b/nixpkgs/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-toml.json @@ -0,0 +1,11 @@ +{ + "url": "https://github.com/ikatyang/tree-sitter-toml", + "rev": "8bd2056818b21860e3d756b5a58c4f6e05fb744e", + "date": "2021-05-11T12:47:32+08:00", + "path": "/nix/store/isgpadcxmgkb14w9yg67pb8lx7wlfhnn-tree-sitter-toml", + "sha256": "0yasw5fp4mq6vzrdwlc3dxlss8a94bsffv4mzrfp0b3iw0s1dlyg", + "fetchLFS": false, + "fetchSubmodules": false, + "deepClone": false, + "leaveDotGit": false +} diff --git a/nixpkgs/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-tsq.json b/nixpkgs/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-tsq.json new file mode 100644 index 000000000000..6119c6e1603d --- /dev/null +++ b/nixpkgs/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-tsq.json @@ -0,0 +1,11 @@ +{ + "url": "https://github.com/tree-sitter/tree-sitter-tsq", + "rev": "b665659d3238e6036e22ed0e24935e60efb39415", + "date": "2021-05-18T15:57:40-04:00", + "path": "/nix/store/j59y4s3bsv6d5nbmhhdgb043hmk8157k-tree-sitter-tsq", + "sha256": "03bch2wp2jwxk69zjplvm0gbyw06qqdy7il9qkiafvhrbh03ayd9", + "fetchLFS": false, + "fetchSubmodules": false, + "deepClone": false, + "leaveDotGit": false +} diff --git a/nixpkgs/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-typescript.json b/nixpkgs/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-typescript.json new file mode 100644 index 000000000000..47dea4c92cd2 --- /dev/null +++ b/nixpkgs/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-typescript.json @@ -0,0 +1,11 @@ +{ + "url": "https://github.com/tree-sitter/tree-sitter-typescript", + "rev": "3383cebec9c9546587d9fe00c2e565d91163014a", + "date": "2021-09-16T13:01:51-07:00", + "path": "/nix/store/ml188xckf51g1r6gw380svxsg639kjgc-tree-sitter-typescript", + "sha256": "0vgkhn36cyg134ygx5wzld3ic9rd4lq9s2rp2dkxh0zg610ilcms", + "fetchLFS": false, + "fetchSubmodules": false, + "deepClone": false, + "leaveDotGit": false +} diff --git a/nixpkgs/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-verilog.json b/nixpkgs/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-verilog.json new file mode 100644 index 000000000000..700ec9f22dd0 --- /dev/null +++ b/nixpkgs/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-verilog.json @@ -0,0 +1,11 @@ +{ + "url": "https://github.com/tree-sitter/tree-sitter-verilog", + "rev": "1b624ab8b3f8d54ecc37847aa04512844f0226ac", + "date": "2021-03-31T21:27:26-07:00", + "path": "/nix/store/4j6hrf8bc8zjd7r9xnna9njpw0i4z817-tree-sitter-verilog", + "sha256": "0ygm6bdxqzpl3qn5l58mnqyj730db0mbasj373bbsx81qmmzkgzz", + "fetchLFS": false, + "fetchSubmodules": false, + "deepClone": false, + "leaveDotGit": false +} diff --git a/nixpkgs/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-vim.json b/nixpkgs/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-vim.json new file mode 100644 index 000000000000..7302892c6bd2 --- /dev/null +++ b/nixpkgs/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-vim.json @@ -0,0 +1,11 @@ +{ + "url": "https://github.com/vigoux/tree-sitter-viml", + "rev": "59595443fb486449f42db839934117221358a85f", + "date": "2021-08-31T08:57:29+02:00", + "path": "/nix/store/9sixkkk37c2bl09aik32cd1jd322ywri-tree-sitter-viml", + "sha256": "1kh3il5vwlz5qxi9553ks7a0dpwx1n7wnqkv5v8jhslhn7w1c1l1", + "fetchLFS": false, + "fetchSubmodules": false, + "deepClone": false, + "leaveDotGit": false +} diff --git a/nixpkgs/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-yaml.json b/nixpkgs/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-yaml.json new file mode 100644 index 000000000000..1942b47e081d --- /dev/null +++ b/nixpkgs/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-yaml.json @@ -0,0 +1,11 @@ +{ + "url": "https://github.com/ikatyang/tree-sitter-yaml", + "rev": "0e36bed171768908f331ff7dff9d956bae016efb", + "date": "2021-05-11T12:47:24+08:00", + "path": "/nix/store/7d7m4zs4ydnwbn3xnfm3pvpy7gvkrmg8-tree-sitter-yaml", + "sha256": "0wyvjh62zdp5bhd2y8k7k7x4wz952l55i1c8d94rhffsbbf9763f", + "fetchLFS": false, + "fetchSubmodules": false, + "deepClone": false, + "leaveDotGit": false +} diff --git a/nixpkgs/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-zig.json b/nixpkgs/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-zig.json new file mode 100644 index 000000000000..e7a9dfc82677 --- /dev/null +++ b/nixpkgs/pkgs/development/tools/parsing/tree-sitter/grammars/tree-sitter-zig.json @@ -0,0 +1,11 @@ +{ + "url": "https://github.com/maxxnino/tree-sitter-zig", + "rev": "5ca53bb7bd649069a6af48f4dfd32f3187491db1", + "date": "2021-09-06T21:30:14+09:00", + "path": "/nix/store/x2dfgc97jmvyq5fnbyg9w7rsjz8cknj6-tree-sitter-zig", + "sha256": "1c50pvza6l4snmvgj3by053j4z7asy828i9pi1zwm6121sl7ffpd", + "fetchLFS": false, + "fetchSubmodules": false, + "deepClone": false, + "leaveDotGit": false +} diff --git a/nixpkgs/pkgs/development/tools/parsing/tree-sitter/update.nix b/nixpkgs/pkgs/development/tools/parsing/tree-sitter/update.nix new file mode 100644 index 000000000000..c6e819465a54 --- /dev/null +++ b/nixpkgs/pkgs/development/tools/parsing/tree-sitter/update.nix @@ -0,0 +1,261 @@ +{ writeShellScript, nix-prefetch-git, formats, lib +, curl, jq, xe +, src }: + +# Grammar list: +# https://github.com/tree-sitter/tree-sitter/blob/master/docs/index.md + +let + # Grammars we want to fetch from the tree-sitter github orga + knownTreeSitterOrgGrammarRepos = [ + "tree-sitter-javascript" + "tree-sitter-c" + "tree-sitter-swift" + "tree-sitter-json" + "tree-sitter-cpp" + "tree-sitter-ruby" + "tree-sitter-go" + "tree-sitter-c-sharp" + "tree-sitter-python" + "tree-sitter-typescript" + "tree-sitter-rust" + "tree-sitter-bash" + "tree-sitter-php" + "tree-sitter-java" + "tree-sitter-scala" + "tree-sitter-ocaml" + "tree-sitter-julia" + "tree-sitter-agda" + "tree-sitter-fluent" + "tree-sitter-html" + "tree-sitter-haskell" + "tree-sitter-regex" + "tree-sitter-css" + "tree-sitter-verilog" + "tree-sitter-jsdoc" + "tree-sitter-ql" + "tree-sitter-embedded-template" + "tree-sitter-tsq" + ]; + knownTreeSitterOrgGrammarReposJson = jsonFile "known-tree-sitter-org-grammar-repos" knownTreeSitterOrgGrammarRepos; + + # repos of the tree-sitter github orga we want to ignore (not grammars) + ignoredTreeSitterOrgRepos = [ + "tree-sitter" + "tree-sitter-cli" + # this is the haskell language bindings, tree-sitter-haskell is the grammar + "haskell-tree-sitter" + # this is the ruby language bindings, tree-sitter-ruby is the grammar + "ruby-tree-sitter" + # this is the (unmaintained) rust language bindings, tree-sitter-rust is the grammar + "rust-tree-sitter" + # this is the nodejs language bindings, tree-sitter-javascript is the grammar + "node-tree-sitter" + # this is the python language bindings, tree-sitter-python is the grammar + "py-tree-sitter" + # afl fuzzing for tree sitter + "afl-tree-sitter" + # archived + "highlight-schema" + # website + "tree-sitter.github.io" + # not maintained + "tree-sitter-razor" + # rust library for constructing arbitrary graph structures from source code + "tree-sitter-graph" + ]; + ignoredTreeSitterOrgReposJson = jsonFile "ignored-tree-sitter-org-repos" ignoredTreeSitterOrgRepos; + + # Additional grammars that are not in the official github orga. + # If you need a grammar that already exists in the official orga, + # make sure to give it a different name. + otherGrammars = { + "tree-sitter-clojure" = { + orga = "sogaiu"; + repo = "tree-sitter-clojure"; + }; + "tree-sitter-comment" = { + orga = "stsewd"; + repo = "tree-sitter-comment"; + }; + "tree-sitter-dart" = { + orga = "usernobody14"; + repo = "tree-sitter-dart"; + }; + "tree-sitter-elisp" = { + orga = "wilfred"; + repo = "tree-sitter-elisp"; + }; + "tree-sitter-nix" = { + orga = "cstrahan"; + repo = "tree-sitter-nix"; + }; + "tree-sitter-latex" = { + orga = "latex-lsp"; + repo = "tree-sitter-latex"; + }; + "tree-sitter-lua" = { + orga = "nvim-treesitter"; + repo = "tree-sitter-lua"; + }; + "tree-sitter-fennel" = { + orga = "travonted"; + repo = "tree-sitter-fennel"; + }; + "tree-sitter-markdown" = { + orga = "ikatyang"; + repo = "tree-sitter-markdown"; + }; + "tree-sitter-rst" = { + orga = "stsewd"; + repo = "tree-sitter-rst"; + }; + "tree-sitter-svelte" = { + orga = "Himujjal"; + repo = "tree-sitter-svelte"; + }; + "tree-sitter-vim" = { + orga = "vigoux"; + repo = "tree-sitter-viml"; + }; + "tree-sitter-yaml" = { + orga = "ikatyang"; + repo = "tree-sitter-yaml"; + }; + "tree-sitter-toml" = { + orga = "ikatyang"; + repo = "tree-sitter-toml"; + }; + "tree-sitter-zig" = { + orga = "maxxnino"; + repo = "tree-sitter-zig"; + }; + "tree-sitter-fish" = { + orga = "ram02z"; + repo = "tree-sitter-fish"; + }; + "tree-sitter-dot" = { + orga = "rydesun"; + repo = "tree-sitter-dot"; + }; + }; + + allGrammars = + let + treeSitterOrgaGrammars = + lib.listToAttrs (map (repo: + { name = repo; + value = { + orga = "tree-sitter"; + inherit repo; + }; + }) + 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; + + + + jsonFile = name: val: (formats.json {}).generate name val; + + # check the tree-sitter orga repos + checkTreeSitterRepos = writeShellScript "get-grammars.sh" '' + set -euo pipefail + res=$(${jq}/bin/jq \ + --slurpfile known "${knownTreeSitterOrgGrammarReposJson}" \ + --slurpfile ignore "${ignoredTreeSitterOrgReposJson}" \ + '. - ($known[0] + $ignore[0])' \ + ) + if [ ! "$res" == "[]" ]; then + echo "These repositories are neither known nor ignored:" 1>&2 + echo "$res" 1>&2 + exit 1 + fi + ''; + + # TODO + urlEscape = x: x; + + # generic bash script to find the latest github release for a repo + latestGithubRelease = { orga, repo }: writeShellScript "latest-github-release" '' + set -euo pipefail + res=$(${curl}/bin/curl \ + --silent \ + "https://api.github.com/repos/${urlEscape orga}/${urlEscape repo}/releases/latest") + if [[ "$(printf "%s" "$res" | ${jq}/bin/jq '.message?')" =~ "rate limit" ]]; then + echo "rate limited" >&2 + fi + release=$(printf "%s" "$res" | ${jq}/bin/jq '.tag_name') + # github sometimes returns an empty list even tough there are releases + if [ "$release" = "null" ]; then + echo "uh-oh, latest for ${orga + "/" + repo} is not there, using HEAD" >&2 + release="HEAD" + fi + echo "$release" + ''; + + # find the latest repos of a github organization + latestGithubRepos = { orga }: writeShellScript "latest-github-repos" '' + set -euo pipefail + res=$(${curl}/bin/curl \ + --silent \ + 'https://api.github.com/orgs/${urlEscape orga}/repos?per_page=100') + + if [[ "$(printf "%s" "$res" | ${jq}/bin/jq '.message?')" =~ "rate limit" ]]; then + echo "rate limited" >&2 # + fi + + printf "%s" "$res" | ${jq}/bin/jq 'map(.name)' \ + || echo "failed $res" + ''; + + # update one tree-sitter grammar repo and print their nix-prefetch-git output + updateGrammar = { orga, repo }: writeShellScript "update-grammar.sh" '' + set -euo pipefail + latest="$(${latestGithubRelease { inherit orga repo; }})" + echo "Fetching latest release ($latest) of ${repo} …" >&2 + ${nix-prefetch-git}/bin/nix-prefetch-git \ + --quiet \ + --no-deepClone \ + --url "https://github.com/${urlEscape orga}/${urlEscape repo}" \ + --rev "$latest" + ''; + + foreachSh = attrs: f: + lib.concatMapStringsSep "\n" f + (lib.mapAttrsToList (k: v: { name = k; } // v) attrs); + + update-all-grammars = writeShellScript "update-all-grammars.sh" '' + set -euo pipefail + echo "fetching list of grammars" 1>&2 + treeSitterRepos=$(${latestGithubRepos { orga = "tree-sitter"; }}) + echo "checking the tree-sitter repo list against the grammars we know" 1>&2 + printf '%s' "$treeSitterRepos" | ${checkTreeSitterRepos} + outputDir="${toString ./.}/grammars" + echo "writing files to $outputDir" 1>&2 + mkdir -p "$outputDir" + ${foreachSh allGrammars + ({name, orga, repo}: ''${updateGrammar { inherit orga repo; }} > $outputDir/${name}.json'')} + ( echo "{" + ${foreachSh allGrammars + ({name, ...}: '' + # indentation hack + printf " %s = (builtins.fromJSON (builtins.readFile ./%s.json));\n" "${name}" "${name}"'')} + echo "}" ) \ + > "$outputDir/default.nix" + ''; + +in update-all-grammars |