1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
use sway_error::handler::ErrorEmitted;

use super::{lexed::LexedProgram, parsed::ParseProgram, ty::TyProgram};

/// Contains the lexed, parsed, and typed compilation stages of a program.
pub struct Programs {
    pub lexed: LexedProgram,
    pub parsed: ParseProgram,
    pub typed: Result<TyProgram, ErrorEmitted>,
}

impl Programs {
    pub fn new(
        lexed: LexedProgram,
        parsed: ParseProgram,
        typed: Result<TyProgram, ErrorEmitted>,
    ) -> Programs {
        Programs {
            lexed,
            parsed,
            typed,
        }
    }
}