diff --git a/cpp-tree-sitter/include/ts/TSParser.h b/cpp-tree-sitter/include/ts/TSParser.h new file mode 100644 index 000000000..1cca0abf6 --- /dev/null +++ b/cpp-tree-sitter/include/ts/TSParser.h @@ -0,0 +1,17 @@ +#pragma once + +#include "tree_sitter/api.h" + +namespace ts { + +class TSParser { + ::TSParser *Self; + +public: + TSParser() { Self = ts_parser_new(); } + ~TSParser() { ts_parser_delete(Self); } + + ::TSParser *unwrap() { return Self; } +}; + +} // namespace ts diff --git a/cpp-tree-sitter/meson.build b/cpp-tree-sitter/meson.build new file mode 100644 index 000000000..a1f813371 --- /dev/null +++ b/cpp-tree-sitter/meson.build @@ -0,0 +1,10 @@ +tree_sitter = dependency('tree-sitter') + +# libcpp_tree_sitter = library('cpp_tree_sitter', +# , include_directories: include_directories('include/ts') +# , dependencies: tree_sitter +# ) + + +cpp_tree_sitter = declare_dependency( # link_with: libcpp_tree_sitter + include_directories: include_directories('include')) diff --git a/meson.build b/meson.build index 4df5c3deb..b4800c366 100644 --- a/meson.build +++ b/meson.build @@ -40,4 +40,5 @@ lit = find_program('lit', required: false) subdir('lspserver') subdir('tree-sitter-grammars') +subdir('cpp-tree-sitter') subdir('nixd')