Chromium Code Reviews| OLD | NEW |
|---|---|
| 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) { | |
|
ngeoffray
2012/08/21 06:28:31
Could you comment on why metadata needs you to add
ahe
2012/08/21 10:49:46
Done.
| |
| 15 if (optional('(', token)) { | |
| 16 return token.endGroup.next; | |
| 17 } else { | |
| 18 return token; | |
| 19 } | |
| 20 } | |
| 21 | |
| 14 Token skipExpression(Token token) { | 22 Token skipExpression(Token token) { |
| 15 while (true) { | 23 while (true) { |
| 16 final kind = token.kind; | 24 final kind = token.kind; |
| 17 final value = token.stringValue; | 25 final value = token.stringValue; |
| 18 if ((kind === EOF_TOKEN) || | 26 if ((kind === EOF_TOKEN) || |
| 19 (value === ';') || | 27 (value === ';') || |
| 20 (value === ',') || | 28 (value === ',') || |
| 21 (value === ']')) | 29 (value === ']')) |
| 22 return token; | 30 return token; |
| 23 if (value === '=') { | 31 if (value === '=') { |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 100 return token; | 108 return token; |
| 101 } | 109 } |
| 102 return listener.unexpected(token); | 110 return listener.unexpected(token); |
| 103 } | 111 } |
| 104 BeginGroupToken beginGroupToken = token; | 112 BeginGroupToken beginGroupToken = token; |
| 105 Token endToken = beginGroupToken.endGroup; | 113 Token endToken = beginGroupToken.endGroup; |
| 106 listener.endFormalParameters(0, token, endToken); | 114 listener.endFormalParameters(0, token, endToken); |
| 107 return endToken.next; | 115 return endToken.next; |
| 108 } | 116 } |
| 109 } | 117 } |
| OLD | NEW |