diff options
author | Hugh Tong <hugh.tong@mongodb.com> | 2022-07-26 19:20:58 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2022-07-26 21:00:49 +0000 |
commit | 044d2f734e0dba40b9dfb02cc49c2bff8f575cd5 (patch) | |
tree | eb2d17564a0c99d2ee9ea3d2f95c81c46bcfcee1 /buildscripts | |
parent | 921bba175902f9b9f29751a466383c3d7e80df7b (diff) | |
download | mongo-044d2f734e0dba40b9dfb02cc49c2bff8f575cd5.tar.gz |
SERVER-67824 Rename IDLParserErrorContext to IDLParserContext
Diffstat (limited to 'buildscripts')
-rw-r--r-- | buildscripts/idl/idl/enum_types.py | 4 | ||||
-rw-r--r-- | buildscripts/idl/idl/generator.py | 18 | ||||
-rw-r--r-- | buildscripts/idl/idl/struct_types.py | 16 |
3 files changed, 19 insertions, 19 deletions
diff --git a/buildscripts/idl/idl/enum_types.py b/buildscripts/idl/idl/enum_types.py index c697cd775e4..266f08a0131 100644 --- a/buildscripts/idl/idl/enum_types.py +++ b/buildscripts/idl/idl/enum_types.py @@ -211,7 +211,7 @@ class _EnumTypeInt(EnumTypeInfoBase, metaclass=ABCMeta): def get_deserializer_declaration(self): # type: () -> str return common.template_args( - "${enum_name} ${function_name}(const IDLParserErrorContext& ctxt, std::int32_t value)", + "${enum_name} ${function_name}(const IDLParserContext& ctxt, std::int32_t value)", enum_name=self.get_cpp_type_name(), function_name=self._get_enum_deserializer_name()) def gen_deserializer_definition(self, indented_writer): @@ -292,7 +292,7 @@ class _EnumTypeString(EnumTypeInfoBase, metaclass=ABCMeta): def get_deserializer_declaration(self): # type: () -> str return common.template_args( - "${enum_name} ${function_name}(const IDLParserErrorContext& ctxt, StringData value)", + "${enum_name} ${function_name}(const IDLParserContext& ctxt, StringData value)", enum_name=self.get_cpp_type_name(), function_name=self._get_enum_deserializer_name()) def gen_deserializer_definition(self, indented_writer): diff --git a/buildscripts/idl/idl/generator.py b/buildscripts/idl/idl/generator.py index 850e41922e8..f48fd3542d2 100644 --- a/buildscripts/idl/idl/generator.py +++ b/buildscripts/idl/idl/generator.py @@ -572,7 +572,7 @@ class _CppHeaderFileWriter(_CppFileWriterBase): # Declare method implemented in C++ file. self._writer.write_template('void ${method_name}(${param_type} value);') self._writer.write_template( - 'void ${method_name}(IDLParserErrorContext& ctxt, ${param_type} value);') + 'void ${method_name}(IDLParserContext& ctxt, ${param_type} value);') self._writer.write_empty_line() @@ -1174,7 +1174,7 @@ class _CppSourceFileWriter(_CppFileWriterBase): if ast_type.is_struct: self._writer.write_line( - 'IDLParserErrorContext tempContext(%s, &ctxt);' % (_get_field_constant_name(field))) + 'IDLParserContext tempContext(%s, &ctxt);' % (_get_field_constant_name(field))) self._writer.write_line('const auto localObject = %s.Obj();' % (element_name)) return '%s::parse(tempContext, localObject)' % (ast_type.cpp_type, ) elif ast_type.deserializer and 'BSONElement::' in ast_type.deserializer: @@ -1196,9 +1196,9 @@ class _CppSourceFileWriter(_CppFileWriterBase): method_name = writer.get_method_name_from_qualified_method_name( ast_type.deserializer) - # For fields which are enums, pass a IDLParserErrorContext + # For fields which are enums, pass a IDLParserContext if ast_type.is_enum: - self._writer.write_line('IDLParserErrorContext tempContext(%s, &ctxt);' % + self._writer.write_line('IDLParserContext tempContext(%s, &ctxt);' % (_get_field_constant_name(field))) return common.template_args("${method_name}(tempContext, ${expression})", method_name=method_name, expression=expression) @@ -1233,7 +1233,7 @@ class _CppSourceFileWriter(_CppFileWriterBase): self._writer.write_line('std::uint32_t expectedFieldNumber{0};') self._writer.write_line( - 'const IDLParserErrorContext arrayCtxt(%s, &ctxt);' % (_get_field_constant_name(field))) + 'const IDLParserContext arrayCtxt(%s, &ctxt);' % (_get_field_constant_name(field))) self._writer.write_line('std::vector<%s> values;' % (cpp_type)) self._writer.write_empty_line() @@ -1470,8 +1470,8 @@ class _CppSourceFileWriter(_CppFileWriterBase): # Either we are deserializing BSON Objects or IDL structs if field.type.is_struct: - self._writer.write_line('IDLParserErrorContext tempContext(%s, &ctxt);' % - (_get_field_constant_name(field))) + self._writer.write_line( + 'IDLParserContext tempContext(%s, &ctxt);' % (_get_field_constant_name(field))) array_value = '%s::parse(tempContext, sequenceObject)' % (field.type.cpp_type, ) else: assert field.type.bson_serialization_type == ['object'] @@ -1772,7 +1772,7 @@ class _CppSourceFileWriter(_CppFileWriterBase): # Fields without validators are implemented in the header. continue - for optional_params in [('IDLParserErrorContext& ctxt, ', 'ctxt, '), ('', '')]: + for optional_params in [('IDLParserContext& ctxt, ', 'ctxt, '), ('', '')]: self._gen_field_validator(struct, field, optional_params) def gen_bson_deserializer_methods(self, struct): @@ -2097,7 +2097,7 @@ class _CppSourceFileWriter(_CppFileWriterBase): if isinstance(struct, ast.Command): known_name = "_knownOP_MSGFields" if is_op_msg_request else "_knownBSONFields" self._writer.write_line( - "IDLParserErrorContext::appendGenericCommandArguments(commandPassthroughFields, %s, builder);" + "IDLParserContext::appendGenericCommandArguments(commandPassthroughFields, %s, builder);" % (known_name)) self._writer.write_empty_line() diff --git a/buildscripts/idl/idl/struct_types.py b/buildscripts/idl/idl/struct_types.py index 07e41af11b5..1d3d1647554 100644 --- a/buildscripts/idl/idl/struct_types.py +++ b/buildscripts/idl/idl/struct_types.py @@ -257,14 +257,14 @@ class _StructTypeInfo(StructTypeInfoBase): # type: () -> MethodInfo class_name = common.title_case(self._struct.cpp_name) return MethodInfo(class_name, 'parse', - ['const IDLParserErrorContext& ctxt', 'const BSONObj& bsonObject'], - class_name, static=True) + ['const IDLParserContext& ctxt', 'const BSONObj& bsonObject'], class_name, + static=True) def get_deserializer_method(self): # type: () -> MethodInfo return MethodInfo( common.title_case(self._struct.cpp_name), 'parseProtected', - ['const IDLParserErrorContext& ctxt', 'const BSONObj& bsonObject'], 'void') + ['const IDLParserContext& ctxt', 'const BSONObj& bsonObject'], 'void') def get_serializer_method(self): # type: () -> MethodInfo @@ -326,14 +326,14 @@ class _CommandBaseTypeInfo(_StructTypeInfo): # type: () -> Optional[MethodInfo] class_name = common.title_case(self._struct.cpp_name) return MethodInfo(class_name, 'parse', - ['const IDLParserErrorContext& ctxt', 'const OpMsgRequest& request'], + ['const IDLParserContext& ctxt', 'const OpMsgRequest& request'], class_name, static=True) def get_op_msg_request_deserializer_method(self): # type: () -> Optional[MethodInfo] return MethodInfo( common.title_case(self._struct.cpp_name), 'parseProtected', - ['const IDLParserErrorContext& ctxt', 'const OpMsgRequest& request'], 'void') + ['const IDLParserContext& ctxt', 'const OpMsgRequest& request'], 'void') class _IgnoredCommandTypeInfo(_CommandBaseTypeInfo): @@ -423,7 +423,7 @@ class _CommandFromType(_CommandBaseTypeInfo): # type: () -> MethodInfo return MethodInfo( common.title_case(self._struct.cpp_name), 'parseProtected', - ['const IDLParserErrorContext& ctxt', 'const BSONObj& bsonObject'], 'void') + ['const IDLParserContext& ctxt', 'const BSONObj& bsonObject'], 'void') def gen_getter_method(self, indented_writer): # type: (writer.IndentedTextWriter) -> None @@ -489,7 +489,7 @@ class _CommandWithNamespaceTypeInfo(_CommandBaseTypeInfo): # type: () -> MethodInfo return MethodInfo( common.title_case(self._struct.cpp_name), 'parseProtected', - ['const IDLParserErrorContext& ctxt', 'const BSONObj& bsonObject'], 'void') + ['const IDLParserContext& ctxt', 'const BSONObj& bsonObject'], 'void') def gen_getter_method(self, indented_writer): # type: (writer.IndentedTextWriter) -> None @@ -568,7 +568,7 @@ class _CommandWithUUIDNamespaceTypeInfo(_CommandBaseTypeInfo): # type: () -> MethodInfo return MethodInfo( common.title_case(self._struct.cpp_name), 'parseProtected', - ['const IDLParserErrorContext& ctxt', 'const BSONObj& bsonObject'], 'void') + ['const IDLParserContext& ctxt', 'const BSONObj& bsonObject'], 'void') def gen_getter_method(self, indented_writer): # type: (writer.IndentedTextWriter) -> None |