Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tree-sitter: introduce tree-sitter, add nix grammar #245

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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')
3 changes: 3 additions & 0 deletions tree-sitter-grammars/nix/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Tree-sitter-nix

These files are copied from [tree-sitter-nix](https://github.com/nix-community/tree-sitter-nix).
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