Rename libraryUri

R=scheglov@google.com

Review URL: https://codereview.chromium.org/2347213002 .
This commit is contained in:
Brian Wilkerson 2016-09-16 10:54:25 -07:00
parent 7eb7573dc4
commit 772c93ccf2
5 changed files with 45 additions and 21 deletions

View file

@ -2039,12 +2039,14 @@ abstract class Configuration extends AstNode {
* Return the URI of the implementation library to be used if the condition is
* true.
*/
@deprecated
StringLiteral get libraryUri;
/**
* Set the URI of the implementation library to be used if the condition is
* true to the given [uri].
*/
@deprecated
void set libraryUri(StringLiteral uri);
/**
@ -2070,12 +2072,24 @@ abstract class Configuration extends AstNode {
void set rightParenthesis(Token token);
/**
* Return the source to which the [libraryUri] was resolved.
* Return the URI of the implementation library to be used if the condition is
* true.
*/
StringLiteral get uri;
/**
* Set the URI of the implementation library to be used if the condition is
* true to the given [uri].
*/
void set uri(StringLiteral uri);
/**
* Return the source to which the [uri] was resolved.
*/
Source get uriSource;
/**
* Set the source to which the [libraryUri] was resolved to the given [source].
* Set the source to which the [uri] was resolved to the given [source].
*/
void set uriSource(Source source);

View file

@ -2609,7 +2609,7 @@ class ConfigurationImpl extends AstNodeImpl implements Configuration {
@override
Token rightParenthesis;
StringLiteral _libraryUri;
StringLiteral _uri;
@override
Source uriSource;
@ -2624,7 +2624,7 @@ class ConfigurationImpl extends AstNodeImpl implements Configuration {
StringLiteralImpl libraryUri) {
_name = _becomeParentOf(name);
_value = _becomeParentOf(value);
_libraryUri = _becomeParentOf(libraryUri);
_uri = _becomeParentOf(libraryUri);
}
@override
@ -2638,17 +2638,19 @@ class ConfigurationImpl extends AstNodeImpl implements Configuration {
..add(equalToken)
..add(_value)
..add(rightParenthesis)
..add(_libraryUri);
..add(_uri);
@override
Token get endToken => _libraryUri.endToken;
Token get endToken => _uri.endToken;
@deprecated
@override
StringLiteral get libraryUri => _libraryUri;
StringLiteral get libraryUri => _uri;
@deprecated
@override
void set libraryUri(StringLiteral libraryUri) {
_libraryUri = _becomeParentOf(libraryUri as AstNodeImpl);
_uri = _becomeParentOf(libraryUri as AstNodeImpl);
}
@override
@ -2659,6 +2661,14 @@ class ConfigurationImpl extends AstNodeImpl implements Configuration {
_name = _becomeParentOf(name as AstNodeImpl);
}
@override
StringLiteral get uri => _uri;
@override
void set uri(StringLiteral uri) {
_uri = _becomeParentOf(uri as AstNodeImpl);
}
@override
StringLiteral get value => _value;
@ -2675,7 +2685,7 @@ class ConfigurationImpl extends AstNodeImpl implements Configuration {
void visitChildren(AstVisitor visitor) {
_name?.accept(visitor);
_value?.accept(visitor);
_libraryUri?.accept(visitor);
_uri?.accept(visitor);
}
}

View file

@ -277,7 +277,7 @@ class AstCloner implements AstVisitor<AstNode> {
cloneToken(node.equalToken),
cloneNode(node.value),
cloneToken(node.rightParenthesis),
cloneNode(node.libraryUri));
cloneNode(node.uri));
@override
ConstructorDeclaration visitConstructorDeclaration(
@ -1267,7 +1267,7 @@ class AstComparator implements AstVisitor<bool> {
isEqualTokens(node.equalToken, other.equalToken) &&
isEqualNodes(node.value, other.value) &&
isEqualTokens(node.rightParenthesis, other.rightParenthesis) &&
isEqualNodes(node.libraryUri, other.libraryUri);
isEqualNodes(node.uri, other.uri);
}
@override
@ -2856,7 +2856,7 @@ class IncrementalAstCloner implements AstVisitor<AstNode> {
_mapToken(node.equalToken),
_cloneNode(node.value),
_mapToken(node.rightParenthesis),
_cloneNode(node.libraryUri));
_cloneNode(node.uri));
@override
ConstructorDeclaration visitConstructorDeclaration(
@ -4170,8 +4170,8 @@ class NodeReplacer implements AstVisitor<bool> {
} else if (identical(node.value, _oldNode)) {
node.value = _newNode as StringLiteral;
return true;
} else if (identical(node.libraryUri, _oldNode)) {
node.libraryUri = _newNode as StringLiteral;
} else if (identical(node.uri, _oldNode)) {
node.uri = _newNode as StringLiteral;
return true;
}
return visitNode(node);
@ -5360,7 +5360,7 @@ class ResolutionCopier implements AstVisitor<bool> {
_isEqualTokens(node.equalToken, toNode.equalToken),
_isEqualNodes(node.value, toNode.value),
_isEqualTokens(node.rightParenthesis, toNode.rightParenthesis),
_isEqualNodes(node.libraryUri, toNode.libraryUri))) {
_isEqualNodes(node.uri, toNode.uri))) {
return true;
}
return false;
@ -6907,7 +6907,7 @@ class ToSourceVisitor implements AstVisitor<Object> {
_visitNode(node.name);
_visitNodeWithPrefix(" == ", node.value);
_writer.print(') ');
_visitNode(node.libraryUri);
_visitNode(node.uri);
return null;
}

View file

@ -27,7 +27,7 @@ UnlinkedConfigurationBuilder serializeConfiguration(
return new UnlinkedConfigurationBuilder(
name: configuration.name.components.map((i) => i.name).join('.'),
value: configuration.value?.stringValue ?? 'true',
uri: configuration.libraryUri.stringValue);
uri: configuration.uri.stringValue);
}
class _CombinatorEncoder extends SimpleAstVisitor<UnlinkedCombinatorBuilder> {

View file

@ -6683,7 +6683,7 @@ void''');
expect(configuration.equalToken, isNull);
expect(configuration.value, isNull);
expect(configuration.rightParenthesis, isNotNull);
expect(configuration.libraryUri, isNotNull);
expect(configuration.uri, isNotNull);
}
void test_parseConfiguration_noOperator_simpleIdentifier() {
@ -6695,7 +6695,7 @@ void''');
expect(configuration.equalToken, isNull);
expect(configuration.value, isNull);
expect(configuration.rightParenthesis, isNotNull);
expect(configuration.libraryUri, isNotNull);
expect(configuration.uri, isNotNull);
}
void test_parseConfiguration_operator_dottedIdentifier() {
@ -6707,7 +6707,7 @@ void''');
expect(configuration.equalToken, isNotNull);
expect(configuration.value, isNotNull);
expect(configuration.rightParenthesis, isNotNull);
expect(configuration.libraryUri, isNotNull);
expect(configuration.uri, isNotNull);
}
void test_parseConfiguration_operator_simpleIdentifier() {
@ -6719,7 +6719,7 @@ void''');
expect(configuration.equalToken, isNotNull);
expect(configuration.value, isNotNull);
expect(configuration.rightParenthesis, isNotNull);
expect(configuration.libraryUri, isNotNull);
expect(configuration.uri, isNotNull);
}
void test_parseConstExpression_instanceCreation() {