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
2085
#[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
14730
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
19
14730
        match self {
20
13350
            Name::UserName(s) => write!(f, "UserName({})", s),
21
1380
            Name::MachineName(i) => write!(f, "MachineName({})", i),
22
        }
23
14730
    }
24
}
25

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