styx-parse 4.0.0

Event-based parser for the Styx configuration language
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use std::io::Read;
use styx_parse::Lexer;
use styx_tokenizer::Tokenizer;

fn main() {
    let mut source = String::new();
    std::io::stdin().read_to_string(&mut source).unwrap();

    println!("=== Tokens ===");
    for tok in Tokenizer::new(&source) {
        println!("{:?}", tok);
    }

    println!("\n=== Lexemes ===");
    for lex in Lexer::new(&source) {
        println!("{:?}", lex);
    }
}