python wml parser: fix another problem with macro-in-macro-argument
This commit is contained in:
parent
07f95b5ce7
commit
a0084fcbcc
1 changed files with 12 additions and 5 deletions
|
@ -283,11 +283,18 @@ class Parser:
|
|||
innermost macro?
|
||||
"""
|
||||
params = []
|
||||
macro = self.read_until("}")
|
||||
if macro[-1] != "}":
|
||||
raise Error(self, "Unclosed macro")
|
||||
return
|
||||
|
||||
balance = 1
|
||||
macro = ""
|
||||
while balance > 0:
|
||||
macro += self.read_until("{}")
|
||||
if macro[-1] == "{":
|
||||
balance += 1
|
||||
elif macro[-1] == "}":
|
||||
balance -= 1
|
||||
else:
|
||||
raise Error(self, "Unclosed macro")
|
||||
return
|
||||
|
||||
if self.just_parse:
|
||||
# We do not execute any macros or file inclusions.
|
||||
return None
|
||||
|
|
Loading…
Add table
Reference in a new issue