| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 /** | 5 /** |
| 6 * Data structures representing an API definition, and visitor base classes | 6 * Data structures representing an API definition, and visitor base classes |
| 7 * for visiting those data structures. | 7 * for visiting those data structures. |
| 8 */ | 8 */ |
| 9 import 'dart:collection'; | 9 import 'dart:collection'; |
| 10 | 10 |
| (...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 351 accept(ApiVisitor visitor); | 351 accept(ApiVisitor visitor); |
| 352 } | 352 } |
| 353 | 353 |
| 354 /** | 354 /** |
| 355 * Description of a named type definition. | 355 * Description of a named type definition. |
| 356 */ | 356 */ |
| 357 class TypeDefinition extends ApiNode { | 357 class TypeDefinition extends ApiNode { |
| 358 final String name; | 358 final String name; |
| 359 final TypeDecl type; | 359 final TypeDecl type; |
| 360 | 360 |
| 361 bool isExternal = false; |
| 362 |
| 361 TypeDefinition(this.name, this.type, dom.Element html, | 363 TypeDefinition(this.name, this.type, dom.Element html, |
| 362 {bool experimental, bool deprecated}) | 364 {bool experimental, bool deprecated}) |
| 363 : super(html, experimental, deprecated); | 365 : super(html, experimental, deprecated); |
| 364 } | 366 } |
| 365 | 367 |
| 366 /** | 368 /** |
| 367 * Type of an enum. We represent enums in JSON as strings, so this type | 369 * Type of an enum. We represent enums in JSON as strings, so this type |
| 368 * declaration simply lists the allowed values. | 370 * declaration simply lists the allowed values. |
| 369 */ | 371 */ |
| 370 class TypeEnum extends TypeDecl { | 372 class TypeEnum extends TypeDecl { |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 485 @override | 487 @override |
| 486 accept(ApiVisitor visitor) => visitor.visitTypeReference(this); | 488 accept(ApiVisitor visitor) => visitor.visitTypeReference(this); |
| 487 } | 489 } |
| 488 | 490 |
| 489 /** | 491 /** |
| 490 * A collection of type definitions. | 492 * A collection of type definitions. |
| 491 */ | 493 */ |
| 492 class Types extends ApiNode with IterableMixin<TypeDefinition> { | 494 class Types extends ApiNode with IterableMixin<TypeDefinition> { |
| 493 final Map<String, TypeDefinition> types; | 495 final Map<String, TypeDefinition> types; |
| 494 | 496 |
| 497 List<String> importUris = <String>[]; |
| 498 |
| 495 Types(this.types, dom.Element html, {bool experimental}) | 499 Types(this.types, dom.Element html, {bool experimental}) |
| 496 : super(html, experimental, false); | 500 : super(html, experimental, false); |
| 497 | 501 |
| 498 @override | 502 @override |
| 499 Iterator<TypeDefinition> get iterator => types.values.iterator; | 503 Iterator<TypeDefinition> get iterator => types.values.iterator; |
| 500 | 504 |
| 501 Iterable<String> get keys => types.keys; | 505 Iterable<String> get keys => types.keys; |
| 502 | 506 |
| 503 TypeDefinition operator [](String typeName) => types[typeName]; | 507 TypeDefinition operator [](String typeName) => types[typeName]; |
| 504 | 508 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 515 * The field that is used to disambiguate this union | 519 * The field that is used to disambiguate this union |
| 516 */ | 520 */ |
| 517 final String field; | 521 final String field; |
| 518 | 522 |
| 519 TypeUnion(this.choices, this.field, dom.Element html, {bool experimental}) | 523 TypeUnion(this.choices, this.field, dom.Element html, {bool experimental}) |
| 520 : super(html, experimental, false); | 524 : super(html, experimental, false); |
| 521 | 525 |
| 522 @override | 526 @override |
| 523 accept(ApiVisitor visitor) => visitor.visitTypeUnion(this); | 527 accept(ApiVisitor visitor) => visitor.visitTypeUnion(this); |
| 524 } | 528 } |
| OLD | NEW |