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

Side by Side Diff: pkg/analyzer/test/src/summary/element_text.dart

Issue 2981303002: Include default values for default field formal parameters into text dump. (Closed)
Patch Set: Remove debug output. Created 3 years, 5 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
« no previous file with comments | « no previous file | pkg/analyzer/test/src/summary/resynthesize_common.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 570 matching lines...) Expand 10 before | Expand all | Expand 10 after
581 buffer.write(' show '); 581 buffer.write(' show ');
582 buffer.write(e.shownNames.join(', ')); 582 buffer.write(e.shownNames.join(', '));
583 } else if (e is HideElementCombinator) { 583 } else if (e is HideElementCombinator) {
584 buffer.write(' hide '); 584 buffer.write(' hide ');
585 buffer.write(e.hiddenNames.join(', ')); 585 buffer.write(e.hiddenNames.join(', '));
586 } 586 }
587 } 587 }
588 588
589 void writeParameterElement(ParameterElement e) { 589 void writeParameterElement(ParameterElement e) {
590 String defaultValueSeparator; 590 String defaultValueSeparator;
591 Expression defaultValue = 591 Expression defaultValue = e is ConstVariableElement
592 e is DefaultParameterElementImpl ? e.constantInitializer : null; 592 ? (e as ConstVariableElement).constantInitializer
593 : null;
593 String closeString; 594 String closeString;
594 ParameterKind kind = e.parameterKind; 595 ParameterKind kind = e.parameterKind;
595 if (kind == ParameterKind.REQUIRED) { 596 if (kind == ParameterKind.REQUIRED) {
596 closeString = ''; 597 closeString = '';
597 } else if (kind == ParameterKind.POSITIONAL) { 598 } else if (kind == ParameterKind.POSITIONAL) {
598 buffer.write('['); 599 buffer.write('[');
599 defaultValueSeparator = ' = '; 600 defaultValueSeparator = ' = ';
600 closeString = ']'; 601 closeString = ']';
601 } else if (kind == ParameterKind.NAMED) { 602 } else if (kind == ParameterKind.NAMED) {
602 buffer.write('{'); 603 buffer.write('{');
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
858 return components.join(';'); 859 return components.join(';');
859 } 860 }
860 } 861 }
861 862
862 class _Replacement { 863 class _Replacement {
863 final int offset; 864 final int offset;
864 final int end; 865 final int end;
865 final String text; 866 final String text;
866 _Replacement(this.offset, this.end, this.text); 867 _Replacement(this.offset, this.end, this.text);
867 } 868 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer/test/src/summary/resynthesize_common.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698