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

Side by Side Diff: Source/bindings/scripts/aggregate_generated_bindings.py

Issue 434133002: Support WebIDL's ExtendedAttributeIdentList in the Blink parser (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase Created 6 years, 4 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 | « no previous file | Source/bindings/scripts/blink_idl_parser.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/python 1 #!/usr/bin/python
2 # 2 #
3 # Copyright (C) 2009 Google Inc. All rights reserved. 3 # Copyright (C) 2009 Google Inc. All rights reserved.
4 # 4 #
5 # Redistribution and use in source and binary forms, with or without 5 # Redistribution and use in source and binary forms, with or without
6 # modification, are permitted provided that the following conditions are 6 # modification, are permitted provided that the following conditions are
7 # met: 7 # met:
8 # 8 #
9 # * Redistributions of source code must retain the above copyright 9 # * Redistributions of source code must retain the above copyright
10 # notice, this list of conditions and the following disclaimer. 10 # notice, this list of conditions and the following disclaimer.
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 113
114 def extract_conditional(idl_file_path): 114 def extract_conditional(idl_file_path):
115 """Find [Conditional] interface extended attribute.""" 115 """Find [Conditional] interface extended attribute."""
116 with open(idl_file_path) as idl_file: 116 with open(idl_file_path) as idl_file:
117 idl_contents = idl_file.read() 117 idl_contents = idl_file.read()
118 118
119 match = CONDITIONAL_PATTERN.search(idl_contents) 119 match = CONDITIONAL_PATTERN.search(idl_contents)
120 if not match: 120 if not match:
121 return None 121 return None
122 conditional = match.group(1) 122 conditional = match.group(1)
123 return re.split('([|&])', conditional) 123 return re.split('([|,])', conditional)
124 124
125 125
126 def extract_meta_data(file_paths): 126 def extract_meta_data(file_paths):
127 """Extracts conditional and interface name from each IDL file.""" 127 """Extracts conditional and interface name from each IDL file."""
128 meta_data_list = [] 128 meta_data_list = []
129 129
130 for file_path in file_paths: 130 for file_path in file_paths:
131 if not file_path.endswith('.idl'): 131 if not file_path.endswith('.idl'):
132 print 'WARNING: non-IDL file passed: "%s"' % file_path 132 print 'WARNING: non-IDL file passed: "%s"' % file_path
133 continue 133 continue
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 files_meta_data_this_partition = [ 220 files_meta_data_this_partition = [
221 meta_data for meta_data in files_meta_data 221 meta_data for meta_data in files_meta_data
222 if hash(meta_data['name']) % total_partitions == partition] 222 if hash(meta_data['name']) % total_partitions == partition]
223 file_contents = generate_content(component_dir, 223 file_contents = generate_content(component_dir,
224 files_meta_data_this_partition) 224 files_meta_data_this_partition)
225 write_content(file_contents, file_name) 225 write_content(file_contents, file_name)
226 226
227 227
228 if __name__ == '__main__': 228 if __name__ == '__main__':
229 sys.exit(main(sys.argv)) 229 sys.exit(main(sys.argv))
OLDNEW
« no previous file with comments | « no previous file | Source/bindings/scripts/blink_idl_parser.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698