OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # | 2 # |
3 # Copyright 2012 the V8 project authors. All rights reserved. | 3 # Copyright 2012 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 565 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
576 | 576 |
577 | 577 |
578 def main(): | 578 def main(): |
579 parser = optparse.OptionParser() | 579 parser = optparse.OptionParser() |
580 parser.add_option("--raw", | 580 parser.add_option("--raw", |
581 help="file to write the processed sources array to.") | 581 help="file to write the processed sources array to.") |
582 parser.add_option("--startup_blob", | 582 parser.add_option("--startup_blob", |
583 help="file to write the startup blob to.") | 583 help="file to write the startup blob to.") |
584 parser.add_option("--js", | 584 parser.add_option("--js", |
585 help="writes a JS file output instead of a C file", | 585 help="writes a JS file output instead of a C file", |
586 action="store_true") | 586 action="store_true", default=False, dest='js') |
| 587 parser.add_option("--nojs", action="store_false", default=False, dest='js') |
587 parser.set_usage("""js2c out.cc type sources.js ... | 588 parser.set_usage("""js2c out.cc type sources.js ... |
588 out.cc: C code to be generated. | 589 out.cc: C code to be generated. |
589 type: type parameter for NativesCollection template. | 590 type: type parameter for NativesCollection template. |
590 sources.js: JS internal sources or macros.py.""") | 591 sources.js: JS internal sources or macros.py.""") |
591 (options, args) = parser.parse_args() | 592 (options, args) = parser.parse_args() |
592 JS2C(args[2:], | 593 JS2C(args[2:], |
593 args[0], | 594 args[0], |
594 args[1], | 595 args[1], |
595 options.raw, | 596 options.raw, |
596 options.startup_blob, | 597 options.startup_blob, |
597 options.js) | 598 options.js) |
598 | 599 |
599 | 600 |
600 if __name__ == "__main__": | 601 if __name__ == "__main__": |
601 main() | 602 main() |
OLD | NEW |