Browse Source

tools: fix js2c macro expansion bug

If the same macro was used twice in close proximity, the second one
didn't get expanded.
v0.11.5-release
Ben Noordhuis 11 years ago
parent
commit
457d529241
  1. 3
      tools/js2c.py

3
tools/js2c.py

@ -150,9 +150,10 @@ def ExpandMacros(lines, macros):
result = macro.expand(mapping)
# Replace the occurrence of the macro with the expansion
lines = lines[:start] + result + lines[end:]
start = lines.find(name + '(', end)
start = lines.find(name + '(', start)
return lines
class TextMacro:
def __init__(self, args, body):
self.args = args

Loading…
Cancel
Save