| 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 part of scanner; | 5 part of scanner; |
| 6 | 6 |
| 7 class PartialParser extends Parser { | 7 class PartialParser extends Parser { |
| 8 PartialParser(Listener listener) : super(listener); | 8 PartialParser(Listener listener) : super(listener); |
| 9 | 9 |
| 10 Token parseClassBody(Token token) => skipClassBody(token); | 10 Token parseClassBody(Token token) => skipClassBody(token); |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 } | 25 } |
| 26 } | 26 } |
| 27 | 27 |
| 28 Token skipExpression(Token token) { | 28 Token skipExpression(Token token) { |
| 29 while (true) { | 29 while (true) { |
| 30 final kind = token.kind; | 30 final kind = token.kind; |
| 31 final value = token.stringValue; | 31 final value = token.stringValue; |
| 32 if ((identical(kind, EOF_TOKEN)) || | 32 if ((identical(kind, EOF_TOKEN)) || |
| 33 (identical(value, ';')) || | 33 (identical(value, ';')) || |
| 34 (identical(value, ',')) || | 34 (identical(value, ',')) || |
| 35 (identical(value, '}')) || |
| 36 (identical(value, ')')) || |
| 35 (identical(value, ']'))) { | 37 (identical(value, ']'))) { |
| 36 break; | 38 break; |
| 37 } | 39 } |
| 38 if (identical(value, '=') || | 40 if (identical(value, '=') || |
| 39 identical(value, '?') || | 41 identical(value, '?') || |
| 40 identical(value, ':')) { | 42 identical(value, ':')) { |
| 41 var nextValue = token.next.stringValue; | 43 var nextValue = token.next.stringValue; |
| 42 if (identical(nextValue, 'const')) { | 44 if (identical(nextValue, 'const')) { |
| 43 token = token.next; | 45 token = token.next; |
| 44 nextValue = token.next.stringValue; | 46 nextValue = token.next.stringValue; |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 return token; | 136 return token; |
| 135 } | 137 } |
| 136 return listener.unexpected(token); | 138 return listener.unexpected(token); |
| 137 } | 139 } |
| 138 BeginGroupToken beginGroupToken = token; | 140 BeginGroupToken beginGroupToken = token; |
| 139 Token endToken = beginGroupToken.endGroup; | 141 Token endToken = beginGroupToken.endGroup; |
| 140 listener.endFormalParameters(0, token, endToken); | 142 listener.endFormalParameters(0, token, endToken); |
| 141 return endToken.next; | 143 return endToken.next; |
| 142 } | 144 } |
| 143 } | 145 } |
| OLD | NEW |