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

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