pulsar_ir/
operand.rs

1// Copyright (C) 2024 Ethan Uppal. All rights reserved.
2use super::variable::Variable;
3use std::fmt::Display;
4
5#[derive(PartialEq, Eq, Hash, Clone, Copy)]
6pub enum Operand {
7    Constant(i64),
8    Variable(Variable)
9}
10
11impl Display for Operand {
12    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
13        match &self {
14            Self::Constant(value) => value.fmt(f),
15            Self::Variable(var) => var.fmt(f)
16        }
17    }
18}