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

Side by Side Diff: lib/compiler/implementation/tree/nodes.dart

Issue 9976004: Allow all different string-literals in map literals. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Add description. Created 8 years, 8 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
« no previous file with comments | « lib/compiler/implementation/scanner/listener.dart ('k') | tests/co19/co19-leg.status » ('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) 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 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 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 Modifiers asModifiers() => null; 134 Modifiers asModifiers() => null;
135 NamedArgument asNamedArgument() => null; 135 NamedArgument asNamedArgument() => null;
136 NodeList asNodeList() => null; 136 NodeList asNodeList() => null;
137 Operator asOperator() => null; 137 Operator asOperator() => null;
138 ParenthesizedExpression asParenthesizedExpression() => null; 138 ParenthesizedExpression asParenthesizedExpression() => null;
139 Return asReturn() => null; 139 Return asReturn() => null;
140 ScriptTag asScriptTag() => null; 140 ScriptTag asScriptTag() => null;
141 Send asSend() => null; 141 Send asSend() => null;
142 SendSet asSendSet() => null; 142 SendSet asSendSet() => null;
143 Statement asStatement() => null; 143 Statement asStatement() => null;
144 StringNode asStringNode() => null;
144 StringInterpolation asStringInterpolation() => null; 145 StringInterpolation asStringInterpolation() => null;
145 StringInterpolationPart asStringInterpolationPart() => null; 146 StringInterpolationPart asStringInterpolationPart() => null;
146 StringJuxtaposition asStringJuxtaposition() => null; 147 StringJuxtaposition asStringJuxtaposition() => null;
147 SwitchCase asSwitchCase() => null; 148 SwitchCase asSwitchCase() => null;
148 SwitchStatement asSwitchStatement() => null; 149 SwitchStatement asSwitchStatement() => null;
149 Throw asThrow() => null; 150 Throw asThrow() => null;
150 TryStatement asTryStatement() => null; 151 TryStatement asTryStatement() => null;
151 TypeAnnotation asTypeAnnotation() => null; 152 TypeAnnotation asTypeAnnotation() => null;
152 Typedef asTypedef() => null; 153 Typedef asTypedef() => null;
153 TypeVariable asTypeVariable() => null; 154 TypeVariable asTypeVariable() => null;
(...skipping 583 matching lines...) Expand 10 before | Expand all | Expand 10 after
737 return mapping[(raw ? 1 : 0) + index * 2 + (quote === $SQ ? 8 : 0)]; 738 return mapping[(raw ? 1 : 0) + index * 2 + (quote === $SQ ? 8 : 0)];
738 } 739 }
739 } 740 }
740 741
741 /** 742 /**
742 * Superclass for classes representing string literals. 743 * Superclass for classes representing string literals.
743 */ 744 */
744 class StringNode extends Expression { 745 class StringNode extends Expression {
745 abstract DartString get dartString(); 746 abstract DartString get dartString();
746 abstract bool get isInterpolation(); 747 abstract bool get isInterpolation();
748
749 StringNode asStringNode() => this;
747 } 750 }
748 751
749 class LiteralString extends StringNode { 752 class LiteralString extends StringNode {
750 final Token token; 753 final Token token;
751 /** Non-null on validated string literals. */ 754 /** Non-null on validated string literals. */
752 final DartString dartString; 755 final DartString dartString;
753 756
754 LiteralString(this.token, this.dartString); 757 LiteralString(this.token, this.dartString);
755 758
756 LiteralString asLiteralString() => this; 759 LiteralString asLiteralString() => this;
(...skipping 883 matching lines...) Expand 10 before | Expand all | Expand 10 after
1640 * argument). 1643 * argument).
1641 * 1644 *
1642 * TODO(ahe): This method is controversial, the team needs to discuss 1645 * TODO(ahe): This method is controversial, the team needs to discuss
1643 * if top-level methods are acceptable and what naming conventions to 1646 * if top-level methods are acceptable and what naming conventions to
1644 * use. 1647 * use.
1645 */ 1648 */
1646 initializerDo(Node node, f(Node node)) { 1649 initializerDo(Node node, f(Node node)) {
1647 SendSet send = node.asSendSet(); 1650 SendSet send = node.asSendSet();
1648 if (send !== null) return f(send.arguments.head); 1651 if (send !== null) return f(send.arguments.head);
1649 } 1652 }
OLDNEW
« no previous file with comments | « lib/compiler/implementation/scanner/listener.dart ('k') | tests/co19/co19-leg.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698