| OLD | NEW |
| 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 2203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2214 void setProperty(String propertyName, Object propertyValue) { | 2214 void setProperty(String propertyName, Object propertyValue) { |
| 2215 if (propertyValue == null) { | 2215 if (propertyValue == null) { |
| 2216 if (_propertyMap != null) { | 2216 if (_propertyMap != null) { |
| 2217 _propertyMap.remove(propertyName); | 2217 _propertyMap.remove(propertyName); |
| 2218 if (_propertyMap.isEmpty) { | 2218 if (_propertyMap.isEmpty) { |
| 2219 _propertyMap = null; | 2219 _propertyMap = null; |
| 2220 } | 2220 } |
| 2221 } | 2221 } |
| 2222 } else { | 2222 } else { |
| 2223 if (_propertyMap == null) { | 2223 if (_propertyMap == null) { |
| 2224 _propertyMap = new Map<String, Object>(); | 2224 _propertyMap = new HashMap<String, Object>(); |
| 2225 } | 2225 } |
| 2226 _propertyMap[propertyName] = propertyValue; | 2226 _propertyMap[propertyName] = propertyValue; |
| 2227 } | 2227 } |
| 2228 } | 2228 } |
| 2229 | 2229 |
| 2230 /** | 2230 /** |
| 2231 * Return a textual description of this node in a form approximating valid sou
rce. The returned | 2231 * Return a textual description of this node in a form approximating valid sou
rce. The returned |
| 2232 * string will not be valid source primarily in the case where the node itself
is not well-formed. | 2232 * string will not be valid source primarily in the case where the node itself
is not well-formed. |
| 2233 * | 2233 * |
| 2234 * @return the source code equivalent of this node | 2234 * @return the source code equivalent of this node |
| (...skipping 2312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4547 if (identical(value, NOT_A_CONSTANT)) { | 4547 if (identical(value, NOT_A_CONSTANT)) { |
| 4548 return value; | 4548 return value; |
| 4549 } | 4549 } |
| 4550 list.add(value); | 4550 list.add(value); |
| 4551 } | 4551 } |
| 4552 return list; | 4552 return list; |
| 4553 } | 4553 } |
| 4554 | 4554 |
| 4555 @override | 4555 @override |
| 4556 Object visitMapLiteral(MapLiteral node) { | 4556 Object visitMapLiteral(MapLiteral node) { |
| 4557 Map<String, Object> map = new Map<String, Object>(); | 4557 HashMap<String, Object> map = new HashMap<String, Object>(); |
| 4558 for (MapLiteralEntry entry in node.entries) { | 4558 for (MapLiteralEntry entry in node.entries) { |
| 4559 Object key = entry.key.accept(this); | 4559 Object key = entry.key.accept(this); |
| 4560 Object value = entry.value.accept(this); | 4560 Object value = entry.value.accept(this); |
| 4561 if (key is! String || identical(value, NOT_A_CONSTANT)) { | 4561 if (key is! String || identical(value, NOT_A_CONSTANT)) { |
| 4562 return NOT_A_CONSTANT; | 4562 return NOT_A_CONSTANT; |
| 4563 } | 4563 } |
| 4564 map[(key as String)] = value; | 4564 map[(key as String)] = value; |
| 4565 } | 4565 } |
| 4566 return map; | 4566 return map; |
| 4567 } | 4567 } |
| (...skipping 9933 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 14501 * first name seen is the most specific one so names are not redefined. | 14501 * first name seen is the most specific one so names are not redefined. |
| 14502 * | 14502 * |
| 14503 * Completion test code coverage is 95%. The two basic blocks that are not execu
ted cannot be | 14503 * Completion test code coverage is 95%. The two basic blocks that are not execu
ted cannot be |
| 14504 * executed. They are included for future reference. | 14504 * executed. They are included for future reference. |
| 14505 */ | 14505 */ |
| 14506 class ScopedNameFinder extends GeneralizingAstVisitor<Object> { | 14506 class ScopedNameFinder extends GeneralizingAstVisitor<Object> { |
| 14507 Declaration _declarationNode; | 14507 Declaration _declarationNode; |
| 14508 | 14508 |
| 14509 AstNode _immediateChild; | 14509 AstNode _immediateChild; |
| 14510 | 14510 |
| 14511 Map<String, SimpleIdentifier> _locals = new Map<String, SimpleIdentifier>(); | 14511 Map<String, SimpleIdentifier> _locals = new HashMap<String, SimpleIdentifier>(
); |
| 14512 | 14512 |
| 14513 final int _position; | 14513 final int _position; |
| 14514 | 14514 |
| 14515 bool _referenceIsWithinLocalFunction = false; | 14515 bool _referenceIsWithinLocalFunction = false; |
| 14516 | 14516 |
| 14517 ScopedNameFinder(this._position); | 14517 ScopedNameFinder(this._position); |
| 14518 | 14518 |
| 14519 Declaration get declaration => _declarationNode; | 14519 Declaration get declaration => _declarationNode; |
| 14520 | 14520 |
| 14521 Map<String, SimpleIdentifier> get locals => _locals; | 14521 Map<String, SimpleIdentifier> get locals => _locals; |
| (...skipping 3776 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 18298 /** | 18298 /** |
| 18299 * Set the URI referenced by this directive to the given URI. | 18299 * Set the URI referenced by this directive to the given URI. |
| 18300 * | 18300 * |
| 18301 * @param uri the URI referenced by this directive | 18301 * @param uri the URI referenced by this directive |
| 18302 */ | 18302 */ |
| 18303 void set uri(StringLiteral uri) { | 18303 void set uri(StringLiteral uri) { |
| 18304 this._uri = becomeParentOf(uri); | 18304 this._uri = becomeParentOf(uri); |
| 18305 } | 18305 } |
| 18306 | 18306 |
| 18307 /** | 18307 /** |
| 18308 * Validate the given directive, but do not check for existance. | 18308 * Validate the given directive, but do not check for existence. |
| 18309 * | 18309 * |
| 18310 * @return a code indicating the problem if there is one, or `null` no problem | 18310 * @return a code indicating the problem if there is one, or `null` no problem |
| 18311 */ | 18311 */ |
| 18312 UriValidationCode validate() { | 18312 UriValidationCode validate() { |
| 18313 StringLiteral uriLiteral = uri; | 18313 StringLiteral uriLiteral = uri; |
| 18314 if (uriLiteral is StringInterpolation) { | 18314 if (uriLiteral is StringInterpolation) { |
| 18315 return UriValidationCode.URI_WITH_INTERPOLATION; | 18315 return UriValidationCode.URI_WITH_INTERPOLATION; |
| 18316 } | 18316 } |
| 18317 String uriContent = this.uriContent; | 18317 String uriContent = this.uriContent; |
| 18318 if (uriContent == null) { | 18318 if (uriContent == null) { |
| (...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 18581 * Set the type of the variables being declared to the given type name. | 18581 * Set the type of the variables being declared to the given type name. |
| 18582 * | 18582 * |
| 18583 * @param typeName the type of the variables being declared | 18583 * @param typeName the type of the variables being declared |
| 18584 */ | 18584 */ |
| 18585 void set type(TypeName typeName) { | 18585 void set type(TypeName typeName) { |
| 18586 _type = becomeParentOf(typeName); | 18586 _type = becomeParentOf(typeName); |
| 18587 } | 18587 } |
| 18588 | 18588 |
| 18589 @override | 18589 @override |
| 18590 void visitChildren(AstVisitor visitor) { | 18590 void visitChildren(AstVisitor visitor) { |
| 18591 super.visitChildren(visitor); |
| 18591 safelyVisitChild(_type, visitor); | 18592 safelyVisitChild(_type, visitor); |
| 18592 _variables.accept(visitor); | 18593 _variables.accept(visitor); |
| 18593 } | 18594 } |
| 18594 | 18595 |
| 18595 @override | 18596 @override |
| 18596 Token get firstTokenAfterCommentAndMetadata { | 18597 Token get firstTokenAfterCommentAndMetadata { |
| 18597 if (keyword != null) { | 18598 if (keyword != null) { |
| 18598 return keyword; | 18599 return keyword; |
| 18599 } else if (_type != null) { | 18600 } else if (_type != null) { |
| 18600 return _type.beginToken; | 18601 return _type.beginToken; |
| (...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 18947 _elements[index] = node; | 18948 _elements[index] = node; |
| 18948 } | 18949 } |
| 18949 void clear() { | 18950 void clear() { |
| 18950 _elements = <E> []; | 18951 _elements = <E> []; |
| 18951 } | 18952 } |
| 18952 int get length => _elements.length; | 18953 int get length => _elements.length; |
| 18953 void set length(int value) { | 18954 void set length(int value) { |
| 18954 throw new UnsupportedError("Cannot resize NodeList."); | 18955 throw new UnsupportedError("Cannot resize NodeList."); |
| 18955 } | 18956 } |
| 18956 } | 18957 } |
| OLD | NEW |