| OLD | NEW |
| 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 final bool LOG_FAILURES = false; | 9 static final bool LOG_FAILURES = false; |
| 10 | 10 |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 toString() { | 98 toString() { |
| 99 StringBuffer sb = new StringBuffer(); | 99 StringBuffer sb = new StringBuffer(); |
| 100 bool first = true; | 100 bool first = true; |
| 101 sb.add('('); | 101 sb.add('('); |
| 102 parameterTypes.printOn(sb, ', '); | 102 parameterTypes.printOn(sb, ', '); |
| 103 sb.add(') -> ${returnType}'); | 103 sb.add(') -> ${returnType}'); |
| 104 return sb.toString(); | 104 return sb.toString(); |
| 105 } | 105 } |
| 106 | 106 |
| 107 SourceString get name() => const SourceString('Function'); | 107 SourceString get name() => const SourceString('Function'); |
| 108 |
| 109 int computeArity() { |
| 110 int arity = 0; |
| 111 parameterTypes.forEach((_) { arity++; }); |
| 112 return arity; |
| 113 } |
| 108 } | 114 } |
| 109 | 115 |
| 110 class Types { | 116 class Types { |
| 111 static final VOID = const SourceString('void'); | 117 static final VOID = const SourceString('void'); |
| 112 static final INT = const SourceString('int'); | 118 static final INT = const SourceString('int'); |
| 113 static final DOUBLE = const SourceString('double'); | 119 static final DOUBLE = const SourceString('double'); |
| 114 static final DYNAMIC = const SourceString('Dynamic'); | 120 static final DYNAMIC = const SourceString('Dynamic'); |
| 115 static final STRING = const SourceString('String'); | 121 static final STRING = const SourceString('String'); |
| 116 static final BOOL = const SourceString('bool'); | 122 static final BOOL = const SourceString('bool'); |
| 117 static final OBJECT = const SourceString('Object'); | 123 static final OBJECT = const SourceString('Object'); |
| (...skipping 656 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 774 } | 780 } |
| 775 | 781 |
| 776 visitCatchBlock(CatchBlock node) { | 782 visitCatchBlock(CatchBlock node) { |
| 777 return unhandledStatement(); | 783 return unhandledStatement(); |
| 778 } | 784 } |
| 779 | 785 |
| 780 visitTypedef(Typedef node) { | 786 visitTypedef(Typedef node) { |
| 781 return unhandledStatement(); | 787 return unhandledStatement(); |
| 782 } | 788 } |
| 783 } | 789 } |
| OLD | NEW |