Skip to main content

parse_with_grammar

Function parse_with_grammar 

Source
pub fn parse_with_grammar(grammar: &str, source: &str) -> Option<Tree>
Expand description

Parse source code with a specific grammar.

The grammar name should match tree-sitter grammar names (e.g., “python”, “rust”, “typescript”). Emits a warning to stderr on the first call where the grammar fails to load.