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

Side by Side Diff: Source/build/scripts/list_idl_files_with_partial_interface.py

Issue 29323008: Fix IDL dependency computation for partial interfaces (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Reupload 4 Created 7 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 | « Source/bindings/scripts/generate_bindings.pl ('k') | no next file » | 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) 2013 Google Inc. All rights reserved. 1 # Copyright (C) 2013 Google Inc. All rights reserved.
2 # 2 #
3 # Redistribution and use in source and binary forms, with or without 3 # Redistribution and use in source and binary forms, with or without
4 # modification, are permitted provided that the following conditions are 4 # modification, are permitted provided that the following conditions are
5 # met: 5 # met:
6 # 6 #
7 # * Redistributions of source code must retain the above copyright 7 # * Redistributions of source code must retain the above copyright
8 # notice, this list of conditions and the following disclaimer. 8 # notice, this list of conditions and the following disclaimer.
9 # * Redistributions in binary form must reproduce the above 9 # * Redistributions in binary form must reproduce the above
10 # copyright notice, this list of conditions and the following disclaimer 10 # copyright notice, this list of conditions and the following disclaimer
(...skipping 11 matching lines...) Expand all
22 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 22 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 28
29 """This file returns a list of all the IDL files that contain a partial interfac e.""" 29 """This file returns a list of all the IDL files that contain a partial interfac e."""
30 30
31 import re 31 import re
32 import sys
33 32
34 partial_interface_regex = re.compile(r'partial\s+interface\s+(\w+).+\]', re.M | re.S) 33 PARTIAL_INTERFACE_RE = re.compile(r'partial\s+interface\s+(\w+)\s[^{]*\{',
34 re.MULTILINE)
35
36
37 def contains_partial_interface(filename):
38 with open(filename) as f:
39 return bool(re.search(PARTIAL_INTERFACE_RE, f.read()))
35 40
36 41
37 def DoMain(filenames): 42 def DoMain(filenames):
38 partial_files = set() 43 partial_interface_filenames = [filename for filename in filenames
39 for filename in filenames: 44 if contains_partial_interface(filename)]
40 with open(filename) as f: 45 return '\n'.join(partial_interface_filenames)
41 match = re.search(partial_interface_regex, f.read())
42 if match:
43 partial_files.add(filename)
44 return '\n'.join(partial_files)
OLDNEW
« no previous file with comments | « Source/bindings/scripts/generate_bindings.pl ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698