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 1008 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 Loading... |
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 } |
OLD | NEW |