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

Unified Diff: dart/lib/compiler/implementation/tree/nodes.dart

Issue 10575033: Implement override checks. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fix problem that caused an assertion failure (and revert of the first attempt) Created 8 years, 6 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 | « dart/lib/compiler/implementation/resolver.dart ('k') | dart/lib/compiler/implementation/warnings.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/lib/compiler/implementation/tree/nodes.dart
diff --git a/dart/lib/compiler/implementation/tree/nodes.dart b/dart/lib/compiler/implementation/tree/nodes.dart
index fa36ce4cddb9e200eb68fc175d4c662a8f5fed9c..4c86235772d4eb3f5a70e8eec204ca0e3d19d59d 100644
--- a/dart/lib/compiler/implementation/tree/nodes.dart
+++ b/dart/lib/compiler/implementation/tree/nodes.dart
@@ -1075,11 +1075,12 @@ class Modifiers extends Node {
static final int FLAG_CONST = FLAG_VAR << 1;
static final int FLAG_FACTORY = FLAG_CONST << 1;
- Modifiers(NodeList nodes)
- : this.nodes = nodes, flags = computeFlags(nodes.nodes);
+ Modifiers(NodeList nodes) : this.withFlags(nodes, computeFlags(nodes.nodes));
Modifiers.empty() : this(new NodeList.empty());
+ Modifiers.withFlags(this.nodes, this.flags);
+
static int computeFlags(Link<Node> nodes) {
int flags = 0;
for (; !nodes.isEmpty(); nodes = nodes.tail) {
@@ -1107,6 +1108,19 @@ class Modifiers extends Node {
bool isVar() => (flags & FLAG_VAR) != 0;
bool isConst() => (flags & FLAG_CONST) != 0;
bool isFactory() => (flags & FLAG_FACTORY) != 0;
+
+ String toString() {
+ LinkBuilder<String> builder = new LinkBuilder<String>();
+ if (isStatic()) builder.addLast('static');
+ if (isAbstract()) builder.addLast('abstract');
+ if (isFinal()) builder.addLast('final');
+ if (isVar()) builder.addLast('var');
+ if (isConst()) builder.addLast('const');
+ if (isFactory()) builder.addLast('factory');
+ StringBuffer buffer = new StringBuffer();
+ builder.toLink().printOn(buffer, ', ');
+ return buffer.toString();
+ }
}
class StringInterpolation extends StringNode {
« no previous file with comments | « dart/lib/compiler/implementation/resolver.dart ('k') | dart/lib/compiler/implementation/warnings.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698