| 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 """This module generates Dart APIs from the IDL database.""" | 6 """This module generates Dart APIs from the IDL database.""" |
| 7 | 7 |
| 8 import emitter | 8 import emitter |
| 9 import idlnode | 9 import idlnode |
| 10 import logging | 10 import logging |
| (...skipping 1433 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1444 comment = ' extends' | 1444 comment = ' extends' |
| 1445 if extends: | 1445 if extends: |
| 1446 extends_emitter.Emit(' extends $SUPERS', SUPERS=', '.join(extends)) | 1446 extends_emitter.Emit(' extends $SUPERS', SUPERS=', '.join(extends)) |
| 1447 comment = ',' | 1447 comment = ',' |
| 1448 if suppressed_extends: | 1448 if suppressed_extends: |
| 1449 extends_emitter.Emit(' /*$COMMENT $SUPERS */', | 1449 extends_emitter.Emit(' /*$COMMENT $SUPERS */', |
| 1450 COMMENT=comment, | 1450 COMMENT=comment, |
| 1451 SUPERS=', '.join(suppressed_extends)) | 1451 SUPERS=', '.join(suppressed_extends)) |
| 1452 | 1452 |
| 1453 if typename in _interface_factories: | 1453 if typename in _interface_factories: |
| 1454 extends_emitter.Emit(' factory $F', F=_interface_factories[typename]) | 1454 extends_emitter.Emit(' default $F', F=_interface_factories[typename]) |
| 1455 | 1455 |
| 1456 element_type = MaybeTypedArrayElementType(self._interface) | 1456 element_type = MaybeTypedArrayElementType(self._interface) |
| 1457 if element_type: | 1457 if element_type: |
| 1458 self._members_emitter.Emit( | 1458 self._members_emitter.Emit( |
| 1459 '\n' | 1459 '\n' |
| 1460 ' $CTOR(int length);\n' | 1460 ' $CTOR(int length);\n' |
| 1461 '\n' | 1461 '\n' |
| 1462 ' $CTOR.fromList(List<$TYPE> list);\n' | 1462 ' $CTOR.fromList(List<$TYPE> list);\n' |
| 1463 '\n' | 1463 '\n' |
| 1464 ' $CTOR.fromBuffer(ArrayBuffer buffer);\n', | 1464 ' $CTOR.fromBuffer(ArrayBuffer buffer);\n', |
| (...skipping 1024 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2489 Arguments: | 2489 Arguments: |
| 2490 info: An OperationInfo object. | 2490 info: An OperationInfo object. |
| 2491 """ | 2491 """ |
| 2492 # TODO(vsm): Handle overloads. | 2492 # TODO(vsm): Handle overloads. |
| 2493 self._members_emitter.Emit( | 2493 self._members_emitter.Emit( |
| 2494 '\n' | 2494 '\n' |
| 2495 ' $TYPE $NAME($ARGS) native;\n', | 2495 ' $TYPE $NAME($ARGS) native;\n', |
| 2496 TYPE=info.type_name, | 2496 TYPE=info.type_name, |
| 2497 NAME=info.name, | 2497 NAME=info.name, |
| 2498 ARGS=info.arg_implementation_declaration) | 2498 ARGS=info.arg_implementation_declaration) |
| OLD | NEW |