From deaa309f9030c91dc6513ffc8efb778b8a332444 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Mon, 4 Aug 2014 22:20:33 -0400 Subject: [PATCH] Bug 1017988 part 2. Add support for parenthesized lists as values of extended attributes in Web IDL. r=khuey --- dom/bindings/parser/WebIDL.py | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/dom/bindings/parser/WebIDL.py b/dom/bindings/parser/WebIDL.py index c464658d3a34..6d46a3a9bc83 100644 --- a/dom/bindings/parser/WebIDL.py +++ b/dom/bindings/parser/WebIDL.py @@ -4765,6 +4765,7 @@ class Parser(Tokenizer): | ExtendedAttributeArgList | ExtendedAttributeIdent | ExtendedAttributeNamedArgList + | ExtendedAttributeIdentList """ p[0] = IDLExtendedAttribute(self.getLocation(p, 1), p[1]) @@ -5239,6 +5240,34 @@ class Parser(Tokenizer): """ p[0] = (p[1], p[3], p[5]) + def p_ExtendedAttributeIdentList(self, p): + """ + ExtendedAttributeIdentList : IDENTIFIER EQUALS LPAREN IdentifierList RPAREN + """ + p[0] = (p[1], p[4]) + + def p_IdentifierList(self, p): + """ + IdentifierList : IDENTIFIER Identifiers + """ + idents = list(p[2]) + idents.insert(0, p[1]) + p[0] = idents + + def p_IdentifiersList(self, p): + """ + Identifiers : COMMA IDENTIFIER Identifiers + """ + idents = list(p[3]) + idents.insert(0, p[2]) + p[0] = idents + + def p_IdentifiersEmpty(self, p): + """ + Identifiers : + """ + p[0] = [] + def p_error(self, p): if not p: raise WebIDLError("Syntax Error at end of file. Possibly due to missing semicolon(;), braces(}) or both",