variables: fixed parsing of function parameters containing undefined variables
Fixed parsing of e.g.:
${f🅰️${var1}:${var2}}
If var1 wasn't defined it was incorrectly parsed as:
f🅰️${var1
I.e. it resulted in invalid number of parameters error, as the
called function was missing the second parameter.
Now with bot variables undefined it parses as:
f🅰️${var1}:${var2}
I.e. it resulted in correct number of parameters even with
undefined variables.
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
This commit is contained in:
parent
f104dca756
commit
bb2fe7440d
1 changed files with 2 additions and 2 deletions
|
|
@ -43,6 +43,6 @@ class Functions():
|
|||
def expand(self, s):
|
||||
if s is None:
|
||||
return s
|
||||
r = re.compile(r'(?<!\\)\${f:([^}]+)}')
|
||||
r = re.compile(r'(?<!\\)\${f:(.*)}')
|
||||
# expand functions and convert all \${f:*} to ${f:*} (unescape)
|
||||
return re.sub(r'\\(\${f:[^}]+})', r'\1', r.sub(self.sub_func, s))
|
||||
return re.sub(r'\\(\${f:.*})', r'\1', r.sub(self.sub_func, s))
|
||||
|
|
|
|||
Loading…
Reference in a new issue