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

Unified Diff: tools/idl_parser/idl_parser.py

Issue 761223002: IDL: Add error handlings to avoid infinite loops (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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/dictionary_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 9b63f94cf83cab79e32426f78f85218ab0a0ba3c..16ecc6e93615e572ee9a62fc0cfc112dbb295996 100755
--- a/tools/idl_parser/idl_parser.py
+++ b/tools/idl_parser/idl_parser.py
@@ -283,6 +283,12 @@ class IDLParser(object):
"""Dictionary : DICTIONARY error ';'"""
p[0] = self.BuildError(p, 'Dictionary')
+ # [11.2] Error recovery for regular Dictionary
+ # (for errors inside dictionary definition)
+ def p_DictionaryError2(self, p):
+ """Dictionary : DICTIONARY identifier Inheritance '{' error"""
+ p[0] = self.BuildError(p, 'Dictionary')
+
# [12]
def p_DictionaryMembers(self, p):
"""DictionaryMembers : ExtendedAttributeList DictionaryMember DictionaryMembers
@@ -590,6 +596,11 @@ class IDLParser(object):
if len(p) > 1:
p[0] = ListFromConcat(p[2], p[3])
+ # [54.1] Arguments error recovery
+ def p_ArgumentsError(self, p):
+ """Arguments : ',' error"""
+ p[0] = self.BuildError(p, 'Arguments')
+
# [55]
def p_Argument(self, p):
"""Argument : ExtendedAttributeList OptionalOrRequiredArgument"""
« no previous file with comments | « no previous file | tools/idl_parser/test_parser/dictionary_web.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698