OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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.member_listener; | 5 library dart2js.parser.member_listener; |
6 | 6 |
7 import '../common.dart'; | 7 import '../common.dart'; |
8 import '../elements/elements.dart' show | 8 import '../elements/elements.dart' show |
9 Element, | 9 Element, |
10 ElementKind, | 10 ElementKind, |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 recoverableError(getOrSet, 'illegal modifier'); | 91 recoverableError(getOrSet, 'illegal modifier'); |
92 } | 92 } |
93 memberElement = new PartialConstructorElement( | 93 memberElement = new PartialConstructorElement( |
94 name, beginToken, endToken, | 94 name, beginToken, endToken, |
95 ElementKind.GENERATIVE_CONSTRUCTOR, | 95 ElementKind.GENERATIVE_CONSTRUCTOR, |
96 method.modifiers, | 96 method.modifiers, |
97 enclosingClass); | 97 enclosingClass); |
98 } else { | 98 } else { |
99 memberElement = new PartialFunctionElement( | 99 memberElement = new PartialFunctionElement( |
100 name, beginToken, getOrSet, endToken, | 100 name, beginToken, getOrSet, endToken, |
101 method.modifiers, enclosingClass, hasBody: method.hasBody()); | 101 method.modifiers, enclosingClass, hasBody: method.hasBody); |
102 } | 102 } |
103 addMember(memberElement); | 103 addMember(memberElement); |
104 } | 104 } |
105 | 105 |
106 void endFactoryMethod(Token beginToken, Token endToken) { | 106 void endFactoryMethod(Token beginToken, Token endToken) { |
107 super.endFactoryMethod(beginToken, endToken); | 107 super.endFactoryMethod(beginToken, endToken); |
108 FunctionExpression method = popNode(); | 108 FunctionExpression method = popNode(); |
109 pushNode(null); | 109 pushNode(null); |
110 String name = getMethodNameHack(method.name); | 110 String name = getMethodNameHack(method.name); |
111 Identifier singleIdentifierName = method.name.asIdentifier(); | 111 Identifier singleIdentifierName = method.name.asIdentifier(); |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 | 163 |
164 void endMetadata(Token beginToken, Token periodBeforeName, Token endToken) { | 164 void endMetadata(Token beginToken, Token periodBeforeName, Token endToken) { |
165 popNode(); // Discard arguments. | 165 popNode(); // Discard arguments. |
166 if (periodBeforeName != null) { | 166 if (periodBeforeName != null) { |
167 popNode(); // Discard name. | 167 popNode(); // Discard name. |
168 } | 168 } |
169 popNode(); // Discard node (Send or Identifier). | 169 popNode(); // Discard node (Send or Identifier). |
170 pushMetadata(new PartialMetadataAnnotation(beginToken, endToken)); | 170 pushMetadata(new PartialMetadataAnnotation(beginToken, endToken)); |
171 } | 171 } |
172 } | 172 } |
OLD | NEW |