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

Side by Side Diff: frog/tree.g.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 | « frog/parser.dart ('k') | tests/language/language-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) 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 // Generated by scripts/tree_gen.py. 4 // Generated by scripts/tree_gen.py.
5 5
6 class DirectiveDefinition extends Definition { 6 class DirectiveDefinition extends Definition {
7 Identifier name; 7 Identifier name;
8 List<ArgumentNode> arguments; 8 List<ArgumentNode> arguments;
9 9
10 DirectiveDefinition(this.name, this.arguments, SourceSpan span): super(span) { } 10 DirectiveDefinition(this.name, this.arguments, SourceSpan span): super(span) { }
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after
362 } 362 }
363 363
364 class LiteralExpression extends Expression { 364 class LiteralExpression extends Expression {
365 Value value; 365 Value value;
366 366
367 LiteralExpression(this.value, SourceSpan span): super(span) {} 367 LiteralExpression(this.value, SourceSpan span): super(span) {}
368 368
369 visit(TreeVisitor visitor) => visitor.visitLiteralExpression(this); 369 visit(TreeVisitor visitor) => visitor.visitLiteralExpression(this);
370 } 370 }
371 371
372 class StringConcatExpression extends Expression {
373 List<Expression> strings;
374
375 StringConcatExpression(this.strings, SourceSpan span): super(span) {}
376
377 visit(TreeVisitor visitor) => visitor.visitStringConcatExpression(this);
378 }
379
372 class StringInterpExpression extends Expression { 380 class StringInterpExpression extends Expression {
373 List<Expression> pieces; 381 List<Expression> pieces;
374 382
375 StringInterpExpression(this.pieces, SourceSpan span): super(span) {} 383 StringInterpExpression(this.pieces, SourceSpan span): super(span) {}
376 384
377 visit(TreeVisitor visitor) => visitor.visitStringInterpExpression(this); 385 visit(TreeVisitor visitor) => visitor.visitStringInterpExpression(this);
378 } 386 }
379 387
380 class SimpleTypeReference extends TypeReference { 388 class SimpleTypeReference extends TypeReference {
381 Type type; 389 Type type;
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
567 visitDotExpression(DotExpression node); 575 visitDotExpression(DotExpression node);
568 576
569 visitVarExpression(VarExpression node); 577 visitVarExpression(VarExpression node);
570 578
571 visitThisExpression(ThisExpression node); 579 visitThisExpression(ThisExpression node);
572 580
573 visitSuperExpression(SuperExpression node); 581 visitSuperExpression(SuperExpression node);
574 582
575 visitLiteralExpression(LiteralExpression node); 583 visitLiteralExpression(LiteralExpression node);
576 584
585 visitStringConcatExpression(StringConcatExpression node);
586
577 visitStringInterpExpression(StringInterpExpression node); 587 visitStringInterpExpression(StringInterpExpression node);
578 588
579 visitSimpleTypeReference(SimpleTypeReference node); 589 visitSimpleTypeReference(SimpleTypeReference node);
580 590
581 visitNameTypeReference(NameTypeReference node); 591 visitNameTypeReference(NameTypeReference node);
582 592
583 visitGenericTypeReference(GenericTypeReference node); 593 visitGenericTypeReference(GenericTypeReference node);
584 594
585 visitFunctionTypeReference(FunctionTypeReference node); 595 visitFunctionTypeReference(FunctionTypeReference node);
586 596
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
840 } 850 }
841 851
842 void visitSuperExpression(SuperExpression node) { 852 void visitSuperExpression(SuperExpression node) {
843 output.heading('SuperExpression', node.span); 853 output.heading('SuperExpression', node.span);
844 } 854 }
845 855
846 void visitLiteralExpression(LiteralExpression node) { 856 void visitLiteralExpression(LiteralExpression node) {
847 output.heading('LiteralExpression(' + output.toValue(node.value) + ")", node .span); 857 output.heading('LiteralExpression(' + output.toValue(node.value) + ")", node .span);
848 } 858 }
849 859
860 void visitStringConcatExpression(StringConcatExpression node) {
861 output.heading('StringConcatExpression', node.span);
862 output.writeNodeList('strings', node.strings);
863 }
864
850 void visitStringInterpExpression(StringInterpExpression node) { 865 void visitStringInterpExpression(StringInterpExpression node) {
851 output.heading('StringInterpExpression', node.span); 866 output.heading('StringInterpExpression', node.span);
852 output.writeNodeList('pieces', node.pieces); 867 output.writeNodeList('pieces', node.pieces);
853 } 868 }
854 869
855 void visitSimpleTypeReference(SimpleTypeReference node) { 870 void visitSimpleTypeReference(SimpleTypeReference node) {
856 output.heading('SimpleTypeReference(' + output.toValue(node.type) + ")", nod e.span); 871 output.heading('SimpleTypeReference(' + output.toValue(node.type) + ")", nod e.span);
857 } 872 }
858 873
859 void visitNameTypeReference(NameTypeReference node) { 874 void visitNameTypeReference(NameTypeReference node) {
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
923 } 938 }
924 939
925 void visitDeclaredIdentifier(DeclaredIdentifier node) { 940 void visitDeclaredIdentifier(DeclaredIdentifier node) {
926 output.heading('DeclaredIdentifier', node.span); 941 output.heading('DeclaredIdentifier', node.span);
927 output.writeNode('type', node.type); 942 output.writeNode('type', node.type);
928 output.writeNode('name', node.name); 943 output.writeNode('name', node.name);
929 output.writeValue('isFinal', node.isFinal); 944 output.writeValue('isFinal', node.isFinal);
930 } 945 }
931 946
932 } 947 }
OLDNEW
« no previous file with comments | « frog/parser.dart ('k') | tests/language/language-leg.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698