Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(369)

Unified Diff: frog/leg/resolver.dart

Issue 9502002: Add FunctionDeclaration node. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | frog/leg/scanner/listener.dart » ('j') | frog/leg/typechecker.dart » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: frog/leg/resolver.dart
diff --git a/frog/leg/resolver.dart b/frog/leg/resolver.dart
index 2d6108b448359cfa678d64f3d4229c6d9f0f7fa7..c11cca8ff8c5b5fe01b32097a47778ce68206a54 100644
--- a/frog/leg/resolver.dart
+++ b/frog/leg/resolver.dart
@@ -700,6 +700,16 @@ class ResolverVisitor extends CommonResolverVisitor<Element> {
visitLoopBodyIn(node, node.body, scope);
}
+ visitFunctionDeclaration(FunctionDeclaration node) {
+ SourceString name = node.function.name;
+ assert(name !== null);
+ visit(node.function);
+ FunctionElement functionElement = mapping[node.function];
+ // TODO(floitsch): this might lead to two errors complaining about
+ // shadowing.
+ defineElement(node, functionElement);
+ }
+
visitFunctionExpression(FunctionExpression node) {
visit(node.returnType);
SourceString name;
@@ -711,8 +721,8 @@ class ResolverVisitor extends CommonResolverVisitor<Element> {
FunctionElement enclosingElement = new FunctionElement.node(
name, node, ElementKind.FUNCTION, new Modifiers.empty(),
context.element);
- defineElement(node, enclosingElement, doAddToScope: node.name !== null);
setupFunction(node, enclosingElement);
+ defineElement(node, enclosingElement, doAddToScope: node.name !== null);
// Run the body in a fresh statement scope.
StatementScope oldScope = statementScope;
« no previous file with comments | « no previous file | frog/leg/scanner/listener.dart » ('j') | frog/leg/typechecker.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698