expand variable lists with prefix/suffix elements
This commit is contained in:
parent
5e42e9b868
commit
fbdc773abb
@ -55,7 +55,16 @@ module Rscons
|
||||
expand_varref.call(ent)
|
||||
end
|
||||
else
|
||||
if varref[0] == '$'
|
||||
if varref =~ /^(.*)\$\[(\w+)\](.*)$/
|
||||
# expand array with given prefix, suffix
|
||||
prefix, varname, suffix = $1, $2, $3
|
||||
varval = merged_variables[varname]
|
||||
unless varval.is_a?(Array)
|
||||
raise "Array expected for $#{varname}"
|
||||
end
|
||||
varval.map {|e| "#{prefix}#{e}#{suffix}"}
|
||||
elsif varref[0] == '$'
|
||||
# expand a single variable reference
|
||||
varname = varref[1, varref.size]
|
||||
varval = merged_variables[varname]
|
||||
if varval
|
||||
|
Loading…
x
Reference in New Issue
Block a user