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

Side by Side Diff: pkg/compiler/lib/src/elements/modelx.dart

Issue 1248483008: Split MessageKind into a MessageKind key and a MessageTemplate. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Updated cf. comments. Created 5 years, 4 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
« no previous file with comments | « pkg/compiler/lib/src/dump_info.dart ('k') | pkg/compiler/lib/src/io/start_end_information.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 elements.modelx; 5 library elements.modelx;
6 6
7 import 'common.dart'; 7 import 'common.dart';
8 import 'elements.dart'; 8 import 'elements.dart';
9 import '../constants/expressions.dart'; 9 import '../constants/expressions.dart';
10 import '../constants/constructors.dart'; 10 import '../constants/constructors.dart';
11 import '../helpers/helpers.dart'; 11 import '../helpers/helpers.dart';
12 import '../tree/tree.dart'; 12 import '../tree/tree.dart';
13 import '../util/util.dart'; 13 import '../util/util.dart';
14 import '../resolution/resolution.dart'; 14 import '../resolution/resolution.dart';
15 import '../resolution/class_members.dart' show ClassMemberMixin; 15 import '../resolution/class_members.dart' show ClassMemberMixin;
16 16
17 import '../dart2jslib.dart' show 17 import '../dart2jslib.dart' show
18 Backend, 18 Backend,
19 Compiler, 19 Compiler,
20 Constant, 20 Constant,
21 DartType, 21 DartType,
22 DiagnosticListener, 22 DiagnosticListener,
23 DualKind, 23 DualKind,
24 FunctionType, 24 FunctionType,
25 InterfaceType, 25 InterfaceType,
26 MessageKind, 26 MessageKind,
27 MessageTemplate,
27 Script, 28 Script,
28 Selector, 29 Selector,
29 SourceSpan, 30 SourceSpan,
30 TypeVariableType, 31 TypeVariableType,
31 TypedefType, 32 TypedefType,
32 invariant, 33 invariant,
33 isPrivateName; 34 isPrivateName;
34 35
35 import '../dart_types.dart'; 36 import '../dart_types.dart';
36 37
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 bool get hasFunctionSignature => false; 302 bool get hasFunctionSignature => false;
302 303
303 get effectiveTarget => this; 304 get effectiveTarget => this;
304 305
305 computeEffectiveTargetType(InterfaceType newType) => unsupported(); 306 computeEffectiveTargetType(InterfaceType newType) => unsupported();
306 307
307 get definingConstructor => null; 308 get definingConstructor => null;
308 309
309 FunctionElement asFunctionElement() => this; 310 FunctionElement asFunctionElement() => this;
310 311
311 String get message => '${messageKind.message(messageArguments)}'; 312 String get message {
313 return MessageTemplate.TEMPLATES[messageKind]
314 .message(messageArguments).toString();
315 }
312 316
313 String toString() => '<$name: $message>'; 317 String toString() => '<$name: $message>';
314 318
315 accept(ElementVisitor visitor, arg) { 319 accept(ElementVisitor visitor, arg) {
316 return visitor.visitErroneousElement(this, arg); 320 return visitor.visitErroneousElement(this, arg);
317 } 321 }
318 322
319 @override 323 @override
320 bool get isFromEnvironmentConstructor => false; 324 bool get isFromEnvironmentConstructor => false;
321 } 325 }
(...skipping 2576 matching lines...) Expand 10 before | Expand all | Expand 10 after
2898 AstElement get definingElement; 2902 AstElement get definingElement;
2899 2903
2900 bool get hasResolvedAst => definingElement.hasTreeElements; 2904 bool get hasResolvedAst => definingElement.hasTreeElements;
2901 2905
2902 ResolvedAst get resolvedAst { 2906 ResolvedAst get resolvedAst {
2903 return new ResolvedAst(declaration, 2907 return new ResolvedAst(declaration,
2904 definingElement.node, definingElement.treeElements); 2908 definingElement.node, definingElement.treeElements);
2905 } 2909 }
2906 2910
2907 } 2911 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/dump_info.dart ('k') | pkg/compiler/lib/src/io/start_end_information.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698