Merge pull request #107197 from Profpatsch/tree-sitter-fixes
Tree sitter fixes
This commit is contained in:
commit
70c07155d0
@ -41,8 +41,10 @@ let
|
|||||||
|
|
||||||
builtGrammars = let
|
builtGrammars = let
|
||||||
change = name: grammar:
|
change = name: grammar:
|
||||||
callPackage ./library.nix {
|
callPackage ./library.nix {} {
|
||||||
language = name; inherit version; source = fetchGrammar grammar;
|
language = name;
|
||||||
|
inherit version;
|
||||||
|
source = fetchGrammar grammar;
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
# typescript doesn't have parser.c in the same place as others
|
# typescript doesn't have parser.c in the same place as others
|
||||||
@ -60,10 +62,6 @@ in rustPlatform.buildRustPackage {
|
|||||||
# needed for the tests
|
# needed for the tests
|
||||||
rm -rf test/fixtures/grammars
|
rm -rf test/fixtures/grammars
|
||||||
ln -s ${grammars} test/fixtures/grammars
|
ln -s ${grammars} test/fixtures/grammars
|
||||||
|
|
||||||
# These functions do not appear in the source code
|
|
||||||
sed -i /_ts_query_context/d lib/binding_web/exports.json
|
|
||||||
sed -i /___assert_fail/d lib/binding_web/exports.json
|
|
||||||
'';
|
'';
|
||||||
|
|
||||||
# Compile web assembly with emscripten. The --debug flag prevents us from
|
# Compile web assembly with emscripten. The --debug flag prevents us from
|
||||||
|
@ -1,7 +1,15 @@
|
|||||||
{ stdenv
|
{ stdenv
|
||||||
, language
|
|
||||||
, tree-sitter
|
, tree-sitter
|
||||||
|
}:
|
||||||
|
|
||||||
|
# Build a parser grammar and put the resulting shared object in `$out/parser`
|
||||||
|
|
||||||
|
{
|
||||||
|
# language name
|
||||||
|
language
|
||||||
|
# version of tree-sitter
|
||||||
, version
|
, version
|
||||||
|
# source for the language grammar
|
||||||
, source
|
, source
|
||||||
}:
|
}:
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user