mirror of
https://github.com/NixOS/nix
synced 2025-06-25 14:51:16 +02:00
* Keep track of the source positions of attributes.
This commit is contained in:
parent
84ce7ac76f
commit
e2d5e40f4f
8 changed files with 117 additions and 86 deletions
|
@ -28,7 +28,8 @@ static void showAttrs(EvalState & state, bool strict, Bindings & attrs,
|
|||
names.insert(i->first);
|
||||
foreach (StringSet::iterator, i, names) {
|
||||
XMLOpenElement _(doc, "attr", singletonAttrs("name", *i));
|
||||
printValueAsXML(state, strict, attrs[state.symbols.create(*i)], doc, context, drvsSeen);
|
||||
printValueAsXML(state, strict, attrs[state.symbols.create(*i)].value,
|
||||
doc, context, drvsSeen);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -71,12 +72,12 @@ static void printValueAsXML(EvalState & state, bool strict, Value & v,
|
|||
|
||||
Path drvPath;
|
||||
a = v.attrs->find(state.sDrvPath);
|
||||
if (a != v.attrs->end() && a->second.type == tString)
|
||||
xmlAttrs["drvPath"] = drvPath = a->second.string.s;
|
||||
if (a != v.attrs->end() && a->second.value.type == tString)
|
||||
xmlAttrs["drvPath"] = drvPath = a->second.value.string.s;
|
||||
|
||||
a = v.attrs->find(state.sOutPath);
|
||||
if (a != v.attrs->end() && a->second.type == tString)
|
||||
xmlAttrs["outPath"] = a->second.string.s;
|
||||
if (a != v.attrs->end() && a->second.value.type == tString)
|
||||
xmlAttrs["outPath"] = a->second.value.string.s;
|
||||
|
||||
XMLOpenElement _(doc, "derivation", xmlAttrs);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue