@@ -523,59 +523,59 @@ void Generator::fixupInputFieldList(InputFieldList& fields)
523
523
524
524
void Generator::visitDefinition (const peg::ast_node& definition)
525
525
{
526
- if (definition.is <peg::schema_definition>())
526
+ if (definition.is_type <peg::schema_definition>())
527
527
{
528
528
visitSchemaDefinition (definition);
529
529
}
530
- else if (definition.is <peg::schema_extension>())
530
+ else if (definition.is_type <peg::schema_extension>())
531
531
{
532
532
visitSchemaExtension (definition);
533
533
}
534
- else if (definition.is <peg::scalar_type_definition>())
534
+ else if (definition.is_type <peg::scalar_type_definition>())
535
535
{
536
536
visitScalarTypeDefinition (definition);
537
537
}
538
- else if (definition.is <peg::enum_type_definition>())
538
+ else if (definition.is_type <peg::enum_type_definition>())
539
539
{
540
540
visitEnumTypeDefinition (definition);
541
541
}
542
- else if (definition.is <peg::enum_type_extension>())
542
+ else if (definition.is_type <peg::enum_type_extension>())
543
543
{
544
544
visitEnumTypeExtension (definition);
545
545
}
546
- else if (definition.is <peg::input_object_type_definition>())
546
+ else if (definition.is_type <peg::input_object_type_definition>())
547
547
{
548
548
visitInputObjectTypeDefinition (definition);
549
549
}
550
- else if (definition.is <peg::input_object_type_extension>())
550
+ else if (definition.is_type <peg::input_object_type_extension>())
551
551
{
552
552
visitInputObjectTypeExtension (definition);
553
553
}
554
- else if (definition.is <peg::union_type_definition>())
554
+ else if (definition.is_type <peg::union_type_definition>())
555
555
{
556
556
visitUnionTypeDefinition (definition);
557
557
}
558
- else if (definition.is <peg::union_type_extension>())
558
+ else if (definition.is_type <peg::union_type_extension>())
559
559
{
560
560
visitUnionTypeExtension (definition);
561
561
}
562
- else if (definition.is <peg::interface_type_definition>())
562
+ else if (definition.is_type <peg::interface_type_definition>())
563
563
{
564
564
visitInterfaceTypeDefinition (definition);
565
565
}
566
- else if (definition.is <peg::interface_type_extension>())
566
+ else if (definition.is_type <peg::interface_type_extension>())
567
567
{
568
568
visitInterfaceTypeExtension (definition);
569
569
}
570
- else if (definition.is <peg::object_type_definition>())
570
+ else if (definition.is_type <peg::object_type_definition>())
571
571
{
572
572
visitObjectTypeDefinition (definition);
573
573
}
574
- else if (definition.is <peg::object_type_extension>())
574
+ else if (definition.is_type <peg::object_type_extension>())
575
575
{
576
576
visitObjectTypeExtension (definition);
577
577
}
578
- else if (definition.is <peg::directive_definition>())
578
+ else if (definition.is_type <peg::directive_definition>())
579
579
{
580
580
visitDirectiveDefinition (definition);
581
581
}
@@ -1048,26 +1048,26 @@ OutputFieldList Generator::getOutputFields(const std::vector<std::unique_ptr<peg
1048
1048
1049
1049
for (const auto & child : fieldDefinition->children )
1050
1050
{
1051
- if (child->is <peg::field_name>())
1051
+ if (child->is_type <peg::field_name>())
1052
1052
{
1053
1053
field.name = child->string_view ();
1054
1054
field.cppName = getSafeCppName (field.name );
1055
1055
}
1056
- else if (child->is <peg::arguments_definition>())
1056
+ else if (child->is_type <peg::arguments_definition>())
1057
1057
{
1058
1058
field.arguments = getInputFields (child->children );
1059
1059
}
1060
- else if (child->is <peg::named_type>()
1061
- || child->is <peg::list_type>()
1062
- || child->is <peg::nonnull_type>())
1060
+ else if (child->is_type <peg::named_type>()
1061
+ || child->is_type <peg::list_type>()
1062
+ || child->is_type <peg::nonnull_type>())
1063
1063
{
1064
1064
fieldType.visit (*child);
1065
1065
}
1066
- else if (child->is <peg::description>())
1066
+ else if (child->is_type <peg::description>())
1067
1067
{
1068
1068
field.description = child->children .front ()->unescaped ;
1069
1069
}
1070
- else if (child->is <peg::directives>())
1070
+ else if (child->is_type <peg::directives>())
1071
1071
{
1072
1072
peg::for_each_child<peg::directive>(*child,
1073
1073
[&field](const peg::ast_node & directive)
@@ -1134,26 +1134,26 @@ InputFieldList Generator::getInputFields(const std::vector<std::unique_ptr<peg::
1134
1134
1135
1135
for (const auto & child : fieldDefinition->children )
1136
1136
{
1137
- if (child->is <peg::argument_name>())
1137
+ if (child->is_type <peg::argument_name>())
1138
1138
{
1139
1139
field.name = child->string_view ();
1140
1140
field.cppName = getSafeCppName (field.name );
1141
1141
}
1142
- else if (child->is <peg::named_type>()
1143
- || child->is <peg::list_type>()
1144
- || child->is <peg::nonnull_type>())
1142
+ else if (child->is_type <peg::named_type>()
1143
+ || child->is_type <peg::list_type>()
1144
+ || child->is_type <peg::nonnull_type>())
1145
1145
{
1146
1146
fieldType.visit (*child);
1147
1147
}
1148
- else if (child->is <peg::default_value>())
1148
+ else if (child->is_type <peg::default_value>())
1149
1149
{
1150
1150
DefaultValueVisitor defaultValue;
1151
1151
1152
1152
defaultValue.visit (*child->children .back ());
1153
1153
field.defaultValue = defaultValue.getValue ();
1154
1154
field.defaultValueString = child->children .back ()->string_view ();
1155
1155
}
1156
- else if (child->is <peg::description>())
1156
+ else if (child->is_type <peg::description>())
1157
1157
{
1158
1158
field.description = child->children .front ()->unescaped ;
1159
1159
}
@@ -1169,15 +1169,15 @@ InputFieldList Generator::getInputFields(const std::vector<std::unique_ptr<peg::
1169
1169
1170
1170
void Generator::TypeVisitor::visit (const peg::ast_node& typeName)
1171
1171
{
1172
- if (typeName.is <peg::nonnull_type>())
1172
+ if (typeName.is_type <peg::nonnull_type>())
1173
1173
{
1174
1174
visitNonNullType (typeName);
1175
1175
}
1176
- else if (typeName.is <peg::list_type>())
1176
+ else if (typeName.is_type <peg::list_type>())
1177
1177
{
1178
1178
visitListType (typeName);
1179
1179
}
1180
- else if (typeName.is <peg::named_type>())
1180
+ else if (typeName.is_type <peg::named_type>())
1181
1181
{
1182
1182
visitNamedType (typeName);
1183
1183
}
@@ -1220,36 +1220,36 @@ std::pair<std::string, TypeModifierStack> Generator::TypeVisitor::getType()
1220
1220
1221
1221
void Generator::DefaultValueVisitor::visit (const peg::ast_node& value)
1222
1222
{
1223
- if (value.is <peg::integer_value>())
1223
+ if (value.is_type <peg::integer_value>())
1224
1224
{
1225
1225
visitIntValue (value);
1226
1226
}
1227
- else if (value.is <peg::float_value>())
1227
+ else if (value.is_type <peg::float_value>())
1228
1228
{
1229
1229
visitFloatValue (value);
1230
1230
}
1231
- else if (value.is <peg::string_value>())
1231
+ else if (value.is_type <peg::string_value>())
1232
1232
{
1233
1233
visitStringValue (value);
1234
1234
}
1235
- else if (value.is <peg::true_keyword>()
1236
- || value.is <peg::false_keyword>())
1235
+ else if (value.is_type <peg::true_keyword>()
1236
+ || value.is_type <peg::false_keyword>())
1237
1237
{
1238
1238
visitBooleanValue (value);
1239
1239
}
1240
- else if (value.is <peg::null_keyword>())
1240
+ else if (value.is_type <peg::null_keyword>())
1241
1241
{
1242
1242
visitNullValue (value);
1243
1243
}
1244
- else if (value.is <peg::enum_value>())
1244
+ else if (value.is_type <peg::enum_value>())
1245
1245
{
1246
1246
visitEnumValue (value);
1247
1247
}
1248
- else if (value.is <peg::list_value>())
1248
+ else if (value.is_type <peg::list_value>())
1249
1249
{
1250
1250
visitListValue (value);
1251
1251
}
1252
- else if (value.is <peg::object_value>())
1252
+ else if (value.is_type <peg::object_value>())
1253
1253
{
1254
1254
visitObjectValue (value);
1255
1255
}
@@ -1272,7 +1272,7 @@ void Generator::DefaultValueVisitor::visitStringValue(const peg::ast_node& strin
1272
1272
1273
1273
void Generator::DefaultValueVisitor::visitBooleanValue (const peg::ast_node& booleanValue)
1274
1274
{
1275
- _value = response::Value (booleanValue.is <peg::true_keyword>());
1275
+ _value = response::Value (booleanValue.is_type <peg::true_keyword>());
1276
1276
}
1277
1277
1278
1278
void Generator::DefaultValueVisitor::visitNullValue (const peg::ast_node& /* nullValue*/ )
0 commit comments