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 library dart2js.parser.partial; | 5 library dart2js.parser.partial; |
6 | 6 |
7 import '../common.dart'; | 7 import '../common.dart'; |
8 import '../util/characters.dart' as Characters show | 8 import '../util/characters.dart' as Characters show |
9 $CLOSE_CURLY_BRACKET; | 9 $CLOSE_CURLY_BRACKET; |
10 import '../tokens/token.dart' show | 10 import '../tokens/token.dart' show |
11 BeginGroupToken, | 11 BeginGroupToken, |
12 ErrorToken, | 12 ErrorToken, |
13 Token; | 13 Token; |
14 import '../tokens/token_constants.dart' as Tokens show | 14 import '../tokens/token_constants.dart' as Tokens show |
15 EOF_TOKEN; | 15 EOF_TOKEN; |
16 | 16 |
17 import 'listener.dart' show | 17 import 'listener.dart' show |
18 Listener; | 18 Listener; |
19 import 'parser.dart' show | 19 import 'parser.dart' show |
20 Parser; | 20 Parser; |
21 | 21 |
22 class PartialParser extends Parser { | 22 class PartialParser extends Parser { |
23 PartialParser(Listener listener) : super(listener); | 23 PartialParser(Listener listener, {bool enableConditionalDirectives}) |
| 24 : super(listener, |
| 25 enableConditionalDirectives: enableConditionalDirectives); |
24 | 26 |
25 Token parseClassBody(Token token) => skipClassBody(token); | 27 Token parseClassBody(Token token) => skipClassBody(token); |
26 | 28 |
27 Token fullParseClassBody(Token token) => super.parseClassBody(token); | 29 Token fullParseClassBody(Token token) => super.parseClassBody(token); |
28 | 30 |
29 Token parseExpression(Token token) => skipExpression(token); | 31 Token parseExpression(Token token) => skipExpression(token); |
30 | 32 |
31 Token parseArgumentsOpt(Token token) { | 33 Token parseArgumentsOpt(Token token) { |
32 // This method is overridden for two reasons: | 34 // This method is overridden for two reasons: |
33 // 1. Avoid generating events for arguments. | 35 // 1. Avoid generating events for arguments. |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 return token; | 174 return token; |
173 } | 175 } |
174 return listener.unexpected(token); | 176 return listener.unexpected(token); |
175 } | 177 } |
176 BeginGroupToken beginGroupToken = token; | 178 BeginGroupToken beginGroupToken = token; |
177 Token endToken = beginGroupToken.endGroup; | 179 Token endToken = beginGroupToken.endGroup; |
178 listener.endFormalParameters(0, token, endToken); | 180 listener.endFormalParameters(0, token, endToken); |
179 return endToken.next; | 181 return endToken.next; |
180 } | 182 } |
181 } | 183 } |
OLD | NEW |