Skip to main content

Module document

Module document 

Source
Expand description

Tolerant parsing of .pactole source text into a concrete syntax tree.

Structs§

ParsedDocument
A parsed .pactole source text, holding the original source, the tree-sitter concrete syntax tree, and any syntax diagnostics collected while walking the tree.

Functions§

analyze
Alias for parse_document, provided for callers that prefer an analyze naming convention (e.g. editor tooling or language servers).
collect_error_nodes
Walks a tree-sitter Tree and collects a SyntaxDiagnostic for every ERROR node and every “missing” node it contains, in document order.
collect_error_nodes_with_source
Like collect_error_nodes, but also takes the original source text so that ERROR diagnostics can include a snippet of the unexpected text, in addition to the syntactic context (surrounding directive/node kind).
parse_document
Parses source as a .pactole document and collects syntax diagnostics.