Swiftpack.co - ChimeHQ/SwiftTreeSitter as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by ChimeHQ.
ChimeHQ/SwiftTreeSitter 0.7.1
Swift API for the tree-sitter incremental parsing system
⭐️ 157
🕓 9 weeks ago
.package(url: "https://github.com/ChimeHQ/SwiftTreeSitter.git", from: "0.7.1")

Build Status License Platforms Documentation

SwiftTreeSitter

Swift API for the tree-sitter incremental parsing system.

  • Close to full coverage of the C API
  • Swift/Foundation types where possible
  • Standard query result mapping for injections
  • Query predicate support via ResolvingQueryCursor

SwiftTreeSitter is fairly low-level. If you are looking a higher-level system for syntax highlighting and other syntactic operations, you might want to have a look at Neon.

📖 Documentation is available in DocC format.

Integration

dependencies: [
    .package(url: "https://github.com/ChimeHQ/SwiftTreeSitter")
]

Language Parsers

Tree-sitter language parsers are separate projects, and you'll probably need at least one. More details are available in the documentation. How they can be installed an incorporated varies. Since you're here, you might find SPM the most convenient.

Parser Make SPM Official Repo
Bash
C
C++
C#
Clojure
CMake
Comment
CSS
D
Dart
Dockerfile
Elixir
Elm
Erlang
Fish
Fortran
gitattributes
gitignore
Go
GoMod
GoWork
graphql
Hack
Haskell
HCL
HTML
Java
Javascript
JSON
Json5
Julia
Kotlin
Latex
LLVM
Lua
Make
Markdown
Markdown
OCaml
Pascal
Perl
PHP
PowerShell
Python
R
Racket
Regex
Ruby
Rust
Scala
Scheme
Scss
SQL
Sqlite
SSH
Swift
TOML
Tree-sitter query language
Typescript
Verilog
Vue
YAML
Zig

Suggestions or Feedback

We'd love to hear from you! Get in touch via twitter, an issue, or a pull request.

Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.

GitHub

link
Stars: 157
Last commit: 2 weeks ago
jonrohan Something's broken? Yell at me @ptrpavlik. Praise and feedback (and money) is also welcome.

Release Notes

v0.7.1
9 weeks ago
  • Expanding query definitions to include highlights and injections
  • TSRange is now Codable, Hashable, and Sendable
  • Point is now Codable and Sendable
  • NamedRange API has been expanded to provide the name components

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics