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

Side by Side Diff: tools/js2c.py

Issue 119239: Add a check to presubmit.py linting python and SCons files for trailing white... Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 years, 6 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 | « SConstruct ('k') | tools/presubmit.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 273 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 lines = CompressScript(lines, do_jsmin) 284 lines = CompressScript(lines, do_jsmin)
285 data = ToCArray(lines) 285 data = ToCArray(lines)
286 id = (os.path.split(str(s))[1])[:-3] 286 id = (os.path.split(str(s))[1])[:-3]
287 if delay: id = id[:-6] 287 if delay: id = id[:-6]
288 if delay: 288 if delay:
289 delay_ids.append((id, len(lines))) 289 delay_ids.append((id, len(lines)))
290 else: 290 else:
291 ids.append((id, len(lines))) 291 ids.append((id, len(lines)))
292 source_lines.append(SOURCE_DECLARATION % { 'id': id, 'data': data }) 292 source_lines.append(SOURCE_DECLARATION % { 'id': id, 'data': data })
293 source_lines_empty.append(SOURCE_DECLARATION % { 'id': id, 'data': 0 }) 293 source_lines_empty.append(SOURCE_DECLARATION % { 'id': id, 'data': 0 })
294 294
295 # Build delay support functions 295 # Build delay support functions
296 get_index_cases = [ ] 296 get_index_cases = [ ]
297 get_script_source_cases = [ ] 297 get_script_source_cases = [ ]
298 get_script_name_cases = [ ] 298 get_script_name_cases = [ ]
299 299
300 i = 0 300 i = 0
301 for (id, length) in delay_ids: 301 for (id, length) in delay_ids:
302 native_name = "native %s.js" % id 302 native_name = "native %s.js" % id
303 get_index_cases.append(GET_DELAY_INDEX_CASE % { 'id': id, 'i': i }) 303 get_index_cases.append(GET_DELAY_INDEX_CASE % { 'id': id, 'i': i })
304 get_script_source_cases.append(GET_DELAY_SCRIPT_SOURCE_CASE % { 304 get_script_source_cases.append(GET_DELAY_SCRIPT_SOURCE_CASE % {
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
356 356
357 def main(): 357 def main():
358 natives = sys.argv[1] 358 natives = sys.argv[1]
359 natives_empty = sys.argv[2] 359 natives_empty = sys.argv[2]
360 type = sys.argv[3] 360 type = sys.argv[3]
361 source_files = sys.argv[4:] 361 source_files = sys.argv[4:]
362 JS2C(source_files, [natives, natives_empty], { 'TYPE': type }) 362 JS2C(source_files, [natives, natives_empty], { 'TYPE': type })
363 363
364 if __name__ == "__main__": 364 if __name__ == "__main__":
365 main() 365 main()
OLDNEW
« no previous file with comments | « SConstruct ('k') | tools/presubmit.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698