| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 library backend_ast_emitter; | 5 library backend_ast_emitter; |
| 6 | 6 |
| 7 import '../tree_ir/tree_ir_nodes.dart' as tree; | 7 import '../tree_ir/tree_ir_nodes.dart' as tree; |
| 8 import 'backend_ast_nodes.dart'; | 8 import 'backend_ast_nodes.dart'; |
| 9 import '../constants/expressions.dart'; | 9 import '../constants/expressions.dart'; |
| 10 import '../constants/values.dart'; | 10 import '../constants/values.dart'; |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 : this.parent = parent, | 70 : this.parent = parent, |
| 71 usedVariableNames = parent.usedVariableNames; | 71 usedVariableNames = parent.usedVariableNames; |
| 72 | 72 |
| 73 FunctionExpression emit(tree.FunctionDefinition definition) { | 73 FunctionExpression emit(tree.FunctionDefinition definition) { |
| 74 functionElement = definition.element; | 74 functionElement = definition.element; |
| 75 | 75 |
| 76 Parameters parameters = emitRootParameters(definition); | 76 Parameters parameters = emitRootParameters(definition); |
| 77 | 77 |
| 78 // Declare parameters. | 78 // Declare parameters. |
| 79 for (tree.Variable param in definition.parameters) { | 79 for (tree.Variable param in definition.parameters) { |
| 80 getVariableName(param); | 80 variableNames[param] = param.element.name; |
| 81 usedVariableNames.add(param.element.name); |
| 81 declaredVariables.add(param); | 82 declaredVariables.add(param); |
| 82 } | 83 } |
| 83 | 84 |
| 84 Statement body; | 85 Statement body; |
| 85 if (definition.isAbstract) { | 86 if (definition.isAbstract) { |
| 86 body = new EmptyStatement(); | 87 body = new EmptyStatement(); |
| 87 } else { | 88 } else { |
| 88 firstStatement = definition.body; | 89 firstStatement = definition.body; |
| 89 visitStatement(definition.body); | 90 visitStatement(definition.body); |
| 90 removeTrailingReturn(); | 91 removeTrailingReturn(); |
| (...skipping 818 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 909 : super(name, ElementKind.VARIABLE, enclosingElement, variables, null); | 910 : super(name, ElementKind.VARIABLE, enclosingElement, variables, null); |
| 910 | 911 |
| 911 ExecutableElement get executableContext => enclosingElement; | 912 ExecutableElement get executableContext => enclosingElement; |
| 912 | 913 |
| 913 ExecutableElement get memberContext => executableContext.memberContext; | 914 ExecutableElement get memberContext => executableContext.memberContext; |
| 914 | 915 |
| 915 bool get isLocal => true; | 916 bool get isLocal => true; |
| 916 | 917 |
| 917 LibraryElement get implementationLibrary => enclosingElement.library; | 918 LibraryElement get implementationLibrary => enclosingElement.library; |
| 918 } | 919 } |
| OLD | NEW |