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

Side by Side Diff: dart/lib/compiler/implementation/scanner/partial_parser.dart

Issue 10836351: Parse metadata, but ignore it. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Address review comments Created 8 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 unified diff | Download patch | Annotate | Revision Log
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 class PartialParser extends Parser { 5 class PartialParser extends Parser {
6 PartialParser(Listener listener) : super(listener); 6 PartialParser(Listener listener) : super(listener);
7 7
8 Token parseClassBody(Token token) => skipClassBody(token); 8 Token parseClassBody(Token token) => skipClassBody(token);
9 9
10 Token fullParseClassBody(Token token) => super.parseClassBody(token); 10 Token fullParseClassBody(Token token) => super.parseClassBody(token);
11 11
12 Token parseExpression(Token token) => skipExpression(token); 12 Token parseExpression(Token token) => skipExpression(token);
13 13
14 Token parseArgumentsOpt(Token token) {
15 // This method is overridden for two reasons:
16 // 1. Avoid generating events for arguments.
17 // 2. Avoid calling skip expression for each argument (which doesn't work).
18 if (optional('(', token)) {
19 return token.endGroup.next;
20 } else {
21 return token;
22 }
23 }
24
14 Token skipExpression(Token token) { 25 Token skipExpression(Token token) {
15 while (true) { 26 while (true) {
16 final kind = token.kind; 27 final kind = token.kind;
17 final value = token.stringValue; 28 final value = token.stringValue;
18 if ((kind === EOF_TOKEN) || 29 if ((kind === EOF_TOKEN) ||
19 (value === ';') || 30 (value === ';') ||
20 (value === ',') || 31 (value === ',') ||
21 (value === ']')) 32 (value === ']'))
22 return token; 33 return token;
23 if (value === '=') { 34 if (value === '=') {
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 return token; 111 return token;
101 } 112 }
102 return listener.unexpected(token); 113 return listener.unexpected(token);
103 } 114 }
104 BeginGroupToken beginGroupToken = token; 115 BeginGroupToken beginGroupToken = token;
105 Token endToken = beginGroupToken.endGroup; 116 Token endToken = beginGroupToken.endGroup;
106 listener.endFormalParameters(0, token, endToken); 117 listener.endFormalParameters(0, token, endToken);
107 return endToken.next; 118 return endToken.next;
108 } 119 }
109 } 120 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698