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

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

Issue 2798603003: Implement parsing of metadata on local variables. (Closed)
Patch Set: Created 3 years, 8 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
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 '../fasta_codes.dart' 7 import '../fasta_codes.dart'
8 show 8 show
9 FastaCode, 9 FastaCode,
10 FastaMessage, 10 FastaMessage,
(...skipping 3291 matching lines...) Expand 10 before | Expand all | Expand 10 after
3302 } 3302 }
3303 3303
3304 Token parseVariablesDeclarationNoSemicolon(Token token) { 3304 Token parseVariablesDeclarationNoSemicolon(Token token) {
3305 // Only called when parsing a for loop, so this is for parsing locals. 3305 // Only called when parsing a for loop, so this is for parsing locals.
3306 return parseVariablesDeclarationMaybeSemicolon(token, false); 3306 return parseVariablesDeclarationMaybeSemicolon(token, false);
3307 } 3307 }
3308 3308
3309 Token parseVariablesDeclarationMaybeSemicolon( 3309 Token parseVariablesDeclarationMaybeSemicolon(
3310 Token token, bool endWithSemicolon) { 3310 Token token, bool endWithSemicolon) {
3311 int count = 1; 3311 int count = 1;
3312 token = parseMetadataStar(token);
3312 token = parseModifiers(token); 3313 token = parseModifiers(token);
3313 token = parseTypeOpt(token); 3314 token = parseTypeOpt(token);
3314 listener.beginVariablesDeclaration(token); 3315 listener.beginVariablesDeclaration(token);
3315 token = parseOptionallyInitializedIdentifier(token); 3316 token = parseOptionallyInitializedIdentifier(token);
3316 while (optional(',', token)) { 3317 while (optional(',', token)) {
3317 token = parseOptionallyInitializedIdentifier(token.next); 3318 token = parseOptionallyInitializedIdentifier(token.next);
3318 ++count; 3319 ++count;
3319 } 3320 }
3320 if (endWithSemicolon) { 3321 if (endWithSemicolon) {
3321 Token semicolon = token; 3322 Token semicolon = token;
(...skipping 533 matching lines...) Expand 10 before | Expand all | Expand 10 after
3855 previous.setNext(firstToken); 3856 previous.setNext(firstToken);
3856 beforeToken = firstToken; 3857 beforeToken = firstToken;
3857 } 3858 }
3858 } 3859 }
3859 3860
3860 typedef FastaMessage NoArgument(Uri uri, int charOffset); 3861 typedef FastaMessage NoArgument(Uri uri, int charOffset);
3861 3862
3862 typedef FastaMessage TokenArgument(Uri uri, int charOffset, Token token); 3863 typedef FastaMessage TokenArgument(Uri uri, int charOffset, Token token);
3863 3864
3864 typedef FastaMessage StringArgument(Uri uri, int charOffset, String string); 3865 typedef FastaMessage StringArgument(Uri uri, int charOffset, String string);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698