Chromium Code Reviews| 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) { | |
|
ahe
2011/12/02 11:27:41
Add todo.
ngeoffray
2011/12/02 14:44:54
Done.
| |
| 344 return types.dynamicType; | |
| 345 } | |
| 346 | |
| 343 Type visitNodeList(NodeList node) { | 347 Type visitNodeList(NodeList node) { |
| 344 for (Link<Node> link = node.nodes; !link.isEmpty(); link = link.tail) { | 348 for (Link<Node> link = node.nodes; !link.isEmpty(); link = link.tail) { |
| 345 type(link.head); | 349 type(link.head); |
| 346 } | 350 } |
| 347 return null; | 351 return null; |
| 348 } | 352 } |
| 349 | 353 |
| 350 Type visitOperator(Operator node) { | 354 Type visitOperator(Operator node) { |
| 351 return types.dynamicType; | 355 return types.dynamicType; |
| 352 } | 356 } |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 424 | 428 |
| 425 Type visitWhile(While node) { | 429 Type visitWhile(While node) { |
| 426 checkCondition(node.condition); | 430 checkCondition(node.condition); |
| 427 type(node.body); | 431 type(node.body); |
| 428 } | 432 } |
| 429 | 433 |
| 430 Type visitParenthesizedExpression(ParenthesizedExpression node) { | 434 Type visitParenthesizedExpression(ParenthesizedExpression node) { |
| 431 return type(node.expression); | 435 return type(node.expression); |
| 432 } | 436 } |
| 433 } | 437 } |
| OLD | NEW |