pub fn parse_tl_file(
    contents: &str
) -> impl Iterator<Item = Result<Definition, ParseError>>
Expand description

Parses a file full of Type Language definitions.

Examples

use std::fs::File;
use std::io::{self, Read};
use grammers_tl_parser::parse_tl_file;

fn main() -> std::io::Result<()> {
    let mut file = File::open("api.tl")?;
    let mut contents = String::new();
    file.read_to_string(&mut contents)?;

    for definition in parse_tl_file(&contents) {
        dbg!(definition);
    }

    Ok(())
}