Skip to content

Commit 67ceaeb

Browse files
authored
Merge pull request #17 from mattmassicotte/feature/swift-binding
SPM support
2 parents c88f444 + 7ab5849 commit 67ceaeb

File tree

3 files changed

+48
-0
lines changed

3 files changed

+48
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ package-lock.json
55
Cargo.lock
66

77
/build
8+
/.build
89
/target
910
*.obj
1011
*.exp

Package.swift

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
// swift-tools-version:5.3
2+
3+
import PackageDescription
4+
5+
let package = Package(
6+
name: "TreeSitterLua",
7+
platforms: [.macOS(.v10_13), .iOS(.v11)],
8+
products: [
9+
.library(name: "TreeSitterLua", targets: ["TreeSitterLua"]),
10+
],
11+
dependencies: [],
12+
targets: [
13+
.target(name: "TreeSitterLua",
14+
path: ".",
15+
exclude: [
16+
"binding.gyp",
17+
"bindings",
18+
"Cargo.toml",
19+
"grammar.js",
20+
"LICENSE.txt",
21+
"package.json",
22+
"README.md",
23+
],
24+
sources: [
25+
"src/parser.c",
26+
"src/scanner.c",
27+
],
28+
publicHeadersPath: "bindings/swift",
29+
cSettings: [.headerSearchPath("src")])
30+
]
31+
)

bindings/swift/TreeSitterLua/lua.h

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#ifndef TREE_SITTER_LUA_H_
2+
#define TREE_SITTER_LUA_H_
3+
4+
typedef struct TSLanguage TSLanguage;
5+
6+
#ifdef __cplusplus
7+
extern "C" {
8+
#endif
9+
10+
extern TSLanguage *tree_sitter_lua();
11+
12+
#ifdef __cplusplus
13+
}
14+
#endif
15+
16+
#endif // TREE_SITTER_LUA_H_

0 commit comments

Comments
 (0)