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

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

Issue 261243002: Add support for [Global] / [PrimaryGlobal] IDL extended attributes (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix nit 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/bindings/scripts/generate_global_constructors.py ('k') | Source/core/frame/Window.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/scripts/utilities.py
diff --git a/Source/bindings/scripts/utilities.py b/Source/bindings/scripts/utilities.py
index 0f16281b79fb434dd877b586cb211b245dc9a9ad..70e4e847b754c04f0b9794afaf137e4bf14b2ebf 100644
--- a/Source/bindings/scripts/utilities.py
+++ b/Source/bindings/scripts/utilities.py
@@ -93,6 +93,13 @@ def get_parent_interface(file_contents):
def get_interface_extended_attributes_from_idl(file_contents):
+ # Strip comments
+ # re.compile needed b/c Python 2.6 doesn't support flags in re.sub
+ single_line_comment_re = re.compile(r'//.*$', flags=re.MULTILINE)
+ block_comment_re = re.compile(r'/\*.*?\*/', flags=re.MULTILINE | re.DOTALL)
+ 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+'
@@ -102,12 +109,8 @@ def get_interface_extended_attributes_from_idl(file_contents):
file_contents, flags=re.DOTALL)
if not match:
return {}
- # Strip comments
- # re.compile needed b/c Python 2.6 doesn't support flags in re.sub
- single_line_comment_re = re.compile(r'//.*$', flags=re.MULTILINE)
- block_comment_re = re.compile(r'/\*.*?\*/', flags=re.MULTILINE | re.DOTALL)
- extended_attributes_string = re.sub(single_line_comment_re, '', match.group(1))
- extended_attributes_string = re.sub(block_comment_re, '', extended_attributes_string)
+
+ extended_attributes_string = match.group(1)
extended_attributes = {}
# FIXME: this splitting is WRONG: it fails on ExtendedAttributeArgList like
# 'NamedConstructor=Foo(a, b)'
« no previous file with comments | « Source/bindings/scripts/generate_global_constructors.py ('k') | Source/core/frame/Window.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698