gbf_core/decompiler/
execution_frame.rs

1#![deny(missing_docs)]
2
3use std::fmt::Display;
4
5use serde::{Deserialize, Serialize};
6
7use super::ast::{AstKind, expr::ExprKind};
8
9/// Represents the state of execution for the decompiler.
10#[derive(Debug, PartialEq, Clone, Serialize, Deserialize)]
11pub enum ExecutionFrame {
12    /// The decompiler is currently building a standalone node.
13    StandaloneNode(AstKind),
14    /// The decompiler is currently building an array.
15    BuildingArray(Vec<ExprKind>),
16}
17
18impl Display for ExecutionFrame {
19    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
20        match self {
21            ExecutionFrame::BuildingArray(_) => write!(f, "BuildingArray"),
22            ExecutionFrame::StandaloneNode(_) => write!(f, "StandaloneNode"),
23        }
24    }
25}