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 1ac2b7f3dc52e791634f59ab7670d7c8fcf7a2e4..fb84787c65466e0b63a34cbc9d7e3446845da7bf 100644 |
--- a/pkg/front_end/lib/src/fasta/parser/listener.dart |
+++ b/pkg/front_end/lib/src/fasta/parser/listener.dart |
@@ -10,7 +10,7 @@ import '../../scanner/token.dart' show BeginToken, Token, TokenType; |
import '../util/link.dart' show Link; |
-import 'parser.dart' show FormalParameterType, MemberKind; |
+import 'parser.dart' show Assert, FormalParameterType, MemberKind; |
import 'identifier_context.dart' show IdentifierContext; |
@@ -168,11 +168,19 @@ class Listener { |
void beginExpressionStatement(Token token) {} |
/// Called by [ClassMemberParser] after skipping an expression as error |
- /// recovery. |
- void handleRecoverExpression(Token token) { |
+ /// recovery. For a stack-based listener, the suggested action is to push |
+ /// `null` or a synthetic erroneous expression. |
+ void handleRecoverExpression(Token token, FastaMessage message) { |
logEvent("RecoverExpression"); |
} |
+ /// Called by [Parser] after parsing an extraneous expression as error |
+ /// recovery. For a stack-based listener, the suggested action is to discard |
+ /// an expression from the stack. |
+ void handleExtraneousExpression(Token token, FastaMessage message) { |
+ logEvent("ExtraneousExpression"); |
+ } |
+ |
void endExpressionStatement(Token token) { |
logEvent("ExpressionStatement"); |
} |
@@ -857,9 +865,11 @@ class Listener { |
logEvent("EmptyStatement"); |
} |
- void handleAssertStatement(Token assertKeyword, Token leftParenthesis, |
+ void beginAssert(Token assertKeyword, Assert kind) {} |
+ |
+ void endAssert(Token assertKeyword, Assert kind, Token leftParenthesis, |
Token commaToken, Token rightParenthesis, Token semicolonToken) { |
- logEvent("AssertStatement"); |
+ logEvent("Assert"); |
} |
/** Called with either the token containing a double literal, or |