pub fn parse<'s>(
input: &'s [SpannedToken<'s>],
) -> Result<SourceText<'s>, VerboseError<'s>>Expand description
Parse the token stream into a SystemVerilog CST as defined in scarf_syntax
let file_contents = "module test_module; endmodule";
let tokens = lex(file_contents, "test_file.v").tokens();
let pp_tokens = preprocess(tokens, &mut state, &cache).unwrap();
let ast: scarf_syntax::SourceText<'_> = parse(&pp_tokens).unwrap();
let descriptions = &ast.2;
assert!(matches!(descriptions.first(), Some(scarf_syntax::Description::ModuleDeclaration(_))))