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

Side by Side Diff: client/dom/scripts/idlrenderer.py

Issue 9051008: Parse 'static' qualifier in IDL. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 12 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 | « client/dom/scripts/idlparser.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/python 1 #!/usr/bin/python
2 # Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 2 # Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
3 # for details. All rights reserved. Use of this source code is governed by a 3 # for details. All rights reserved. Use of this source code is governed by a
4 # BSD-style license that can be found in the LICENSE file. 4 # BSD-style license that can be found in the LICENSE file.
5 5
6 from idlnode import * 6 from idlnode import *
7 7
8 8
9 def render(idl_node, indent_str=' '): 9 def render(idl_node, indent_str=' '):
10 output = [] 10 output = []
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 elif isinstance(node, IDLConstant): 123 elif isinstance(node, IDLConstant):
124 w(node.annotations) 124 w(node.annotations)
125 w(node.ext_attrs) 125 w(node.ext_attrs)
126 wln('const %s %s = %s;' % (node.type.id, node.id, node.value)) 126 wln('const %s %s = %s;' % (node.type.id, node.id, node.value))
127 elif isinstance(node, IDLSnippet): 127 elif isinstance(node, IDLSnippet):
128 w(node.annotations) 128 w(node.annotations)
129 wln('snippet {%s};' % node.text) 129 wln('snippet {%s};' % node.text)
130 elif isinstance(node, IDLOperation): 130 elif isinstance(node, IDLOperation):
131 w(node.annotations) 131 w(node.annotations)
132 w(node.ext_attrs) 132 w(node.ext_attrs)
133 if node.is_static:
134 w('static ')
133 if node.specials: 135 if node.specials:
134 w(node.specials, ' ') 136 w(node.specials, ' ')
135 w(' ') 137 w(' ')
136 w('%s ' % node.type.id) 138 w('%s ' % node.type.id)
137 w(node.id) 139 w(node.id)
138 w('(') 140 w('(')
139 w(node.arguments, ', ') 141 w(node.arguments, ', ')
140 wln(');') 142 wln(');')
141 elif isinstance(node, IDLArgument): 143 elif isinstance(node, IDLArgument):
142 w(node.ext_attrs) 144 w(node.ext_attrs)
143 w('in ') 145 w('in ')
144 if node.is_optional: 146 if node.is_optional:
145 w('optional ') 147 w('optional ')
146 w('%s %s' % (node.type.id, node.id)) 148 w('%s %s' % (node.type.id, node.id))
147 else: 149 else:
148 raise TypeError("Expected str or IDLNode but %s found" % 150 raise TypeError("Expected str or IDLNode but %s found" %
149 type(node)) 151 type(node))
150 152
151 w(idl_node) 153 w(idl_node)
152 return ''.join(output) 154 return ''.join(output)
OLDNEW
« no previous file with comments | « client/dom/scripts/idlparser.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698