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

Unified Diff: runtime/vm/ast.h

Issue 935713002: Accept constant string concatenation and constant string length as constant (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 5 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | runtime/vm/ast.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/ast.h
===================================================================
--- runtime/vm/ast.h (revision 43830)
+++ runtime/vm/ast.h (working copy)
@@ -129,6 +129,14 @@
return NULL;
}
+ // Returns true if this node can be a compile-time constant, assuming
+ // that all nodes it depends on are also compile-time constants of
+ // the proper types and values.
+ // See the concept of "potentially constant expression" in the language spec.
+ // The purpose of IsPotentiallyConst is to detect cases where the node is
+ // known NOT to be a constant expression, in which case false is returned and
+ // a compile-time error is reported by the compiler. Otherwise, an error may
+ // still be reported at run-time depending on actual values.
virtual bool IsPotentiallyConst() const { return false; }
// Analyzes an expression to determine whether it is a compile time
@@ -1423,6 +1431,9 @@
virtual AstNode* MakeAssignmentNode(AstNode* rhs);
+ virtual bool IsPotentiallyConst() const;
+ virtual const Instance* EvalConstExpr() const;
+
DECLARE_COMMON_NODE_FUNCTIONS(InstanceGetterNode);
private:
« no previous file with comments | « no previous file | runtime/vm/ast.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698