Commit
Author: Matt Massicotte [85322+mattmassicotte@users.noreply.github.com]
Committer: GitHub [noreply@github.com] Sun, 12 Feb 2023 18:20:38 +0000
Hash: f69bde8e56f431863eba2fe4bab23e7d9692855f
Timestamp: Sun, 12 Feb 2023 18:20:38 +0000 (1 year ago)

+56 -0 +/-3 browse
SPM support (#6)
SPM support (#6)

1diff --git a/.gitignore b/.gitignore
2index 48f9f13..b3c6388 100644
3--- a/.gitignore
4+++ b/.gitignore
5 @@ -3,3 +3,4 @@
6 /log.html
7 /build/
8 /*.wasm
9+ /.build
10 diff --git a/Package.swift b/Package.swift
11new file mode 100644
12index 0000000..15d034c
13--- /dev/null
14+++ b/Package.swift
15 @@ -0,0 +1,39 @@
16+ // swift-tools-version:5.5
17+
18+ import PackageDescription
19+
20+ let package = Package(
21+ name: "TreeSitterDiff",
22+ platforms: [.macOS(.v10_13), .iOS(.v11)],
23+ products: [
24+ .library(name: "TreeSitterDiff", targets: ["TreeSitterDiff"]),
25+ ],
26+ dependencies: [],
27+ targets: [
28+ .target(name: "TreeSitterDiff",
29+ path: ".",
30+ exclude: [
31+ "assets",
32+ "binding.gyp",
33+ "bindings",
34+ "Cargo.toml",
35+ "docs",
36+ "grammar.js",
37+ "LICENSE",
38+ "package-lock.json",
39+ "package.json",
40+ "README.md",
41+ "src/grammar.json",
42+ "src/node-types.json",
43+ "test",
44+ ],
45+ sources: [
46+ "src/parser.c",
47+ ],
48+ resources: [
49+ .copy("queries")
50+ ],
51+ publicHeadersPath: "bindings/swift",
52+ cSettings: [.headerSearchPath("src")])
53+ ]
54+ )
55 diff --git a/bindings/swift/TreeSitterDiff/diff.h b/bindings/swift/TreeSitterDiff/diff.h
56new file mode 100644
57index 0000000..b4ce172
58--- /dev/null
59+++ b/bindings/swift/TreeSitterDiff/diff.h
60 @@ -0,0 +1,16 @@
61+ #ifndef TREE_SITTER_DIFF_H_
62+ #define TREE_SITTER_DIFF_H_
63+
64+ typedef struct TSLanguage TSLanguage;
65+
66+ #ifdef __cplusplus
67+ extern "C" {
68+ #endif
69+
70+ extern TSLanguage *tree_sitter_diff();
71+
72+ #ifdef __cplusplus
73+ }
74+ #endif
75+
76+ #endif // TREE_SITTER_DIFF_H_