Skip to content

Commit

Permalink
cpp-tree-sitter: introduce cpp-tree-sitter, as a C++ wrapper (WIP)
Browse files Browse the repository at this point in the history
  • Loading branch information
inclyc committed Aug 19, 2023
1 parent b517d6c commit d10f937
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 0 deletions.
17 changes: 17 additions & 0 deletions cpp-tree-sitter/include/ts/TSParser.h
Original file line number Diff line number Diff line change
@@ -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
10 changes: 10 additions & 0 deletions cpp-tree-sitter/meson.build
Original file line number Diff line number Diff line change
@@ -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'))
1 change: 1 addition & 0 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,5 @@ lit = find_program('lit', required: false)

subdir('lspserver')
subdir('tree-sitter-grammars')
subdir('cpp-tree-sitter')
subdir('nixd')

0 comments on commit d10f937

Please sign in to comment.