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

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

Issue 98343005: Pepper: More IDL generator cleanup. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix for json_schema_compiler Created 7 years 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_node.py ('k') | ppapi/generators/idl_tests.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/env python 1 #!/usr/bin/env python
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2012 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 958 matching lines...) Expand 10 before | Expand all | Expand 10 after
969 969
970 970
971 # 971 #
972 # Flatten Tree 972 # Flatten Tree
973 # 973 #
974 # Flattens the tree of IDLNodes for use in testing. 974 # Flattens the tree of IDLNodes for use in testing.
975 # 975 #
976 def FlattenTree(node): 976 def FlattenTree(node):
977 add_self = False 977 add_self = False
978 out = [] 978 out = []
979 for child in node.children: 979 for child in node.GetChildren():
980 if child.IsA('Comment'): 980 if child.IsA('Comment'):
981 add_self = True 981 add_self = True
982 else: 982 else:
983 out.extend(FlattenTree(child)) 983 out.extend(FlattenTree(child))
984 984
985 if add_self: 985 if add_self:
986 out = [str(node)] + out 986 out = [str(node)] + out
987 return out 987 return out
988 988
989 989
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
1219 errs = ast.GetProperty('ERRORS') 1219 errs = ast.GetProperty('ERRORS')
1220 if errs: 1220 if errs:
1221 ErrOut.Log('Found %d error(s).' % errs); 1221 ErrOut.Log('Found %d error(s).' % errs);
1222 InfoOut.Log("%d files processed." % len(filenames)) 1222 InfoOut.Log("%d files processed." % len(filenames))
1223 return errs 1223 return errs
1224 1224
1225 1225
1226 if __name__ == '__main__': 1226 if __name__ == '__main__':
1227 sys.exit(Main(sys.argv[1:])) 1227 sys.exit(Main(sys.argv[1:]))
1228 1228
OLDNEW
« no previous file with comments | « ppapi/generators/idl_node.py ('k') | ppapi/generators/idl_tests.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698