kcl_lib::std::kcl_stdlib

Function extract_function

Source
pub fn extract_function(
    source: &str,
) -> Option<(Node<Program>, BoxNode<FunctionExpression>)>
Expand description

Parse a KCL program. Expect it to have a single body item, which is a function. Return the program and its single function. Return None if those expectations aren’t met.