summary refs log tree commit diff
path: root/doc/guix.texi
diff options
context:
space:
mode:
authorPierre Langlois <pierre.langlois@gmx.com>2022-11-25 01:57:21 +0000
committerAndrew Tropin <andrew@trop.in>2023-02-12 11:32:20 +0400
commitdbd4d2d0707b486f1e2c8659e94e1d3b15e4351e (patch)
tree131835584a8cc60536cda9c657a4807c7528a097 /doc/guix.texi
parent4a6f64ab2afff761eb233e7ca6110d9e8acf8f32 (diff)
downloadguix-dbd4d2d0707b486f1e2c8659e94e1d3b15e4351e.tar.gz
build-system: Add tree-sitter-build-system.
* guix/build-system/tree-sitter.scm: New module.
* guix/build/tree-sitter-build-system.scm: Likewise.
* Makefile.am (MODULES): Add them.
* doc/guix.texi: Document it.

Signed-off-by: Andrew Tropin <andrew@trop.in>
Diffstat (limited to 'doc/guix.texi')
-rw-r--r--doc/guix.texi21
1 files changed, 20 insertions, 1 deletions
diff --git a/doc/guix.texi b/doc/guix.texi
index 6c7c918eb0..44e2165a82 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -79,7 +79,7 @@ Copyright @copyright{} 2020 Jack Hill@*
 Copyright @copyright{} 2020 Naga Malleswari@*
 Copyright @copyright{} 2020, 2021 Brice Waegeneire@*
 Copyright @copyright{} 2020 R Veera Kumar@*
-Copyright @copyright{} 2020, 2021 Pierre Langlois@*
+Copyright @copyright{} 2020, 2021, 2022 Pierre Langlois@*
 Copyright @copyright{} 2020 pinoaffe@*
 Copyright @copyright{} 2020 André Batista@*
 Copyright @copyright{} 2020, 2021 Alexandru-Sergiu Marton@*
@@ -9756,6 +9756,25 @@ be specified with the @code{#:node} parameter which defaults to
 @code{node}.
 @end defvar
 
+@defvr {Scheme Variable} tree-sitter-build-system
+
+This variable is exported by @code{(guix build-system tree-sitter)}.  It
+implements procedures to compile grammars for the
+@url{https://tree-sitter.github.io/tree-sitter/, Tree-sitter} parsing
+library.  It essentially runs @code{tree-sitter generate} to translate
+@code{grammar.js} grammars to JSON and then to C.  Which it then
+compiles to native code.
+
+Tree-sitter packages may support multiple grammars, so this build system
+supports a @code{#:grammar-directories} keyword to specify a list of
+locations where a @code{grammar.js} file may be found.
+
+Grammars sometimes depend on each other, such as C++ depending on C and
+TypeScript depending on JavaScript.  You may use inputs to declare such
+dependencies.
+
+@end defvr
+
 Lastly, for packages that do not need anything as sophisticated, a
 ``trivial'' build system is provided.  It is trivial in the sense that
 it provides basically no support: it does not pull any implicit inputs,