Index: tools/js2c.py |
diff --git a/tools/js2c.py b/tools/js2c.py |
index c2805373796f0c58f88cd2c63a2e25a6ab97637f..e5404e4133ee74288cb387bb5c5af9960b2d84c1 100755 |
--- a/tools/js2c.py |
+++ b/tools/js2c.py |
@@ -108,6 +108,9 @@ def ExpandMacroDefinition(lines, pos, name_pattern, macro, expander): |
mapping = { } |
def add_arg(str): |
# Remember to expand recursively in the arguments |
+ if arg_index[0] >= len(macro.args): |
+ lineno = lines.count(os.linesep, 0, start) + 1 |
+ raise Error('line %s: Too many arguments for macro "%s"' % (lineno, name_pattern.pattern)) |
replacement = expander(str.strip()) |
mapping[macro.args[arg_index[0]]] = replacement |
arg_index[0] += 1 |