1
use std::collections::HashMap;
2
use std::fmt::Display;
3

            
4
use serde::{Deserialize, Serialize};
5

            
6
use crate::ast::variables::DecisionVariable;
7
use uniplate::{Biplate, Uniplate};
8

            
9
3954
#[derive(Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
10
pub enum Name {
11
    UserName(String),
12
    MachineName(i32),
13
}
14

            
15
uniplate::derive_unplateable!(Name);
16

            
17
impl Display for Name {
18
154649
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
19
154649
        match self {
20
105910
            Name::UserName(s) => write!(f, "{}", s),
21
48739
            Name::MachineName(i) => write!(f, "__{}", i),
22
        }
23
154649
    }
24
}
25

            
26
pub type SymbolTable = HashMap<Name, DecisionVariable>;