Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/krzyzanowskim/tree-sitter-xcframework
binary build of tree-sitter for apple platforms
https://github.com/krzyzanowskim/tree-sitter-xcframework
parser spm swift swift-package-manager tree-sitter tree-sitter-parser
Last synced: 3 months ago
JSON representation
binary build of tree-sitter for apple platforms
- Host: GitHub
- URL: https://github.com/krzyzanowskim/tree-sitter-xcframework
- Owner: krzyzanowskim
- License: mit
- Created: 2022-03-05T11:55:45.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-02-12T00:00:13.000Z (11 months ago)
- Last Synced: 2024-04-14T04:57:22.754Z (9 months ago)
- Topics: parser, spm, swift, swift-package-manager, tree-sitter, tree-sitter-parser
- Language: C
- Homepage: https://swift.best
- Size: 105 MB
- Stars: 37
- Watchers: 4
- Forks: 6
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
A module for the [tree-sitter](https://tree-sitter.github.io/) incremental parsing system. The tree-sitter has both runtime and per-language dependencies. They all have to be build separately. For a purpose of this project per-language dependencies are part of the resulting `tree_sitter.xcframework`.
The `tree_sitter.xcframework` binary comes with:
- [tree-sitter](https://tree-sitter.github.io/tree-sitter) runtime
- [tree-sitter-swift](https://github.com/alex-pinkus/tree-sitter-swift)
- [tree-sitter-go](https://github.com/tree-sitter/tree-sitter-go)
- [tree-sitter-gomod](https://github.com/camdencheek/tree-sitter-go-mod)
- [tree-sitter-ruby](https://github.com/tree-sitter/tree-sitter-ruby)
- [tree-sitter-json](https://github.com/tree-sitter/tree-sitter-json)
- [tree-sitter-php](https://github.com/tree-sitter/tree-sitter-php)
- [tree-sitter-markdown](https://github.com/ikatyang/tree-sitter-markdown)
- [tree-sitter-java](https://github.com/tree-sitter/tree-sitter-java)
- [tree-sitter-python](https://github.com/tree-sitter/tree-sitter-python)
- [tree-sitter-html](https://github.com/tree-sitter/tree-sitter-html)
- [tree-sitter-css](https://github.com/tree-sitter/tree-sitter-css)This is a [work-in-progress](https://github.com/tree-sitter/tree-sitter/issues/1488). But, if the parser you'd like to use doesn't have a Makefile, let me know and I'll help get it set up.
## Integration
### Swift Package Manager
```swift
dependencies: [
.package(url: "https://github.com/krzyzanowskim/tree-sitter-xcframework", from: "0.208.4")
]
```## Usage
Accessing the parsers directly:
```swift
import TreeSitterlet parser = tree_sitter_swift()
let parser = tree_sitter_ruby()
```Via the included "TreeSitterResource" abstraction:
```swift
import TreeSitterResourcelet swift = TreeSitterLanguage.swift
let url = swift.highlightQueryURL
let parserPtr = swift.parser
```### Suggestions or Feedback
I'd love to hear from you! Get in touch via twitter [@krzyzanowskim](https://x.com/krzyzanowskim), an issue, or a pull request.