| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |