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

Side by Side Diff: tools/idl_parser/idl_parser.py

Issue 1314443003: idl_parser: An error should be reduced to DictionaryMembers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 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 unified diff | Download patch
« no previous file with comments | « no previous file | tools/idl_parser/test_parser/dictionary_web.idl » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright (c) 2013 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2013 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 """ Parser for PPAPI IDL """ 6 """ Parser for PPAPI IDL """
7 7
8 # 8 #
9 # IDL Parser 9 # IDL Parser
10 # 10 #
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after
300 p[0] = self.BuildError(p, 'Dictionary') 300 p[0] = self.BuildError(p, 'Dictionary')
301 301
302 # [12] 302 # [12]
303 def p_DictionaryMembers(self, p): 303 def p_DictionaryMembers(self, p):
304 """DictionaryMembers : ExtendedAttributeList DictionaryMember DictionaryMemb ers 304 """DictionaryMembers : ExtendedAttributeList DictionaryMember DictionaryMemb ers
305 |""" 305 |"""
306 if len(p) > 1: 306 if len(p) > 1:
307 p[2].AddChildren(p[1]) 307 p[2].AddChildren(p[1])
308 p[0] = ListFromConcat(p[2], p[3]) 308 p[0] = ListFromConcat(p[2], p[3])
309 309
310 # [12.1] Error recovery for DictionaryMembers
311 def p_DictionaryMembersError(self, p):
312 """DictionaryMembers : ExtendedAttributeList error"""
313 p[0] = self.BuildError(p, 'DictionaryMembers')
314
310 # [13] 315 # [13]
311 def p_DictionaryMember(self, p): 316 def p_DictionaryMember(self, p):
312 """DictionaryMember : Required Type identifier Default ';'""" 317 """DictionaryMember : Required Type identifier Default ';'"""
313 p[0] = self.BuildNamed('Key', p, 3, ListFromConcat(p[1], p[2], p[4])) 318 p[0] = self.BuildNamed('Key', p, 3, ListFromConcat(p[1], p[2], p[4]))
314 319
315 # [14] 320 # [14]
316 def p_Required(self, p): 321 def p_Required(self, p):
317 """Required : REQUIRED 322 """Required : REQUIRED
318 |""" 323 |"""
319 if len(p) > 1: 324 if len(p) > 1:
(...skipping 963 matching lines...) Expand 10 before | Expand all | Expand 10 after
1283 1288
1284 print '\n'.join(ast.Tree(accept_props=['PROD'])) 1289 print '\n'.join(ast.Tree(accept_props=['PROD']))
1285 if errors: 1290 if errors:
1286 print '\nFound %d errors.\n' % errors 1291 print '\nFound %d errors.\n' % errors
1287 1292
1288 return errors 1293 return errors
1289 1294
1290 1295
1291 if __name__ == '__main__': 1296 if __name__ == '__main__':
1292 sys.exit(main(sys.argv[1:])) 1297 sys.exit(main(sys.argv[1:]))
OLDNEW
« 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