feat(3p/bat_syntaxes): Add a derivation to extend bat syntaxes

This derivation can add arbitrary new Sublime syntaxes to bat's syntax
file, which is used by cheddar.

Included is a Prolog syntax. It is kind of mediocre, but better than
nothing.

Change-Id: I6ceecbc86a5dfba5886cd27bd5114721845446a7
Reviewed-on: https://cl.tvl.fyi/c/depot/+/348
Reviewed-by: lukegb <lukegb@tvl.fyi>
This commit is contained in:
Vincent Ambo 2020-06-15 00:58:26 +01:00 committed by tazjin
parent 81b6bde074
commit 0b95b8632d
2 changed files with 1336 additions and 0 deletions

File diff suppressed because it is too large Load diff

17
third_party/bat_syntaxes/default.nix vendored Normal file
View file

@ -0,0 +1,17 @@
# For depot projects that make use of syntect (primarily
# //tools/cheddar) the included syntax set is taken from bat.
#
# However, bat lacks some of the syntaxes we are interested in. This
# package creates a new binary syntax set which bundles our additional
# syntaxes on top of bat's existing ones.
{ pkgs, ... }:
let
inherit (pkgs) bat runCommandNoCC;
in runCommandNoCC "bat-syntaxes.bin" {} ''
export HOME=$PWD
mkdir -p .config/bat/syntaxes
cp ${./Prolog.sublime-syntax} .config/bat/syntaxes
${bat}/bin/bat cache --build
mv .cache/bat/syntaxes.bin $out
''