Add map values
This commit is contained in:
parent
32028acab2
commit
a6a02f26e4
@ -45,7 +45,7 @@ impl<'src> AbstractTree for ValueNode<'src> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn validate(&self, _context: &Context) -> Result<(), ValidationError> {
|
fn validate(&self, _context: &Context) -> Result<(), ValidationError> {
|
||||||
todo!()
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn run(self, _context: &Context) -> Result<Value, RuntimeError> {
|
fn run(self, _context: &Context) -> Result<Value, RuntimeError> {
|
||||||
|
12
src/value.rs
12
src/value.rs
@ -133,9 +133,17 @@ impl Display for Value {
|
|||||||
Float(float) => write!(f, "{float}"),
|
Float(float) => write!(f, "{float}"),
|
||||||
Integer(integer) => write!(f, "{integer}"),
|
Integer(integer) => write!(f, "{integer}"),
|
||||||
List(_) => todo!(),
|
List(_) => todo!(),
|
||||||
Map(_) => todo!(),
|
Map(map) => {
|
||||||
|
writeln!(f, "{{")?;
|
||||||
|
|
||||||
|
for (identifier, value) in map {
|
||||||
|
writeln!(f, " {identifier} = {value}")?;
|
||||||
|
}
|
||||||
|
|
||||||
|
write!(f, "}}")
|
||||||
|
}
|
||||||
Range(_) => todo!(),
|
Range(_) => todo!(),
|
||||||
String(_) => todo!(),
|
String(string) => write!(f, "{string}"),
|
||||||
Enum(_, _) => todo!(),
|
Enum(_, _) => todo!(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user