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

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

Issue 2704163002: Add handleNoVariableInitializer event. (Closed)
Patch Set: Created 3 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 unified diff | Download patch
« no previous file with comments | « pkg/front_end/lib/src/fasta/parser/listener.dart ('k') | no next file » | 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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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.parser; 5 library fasta.parser.parser;
6 6
7 import '../scanner.dart' show 7 import '../scanner.dart' show
8 ErrorToken; 8 ErrorToken;
9 9
10 import '../scanner/recover.dart' show 10 import '../scanner/recover.dart' show
(...skipping 1235 matching lines...) Expand 10 before | Expand all | Expand 10 after
1246 } 1246 }
1247 return token; 1247 return token;
1248 } 1248 }
1249 1249
1250 Token parseVariableInitializerOpt(Token token) { 1250 Token parseVariableInitializerOpt(Token token) {
1251 if (optional('=', token)) { 1251 if (optional('=', token)) {
1252 Token assignment = token; 1252 Token assignment = token;
1253 listener.beginVariableInitializer(token); 1253 listener.beginVariableInitializer(token);
1254 token = parseExpression(token.next); 1254 token = parseExpression(token.next);
1255 listener.endVariableInitializer(assignment); 1255 listener.endVariableInitializer(assignment);
1256 } else {
1257 listener.handleNoVariableInitializer(token);
1256 } 1258 }
1257 return token; 1259 return token;
1258 } 1260 }
1259 1261
1260 Token parseInitializersOpt(Token token) { 1262 Token parseInitializersOpt(Token token) {
1261 if (optional(':', token)) { 1263 if (optional(':', token)) {
1262 return parseInitializers(token); 1264 return parseInitializers(token);
1263 } else { 1265 } else {
1264 listener.handleNoInitializers(); 1266 listener.handleNoInitializers();
1265 return token; 1267 return token;
(...skipping 2047 matching lines...) Expand 10 before | Expand all | Expand 10 after
3313 break; 3315 break;
3314 } 3316 }
3315 if (isRecoverable) { 3317 if (isRecoverable) {
3316 listener.handleRecoverableError(token, kind, arguments); 3318 listener.handleRecoverableError(token, kind, arguments);
3317 return null; 3319 return null;
3318 } else { 3320 } else {
3319 return listener.handleUnrecoverableError(token, kind, arguments); 3321 return listener.handleUnrecoverableError(token, kind, arguments);
3320 } 3322 }
3321 } 3323 }
3322 } 3324 }
OLDNEW
« no previous file with comments | « pkg/front_end/lib/src/fasta/parser/listener.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698