INNER CODE UNIT · Rust
parse_executable_document
obmarg/cynic · cynic-parser/src/lib.rs:42
pub fn parse_executable_document(input: &str) -> Result<ExecutableDocument, Error> {
if input.trim().is_empty() {
return Err(Error::EmptyExecutableDocument);
}
let lexer = lexer::Lexer::new(input);
let mut ast = executable::writer::ExecutableAstWriter::new();
parser::ExecutableDocumentParser::new().parse(input, &mut ast, lexer)?;
Ok(ast.finish())
}
trait AstLookup<Id> {
type Output: ?Sized;
fn lookup(&self, index: Id) -> &Self::Output;
}