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

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

Issue 935333002: Update from https://crrev.com/316786 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 10 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 | « tools/git/move_source_file.py ('k') | tools/idl_parser/test_parser/interface_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 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 def p_CallbackRestOrInterface(self, p): 222 def p_CallbackRestOrInterface(self, p):
223 """CallbackRestOrInterface : CallbackRest 223 """CallbackRestOrInterface : CallbackRest
224 | Interface""" 224 | Interface"""
225 p[0] = p[1] 225 p[0] = p[1]
226 226
227 # [5] 227 # [5]
228 def p_Interface(self, p): 228 def p_Interface(self, p):
229 """Interface : INTERFACE identifier Inheritance '{' InterfaceMembers '}' ';' """ 229 """Interface : INTERFACE identifier Inheritance '{' InterfaceMembers '}' ';' """
230 p[0] = self.BuildNamed('Interface', p, 2, ListFromConcat(p[3], p[5])) 230 p[0] = self.BuildNamed('Interface', p, 2, ListFromConcat(p[3], p[5]))
231 231
232 # [5.1] Error recovery for interface.
233 def p_InterfaceError(self, p):
234 """Interface : INTERFACE identifier Inheritance '{' error"""
235 p[0] = self.BuildError(p, 'Interface')
236
232 # [6] 237 # [6]
233 def p_Partial(self, p): 238 def p_Partial(self, p):
234 """Partial : PARTIAL PartialDefinition""" 239 """Partial : PARTIAL PartialDefinition"""
235 p[2].AddChildren(self.BuildTrue('Partial')) 240 p[2].AddChildren(self.BuildTrue('Partial'))
236 p[0] = p[2] 241 p[0] = p[2]
237 242
238 # [6.1] Error recovery for Partial 243 # [6.1] Error recovery for Partial
239 def p_PartialError(self, p): 244 def p_PartialError(self, p):
240 """Partial : PARTIAL error""" 245 """Partial : PARTIAL error"""
241 p[0] = self.BuildError(p, 'Partial') 246 p[0] = self.BuildError(p, 'Partial')
(...skipping 956 matching lines...) Expand 10 before | Expand all | Expand 10 after
1198 1203
1199 print '\n'.join(ast.Tree(accept_props=['PROD'])) 1204 print '\n'.join(ast.Tree(accept_props=['PROD']))
1200 if errors: 1205 if errors:
1201 print '\nFound %d errors.\n' % errors 1206 print '\nFound %d errors.\n' % errors
1202 1207
1203 return errors 1208 return errors
1204 1209
1205 1210
1206 if __name__ == '__main__': 1211 if __name__ == '__main__':
1207 sys.exit(main(sys.argv[1:])) 1212 sys.exit(main(sys.argv[1:]))
OLDNEW
« no previous file with comments | « tools/git/move_source_file.py ('k') | tools/idl_parser/test_parser/interface_web.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698