| 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 /** | 5 /** |
| 6 * An event generating parser of Dart programs. This parser expects | 6 * An event generating parser of Dart programs. This parser expects |
| 7 * all tokens in a linked list (aka a token stream). | 7 * all tokens in a linked list (aka a token stream). |
| 8 * | 8 * |
| 9 * The class [Scanner] is used to generate a token stream. See the | 9 * The class [Scanner] is used to generate a token stream. See the |
| 10 * file scanner.dart. | 10 * file scanner.dart. |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 223 if (optional('extends', token)) { | 223 if (optional('extends', token)) { |
| 224 extendsKeyword = token; | 224 extendsKeyword = token; |
| 225 token = parseType(token.next); | 225 token = parseType(token.next); |
| 226 } else { | 226 } else { |
| 227 extendsKeyword = null; | 227 extendsKeyword = null; |
| 228 listener.handleNoType(token); | 228 listener.handleNoType(token); |
| 229 } | 229 } |
| 230 Token implementsKeyword; | 230 Token implementsKeyword; |
| 231 int interfacesCount = 0; | 231 int interfacesCount = 0; |
| 232 if (optional('implements', token)) { | 232 if (optional('implements', token)) { |
| 233 implementsKeyword = token; |
| 233 do { | 234 do { |
| 234 token = parseType(token.next); | 235 token = parseType(token.next); |
| 235 ++interfacesCount; | 236 ++interfacesCount; |
| 236 } while (optional(',', token)); | 237 } while (optional(',', token)); |
| 237 } | 238 } |
| 238 token = parseClassBody(token); | 239 token = parseClassBody(token); |
| 239 listener.endClassDeclaration(interfacesCount, begin, extendsKeyword, | 240 listener.endClassDeclaration(interfacesCount, begin, extendsKeyword, |
| 240 implementsKeyword, token); | 241 implementsKeyword, token); |
| 241 return token.next; | 242 return token.next; |
| 242 } | 243 } |
| (...skipping 1471 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1714 } | 1715 } |
| 1715 listener.handleContinueStatement(hasTarget, continueKeyword, token); | 1716 listener.handleContinueStatement(hasTarget, continueKeyword, token); |
| 1716 return expectSemicolon(token); | 1717 return expectSemicolon(token); |
| 1717 } | 1718 } |
| 1718 | 1719 |
| 1719 Token parseEmptyStatement(Token token) { | 1720 Token parseEmptyStatement(Token token) { |
| 1720 listener.handleEmptyStatement(token); | 1721 listener.handleEmptyStatement(token); |
| 1721 return expectSemicolon(token); | 1722 return expectSemicolon(token); |
| 1722 } | 1723 } |
| 1723 } | 1724 } |
| OLD | NEW |