| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # | 2 # |
| 3 # Copyright 2006-2008 the V8 project authors. All rights reserved. | 3 # Copyright 2006-2008 the V8 project authors. All rights reserved. |
| 4 # Redistribution and use in source and binary forms, with or without | 4 # Redistribution and use in source and binary forms, with or without |
| 5 # modification, are permitted provided that the following conditions are | 5 # modification, are permitted provided that the following conditions are |
| 6 # met: | 6 # met: |
| 7 # | 7 # |
| 8 # * Redistributions of source code must retain the above copyright | 8 # * Redistributions of source code must retain the above copyright |
| 9 # notice, this list of conditions and the following disclaimer. | 9 # notice, this list of conditions and the following disclaimer. |
| 10 # * Redistributions in binary form must reproduce the above | 10 # * Redistributions in binary form must reproduce the above |
| (...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 268 | 268 |
| 269 GET_DEBUGGER_SCRIPT_NAME_CASE = """\ | 269 GET_DEBUGGER_SCRIPT_NAME_CASE = """\ |
| 270 if (index == %(i)i) return Vector<const char>("%(name)s", %(length)i); | 270 if (index == %(i)i) return Vector<const char>("%(name)s", %(length)i); |
| 271 """ | 271 """ |
| 272 | 272 |
| 273 def JS2C(source, target, env): | 273 def JS2C(source, target, env): |
| 274 ids = [] | 274 ids = [] |
| 275 debugger_ids = [] | 275 debugger_ids = [] |
| 276 modules = [] | 276 modules = [] |
| 277 # Locate the macros file name. | 277 # Locate the macros file name. |
| 278 consts = {} | 278 consts = [] |
| 279 macros = {} | 279 macros = [] |
| 280 for s in source: | 280 for s in source: |
| 281 if 'macros.py' == (os.path.split(str(s))[1]): | 281 if 'macros.py' == (os.path.split(str(s))[1]): |
| 282 (consts, macros) = ReadMacros(ReadLines(str(s))) | 282 (consts, macros) = ReadMacros(ReadLines(str(s))) |
| 283 else: | 283 else: |
| 284 modules.append(s) | 284 modules.append(s) |
| 285 | 285 |
| 286 # Build source code lines | 286 # Build source code lines |
| 287 source_lines = [ ] | 287 source_lines = [ ] |
| 288 | 288 |
| 289 minifier = jsmin.JavaScriptMinifier() | 289 minifier = jsmin.JavaScriptMinifier() |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 371 | 371 |
| 372 def main(): | 372 def main(): |
| 373 natives = sys.argv[1] | 373 natives = sys.argv[1] |
| 374 natives_empty = sys.argv[2] | 374 natives_empty = sys.argv[2] |
| 375 type = sys.argv[3] | 375 type = sys.argv[3] |
| 376 source_files = sys.argv[4:] | 376 source_files = sys.argv[4:] |
| 377 JS2C(source_files, [natives, natives_empty], { 'TYPE': type }) | 377 JS2C(source_files, [natives, natives_empty], { 'TYPE': type }) |
| 378 | 378 |
| 379 if __name__ == "__main__": | 379 if __name__ == "__main__": |
| 380 main() | 380 main() |
| OLD | NEW |