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 LocalPlaceholder { | 5 class LocalPlaceholder { |
6 final String identifier; | 6 final String identifier; |
7 final Set<Node> nodes; | 7 final Set<Node> nodes; |
8 LocalPlaceholder(this.identifier) : nodes = new Set<Node>(); | 8 LocalPlaceholder(this.identifier) : nodes = new Set<Node>(); |
9 int hashCode() => identifier.hashCode(); | 9 int hashCode() => identifier.hashCode(); |
10 String toString() => | 10 String toString() => |
(...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
359 return currentLocalPlaceholders.putIfAbsent(name, () { | 359 return currentLocalPlaceholders.putIfAbsent(name, () { |
360 LocalPlaceholder localPlaceholder = new LocalPlaceholder(name); | 360 LocalPlaceholder localPlaceholder = new LocalPlaceholder(name); |
361 currentFunctionScope.localPlaceholders.add(localPlaceholder); | 361 currentFunctionScope.localPlaceholders.add(localPlaceholder); |
362 return localPlaceholder; | 362 return localPlaceholder; |
363 }); | 363 }); |
364 } | 364 } |
365 | 365 |
366 getLocalPlaceholder().nodes.add(identifier); | 366 getLocalPlaceholder().nodes.add(identifier); |
367 } | 367 } |
368 | 368 |
369 void internalError(String reason, [Node node]) { | 369 void internalError(String reason, {Node node}) { |
370 compiler.cancel(reason: reason, node: node); | 370 compiler.cancel(reason: reason, node: node); |
371 } | 371 } |
372 | 372 |
373 void unreachable() { internalError('Unreachable case'); } | 373 void unreachable() { internalError('Unreachable case'); } |
374 | 374 |
375 visit(Node node) => (node === null) ? null : node.accept(this); | 375 visit(Node node) => (node === null) ? null : node.accept(this); |
376 | 376 |
377 visitNode(Node node) { node.visitChildren(this); } // We must go deeper. | 377 visitNode(Node node) { node.visitChildren(this); } // We must go deeper. |
378 | 378 |
379 visitSend(Send send) { | 379 visitSend(Send send) { |
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
635 | 635 |
636 visitBlock(Block node) { | 636 visitBlock(Block node) { |
637 for (Node statement in node.statements.nodes) { | 637 for (Node statement in node.statements.nodes) { |
638 if (statement is VariableDefinitions) { | 638 if (statement is VariableDefinitions) { |
639 makeVarDeclarationTypePlaceholder(statement); | 639 makeVarDeclarationTypePlaceholder(statement); |
640 } | 640 } |
641 } | 641 } |
642 node.visitChildren(this); | 642 node.visitChildren(this); |
643 } | 643 } |
644 } | 644 } |
OLD | NEW |