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

Side by Side Diff: pkg/compiler/lib/src/elements/modelx.dart

Issue 1661853005: Introduce getPrefixEndToken to avoid too big context in messages. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Updated cf. comments. Created 4 years, 10 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/compiler/lib/src/diagnostics/source_span.dart ('k') | pkg/compiler/lib/src/tree/nodes.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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 elements.modelx; 5 library elements.modelx;
6 6
7 import '../common.dart'; 7 import '../common.dart';
8 import '../common/resolution.dart' show 8 import '../common/resolution.dart' show
9 Resolution, 9 Resolution,
10 Parsing; 10 Parsing;
(...skipping 2097 matching lines...) Expand 10 before | Expand all | Expand 10 after
2108 : super(name, kind, modifiers, enclosing); 2108 : super(name, kind, modifiers, enclosing);
2109 2109
2110 MemberElement get memberContext => this; 2110 MemberElement get memberContext => this;
2111 2111
2112 @override 2112 @override
2113 SourceSpan get sourcePosition { 2113 SourceSpan get sourcePosition {
2114 SourceSpan span = super.sourcePosition; 2114 SourceSpan span = super.sourcePosition;
2115 if (span != null && hasNode) { 2115 if (span != null && hasNode) {
2116 FunctionExpression functionExpression = node.asFunctionExpression(); 2116 FunctionExpression functionExpression = node.asFunctionExpression();
2117 if (functionExpression != null) { 2117 if (functionExpression != null) {
2118 Token begin = functionExpression.getBeginToken(); 2118 span = new SourceSpan.fromNode(span.uri, functionExpression);
2119 Token end;
2120 if (functionExpression.parameters != null) {
2121 end = functionExpression.parameters.getEndToken();
2122 } else {
2123 end = functionExpression.name.getEndToken();
2124 }
2125 span = new SourceSpan.fromTokens(span.uri, begin, end);
2126 } 2119 }
2127 } 2120 }
2128 return span; 2121 return span;
2129 } 2122 }
2130 2123
2131 void reuseElement() { 2124 void reuseElement() {
2132 super.reuseElement(); 2125 super.reuseElement();
2133 nestedClosures.clear(); 2126 nestedClosures.clear();
2134 _functionSignatureCache = null; 2127 _functionSignatureCache = null;
2135 typeCache = null; 2128 typeCache = null;
(...skipping 1092 matching lines...) Expand 10 before | Expand all | Expand 10 after
3228 AstElement get definingElement; 3221 AstElement get definingElement;
3229 3222
3230 bool get hasResolvedAst => definingElement.hasTreeElements; 3223 bool get hasResolvedAst => definingElement.hasTreeElements;
3231 3224
3232 ResolvedAst get resolvedAst { 3225 ResolvedAst get resolvedAst {
3233 return new ResolvedAst(declaration, 3226 return new ResolvedAst(declaration,
3234 definingElement.node, definingElement.treeElements); 3227 definingElement.node, definingElement.treeElements);
3235 } 3228 }
3236 3229
3237 } 3230 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/diagnostics/source_span.dart ('k') | pkg/compiler/lib/src/tree/nodes.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698