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
use super::*;

#[derive(PartialEq, Clone, Debug)]
pub struct TernaryExpression {
    pub condition: Box<Expression>,
    pub if_true: Box<Expression>,
    pub if_false: Box<Expression>,
    pub span: Span,
}

impl AsgExpression for TernaryExpression {
    fn get_type(&self) -> Option<Type> {
        self.if_true.get_type().or_else(|| self.if_false.get_type())
    }
}