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

Unified Diff: lib/dom/scripts/idlparser.py

Issue 10591002: Properly parse IDL arrays. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Next it Created 8 years, 6 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 | « lib/dom/scripts/idlnode.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/dom/scripts/idlparser.py
diff --git a/lib/dom/scripts/idlparser.py b/lib/dom/scripts/idlparser.py
index c2470c077aacab48ab9ed6544d3a066e5763e371..8e9c738523bfc7c1d97755a1dee67d169d3860be 100755
--- a/lib/dom/scripts/idlparser.py
+++ b/lib/dom/scripts/idlparser.py
@@ -283,12 +283,15 @@ class IDLParser(object):
def InterfaceType():
return ScopedName
+ def ArrayModifiers():
+ return re.compile(r'(\[\])+')
+
def _Type():
- return OR(AnyArrayType, AnyType, ObjectType, _NullableType)
+ return [OR(AnyType, ObjectType, _NullableType), MAYBE(ArrayModifiers)]
def _NullableType():
return [OR(_IntegerType, BooleanType, OctetType, FloatType,
- DoubleType, SequenceType, DOMStringArrayType, ScopedName),
+ DoubleType, SequenceType, ScopedName),
MAYBE(Nullable)]
def Nullable():
@@ -300,10 +303,6 @@ class IDLParser(object):
def AnyType():
return 'any'
- def AnyArrayType():
- # TODO(sra): Do more general handling of array types.
- return 'any[]'
-
def ObjectType():
return re.compile(r'(object|Object)\b') # both spellings.
@@ -350,9 +349,6 @@ class IDLParser(object):
def ScopedName():
return re.compile(r'[\w\_\:\.\<\>]+')
- def DOMStringArrayType():
- return 'DOMString[]'
-
# Extended Attributes:
def ExtAttrs():
return ['[', MAYBE(MANY(ExtAttr, ',')), ']']
« no previous file with comments | « lib/dom/scripts/idlnode.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698