ast_to_json

Function ast_to_json 

Source
pub fn ast_to_json<T>(node: &T) -> Result<String, Error>
where T: ?Sized + Serialize,
Expand description

Converts an AST node to a JSON string representation.

§Arguments

  • node - The AST node to convert.

§Returns

Returns a Result containing the JSON string representation of the AST node, or an error if the conversion fails.