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

Side by Side Diff: pkg/compiler/lib/src/resolution/resolution_common.dart

Issue 1383503002: Add Resolution and Parsing interfaces for computeType, ensureResolved and parseNode. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Add TODOs. Created 5 years, 2 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) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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 dart2js.resolution.common; 5 library dart2js.resolution.common;
6 6
7 import '../common/resolution.dart' show
8 Resolution;
7 import '../common/tasks.dart' show 9 import '../common/tasks.dart' show
8 DeferredAction; 10 DeferredAction;
9 import '../compiler.dart' show 11 import '../compiler.dart' show
10 Compiler; 12 Compiler;
11 import '../diagnostics/diagnostic_listener.dart' show 13 import '../diagnostics/diagnostic_listener.dart' show
12 DiagnosticMessage; 14 DiagnosticMessage;
13 import '../diagnostics/messages.dart' show 15 import '../diagnostics/messages.dart' show
14 MessageKind; 16 MessageKind;
15 import '../diagnostics/spannable.dart' show 17 import '../diagnostics/spannable.dart' show
16 Spannable; 18 Spannable;
17 import '../elements/elements.dart'; 19 import '../elements/elements.dart';
18 import '../tree/tree.dart'; 20 import '../tree/tree.dart';
19 21
20 import 'registry.dart' show 22 import 'registry.dart' show
21 ResolutionRegistry; 23 ResolutionRegistry;
22 import 'scope.dart' show 24 import 'scope.dart' show
23 Scope; 25 Scope;
24 import 'type_resolver.dart' show 26 import 'type_resolver.dart' show
25 TypeResolver; 27 TypeResolver;
26 28
27 class CommonResolverVisitor<R> extends Visitor<R> { 29 class CommonResolverVisitor<R> extends Visitor<R> {
28 final Compiler compiler; 30 final Compiler compiler;
29 31
30 CommonResolverVisitor(Compiler this.compiler); 32 CommonResolverVisitor(Compiler this.compiler);
31 33
34 Resolution get resolution => compiler.resolution;
35
32 R visitNode(Node node) { 36 R visitNode(Node node) {
33 return compiler.internalError(node, 37 return compiler.internalError(node,
34 'internal error: Unhandled node: ${node.getObjectDescription()}'); 38 'internal error: Unhandled node: ${node.getObjectDescription()}');
35 } 39 }
36 40
37 R visitEmptyStatement(Node node) => null; 41 R visitEmptyStatement(Node node) => null;
38 42
39 /** Convenience method for visiting nodes that may be null. */ 43 /** Convenience method for visiting nodes that may be null. */
40 R visit(Node node) => (node == null) ? null : node.accept(this); 44 R visit(Node node) => (node == null) ? null : node.accept(this);
41 45
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 MessageKind.DUPLICATE_DEFINITION, 105 MessageKind.DUPLICATE_DEFINITION,
102 {'name': name}), 106 {'name': name}),
103 <DiagnosticMessage>[ 107 <DiagnosticMessage>[
104 compiler.createMessage( 108 compiler.createMessage(
105 existing, 109 existing,
106 MessageKind.EXISTING_DEFINITION, 110 MessageKind.EXISTING_DEFINITION,
107 {'name': name}), 111 {'name': name}),
108 ]); 112 ]);
109 } 113 }
110 } 114 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/resolution/resolution.dart ('k') | pkg/compiler/lib/src/resolution/signatures.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698