| 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); |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 expectSemicolon(token); | 83 expectSemicolon(token); |
| 84 } else { | 84 } else { |
| 85 token = skipBlock(token); | 85 token = skipBlock(token); |
| 86 } | 86 } |
| 87 // There is no "skipped function body event", so we use | 87 // There is no "skipped function body event", so we use |
| 88 // handleNoFunctionBody instead. | 88 // handleNoFunctionBody instead. |
| 89 listener.handleNoFunctionBody(token); | 89 listener.handleNoFunctionBody(token); |
| 90 return token; | 90 return token; |
| 91 } | 91 } |
| 92 | 92 |
| 93 Token parseFormalParameters(Token token) => skipFormals(token); | 93 Token parseFormalParameters(Token token, [bool allowValuesForNamedOptionalPara
ms = true]) => skipFormals(token); |
| 94 | 94 |
| 95 Token skipFormals(Token token) { | 95 Token skipFormals(Token token) { |
| 96 listener.beginOptionalFormalParameters(token); | 96 listener.beginOptionalFormalParameters(token); |
| 97 if (!optional('(', token)) { | 97 if (!optional('(', token)) { |
| 98 if (optional(';', token)) { | 98 if (optional(';', token)) { |
| 99 listener.recoverableError("expected '('", token: token); | 99 listener.recoverableError("expected '('", token: token); |
| 100 return token; | 100 return token; |
| 101 } | 101 } |
| 102 return listener.unexpected(token); | 102 return listener.unexpected(token); |
| 103 } | 103 } |
| 104 BeginGroupToken beginGroupToken = token; | 104 BeginGroupToken beginGroupToken = token; |
| 105 Token endToken = beginGroupToken.endGroup; | 105 Token endToken = beginGroupToken.endGroup; |
| 106 listener.endFormalParameters(0, token, endToken); | 106 listener.endFormalParameters(0, token, endToken); |
| 107 return endToken.next; | 107 return endToken.next; |
| 108 } | 108 } |
| 109 } | 109 } |
| OLD | NEW |