Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(146)

Unified Diff: tools/idl_parser/idl_parser.py

Issue 329163002: IDL parser: implement Stringifier production (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: rebased Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tools/idl_parser/test_parser/interface_web.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/idl_parser/idl_parser.py
diff --git a/tools/idl_parser/idl_parser.py b/tools/idl_parser/idl_parser.py
index fabe2daa0008874928d3ddec526cc842f23acf37..a8cd82f8cf9a66fbab96071e8a1f36151f292644 100755
--- a/tools/idl_parser/idl_parser.py
+++ b/tools/idl_parser/idl_parser.py
@@ -438,15 +438,31 @@ class IDLParser(object):
p[0] = ListFromConcat(self.BuildAttribute('TYPE', 'float'),
self.BuildAttribute('VALUE', val))
- # [31] Removed unsupported: Serializer, Stringifier
+ # [31] Removed unsupported: Serializer
def p_AttributeOrOperationOrIterator(self, p):
- """AttributeOrOperationOrIterator : StaticMember
+ """AttributeOrOperationOrIterator : Stringifier
+ | StaticMember
| Attribute
| OperationOrIterator"""
p[0] = p[1]
# [32-37] NOT IMPLEMENTED (Serializer)
- # [38-39] FIXME: NOT IMPLEMENTED (Stringifier) http://crbug.com/306606
+
+ # [38]
+ def p_Stringifier(self, p):
+ """Stringifier : STRINGIFIER StringifierRest"""
+ p[0] = self.BuildProduction('Stringifier', p, 1, p[2])
+
+ # [39]
+ def p_StringifierRest(self, p):
+ """StringifierRest : AttributeRest
+ | ReturnType OperationRest
+ | ';'"""
+ if len(p) == 3:
+ p[2].AddChildren(p[1])
+ p[0] = p[2]
+ elif p[1] != ';':
+ p[0] = p[1]
# [40]
def p_StaticMember(self, p):
« no previous file with comments | « no previous file | tools/idl_parser/test_parser/interface_web.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698