diff --git a/Package.swift b/Package.swift new file mode 100644 index 00000000..a5e4524d --- /dev/null +++ b/Package.swift @@ -0,0 +1,33 @@ +// swift-tools-version:5.3 +import PackageDescription + +let package = Package( + name: "TreeSitterPython", + products: [ + .library(name: "TreeSitterPython", targets: ["TreeSitterPython"]), + ], + dependencies: [], + targets: [ + .target(name: "TreeSitterPython", + path: ".", + exclude: [ + "binding.gyp", + "bindings", + "Cargo.toml", + "corpus", + "grammar.js", + "LICENSE", + "package.json", + "README.md", + ], + sources: [ + "src/parser.c", + "src/scanner.c", + ], + resources: [ + .copy("queries") + ], + publicHeadersPath: "bindings/swift", + cSettings: [.headerSearchPath("src")]) + ] +) diff --git a/bindings/swift/TreeSitterPython/python.h b/bindings/swift/TreeSitterPython/python.h new file mode 100644 index 00000000..6f2548a2 --- /dev/null +++ b/bindings/swift/TreeSitterPython/python.h @@ -0,0 +1,16 @@ +#ifndef TREE_SITTER_PYTHON_H_ +#define TREE_SITTER_PYTHON_H_ + +typedef struct TSLanguage TSLanguage; + +#ifdef __cplusplus +extern "C" { +#endif + +extern TSLanguage *tree_sitter_python(); + +#ifdef __cplusplus +} +#endif + +#endif // TREE_SITTER_PYTHON_H_