Skip to content

Commit 5b83654

Browse files
committed
s/Array/List/g
1 parent 2d16afc commit 5b83654

File tree

6 files changed

+54
-54
lines changed

6 files changed

+54
-54
lines changed

JsonVisitor.cpp

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ void JsonVisitor::startPrintingNode(const char *kind, const yy::location &locati
3434
return;
3535
}
3636

37-
void JsonVisitor::printChildArray(
37+
void JsonVisitor::printChildList(
3838
const std::vector<std::string>::const_iterator &childIterator,
3939
size_t numChildren) {
4040
out_ << '[';
@@ -66,7 +66,7 @@ void JsonVisitor::endVisitDocument(const Document &document) {
6666
out_ << "\"definitions\":";
6767

6868
const auto &children = printed_.back();
69-
printChildArray(children.begin(), children.size());
69+
printChildList(children.begin(), children.size());
7070
out_ << '}';
7171
printed_.pop_back();
7272
assert(printed_.empty());
@@ -93,7 +93,7 @@ void JsonVisitor::endVisitOperationDefinition(const OperationDefinition &operati
9393
out_ << ",\"variableDefinitions\":";
9494
const auto *variableDefinitions = operationDefinition.getVariableDefinitions();
9595
if (variableDefinitions != nullptr) {
96-
printChildArray(nextChild, variableDefinitions->size());
96+
printChildList(nextChild, variableDefinitions->size());
9797
nextChild += variableDefinitions->size();
9898
} else {
9999
out_ << "null";
@@ -102,7 +102,7 @@ void JsonVisitor::endVisitOperationDefinition(const OperationDefinition &operati
102102
out_ << ",\"directives\":";
103103
const auto *directives = operationDefinition.getDirectives();
104104
if (directives != nullptr) {
105-
printChildArray(nextChild, directives->size());
105+
printChildList(nextChild, directives->size());
106106
nextChild += directives->size();
107107
} else {
108108
out_ << "null";
@@ -152,7 +152,7 @@ void JsonVisitor::endVisitSelectionSet(const SelectionSet &selectionSet) {
152152
out_ << "\"selections\":";
153153

154154
const auto &children = printed_.back();
155-
printChildArray(children.begin(), children.size());
155+
printChildList(children.begin(), children.size());
156156

157157
out_ << '}';
158158

@@ -182,7 +182,7 @@ void JsonVisitor::endVisitField(const Field &field) {
182182
out_ << ",\"arguments\":";
183183
const auto *arguments = field.getArguments();
184184
if (arguments != nullptr) {
185-
printChildArray(nextChild, arguments->size());
185+
printChildList(nextChild, arguments->size());
186186
nextChild += arguments->size();
187187
} else {
188188
out_ << "null";
@@ -191,7 +191,7 @@ void JsonVisitor::endVisitField(const Field &field) {
191191
out_ << ",\"directives\":";
192192
const auto *directives = field.getDirectives();
193193
if (directives != nullptr) {
194-
printChildArray(nextChild, directives->size());
194+
printChildList(nextChild, directives->size());
195195
nextChild += directives->size();
196196
} else {
197197
out_ << "null";
@@ -239,7 +239,7 @@ void JsonVisitor::endVisitFragmentSpread(const FragmentSpread &fragmentSpread) {
239239
out_ << ",\"directives\":";
240240
const auto *directives = fragmentSpread.getDirectives();
241241
if (directives != nullptr) {
242-
printChildArray(children.begin() + 1, directives->size());
242+
printChildList(children.begin() + 1, directives->size());
243243
} else {
244244
out_ << "null";
245245
}
@@ -267,7 +267,7 @@ void JsonVisitor::endVisitInlineFragment(const InlineFragment &inlineFragment) {
267267
out_ << "\"directives\":";
268268
const auto *directives = inlineFragment.getDirectives();
269269
if (directives != nullptr) {
270-
printChildArray(nextChild, directives->size());
270+
printChildList(nextChild, directives->size());
271271
nextChild += directives->size();
272272
} else {
273273
out_ << "null";
@@ -298,7 +298,7 @@ void JsonVisitor::endVisitFragmentDefinition(const FragmentDefinition &fragmentD
298298
out_ << ",\"directives\":";
299299
const auto *directives = fragmentDefinition.getDirectives();
300300
if (directives != nullptr) {
301-
printChildArray(nextChild, directives->size());
301+
printChildList(nextChild, directives->size());
302302
nextChild += directives->size();
303303
} else {
304304
out_ << "null";
@@ -355,16 +355,16 @@ void JsonVisitor::endVisitBooleanValue(const BooleanValue &booleanValue) {
355355
printed_.back().emplace_back(out_.str());
356356
}
357357

358-
bool JsonVisitor::visitArrayValue(const ArrayValue &arrayValue) {
358+
bool JsonVisitor::visitListValue(const ListValue &arrayValue) {
359359
visitNode();
360360
return true;
361361
}
362362

363-
void JsonVisitor::endVisitArrayValue(const ArrayValue &arrayValue) {
364-
startPrintingNode("ArrayValue", arrayValue.getLocation());
363+
void JsonVisitor::endVisitListValue(const ListValue &arrayValue) {
364+
startPrintingNode("ListValue", arrayValue.getLocation());
365365

366366
out_ << "\"values\":";
367-
printChildArray(printed_.back().begin(), arrayValue.getValues().size());
367+
printChildList(printed_.back().begin(), arrayValue.getValues().size());
368368

369369
out_ << '}';
370370

@@ -380,7 +380,7 @@ void JsonVisitor::endVisitObjectValue(const ObjectValue &objectValue) {
380380
startPrintingNode("ObjectValue", objectValue.getLocation());
381381

382382
out_ << "\"fields\":";
383-
printChildArray(printed_.back().begin(), objectValue.getFields().size());
383+
printChildList(printed_.back().begin(), objectValue.getFields().size());
384384

385385
out_ << '}';
386386

@@ -419,7 +419,7 @@ void JsonVisitor::endVisitDirective(const Directive &directive) {
419419
out_ << ",\"arguments\":";
420420
const auto *arguments = directive.getArguments();
421421
if (arguments != nullptr) {
422-
printChildArray(nextChild, arguments->size());
422+
printChildList(nextChild, arguments->size());
423423
} else {
424424
out_ << "null";
425425
}

JsonVisitor.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class JsonVisitor : public AstVisitor {
4848

4949
// Prints a non-null array of n children from the given
5050
// iterator. Does not update the iterator.
51-
void printChildArray(
51+
void printChildList(
5252
const std::vector<std::string>::const_iterator &childIterator,
5353
size_t numChildren);
5454

@@ -105,8 +105,8 @@ class JsonVisitor : public AstVisitor {
105105

106106
void endVisitEnumValue(const EnumValue &enumValue) override;
107107

108-
bool visitArrayValue(const ArrayValue &arrayValue) override;
109-
void endVisitArrayValue(const ArrayValue &arrayValue) override;
108+
bool visitListValue(const ListValue &arrayValue) override;
109+
void endVisitListValue(const ListValue &arrayValue) override;
110110

111111
bool visitObjectValue(const ObjectValue &objectValue) override;
112112
void endVisitObjectValue(const ObjectValue &objectValue) override;

ast/ast.ast

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ O FloatValue
6868
O StringValue
6969
O BooleanValue
7070
O EnumValue
71-
O ArrayValue
71+
O ListValue
7272
O ObjectValue
7373

7474
T Variable
@@ -89,7 +89,7 @@ S boolean value
8989
T EnumValue
9090
S string value
9191

92-
T ArrayValue
92+
T ListValue
9393
P Value values
9494

9595
T ObjectValue

parser.tab.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -720,7 +720,7 @@ namespace yy {
720720
#line 721 "parser.tab.cpp" // lalr1.cc:617
721721
break;
722722

723-
case 63: // array_value
723+
case 63: // list_value
724724

725725
#line 227 "parser.ypp" // lalr1.cc:617
726726
{ delete (yysym.value.arrayValue); }
@@ -734,7 +734,7 @@ namespace yy {
734734
#line 735 "parser.tab.cpp" // lalr1.cc:617
735735
break;
736736

737-
case 65: // array_value_const
737+
case 65: // list_value_const
738738

739739
#line 227 "parser.ypp" // lalr1.cc:617
740740
{ delete (yysym.value.arrayValue); }
@@ -1608,13 +1608,13 @@ namespace yy {
16081608

16091609
case 80:
16101610
#line 403 "parser.ypp" // lalr1.cc:859
1611-
{ (yylhs.value.arrayValue) = new ArrayValue(yylhs.location, new std::vector<std::unique_ptr<Value>>()); }
1611+
{ (yylhs.value.arrayValue) = new ListValue(yylhs.location, new std::vector<std::unique_ptr<Value>>()); }
16121612
#line 1613 "parser.tab.cpp" // lalr1.cc:859
16131613
break;
16141614

16151615
case 81:
16161616
#line 404 "parser.ypp" // lalr1.cc:859
1617-
{ (yylhs.value.arrayValue) = new ArrayValue(yylhs.location, (yystack_[1].value.valueList)); }
1617+
{ (yylhs.value.arrayValue) = new ListValue(yylhs.location, (yystack_[1].value.valueList)); }
16181618
#line 1619 "parser.tab.cpp" // lalr1.cc:859
16191619
break;
16201620

@@ -1632,13 +1632,13 @@ namespace yy {
16321632

16331633
case 84:
16341634
#line 412 "parser.ypp" // lalr1.cc:859
1635-
{ (yylhs.value.arrayValue) = new ArrayValue(yylhs.location, new std::vector<std::unique_ptr<Value>>()); }
1635+
{ (yylhs.value.arrayValue) = new ListValue(yylhs.location, new std::vector<std::unique_ptr<Value>>()); }
16361636
#line 1637 "parser.tab.cpp" // lalr1.cc:859
16371637
break;
16381638

16391639
case 85:
16401640
#line 413 "parser.ypp" // lalr1.cc:859
1641-
{ (yylhs.value.arrayValue) = new ArrayValue(yylhs.location, (yystack_[1].value.valueList)); }
1641+
{ (yylhs.value.arrayValue) = new ListValue(yylhs.location, (yystack_[1].value.valueList)); }
16421642
#line 1643 "parser.tab.cpp" // lalr1.cc:859
16431643
break;
16441644

@@ -2266,8 +2266,8 @@ namespace yy {
22662266
"field", "arguments", "arguments_opt", "argument_list", "argument",
22672267
"fragment_spread", "inline_fragment", "fragment_definition",
22682268
"type_condition", "value", "int_value", "float_value", "string_value",
2269-
"value_const", "boolean_value", "enum_value", "array_value",
2270-
"value_list", "array_value_const", "value_const_list", "object_value",
2269+
"value_const", "boolean_value", "enum_value", "list_value", "value_list",
2270+
"list_value_const", "value_const_list", "object_value",
22712271
"object_field_list", "object_field", "object_value_const",
22722272
"object_field_const_list", "object_field_const", "directives",
22732273
"directives_opt", "directive_list", "directive", "type", "type_name",

parser.tab.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ using facebook::graphql::ast::FloatValue;
7070
using facebook::graphql::ast::StringValue;
7171
using facebook::graphql::ast::BooleanValue;
7272
using facebook::graphql::ast::EnumValue;
73-
using facebook::graphql::ast::ArrayValue;
73+
using facebook::graphql::ast::ListValue;
7474
using facebook::graphql::ast::ObjectValue;
7575
using facebook::graphql::ast::ObjectField;
7676
using facebook::graphql::ast::Directive;
@@ -101,7 +101,7 @@ union yystype { \
101101
StringValue *stringValue; \
102102
BooleanValue *booleanValue; \
103103
EnumValue *enumValue; \
104-
ArrayValue *arrayValue; \
104+
ListValue *arrayValue; \
105105
ObjectValue *objectValue; \
106106
ObjectField *objectField; \
107107
Directive *directive; \
@@ -129,7 +129,7 @@ union yystype { \
129129
std::vector<std::unique_ptr<StringValue>> *stringValueList; \
130130
std::vector<std::unique_ptr<BooleanValue>> *booleanValueList; \
131131
std::vector<std::unique_ptr<EnumValue>> *enumValueList; \
132-
std::vector<std::unique_ptr<ArrayValue>> *arrayValueList; \
132+
std::vector<std::unique_ptr<ListValue>> *arrayValueList; \
133133
std::vector<std::unique_ptr<ObjectValue>> *objectValueList; \
134134
std::vector<std::unique_ptr<ObjectField>> *objectFieldList; \
135135
std::vector<std::unique_ptr<Directive>> *directiveList; \

0 commit comments

Comments
 (0)