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.kernel_library_builder; | 5 library fasta.kernel_library_builder; |
6 | 6 |
7 import 'package:front_end/src/fasta/scanner/token.dart' show Token; | 7 import 'package:front_end/src/fasta/scanner/token.dart' show Token; |
8 | 8 |
9 import 'package:kernel/ast.dart'; | 9 import 'package:kernel/ast.dart'; |
10 | 10 |
(...skipping 634 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
645 | 645 |
646 @override | 646 @override |
647 void buildBuilder(Builder builder, LibraryBuilder coreLibrary) { | 647 void buildBuilder(Builder builder, LibraryBuilder coreLibrary) { |
648 if (builder is SourceClassBuilder) { | 648 if (builder is SourceClassBuilder) { |
649 Class cls = builder.build(this, coreLibrary); | 649 Class cls = builder.build(this, coreLibrary); |
650 library.addClass(cls); | 650 library.addClass(cls); |
651 } else if (builder is KernelFieldBuilder) { | 651 } else if (builder is KernelFieldBuilder) { |
652 library.addMember(builder.build(this)..isStatic = true); | 652 library.addMember(builder.build(this)..isStatic = true); |
653 } else if (builder is KernelProcedureBuilder) { | 653 } else if (builder is KernelProcedureBuilder) { |
654 library.addMember(builder.build(this)..isStatic = true); | 654 library.addMember(builder.build(this)..isStatic = true); |
655 } else if (builder is FunctionTypeAliasBuilder) { | 655 } else if (builder is KernelFunctionTypeAliasBuilder) { |
656 // Kernel discard typedefs and use their corresponding function types | 656 library.addTypedef(builder.build(this)); |
657 // directly. | |
658 } else if (builder is KernelEnumBuilder) { | 657 } else if (builder is KernelEnumBuilder) { |
659 library.addClass(builder.build(this, coreLibrary)); | 658 library.addClass(builder.build(this, coreLibrary)); |
660 } else if (builder is PrefixBuilder) { | 659 } else if (builder is PrefixBuilder) { |
661 // Ignored. Kernel doesn't represent prefixes. | 660 // Ignored. Kernel doesn't represent prefixes. |
662 } else if (builder is BuiltinTypeBuilder) { | 661 } else if (builder is BuiltinTypeBuilder) { |
663 // Nothing needed. | 662 // Nothing needed. |
664 } else { | 663 } else { |
665 internalError("Unhandled builder: ${builder.runtimeType}"); | 664 internalError("Unhandled builder: ${builder.runtimeType}"); |
666 } | 665 } |
667 } | 666 } |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
848 mixinApplicationClasses.putIfAbsent(name, () => builder); | 847 mixinApplicationClasses.putIfAbsent(name, () => builder); |
849 if (existing != builder) { | 848 if (existing != builder) { |
850 part.scope.local.remove(name); | 849 part.scope.local.remove(name); |
851 } | 850 } |
852 }); | 851 }); |
853 super.includePart(part); | 852 super.includePart(part); |
854 nativeMethods.addAll(part.nativeMethods); | 853 nativeMethods.addAll(part.nativeMethods); |
855 boundlessTypeVariables.addAll(part.boundlessTypeVariables); | 854 boundlessTypeVariables.addAll(part.boundlessTypeVariables); |
856 } | 855 } |
857 } | 856 } |
OLD | NEW |