| 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 class FormalParameterType { | 7 class FormalParameterType { |
| 8 final String type; | 8 final String type; |
| 9 const FormalParameterType(this.type); | 9 const FormalParameterType(this.type); |
| 10 bool get isRequired => this == REQUIRED; | 10 bool get isRequired => this == REQUIRED; |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 listener.endLibraryName(libraryKeyword, semicolon); | 88 listener.endLibraryName(libraryKeyword, semicolon); |
| 89 return token; | 89 return token; |
| 90 } | 90 } |
| 91 | 91 |
| 92 /// import uri (as identifier)? combinator* ';' | 92 /// import uri (as identifier)? combinator* ';' |
| 93 Token parseImport(Token token) { | 93 Token parseImport(Token token) { |
| 94 Token importKeyword = token; | 94 Token importKeyword = token; |
| 95 listener.beginImport(importKeyword); | 95 listener.beginImport(importKeyword); |
| 96 assert(optional('import', token)); | 96 assert(optional('import', token)); |
| 97 token = parseLiteralStringOrRecoverExpression(token.next); | 97 token = parseLiteralStringOrRecoverExpression(token.next); |
| 98 Token deferredKeyword; |
| 99 if (optional('deferred', token)) { |
| 100 deferredKeyword = token; |
| 101 token = token.next; |
| 102 } |
| 98 Token asKeyword; | 103 Token asKeyword; |
| 99 if (optional('as', token)) { | 104 if (optional('as', token)) { |
| 100 asKeyword = token; | 105 asKeyword = token; |
| 101 token = parseIdentifier(token.next); | 106 token = parseIdentifier(token.next); |
| 102 } | 107 } |
| 103 token = parseCombinators(token); | 108 token = parseCombinators(token); |
| 104 Token semicolon = token; | 109 Token semicolon = token; |
| 105 token = expect(';', token); | 110 token = expect(';', token); |
| 106 listener.endImport(importKeyword, asKeyword, semicolon); | 111 listener.endImport(importKeyword, deferredKeyword, asKeyword, semicolon); |
| 107 return token; | 112 return token; |
| 108 } | 113 } |
| 109 | 114 |
| 110 /// export uri combinator* ';' | 115 /// export uri combinator* ';' |
| 111 Token parseExport(Token token) { | 116 Token parseExport(Token token) { |
| 112 Token exportKeyword = token; | 117 Token exportKeyword = token; |
| 113 listener.beginExport(exportKeyword); | 118 listener.beginExport(exportKeyword); |
| 114 assert(optional('export', token)); | 119 assert(optional('export', token)); |
| 115 token = parseLiteralStringOrRecoverExpression(token.next); | 120 token = parseLiteralStringOrRecoverExpression(token.next); |
| 116 token = parseCombinators(token); | 121 token = parseCombinators(token); |
| (...skipping 2316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2433 } | 2438 } |
| 2434 listener.handleContinueStatement(hasTarget, continueKeyword, token); | 2439 listener.handleContinueStatement(hasTarget, continueKeyword, token); |
| 2435 return expectSemicolon(token); | 2440 return expectSemicolon(token); |
| 2436 } | 2441 } |
| 2437 | 2442 |
| 2438 Token parseEmptyStatement(Token token) { | 2443 Token parseEmptyStatement(Token token) { |
| 2439 listener.handleEmptyStatement(token); | 2444 listener.handleEmptyStatement(token); |
| 2440 return expectSemicolon(token); | 2445 return expectSemicolon(token); |
| 2441 } | 2446 } |
| 2442 } | 2447 } |
| OLD | NEW |