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

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