projects
/
platform
/
upstream
/
nodejs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4b279f0
)
tools: fix js2c macro expansion bug
author
Ben Noordhuis
<info@bnoordhuis.nl>
Wed, 24 Jul 2013 16:13:25 +0000
(18:13 +0200)
committer
Ben Noordhuis
<info@bnoordhuis.nl>
Wed, 24 Jul 2013 19:49:34 +0000
(21:49 +0200)
If the same macro was used twice in close proximity, the second one
didn't get expanded.
tools/js2c.py
patch
|
blob
|
history
diff --git
a/tools/js2c.py
b/tools/js2c.py
index
772a0f5
..
bbbccb2
100755
(executable)
--- a/
tools/js2c.py
+++ b/
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