Bug 1017988 part 2. Add support for parenthesized lists as values of extended attributes in Web IDL. r=khuey

This commit is contained in:
Boris Zbarsky 2014-08-04 22:20:33 -04:00
Родитель 82495c5d72
Коммит deaa309f90
1 изменённых файлов: 29 добавлений и 0 удалений

Просмотреть файл

@ -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",