just/src/assignment.rs
2021-06-08 01:01:27 -07:00

14 lines
344 B
Rust

use crate::common::*;
/// An assignment, e.g `foo := bar`
pub(crate) type Assignment<'src> = Binding<'src, Expression<'src>>;
impl<'src> Display for Assignment<'src> {
fn fmt(&self, f: &mut Formatter) -> Result<(), fmt::Error> {
if self.export {
write!(f, "export ")?;
}
write!(f, "{} := {}", self.name, self.value)
}
}