pub fn parse(
input: Arc<str>,
type_engine: &TypeEngine,
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(), None);
Panics
Panics if the parser panics.