A modern Svelte grammar for tree-sitter, compatible with tree-sitter 0.25 and later versions.
This project provides a tree-sitter parser for the Svelte framework, enabling syntax highlighting, code navigation, and other advanced editor features for Svelte files. It includes support for Svelte's unique syntax including components, reactive declarations, template syntax, and embedded JavaScript/TypeScript and CSS.
highlights.scm)<script> and <style> blocks (injections.scm)locals.scm)Add this to your Cargo.toml:
[dependencies]
tree-sitter-svelte-next = "0.1.0"
Contributions are welcome. Please ensure that:
cargo test)cargo fmt)This grammar builds upon the tree-sitter ecosystem and the Svelte community's work in defining the language's syntax and semantics.
Licensed under either of Apache License, Version 2.0 or MIT license at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this crate by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.