aboutsummaryrefslogtreecommitdiff
path: root/src/libexpr/value.hh
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2023-01-03 11:44:59 -0500
committerJohn Ericson <John.Ericson@Obsidian.Systems>2023-01-10 13:10:49 -0500
commit5576d5e987e907bf13ae6c7fe79ececce4e86e2d (patch)
tree058d40aea1fc3775061a99baa838a20e09963ba6 /src/libexpr/value.hh
parentda64f026dd7b12d72ffbc15752e8b95707fa1f9f (diff)
Parse string context elements properly
Prior to this change, we had a bunch of ad-hoc string manipulation code scattered around. This made it hard to figure out what data model for string contexts is. Now, we still store string contexts most of the time as encoded strings --- I was wary of the performance implications of changing that --- but whenever we parse them we do so only through the `NixStringContextElem::parse` method, which handles all cases. This creates a data type that is very similar to `DerivedPath` but: - Represents the funky `=<drvpath>` case as properly distinct from the others. - Only encodes a single output, no wildcards and no set, for the "built" case. (I would like to deprecate `=<path>`, after which we are in spitting distance of `DerivedPath` and could maybe get away with fewer types, but that is another topic for another day.)
Diffstat (limited to 'src/libexpr/value.hh')
-rw-r--r--src/libexpr/value.hh3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/libexpr/value.hh b/src/libexpr/value.hh
index f57597cff..7d3f6d700 100644
--- a/src/libexpr/value.hh
+++ b/src/libexpr/value.hh
@@ -3,6 +3,7 @@
#include <cassert>
#include "symbol-table.hh"
+#include "value/context.hh"
#if HAVE_BOEHMGC
#include <gc/gc_allocator.h>
@@ -67,8 +68,6 @@ class XMLWriter;
typedef int64_t NixInt;
typedef double NixFloat;
-typedef std::pair<StorePath, std::string> NixStringContextElem;
-typedef std::vector<NixStringContextElem> NixStringContext;
/* External values must descend from ExternalValueBase, so that
* type-agnostic nix functions (e.g. showType) can be implemented