Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | |
| 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. | |
| 4 | |
| 5 library fasta.metadata_builder; | |
| 6 | |
| 7 import 'builder.dart' show | |
| 8 Builder, | |
| 9 TypeBuilder; | |
| 10 | |
| 11 import 'constructor_reference_builder.dart' show | |
| 12 ConstructorReferenceBuilder; | |
| 13 | |
| 14 abstract class MetadataBuilder<T extends TypeBuilder> extends Builder { | |
| 15 MetadataBuilder(); | |
| 16 | |
| 17 factory MetadataBuilder.fromConstructor( | |
| 18 ConstructorReferenceBuilder constructorReference, List arguments) { | |
| 19 return new ConstructorMetadataBuilder(constructorReference, arguments); | |
| 20 } | |
| 21 | |
| 22 factory MetadataBuilder.fromExpression(String expression, String postfix) { | |
| 23 return new ExpressionMetadataBuilder(expression, postfix); | |
| 24 } | |
| 25 } | |
| 26 | |
| 27 class ConstructorMetadataBuilder<T extends TypeBuilder> | |
| 28 extends MetadataBuilder<T> { | |
| 29 final ConstructorReferenceBuilder constructorReference; | |
| 30 | |
| 31 final List arguments; | |
| 32 | |
| 33 ConstructorMetadataBuilder(this.constructorReference, this.arguments); | |
| 34 } | |
| 35 | |
| 36 class ExpressionMetadataBuilder<T extends TypeBuilder> | |
| 37 extends MetadataBuilder<T> { | |
| 38 final String expression; | |
|
Johnni Winther
2017/01/16 13:01:19
Why use String?
ahe
2017/01/16 15:26:33
I generally use Strings to represent identifiers.
| |
| 39 | |
| 40 final String postfix; | |
|
Johnni Winther
2017/01/16 13:01:19
What is this?
ahe
2017/01/16 15:26:33
I've changed this to:
/// Expression metadata (wi
| |
| 41 | |
| 42 ExpressionMetadataBuilder(this.expression, this.postfix); | |
| 43 } | |
| OLD | NEW |