Skip to content

Commit

Permalink
tools: fix js2c macro expansion bug
Browse files Browse the repository at this point in the history
If the same macro was used twice in close proximity, the second one
didn't get expanded.
  • Loading branch information
bnoordhuis committed Jul 24, 2013
1 parent 4b279f0 commit 457d529
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tools/js2c.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,10 @@ def add_arg(str):
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
Expand Down

0 comments on commit 457d529

Please sign in to comment.