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

Side by Side Diff: pkg/analyzer/lib/src/generated/engine.dart

Issue 736603005: Rollback r41807. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 1 month 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
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 // This code was auto-generated, is not intended to be edited, and is subject to 5 // This code was auto-generated, is not intended to be edited, and is subject to
6 // significant change. Please see the README file for more information. 6 // significant change. Please see the README file for more information.
7 7
8 library engine; 8 library engine;
9 9
10 import "dart:math" as math; 10 import "dart:math" as math;
(...skipping 1695 matching lines...) Expand 10 before | Expand all | Expand 10 after
1706 @override 1706 @override
1707 InternalAnalysisContext getContextFor(Source source) { 1707 InternalAnalysisContext getContextFor(Source source) {
1708 InternalAnalysisContext context = _cache.getContextFor(source); 1708 InternalAnalysisContext context = _cache.getContextFor(source);
1709 return context == null ? this : context; 1709 return context == null ? this : context;
1710 } 1710 }
1711 1711
1712 @override 1712 @override
1713 Element getElement(ElementLocation location) { 1713 Element getElement(ElementLocation location) {
1714 // TODO(brianwilkerson) This should not be a "get" method. 1714 // TODO(brianwilkerson) This should not be a "get" method.
1715 try { 1715 try {
1716 if (location is DartElementLocation) { 1716 List<String> components = location.components;
1717 String libSourceEncoding = location.librarySourceEncoding; 1717 Source source = _computeSourceFromEncoding(components[0]);
1718 Source libSource = _computeSourceFromEncoding(libSourceEncoding); 1718 String sourceName = source.shortName;
1719 LibraryElementImpl libElement = computeLibraryElement(libSource); 1719 if (AnalysisEngine.isDartFileName(sourceName)) {
1720 return libElement.getChildElement( 1720 ElementImpl element = computeLibraryElement(source) as ElementImpl;
1721 location.unitSourceEncoding, 1721 for (int i = 1; i < components.length; i++) {
1722 location.nameOffset, 1722 if (element == null) {
1723 location.kind); 1723 return null;
1724 }
1725 element = element.getChild(components[i]);
1726 }
1727 return element;
1724 } 1728 }
1725 // TODO(scheglov) add HtmlElementLocation 1729 if (AnalysisEngine.isHtmlFileName(sourceName)) {
1730 return computeHtmlElement(source);
1731 }
1726 } on AnalysisException catch (exception) { 1732 } on AnalysisException catch (exception) {
1727 } 1733 }
1728 return null; 1734 return null;
1729 } 1735 }
1730 1736
1731 @override 1737 @override
1732 AnalysisErrorInfo getErrors(Source source) { 1738 AnalysisErrorInfo getErrors(Source source) {
1733 SourceEntry sourceEntry = _getReadableSourceEntryOrNull(source); 1739 SourceEntry sourceEntry = _getReadableSourceEntryOrNull(source);
1734 if (sourceEntry is DartEntry) { 1740 if (sourceEntry is DartEntry) {
1735 DartEntry dartEntry = sourceEntry; 1741 DartEntry dartEntry = sourceEntry;
(...skipping 12946 matching lines...) Expand 10 before | Expand all | Expand 10 after
14682 14688
14683 @override 14689 @override
14684 Object visitPolymerTagDartElement(PolymerTagDartElement element) { 14690 Object visitPolymerTagDartElement(PolymerTagDartElement element) {
14685 if (element.name == PolymerHtmlUnitBuilder_this._elementName) { 14691 if (element.name == PolymerHtmlUnitBuilder_this._elementName) {
14686 throw new PolymerHtmlUnitBuilder_FoundTagDartElementError( 14692 throw new PolymerHtmlUnitBuilder_FoundTagDartElementError(
14687 element as PolymerTagDartElementImpl); 14693 element as PolymerTagDartElementImpl);
14688 } 14694 }
14689 return null; 14695 return null;
14690 } 14696 }
14691 } 14697 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/generated/element.dart ('k') | pkg/analyzer/test/generated/element_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698