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

Side by Side Diff: frog/leg/tree/nodes.dart

Issue 9595017: Refactor constant part. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 Visitor<R> { 5 interface Visitor<R> {
6 R visitBlock(Block node); 6 R visitBlock(Block node);
7 R visitBreakStatement(BreakStatement node); 7 R visitBreakStatement(BreakStatement node);
8 R visitCatchBlock(CatchBlock node); 8 R visitCatchBlock(CatchBlock node);
9 R visitClassNode(ClassNode node); 9 R visitClassNode(ClassNode node);
10 R visitConditional(Conditional node); 10 R visitConditional(Conditional node);
(...skipping 707 matching lines...) Expand 10 before | Expand all | Expand 10 after
718 718
719 class DartString implements Iterable<int> { 719 class DartString implements Iterable<int> {
720 factory DartString.literal(String string) => new LiteralDartString(string); 720 factory DartString.literal(String string) => new LiteralDartString(string);
721 factory DartString.rawString(SourceString source, int length) => 721 factory DartString.rawString(SourceString source, int length) =>
722 new RawSourceDartString(source, length); 722 new RawSourceDartString(source, length);
723 factory DartString.escapedString(SourceString source, int length) => 723 factory DartString.escapedString(SourceString source, int length) =>
724 new EscapedSourceDartString(source, length); 724 new EscapedSourceDartString(source, length);
725 DartString(); 725 DartString();
726 abstract int get length(); 726 abstract int get length();
727 bool isEmpty() => length == 0; 727 bool isEmpty() => length == 0;
728 // TODO(lrn): Is this test too expensive?
729 bool definitelyEquals(DartString other) => toString() == other.toString();
730 abstract Iterator<int> iterator(); 728 abstract Iterator<int> iterator();
731 abstract String toString(); 729 abstract String toString();
732 730
733 bool operator ==(var other) { 731 bool operator ==(var other) {
734 if (other is !DartString) return false; 732 if (other is !DartString) return false;
735 DartString otherString = other; 733 DartString otherString = other;
736 if (length != otherString.length) return false; 734 if (length != otherString.length) return false;
737 Iterator it1 = iterator(); 735 Iterator it1 = iterator();
738 Iterator it2 = otherString.iterator(); 736 Iterator it2 = otherString.iterator();
739 while (it1.hasNext()) { 737 while (it1.hasNext()) {
(...skipping 875 matching lines...) Expand 10 before | Expand all | Expand 10 after
1615 static bool isConstructorRedirect(Send node) { 1613 static bool isConstructorRedirect(Send node) {
1616 return (node.receiver === null && 1614 return (node.receiver === null &&
1617 node.selector.asIdentifier() !== null && 1615 node.selector.asIdentifier() !== null &&
1618 node.selector.asIdentifier().isThis()) || 1616 node.selector.asIdentifier().isThis()) ||
1619 (node.receiver !== null && 1617 (node.receiver !== null &&
1620 node.receiver.asIdentifier() !== null && 1618 node.receiver.asIdentifier() !== null &&
1621 node.receiver.asIdentifier().isThis() && 1619 node.receiver.asIdentifier().isThis() &&
1622 node.selector.asIdentifier() !== null); 1620 node.selector.asIdentifier() !== null);
1623 } 1621 }
1624 } 1622 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698