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 part of dart_backend; | 5 part of dart_backend; |
6 | 6 |
7 class LocalPlaceholder { | 7 class LocalPlaceholder { |
8 final String identifier; | 8 final String identifier; |
9 final Set<Node> nodes; | 9 final Set<Node> nodes; |
10 LocalPlaceholder(this.identifier) : nodes = new Set<Node>(); | 10 LocalPlaceholder(this.identifier) : nodes = new Set<Node>(); |
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
330 declarationTypePlaceholders.add( | 330 declarationTypePlaceholders.add( |
331 new DeclarationTypePlaceholder(type, false)); | 331 new DeclarationTypePlaceholder(type, false)); |
332 } | 332 } |
333 | 333 |
334 void makeVarDeclarationTypePlaceholder(VariableDefinitions node) { | 334 void makeVarDeclarationTypePlaceholder(VariableDefinitions node) { |
335 // TODO(smok): Maybe instead of calling this method and | 335 // TODO(smok): Maybe instead of calling this method and |
336 // makeDeclaratioTypePlaceholder have type declaration placeholder | 336 // makeDeclaratioTypePlaceholder have type declaration placeholder |
337 // collector logic in visitVariableDefinitions when resolver becomes better | 337 // collector logic in visitVariableDefinitions when resolver becomes better |
338 // and/or catch syntax changes. | 338 // and/or catch syntax changes. |
339 if (node.type == null) return; | 339 if (node.type == null) return; |
340 Element definitionElement = treeElements[node.definitions.nodes.head]; | |
341 bool requiresVar = !node.modifiers.isFinalOrConst; | 340 bool requiresVar = !node.modifiers.isFinalOrConst; |
342 declarationTypePlaceholders.add( | 341 declarationTypePlaceholders.add( |
343 new DeclarationTypePlaceholder(node.type, requiresVar)); | 342 new DeclarationTypePlaceholder(node.type, requiresVar)); |
344 } | 343 } |
345 | 344 |
346 /// Marks [node] to be erased in the output. | 345 /// Marks [node] to be erased in the output. |
347 /// This is done for library prefixes because they are not used in the output | 346 /// This is done for library prefixes because they are not used in the output |
348 /// because all imports are flattened and conflicts are renamed away. | 347 /// because all imports are flattened and conflicts are renamed away. |
349 void makeErasePrefixPlaceholder(Node node) { | 348 void makeErasePrefixPlaceholder(Node node) { |
350 assert(node is Identifier || node is Send); | 349 assert(node is Identifier || node is Send); |
(...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
718 | 717 |
719 visitBlock(Block node) { | 718 visitBlock(Block node) { |
720 for (Node statement in node.statements.nodes) { | 719 for (Node statement in node.statements.nodes) { |
721 if (statement is VariableDefinitions) { | 720 if (statement is VariableDefinitions) { |
722 makeVarDeclarationTypePlaceholder(statement); | 721 makeVarDeclarationTypePlaceholder(statement); |
723 } | 722 } |
724 } | 723 } |
725 node.visitChildren(this); | 724 node.visitChildren(this); |
726 } | 725 } |
727 } | 726 } |
OLD | NEW |