Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(310)

Side by Side Diff: runtime/tools/create_string_literal.py

Issue 8363018: use more distinctive pattern to mark where dart source goes (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 9 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/bin/builtin_in.cc ('k') | runtime/vm/corelib_impl_in.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 # Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
2 # for details. All rights reserved. Use of this source code is governed by a 2 # for details. All rights reserved. Use of this source code is governed by a
3 # BSD-style license that can be found in the LICENSE file. 3 # BSD-style license that can be found in the LICENSE file.
4 # 4 #
5 # This python script creates a string literal in a C++ source file from a C++ 5 # This python script creates a string literal in a C++ source file from a C++
6 # source template and text file. 6 # source template and text file.
7 7
8 import os 8 import os
9 import sys 9 import sys
10 from os.path import join 10 from os.path import join
(...skipping 15 matching lines...) Expand all
26 result += '\n ' 26 result += '\n '
27 lineCounter = 0 27 lineCounter = 0
28 if lineCounter != 0: 28 if lineCounter != 0:
29 result += '\n ' 29 result += '\n '
30 result += ' // Terminating null character.\n 0' 30 result += ' // Terminating null character.\n 0'
31 return result 31 return result
32 32
33 33
34 def makeFile(output_file, input_cc_file, input_files): 34 def makeFile(output_file, input_cc_file, input_files):
35 bootstrap_cc_text = open(input_cc_file).read() 35 bootstrap_cc_text = open(input_cc_file).read()
36 bootstrap_cc_text = bootstrap_cc_text % makeString(input_files) 36 bootstrap_cc_text = bootstrap_cc_text.replace("{{DART_SOURCE}}",
37 makeString(input_files))
37 open(output_file, 'w').write(bootstrap_cc_text) 38 open(output_file, 'w').write(bootstrap_cc_text)
38 return True 39 return True
39 40
40 41
41 def main(args): 42 def main(args):
42 try: 43 try:
43 # Parse input. 44 # Parse input.
44 parser = OptionParser() 45 parser = OptionParser()
45 parser.add_option("--output", 46 parser.add_option("--output",
46 action="store", type="string", 47 action="store", type="string",
(...skipping 22 matching lines...) Expand all
69 70
70 return 0 71 return 0
71 except Exception, inst: 72 except Exception, inst:
72 sys.stderr.write('create_string_literal.py exception\n') 73 sys.stderr.write('create_string_literal.py exception\n')
73 sys.stderr.write(str(inst)) 74 sys.stderr.write(str(inst))
74 sys.stderr.write('\n') 75 sys.stderr.write('\n')
75 return -1 76 return -1
76 77
77 if __name__ == '__main__': 78 if __name__ == '__main__':
78 sys.exit(main(sys.argv)) 79 sys.exit(main(sys.argv))
OLDNEW
« no previous file with comments | « runtime/bin/builtin_in.cc ('k') | runtime/vm/corelib_impl_in.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698