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 Element, ElementKind, Elements; | 8 import '../elements/elements.dart' show Element, ElementKind, Elements; |
9 import '../elements/modelx.dart' | 9 import '../elements/modelx.dart' |
10 show ClassElementX, ElementX, FieldElementX, VariableList; | 10 show ClassElementX, ElementX, FieldElementX, VariableList; |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 name, | 109 name, |
110 beginToken, | 110 beginToken, |
111 endToken, | 111 endToken, |
112 ElementKind.FACTORY_CONSTRUCTOR, | 112 ElementKind.FACTORY_CONSTRUCTOR, |
113 method.modifiers, | 113 method.modifiers, |
114 enclosingClass); | 114 enclosingClass); |
115 addMember(memberElement); | 115 addMember(memberElement); |
116 } | 116 } |
117 | 117 |
118 @override | 118 @override |
119 void endFields( | 119 void endFields(int count, Token beginToken, Token endToken) { |
120 int count, Token covariantKeyword, Token beginToken, Token endToken) { | |
121 bool hasParseError = memberErrors.head; | 120 bool hasParseError = memberErrors.head; |
122 super.endFields(count, covariantKeyword, beginToken, endToken); | 121 super.endFields(count, beginToken, endToken); |
123 VariableDefinitions variableDefinitions = popNode(); | 122 VariableDefinitions variableDefinitions = popNode(); |
124 Modifiers modifiers = variableDefinitions.modifiers; | 123 Modifiers modifiers = variableDefinitions.modifiers; |
125 pushNode(null); | 124 pushNode(null); |
126 void buildFieldElement(Identifier name, VariableList fields) { | 125 void buildFieldElement(Identifier name, VariableList fields) { |
127 Element element = new FieldElementX(name, enclosingClass, fields); | 126 Element element = new FieldElementX(name, enclosingClass, fields); |
128 addMember(element); | 127 addMember(element); |
129 } | 128 } |
130 | 129 |
131 buildFieldElements(modifiers, variableDefinitions.definitions, | 130 buildFieldElements(modifiers, variableDefinitions.definitions, |
132 enclosingClass, buildFieldElement, beginToken, endToken, hasParseError); | 131 enclosingClass, buildFieldElement, beginToken, endToken, hasParseError); |
(...skipping 23 matching lines...) Expand all Loading... |
156 @override | 155 @override |
157 void endMetadata(Token beginToken, Token periodBeforeName, Token endToken) { | 156 void endMetadata(Token beginToken, Token periodBeforeName, Token endToken) { |
158 super.endMetadata(beginToken, periodBeforeName, endToken); | 157 super.endMetadata(beginToken, periodBeforeName, endToken); |
159 // TODO(paulberry,ahe): type variable metadata should not be ignored. See | 158 // TODO(paulberry,ahe): type variable metadata should not be ignored. See |
160 // dartbug.com/5841. | 159 // dartbug.com/5841. |
161 if (!inTypeVariable) { | 160 if (!inTypeVariable) { |
162 pushMetadata(new PartialMetadataAnnotation(beginToken, endToken)); | 161 pushMetadata(new PartialMetadataAnnotation(beginToken, endToken)); |
163 } | 162 } |
164 } | 163 } |
165 } | 164 } |
OLD | NEW |