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/scanner/token.dart' show Token; | 7 import 'package:front_end/src/scanner/token.dart' show Token; |
8 | 8 |
9 import 'package:kernel/ast.dart'; | 9 import 'package:kernel/ast.dart'; |
10 | 10 |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 ProcedureBuilder, | 54 ProcedureBuilder, |
55 Scope, | 55 Scope, |
56 TypeBuilder, | 56 TypeBuilder, |
57 TypeVariableBuilder, | 57 TypeVariableBuilder, |
58 compareProcedures; | 58 compareProcedures; |
59 | 59 |
60 class KernelLibraryBuilder | 60 class KernelLibraryBuilder |
61 extends SourceLibraryBuilder<KernelTypeBuilder, Library> { | 61 extends SourceLibraryBuilder<KernelTypeBuilder, Library> { |
62 final Library library; | 62 final Library library; |
63 | 63 |
| 64 final bool isPatch; |
| 65 |
64 final Map<String, SourceClassBuilder> mixinApplicationClasses = | 66 final Map<String, SourceClassBuilder> mixinApplicationClasses = |
65 <String, SourceClassBuilder>{}; | 67 <String, SourceClassBuilder>{}; |
66 | 68 |
67 final List<List> argumentsWithMissingDefaultValues = <List>[]; | 69 final List<List> argumentsWithMissingDefaultValues = <List>[]; |
68 | 70 |
69 final List<KernelProcedureBuilder> nativeMethods = <KernelProcedureBuilder>[]; | 71 final List<KernelProcedureBuilder> nativeMethods = <KernelProcedureBuilder>[]; |
70 | 72 |
71 final List<KernelTypeVariableBuilder> boundlessTypeVariables = | 73 final List<KernelTypeVariableBuilder> boundlessTypeVariables = |
72 <KernelTypeVariableBuilder>[]; | 74 <KernelTypeVariableBuilder>[]; |
73 | 75 |
74 KernelLibraryBuilder(Uri uri, Uri fileUri, Loader loader) | 76 KernelLibraryBuilder(Uri uri, Uri fileUri, Loader loader, this.isPatch) |
75 : library = new Library(uri, fileUri: relativizeUri(fileUri)), | 77 : library = new Library(uri, fileUri: relativizeUri(fileUri)), |
76 super(loader, fileUri); | 78 super(loader, fileUri); |
77 | 79 |
78 Library get target => library; | 80 Library get target => library; |
79 | 81 |
80 Uri get uri => library.importUri; | 82 Uri get uri => library.importUri; |
81 | 83 |
82 KernelTypeBuilder addNamedType( | 84 KernelTypeBuilder addNamedType( |
83 String name, List<KernelTypeBuilder> arguments, int charOffset) { | 85 String name, List<KernelTypeBuilder> arguments, int charOffset) { |
84 return addType( | 86 return addType( |
(...skipping 758 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
843 mixinApplicationClasses.putIfAbsent(name, () => builder); | 845 mixinApplicationClasses.putIfAbsent(name, () => builder); |
844 if (existing != builder) { | 846 if (existing != builder) { |
845 part.scope.local.remove(name); | 847 part.scope.local.remove(name); |
846 } | 848 } |
847 }); | 849 }); |
848 super.includePart(part); | 850 super.includePart(part); |
849 nativeMethods.addAll(part.nativeMethods); | 851 nativeMethods.addAll(part.nativeMethods); |
850 boundlessTypeVariables.addAll(part.boundlessTypeVariables); | 852 boundlessTypeVariables.addAll(part.boundlessTypeVariables); |
851 } | 853 } |
852 } | 854 } |
OLD | NEW |