Skip to main content

Module syntax

Module syntax 

Source
Expand description

Multi-language syntax validation for Attested Computations and embedded scripts.

Provides fast syntax checking for Python, JavaScript, TypeScript, Rust, SQL, JSON, YAML, and Bash using pure Rust AST parsers.

§Cargo features

The third-party parsers are optional, each behind a feature of the same name (all on by default):

FeatureLanguagesParser crate
pythonPythonrustpython-parser
javascriptJavaScript, TypeScriptoxc_parser
rustRustsyn
sqlSQLsqlparser

JSON, YAML, and Bash checking is built in and always available. With a feature disabled, check_syntax accepts that language unchecked (it returns Ok(()), as for an unknown tag) and Language::is_supported reports false for it. The python feature is the one worth knowing about: rustpython-parser brings in the LGPL-3.0-only malachite crates, which an allow-list licence policy will typically reject.

Structs§

FencedCodeBlock
A parsed fenced code block from markdown.
SyntaxError
A syntax diagnostic produced by static AST parsing.

Enums§

Language
Supported languages for static syntax checking.

Functions§

check_syntax
Checks the syntax of source for the given language tag or name.
extract_fenced_code_blocks
Extracts all fenced code blocks (delimited by 3+ backticks or 3+ tildes) from markdown text.