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

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

Issue 2050823003: Clean-up blink_idl_parser (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/bindings/scripts/blink_idl_parser.py ('k') | no next file » | 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 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 # [2.1] Error recovery for definition 207 # [2.1] Error recovery for definition
208 def p_DefinitionError(self, p): 208 def p_DefinitionError(self, p):
209 """Definition : error ';'""" 209 """Definition : error ';'"""
210 p[0] = self.BuildError(p, 'Definition') 210 p[0] = self.BuildError(p, 'Definition')
211 211
212 # [3] 212 # [3]
213 def p_CallbackOrInterface(self, p): 213 def p_CallbackOrInterface(self, p):
214 """CallbackOrInterface : CALLBACK CallbackRestOrInterface 214 """CallbackOrInterface : CALLBACK CallbackRestOrInterface
215 | Interface""" 215 | Interface"""
216 if len(p) > 2: 216 if len(p) > 2:
217 p[2].AddChildren(self.BuildTrue('CALLBACK'))
217 p[0] = p[2] 218 p[0] = p[2]
218 else: 219 else:
219 p[0] = p[1] 220 p[0] = p[1]
220 221
221 # [4] 222 # [4]
222 def p_CallbackRestOrInterface(self, p): 223 def p_CallbackRestOrInterface(self, p):
223 """CallbackRestOrInterface : CallbackRest 224 """CallbackRestOrInterface : CallbackRest
224 | Interface""" 225 | Interface"""
225 p[0] = p[1] 226 p[0] = p[1]
226 227
(...skipping 1071 matching lines...) Expand 10 before | Expand all | Expand 10 after
1298 1299
1299 print '\n'.join(ast.Tree(accept_props=['PROD'])) 1300 print '\n'.join(ast.Tree(accept_props=['PROD']))
1300 if errors: 1301 if errors:
1301 print '\nFound %d errors.\n' % errors 1302 print '\nFound %d errors.\n' % errors
1302 1303
1303 return errors 1304 return errors
1304 1305
1305 1306
1306 if __name__ == '__main__': 1307 if __name__ == '__main__':
1307 sys.exit(main(sys.argv[1:])) 1308 sys.exit(main(sys.argv[1:]))
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/bindings/scripts/blink_idl_parser.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698