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

Side by Side Diff: lib/compiler/implementation/typechecker.dart

Issue 10905305: Patch refactoring. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebased Created 8 years, 3 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 class TypeCheckerTask extends CompilerTask { 5 class TypeCheckerTask extends CompilerTask {
6 TypeCheckerTask(Compiler compiler) : super(compiler); 6 TypeCheckerTask(Compiler compiler) : super(compiler);
7 String get name => "Type checker"; 7 String get name => "Type checker";
8 8
9 static const bool LOG_FAILURES = false; 9 static const bool LOG_FAILURES = false;
10 10
11 void check(Node tree, TreeElements elements) { 11 void check(Node tree, TreeElements elements) {
12 measure(() { 12 measure(() {
13 Visitor visitor = 13 Visitor visitor =
14 new TypeCheckerVisitor(compiler, elements, compiler.types); 14 new TypeCheckerVisitor(compiler, elements, compiler.types);
15 try { 15 try {
16 tree.accept(visitor); 16 tree.accept(visitor);
17 } on CancelTypeCheckException catch (e) { 17 } on CancelTypeCheckException catch (e) {
18 if (LOG_FAILURES) { 18 if (LOG_FAILURES) {
19 // Do not warn about unimplemented features; log message instead. 19 // Do not warn about unimplemented features; log message instead.
20 compiler.log("'${e.node}': ${e.reason}"); 20 compiler.log("'${e.node}': ${e.reason}");
21 } 21 }
22 } 22 }
23 }); 23 });
24 } 24 }
25 } 25 }
26 26
27 abstract class DartType implements Hashable { 27 abstract class DartType implements Hashable {
28 abstract SourceString get name; 28 abstract SourceString get name;
29
29 /** 30 /**
30 * Returns the [Element] which declared this type. 31 * Returns the [Element] which declared this type.
31 * 32 *
32 * This can be [ClassElement] for classes, [TypedefElement] for typedefs, 33 * This can be [ClassElement] for classes, [TypedefElement] for typedefs,
33 * [TypeVariableElement] for type variables and [FunctionElement] for 34 * [TypeVariableElement] for type variables and [FunctionElement] for
34 * function types. 35 * function types.
35 * 36 *
36 * Invariant: [element] must be a declaration element. 37 * Invariant: [element] must be a declaration element.
37 */ 38 */
38 abstract Element get element; 39 abstract Element get element;
(...skipping 878 matching lines...) Expand 10 before | Expand all | Expand 10 after
917 } 918 }
918 919
919 visitCatchBlock(CatchBlock node) { 920 visitCatchBlock(CatchBlock node) {
920 return unhandledStatement(); 921 return unhandledStatement();
921 } 922 }
922 923
923 visitTypedef(Typedef node) { 924 visitTypedef(Typedef node) {
924 return unhandledStatement(); 925 return unhandledStatement();
925 } 926 }
926 } 927 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698