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_class_builder; | 5 library fasta.dill_class_builder; |
6 | 6 |
7 import 'package:kernel/ast.dart' show | 7 import 'package:kernel/ast.dart' |
8 Class, | 8 show Class, Constructor, Member, Procedure, ProcedureKind; |
9 Constructor, | |
10 Member, | |
11 Procedure, | |
12 ProcedureKind; | |
13 | 9 |
14 import '../errors.dart' show | 10 import '../errors.dart' show internalError; |
15 internalError; | |
16 | 11 |
17 import '../kernel/kernel_builder.dart' show | 12 import '../kernel/kernel_builder.dart' |
18 Builder, | 13 show Builder, KernelClassBuilder, KernelTypeBuilder; |
19 KernelClassBuilder, | |
20 KernelTypeBuilder; | |
21 | 14 |
22 import '../modifier.dart' show | 15 import '../modifier.dart' show abstractMask; |
23 abstractMask; | |
24 | 16 |
25 import 'dill_member_builder.dart' show | 17 import 'dill_member_builder.dart' show DillMemberBuilder; |
26 DillMemberBuilder; | |
27 | 18 |
28 import 'dill_library_builder.dart' show | 19 import 'dill_library_builder.dart' show DillLibraryBuilder; |
29 DillLibraryBuilder; | |
30 | 20 |
31 class DillClassBuilder extends KernelClassBuilder { | 21 class DillClassBuilder extends KernelClassBuilder { |
32 final Class cls; | 22 final Class cls; |
33 | 23 |
34 final Map<String, Builder> constructors = <String, Builder>{}; | 24 final Map<String, Builder> constructors = <String, Builder>{}; |
35 | 25 |
36 DillClassBuilder(Class cls, DillLibraryBuilder parent) | 26 DillClassBuilder(Class cls, DillLibraryBuilder parent) |
37 : cls = cls, | 27 : cls = cls, |
38 super(null, computeModifiers(cls), cls.name, null, null, null, | 28 super(null, computeModifiers(cls), cls.name, null, null, null, |
39 <String, Builder>{}, parent, cls.fileOffset); | 29 <String, Builder>{}, parent, cls.fileOffset); |
(...skipping 19 matching lines...) Expand all Loading... |
59 bool get isMixinApplication => cls.isMixinApplication; | 49 bool get isMixinApplication => cls.isMixinApplication; |
60 | 50 |
61 KernelTypeBuilder get mixedInType => internalError("Not implemented."); | 51 KernelTypeBuilder get mixedInType => internalError("Not implemented."); |
62 | 52 |
63 Builder findConstructorOrFactory(String name) => constructors[name]; | 53 Builder findConstructorOrFactory(String name) => constructors[name]; |
64 } | 54 } |
65 | 55 |
66 int computeModifiers(Class cls) { | 56 int computeModifiers(Class cls) { |
67 return cls.isAbstract ? abstractMask : 0; | 57 return cls.isAbstract ? abstractMask : 0; |
68 } | 58 } |
OLD | NEW |