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

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

Issue 9388002: Add support for Chrome Apps to IDL lexer/parser (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: removed apps_tests from this CL, will put them back in when we move generators to new location in t… Created 8 years, 9 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_lexer.py ('k') | ppapi/generators/idl_option.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 """Nodes for PPAPI IDL AST""" 6 """Nodes for PPAPI IDL AST"""
7 7
8 # 8 #
9 # IDL Node 9 # IDL Node
10 # 10 #
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 is_comment = True 125 is_comment = True
126 else: 126 else:
127 is_comment = False 127 is_comment = False
128 128
129 # Skip this node if it's a comment, and we are not printing comments 129 # Skip this node if it's a comment, and we are not printing comments
130 if not comments and is_comment: return 130 if not comments and is_comment: return
131 131
132 tab = ''.rjust(depth * 2) 132 tab = ''.rjust(depth * 2)
133 133
134 if is_comment: 134 if is_comment:
135 out.write('%sComment\n' % tab)
135 for line in self.GetName().split('\n'): 136 for line in self.GetName().split('\n'):
136 out.write('%s%s\n' % (tab, line)) 137 out.write('%s "%s"\n' % (tab, line))
137 else: 138 else:
138 out.write('%s%s\n' % (tab, self)) 139 out.write('%s%s\n' % (tab, self))
139 properties = self.property_node.GetPropertyList() 140 properties = self.property_node.GetPropertyList()
140 if properties: 141 if properties:
141 out.write('%s Properties\n' % tab) 142 out.write('%s Properties\n' % tab)
142 for p in properties: 143 for p in properties:
144 if is_comment and p == 'NAME':
145 # Skip printing the name for comments, since we printed above already
146 continue
143 out.write('%s %s : %s\n' % (tab, p, self.GetProperty(p))) 147 out.write('%s %s : %s\n' % (tab, p, self.GetProperty(p)))
144 for child in self.children: 148 for child in self.children:
145 child.Dump(depth+1, comments=comments, out=out) 149 child.Dump(depth+1, comments=comments, out=out)
146 150
147 # 151 #
148 # Search related functions 152 # Search related functions
149 # 153 #
150 154
151 # Check if node is of a given type 155 # Check if node is of a given type
152 def IsA(self, *typelist): 156 def IsA(self, *typelist):
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
382 errors = StringTest() 386 errors = StringTest()
383 errors += ChildTest() 387 errors += ChildTest()
384 388
385 if errors: 389 if errors:
386 ErrOut.Log('IDLNode failed with %d errors.' % errors) 390 ErrOut.Log('IDLNode failed with %d errors.' % errors)
387 return -1 391 return -1
388 return 0 392 return 0
389 393
390 if __name__ == '__main__': 394 if __name__ == '__main__':
391 sys.exit(Main()) 395 sys.exit(Main())
OLDNEW
« no previous file with comments | « ppapi/generators/idl_lexer.py ('k') | ppapi/generators/idl_option.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698