OLD | NEW |
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2017, 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 import 'dart:io'; | 5 import 'dart:io'; |
6 | 6 |
7 import 'package:analyzer/dart/ast/ast.dart'; | 7 import 'package:analyzer/dart/ast/ast.dart'; |
8 import 'package:analyzer/dart/ast/token.dart'; | 8 import 'package:analyzer/dart/ast/token.dart'; |
9 import 'package:analyzer/dart/element/element.dart'; | 9 import 'package:analyzer/dart/element/element.dart'; |
10 import 'package:analyzer/dart/element/type.dart'; | 10 import 'package:analyzer/dart/element/type.dart'; |
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
354 buffer.write('const '); | 354 buffer.write('const '); |
355 } | 355 } |
356 if (e.typeArguments != null) { | 356 if (e.typeArguments != null) { |
357 writeList('<', '>', e.typeArguments.arguments, ', ', writeExpression); | 357 writeList('<', '>', e.typeArguments.arguments, ', ', writeExpression); |
358 } | 358 } |
359 writeList('{', '}', e.entries, ', ', writeExpression, includeEmpty: true); | 359 writeList('{', '}', e.entries, ', ', writeExpression, includeEmpty: true); |
360 } else if (e is MapLiteralEntry) { | 360 } else if (e is MapLiteralEntry) { |
361 writeExpression(e.key); | 361 writeExpression(e.key); |
362 buffer.write(': '); | 362 buffer.write(': '); |
363 writeExpression(e.value); | 363 writeExpression(e.value); |
| 364 } else if (e is MethodInvocation) { |
| 365 if (e.target != null) { |
| 366 writeExpression(e.target); |
| 367 buffer.write(e.operator); |
| 368 } |
| 369 writeExpression(e.methodName); |
| 370 if (e.typeArguments != null) { |
| 371 writeList('<', '>', e.typeArguments.arguments, ', ', writeExpression); |
| 372 } |
| 373 writeList('(', ')', e.argumentList.arguments, ', ', writeExpression, |
| 374 includeEmpty: true); |
364 } else if (e is NamedExpression) { | 375 } else if (e is NamedExpression) { |
365 writeExpression(e.name); | 376 writeExpression(e.name); |
366 buffer.write(e.expression); | 377 buffer.write(e.expression); |
367 } else if (e is NullLiteral) { | 378 } else if (e is NullLiteral) { |
368 buffer.write('null'); | 379 buffer.write('null'); |
369 } else if (e is PrefixExpression) { | 380 } else if (e is PrefixExpression) { |
370 buffer.write(e.operator.lexeme); | 381 buffer.write(e.operator.lexeme); |
371 writeExpression(e.operand, e); | 382 writeExpression(e.operand, e); |
372 } else if (e is PrefixedIdentifier) { | 383 } else if (e is PrefixedIdentifier) { |
373 writeExpression(e.prefix); | 384 writeExpression(e.prefix); |
(...skipping 504 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
878 return components.join(';'); | 889 return components.join(';'); |
879 } | 890 } |
880 } | 891 } |
881 | 892 |
882 class _Replacement { | 893 class _Replacement { |
883 final int offset; | 894 final int offset; |
884 final int end; | 895 final int end; |
885 final String text; | 896 final String text; |
886 _Replacement(this.offset, this.end, this.text); | 897 _Replacement(this.offset, this.end, this.text); |
887 } | 898 } |
OLD | NEW |