aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/interpreter.cpp')
-rw-r--r--src/core/interpreter.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/core/interpreter.cpp b/src/core/interpreter.cpp
index 1b8ef0a..274d01d 100644
--- a/src/core/interpreter.cpp
+++ b/src/core/interpreter.cpp
@@ -244,6 +244,16 @@ std::string interpreter::do_replace_expansion(const std::string& name,
return value;
}
+std::string interpreter::do_array_replace_expansion(const std::string& name,
+ std::function<void(std::string&)> replacer) const
+{
+ std::vector<std::string> array;
+ resolve_array<std::string>(name, array);
+ for(auto i = array.begin(); i != array.end(); ++i)
+ replacer(*i);
+ return boost::algorithm::join(array, resolve<std::string>("IFS").substr(0, 1));
+}
+
std::string::size_type interpreter::get_length(const std::string& name,
const unsigned index) const
{