code-gen 0.10.0

This library aids in code generation.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use crate::rust::Var;
use crate::{CodeBuffer, Expression};

/// An element with a variable.
pub trait WithVar {
    /// Gets the variable.
    fn var(&self) -> &Var;

    /// Writes the variable.
    fn write_var(&self, b: &mut CodeBuffer) {
        self.var().write(b);
    }
}