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

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

Issue 2342383002: Initial support for the NNBD proposal (Closed)
Patch Set: Addressed comments and added tests Created 4 years, 3 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 | « pkg/analyzer/lib/dart/ast/ast.dart ('k') | pkg/analyzer/lib/src/dart/ast/utilities.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 library analyzer.src.dart.ast.ast; 5 library analyzer.src.dart.ast.ast;
6 6
7 import 'dart:collection'; 7 import 'dart:collection';
8 8
9 import 'package:analyzer/dart/ast/ast.dart'; 9 import 'package:analyzer/dart/ast/ast.dart';
10 import 'package:analyzer/dart/ast/token.dart'; 10 import 'package:analyzer/dart/ast/token.dart';
(...skipping 5435 matching lines...) Expand 10 before | Expand all | Expand 10 after
5446 * The type parameters associated with the function, or `null` if the function 5446 * The type parameters associated with the function, or `null` if the function
5447 * is not a generic function. 5447 * is not a generic function.
5448 */ 5448 */
5449 TypeParameterList _typeParameters; 5449 TypeParameterList _typeParameters;
5450 5450
5451 /** 5451 /**
5452 * The parameters of the function-typed parameter. 5452 * The parameters of the function-typed parameter.
5453 */ 5453 */
5454 FormalParameterList _parameters; 5454 FormalParameterList _parameters;
5455 5455
5456 @override
5457 Token question;
5458
5456 /** 5459 /**
5457 * Initialize a newly created formal parameter. Either or both of the 5460 * Initialize a newly created formal parameter. Either or both of the
5458 * [comment] and [metadata] can be `null` if the parameter does not have the 5461 * [comment] and [metadata] can be `null` if the parameter does not have the
5459 * corresponding attribute. The [returnType] can be `null` if no return type 5462 * corresponding attribute. The [returnType] can be `null` if no return type
5460 * was specified. 5463 * was specified.
5461 */ 5464 */
5462 FunctionTypedFormalParameterImpl( 5465 FunctionTypedFormalParameterImpl(
5463 CommentImpl comment, 5466 CommentImpl comment,
5464 List<Annotation> metadata, 5467 List<Annotation> metadata,
5465 TypeNameImpl returnType, 5468 TypeNameImpl returnType,
5466 SimpleIdentifierImpl identifier, 5469 SimpleIdentifierImpl identifier,
5467 TypeParameterListImpl typeParameters, 5470 TypeParameterListImpl typeParameters,
5468 FormalParameterListImpl parameters) 5471 FormalParameterListImpl parameters,
5472 this.question)
5469 : super(comment, metadata, identifier) { 5473 : super(comment, metadata, identifier) {
5470 _returnType = _becomeParentOf(returnType); 5474 _returnType = _becomeParentOf(returnType);
5471 _typeParameters = _becomeParentOf(typeParameters); 5475 _typeParameters = _becomeParentOf(typeParameters);
5472 _parameters = _becomeParentOf(parameters); 5476 _parameters = _becomeParentOf(parameters);
5473 } 5477 }
5474 5478
5475 @override 5479 @override
5476 Token get beginToken { 5480 Token get beginToken {
5477 if (_returnType != null) { 5481 if (_returnType != null) {
5478 return _returnType.beginToken; 5482 return _returnType.beginToken;
(...skipping 4804 matching lines...) Expand 10 before | Expand all | Expand 10 after
10283 * The name of the type. 10287 * The name of the type.
10284 */ 10288 */
10285 Identifier _name; 10289 Identifier _name;
10286 10290
10287 /** 10291 /**
10288 * The type arguments associated with the type, or `null` if there are no type 10292 * The type arguments associated with the type, or `null` if there are no type
10289 * arguments. 10293 * arguments.
10290 */ 10294 */
10291 TypeArgumentList _typeArguments; 10295 TypeArgumentList _typeArguments;
10292 10296
10297 @override
10298 Token question;
10299
10293 /** 10300 /**
10294 * The type being named, or `null` if the AST structure has not been resolved. 10301 * The type being named, or `null` if the AST structure has not been resolved.
10295 */ 10302 */
10296 DartType type; 10303 DartType type;
10297 10304
10298 /** 10305 /**
10299 * Initialize a newly created type name. The [typeArguments] can be `null` if 10306 * Initialize a newly created type name. The [typeArguments] can be `null` if
10300 * there are no type arguments. 10307 * there are no type arguments.
10301 */ 10308 */
10302 TypeNameImpl(IdentifierImpl name, TypeArgumentListImpl typeArguments) { 10309 TypeNameImpl(
10310 IdentifierImpl name, TypeArgumentListImpl typeArguments, this.question) {
10303 _name = _becomeParentOf(name); 10311 _name = _becomeParentOf(name);
10304 _typeArguments = _becomeParentOf(typeArguments); 10312 _typeArguments = _becomeParentOf(typeArguments);
10305 } 10313 }
10306 10314
10307 @override 10315 @override
10308 Token get beginToken => _name.beginToken; 10316 Token get beginToken => _name.beginToken;
10309 10317
10310 @override 10318 @override
10311 Iterable get childEntities => 10319 Iterable get childEntities =>
10312 new ChildEntities()..add(_name)..add(_typeArguments); 10320 new ChildEntities()..add(_name)..add(_typeArguments);
(...skipping 770 matching lines...) Expand 10 before | Expand all | Expand 10 after
11083 11091
11084 @override 11092 @override
11085 dynamic/*=E*/ accept/*<E>*/(AstVisitor/*<E>*/ visitor) => 11093 dynamic/*=E*/ accept/*<E>*/(AstVisitor/*<E>*/ visitor) =>
11086 visitor.visitYieldStatement(this); 11094 visitor.visitYieldStatement(this);
11087 11095
11088 @override 11096 @override
11089 void visitChildren(AstVisitor visitor) { 11097 void visitChildren(AstVisitor visitor) {
11090 _expression?.accept(visitor); 11098 _expression?.accept(visitor);
11091 } 11099 }
11092 } 11100 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/dart/ast/ast.dart ('k') | pkg/analyzer/lib/src/dart/ast/utilities.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698