pub fn parse(
    input: Arc<str>,
    config: Option<&BuildConfig>
) -> CompileResult<ParseProgram>
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 parser panics.