Skip to content

Commit 3b8eb02

Browse files
SPM support (#41)
1 parent 10e0103 commit 3b8eb02

File tree

3 files changed

+60
-0
lines changed

3 files changed

+60
-0
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,6 @@ Cargo.lock
2020
*.o
2121
/bindings/c/*.h
2222
/bindings/c/tree-sitter-*.pc
23+
24+
# Files generated by Swift
25+
/.build/

Package.swift

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

0 commit comments

Comments
 (0)