1
2
3
4
5
6
7
8
9
10
11
12
use crate::{CodeBuffer, Expression};

/// An element with a condition expression.
pub trait WithCondition {
    /// Gets the condition.
    fn condition(&self) -> &Box<dyn Expression>;

    /// Writes the condition.
    fn write_condition(&self, b: &mut CodeBuffer) {
        self.condition().write(b);
    }
}