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

Side by Side Diff: tools/json_schema_compiler/idl_schema.py

Issue 273323002: Convert snakecase enum names to camelcase when stringified. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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
OLDNEW
1 #! /usr/bin/env python 1 #! /usr/bin/env python
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2012 The Chromium 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 itertools 6 import itertools
7 import json 7 import json
8 import os.path 8 import os.path
9 import re 9 import re
10 import sys 10 import sys
(...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after
431 description = node.GetName() 431 description = node.GetName()
432 elif node.cls == 'ExtAttribute': 432 elif node.cls == 'ExtAttribute':
433 if node.name == 'nodoc': 433 if node.name == 'nodoc':
434 nodoc = bool(node.value) 434 nodoc = bool(node.value)
435 elif node.name == 'internal': 435 elif node.name == 'internal':
436 internal = bool(node.value) 436 internal = bool(node.value)
437 elif node.name == 'platforms': 437 elif node.name == 'platforms':
438 platforms = list(node.value) 438 platforms = list(node.value)
439 elif node.name == 'implemented_in': 439 elif node.name == 'implemented_in':
440 compiler_options = {'implemented_in': node.value} 440 compiler_options = {'implemented_in': node.value}
441 elif node.name == 'camel_case_enum_to_string':
442 compiler_options = {'camel_case_enum_to_string': node.value}
not at google - send to devlin 2014/05/13 18:36:35 this means that an API can't specify more than one
David Tseng 2014/05/13 20:10:17 Done.
441 elif node.name == 'deprecated': 443 elif node.name == 'deprecated':
442 deprecated = str(node.value) 444 deprecated = str(node.value)
443 else: 445 else:
444 continue 446 continue
445 else: 447 else:
446 sys.exit('Did not process %s %s' % (node.cls, node)) 448 sys.exit('Did not process %s %s' % (node.cls, node))
447 return namespaces 449 return namespaces
448 450
449 451
450 def Load(filename): 452 def Load(filename):
(...skipping 16 matching lines...) Expand all
467 Dump a json serialization of parse result for the IDL files whose names 469 Dump a json serialization of parse result for the IDL files whose names
468 were passed in on the command line. 470 were passed in on the command line.
469 ''' 471 '''
470 for filename in sys.argv[1:]: 472 for filename in sys.argv[1:]:
471 schema = Load(filename) 473 schema = Load(filename)
472 print json.dumps(schema, indent=2) 474 print json.dumps(schema, indent=2)
473 475
474 476
475 if __name__ == '__main__': 477 if __name__ == '__main__':
476 Main() 478 Main()
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698