gbf_core/decompiler/
execution_frame.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#![deny(missing_docs)]

use std::fmt::Display;

use super::ast::{expr::ExprKind, AstKind};

/// Represents the state of execution for the decompiler.
#[derive(Debug, PartialEq, Clone)]
pub enum ExecutionFrame {
    /// The decompiler is currently building a standalone node.
    StandaloneNode(AstKind),
    /// The decompiler is currently building an array.
    BuildingArray(Vec<ExprKind>),
    /// The decompiler is not building any partial construct.
    None,
}

impl Display for ExecutionFrame {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        match self {
            ExecutionFrame::BuildingArray(_) => write!(f, "BuildingArray"),
            ExecutionFrame::None => write!(f, "None"),
            ExecutionFrame::StandaloneNode(_) => write!(f, "StandaloneNode"),
        }
    }
}