| OLD | NEW |
| 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 part of scanner; | 5 part of scanner; |
| 6 | 6 |
| 7 /** | 7 /** |
| 8 * An event generating parser of Dart programs. This parser expects | 8 * An event generating parser of Dart programs. This parser expects |
| 9 * all tokens in a linked list (aka a token stream). | 9 * all tokens in a linked list (aka a token stream). |
| 10 * | 10 * |
| (...skipping 538 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 549 listener.handleNoType(token); | 549 listener.handleNoType(token); |
| 550 } | 550 } |
| 551 listener.endTypeVariable(token); | 551 listener.endTypeVariable(token); |
| 552 return token; | 552 return token; |
| 553 } | 553 } |
| 554 | 554 |
| 555 /** | 555 /** |
| 556 * Returns true if the stringValue of the [token] is [value]. | 556 * Returns true if the stringValue of the [token] is [value]. |
| 557 */ | 557 */ |
| 558 bool optional(String value, Token token) { | 558 bool optional(String value, Token token) { |
| 559 return identical(value, token.stringValue); | 559 return identical(value, token.stringValue); |
| 560 } | 560 } |
| 561 | 561 |
| 562 /** | 562 /** |
| 563 * Returns true if the stringValue of the [token] is either [value1], | 563 * Returns true if the stringValue of the [token] is either [value1], |
| 564 * [value2], [value3], or [value4]. | 564 * [value2], [value3], or [value4]. |
| 565 */ | 565 */ |
| 566 bool isOneOf4(Token token, | 566 bool isOneOf4(Token token, |
| 567 String value1, String value2, String value3, String value4) { | 567 String value1, String value2, String value3, String value4) { |
| 568 String stringValue = token.stringValue; | 568 String stringValue = token.stringValue; |
| 569 return identical(value1, stringValue) || | 569 return identical(value1, stringValue) || |
| (...skipping 1652 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2222 } | 2222 } |
| 2223 listener.handleContinueStatement(hasTarget, continueKeyword, token); | 2223 listener.handleContinueStatement(hasTarget, continueKeyword, token); |
| 2224 return expectSemicolon(token); | 2224 return expectSemicolon(token); |
| 2225 } | 2225 } |
| 2226 | 2226 |
| 2227 Token parseEmptyStatement(Token token) { | 2227 Token parseEmptyStatement(Token token) { |
| 2228 listener.handleEmptyStatement(token); | 2228 listener.handleEmptyStatement(token); |
| 2229 return expectSemicolon(token); | 2229 return expectSemicolon(token); |
| 2230 } | 2230 } |
| 2231 } | 2231 } |
| OLD | NEW |