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

Unified Diff: third_party/WebKit/Source/bindings/scripts/utilities.py

Issue 2397363002: Replace hand-written IDBObserverCallback with auto-generated code (Closed)
Patch Set: rebase Created 4 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 | « third_party/WebKit/Source/bindings/modules/v8/v8.gni ('k') | third_party/WebKit/Source/modules/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/bindings/scripts/utilities.py
diff --git a/third_party/WebKit/Source/bindings/scripts/utilities.py b/third_party/WebKit/Source/bindings/scripts/utilities.py
index 01c56d08f058c14d491acab0d3b608d1ea88457c..a06ff244e0d5792ce50af0e980ce6edf71719d25 100644
--- a/third_party/WebKit/Source/bindings/scripts/utilities.py
+++ b/third_party/WebKit/Source/bindings/scripts/utilities.py
@@ -334,8 +334,9 @@ def write_pickle_file(pickle_filename, data):
################################################################################
# IDL parsing
#
-# We use regular expressions for parsing; this is incorrect (Web IDL is not a
-# regular language), but simple and sufficient in practice.
+# TODO(bashi): We use regular expressions for parsing; this is incorrect
+# (Web IDL is not a regular language) and broken. Remove these functions and
+# always use the parser and ASTs.
# Leading and trailing context (e.g. following '{') used to avoid false matches.
################################################################################
@@ -360,16 +361,15 @@ def match_interface_extended_attributes_from_idl(file_contents):
file_contents = re.sub(single_line_comment_re, '', file_contents)
file_contents = re.sub(block_comment_re, '', file_contents)
- match = re.search(r'\[(.*)\]\s*'
- r'((callback|partial)\s+)?'
- r'(interface|exception)\s+'
- r'\w+\s*'
- r'(:\s*\w+\s*)?'
- r'{',
- file_contents, flags=re.DOTALL)
+ match = re.search(
+ r'\[([^[]*)\]\s*'
+ r'(interface|callback\s+interface|partial\s+interface|exception)\s+'
+ r'\w+\s*'
+ r'(:\s*\w+\s*)?'
+ r'{',
+ file_contents, flags=re.DOTALL)
return match
-
def get_interface_extended_attributes_from_idl(file_contents):
match = match_interface_extended_attributes_from_idl(file_contents)
if not match:
« no previous file with comments | « third_party/WebKit/Source/bindings/modules/v8/v8.gni ('k') | third_party/WebKit/Source/modules/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698