Skip to content

Commit

Permalink
SPM support
Browse files Browse the repository at this point in the history
  • Loading branch information
mattmassicotte committed Oct 17, 2022
1 parent cce0e59 commit 99c2400
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ build
.idea
.vscode/ipch
target/
/.build/

# Examples generated during automated tests
examples/**
Expand Down
43 changes: 43 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
// swift-tools-version:5.3

import PackageDescription

let package = Package(
name: "TreeSitterElm",
platforms: [.macOS(.v10_13), .iOS(.v11)],
products: [
.library(name: "TreeSitterElm", targets: ["TreeSitterElm"]),
],
dependencies: [],
targets: [
.target(name: "TreeSitterElm",
path: ".",
exclude: [
"binding.gyp",
"bindings",
"Cargo.toml",
"docs",
"examples",
"grammar.js",
"HOW_TO_RELEASE.md",
"index.d.ts",
"LICENSE.md",
"package.json",
"README.md",
"script",
"src/grammar.json",
"src/node-types.json",
"test",
"tsconfig.json",
],
sources: [
"src/parser.c",
"src/scanner.cc",
],
resources: [
.copy("queries")
],
publicHeadersPath: "bindings/swift",
cSettings: [.headerSearchPath("src")])
]
)
16 changes: 16 additions & 0 deletions bindings/swift/TreeSitterElm/elm.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#ifndef TREE_SITTER_ELM_H_
#define TREE_SITTER_ELM_H_

typedef struct TSLanguage TSLanguage;

#ifdef __cplusplus
extern "C" {
#endif

extern TSLanguage *tree_sitter_elm();

#ifdef __cplusplus
}
#endif

#endif // TREE_SITTER_ELM_H_

0 comments on commit 99c2400

Please sign in to comment.