2022-06-18 21:56:31 -07:00
|
|
|
use super::*;
|
2019-11-10 23:17:47 -08:00
|
|
|
|
2021-06-08 01:01:27 -07:00
|
|
|
#[derive(Debug, Clone)]
|
2019-11-10 23:17:47 -08:00
|
|
|
pub(crate) struct Set<'src> {
|
2021-09-16 06:44:40 -07:00
|
|
|
pub(crate) name: Name<'src>,
|
2019-11-10 23:17:47 -08:00
|
|
|
pub(crate) value: Setting<'src>,
|
|
|
|
}
|
|
|
|
|
|
|
|
impl<'src> Keyed<'src> for Set<'src> {
|
|
|
|
fn key(&self) -> &'src str {
|
|
|
|
self.name.lexeme()
|
|
|
|
}
|
|
|
|
}
|
2021-06-08 01:01:27 -07:00
|
|
|
|
|
|
|
impl<'src> Display for Set<'src> {
|
2024-06-14 13:35:03 -07:00
|
|
|
fn fmt(&self, f: &mut Formatter) -> fmt::Result {
|
2021-06-08 01:01:27 -07:00
|
|
|
write!(f, "set {} := {}", self.name, self.value)
|
|
|
|
}
|
|
|
|
}
|