Function sway_core::parse[][src]

pub fn parse(
    input: Arc<str>,
    config: Option<&BuildConfig>
) -> CompileResult<HllParseTree>
Expand description

Given an input Arc<str> and an optional BuildConfig, parse the input into a HllParseTree.

Example

    let input = "script; fn main() -> bool { true }";
    let result = parse(input.into(), Default::default());

Panics

Panics if the generated parser from Pest panics.