1
0
Fork 0
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:
Eelco Dolstra 2021-11-24 20:21:34 +01:00
parent ca82967ee3
commit b6c8e57056
10 changed files with 103 additions and 79 deletions

View file

@ -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;
}