| OLD | NEW |
| 1 #!/usr/bin/python | 1 #!/usr/bin/python |
| 2 # | 2 # |
| 3 # Copyright (c) 2011 The Chromium Authors. All rights reserved. | 3 # 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 | 4 # Use of this source code is governed by a BSD-style license that can be |
| 5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
| 6 | 6 |
| 7 """ Parser for PPAPI IDL """ | 7 """ Parser for PPAPI IDL """ |
| 8 | 8 |
| 9 # | 9 # |
| 10 # IDL Parser | 10 # IDL Parser |
| (...skipping 984 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 995 ast = ParseFiles(testnames) | 995 ast = ParseFiles(testnames) |
| 996 InfoOut.SetConsole(True) | 996 InfoOut.SetConsole(True) |
| 997 | 997 |
| 998 errs = ast.GetProperty('ERRORS') | 998 errs = ast.GetProperty('ERRORS') |
| 999 if errs: | 999 if errs: |
| 1000 ErrOut.Log("Failed namespace test.") | 1000 ErrOut.Log("Failed namespace test.") |
| 1001 else: | 1001 else: |
| 1002 InfoOut.Log("Passed namespace test.") | 1002 InfoOut.Log("Passed namespace test.") |
| 1003 return errs | 1003 return errs |
| 1004 | 1004 |
| 1005 default_dirs = ['.', 'trusted', 'dev'] | 1005 default_dirs = ['.', 'trusted', 'dev', 'private'] |
| 1006 def ParseFiles(filenames): | 1006 def ParseFiles(filenames): |
| 1007 parser = IDLParser() | 1007 parser = IDLParser() |
| 1008 filenodes = [] | 1008 filenodes = [] |
| 1009 | 1009 |
| 1010 if not filenames: | 1010 if not filenames: |
| 1011 filenames = [] | 1011 filenames = [] |
| 1012 srcroot = GetOption('srcroot') | 1012 srcroot = GetOption('srcroot') |
| 1013 dirs = default_dirs | 1013 dirs = default_dirs |
| 1014 if GetOption('include_private'): | 1014 if GetOption('include_private'): |
| 1015 dirs += ['private'] | 1015 dirs += ['private'] |
| (...skipping 28 matching lines...) Expand all Loading... |
| 1044 # Otherwise, build the AST | 1044 # Otherwise, build the AST |
| 1045 ast = ParseFiles(filenames) | 1045 ast = ParseFiles(filenames) |
| 1046 errs = ast.GetProperty('ERRORS') | 1046 errs = ast.GetProperty('ERRORS') |
| 1047 if errs: | 1047 if errs: |
| 1048 ErrOut.Log('Found %d error(s).' % errs); | 1048 ErrOut.Log('Found %d error(s).' % errs); |
| 1049 InfoOut.Log("%d files processed." % len(filenames)) | 1049 InfoOut.Log("%d files processed." % len(filenames)) |
| 1050 return errs | 1050 return errs |
| 1051 | 1051 |
| 1052 if __name__ == '__main__': | 1052 if __name__ == '__main__': |
| 1053 sys.exit(Main(sys.argv[1:])) | 1053 sys.exit(Main(sys.argv[1:])) |
| OLD | NEW |