rnix 0.14.0

A Nix parser written in Rust
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use std::{io, io::Read};

fn main() {
    let mut content = String::new();
    io::stdin().read_to_string(&mut content).expect("could not read nix from stdin");
    let ast = rnix::Root::parse(&content);

    for error in ast.errors() {
        println!("error: {}", error);
    }

    println!("{:#?}", ast.tree());
}