diff options
author | Vincent Ambo <mail@tazj.in> | 2022-08-09T14·08+0300 |
---|---|---|
committer | clbot <clbot@tvl.fyi> | 2022-08-13T15·35+0000 |
commit | c67747cbe126649057e47f2f4756645a553e682e (patch) | |
tree | 7dfabb036df54145d2b0eb0336ad53b494a43aa0 /tvix/eval/src/value/mod.rs | |
parent | 6f13c16f28de01209c92e9b9415b68b00b913894 (diff) |
feat(tvix/value): add runtime representation of simple lists r/4429
There might be more logic in the future to encapsulate different backing implementations of lists as well. Change-Id: Ib7064fab48bf88b0c8913b0ecfa2108177c7c9fd Reviewed-on: https://cl.tvl.fyi/c/depot/+/6093 Tested-by: BuildkiteCI Reviewed-by: grfn <grfn@gws.fyi> Autosubmit: tazjin <tazjin@tvl.su>
Diffstat (limited to 'tvix/eval/src/value/mod.rs')
-rw-r--r-- | tvix/eval/src/value/mod.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tvix/eval/src/value/mod.rs b/tvix/eval/src/value/mod.rs index 56f8620d3a58..d00fc56e2a73 100644 --- a/tvix/eval/src/value/mod.rs +++ b/tvix/eval/src/value/mod.rs @@ -4,10 +4,12 @@ use std::fmt::Display; use std::rc::Rc; mod attrs; +mod list; mod string; use crate::errors::{Error, EvalResult}; pub use attrs::NixAttrs; +pub use list::NixList; pub use string::NixString; #[derive(Clone, Debug, PartialEq)] @@ -18,6 +20,7 @@ pub enum Value { Float(f64), String(NixString), Attrs(Rc<NixAttrs>), + List(NixList), } impl Value { @@ -37,6 +40,7 @@ impl Value { Value::Float(_) => "float", Value::String(_) => "string", Value::Attrs(_) => "set", + Value::List(_) => "list", } } @@ -71,6 +75,7 @@ impl Display for Value { Value::Float(num) => f.write_fmt(format_args!("{}", num)), Value::String(s) => s.fmt(f), Value::Attrs(attrs) => attrs.fmt(f), + Value::List(list) => list.fmt(f), } } } |