Commit b108a5b9 authored by peter@chromium.org's avatar peter@chromium.org

Introduce support for ExtendedAttributeIdentList in the IDL parser.

BUG=399653

Review URL: https://codereview.chromium.org/447543002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@287775 0039d316-1c4b-4281-b951-d872f2087c98
parent 18bef568
......@@ -654,15 +654,17 @@ class IDLParser(object):
# We only support:
# [ identifier ]
# [ identifier ( ArgumentList ) ]
# [ identifier = identifier ]
# [ identifier ( ArgumentList )]
# [ identifier = identifier ( ArgumentList )]
# [ identifier = ( IdentifierList ) ]
# [ identifier = identifier ( ArgumentList ) ]
# [66] map directly to [91-93, 95]
# [67-69, 71] are unsupported
def p_ExtendedAttribute(self, p):
"""ExtendedAttribute : ExtendedAttributeNoArgs
| ExtendedAttributeArgList
| ExtendedAttributeIdent
| ExtendedAttributeIdentList
| ExtendedAttributeNamedArgList"""
p[0] = p[1]
......@@ -855,7 +857,17 @@ class IDLParser(object):
else:
p[0] = p[1]
# [89-90] NOT IMPLEMENTED (IdentifierList)
# [89]
def p_IdentifierList(self, p):
"""IdentifierList : identifier Identifiers"""
p[0] = ListFromConcat(p[1], p[2])
# [90]
def p_Identifiers(self, p):
"""Identifiers : ',' identifier Identifiers
|"""
if len(p) > 1:
p[0] = ListFromConcat(p[2], p[3])
# [91]
def p_ExtendedAttributeNoArgs(self, p):
......@@ -874,7 +886,11 @@ class IDLParser(object):
value = self.BuildAttribute('VALUE', p[3])
p[0] = self.BuildNamed('ExtAttribute', p, 1, value)
# [94] NOT IMPLEMENTED (ExtendedAttributeIdentList)
# [94]
def p_ExtendedAttributeIdentList(self, p):
"""ExtendedAttributeIdentList : identifier '=' '(' IdentifierList ')'"""
value = self.BuildAttribute('VALUE', p[4])
p[0] = self.BuildNamed('ExtAttribute', p, 1, value)
# [95]
def p_ExtendedAttributeNamedArgList(self, p):
......
......@@ -239,9 +239,11 @@ class IDLPPAPIParser(IDLParser):
# We only support:
# [ identifier ]
# [ identifier = identifier ]
# [ identifier ( ArgumentList )]
# [ identifier ( ValueList )]
# [ identifier = identifier ]
# [ identifier = ( IdentifierList )]
# [ identifier = ConstValue ]
# [ identifier = identifier ( ArgumentList )]
# [51] map directly to 74-77
# [52-54, 56] are unsupported
......@@ -250,6 +252,7 @@ class IDLPPAPIParser(IDLParser):
| ExtendedAttributeArgList
| ExtendedAttributeValList
| ExtendedAttributeIdent
| ExtendedAttributeIdentList
| ExtendedAttributeIdentConst
| ExtendedAttributeNamedArgList"""
p[0] = p[1]
......
......@@ -89,3 +89,11 @@ symatics should exist. This is an exact match.
*/
[foo=1.2e-3] interface Foo {};
/* TREE
*Interface(Foo)
* ExtAttributes()
* ExtAttribute(foo)
*/
[foo=(bar, baz)] interface Foo {};
......@@ -162,3 +162,22 @@ interface MyIFaceStringifiers {
stringifier DOMString namedStringifier();
stringifier attribute DOMString stringValue;
};
/* TREE
*Interface(MyExtendedAttributeInterface)
* Operation(method)
* Arguments()
* Type()
* PrimitiveType(void)
* ExtAttributes()
* ExtAttribute(Attr)
* ExtAttribute(MethodIdentList)
* ExtAttributes()
* ExtAttribute(MyExtendedAttribute)
* ExtAttribute(MyExtendedIdentListAttribute)
*/
[MyExtendedAttribute,
MyExtendedIdentListAttribute=(Foo, Bar, Baz)]
interface MyExtendedAttributeInterface {
[Attr, MethodIdentList=(Foo, Bar)] void method();
};
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment