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

Side by Side Diff: dart/lib/compiler/implementation/resolver.dart

Issue 10823290: Abort earlier on compilation errors (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 4 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 | « dart/lib/compiler/implementation/compiler.dart ('k') | dart/tests/co19/co19-leg.status » ('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) 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 interface TreeElements { 5 interface TreeElements {
6 Element operator[](Node node); 6 Element operator[](Node node);
7 Selector getSelector(Send send); 7 Selector getSelector(Send send);
8 Type getType(TypeAnnotation annotation); 8 Type getType(TypeAnnotation annotation);
9 } 9 }
10 10
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 compiler.withCurrentElement(cls, () => measure(() { 230 compiler.withCurrentElement(cls, () => measure(() {
231 if (cls.supertypeLoadState == ClassElement.STATE_DONE) return; 231 if (cls.supertypeLoadState == ClassElement.STATE_DONE) return;
232 if (cls.supertypeLoadState == ClassElement.STATE_STARTED) { 232 if (cls.supertypeLoadState == ClassElement.STATE_STARTED) {
233 compiler.reportMessage( 233 compiler.reportMessage(
234 compiler.spanFromNode(from), 234 compiler.spanFromNode(from),
235 MessageKind.CYCLIC_CLASS_HIERARCHY.error([cls.name]), 235 MessageKind.CYCLIC_CLASS_HIERARCHY.error([cls.name]),
236 api.Diagnostic.ERROR); 236 api.Diagnostic.ERROR);
237 cls.supertypeLoadState = ClassElement.STATE_DONE; 237 cls.supertypeLoadState = ClassElement.STATE_DONE;
238 cls.allSupertypes = const EmptyLink<Type>().prepend( 238 cls.allSupertypes = const EmptyLink<Type>().prepend(
239 compiler.objectClass.computeType(compiler)); 239 compiler.objectClass.computeType(compiler));
240 // TODO(ahe): We should also set cls.supertype here to avoid
241 // creating a malformed class hierarchy.
240 return; 242 return;
241 } 243 }
242 cls.supertypeLoadState = ClassElement.STATE_STARTED; 244 cls.supertypeLoadState = ClassElement.STATE_STARTED;
243 compiler.withCurrentElement(cls, () { 245 compiler.withCurrentElement(cls, () {
244 // TODO(ahe): Cache the node in cls. 246 // TODO(ahe): Cache the node in cls.
245 cls.parseNode(compiler).accept(new ClassSupertypeResolver(compiler, 247 cls.parseNode(compiler).accept(new ClassSupertypeResolver(compiler,
246 cls)); 248 cls));
247 if (cls.supertypeLoadState != ClassElement.STATE_DONE) { 249 if (cls.supertypeLoadState != ClassElement.STATE_DONE) {
248 cls.supertypeLoadState = ClassElement.STATE_DONE; 250 cls.supertypeLoadState = ClassElement.STATE_DONE;
249 } 251 }
(...skipping 2147 matching lines...) Expand 10 before | Expand all | Expand 10 after
2397 TopScope(LibraryElement library) : super(null, library); 2399 TopScope(LibraryElement library) : super(null, library);
2398 Element lookup(SourceString name) { 2400 Element lookup(SourceString name) {
2399 return library.find(name); 2401 return library.find(name);
2400 } 2402 }
2401 2403
2402 Element add(Element newElement) { 2404 Element add(Element newElement) {
2403 throw "Cannot add an element in the top scope"; 2405 throw "Cannot add an element in the top scope";
2404 } 2406 }
2405 String toString() => '$element'; 2407 String toString() => '$element';
2406 } 2408 }
OLDNEW
« no previous file with comments | « dart/lib/compiler/implementation/compiler.dart ('k') | dart/tests/co19/co19-leg.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698