OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright 2014 the V8 project authors. All rights reserved. | 2 # Copyright 2014 the V8 project authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 import js2c | 6 import js2c |
7 import os | 7 import os |
8 import re | 8 import re |
9 import sys | 9 import sys |
10 | 10 |
11 FILENAME = "src/runtime/runtime.h" | 11 FILENAME = "src/runtime/runtime.h" |
12 LISTHEAD = re.compile(r"#define\s+(\w+LIST\w*)\((\w+)\)") | 12 LISTHEAD = re.compile(r"#define\s+(FOR_EACH_\w+)\((\w+)\)") |
13 LISTBODY = re.compile(r".*\\$") | 13 LISTBODY = re.compile(r".*\\$") |
14 | 14 |
15 | 15 |
16 class Function(object): | 16 class Function(object): |
17 def __init__(self, match): | 17 def __init__(self, match): |
18 self.name = match.group(1).strip() | 18 self.name = match.group(1).strip() |
19 | 19 |
20 def ListMacroRe(list): | 20 def ListMacroRe(list): |
21 macro = LISTHEAD.match(list[0]).group(2) | 21 macro = LISTHEAD.match(list[0]).group(2) |
22 re_string = "\s*%s\((\w+)" % macro | 22 re_string = "\s*%s\((\w+)" % macro |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 | 109 |
110 if errors > 0: | 110 if errors > 0: |
111 return 1 | 111 return 1 |
112 print("Runtime/Natives name clashes: checked %d/%d functions, all good." % | 112 print("Runtime/Natives name clashes: checked %d/%d functions, all good." % |
113 (len(functions), len(natives))) | 113 (len(functions), len(natives))) |
114 return 0 | 114 return 0 |
115 | 115 |
116 | 116 |
117 if __name__ == "__main__": | 117 if __name__ == "__main__": |
118 sys.exit(Main()) | 118 sys.exit(Main()) |
OLD | NEW |