OLD | NEW |
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.resolver; | 5 library analyzer.src.generated.resolver; |
6 | 6 |
7 import 'dart:collection'; | 7 import 'dart:collection'; |
8 | 8 |
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 8479 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8490 // Continue the class resolution. | 8490 // Continue the class resolution. |
8491 // | 8491 // |
8492 enclosingClass = node.element; | 8492 enclosingClass = node.element; |
8493 typeAnalyzer.thisType = enclosingClass == null ? null : enclosingClass.type; | 8493 typeAnalyzer.thisType = enclosingClass == null ? null : enclosingClass.type; |
8494 node.accept(elementResolver); | 8494 node.accept(elementResolver); |
8495 node.accept(typeAnalyzer); | 8495 node.accept(typeAnalyzer); |
8496 } | 8496 } |
8497 | 8497 |
8498 @override | 8498 @override |
8499 Object visitComment(Comment node) { | 8499 Object visitComment(Comment node) { |
8500 if (node.parent is FunctionDeclaration || | 8500 AstNode parent = node.parent; |
8501 node.parent is ConstructorDeclaration || | 8501 if (parent is FunctionDeclaration || |
8502 node.parent is MethodDeclaration) { | 8502 parent is FunctionTypeAlias || |
| 8503 parent is ConstructorDeclaration || |
| 8504 parent is MethodDeclaration) { |
8503 if (!identical(node, _commentBeforeFunction)) { | 8505 if (!identical(node, _commentBeforeFunction)) { |
8504 _commentBeforeFunction = node; | 8506 _commentBeforeFunction = node; |
8505 return null; | 8507 return null; |
8506 } | 8508 } |
8507 } | 8509 } |
8508 super.visitComment(node); | 8510 super.visitComment(node); |
8509 _commentBeforeFunction = null; | 8511 _commentBeforeFunction = null; |
8510 return null; | 8512 return null; |
8511 } | 8513 } |
8512 | 8514 |
(...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8922 _enclosingFunctionTypeAlias = node; | 8924 _enclosingFunctionTypeAlias = node; |
8923 try { | 8925 try { |
8924 super.visitFunctionTypeAlias(node); | 8926 super.visitFunctionTypeAlias(node); |
8925 } finally { | 8927 } finally { |
8926 _enclosingFunctionTypeAlias = outerAlias; | 8928 _enclosingFunctionTypeAlias = outerAlias; |
8927 } | 8929 } |
8928 return null; | 8930 return null; |
8929 } | 8931 } |
8930 | 8932 |
8931 @override | 8933 @override |
| 8934 Object visitFormalParameterList(FormalParameterList node) { |
| 8935 super.visitFormalParameterList(node); |
| 8936 if (_commentBeforeFunction != null) { |
| 8937 safelyVisit(_commentBeforeFunction); |
| 8938 _commentBeforeFunction = null; |
| 8939 } |
| 8940 return null; |
| 8941 } |
| 8942 |
| 8943 @override |
8932 Object visitHideCombinator(HideCombinator node) => null; | 8944 Object visitHideCombinator(HideCombinator node) => null; |
8933 | 8945 |
8934 @override | 8946 @override |
8935 Object visitIfStatement(IfStatement node) { | 8947 Object visitIfStatement(IfStatement node) { |
8936 Expression condition = node.condition; | 8948 Expression condition = node.condition; |
8937 safelyVisit(condition); | 8949 safelyVisit(condition); |
8938 Map<VariableElement, DartType> thenOverrides = | 8950 Map<VariableElement, DartType> thenOverrides = |
8939 new HashMap<VariableElement, DartType>(); | 8951 new HashMap<VariableElement, DartType>(); |
8940 Statement thenStatement = node.thenStatement; | 8952 Statement thenStatement = node.thenStatement; |
8941 if (thenStatement != null) { | 8953 if (thenStatement != null) { |
(...skipping 4405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
13347 nonFields.add(node); | 13359 nonFields.add(node); |
13348 return null; | 13360 return null; |
13349 } | 13361 } |
13350 | 13362 |
13351 @override | 13363 @override |
13352 Object visitNode(AstNode node) => node.accept(TypeResolverVisitor_this); | 13364 Object visitNode(AstNode node) => node.accept(TypeResolverVisitor_this); |
13353 | 13365 |
13354 @override | 13366 @override |
13355 Object visitWithClause(WithClause node) => null; | 13367 Object visitWithClause(WithClause node) => null; |
13356 } | 13368 } |
OLD | NEW |