parse_declaration_file

Function parse_declaration_file 

Source
pub fn parse_declaration_file(
    source: &str,
    name: String,
    options: &ParseOptions,
    provider: &dyn DeclProvider,
) -> Result<DeclFile, ParserError>
Expand description

parse a decleration file into a DeclFile.

it takes a name for the file, parsing options and a decleration provider used to resolve imports.

ยงexample

let file = parse_declaration_file(
	"struct A { v: vint }", "file".to_string(), &ParseOptions::default(), &VoidProvider{}
).unwrap();