OLD | NEW |
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 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 | 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 library fasta.dill_library_builder; | 5 library fasta.dill_library_builder; |
6 | 6 |
| 7 import 'package:front_end/src/fasta/dill/dill_typedef_builder.dart'; |
7 import 'package:kernel/ast.dart' | 8 import 'package:kernel/ast.dart' |
8 show | 9 show |
9 Class, | 10 Class, |
10 ExpressionStatement, | 11 ExpressionStatement, |
11 Field, | 12 Field, |
12 FunctionNode, | 13 FunctionNode, |
13 Let, | 14 Let, |
14 Library, | 15 Library, |
15 ListLiteral, | 16 ListLiteral, |
16 Member, | 17 Member, |
17 Procedure, | 18 Procedure, |
18 StaticGet; | 19 StaticGet, |
| 20 Typedef; |
19 | 21 |
20 import '../errors.dart' show internalError; | 22 import '../errors.dart' show internalError; |
21 | 23 |
22 import '../kernel/kernel_builder.dart' | 24 import '../kernel/kernel_builder.dart' |
23 show | 25 show |
24 Builder, | 26 Builder, |
25 KernelInvalidTypeBuilder, | 27 KernelInvalidTypeBuilder, |
26 KernelTypeBuilder, | 28 KernelTypeBuilder, |
27 LibraryBuilder, | 29 LibraryBuilder, |
28 Scope; | 30 Scope; |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 if (!name.startsWith("_")) { | 99 if (!name.startsWith("_")) { |
98 if (isSetter) { | 100 if (isSetter) { |
99 exportScopeBuilder.addSetter(name, builder); | 101 exportScopeBuilder.addSetter(name, builder); |
100 } else { | 102 } else { |
101 exportScopeBuilder.addMember(name, builder); | 103 exportScopeBuilder.addMember(name, builder); |
102 } | 104 } |
103 } | 105 } |
104 return builder; | 106 return builder; |
105 } | 107 } |
106 | 108 |
| 109 void addTypedef(Typedef typedef) { |
| 110 var typedefBuilder = new DillFunctionTypeAliasBuilder(typedef, this); |
| 111 addBuilder(typedef.name, typedefBuilder, typedef.fileOffset); |
| 112 } |
| 113 |
107 bool addToExportScope(String name, Builder member) { | 114 bool addToExportScope(String name, Builder member) { |
108 return internalError("Not implemented yet."); | 115 return internalError("Not implemented yet."); |
109 } | 116 } |
110 | 117 |
111 @override | 118 @override |
112 void addToScope(String name, Builder member, int charOffset, bool isImport) { | 119 void addToScope(String name, Builder member, int charOffset, bool isImport) { |
113 internalError("Not implemented yet."); | 120 internalError("Not implemented yet."); |
114 } | 121 } |
115 | 122 |
116 @override | 123 @override |
117 Builder buildAmbiguousBuilder( | 124 Builder buildAmbiguousBuilder( |
118 String name, Builder builder, Builder other, int charOffset, | 125 String name, Builder builder, Builder other, int charOffset, |
119 {bool isExport: false, bool isImport: false}) { | 126 {bool isExport: false, bool isImport: false}) { |
120 return new KernelInvalidTypeBuilder(name, charOffset, fileUri); | 127 return new KernelInvalidTypeBuilder(name, charOffset, fileUri); |
121 } | 128 } |
122 | 129 |
123 @override | 130 @override |
124 String get fullNameForErrors { | 131 String get fullNameForErrors { |
125 return library.name ?? "<library '${library.fileUri}'>"; | 132 return library.name ?? "<library '${library.fileUri}'>"; |
126 } | 133 } |
127 } | 134 } |
OLD | NEW |