Skip to content

Commit 49716ff

Browse files
author
Lukas Pistrol
authored
add spm support (tree-sitter#227)
1 parent fcb2b6f commit 49716ff

File tree

3 files changed

+55
-0
lines changed

3 files changed

+55
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ examples
1010
!examples/.gitkeep
1111
scanner.obj
1212
/target/
13+
.build/

Package.swift

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
// swift-tools-version:5.3
2+
import PackageDescription
3+
4+
let package = Package(
5+
name: "TreeSitterCSharp",
6+
products: [
7+
.library(name: "TreeSitterCSharp", targets: ["TreeSitterCSharp"]),
8+
],
9+
dependencies: [],
10+
targets: [
11+
.target(name: "TreeSitterCSharp",
12+
path: ".",
13+
exclude: [
14+
"binding.gyp",
15+
"bindings",
16+
"Cargo.toml",
17+
"corpus",
18+
"grammar.js",
19+
"index.js",
20+
"LICENSE",
21+
"Makefile",
22+
"package.json",
23+
"README.md",
24+
"script",
25+
"src/grammar.json",
26+
"src/node-types.json",
27+
],
28+
sources: [
29+
"src/parser.c",
30+
"src/scanner.c",
31+
],
32+
resources: [
33+
.copy("queries")
34+
],
35+
publicHeadersPath: "bindings/swift",
36+
cSettings: [.headerSearchPath("src")])
37+
]
38+
)
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#ifndef TREE_SITTER_CSHARP_H_
2+
#define TREE_SITTER_CSHARP_H_
3+
4+
typedef struct TSLanguage TSLanguage;
5+
6+
#ifdef __cplusplus
7+
extern "C" {
8+
#endif
9+
10+
extern TSLanguage *tree_sitter_c_sharp();
11+
12+
#ifdef __cplusplus
13+
}
14+
#endif
15+
16+
#endif // TREE_SITTER_CSHARP_H_

0 commit comments

Comments
 (0)