Skip to main content

Crate vvv_lang

Crate vvv_lang 

Source
Expand description

Language support: the parser adapter plus one module per language.

syntax is the only module that touches ast_grep_core nodes; it turns a language’s declarative tables (vvv_core::SymbolRule, vvv_core::ImportGrammar) into data. Each language module contributes a grammar.rs (its vvv_core::Grammar and vvv_core::Semantics), a layout.rs (vvv_core::Layout: pure path algebra over a project) and a surgery.rs (vvv_core::Surgery: text in, edits out), assembled into a syntax::AstGrepLanguage, with an explicit parser-side navigation selection. Language modules must not import ast_grep_core, and nothing in this crate touches a file system.

Languages are compiled in behind Cargo features (rust, typescript), each enabling exactly one grammar of ast-grep-language.

Modules§

rust
Rust support: grammar and semantics as tables, the Cargo layout as pure path algebra, and the surgery that spells use paths and mod lines.
syntax
Adapter from ast-grep-core to the data-only vvv_core::search model.
typescript
TypeScript support. .ts and .tsx are distinct grammars, so they are distinct plugins sharing one grammar description.