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 dart_parser.class_member_parser; | 5 library dart_parser.class_member_parser; |
6 | 6 |
7 import 'package:dart_scanner/src/token.dart' show | 7 import 'package:dart_scanner/src/token.dart' show |
8 Token; | 8 Token; |
9 | 9 |
10 import 'listener.dart' show | 10 import 'listener.dart' show |
11 Listener; | 11 Listener; |
12 | 12 |
13 import 'parser.dart' show | 13 import 'parser.dart' show |
14 Parser; | 14 Parser; |
15 | 15 |
16 /// Parser similar to [TopLevelParser] but also parses class members (excluding | 16 /// Parser similar to [TopLevelParser] but also parses class members (excluding |
17 /// their bodies). | 17 /// their bodies). |
18 class ClassMemberParser extends Parser { | 18 class ClassMemberParser extends Parser { |
19 ClassMemberParser(Listener listener, | 19 ClassMemberParser(Listener listener, |
20 {bool asyncAwaitKeywordsEnabled: false, | 20 {bool asyncAwaitKeywordsEnabled: false}) |
21 bool enableGenericMethodSyntax: false}) | 21 : super(listener, asyncAwaitKeywordsEnabled: asyncAwaitKeywordsEnabled); |
22 : super(listener, asyncAwaitKeywordsEnabled: asyncAwaitKeywordsEnabled, | |
23 enableGenericMethodSyntax: enableGenericMethodSyntax); | |
24 | 22 |
25 Token parseExpression(Token token) => skipExpression(token); | 23 Token parseExpression(Token token) => skipExpression(token); |
26 | 24 |
27 // This method is overridden for two reasons: | 25 // This method is overridden for two reasons: |
28 // 1. Avoid generating events for arguments. | 26 // 1. Avoid generating events for arguments. |
29 // 2. Avoid calling skip expression for each argument (which doesn't work). | 27 // 2. Avoid calling skip expression for each argument (which doesn't work). |
30 Token parseArgumentsOpt(Token token) => skipArgumentsOpt(token); | 28 Token parseArgumentsOpt(Token token) => skipArgumentsOpt(token); |
31 | 29 |
32 Token parseFunctionBody(Token token, bool isExpression, bool allowAbstract) { | 30 Token parseFunctionBody(Token token, bool isExpression, bool allowAbstract) { |
33 return skipFunctionBody(token, isExpression, allowAbstract); | 31 return skipFunctionBody(token, isExpression, allowAbstract); |
34 } | 32 } |
35 } | 33 } |
OLD | NEW |