mirror of
https://github.com/NixOS/nix
synced 2025-06-25 10:41:16 +02:00
Support range-based for loop over list values
This commit is contained in:
parent
ca82967ee3
commit
b6c8e57056
10 changed files with 103 additions and 79 deletions
|
@ -63,9 +63,9 @@ void printValueAsJSON(EvalState & state, bool strict,
|
|||
|
||||
case nList: {
|
||||
auto list(out.list());
|
||||
for (unsigned int n = 0; n < v.listSize(); ++n) {
|
||||
for (auto elem : v.listItems()) {
|
||||
auto placeholder(list.placeholder());
|
||||
printValueAsJSON(state, strict, *v.listElems()[n], pos, placeholder, context);
|
||||
printValueAsJSON(state, strict, *elem, pos, placeholder, context);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue