protospec-build 0.3.0

One binary format language to rule them all, One binary format language to find them, One binary format language to bring them all and in the darkness bind them.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use super::*;

#[derive(PartialEq, Clone, Debug)]
pub struct EnumAccessExpression {
    pub enum_field: Arc<Field>,
    pub variant: Arc<Const>,
    pub span: Span,
}

impl AsgExpression for EnumAccessExpression {
    fn get_type(&self) -> Option<Type> {
        match &*self.enum_field.type_.borrow() {
            Type::Enum(e) => Some(Type::Scalar(e.rep)),
            Type::Bitfield(e) => Some(Type::Scalar(e.rep)),
            _ => None,
        }
    }
}