//! Basic parsing example.
//!
//! Run with: `cargo run --example parse_basic`

use slash_lang::parser::parse;

fn main() {
    let inputs = [
        "/build",
        "/Build",
        "/BUILD",
        "/run-tests",
        "/run_slow",
        "/deploy!",
        "/check!!",
        "/lint!!!",
        "/verbose+",
        "/quiet--",
        "/maybe?",
    ];

    for input in &inputs {
        match parse(input) {
            Ok(program) => {
                let cmd = &program.pipelines[0].commands[0];
                println!(
                    "{:<16} → name={:<12} priority={:?}  urgency={:?}  verbosity={:+}  optional={}",
                    input, cmd.name, cmd.priority, cmd.urgency, cmd.verbosity, cmd.optional,
                );
            }
            Err(e) => println!("{:<16} → ERROR: {:?}", input, e),
        }
    }
}
