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

Unified Diff: pkg/front_end/lib/src/fasta/parser/listener.dart

Issue 2994973002: Implement type variables on local function declarations and expressions. (Closed)
Patch Set: Update expectation files after adding copyright. Created 3 years, 4 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
Index: pkg/front_end/lib/src/fasta/parser/listener.dart
diff --git a/pkg/front_end/lib/src/fasta/parser/listener.dart b/pkg/front_end/lib/src/fasta/parser/listener.dart
index 22a8c4b486800378bbba1a8fc661bc6569037405..9690f9c09dff5009c77caf5985b0007246beeb2c 100644
--- a/pkg/front_end/lib/src/fasta/parser/listener.dart
+++ b/pkg/front_end/lib/src/fasta/parser/listener.dart
@@ -261,6 +261,13 @@ class Listener {
logEvent("ForInBody");
}
+ /// Handle the beginning of a named function expression which isn't legal
+ /// syntax in Dart. Useful for recovering from Javascript code being pasted
+ /// into a Dart proram, as it will interpret `function foo() {}` as a named
+ /// function expression with return type `function` and name `foo`.
+ ///
+ /// Substructures:
+ /// - Type variables
void beginNamedFunctionExpression(Token token) {}
/// A named function expression which isn't legal syntax in Dart.
@@ -269,10 +276,10 @@ class Listener {
/// expression with return type `function` and name `foo`.
///
/// Substructures:
+ /// - Type variables
/// - Modifiers
/// - Return type
/// - Name
- /// - Type variables
/// - Formals
/// - Initializers
/// - Async modifier
« no previous file with comments | « pkg/front_end/lib/src/fasta/kernel/kernel_shadow_ast.dart ('k') | pkg/front_end/lib/src/fasta/parser/parser.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698