Skip to content

Commit

Permalink
tree-sitter: introduce tree-sitter, add nix grammar
Browse files Browse the repository at this point in the history
  • Loading branch information
inclyc committed Aug 15, 2023
1 parent d1704af commit cde7db0
Show file tree
Hide file tree
Showing 7 changed files with 22,606 additions and 0 deletions.
2 changes: 2 additions & 0 deletions default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
, nix
, nixpkgs-fmt
, pkg-config
, tree-sitter
}:

stdenv.mkDerivation {
Expand Down Expand Up @@ -41,6 +42,7 @@ stdenv.mkDerivation {
gtest
boost182
llvmPackages.llvm
tree-sitter
];

env.CXXFLAGS = "-include ${nix.dev}/include/nix/config.h";
Expand Down
2 changes: 2 additions & 0 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,13 @@ gtest_main = dependency('gtest_main')

llvm = dependency('llvm')
boost = dependency('boost')
tree_sitter = dependency('tree-sitter')

cpp = meson.get_compiler('cpp')
backtrace = cpp.find_library('backtrace')

lit = find_program('lit', required: false)

subdir('lspserver')
subdir('tree-sitter-grammars')
subdir('nixd')
1 change: 1 addition & 0 deletions tree-sitter-grammars/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
subdir('nix')
4 changes: 4 additions & 0 deletions tree-sitter-grammars/nix/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Tree-sitter-nix

These files are copied from https://github.com/nix-community/tree-sitter-nix,
and licensed under https://github.com/nix-community/tree-sitter-nix/blob/master/LICENSE
11 changes: 11 additions & 0 deletions tree-sitter-grammars/nix/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
libtree_sitter_nix_deps = [ tree_sitter ]

libtree_sitter_nix = library('tree_sitter_grammars'
, 'parser.c'
, 'scanner.c'
, dependencies: libtree_sitter_nix_deps
, install: true
)

tree_sitter_nix = declare_dependency( link_with: libtree_sitter_nix
, dependencies: libtree_sitter_nix_deps)
Loading

0 comments on commit cde7db0

Please sign in to comment.