1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// Copyright (C) 2024 Ethan Uppal. All rights reserved.
use pulsar_utils::id::{Gen, Id};
use std::fmt::Display;

#[derive(PartialEq, Eq, Hash, Clone, Copy)]
pub struct Variable {
    id: Id
}

impl Variable {
    pub fn new() -> Self {
        Self {
            id: Gen::next("IR variable")
        }
    }
}

impl Display for Variable {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        write!(f, "i{}", self.id)
    }
}