Chromium Code Reviews| Index: Source/bindings/scripts/unstable/blink_idl_parser.py |
| diff --git a/Source/bindings/scripts/unstable/blink_idl_parser.py b/Source/bindings/scripts/unstable/blink_idl_parser.py |
| index 3418c9f37be371534305e553d81f77861354530d..17df1fec8717df52c7d340226fdc92445d9def43 100644 |
| --- a/Source/bindings/scripts/unstable/blink_idl_parser.py |
| +++ b/Source/bindings/scripts/unstable/blink_idl_parser.py |
| @@ -305,6 +305,7 @@ class BlinkIDLParser(IDLParser): |
| | ExtendedAttributeArgList |
| | ExtendedAttributeIdent |
| | ExtendedAttributeIdentList |
| + | ExtendedAttributeStringLiteralList |
| | ExtendedAttributeNamedArgList""" |
| p[0] = p[1] |
| @@ -371,6 +372,28 @@ class BlinkIDLParser(IDLParser): |
| else: |
| p[0] = p[1] |
| + # Blink extension: Add support for compound Extended Attribute values over string literals ("A"|"B") |
| + def p_ExtendedAttributeStringLiteralList(self, p): |
| + """ExtendedAttributeStringLiteralList : identifier '=' StringLiteralOrList""" |
| + value = self.BuildAttribute('VALUE', p[3]) |
| + p[0] = self.BuildNamed('ExtAttribute', p, 1, value) |
| + |
| + # Blink extension: one or more string literals. The values aren't propagated as literals, |
| + # but their by their value only. |
| + def p_StringLiteralOrList(self, p): |
| + """StringLiteralOrList : StringLiteral '|' StringLiteralOrList |
| + | StringLiteral""" |
| + def unwrap_string(ls): |
| + """ |
|
Nils Barth (inactive)
2014/01/09 11:24:27
One-line docstring please:
http://www.python.org/d
sof
2014/01/09 11:42:35
thanks, updated.
|
| + Reach in and grab the string literal's "NAME". |
| + """ |
| + return ls[1].value |
| + |
| + if len(p) > 3: |
| + p[0] = unwrap_string(p[1]) + p[2] + p[3] |
| + else: |
| + p[0] = unwrap_string(p[1]) |
| + |
| def __dir__(self): |
| # Remove REMOVED_RULES from listing so yacc doesn't parse them |
| # FIXME: Upstream |