pub fn parse(
input: Arc<str>,
config: Option<&BuildConfig>
) -> CompileResult<SwayParseTree>
Expand description
Given an input Arc<str>
and an optional BuildConfig, parse the input into a SwayParseTree.
Example
let input = "script; fn main() -> bool { true }";
let result = parse(input.into(), Default::default());
Panics
Panics if the generated parser from Pest panics.