| 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 interface TreeElements { | 5 interface TreeElements { |
| 6 Element operator[](Node node); | 6 Element operator[](Node node); |
| 7 Selector getSelector(Send send); | 7 Selector getSelector(Send send); |
| 8 Type getType(TypeAnnotation annotation); | 8 Type getType(TypeAnnotation annotation); |
| 9 } | 9 } |
| 10 | 10 |
| (...skipping 1715 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1726 element = visitSend(node); | 1726 element = visitSend(node); |
| 1727 } else if (node.selector.asIdentifier() != null) { | 1727 } else if (node.selector.asIdentifier() != null) { |
| 1728 Element variables = new VariableListElement.node(currentDefinitions, | 1728 Element variables = new VariableListElement.node(currentDefinitions, |
| 1729 ElementKind.VARIABLE_LIST, enclosingElement); | 1729 ElementKind.VARIABLE_LIST, enclosingElement); |
| 1730 element = new VariableElement(node.selector.asIdentifier().source, | 1730 element = new VariableElement(node.selector.asIdentifier().source, |
| 1731 variables, ElementKind.PARAMETER, enclosingElement, node: node); | 1731 variables, ElementKind.PARAMETER, enclosingElement, node: node); |
| 1732 } | 1732 } |
| 1733 // Visit the value. The compile time constant handler will | 1733 // Visit the value. The compile time constant handler will |
| 1734 // make sure it's a compile time constant. | 1734 // make sure it's a compile time constant. |
| 1735 resolveExpression(node.arguments.head); | 1735 resolveExpression(node.arguments.head); |
| 1736 // TODO(ahe): Do not call addToWorkList, and make sure that element isn't nu
ll. | 1736 // TODO(ahe): Move this to codegen, and make sure that element isn't null. |
| 1737 if (element !== null) compiler.addToWorkList(element); | 1737 if (element !== null) compiler.enqueuer.codegen.addToWorkList(element); |
| 1738 return element; | 1738 return element; |
| 1739 } | 1739 } |
| 1740 | 1740 |
| 1741 Element visitFunctionExpression(FunctionExpression node) { | 1741 Element visitFunctionExpression(FunctionExpression node) { |
| 1742 // This is a function typed parameter. | 1742 // This is a function typed parameter. |
| 1743 // TODO(ahe): Resolve the function type. | 1743 // TODO(ahe): Resolve the function type. |
| 1744 return visit(node.name); | 1744 return visit(node.name); |
| 1745 } | 1745 } |
| 1746 | 1746 |
| 1747 LinkBuilder<Element> analyzeNodes(Link<Node> link) { | 1747 LinkBuilder<Element> analyzeNodes(Link<Node> link) { |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1943 | 1943 |
| 1944 TopScope(LibraryElement library) : super(null, library); | 1944 TopScope(LibraryElement library) : super(null, library); |
| 1945 Element lookup(SourceString name) { | 1945 Element lookup(SourceString name) { |
| 1946 return library.find(name); | 1946 return library.find(name); |
| 1947 } | 1947 } |
| 1948 | 1948 |
| 1949 Element add(Element newElement) { | 1949 Element add(Element newElement) { |
| 1950 throw "Cannot add an element in the top scope"; | 1950 throw "Cannot add an element in the top scope"; |
| 1951 } | 1951 } |
| 1952 } | 1952 } |
| OLD | NEW |