Skip to content

Commit

Permalink
feat: add Swift bindings
Browse files Browse the repository at this point in the history
  • Loading branch information
amaanq committed Feb 22, 2023
1 parent 091cabd commit 960690a
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 0 deletions.
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: "TreeSitterGosum",
platforms: [.macOS(.v10_13), .iOS(.v11)],
products: [
.library(name: "TreeSitterGosum", targets: ["TreeSitterGosum"]),
],
dependencies: [],
targets: [
.target(name: "TreeSitterGosum",
path: ".",
exclude: [
"binding.gyp",
"bindings",
"Cargo.toml",
"test",
"grammar.js",
"LICENSE",
"package.json",
"README.md",
"script",
"src/grammar.json",
"src/node-types.json",
],
sources: [
"src/parser.c",
],
resources: [
.copy("queries")
],
publicHeadersPath: "bindings/swift",
cSettings: [.headerSearchPath("src")])
]
)
16 changes: 16 additions & 0 deletions bindings/swift/gosum.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#ifndef TREE_SITTER_GOSUM_H_
#define TREE_SITTER_GOSUM_H_

typedef struct TSLanguage TSLanguage;

#ifdef __cplusplus
extern "C" {
#endif

extern TSLanguage *tree_sitter_gosum();

#ifdef __cplusplus
}
#endif

#endif // TREE_SITTER_GOSUM_H_

0 comments on commit 960690a

Please sign in to comment.