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

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

Issue 2853113002: Infer types of double literals. (Closed)
Patch Set: Add expectations for compile/outline pipelines. 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 1286 matching lines...) Expand 10 before | Expand all | Expand 10 after
1297 void handleLiteralBool(Token token) { 1297 void handleLiteralBool(Token token) {
1298 debugEvent("LiteralBool"); 1298 debugEvent("LiteralBool");
1299 bool value = optional("true", token); 1299 bool value = optional("true", token);
1300 assert(value || optional("false", token)); 1300 assert(value || optional("false", token));
1301 push(new BoolLiteral(value)..fileOffset = token.charOffset); 1301 push(new BoolLiteral(value)..fileOffset = token.charOffset);
1302 } 1302 }
1303 1303
1304 @override 1304 @override
1305 void handleLiteralDouble(Token token) { 1305 void handleLiteralDouble(Token token) {
1306 debugEvent("LiteralDouble"); 1306 debugEvent("LiteralDouble");
1307 push(new DoubleLiteral(double.parse(token.lexeme)) 1307 push(astFactory.doubleLiteral(double.parse(token.lexeme), token));
1308 ..fileOffset = token.charOffset);
1309 } 1308 }
1310 1309
1311 @override 1310 @override
1312 void handleLiteralNull(Token token) { 1311 void handleLiteralNull(Token token) {
1313 debugEvent("LiteralNull"); 1312 debugEvent("LiteralNull");
1314 push(new NullLiteral()..fileOffset = token.charOffset); 1313 push(new NullLiteral()..fileOffset = token.charOffset);
1315 } 1314 }
1316 1315
1317 @override 1316 @override
1318 void handleLiteralMap( 1317 void handleLiteralMap(
(...skipping 1810 matching lines...) Expand 10 before | Expand all | Expand 10 after
3129 } else if (node is PrefixBuilder) { 3128 } else if (node is PrefixBuilder) {
3130 return node.name; 3129 return node.name;
3131 } else if (node is ThisAccessor) { 3130 } else if (node is ThisAccessor) {
3132 return node.isSuper ? "super" : "this"; 3131 return node.isSuper ? "super" : "this";
3133 } else if (node is FastaAccessor) { 3132 } else if (node is FastaAccessor) {
3134 return node.plainNameForRead; 3133 return node.plainNameForRead;
3135 } else { 3134 } else {
3136 return internalError("Unhandled: ${node.runtimeType}"); 3135 return internalError("Unhandled: ${node.runtimeType}");
3137 } 3136 }
3138 } 3137 }
OLDNEW
« no previous file with comments | « pkg/front_end/lib/src/fasta/builder/ast_factory.dart ('k') | pkg/front_end/lib/src/fasta/kernel/kernel_ast_factory.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698