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

Side by Side Diff: dart/frog/leg/compiler.dart

Issue 9692018: Unresolved super-send is not a compile-time error. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Address review coments Created 8 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | dart/frog/leg/resolver.dart » ('j') | dart/frog/leg/resolver.dart » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 class WorkItem { 5 class WorkItem {
6 final Element element; 6 final Element element;
7 TreeElements resolutionTree; 7 TreeElements resolutionTree;
8 Function run; 8 Function run;
9 Map<int, BailoutInfo> bailouts = null; 9 Map<int, BailoutInfo> bailouts = null;
10 bool allowSpeculativeOptimization = true; 10 bool allowSpeculativeOptimization = true;
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after
367 abstract void reportDiagnostic(SourceSpan span, String message, bool fatal); 367 abstract void reportDiagnostic(SourceSpan span, String message, bool fatal);
368 368
369 SourceSpan spanFromTokens(Token begin, Token end) { 369 SourceSpan spanFromTokens(Token begin, Token end) {
370 if (begin === null || end === null) { 370 if (begin === null || end === null) {
371 // TODO(ahe): We can almost always do better. Often it is only 371 // TODO(ahe): We can almost always do better. Often it is only
372 // end that is null. Otherwise, we probably know the current 372 // end that is null. Otherwise, we probably know the current
373 // URI. 373 // URI.
374 throw 'cannot find tokens to produce error message'; 374 throw 'cannot find tokens to produce error message';
375 } 375 }
376 final startOffset = begin.charOffset; 376 final startOffset = begin.charOffset;
377 // TODO(ahe): Compute proper end offset. 377 // TODO(ahe): Compute proper end offset in token. Right now we use
378 // the position of the next token. We want to preserve the
379 // invariant that endOffset > startOffset, but for EOF the
380 // charoffset of the next token may be [startOffset]. This can
381 // also happen for synthetized tokens that are produced during
382 // error handling.
378 final endOffset = 383 final endOffset =
379 (end.next !== null) ? end.next.charOffset : startOffset + 1; 384 Math.max((end.next !== null) ? end.next.charOffset : 0, startOffset + 1);
385 assert(endOffset > startOffset);
380 Uri uri = currentElement.getCompilationUnit().script.uri; 386 Uri uri = currentElement.getCompilationUnit().script.uri;
381 return new SourceSpan(uri, startOffset, endOffset); 387 return new SourceSpan(uri, startOffset, endOffset);
382 } 388 }
383 389
384 SourceSpan spanFromNode(Node node) { 390 SourceSpan spanFromNode(Node node) {
385 return spanFromTokens(node.getBeginToken(), node.getEndToken()); 391 return spanFromTokens(node.getBeginToken(), node.getEndToken());
386 } 392 }
387 393
388 SourceSpan spanFromElement(Element element) { 394 SourceSpan spanFromElement(Element element) {
389 if (element.position() === null) { 395 if (element.position() === null) {
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
470 } 476 }
471 } 477 }
472 478
473 class SourceSpan { 479 class SourceSpan {
474 final Uri uri; 480 final Uri uri;
475 final int begin; 481 final int begin;
476 final int end; 482 final int end;
477 483
478 const SourceSpan(this.uri, this.begin, this.end); 484 const SourceSpan(this.uri, this.begin, this.end);
479 } 485 }
OLDNEW
« no previous file with comments | « no previous file | dart/frog/leg/resolver.dart » ('j') | dart/frog/leg/resolver.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698