mirror of
https://github.com/tests-always-included/mo.git
synced 2025-04-07 01:16:38 +00:00
Added function to cleanup expanded after looping
This commit is contained in:
parent
5603ad4178
commit
766f3f0371
16
mo
16
mo
@ -497,6 +497,20 @@ moExpandAssoc() {
|
||||
done
|
||||
}
|
||||
|
||||
|
||||
# Internal: Cleans the values from a previous expanded assoc
|
||||
#
|
||||
# $1 - Array name
|
||||
#
|
||||
# Returns nothing.
|
||||
moCleanExpanded() {
|
||||
local moKeys moValue moValueArr
|
||||
moKeys=($(eval 'echo "${!'$1'[@]}"'))
|
||||
for k in "${moKeys[@]}"; do
|
||||
unset -v "$k"
|
||||
done
|
||||
}
|
||||
|
||||
# Internal: Scans a string to determine if all elements are declared arrays
|
||||
#
|
||||
# $1-@ - Array elements
|
||||
@ -818,6 +832,8 @@ moParse() {
|
||||
moCurContext=$(moAppendContext "$moContext" "$k" "$moValue")
|
||||
|
||||
moParse "${moBlock[0]}" "$moFullKey" false "$moCurContext"
|
||||
|
||||
moCleanExpanded "$moValue"
|
||||
done;
|
||||
else
|
||||
moParse "${moBlock[0]}" "$moCurrent" true "$moContext"
|
||||
|
Loading…
x
Reference in New Issue
Block a user