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

Side by Side Diff: pkg/analyzer/lib/src/generated/parser.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
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 library analyzer.src.generated.parser; 5 library analyzer.src.generated.parser;
6 6
7 import 'dart:collection'; 7 import 'dart:collection';
8 import "dart:math" as math; 8 import "dart:math" as math;
9 9
10 import 'package:analyzer/dart/ast/ast.dart'; 10 import 'package:analyzer/dart/ast/ast.dart';
(...skipping 8181 matching lines...) Expand 10 before | Expand all | Expand 10 after
8192 keyword != null && 8192 keyword != null &&
8193 _tokenMatchesKeyword(keyword, Keyword.VAR)) { 8193 _tokenMatchesKeyword(keyword, Keyword.VAR)) {
8194 _reportErrorForToken(ParserErrorCode.VAR_AND_TYPE, keyword); 8194 _reportErrorForToken(ParserErrorCode.VAR_AND_TYPE, keyword);
8195 } 8195 }
8196 List<VariableDeclaration> variables = new List<VariableDeclaration>(); 8196 List<VariableDeclaration> variables = new List<VariableDeclaration>();
8197 variables.add(_parseVariableDeclaration()); 8197 variables.add(_parseVariableDeclaration());
8198 while (_matches(TokenType.COMMA)) { 8198 while (_matches(TokenType.COMMA)) {
8199 _advance(); 8199 _advance();
8200 variables.add(_parseVariableDeclaration()); 8200 variables.add(_parseVariableDeclaration());
8201 } 8201 }
8202 return new VariableDeclarationList( 8202 return new VariableDeclarationList(commentAndMetadata?.comment,
8203 commentAndMetadata != null ? commentAndMetadata.comment : null, 8203 commentAndMetadata?.metadata, keyword, type, variables);
8204 commentAndMetadata != null ? commentAndMetadata.metadata : null,
8205 keyword,
8206 type,
8207 variables);
8208 } 8204 }
8209 8205
8210 /** 8206 /**
8211 * Parse a variable declaration statement. The [commentAndMetadata] is the 8207 * Parse a variable declaration statement. The [commentAndMetadata] is the
8212 * metadata to be associated with the variable declaration statement, or 8208 * metadata to be associated with the variable declaration statement, or
8213 * `null` if there is no attempt at parsing the comment and metadata. Return 8209 * `null` if there is no attempt at parsing the comment and metadata. Return
8214 * the variable declaration statement that was parsed. 8210 * the variable declaration statement that was parsed.
8215 * 8211 *
8216 * variableDeclarationStatement ::= 8212 * variableDeclarationStatement ::=
8217 * variableDeclarationList ';' 8213 * variableDeclarationList ';'
(...skipping 1754 matching lines...) Expand 10 before | Expand all | Expand 10 after
9972 */ 9968 */
9973 const ParserErrorCode(String name, String message, [String correction]) 9969 const ParserErrorCode(String name, String message, [String correction])
9974 : super(name, message, correction); 9970 : super(name, message, correction);
9975 9971
9976 @override 9972 @override
9977 ErrorSeverity get errorSeverity => ErrorSeverity.ERROR; 9973 ErrorSeverity get errorSeverity => ErrorSeverity.ERROR;
9978 9974
9979 @override 9975 @override
9980 ErrorType get type => ErrorType.SYNTACTIC_ERROR; 9976 ErrorType get type => ErrorType.SYNTACTIC_ERROR;
9981 } 9977 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/generated/java_core.dart ('k') | pkg/analyzer/lib/src/generated/resolver.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698