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

Side by Side Diff: pkg/compiler/lib/src/tree/nodes.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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 part of tree; 5 part of tree;
6 6
7 abstract class Visitor<R> { 7 abstract class Visitor<R> {
8 const Visitor(); 8 const Visitor();
9 9
10 R visitNode(Node node); 10 R visitNode(Node node);
(...skipping 822 matching lines...) Expand 10 before | Expand all | Expand 10 after
833 visitChildren(Visitor visitor) { 833 visitChildren(Visitor visitor) {
834 if (modifiers != null) modifiers.accept(visitor); 834 if (modifiers != null) modifiers.accept(visitor);
835 if (returnType != null) returnType.accept(visitor); 835 if (returnType != null) returnType.accept(visitor);
836 if (name != null) name.accept(visitor); 836 if (name != null) name.accept(visitor);
837 if (parameters != null) parameters.accept(visitor); 837 if (parameters != null) parameters.accept(visitor);
838 if (initializers != null) initializers.accept(visitor); 838 if (initializers != null) initializers.accept(visitor);
839 if (asyncModifier != null) asyncModifier.accept(visitor); 839 if (asyncModifier != null) asyncModifier.accept(visitor);
840 if (body != null) body.accept(visitor); 840 if (body != null) body.accept(visitor);
841 } 841 }
842 842
843 bool hasBody() => body.asEmptyStatement() == null; 843 bool get hasBody => body.asEmptyStatement() == null;
844 844
845 bool hasEmptyBody() { 845 bool get hasEmptyBody {
846 Block block = body.asBlock(); 846 Block block = body.asBlock();
847 if (block == null) return false; 847 if (block == null) return false;
848 return block.statements.isEmpty; 848 return block.statements.isEmpty;
849 } 849 }
850 850
851 Token getBeginToken() { 851 Token getBeginToken() {
852 Token token = firstBeginToken(modifiers, returnType); 852 Token token = firstBeginToken(modifiers, returnType);
853 if (token != null) return token; 853 if (token != null) return token;
854 if (getOrSet != null) return getOrSet; 854 if (getOrSet != null) return getOrSet;
855 return firstBeginToken(name, parameters); 855 return firstBeginToken(name, parameters);
(...skipping 1613 matching lines...) Expand 10 before | Expand all | Expand 10 after
2469 2469
2470 // FunctionExpression. 2470 // FunctionExpression.
2471 get asyncModifier => null; 2471 get asyncModifier => null;
2472 get parameters => null; 2472 get parameters => null;
2473 get body => null; 2473 get body => null;
2474 get returnType => null; 2474 get returnType => null;
2475 get modifiers => Modifiers.EMPTY; 2475 get modifiers => Modifiers.EMPTY;
2476 get initializers => null; 2476 get initializers => null;
2477 get getOrSet => null; 2477 get getOrSet => null;
2478 get isRedirectingFactory => false; 2478 get isRedirectingFactory => false;
2479 bool hasBody() => false; 2479 bool get hasBody => false;
2480 bool hasEmptyBody() => false; 2480 bool get hasEmptyBody => false;
2481 2481
2482 // VariableDefinitions. 2482 // VariableDefinitions.
2483 get metadata => null; 2483 get metadata => null;
2484 get type => null; 2484 get type => null;
2485 2485
2486 // Typedef. 2486 // Typedef.
2487 get typeParameters => null; 2487 get typeParameters => null;
2488 get formals => null; 2488 get formals => null;
2489 get typedefKeyword => null; 2489 get typedefKeyword => null;
2490 } 2490 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/ssa/builder.dart ('k') | pkg/dart_messages/lib/generated/shared_messages.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698