mylang_parser/
parse.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
mod expr;
mod program;
mod stmt;
mod term;

use itertools::put_back;
use mylang_ast::Stmt;
use mylang_token::Token;

use self::program::program;
use crate::result::ParseResult;

pub fn parse(tokens: impl Iterator<Item = Token>) -> Vec<ParseResult<Stmt>> {
    program(&mut put_back(tokens))
}