gql-parser 0.1.1

GQL lexer, parser, and AST definitions for GraphFusion.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
//! Parse GQL files without executing database operations.
fn main() -> Result<(), Box<dyn std::error::Error>> {
    let files = std::env::args().skip(1).collect::<Vec<_>>();
    if files.is_empty() {
        return Err("usage: parse_file FILE [FILE ...]".into());
    }
    for file in files {
        let input = std::fs::read_to_string(&file)?;
        graphfusion_gql_parser::parse(&input).map_err(|error| format!("{file}: {error}"))?;
    }
    Ok(())
}