tools: fix js2c macro expansion bug
If the same macro was used twice in close proximity, the second one didn't get expanded.
This commit is contained in:
parent
4b279f0092
commit
457d529241
@ -150,9 +150,10 @@ def ExpandMacros(lines, macros):
|
|||||||
result = macro.expand(mapping)
|
result = macro.expand(mapping)
|
||||||
# Replace the occurrence of the macro with the expansion
|
# Replace the occurrence of the macro with the expansion
|
||||||
lines = lines[:start] + result + lines[end:]
|
lines = lines[:start] + result + lines[end:]
|
||||||
start = lines.find(name + '(', end)
|
start = lines.find(name + '(', start)
|
||||||
return lines
|
return lines
|
||||||
|
|
||||||
|
|
||||||
class TextMacro:
|
class TextMacro:
|
||||||
def __init__(self, args, body):
|
def __init__(self, args, body):
|
||||||
self.args = args
|
self.args = args
|
||||||
|
Loading…
x
Reference in New Issue
Block a user