yak-sitter

Crates.ioyak-sitter
lib.rsyak-sitter
version
sourcesrc
created_at2023-07-18 22:42:41.362565
updated_at2024-11-30 13:35:56.549516
descriptionopinionated tree-sitter facade which lets you store data visible to nodes and provides other improvements
homepage
repositoryhttps://github.com/Jakobeha/type-sitter/
max_upload_size
id919812
Cargo.toml error:TOML parse error at line 17, column 1 | 17 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include`
size0
Jakob Hain (Jakobeha)

documentation

README

yak-sitter: opinionated tree-sitter facade which lets you store data visible to nodes and provides other improvements

crates.io docs.rs

This library provides an API almost identical to tree-sitter, but with the following changes:

  • Trees can optionally store Custom data of arbitrary type, which each node can access via shared reference. Typically the custom data will contain a map of nodes to additional metadata, or a diagnostic logger (assuming all diagnostics have at least one source location). Then, you won't need to pass around this extra information to functions which deal with nodes, you can retrieve it from the nodes directly.
  • Trees store their original source code, and nodes can access their text
  • Trees also store the path they were parsed from, and nodes can access this path
  • Nodes are ordered based on their location in the tree, and nodes from different trees are ordered based on their paths.
  • TreeCursor is split into LocalTreeCursor and GlobalTreeCursor. When GlobalTreeCursor is reset to a node it can still go to parents and siblings, albeit with a performance penalty. LocalTreeCursor is the original TreeCursor since its behavior a bit confusing.
  • All parsed text must be valid UTF-8

The library is an attempt to integrate tree-sitter with an existing project (https://github.com/Jakobeha/nominalscript), hence the name. Regardless, if you want any changes or have any suggestions, feel free to submit a github issue or PR

Commit count: 137

cargo fmt