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.partial_elements; | 5 library dart2js.parser.partial_elements; |
6 | 6 |
7 import '../common.dart'; | 7 import '../common.dart'; |
8 import '../common/resolution.dart' show ParsingContext, Resolution; | 8 import '../common/resolution.dart' show ParsingContext, Resolution; |
9 import '../elements/resolution_types.dart' show ResolutionDynamicType; | 9 import '../elements/resolution_types.dart' show ResolutionDynamicType; |
10 import '../elements/elements.dart' | 10 import '../elements/elements.dart' |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 assert(identical(getOrSet.stringValue, 'set')); | 132 assert(identical(getOrSet.stringValue, 'set')); |
133 return new PartialSetterElement( | 133 return new PartialSetterElement( |
134 name, beginToken, getOrSet, endToken, modifiers, enclosingElement, | 134 name, beginToken, getOrSet, endToken, modifiers, enclosingElement, |
135 hasBody: hasBody); | 135 hasBody: hasBody); |
136 } | 136 } |
137 } | 137 } |
138 | 138 |
139 PartialFunctionElement copyWithEnclosing(Element enclosing); | 139 PartialFunctionElement copyWithEnclosing(Element enclosing); |
140 } | 140 } |
141 | 141 |
| 142 // ignore: STRONG_MODE_INVALID_METHOD_OVERRIDE_FROM_BASE |
142 class PartialMethodElement extends MethodElementX | 143 class PartialMethodElement extends MethodElementX |
143 with PartialElement, PartialFunctionMixin | 144 with PartialElement, PartialFunctionMixin |
144 implements PartialFunctionElement { | 145 implements PartialFunctionElement { |
145 PartialMethodElement(String name, Token beginToken, Token endToken, | 146 PartialMethodElement(String name, Token beginToken, Token endToken, |
146 Modifiers modifiers, Element enclosing, | 147 Modifiers modifiers, Element enclosing, |
147 {bool hasBody: true}) | 148 {bool hasBody: true}) |
148 : super(name, ElementKind.FUNCTION, modifiers, enclosing, hasBody) { | 149 : super(name, ElementKind.FUNCTION, modifiers, enclosing, hasBody) { |
149 init(beginToken, null, endToken); | 150 init(beginToken, null, endToken); |
150 } | 151 } |
151 | 152 |
152 void reuseElement() { | 153 void reuseElement() { |
153 super.reuseElement(); | 154 super.reuseElement(); |
154 reusePartialFunctionMixin(); | 155 reusePartialFunctionMixin(); |
155 } | 156 } |
156 | 157 |
157 PartialMethodElement copyWithEnclosing(Element enclosing) { | 158 PartialMethodElement copyWithEnclosing(Element enclosing) { |
158 return new PartialMethodElement( | 159 return new PartialMethodElement( |
159 name, beginToken, endToken, modifiers, enclosing, | 160 name, beginToken, endToken, modifiers, enclosing, |
160 hasBody: hasBody); | 161 hasBody: hasBody); |
161 } | 162 } |
162 } | 163 } |
163 | 164 |
| 165 // ignore: STRONG_MODE_INVALID_METHOD_OVERRIDE_FROM_BASE |
164 class PartialGetterElement extends GetterElementX | 166 class PartialGetterElement extends GetterElementX |
165 with PartialElement, PartialFunctionMixin | 167 with PartialElement, PartialFunctionMixin |
166 implements GetterElement, PartialFunctionElement { | 168 implements GetterElement, PartialFunctionElement { |
167 PartialGetterElement(String name, Token beginToken, Token getToken, | 169 PartialGetterElement(String name, Token beginToken, Token getToken, |
168 Token endToken, Modifiers modifiers, Element enclosing, | 170 Token endToken, Modifiers modifiers, Element enclosing, |
169 {bool hasBody: true}) | 171 {bool hasBody: true}) |
170 : super(name, modifiers, enclosing, hasBody) { | 172 : super(name, modifiers, enclosing, hasBody) { |
171 init(beginToken, getToken, endToken); | 173 init(beginToken, getToken, endToken); |
172 } | 174 } |
173 | 175 |
174 @override | 176 @override |
175 SetterElement get setter => abstractField.setter; | 177 SetterElement get setter => abstractField.setter; |
176 | 178 |
177 void reuseElement() { | 179 void reuseElement() { |
178 super.reuseElement(); | 180 super.reuseElement(); |
179 reusePartialFunctionMixin(); | 181 reusePartialFunctionMixin(); |
180 } | 182 } |
181 | 183 |
182 PartialGetterElement copyWithEnclosing(Element enclosing) { | 184 PartialGetterElement copyWithEnclosing(Element enclosing) { |
183 return new PartialGetterElement( | 185 return new PartialGetterElement( |
184 name, beginToken, getOrSet, endToken, modifiers, enclosing, | 186 name, beginToken, getOrSet, endToken, modifiers, enclosing, |
185 hasBody: hasBody); | 187 hasBody: hasBody); |
186 } | 188 } |
187 } | 189 } |
188 | 190 |
| 191 // ignore: STRONG_MODE_INVALID_METHOD_OVERRIDE_FROM_BASE |
189 class PartialSetterElement extends SetterElementX | 192 class PartialSetterElement extends SetterElementX |
190 with PartialElement, PartialFunctionMixin | 193 with PartialElement, PartialFunctionMixin |
191 implements SetterElement, PartialFunctionElement { | 194 implements SetterElement, PartialFunctionElement { |
192 PartialSetterElement(String name, Token beginToken, Token setToken, | 195 PartialSetterElement(String name, Token beginToken, Token setToken, |
193 Token endToken, Modifiers modifiers, Element enclosing, | 196 Token endToken, Modifiers modifiers, Element enclosing, |
194 {bool hasBody: true}) | 197 {bool hasBody: true}) |
195 : super(name, modifiers, enclosing, hasBody) { | 198 : super(name, modifiers, enclosing, hasBody) { |
196 init(beginToken, setToken, endToken); | 199 init(beginToken, setToken, endToken); |
197 } | 200 } |
198 | 201 |
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
455 } on ParserError catch (e) { | 458 } on ParserError catch (e) { |
456 partial.hasParseError = true; | 459 partial.hasParseError = true; |
457 return new ErrorNode(element.position, e.message); | 460 return new ErrorNode(element.position, e.message); |
458 } | 461 } |
459 Node node = listener.popNode(); | 462 Node node = listener.popNode(); |
460 assert(listener.nodes.isEmpty); | 463 assert(listener.nodes.isEmpty); |
461 return node; | 464 return node; |
462 }); | 465 }); |
463 }); | 466 }); |
464 } | 467 } |
OLD | NEW |