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

Unified Diff: frog/leg/scanner/parser.dart

Issue 9502002: Add FunctionDeclaration node. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Update status files. 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 | « frog/leg/scanner/listener.dart ('k') | frog/leg/ssa/builder.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: frog/leg/scanner/parser.dart
diff --git a/frog/leg/scanner/parser.dart b/frog/leg/scanner/parser.dart
index 4cae1a907b0292d2dd6daaf43a5ad0feb3da3408..c83555a739119cb621955d75db0ddafdd5dffb94 100644
--- a/frog/leg/scanner/parser.dart
+++ b/frog/leg/scanner/parser.dart
@@ -724,6 +724,13 @@ class Parser {
return isBlock ? token.next : token;
}
+ Token parseFunctionDeclaration(Token token) {
+ listener.beginFunctionDeclaration(token);
+ token = parseFunction(token, null);
+ listener.endFunctionDeclaration(token);
+ return token;
+ }
+
Token parseFunctionExpression(Token token) {
listener.beginFunction(token);
listener.handleModifiers(0);
@@ -852,7 +859,7 @@ class Parser {
if (optional('{', afterParens) || optional('=>', afterParens)) {
// We are looking at "type identifier '(' ... ')'" followed
// by '=>' or '{'.
- return parseFunction(token, null);
+ return parseFunctionDeclaration(token);
}
}
// Fall-through to expression statement.
@@ -863,7 +870,7 @@ class Parser {
BeginGroupToken begin = token.next;
String afterParens = begin.endGroup.next.stringValue;
if (afterParens === '{' || afterParens === '=>') {
- return parseFunction(token, null);
+ return parseFunctionDeclaration(token);
}
}
}
« no previous file with comments | « frog/leg/scanner/listener.dart ('k') | frog/leg/ssa/builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698