From 2c14abedd6aa818a38672053f18bb3f5a2496d5e Mon Sep 17 00:00:00 2001 From: AnotherTest Date: Sat, 22 Aug 2020 13:56:11 +0430 Subject: [PATCH] Shell: Do not flatten syntactic lists in for_each_entry() --- Shell/AST.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Shell/AST.cpp b/Shell/AST.cpp index b7b1da69b2b..a6a72998528 100644 --- a/Shell/AST.cpp +++ b/Shell/AST.cpp @@ -87,6 +87,16 @@ void Node::for_each_entry(RefPtr shell, Functionis_list_without_resolution()) { + auto list = value->resolve_without_cast(shell); + for (auto& element : static_cast(list.ptr())->values()) { + if (callback(element) == IterationDecision::Break) + break; + } + return; + } + auto list = value->resolve_as_list(shell); for (auto& element : list) { if (callback(create(move(element))) == IterationDecision::Break)