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

Side by Side Diff: ppapi/generators/idl_lexer.py

Issue 8653004: Fix python scripts in src/ppapi/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase error Created 8 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « ppapi/generators/idl_generator.py ('k') | ppapi/generators/idl_lint.py » ('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/python 1 #!/usr/bin/env python
2 #
3 # Copyright (c) 2011 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2011 The Chromium Authors. All rights reserved.
4 # 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
5 # found in the LICENSE file. 4 # found in the LICENSE file.
6 5
7 """ Lexer for PPAPI IDL """ 6 """ Lexer for PPAPI IDL """
8 7
9 # 8 #
10 # IDL Lexer 9 # IDL Lexer
11 # 10 #
12 # The lexer is uses the PLY lex library to build a tokenizer which understands 11 # The lexer is uses the PLY lex library to build a tokenizer which understands
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 errors += 1 300 errors += 1
302 301
303 if not errors: 302 if not errors:
304 sys.stdout.write('Expect: Pass\n') 303 sys.stdout.write('Expect: Pass\n')
305 return 0 304 return 0
306 305
307 sys.stdout.write('Expect: Failed\n') 306 sys.stdout.write('Expect: Failed\n')
308 return -1 307 return -1
309 308
310 309
311
312
313 def Main(args): 310 def Main(args):
314 filenames = ParseOptions(args) 311 filenames = ParseOptions(args)
315 312
316 try: 313 try:
317 tokens = FilesToTokens(filenames, GetOption('verbose')) 314 tokens = FilesToTokens(filenames, GetOption('verbose'))
318 values = [tok.value for tok in tokens] 315 values = [tok.value for tok in tokens]
319 if GetOption('output'): sys.stdout.write(' <> '.join(values) + '\n') 316 if GetOption('output'): sys.stdout.write(' <> '.join(values) + '\n')
320 if GetOption('test'): 317 if GetOption('test'):
321 if TestSame(values): 318 if TestSame(values):
322 return -1 319 return -1
323 if TestExpect(tokens): 320 if TestExpect(tokens):
324 return -1 321 return -1
325 return 0 322 return 0
326 323
327 except lex.LexError as le: 324 except lex.LexError as le:
328 sys.stderr.write('%s\n' % str(le)) 325 sys.stderr.write('%s\n' % str(le))
329 return -1 326 return -1
330 327
328
331 if __name__ == '__main__': 329 if __name__ == '__main__':
332 sys.exit(Main(sys.argv[1:])) 330 sys.exit(Main(sys.argv[1:]))
OLDNEW
« no previous file with comments | « ppapi/generators/idl_generator.py ('k') | ppapi/generators/idl_lint.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698