tree-sitter-yarn-spinner

Crates.iotree-sitter-yarn-spinner
lib.rstree-sitter-yarn-spinner
version0.0.7
created_at2025-08-07 05:54:42.755673+00
updated_at2025-08-08 10:24:31.143486+00
descriptionTree-sitter grammar for Yarn Spinner
homepage
repositoryhttps://github.com/yuna0x0/tree-sitter-yarn-spinner
max_upload_size
id1784725
size460,417
yuna0x0 (yuna0x0)

documentation

README

tree-sitter-yarn-spinner

A tree-sitter grammar for Yarn Spinner, a dialogue system for interactive fiction and games.

⚠️ This tree-sitter parser is in early development and might have incomplete or incorrect grammar rules.

The grammar rules are based on the Yarn Spinner ANTLR 4 grammar files YarnSpinnerLexer.g4 and YarnSpinnerParser.g4 from the Yarn Spinner repository.

The grammar file in this repository is grammar.js with the external scanner in src/scanner.c and a generated src/grammar.json file.

Bindings

This parser can be used with various programming languages that support tree-sitter. Here are some examples:

Rust:

cargo add tree-sitter-yarn-spinner

JavaScript / TypeScript / Node.js:

pnpm install tree-sitter-yarn-spinner

Python:

uv add tree-sitter-yarn-spinner

Build

To build the parser, you need to have a JavaScript runtime like Node.js and a C compiler (like gcc, clang, or MSVC on Windows) installed.

Then, run the following command in the root directory of this repository, to install dependencies and generate the parser:

pnpm install
tree-sitter generate

To test the parser, you can run:

tree-sitter parse YOUR_FILE.yarn

Details can be found in the tree-sitter documentation.

License

This project is licensed under the MIT License.

Commit count: 0

cargo fmt