Skip to content

Commit

Permalink
Merge pull request #76 from nhubbard/master
Browse files Browse the repository at this point in the history
Add Swift Package Manager support
  • Loading branch information
pfoerster authored Feb 25, 2023
2 parents 6b7ea83 + fb8e0f5 commit 376f640
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -243,3 +243,6 @@ Cargo.lock
build/
/bindings/c/*.h
/bindings/c/tree-sitter-*.pc

# Swift Package Manager
.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: "TreeSitterLatex",
products: [
.library(name: "TreeSitterLatex", targets: ["TreeSitterLatex"]),
],
dependencies: [],
targets: [
.target(name: "TreeSitterLatex",
path: ".",
exclude: [
"binding.gyp",
"bindings",
"benches",
".github",
"examples",
"Cargo.toml",
"test",
"grammar.js",
"LICENSE",
"Makefile",
"package.json",
"README.md",
"src/grammar.json",
"src/node-types.json",
],
sources: [
"src/parser.c",
"src/scanner.c",
],
publicHeadersPath: "bindings/swift",
cSettings: [.headerSearchPath("src")])
]
)
16 changes: 16 additions & 0 deletions bindings/swift/TreeSitterLatex/latex.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#ifndef TREE_SITTER_LATEX_H_
#define TREE_SITTER_LATEX_H_

typedef struct TSLanguage TSLanguage;

#ifdef __cplusplus
extern "C" {
#endif

extern TSLanguage *tree_sitter_latex();

#ifdef __cplusplus
}
#endif

#endif // TREE_SITTER_LATEX_H_

0 comments on commit 376f640

Please sign in to comment.