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

Side by Side Diff: lib/compiler/implementation/constant_system.dart

Issue 10916232: Implement checked mode for const constructors. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 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 | Annotate | Revision Log
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 interface Operation { 5 interface Operation {
6 final SourceString name; 6 final SourceString name;
7 bool isUserDefinable(); 7 bool isUserDefinable();
8 } 8 }
9 9
10 interface UnaryOperation extends Operation { 10 interface UnaryOperation extends Operation {
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 BinaryOperation get shiftRight; 43 BinaryOperation get shiftRight;
44 BinaryOperation get subtract; 44 BinaryOperation get subtract;
45 BinaryOperation get truncatingDivide; 45 BinaryOperation get truncatingDivide;
46 46
47 Constant createInt(int i); 47 Constant createInt(int i);
48 Constant createDouble(double d); 48 Constant createDouble(double d);
49 // We need a diagnostic node to report errors in case the string is malformed. 49 // We need a diagnostic node to report errors in case the string is malformed.
50 Constant createString(DartString string, Node diagnosticNode); 50 Constant createString(DartString string, Node diagnosticNode);
51 Constant createBool(bool value); 51 Constant createBool(bool value);
52 Constant createNull(); 52 Constant createNull();
53 bool isSubtype(Compiler compiler, DartType s, DartType t);
kasperl 2012/09/14 05:53:34 Add a comment that explains why the constant syste
ngeoffray 2012/09/14 09:44:56 Done.
53 54
54 /** Returns true if the [constant] is an integer at runtime. */ 55 /** Returns true if the [constant] is an integer at runtime. */
55 bool isInt(Constant constant); 56 bool isInt(Constant constant);
56 /** Returns true if the [constant] is a double at runtime. */ 57 /** Returns true if the [constant] is a double at runtime. */
57 bool isDouble(Constant constant); 58 bool isDouble(Constant constant);
58 /** Returns true if the [constant] is a string at runtime. */ 59 /** Returns true if the [constant] is a string at runtime. */
59 bool isString(Constant constant); 60 bool isString(Constant constant);
60 /** Returns true if the [constant] is a boolean at runtime. */ 61 /** Returns true if the [constant] is a boolean at runtime. */
61 bool isBool(Constant constant); 62 bool isBool(Constant constant);
62 /** Returns true if the [constant] is null at runtime. */ 63 /** Returns true if the [constant] is null at runtime. */
63 bool isNull(Constant constant); 64 bool isNull(Constant constant);
64 } 65 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698