Skip to content

Commit 4d552d1

Browse files
johnniwintherCommit Queue
authored andcommitted
[_fe_analyzer_shared] Rename StringJuxtaposition to AdjacentStringLiterals
Change-Id: I2ed9172f51f9a9011ca9dff59c62c42ffb56f05e Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/391605 Reviewed-by: Konstantin Shcheglov <[email protected]> Commit-Queue: Johnni Winther <[email protected]> Reviewed-by: Jens Johansen <[email protected]>
1 parent 4b2b07b commit 4d552d1

File tree

17 files changed

+47
-46
lines changed

17 files changed

+47
-46
lines changed

pkg/_fe_analyzer_shared/lib/src/metadata/expressions.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -162,20 +162,20 @@ class StringLiteral extends Expression {
162162
}
163163
}
164164

165-
class StringJuxtaposition extends Expression {
165+
class AdjacentStringLiterals extends Expression {
166166
final List<Expression> expressions;
167167

168-
StringJuxtaposition(this.expressions);
168+
AdjacentStringLiterals(this.expressions);
169169

170170
@override
171-
String toString() => 'StringJuxtaposition($expressions)';
171+
String toString() => 'AdjacentStringLiterals($expressions)';
172172

173173
@override
174174
Expression? resolve() {
175175
List<Expression>? newExpressions = expressions.resolve((e) => e.resolve());
176176
return newExpressions == null
177177
? null
178-
: new StringJuxtaposition(newExpressions);
178+
: new AdjacentStringLiterals(newExpressions);
179179
}
180180
}
181181

pkg/_fe_analyzer_shared/lib/src/metadata/parser.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -666,15 +666,15 @@ class AnnotationsListener extends StackListener {
666666
}
667667

668668
@override
669-
void handleStringJuxtaposition(Token startToken, int literalCount) {
669+
void handleAdjacentStringLiterals(Token startToken, int literalCount) {
670670
assert(
671671
checkState(startToken, repeatedKind(_ValueKinds._Proto, literalCount)));
672672
List<Expression> expressions =
673673
new List.filled(literalCount, _dummyExpression);
674674
while (--literalCount >= 0) {
675675
expressions[literalCount] = _popExpression();
676676
}
677-
push(new ExpressionProto(new StringJuxtaposition(expressions)));
677+
push(new ExpressionProto(new AdjacentStringLiterals(expressions)));
678678
}
679679

680680
@override

pkg/_fe_analyzer_shared/lib/src/parser/forwarding_listener.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1991,8 +1991,8 @@ class ForwardingListener implements Listener {
19911991
}
19921992

19931993
@override
1994-
void handleStringJuxtaposition(Token startToken, int literalCount) {
1995-
listener?.handleStringJuxtaposition(startToken, literalCount);
1994+
void handleAdjacentStringLiterals(Token startToken, int literalCount) {
1995+
listener?.handleAdjacentStringLiterals(startToken, literalCount);
19961996
}
19971997

19981998
@override

pkg/_fe_analyzer_shared/lib/src/parser/listener.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1141,8 +1141,8 @@ class Listener implements UnescapeErrorListener {
11411141
logEvent("LiteralString");
11421142
}
11431143

1144-
void handleStringJuxtaposition(Token startToken, int literalCount) {
1145-
logEvent("StringJuxtaposition");
1144+
void handleAdjacentStringLiterals(Token startToken, int literalCount) {
1145+
logEvent("AdjacentStringLiterals");
11461146
}
11471147

11481148
/// Called for class-like members (class, mixin, extension), but each member

pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7564,7 +7564,7 @@ class Parser {
75647564
count++;
75657565
}
75667566
if (count > 1) {
7567-
listener.handleStringJuxtaposition(startToken, count);
7567+
listener.handleAdjacentStringLiterals(startToken, count);
75687568
}
75697569
mayParseFunctionExpressions = old;
75707570
return token;

pkg/_fe_analyzer_shared/lib/src/testing/metadata_helper.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,8 @@ class Writer {
144144
_write('StringLiteral(');
145145
_stringPartsToText(expression.parts);
146146
_write(')');
147-
case StringJuxtaposition():
148-
_write('StringJuxtaposition(');
147+
case AdjacentStringLiterals():
148+
_write('AdjacentStringLiterals(');
149149
_incIndent(addNewLine: false);
150150
_expressionsToText(expression.expressions, delimiter: '');
151151
_decIndent();

pkg/_fe_analyzer_shared/test/metadata/data/literal/main.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,10 @@ void literal9() {}
8484
/*member: literal10:
8585
unresolved=UnresolvedExpression(UnresolvedInvoke(
8686
UnresolvedIdentifier(Helper)
87-
(StringJuxtaposition(
87+
(AdjacentStringLiterals(
8888
StringLiteral('a')
8989
StringLiteral('b')))))
90-
resolved=StringJuxtaposition(
90+
resolved=AdjacentStringLiterals(
9191
StringLiteral('a')
9292
StringLiteral('b'))*/
9393
void literal10() {}
@@ -96,11 +96,11 @@ void literal10() {}
9696
/*member: literal11:
9797
unresolved=UnresolvedExpression(UnresolvedInvoke(
9898
UnresolvedIdentifier(Helper)
99-
(StringJuxtaposition(
99+
(AdjacentStringLiterals(
100100
StringLiteral('a')
101101
StringLiteral('b')
102102
StringLiteral('c')))))
103-
resolved=StringJuxtaposition(
103+
resolved=AdjacentStringLiterals(
104104
StringLiteral('a')
105105
StringLiteral('b')
106106
StringLiteral('c'))*/

pkg/_fe_analyzer_shared/test/metadata/data/unresolved/main.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -388,11 +388,11 @@ void literals2() {}
388388
/*member: literals3:
389389
unresolved=UnresolvedExpression(UnresolvedInvoke(
390390
UnresolvedIdentifier(Helper)
391-
(StringJuxtaposition(
391+
(AdjacentStringLiterals(
392392
StringLiteral('a')
393393
StringLiteral('b${UnresolvedExpression(UnresolvedIdentifier(constInt))}')
394394
StringLiteral('c')))))
395-
resolved=StringJuxtaposition(
395+
resolved=AdjacentStringLiterals(
396396
StringLiteral('a')
397397
StringLiteral('b${UnresolvedExpression(UnresolvedIdentifier(constInt))}')
398398
StringLiteral('c'))*/

pkg/analyzer/lib/src/fasta/ast_builder.dart

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3709,6 +3709,14 @@ class AstBuilder extends StackListener {
37093709
);
37103710
}
37113711

3712+
@override
3713+
void handleAdjacentStringLiterals(Token startToken, int literalCount) {
3714+
debugEvent("AdjacentStringLiterals");
3715+
3716+
var strings = popTypedList2<StringLiteralImpl>(literalCount);
3717+
push(AdjacentStringsImpl(strings: strings));
3718+
}
3719+
37123720
@override
37133721
void handleAsOperator(Token asOperator) {
37143722
assert(optional('as', asOperator));
@@ -5535,14 +5543,6 @@ class AstBuilder extends StackListener {
55355543
);
55365544
}
55375545

5538-
@override
5539-
void handleStringJuxtaposition(Token startToken, int literalCount) {
5540-
debugEvent("StringJuxtaposition");
5541-
5542-
var strings = popTypedList2<StringLiteralImpl>(literalCount);
5543-
push(AdjacentStringsImpl(strings: strings));
5544-
}
5545-
55465546
@override
55475547
void handleStringPart(Token literalString) {
55485548
assert(identical(literalString.kind, STRING_TOKEN));

pkg/front_end/lib/src/kernel/body_builder.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3499,8 +3499,8 @@ class BodyBuilder extends StackListenerImpl
34993499
}
35003500

35013501
@override
3502-
void handleStringJuxtaposition(Token startToken, int literalCount) {
3503-
debugEvent("StringJuxtaposition");
3502+
void handleAdjacentStringLiterals(Token startToken, int literalCount) {
3503+
debugEvent("AdjacentStringLiterals");
35043504
List<Expression> parts = popListForValue(literalCount);
35053505
List<Expression>? expressions;
35063506
// Flatten string juxtapositions of string interpolation.

0 commit comments

Comments
 (0)