Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(380)

Side by Side Diff: pkg/front_end/lib/src/fasta/source/source_library_builder.dart

Issue 2850683004: Get astBuilder and typeInferenceEngine from SourceLoader. (Closed)
Patch Set: Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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.source_library_builder; 5 library fasta.source_library_builder;
6 6
7 import 'package:front_end/src/fasta/scanner/token.dart' show SymbolToken, Token; 7 import 'package:front_end/src/fasta/scanner/token.dart' show SymbolToken, Token;
8 8
9 import 'package:front_end/src/fasta/type_inference/type_inference_engine.dart'
10 show TypeInferenceEngine;
11
12 import 'package:kernel/ast.dart' show AsyncMarker, ProcedureKind; 9 import 'package:kernel/ast.dart' show AsyncMarker, ProcedureKind;
13 10
14 import '../combinator.dart' show Combinator; 11 import '../combinator.dart' show Combinator;
15 12
16 import '../errors.dart' show inputError, internalError; 13 import '../errors.dart' show inputError, internalError;
17 14
18 import '../export.dart' show Export; 15 import '../export.dart' show Export;
19 16
20 import '../import.dart' show Import; 17 import '../import.dart' show Import;
21 18
(...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after
478 return count; 475 return count;
479 } 476 }
480 477
481 List<TypeVariableBuilder> copyTypeVariables( 478 List<TypeVariableBuilder> copyTypeVariables(
482 List<TypeVariableBuilder> original); 479 List<TypeVariableBuilder> original);
483 480
484 @override 481 @override
485 String get fullNameForErrors => name ?? "<library '$relativeFileUri'>"; 482 String get fullNameForErrors => name ?? "<library '$relativeFileUri'>";
486 483
487 @override 484 @override
488 void prepareInitializerInference(TypeInferenceEngine typeInferenceEngine, 485 void prepareInitializerInference(
489 LibraryBuilder library, ClassBuilder currentClass) { 486 SourceLibraryBuilder library, ClassBuilder currentClass) {
490 forEach((String name, Builder member) { 487 forEach((String name, Builder member) {
491 member.prepareInitializerInference( 488 member.prepareInitializerInference(library, currentClass);
492 typeInferenceEngine, library, currentClass);
493 }); 489 });
494 } 490 }
495 } 491 }
496 492
497 /// Unlike [Scope], this scope is used during construction of builders to 493 /// Unlike [Scope], this scope is used during construction of builders to
498 /// ensure types and members are added to and resolved in the correct location. 494 /// ensure types and members are added to and resolved in the correct location.
499 class DeclarationBuilder<T extends TypeBuilder> { 495 class DeclarationBuilder<T extends TypeBuilder> {
500 final DeclarationBuilder<T> parent; 496 final DeclarationBuilder<T> parent;
501 497
502 final Map<String, Builder> members; 498 final Map<String, Builder> members;
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
579 /// synthesize type variables on the factory matching the class'. 575 /// synthesize type variables on the factory matching the class'.
580 void addFactoryDeclaration( 576 void addFactoryDeclaration(
581 ProcedureBuilder procedure, DeclarationBuilder<T> factoryDeclaration) { 577 ProcedureBuilder procedure, DeclarationBuilder<T> factoryDeclaration) {
582 factoryDeclarations[procedure] = factoryDeclaration; 578 factoryDeclarations[procedure] = factoryDeclaration;
583 } 579 }
584 580
585 Scope toScope(Scope parent) { 581 Scope toScope(Scope parent) {
586 return new Scope(members, setters, parent, isModifiable: false); 582 return new Scope(members, setters, parent, isModifiable: false);
587 } 583 }
588 } 584 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698