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

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

Issue 667463004: Code clean-up (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:collection'; 10 import 'dart:collection';
(...skipping 3587 matching lines...) Expand 10 before | Expand all | Expand 10 after
3598 libraryEntry.invalidateAllResolutionInformation(false); 3598 libraryEntry.invalidateAllResolutionInformation(false);
3599 _workManager.add(librarySource, SourcePriority.LIBRARY); 3599 _workManager.add(librarySource, SourcePriority.LIBRARY);
3600 for (Source partSource in includedParts) { 3600 for (Source partSource in includedParts) {
3601 SourceEntry partEntry = _cache.get(partSource); 3601 SourceEntry partEntry = _cache.get(partSource);
3602 if (partEntry is DartEntry) { 3602 if (partEntry is DartEntry) {
3603 partEntry.invalidateAllResolutionInformation(false); 3603 partEntry.invalidateAllResolutionInformation(false);
3604 } 3604 }
3605 } 3605 }
3606 } 3606 }
3607 // invalidate Angular applications 3607 // invalidate Angular applications
3608 List<AngularApplication> angularApplicationsCopy = []; 3608 List<AngularApplication> angularApplicationsCopy = <AngularApplication>[];
3609 for (AngularApplication application in angularApplicationsCopy) { 3609 for (AngularApplication application in angularApplicationsCopy) {
3610 if (application.dependsOn(librarySource)) { 3610 if (application.dependsOn(librarySource)) {
3611 Source entryPointSource = application.entryPoint; 3611 Source entryPointSource = application.entryPoint;
3612 HtmlEntry htmlEntry = _getReadableHtmlEntry(entryPointSource); 3612 HtmlEntry htmlEntry = _getReadableHtmlEntry(entryPointSource);
3613 _invalidateAngularResolution(htmlEntry); 3613 _invalidateAngularResolution(htmlEntry);
3614 _workManager.add(entryPointSource, SourcePriority.HTML); 3614 _workManager.add(entryPointSource, SourcePriority.HTML);
3615 } 3615 }
3616 } 3616 }
3617 } 3617 }
3618 3618
(...skipping 2490 matching lines...) Expand 10 before | Expand all | Expand 10 after
6109 if (formatterArguments.isEmpty) { 6109 if (formatterArguments.isEmpty) {
6110 return lastFormatter.name.end; 6110 return lastFormatter.name.end;
6111 } 6111 }
6112 return formatterArguments[formatterArguments.length - 1].expression.end; 6112 return formatterArguments[formatterArguments.length - 1].expression.end;
6113 } 6113 }
6114 6114
6115 /** 6115 /**
6116 * Return Dart [Expression]s this Angular expression consists of. 6116 * Return Dart [Expression]s this Angular expression consists of.
6117 */ 6117 */
6118 List<Expression> get expressions { 6118 List<Expression> get expressions {
6119 List<Expression> expressions = []; 6119 List<Expression> expressions = <Expression>[];
6120 expressions.add(expression); 6120 expressions.add(expression);
6121 for (AngularFormatterNode formatter in formatters) { 6121 for (AngularFormatterNode formatter in formatters) {
6122 expressions.add(formatter.name); 6122 expressions.add(formatter.name);
6123 for (AngularFormatterArgument formatterArgument in formatter.arguments) { 6123 for (AngularFormatterArgument formatterArgument in formatter.arguments) {
6124 expressions.addAll(formatterArgument.subExpressions); 6124 expressions.addAll(formatterArgument.subExpressions);
6125 expressions.add(formatterArgument.expression); 6125 expressions.add(formatterArgument.expression);
6126 } 6126 }
6127 } 6127 }
6128 return expressions; 6128 return expressions;
6129 } 6129 }
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
6308 AngularHtmlUnitResolver_FilteringAnalysisErrorListener _errorListener; 6308 AngularHtmlUnitResolver_FilteringAnalysisErrorListener _errorListener;
6309 6309
6310 final Source _source; 6310 final Source _source;
6311 6311
6312 final LineInfo _lineInfo; 6312 final LineInfo _lineInfo;
6313 6313
6314 final ht.HtmlUnit _unit; 6314 final ht.HtmlUnit _unit;
6315 6315
6316 List<AngularElement> _angularElements; 6316 List<AngularElement> _angularElements;
6317 6317
6318 List<NgProcessor> _processors = []; 6318 List<NgProcessor> _processors = <NgProcessor>[];
6319 6319
6320 LibraryElementImpl _libraryElement; 6320 LibraryElementImpl _libraryElement;
6321 6321
6322 CompilationUnitElementImpl _unitElement; 6322 CompilationUnitElementImpl _unitElement;
6323 6323
6324 FunctionElementImpl _functionElement; 6324 FunctionElementImpl _functionElement;
6325 6325
6326 ResolverVisitor _resolver; 6326 ResolverVisitor _resolver;
6327 6327
6328 bool _isAngular = false; 6328 bool _isAngular = false;
6329 6329
6330 List<LocalVariableElementImpl> _definedVariables = []; 6330 List<LocalVariableElementImpl> _definedVariables = <LocalVariableElementImpl>[ ];
6331 6331
6332 Set<LibraryElement> _injectedLibraries = new Set(); 6332 Set<LibraryElement> _injectedLibraries = new Set();
6333 6333
6334 Scope _topNameScope; 6334 Scope _topNameScope;
6335 6335
6336 Scope _nameScope; 6336 Scope _nameScope;
6337 6337
6338 AngularHtmlUnitResolver(this._context, AnalysisErrorListener errorListener, th is._source, this._lineInfo, this._unit) { 6338 AngularHtmlUnitResolver(this._context, AnalysisErrorListener errorListener, th is._source, this._lineInfo, this._unit) {
6339 this._typeProvider = _context.typeProvider; 6339 this._typeProvider = _context.typeProvider;
6340 this._errorListener = new AngularHtmlUnitResolver_FilteringAnalysisErrorList ener(errorListener); 6340 this._errorListener = new AngularHtmlUnitResolver_FilteringAnalysisErrorList ener(errorListener);
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
6528 */ 6528 */
6529 AngularExpression _parseAngularExpression(String contents, int startIndex, int endIndex, int offset) { 6529 AngularExpression _parseAngularExpression(String contents, int startIndex, int endIndex, int offset) {
6530 Token token = _scanDart(contents, startIndex, endIndex, offset); 6530 Token token = _scanDart(contents, startIndex, endIndex, offset);
6531 return _parseAngularExpressionInToken(token); 6531 return _parseAngularExpressionInToken(token);
6532 } 6532 }
6533 6533
6534 AngularExpression _parseAngularExpressionInToken(Token token) { 6534 AngularExpression _parseAngularExpressionInToken(Token token) {
6535 List<Token> tokens = _splitAtBar(token); 6535 List<Token> tokens = _splitAtBar(token);
6536 Expression mainExpression = _parseDartExpressionInToken(tokens[0]); 6536 Expression mainExpression = _parseDartExpressionInToken(tokens[0]);
6537 // parse formatters 6537 // parse formatters
6538 List<AngularFormatterNode> formatters = []; 6538 List<AngularFormatterNode> formatters = <AngularFormatterNode>[];
6539 for (int i = 1; i < tokens.length; i++) { 6539 for (int i = 1; i < tokens.length; i++) {
6540 Token formatterToken = tokens[i]; 6540 Token formatterToken = tokens[i];
6541 Token barToken = formatterToken; 6541 Token barToken = formatterToken;
6542 formatterToken = formatterToken.next; 6542 formatterToken = formatterToken.next;
6543 // parse name 6543 // parse name
6544 Expression nameExpression = _parseDartExpressionInToken(formatterToken); 6544 Expression nameExpression = _parseDartExpressionInToken(formatterToken);
6545 if (nameExpression is! SimpleIdentifier) { 6545 if (nameExpression is! SimpleIdentifier) {
6546 _reportErrorForNode(AngularCode.INVALID_FORMATTER_NAME, nameExpression, []); 6546 _reportErrorForNode(AngularCode.INVALID_FORMATTER_NAME, nameExpression, []);
6547 continue; 6547 continue;
6548 } 6548 }
6549 SimpleIdentifier name = nameExpression as SimpleIdentifier; 6549 SimpleIdentifier name = nameExpression as SimpleIdentifier;
6550 formatterToken = name.endToken.next; 6550 formatterToken = name.endToken.next;
6551 // parse arguments 6551 // parse arguments
6552 List<AngularFormatterArgument> arguments = []; 6552 List<AngularFormatterArgument> arguments = <AngularFormatterArgument>[];
6553 while (formatterToken.type != TokenType.EOF) { 6553 while (formatterToken.type != TokenType.EOF) {
6554 // skip ":" 6554 // skip ":"
6555 Token colonToken = formatterToken; 6555 Token colonToken = formatterToken;
6556 if (colonToken.type == TokenType.COLON) { 6556 if (colonToken.type == TokenType.COLON) {
6557 formatterToken = formatterToken.next; 6557 formatterToken = formatterToken.next;
6558 } else { 6558 } else {
6559 _reportErrorForToken(AngularCode.MISSING_FORMATTER_COLON, colonToken, []); 6559 _reportErrorForToken(AngularCode.MISSING_FORMATTER_COLON, colonToken, []);
6560 } 6560 }
6561 // parse argument 6561 // parse argument
6562 Expression argument = _parseDartExpressionInToken(formatterToken); 6562 Expression argument = _parseDartExpressionInToken(formatterToken);
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after
6842 _libraryElement.imports = imports; 6842 _libraryElement.imports = imports;
6843 } 6843 }
6844 } 6844 }
6845 6845
6846 void _resolveXmlExpression(AngularXmlExpression angularXmlExpression) { 6846 void _resolveXmlExpression(AngularXmlExpression angularXmlExpression) {
6847 AngularExpression angularExpression = angularXmlExpression.expression; 6847 AngularExpression angularExpression = angularXmlExpression.expression;
6848 _resolveExpression(angularExpression); 6848 _resolveExpression(angularExpression);
6849 } 6849 }
6850 6850
6851 List<Token> _splitAtBar(Token token) { 6851 List<Token> _splitAtBar(Token token) {
6852 List<Token> tokens = []; 6852 List<Token> tokens = <Token>[];
6853 tokens.add(token); 6853 tokens.add(token);
6854 while (token.type != TokenType.EOF) { 6854 while (token.type != TokenType.EOF) {
6855 if (token.type == TokenType.BAR) { 6855 if (token.type == TokenType.BAR) {
6856 tokens.add(token); 6856 tokens.add(token);
6857 Token eofToken = new Token(TokenType.EOF, 0); 6857 Token eofToken = new Token(TokenType.EOF, 0);
6858 token.previous.setNext(eofToken); 6858 token.previous.setNext(eofToken);
6859 } 6859 }
6860 token = token.next; 6860 token = token.next;
6861 } 6861 }
6862 return tokens; 6862 return tokens;
(...skipping 4382 matching lines...) Expand 10 before | Expand all | Expand 10 after
11245 TypeProvider _typeProvider; 11245 TypeProvider _typeProvider;
11246 11246
11247 final AnalysisErrorListener _errorListener; 11247 final AnalysisErrorListener _errorListener;
11248 11248
11249 final Source _source; 11249 final Source _source;
11250 11250
11251 final LineInfo _lineInfo; 11251 final LineInfo _lineInfo;
11252 11252
11253 final ht.HtmlUnit _unit; 11253 final ht.HtmlUnit _unit;
11254 11254
11255 List<PolymerTagHtmlElement> _tagHtmlElements = []; 11255 List<PolymerTagHtmlElement> _tagHtmlElements = <PolymerTagHtmlElement>[];
11256 11256
11257 ht.XmlTagNode _elementNode; 11257 ht.XmlTagNode _elementNode;
11258 11258
11259 String _elementName; 11259 String _elementName;
11260 11260
11261 PolymerTagHtmlElementImpl _htmlElement; 11261 PolymerTagHtmlElementImpl _htmlElement;
11262 11262
11263 PolymerTagDartElementImpl _dartElement; 11263 PolymerTagDartElementImpl _dartElement;
11264 11264
11265 PolymerHtmlUnitBuilder(this._context, this._errorListener, this._source, this. _lineInfo, this._unit) { 11265 PolymerHtmlUnitBuilder(this._context, this._errorListener, this._source, this. _lineInfo, this._unit) {
(...skipping 30 matching lines...) Expand all
11296 // TODO(scheglov) maybe report error (if it is allowed at all to have elem ent without Dart part) 11296 // TODO(scheglov) maybe report error (if it is allowed at all to have elem ent without Dart part)
11297 return; 11297 return;
11298 } 11298 }
11299 // prepare value of the "attributes" attribute 11299 // prepare value of the "attributes" attribute
11300 String attributesText = attributesAttribute.text; 11300 String attributesText = attributesAttribute.text;
11301 if (attributesText.trim().isEmpty) { 11301 if (attributesText.trim().isEmpty) {
11302 _reportErrorForAttribute(attributesAttribute, PolymerCode.EMPTY_ATTRIBUTES , []); 11302 _reportErrorForAttribute(attributesAttribute, PolymerCode.EMPTY_ATTRIBUTES , []);
11303 return; 11303 return;
11304 } 11304 }
11305 // prepare attribute name tokens 11305 // prepare attribute name tokens
11306 List<PolymerHtmlUnitBuilder_NameToken> nameTokens = []; 11306 List<PolymerHtmlUnitBuilder_NameToken> nameTokens = <PolymerHtmlUnitBuilder_ NameToken>[];
11307 { 11307 {
11308 int index = 0; 11308 int index = 0;
11309 int textOffset = attributesAttribute.textOffset; 11309 int textOffset = attributesAttribute.textOffset;
11310 int nameOffset = -1; 11310 int nameOffset = -1;
11311 StringBuffer nameBuffer = new StringBuffer(); 11311 StringBuffer nameBuffer = new StringBuffer();
11312 while (index < attributesText.length) { 11312 while (index < attributesText.length) {
11313 int c = attributesText.codeUnitAt(index++); 11313 int c = attributesText.codeUnitAt(index++);
11314 if (Character.isWhitespace(c)) { 11314 if (Character.isWhitespace(c)) {
11315 if (nameOffset != -1) { 11315 if (nameOffset != -1) {
11316 nameTokens.add(new PolymerHtmlUnitBuilder_NameToken(nameOffset, name Buffer.toString())); 11316 nameTokens.add(new PolymerHtmlUnitBuilder_NameToken(nameOffset, name Buffer.toString()));
(...skipping 2155 matching lines...) Expand 10 before | Expand all | Expand 10 after
13472 _index++; 13472 _index++;
13473 if (_index >= _manager._workQueues[_queueIndex].length) { 13473 if (_index >= _manager._workQueues[_queueIndex].length) {
13474 _index = 0; 13474 _index = 0;
13475 _queueIndex++; 13475 _queueIndex++;
13476 while (_queueIndex < _manager._workQueues.length && _manager._workQueues[_ queueIndex].isEmpty) { 13476 while (_queueIndex < _manager._workQueues.length && _manager._workQueues[_ queueIndex].isEmpty) {
13477 _queueIndex++; 13477 _queueIndex++;
13478 } 13478 }
13479 } 13479 }
13480 } 13480 }
13481 } 13481 }
OLDNEW
« no previous file with comments | « pkg/analysis_server/lib/src/services/refactoring/extract_local.dart ('k') | pkg/analyzer/lib/src/generated/html.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698