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

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

Issue 681003002: Replace ${name} with $name where possible. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Clean up also implementation 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
« no previous file with comments | « pkg/analyzer/lib/src/analyzer_impl.dart ('k') | pkg/analyzer/lib/src/generated/constant.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) 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.ast; 8 library engine.ast;
9 9
10 import 'dart:collection'; 10 import 'dart:collection';
(...skipping 12426 matching lines...) Expand 10 before | Expand all | Expand 10 after
12437 */ 12437 */
12438 AstNode searchWithin(AstNode node) { 12438 AstNode searchWithin(AstNode node) {
12439 if (node == null) { 12439 if (node == null) {
12440 return null; 12440 return null;
12441 } 12441 }
12442 try { 12442 try {
12443 node.accept(this); 12443 node.accept(this);
12444 } on NodeLocator_NodeFoundException catch (exception) { 12444 } on NodeLocator_NodeFoundException catch (exception) {
12445 // A node with the right source position was found. 12445 // A node with the right source position was found.
12446 } catch (exception) { 12446 } catch (exception) {
12447 AnalysisEngine.instance.logger.logInformation2("Unable to locate element a t offset (${_startOffset} - ${_endOffset})", exception); 12447 AnalysisEngine.instance.logger.logInformation2("Unable to locate element a t offset ($_startOffset - $_endOffset)", exception);
12448 return null; 12448 return null;
12449 } 12449 }
12450 return _foundNode; 12450 return _foundNode;
12451 } 12451 }
12452 12452
12453 @override 12453 @override
12454 Object visitNode(AstNode node) { 12454 Object visitNode(AstNode node) {
12455 int start = node.offset; 12455 int start = node.offset;
12456 int end = start + node.length; 12456 int end = start + node.length;
12457 if (end < _startOffset) { 12457 if (end < _startOffset) {
(...skipping 7710 matching lines...) Expand 10 before | Expand all | Expand 10 after
20168 for (var i = 0; i < length; i++) { 20168 for (var i = 0; i < length; i++) {
20169 _elements[i].accept(visitor); 20169 _elements[i].accept(visitor);
20170 } 20170 }
20171 } 20171 }
20172 void add(E node) { 20172 void add(E node) {
20173 insert(length, node); 20173 insert(length, node);
20174 } 20174 }
20175 void insert(int index, E node) { 20175 void insert(int index, E node) {
20176 int length = _elements.length; 20176 int length = _elements.length;
20177 if (index < 0 || index > length) { 20177 if (index < 0 || index > length) {
20178 throw new RangeError("Index: ${index}, Size: ${_elements.length}"); 20178 throw new RangeError("Index: $index, Size: ${_elements.length}");
20179 } 20179 }
20180 owner.becomeParentOf(node); 20180 owner.becomeParentOf(node);
20181 if (length == 0) { 20181 if (length == 0) {
20182 _elements = <E> [node]; 20182 _elements = <E> [node];
20183 } else { 20183 } else {
20184 _elements.insert(index, node); 20184 _elements.insert(index, node);
20185 } 20185 }
20186 } 20186 }
20187 bool addAll(Iterable<E> nodes) { 20187 bool addAll(Iterable<E> nodes) {
20188 if (nodes != null && !nodes.isEmpty) { 20188 if (nodes != null && !nodes.isEmpty) {
20189 _elements.addAll(nodes); 20189 _elements.addAll(nodes);
20190 for (E node in nodes) { 20190 for (E node in nodes) {
20191 owner.becomeParentOf(node); 20191 owner.becomeParentOf(node);
20192 } 20192 }
20193 return true; 20193 return true;
20194 } 20194 }
20195 return false; 20195 return false;
20196 } 20196 }
20197 E operator[](int index) { 20197 E operator[](int index) {
20198 if (index < 0 || index >= _elements.length) { 20198 if (index < 0 || index >= _elements.length) {
20199 throw new RangeError("Index: ${index}, Size: ${_elements.length}"); 20199 throw new RangeError("Index: $index, Size: ${_elements.length}");
20200 } 20200 }
20201 return _elements[index] as E; 20201 return _elements[index] as E;
20202 } 20202 }
20203 20203
20204 /** 20204 /**
20205 * Return the first token included in this node's source range. 20205 * Return the first token included in this node's source range.
20206 * 20206 *
20207 * @return the first token included in this node's source range 20207 * @return the first token included in this node's source range
20208 */ 20208 */
20209 Token get beginToken { 20209 Token get beginToken {
20210 if (_elements.length == 0) { 20210 if (_elements.length == 0) {
20211 return null; 20211 return null;
20212 } 20212 }
20213 return _elements[0].beginToken; 20213 return _elements[0].beginToken;
20214 } 20214 }
20215 20215
20216 /** 20216 /**
20217 * Return the last token included in this node list's source range. 20217 * Return the last token included in this node list's source range.
20218 * 20218 *
20219 * @return the last token included in this node list's source range 20219 * @return the last token included in this node list's source range
20220 */ 20220 */
20221 Token get endToken { 20221 Token get endToken {
20222 if (_elements.length == 0) { 20222 if (_elements.length == 0) {
20223 return null; 20223 return null;
20224 } 20224 }
20225 return _elements[_elements.length - 1].endToken; 20225 return _elements[_elements.length - 1].endToken;
20226 } 20226 }
20227 E removeAt(int index) { 20227 E removeAt(int index) {
20228 if (index < 0 || index >= _elements.length) { 20228 if (index < 0 || index >= _elements.length) {
20229 throw new RangeError("Index: ${index}, Size: ${_elements.length}"); 20229 throw new RangeError("Index: $index, Size: ${_elements.length}");
20230 } 20230 }
20231 E removedNode = _elements[index] as E; 20231 E removedNode = _elements[index] as E;
20232 int length = _elements.length; 20232 int length = _elements.length;
20233 if (length == 1) { 20233 if (length == 1) {
20234 _elements = AstNode.EMPTY_ARRAY; 20234 _elements = AstNode.EMPTY_ARRAY;
20235 return removedNode; 20235 return removedNode;
20236 } 20236 }
20237 _elements.removeAt(index); 20237 _elements.removeAt(index);
20238 return removedNode; 20238 return removedNode;
20239 } 20239 }
20240 void operator[]=(int index, E node) { 20240 void operator[]=(int index, E node) {
20241 if (index < 0 || index >= _elements.length) { 20241 if (index < 0 || index >= _elements.length) {
20242 throw new RangeError("Index: ${index}, Size: ${_elements.length}"); 20242 throw new RangeError("Index: $index, Size: ${_elements.length}");
20243 } 20243 }
20244 owner.becomeParentOf(node); 20244 owner.becomeParentOf(node);
20245 _elements[index] = node; 20245 _elements[index] = node;
20246 } 20246 }
20247 void clear() { 20247 void clear() {
20248 _elements = <E> []; 20248 _elements = <E> [];
20249 } 20249 }
20250 int get length => _elements.length; 20250 int get length => _elements.length;
20251 void set length(int value) { 20251 void set length(int value) {
20252 throw new UnsupportedError("Cannot resize NodeList."); 20252 throw new UnsupportedError("Cannot resize NodeList.");
20253 } 20253 }
20254 } 20254 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/analyzer_impl.dart ('k') | pkg/analyzer/lib/src/generated/constant.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698