use axiom_lang::lexer::Lexer;
use axiom_lang::parser::Parser;

fn main() {
    let source = r#"
        module test {
            intent TestExploit {
                takes: exploit_code: String;
                gives: result: String;
                effect: NOOP;
                pre: length(exploit_code) > 0;
            }
        }
    "#;

    let mut lexer = Lexer::new(source);
    let tokens = lexer.tokenize().unwrap();
    let mut parser = Parser::new(tokens);
    let program = parser.parse_program().unwrap();
    
    for item in &program.module.items {
        if let axiom_lang::parser::ast::Item::Intent(intent) = item {
            println!("Intent: {}", intent.name);
            for (i, pre) in intent.clauses.pre.iter().enumerate() {
                println!("  Pre[{}]: {:?}", i, pre);
            }
        }
    }
}
