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

Side by Side Diff: frog/analyze.dart

Issue 9653021: Add support for implicitly concatenating adjacent string literals. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Added test case. 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
« no previous file with comments | « no previous file | frog/gen.dart » ('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 /** 5 /**
6 * A simple code analyzer for Dart. 6 * A simple code analyzer for Dart.
7 * 7 *
8 * Currently used to ensure all concrete generic types are visited. 8 * Currently used to ensure all concrete generic types are visited.
9 * Also performs all static type checks - so these don't need to be 9 * Also performs all static type checks - so these don't need to be
10 * done in later phases. 10 * done in later phases.
(...skipping 756 matching lines...) Expand 10 before | Expand all | Expand 10 after
767 } 767 }
768 768
769 Value visitSuperExpression(SuperExpression node) { 769 Value visitSuperExpression(SuperExpression node) {
770 return _frame.makeSuperValue(node); 770 return _frame.makeSuperValue(node);
771 } 771 }
772 772
773 Value visitLiteralExpression(LiteralExpression node) { 773 Value visitLiteralExpression(LiteralExpression node) {
774 return new PureStaticValue(node.value.type, node.span, true); 774 return new PureStaticValue(node.value.type, node.span, true);
775 } 775 }
776 776
777 Value visitStringConcatExpression(StringConcatExpression node) {
778 node.strings.forEach(visitValue);
779 return _frame._makeValue(world.stringType, node);
780 }
781
777 Value visitStringInterpExpression(StringInterpExpression node) { 782 Value visitStringInterpExpression(StringInterpExpression node) {
778 node.pieces.forEach(visitValue); 783 node.pieces.forEach(visitValue);
779 return _frame._makeValue(world.stringType, node); 784 return _frame._makeValue(world.stringType, node);
780 785
781 // TODO(jimhug): Do we need this more elaborate analysis? 786 // TODO(jimhug): Do we need this more elaborate analysis?
782 /* 787 /*
783 var ret = Value.fromString('', node.span); 788 var ret = Value.fromString('', node.span);
784 789
785 for (var item in node.pieces) { 790 for (var item in node.pieces) {
786 var val = visitValue(item); 791 var val = visitValue(item);
787 var sval = val.invoke(_frame, 'toString', item, Arguments.EMPTY); 792 var sval = val.invoke(_frame, 'toString', item, Arguments.EMPTY);
788 ret = ret.binop(TokenKind.ADD, sval, _frame, item); 793 ret = ret.binop(TokenKind.ADD, sval, _frame, item);
789 } 794 }
790 return _frame._makeValue(world.stringType, node); //???ret; 795 return _frame._makeValue(world.stringType, node); //???ret;
791 */ 796 */
792 } 797 }
793 } 798 }
794 799
OLDNEW
« no previous file with comments | « no previous file | frog/gen.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698