Skip to main content

parse_agent_to_json

Function parse_agent_to_json 

Source
pub fn parse_agent_to_json(source: &str) -> Result<String, JsValue>
Expand description

Parse AgentScript source code and return the AST as a JSON string.

This is useful when you need to pass the AST to another system or want to inspect it as text.

§Arguments

  • source - The AgentScript source code to parse

§Returns

  • Ok(String) - The parsed AST as a JSON string
  • Err(JsValue) - Error message if parsing fails