From f447d2024fb50fc72ecc941b148fc3ed50858201 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Mon, 5 Nov 2012 14:40:32 -0500 Subject: [PATCH] Bug 804632. Allow certain reserved words as argument names in WebIDL. r=khuey --- dom/bindings/parser/WebIDL.py | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/dom/bindings/parser/WebIDL.py b/dom/bindings/parser/WebIDL.py index 63be534bcbc..ca50d0d35d1 100644 --- a/dom/bindings/parser/WebIDL.py +++ b/dom/bindings/parser/WebIDL.py @@ -2734,7 +2734,9 @@ class Tokenizer(object): "null": "NULL", "true": "TRUE", "false": "FALSE", + "serializer": "SERIALIZER", "stringifier": "STRINGIFIER", + "unrestricted": "UNRESTRICTED", "attribute": "ATTRIBUTE", "readonly": "READONLY", "inherit": "INHERIT", @@ -3425,7 +3427,7 @@ class Parser(Tokenizer): def p_Argument(self, p): """ - Argument : ExtendedAttributeList Optional Type Ellipsis IDENTIFIER DefaultValue + Argument : ExtendedAttributeList Optional Type Ellipsis ArgumentName DefaultValue """ t = p[3] assert isinstance(t, IDLType) @@ -3448,6 +3450,32 @@ class Parser(Tokenizer): p[0] = IDLArgument(self.getLocation(p, 5), identifier, t, optional, defaultValue, variadic) p[0].addExtendedAttributes(p[1]) + def p_ArgumentName(self, p): + """ + ArgumentName : IDENTIFIER + | ATTRIBUTE + | CALLBACK + | CONST + | CREATOR + | DELETER + | DICTIONARY + | ENUM + | EXCEPTION + | GETTER + | IMPLEMENTS + | INHERIT + | INTERFACE + | LEGACYCALLER + | PARTIAL + | SERIALIZER + | SETTER + | STATIC + | STRINGIFIER + | TYPEDEF + | UNRESTRICTED + """ + p[0] = p[1] + def p_Optional(self, p): """ Optional : OPTIONAL