about summary refs log tree commit diff
path: root/src/parse/ast/mod.rs
blob: 93944b257550f7a444907d40b8e763dd47adb385 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
use std::fmt::Display;

use self::statement::Statement;

pub mod expression;
pub mod statement;
pub mod nodes;

#[derive(Debug)]
pub struct Program {
    pub statements: Vec<Statement>,
}

impl Display for Program {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        for statement in self.statements.iter() {
            writeln!(f, "{}", statement)?;
        }
        Ok(())
    }
}