Skip to content

Commit

Permalink
Merge pull request #19 from mattmassicotte/feature/spm
Browse files Browse the repository at this point in the history
SPM support
  • Loading branch information
theHamsta authored Oct 14, 2022
2 parents 5217c68 + b0e4acb commit a3188cf
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
.tests
node_modules
build/
/.build/
36 changes: 36 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
// swift-tools-version:5.3

import PackageDescription

let package = Package(
name: "TreeSitterQuery",
platforms: [.macOS(.v10_13), .iOS(.v11)],
products: [
.library(name: "TreeSitterQuery", targets: ["TreeSitterQuery"]),
],
dependencies: [],
targets: [
.target(name: "TreeSitterQuery",
path: ".",
exclude: [
"binding.gyp",
"bindings",
"Cargo.toml",
"corpus",
"grammar.js",
"LICENSE",
"Makefile",
"package.json",
"package-lock.json",
"README.md",
"scripts",
"src/grammar.json",
"src/node-types.json",
],
sources: [
"src/parser.c",
],
publicHeadersPath: "bindings/swift",
cSettings: [.headerSearchPath("src")])
]
)
16 changes: 16 additions & 0 deletions bindings/swift/TreeSitterQuery/query.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#ifndef TREE_SITTER_QUERY_H_
#define TREE_SITTER_QUERY_H_

typedef struct TSLanguage TSLanguage;

#ifdef __cplusplus
extern "C" {
#endif

extern TSLanguage *tree_sitter_query();

#ifdef __cplusplus
}
#endif

#endif // TREE_SITTER_QUERY_H_

0 comments on commit a3188cf

Please sign in to comment.