use crate::lexer::Token; pub struct Parser { tokens: Box>, current: Option, indentation_level: usize, } impl Parser { pub(crate) fn new(tokens: impl Iterator + 'static) -> Self { Parser { tokens: Box::new(tokens), current: None, indentation_level: 0, } } fn next(&mut self) { self.current = self.tokens.next(); } } #[derive(Debug)] pub struct AST; pub fn parse(tokens: impl Iterator + 'static) -> AST { let mut parser = Parser::new(tokens); let ast = AST {}; loop { parser.next(); break; } ast }