| OLD | NEW |
| 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 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 if (node.type.nullable): | 170 if (node.type.nullable): |
| 171 w('?') | 171 w('?') |
| 172 w(' ') | 172 w(' ') |
| 173 w(node.id) | 173 w(node.id) |
| 174 w('(') | 174 w('(') |
| 175 w(node.arguments, ', ') | 175 w(node.arguments, ', ') |
| 176 w(')') | 176 w(')') |
| 177 wln(';') | 177 wln(';') |
| 178 elif isinstance(node, IDLArgument): | 178 elif isinstance(node, IDLArgument): |
| 179 wsp(node.ext_attrs) | 179 wsp(node.ext_attrs) |
| 180 w('in ') | |
| 181 if (node.optional): | 180 if (node.optional): |
| 182 w('optional ') | 181 w('optional ') |
| 183 w('%s %s' % (node.type.id, node.id)) | 182 w('%s %s' % (node.type.id, node.id)) |
| 184 else: | 183 else: |
| 185 raise TypeError("Expected str or IDLNode but %s found" % | 184 raise TypeError("Expected str or IDLNode but %s found" % |
| 186 type(node)) | 185 type(node)) |
| 187 | 186 |
| 188 w(idl_node) | 187 w(idl_node) |
| 189 return ''.join(output) | 188 return ''.join(output) |
| OLD | NEW |