1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
use crate::resources::Instruction;

#[derive(Eq, Ord, PartialOrd, PartialEq, Debug, Clone)]
pub struct Group {
    pub label: String,
    pub insts: Vec<Instruction>,
}

impl Group {
    pub fn new(label: &str) -> Self {
        assert!(label.starts_with(".L"), "label name must start with '.L'");

        Self {
            label: label.to_string(),
            insts: Vec::new(),
        }
    }
}

impl Default for Group {
    fn default() -> Self {
        Self {
            label: String::new(),
            insts: Vec::new(),
        }
    }
}