mirror of
https://github.com/NixOS/nix.git
synced 2025-11-25 19:51:00 +01:00
refactor: Extract EvalState::realiseString
(cherry picked from commit 7465fbe926)
This commit is contained in:
parent
2fce659c7d
commit
527e68ac3e
3 changed files with 19 additions and 5 deletions
|
|
@ -47,6 +47,15 @@ static inline Value * mkString(EvalState & state, const std::csub_match & match)
|
|||
return v;
|
||||
}
|
||||
|
||||
std::string EvalState::realiseString(Value & s, StorePathSet * storePathsOutMaybe, bool isIFD, const PosIdx pos)
|
||||
{
|
||||
nix::NixStringContext stringContext;
|
||||
auto rawStr = coerceToString(pos, s, stringContext, "while realising a string").toOwned();
|
||||
auto rewrites = realiseContext(stringContext, storePathsOutMaybe, isIFD);
|
||||
|
||||
return nix::rewriteStrings(rawStr, rewrites);
|
||||
}
|
||||
|
||||
StringMap EvalState::realiseContext(const NixStringContext & context, StorePathSet * maybePathsOut, bool isIFD)
|
||||
{
|
||||
std::vector<DerivedPath::Built> drvs;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue