Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(108)

Side by Side Diff: pkg/compiler/lib/src/parser/member_listener.dart

Issue 3003263002: add support for native methods in class
Patch Set: update listeners Created 3 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 reporter.reportErrorMessage( 61 reporter.reportErrorMessage(
62 send.receiver, 62 send.receiver,
63 MessageKind.INVALID_CONSTRUCTOR_NAME, 63 MessageKind.INVALID_CONSTRUCTOR_NAME,
64 {'name': enclosingClass.name}); 64 {'name': enclosingClass.name});
65 } 65 }
66 return selector.source; 66 return selector.source;
67 } 67 }
68 } 68 }
69 69
70 @override 70 @override
71 void endMethod(Token getOrSet, Token beginToken, Token endToken) { 71 void endMethod(
72 super.endMethod(getOrSet, beginToken, endToken); 72 Token getOrSet, Token beginToken, Token nativeToken, Token endToken) {
73 super.endMethod(getOrSet, beginToken, nativeToken, endToken);
73 FunctionExpression method = popNode(); 74 FunctionExpression method = popNode();
74 pushNode(null); 75 pushNode(null);
75 bool isConstructor = isConstructorName(method.name); 76 bool isConstructor = isConstructorName(method.name);
76 String name = getMethodNameHack(method.name); 77 String name = getMethodNameHack(method.name);
77 Element memberElement; 78 Element memberElement;
78 if (isConstructor) { 79 if (isConstructor) {
79 if (getOrSet != null) { 80 if (getOrSet != null) {
80 recoverableError(reporter.spanFromToken(getOrSet), 'illegal modifier'); 81 recoverableError(reporter.spanFromToken(getOrSet), 'illegal modifier');
81 } 82 }
82 memberElement = new PartialConstructorElement(name, beginToken, endToken, 83 memberElement = new PartialConstructorElement(name, beginToken, endToken,
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 @override 156 @override
156 void endMetadata(Token beginToken, Token periodBeforeName, Token endToken) { 157 void endMetadata(Token beginToken, Token periodBeforeName, Token endToken) {
157 super.endMetadata(beginToken, periodBeforeName, endToken); 158 super.endMetadata(beginToken, periodBeforeName, endToken);
158 // TODO(paulberry,ahe): type variable metadata should not be ignored. See 159 // TODO(paulberry,ahe): type variable metadata should not be ignored. See
159 // dartbug.com/5841. 160 // dartbug.com/5841.
160 if (!inTypeVariable) { 161 if (!inTypeVariable) {
161 pushMetadata(new PartialMetadataAnnotation(beginToken, endToken)); 162 pushMetadata(new PartialMetadataAnnotation(beginToken, endToken));
162 } 163 }
163 } 164 }
164 } 165 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698