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

Side by Side Diff: pkg/analyzer/lib/dart/ast/ast.dart

Issue 1933763002: Use null-aware operators to clean up the code (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Additional clean-up Created 4 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
« no previous file with comments | « no previous file | pkg/analyzer/lib/file_system/file_system.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) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 /** 5 /**
6 * Defines the AST model. The AST (Abstract Syntax Tree) model describes the 6 * Defines the AST model. The AST (Abstract Syntax Tree) model describes the
7 * syntactic (as opposed to semantic) structure of Dart code. The semantic 7 * syntactic (as opposed to semantic) structure of Dart code. The semantic
8 * structure of the code is modeled by the 8 * structure of the code is modeled by the
9 * [element model](../element/element.dart). 9 * [element model](../element/element.dart).
10 * 10 *
(...skipping 4449 matching lines...) Expand 10 before | Expand all | Expand 10 after
4460 if (compare != 0) { 4460 if (compare != 0) {
4461 return compare; 4461 return compare;
4462 } 4462 }
4463 } 4463 }
4464 } 4464 }
4465 // 4465 //
4466 // as 4466 // as
4467 // 4467 //
4468 SimpleIdentifier prefix1 = import1.prefix; 4468 SimpleIdentifier prefix1 = import1.prefix;
4469 SimpleIdentifier prefix2 = import2.prefix; 4469 SimpleIdentifier prefix2 = import2.prefix;
4470 String prefixStr1 = prefix1 != null ? prefix1.name : null; 4470 String prefixStr1 = prefix1?.name;
4471 String prefixStr2 = prefix2 != null ? prefix2.name : null; 4471 String prefixStr2 = prefix2?.name;
4472 if (prefixStr1 != null || prefixStr2 != null) { 4472 if (prefixStr1 != null || prefixStr2 != null) {
4473 if (prefixStr1 == null) { 4473 if (prefixStr1 == null) {
4474 return -1; 4474 return -1;
4475 } else if (prefixStr2 == null) { 4475 } else if (prefixStr2 == null) {
4476 return 1; 4476 return 1;
4477 } else { 4477 } else {
4478 int compare = prefixStr1.compareTo(prefixStr2); 4478 int compare = prefixStr1.compareTo(prefixStr2);
4479 if (compare != 0) { 4479 if (compare != 0) {
4480 return compare; 4480 return compare;
4481 } 4481 }
(...skipping 3623 matching lines...) Expand 10 before | Expand all | Expand 10 after
8105 /** 8105 /**
8106 * Return the 'yield' keyword. 8106 * Return the 'yield' keyword.
8107 */ 8107 */
8108 Token get yieldKeyword; 8108 Token get yieldKeyword;
8109 8109
8110 /** 8110 /**
8111 * Return the 'yield' keyword to the given [token]. 8111 * Return the 'yield' keyword to the given [token].
8112 */ 8112 */
8113 void set yieldKeyword(Token token); 8113 void set yieldKeyword(Token token);
8114 } 8114 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer/lib/file_system/file_system.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698