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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/bindings/scripts/generate_bindings.pl ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/build/scripts/list_idl_files_with_partial_interface.py
diff --git a/Source/build/scripts/list_idl_files_with_partial_interface.py b/Source/build/scripts/list_idl_files_with_partial_interface.py
index edebc517d0865c49d3060fc03041d1838c8ac9de..0b58bac433d792949d57e8824af92769e98a978f 100644
--- a/Source/build/scripts/list_idl_files_with_partial_interface.py
+++ b/Source/build/scripts/list_idl_files_with_partial_interface.py
@@ -29,16 +29,17 @@
"""This file returns a list of all the IDL files that contain a partial interface."""
import re
-import sys
-partial_interface_regex = re.compile(r'partial\s+interface\s+(\w+).+\]', re.M | re.S)
+PARTIAL_INTERFACE_RE = re.compile(r'partial\s+interface\s+(\w+)\s[^{]*\{',
+ re.MULTILINE)
+
+
+def contains_partial_interface(filename):
+ with open(filename) as f:
+ return bool(re.search(PARTIAL_INTERFACE_RE, f.read()))
def DoMain(filenames):
- partial_files = set()
- for filename in filenames:
- with open(filename) as f:
- match = re.search(partial_interface_regex, f.read())
- if match:
- partial_files.add(filename)
- return '\n'.join(partial_files)
+ partial_interface_filenames = [filename for filename in filenames
+ if contains_partial_interface(filename)]
+ return '\n'.join(partial_interface_filenames)
« 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