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

Side by Side Diff: pkg/front_end/lib/src/fasta/kernel/body_builder.dart

Issue 2855403002: Type inference for StringConcatenation. (Closed)
Patch Set: Fixes for review comments. Created 3 years, 7 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
OLDNEW
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, 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 library fasta.body_builder; 5 library fasta.body_builder;
6 6
7 import '../fasta_codes.dart' 7 import '../fasta_codes.dart'
8 show FastaMessage, codeExpectedButGot, codeExpectedFunctionBody; 8 show FastaMessage, codeExpectedButGot, codeExpectedFunctionBody;
9 9
10 import '../parser/parser.dart' show FormalParameterType, optional; 10 import '../parser/parser.dart' show FormalParameterType, optional;
(...skipping 1008 matching lines...) Expand 10 before | Expand all | Expand 10 after
1019 if (expressions == null) { 1019 if (expressions == null) {
1020 expressions = parts.sublist(0, i); 1020 expressions = parts.sublist(0, i);
1021 } 1021 }
1022 expressions.addAll(part.expressions); 1022 expressions.addAll(part.expressions);
1023 } else { 1023 } else {
1024 if (expressions != null) { 1024 if (expressions != null) {
1025 expressions.add(part); 1025 expressions.add(part);
1026 } 1026 }
1027 } 1027 }
1028 } 1028 }
1029 push(new StringConcatenation(expressions ?? parts)); 1029 push(astFactory.stringConcatenation(expressions ?? parts, null));
1030 } 1030 }
1031 1031
1032 @override 1032 @override
1033 void handleLiteralInt(Token token) { 1033 void handleLiteralInt(Token token) {
1034 debugEvent("LiteralInt"); 1034 debugEvent("LiteralInt");
1035 push(astFactory.intLiteral(int.parse(token.lexeme), token)); 1035 push(astFactory.intLiteral(int.parse(token.lexeme), token));
1036 } 1036 }
1037 1037
1038 @override 1038 @override
1039 void handleEmptyFunctionBody(Token semicolon) { 1039 void handleEmptyFunctionBody(Token semicolon) {
(...skipping 2091 matching lines...) Expand 10 before | Expand all | Expand 10 after
3131 } else if (node is PrefixBuilder) { 3131 } else if (node is PrefixBuilder) {
3132 return node.name; 3132 return node.name;
3133 } else if (node is ThisAccessor) { 3133 } else if (node is ThisAccessor) {
3134 return node.isSuper ? "super" : "this"; 3134 return node.isSuper ? "super" : "this";
3135 } else if (node is FastaAccessor) { 3135 } else if (node is FastaAccessor) {
3136 return node.plainNameForRead; 3136 return node.plainNameForRead;
3137 } else { 3137 } else {
3138 return internalError("Unhandled: ${node.runtimeType}"); 3138 return internalError("Unhandled: ${node.runtimeType}");
3139 } 3139 }
3140 } 3140 }
OLDNEW
« no previous file with comments | « pkg/analyzer_cli/analyzer_cli.iml ('k') | pkg/front_end/lib/src/fasta/kernel/kernel_shadow_ast.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698