@@ -523,59 +523,59 @@ void Generator::fixupInputFieldList(InputFieldList& fields)
523523
524524void Generator::visitDefinition (const peg::ast_node& definition)
525525{
526- if (definition.is <peg::schema_definition>())
526+ if (definition.is_type <peg::schema_definition>())
527527 {
528528 visitSchemaDefinition (definition);
529529 }
530- else if (definition.is <peg::schema_extension>())
530+ else if (definition.is_type <peg::schema_extension>())
531531 {
532532 visitSchemaExtension (definition);
533533 }
534- else if (definition.is <peg::scalar_type_definition>())
534+ else if (definition.is_type <peg::scalar_type_definition>())
535535 {
536536 visitScalarTypeDefinition (definition);
537537 }
538- else if (definition.is <peg::enum_type_definition>())
538+ else if (definition.is_type <peg::enum_type_definition>())
539539 {
540540 visitEnumTypeDefinition (definition);
541541 }
542- else if (definition.is <peg::enum_type_extension>())
542+ else if (definition.is_type <peg::enum_type_extension>())
543543 {
544544 visitEnumTypeExtension (definition);
545545 }
546- else if (definition.is <peg::input_object_type_definition>())
546+ else if (definition.is_type <peg::input_object_type_definition>())
547547 {
548548 visitInputObjectTypeDefinition (definition);
549549 }
550- else if (definition.is <peg::input_object_type_extension>())
550+ else if (definition.is_type <peg::input_object_type_extension>())
551551 {
552552 visitInputObjectTypeExtension (definition);
553553 }
554- else if (definition.is <peg::union_type_definition>())
554+ else if (definition.is_type <peg::union_type_definition>())
555555 {
556556 visitUnionTypeDefinition (definition);
557557 }
558- else if (definition.is <peg::union_type_extension>())
558+ else if (definition.is_type <peg::union_type_extension>())
559559 {
560560 visitUnionTypeExtension (definition);
561561 }
562- else if (definition.is <peg::interface_type_definition>())
562+ else if (definition.is_type <peg::interface_type_definition>())
563563 {
564564 visitInterfaceTypeDefinition (definition);
565565 }
566- else if (definition.is <peg::interface_type_extension>())
566+ else if (definition.is_type <peg::interface_type_extension>())
567567 {
568568 visitInterfaceTypeExtension (definition);
569569 }
570- else if (definition.is <peg::object_type_definition>())
570+ else if (definition.is_type <peg::object_type_definition>())
571571 {
572572 visitObjectTypeDefinition (definition);
573573 }
574- else if (definition.is <peg::object_type_extension>())
574+ else if (definition.is_type <peg::object_type_extension>())
575575 {
576576 visitObjectTypeExtension (definition);
577577 }
578- else if (definition.is <peg::directive_definition>())
578+ else if (definition.is_type <peg::directive_definition>())
579579 {
580580 visitDirectiveDefinition (definition);
581581 }
@@ -1048,26 +1048,26 @@ OutputFieldList Generator::getOutputFields(const std::vector<std::unique_ptr<peg
10481048
10491049 for (const auto & child : fieldDefinition->children )
10501050 {
1051- if (child->is <peg::field_name>())
1051+ if (child->is_type <peg::field_name>())
10521052 {
10531053 field.name = child->string_view ();
10541054 field.cppName = getSafeCppName (field.name );
10551055 }
1056- else if (child->is <peg::arguments_definition>())
1056+ else if (child->is_type <peg::arguments_definition>())
10571057 {
10581058 field.arguments = getInputFields (child->children );
10591059 }
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>())
10631063 {
10641064 fieldType.visit (*child);
10651065 }
1066- else if (child->is <peg::description>())
1066+ else if (child->is_type <peg::description>())
10671067 {
10681068 field.description = child->children .front ()->unescaped ;
10691069 }
1070- else if (child->is <peg::directives>())
1070+ else if (child->is_type <peg::directives>())
10711071 {
10721072 peg::for_each_child<peg::directive>(*child,
10731073 [&field](const peg::ast_node & directive)
@@ -1134,26 +1134,26 @@ InputFieldList Generator::getInputFields(const std::vector<std::unique_ptr<peg::
11341134
11351135 for (const auto & child : fieldDefinition->children )
11361136 {
1137- if (child->is <peg::argument_name>())
1137+ if (child->is_type <peg::argument_name>())
11381138 {
11391139 field.name = child->string_view ();
11401140 field.cppName = getSafeCppName (field.name );
11411141 }
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>())
11451145 {
11461146 fieldType.visit (*child);
11471147 }
1148- else if (child->is <peg::default_value>())
1148+ else if (child->is_type <peg::default_value>())
11491149 {
11501150 DefaultValueVisitor defaultValue;
11511151
11521152 defaultValue.visit (*child->children .back ());
11531153 field.defaultValue = defaultValue.getValue ();
11541154 field.defaultValueString = child->children .back ()->string_view ();
11551155 }
1156- else if (child->is <peg::description>())
1156+ else if (child->is_type <peg::description>())
11571157 {
11581158 field.description = child->children .front ()->unescaped ;
11591159 }
@@ -1169,15 +1169,15 @@ InputFieldList Generator::getInputFields(const std::vector<std::unique_ptr<peg::
11691169
11701170void Generator::TypeVisitor::visit (const peg::ast_node& typeName)
11711171{
1172- if (typeName.is <peg::nonnull_type>())
1172+ if (typeName.is_type <peg::nonnull_type>())
11731173 {
11741174 visitNonNullType (typeName);
11751175 }
1176- else if (typeName.is <peg::list_type>())
1176+ else if (typeName.is_type <peg::list_type>())
11771177 {
11781178 visitListType (typeName);
11791179 }
1180- else if (typeName.is <peg::named_type>())
1180+ else if (typeName.is_type <peg::named_type>())
11811181 {
11821182 visitNamedType (typeName);
11831183 }
@@ -1220,36 +1220,36 @@ std::pair<std::string, TypeModifierStack> Generator::TypeVisitor::getType()
12201220
12211221void Generator::DefaultValueVisitor::visit (const peg::ast_node& value)
12221222{
1223- if (value.is <peg::integer_value>())
1223+ if (value.is_type <peg::integer_value>())
12241224 {
12251225 visitIntValue (value);
12261226 }
1227- else if (value.is <peg::float_value>())
1227+ else if (value.is_type <peg::float_value>())
12281228 {
12291229 visitFloatValue (value);
12301230 }
1231- else if (value.is <peg::string_value>())
1231+ else if (value.is_type <peg::string_value>())
12321232 {
12331233 visitStringValue (value);
12341234 }
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>())
12371237 {
12381238 visitBooleanValue (value);
12391239 }
1240- else if (value.is <peg::null_keyword>())
1240+ else if (value.is_type <peg::null_keyword>())
12411241 {
12421242 visitNullValue (value);
12431243 }
1244- else if (value.is <peg::enum_value>())
1244+ else if (value.is_type <peg::enum_value>())
12451245 {
12461246 visitEnumValue (value);
12471247 }
1248- else if (value.is <peg::list_value>())
1248+ else if (value.is_type <peg::list_value>())
12491249 {
12501250 visitListValue (value);
12511251 }
1252- else if (value.is <peg::object_value>())
1252+ else if (value.is_type <peg::object_value>())
12531253 {
12541254 visitObjectValue (value);
12551255 }
@@ -1272,7 +1272,7 @@ void Generator::DefaultValueVisitor::visitStringValue(const peg::ast_node& strin
12721272
12731273void Generator::DefaultValueVisitor::visitBooleanValue (const peg::ast_node& booleanValue)
12741274{
1275- _value = response::Value (booleanValue.is <peg::true_keyword>());
1275+ _value = response::Value (booleanValue.is_type <peg::true_keyword>());
12761276}
12771277
12781278void Generator::DefaultValueVisitor::visitNullValue (const peg::ast_node& /* nullValue*/ )
0 commit comments