| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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) : types = new Types(), super(compiler); | 6 TypeCheckerTask(Compiler compiler) : types = new Types(), super(compiler); |
| 7 String get name() => "Type checker"; | 7 String get name() => "Type checker"; |
| 8 Types types; | 8 Types types; |
| 9 | 9 |
| 10 void check(Node tree, TreeElements elements) { | 10 void check(Node tree, TreeElements elements) { |
| (...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 333 } | 333 } |
| 334 | 334 |
| 335 Type visitLiteralString(LiteralString node) { | 335 Type visitLiteralString(LiteralString node) { |
| 336 return types.stringType; | 336 return types.stringType; |
| 337 } | 337 } |
| 338 | 338 |
| 339 Type visitLiteralNull(LiteralNull node) { | 339 Type visitLiteralNull(LiteralNull node) { |
| 340 return types.dynamicType; | 340 return types.dynamicType; |
| 341 } | 341 } |
| 342 | 342 |
| 343 Type visitNewExpression(NewExpression node) { |
| 344 // TODO(karlklose): return the type. |
| 345 return types.dynamicType; |
| 346 } |
| 347 |
| 343 Type visitLiteralList(LiteralList node) { | 348 Type visitLiteralList(LiteralList node) { |
| 344 return types.dynamicType; | 349 return types.dynamicType; |
| 345 } | 350 } |
| 346 | 351 |
| 347 Type visitNodeList(NodeList node) { | 352 Type visitNodeList(NodeList node) { |
| 348 for (Link<Node> link = node.nodes; !link.isEmpty(); link = link.tail) { | 353 for (Link<Node> link = node.nodes; !link.isEmpty(); link = link.tail) { |
| 349 type(link.head); | 354 type(link.head); |
| 350 } | 355 } |
| 351 return null; | 356 return null; |
| 352 } | 357 } |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 428 | 433 |
| 429 Type visitWhile(While node) { | 434 Type visitWhile(While node) { |
| 430 checkCondition(node.condition); | 435 checkCondition(node.condition); |
| 431 type(node.body); | 436 type(node.body); |
| 432 } | 437 } |
| 433 | 438 |
| 434 Type visitParenthesizedExpression(ParenthesizedExpression node) { | 439 Type visitParenthesizedExpression(ParenthesizedExpression node) { |
| 435 return type(node.expression); | 440 return type(node.expression); |
| 436 } | 441 } |
| 437 } | 442 } |
| OLD | NEW |