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

Side by Side Diff: pkg/front_end/lib/src/fasta/parser/class_member_parser.dart

Issue 2725973004: Correctly recover from incorrect imports, etc. (Closed)
Patch Set: Created 3 years, 9 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 unified diff | Download patch
« no previous file with comments | « no previous file | pkg/front_end/lib/src/fasta/parser/listener.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 fasta.parser.class_member_parser; 5 library fasta.parser.class_member_parser;
6 6
7 import '../scanner/token.dart' show Token; 7 import '../scanner/token.dart' show Token;
8 8
9 import 'listener.dart' show Listener; 9 import 'listener.dart' show Listener;
10 10
11 import 'parser.dart' show Parser; 11 import 'parser.dart' show Parser;
12 12
13 /// Parser similar to [TopLevelParser] but also parses class members (excluding 13 /// Parser similar to [TopLevelParser] but also parses class members (excluding
14 /// their bodies). 14 /// their bodies).
15 class ClassMemberParser extends Parser { 15 class ClassMemberParser extends Parser {
16 ClassMemberParser(Listener listener, {bool asyncAwaitKeywordsEnabled: false}) 16 ClassMemberParser(Listener listener, {bool asyncAwaitKeywordsEnabled: false})
17 : super(listener, asyncAwaitKeywordsEnabled: asyncAwaitKeywordsEnabled); 17 : super(listener, asyncAwaitKeywordsEnabled: asyncAwaitKeywordsEnabled);
18 18
19 Token parseExpression(Token token) => skipExpression(token); 19 Token parseExpression(Token token) => skipExpression(token);
20 20
21 Token parseRecoverExpression(Token token) {
22 Token begin = token;
23 token = skipExpression(token);
24 listener.handleRecoverExpression(begin);
25 return token;
26 }
27
21 // This method is overridden for two reasons: 28 // This method is overridden for two reasons:
22 // 1. Avoid generating events for arguments. 29 // 1. Avoid generating events for arguments.
23 // 2. Avoid calling skip expression for each argument (which doesn't work). 30 // 2. Avoid calling skip expression for each argument (which doesn't work).
24 Token parseArgumentsOpt(Token token) => skipArgumentsOpt(token); 31 Token parseArgumentsOpt(Token token) => skipArgumentsOpt(token);
25 32
26 Token parseFunctionBody(Token token, bool isExpression, bool allowAbstract) { 33 Token parseFunctionBody(Token token, bool isExpression, bool allowAbstract) {
27 return skipFunctionBody(token, isExpression, allowAbstract); 34 return skipFunctionBody(token, isExpression, allowAbstract);
28 } 35 }
29 } 36 }
OLDNEW
« no previous file with comments | « no previous file | pkg/front_end/lib/src/fasta/parser/listener.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698