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

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

Issue 1768143003: Use specific messages for const constructor with body. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Updated cf. comments. Created 4 years, 9 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 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
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
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 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/diagnostics/messages.dart ('k') | pkg/compiler/lib/src/resolution/constructors.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698