/* tagletinheritdoc.c generated by valac, the Vala compiler
 * generated from tagletinheritdoc.vala, do not modify */

/* tagletinheritdoc.vala
 *
 * Copyright (C) 2008-2009 Didier Villevalois
 * Copyright (C) 2008-2012 Florian Brosch
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
 *
 * Author:
 * 	Didier 'Ptitjes Villevalois <ptitjes@free.fr>
 */

#include "valadoc.h"
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <valagee.h>
#include <glib-object.h>

#if !defined(VALA_STRICT_C)
#if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 14)
#pragma GCC diagnostic warning "-Wincompatible-pointer-types"
#elif defined(__clang__) && (__clang_major__ >= 16)
#pragma clang diagnostic ignored "-Wincompatible-function-pointer-types"
#pragma clang diagnostic ignored "-Wincompatible-pointer-types"
#endif
#endif

enum  {
	VALADOC_TAGLETS_INHERIT_DOC_0_PROPERTY,
	VALADOC_TAGLETS_INHERIT_DOC_INHERITED_PROPERTY,
	VALADOC_TAGLETS_INHERIT_DOC_NUM_PROPERTIES
};
static GParamSpec* valadoc_taglets_inherit_doc_properties[VALADOC_TAGLETS_INHERIT_DOC_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _vala_iterable_unref0(var) ((var == NULL) ? NULL : (var = (vala_iterable_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
#define _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);
#define _vala_return_if_fail(expr, msg) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return; }
#define _vala_return_val_if_fail(expr, msg, val) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return val; }
#define _vala_warn_if_fail(expr, msg) if G_LIKELY (expr) ; else g_warn_message (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);

struct _ValadocTagletsInheritDocPrivate {
	ValadocContentTaglet* parent_taglet;
	ValadocApiNode* _inherited;
};

static gint ValadocTagletsInheritDoc_private_offset;
static gpointer valadoc_taglets_inherit_doc_parent_class = NULL;

static void valadoc_taglets_inherit_doc_set_inherited (ValadocTagletsInheritDoc* self,
                                                ValadocApiNode* value);
static ValadocRule* valadoc_taglets_inherit_doc_real_get_parser_rule (ValadocContentInlineTaglet* base,
                                                               ValadocRule* run_rule);
static ValadocContentTaglet* valadoc_taglets_inherit_doc_find_parent_taglet (ValadocTagletsInheritDoc* self);
static void valadoc_taglets_inherit_doc_real_check (ValadocContentContentElement* base,
                                             ValadocApiTree* api_root,
                                             ValadocApiNode* container,
                                             const gchar* file_path,
                                             ValadocErrorReporter* reporter,
                                             ValadocSettings* settings);
 G_GNUC_INTERNAL void valadoc_api_tree_register_inheritdoc (ValadocApiTree* self,
                                           ValadocApiNode* container,
                                           ValadocTagletsInheritDoc* taglet);
static ValadocContentRun** valadoc_taglets_inherit_doc_split_run (ValadocTagletsInheritDoc* self,
                                                           ValadocContentInline* separator,
                                                           gint* result_length1);
 G_GNUC_INTERNAL ValadocContentRun* valadoc_content_run_new (ValadocContentRunStyle style);
 G_GNUC_INTERNAL ValadocContentRun* valadoc_content_run_construct (GType object_type,
                                                  ValadocContentRunStyle style);
 G_GNUC_INTERNAL void valadoc_content_content_element_set_parent (ValadocContentContentElement* self,
                                                 ValadocContentContentElement* value);
 G_GNUC_INTERNAL void valadoc_taglets_inherit_doc_transform (ValadocTagletsInheritDoc* self,
                                            ValadocApiTree* api_root,
                                            ValadocApiNode* container,
                                            const gchar* file_path,
                                            ValadocErrorReporter* reporter,
                                            ValadocSettings* settings);
 G_GNUC_INTERNAL ValadocContentParagraph* valadoc_content_paragraph_new (void);
 G_GNUC_INTERNAL ValadocContentParagraph* valadoc_content_paragraph_construct (GType object_type);
static ValadocContentRun* valadoc_taglets_inherit_doc_content_copy (ValadocTagletsInheritDoc* self,
                                                             ValaList* content);
static ValadocContentContentElement* valadoc_taglets_inherit_doc_real_produce_content (ValadocContentInlineTaglet* base);
 G_GNUC_INTERNAL ValadocContentText* valadoc_content_text_new (const gchar* text);
 G_GNUC_INTERNAL ValadocContentText* valadoc_content_text_construct (GType object_type,
                                                    const gchar* text);
static gboolean valadoc_taglets_inherit_doc_real_is_empty (ValadocContentContentElement* base);
static ValadocContentContentElement* valadoc_taglets_inherit_doc_real_copy (ValadocContentContentElement* base,
                                                                     ValadocContentContentElement* new_parent);
static void valadoc_taglets_inherit_doc_finalize (GObject * obj);
static GType valadoc_taglets_inherit_doc_get_type_once (void);
static void _vala_valadoc_taglets_inherit_doc_get_property (GObject * object,
                                                     guint property_id,
                                                     GValue * value,
                                                     GParamSpec * pspec);
static void _vala_valadoc_taglets_inherit_doc_set_property (GObject * object,
                                                     guint property_id,
                                                     const GValue * value,
                                                     GParamSpec * pspec);
static void _vala_array_destroy (gpointer array,
                          gssize array_length,
                          GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array,
                       gssize array_length,
                       GDestroyNotify destroy_func);

static inline gpointer
valadoc_taglets_inherit_doc_get_instance_private (ValadocTagletsInheritDoc* self)
{
	return G_STRUCT_MEMBER_P (self, ValadocTagletsInheritDoc_private_offset);
}

ValadocApiNode*
valadoc_taglets_inherit_doc_get_inherited (ValadocTagletsInheritDoc* self)
{
	ValadocApiNode* result;
	ValadocApiNode* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_inherited;
	result = _tmp0_;
	return result;
}

static gpointer
_g_object_ref0 (gpointer self)
{
	return self ? g_object_ref (self) : NULL;
}

static void
valadoc_taglets_inherit_doc_set_inherited (ValadocTagletsInheritDoc* self,
                                           ValadocApiNode* value)
{
	ValadocApiNode* old_value;
	g_return_if_fail (self != NULL);
	old_value = valadoc_taglets_inherit_doc_get_inherited (self);
	if (old_value != value) {
		ValadocApiNode* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_inherited);
		self->priv->_inherited = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, valadoc_taglets_inherit_doc_properties[VALADOC_TAGLETS_INHERIT_DOC_INHERITED_PROPERTY]);
	}
}

static ValadocRule*
valadoc_taglets_inherit_doc_real_get_parser_rule (ValadocContentInlineTaglet* base,
                                                  ValadocRule* run_rule)
{
	ValadocTagletsInheritDoc * self;
	ValadocRule* result;
	self = (ValadocTagletsInheritDoc*) base;
	g_return_val_if_fail (run_rule != NULL, NULL);
	result = NULL;
	return result;
}

static ValadocContentTaglet*
valadoc_taglets_inherit_doc_find_parent_taglet (ValadocTagletsInheritDoc* self)
{
	gboolean _tmp0_ = FALSE;
	ValadocApiNode* _tmp1_;
	ValadocContentContentElement* pos = NULL;
	ValadocContentContentElement* _tmp16_;
	ValadocContentTaglet* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp1_ = self->priv->_inherited;
	if (_tmp1_ == NULL) {
		_tmp0_ = TRUE;
	} else {
		ValadocApiNode* _tmp2_;
		ValadocContentComment* _tmp3_;
		ValadocContentComment* _tmp4_;
		_tmp2_ = self->priv->_inherited;
		_tmp3_ = valadoc_api_node_get_documentation (_tmp2_);
		_tmp4_ = _tmp3_;
		_tmp0_ = _tmp4_ == NULL;
	}
	if (_tmp0_) {
		result = NULL;
		return result;
	}
	{
		ValadocContentContentElement* _tmp5_;
		ValadocContentContentElement* _tmp6_;
		ValadocContentContentElement* _tmp7_;
		gboolean _tmp8_ = FALSE;
		_tmp5_ = valadoc_content_content_element_get_parent ((ValadocContentContentElement*) self);
		_tmp6_ = _tmp5_;
		_tmp7_ = _g_object_ref0 (_tmp6_);
		_g_object_unref0 (pos);
		pos = _tmp7_;
		_tmp8_ = TRUE;
		while (TRUE) {
			gboolean _tmp13_ = FALSE;
			ValadocContentContentElement* _tmp14_;
			if (!_tmp8_) {
				ValadocContentContentElement* _tmp9_;
				ValadocContentContentElement* _tmp10_;
				ValadocContentContentElement* _tmp11_;
				ValadocContentContentElement* _tmp12_;
				_tmp9_ = pos;
				_tmp10_ = valadoc_content_content_element_get_parent (_tmp9_);
				_tmp11_ = _tmp10_;
				_tmp12_ = _g_object_ref0 (_tmp11_);
				_g_object_unref0 (pos);
				pos = _tmp12_;
			}
			_tmp8_ = FALSE;
			_tmp14_ = pos;
			if (_tmp14_ != NULL) {
				ValadocContentContentElement* _tmp15_;
				_tmp15_ = pos;
				_tmp13_ = VALADOC_CONTENT_IS_TAGLET (_tmp15_) == FALSE;
			} else {
				_tmp13_ = FALSE;
			}
			if (!_tmp13_) {
				break;
			}
		}
	}
	_tmp16_ = pos;
	if (VALADOC_CONTENT_IS_TAGLET (_tmp16_)) {
		ValadocContentContentElement* _tmp17_;
		ValadocContentTaglet* _tmp18_;
		_tmp17_ = pos;
		_tmp18_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp17_, VALADOC_CONTENT_TYPE_TAGLET, ValadocContentTaglet));
		result = _tmp18_;
		_g_object_unref0 (pos);
		return result;
	}
	result = NULL;
	_g_object_unref0 (pos);
	return result;
}

static void
valadoc_taglets_inherit_doc_real_check (ValadocContentContentElement* base,
                                        ValadocApiTree* api_root,
                                        ValadocApiNode* container,
                                        const gchar* file_path,
                                        ValadocErrorReporter* reporter,
                                        ValadocSettings* settings)
{
	ValadocTagletsInheritDoc * self;
	ValadocContentTaglet* _tmp22_;
	gboolean _tmp23_ = FALSE;
	ValadocContentTaglet* _tmp24_;
	self = (ValadocTagletsInheritDoc*) base;
	g_return_if_fail (api_root != NULL);
	g_return_if_fail (container != NULL);
	g_return_if_fail (file_path != NULL);
	g_return_if_fail (reporter != NULL);
	g_return_if_fail (settings != NULL);
	if (VALADOC_API_IS_METHOD (container)) {
		ValadocApiMethod* _tmp0_;
		ValadocApiMethod* _tmp1_;
		ValadocApiNode* _tmp2_;
		_tmp0_ = valadoc_api_method_get_base_method (G_TYPE_CHECK_INSTANCE_CAST (container, VALADOC_API_TYPE_METHOD, ValadocApiMethod));
		_tmp1_ = _tmp0_;
		_tmp2_ = _g_object_ref0 ((ValadocApiNode*) _tmp1_);
		_g_object_unref0 (self->priv->_inherited);
		self->priv->_inherited = _tmp2_;
	} else {
		if (VALADOC_API_IS_PROPERTY (container)) {
			ValadocApiProperty* _tmp3_;
			ValadocApiProperty* _tmp4_;
			ValadocApiNode* _tmp5_;
			_tmp3_ = valadoc_api_property_get_base_property (G_TYPE_CHECK_INSTANCE_CAST (container, VALADOC_API_TYPE_PROPERTY, ValadocApiProperty));
			_tmp4_ = _tmp3_;
			_tmp5_ = _g_object_ref0 ((ValadocApiNode*) _tmp4_);
			_g_object_unref0 (self->priv->_inherited);
			self->priv->_inherited = _tmp5_;
		} else {
			gboolean _tmp6_ = FALSE;
			if (VALADOC_API_IS_CLASS (container)) {
				ValadocApiTypeReference* _tmp7_;
				ValadocApiTypeReference* _tmp8_;
				_tmp7_ = valadoc_api_class_get_base_type (G_TYPE_CHECK_INSTANCE_CAST (container, VALADOC_API_TYPE_CLASS, ValadocApiClass));
				_tmp8_ = _tmp7_;
				_tmp6_ = _tmp8_ != NULL;
			} else {
				_tmp6_ = FALSE;
			}
			if (_tmp6_) {
				ValadocApiTypeReference* _tmp9_;
				ValadocApiTypeReference* _tmp10_;
				ValadocApiItem* _tmp11_;
				ValadocApiItem* _tmp12_;
				ValadocApiNode* _tmp13_;
				_tmp9_ = valadoc_api_class_get_base_type (G_TYPE_CHECK_INSTANCE_CAST (container, VALADOC_API_TYPE_CLASS, ValadocApiClass));
				_tmp10_ = _tmp9_;
				_tmp11_ = valadoc_api_typereference_get_data_type (_tmp10_);
				_tmp12_ = _tmp11_;
				_tmp13_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp12_, VALADOC_API_TYPE_NODE, ValadocApiNode));
				_g_object_unref0 (self->priv->_inherited);
				self->priv->_inherited = _tmp13_;
			} else {
				gboolean _tmp14_ = FALSE;
				if (VALADOC_API_IS_STRUCT (container)) {
					ValadocApiTypeReference* _tmp15_;
					ValadocApiTypeReference* _tmp16_;
					_tmp15_ = valadoc_api_struct_get_base_type (G_TYPE_CHECK_INSTANCE_CAST (container, VALADOC_API_TYPE_STRUCT, ValadocApiStruct));
					_tmp16_ = _tmp15_;
					_tmp14_ = _tmp16_ != NULL;
				} else {
					_tmp14_ = FALSE;
				}
				if (_tmp14_) {
					ValadocApiTypeReference* _tmp17_;
					ValadocApiTypeReference* _tmp18_;
					ValadocApiItem* _tmp19_;
					ValadocApiItem* _tmp20_;
					ValadocApiNode* _tmp21_;
					_tmp17_ = valadoc_api_struct_get_base_type (G_TYPE_CHECK_INSTANCE_CAST (container, VALADOC_API_TYPE_STRUCT, ValadocApiStruct));
					_tmp18_ = _tmp17_;
					_tmp19_ = valadoc_api_typereference_get_data_type (_tmp18_);
					_tmp20_ = _tmp19_;
					_tmp21_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp20_, VALADOC_API_TYPE_NODE, ValadocApiNode));
					_g_object_unref0 (self->priv->_inherited);
					self->priv->_inherited = _tmp21_;
				}
			}
		}
	}
	_tmp22_ = valadoc_taglets_inherit_doc_find_parent_taglet (self);
	_g_object_unref0 (self->priv->parent_taglet);
	self->priv->parent_taglet = _tmp22_;
	_tmp24_ = self->priv->parent_taglet;
	if (_tmp24_ == NULL) {
		ValadocApiNode* _tmp25_;
		_tmp25_ = self->priv->_inherited;
		_tmp23_ = _tmp25_ != NULL;
	} else {
		_tmp23_ = FALSE;
	}
	if (_tmp23_) {
		valadoc_api_tree_register_inheritdoc (api_root, container, self);
	}
}

static gpointer
_vala_iterable_ref0 (gpointer self)
{
	return self ? vala_iterable_ref (self) : NULL;
}

static ValadocContentRun**
valadoc_taglets_inherit_doc_split_run (ValadocTagletsInheritDoc* self,
                                       ValadocContentInline* separator,
                                       gint* result_length1)
{
	ValadocContentContentElement* parent = NULL;
	ValadocContentContentElement* _tmp1_;
	ValadocContentContentElement* _tmp2_;
	ValadocContentContentElement* _tmp3_;
	ValaList* parent_content = NULL;
	gboolean _tmp4_ = FALSE;
	ValadocContentContentElement* _tmp5_;
	ValaList* _tmp18_;
	ValadocContentRun** _tmp48_;
	gint _tmp48__length1;
	ValadocContentRun** result;
	g_return_val_if_fail (self != NULL, NULL);
	if (separator == NULL) {
		ValadocContentRun** _tmp0_;
		gint _tmp0__length1;
		_tmp0_ = NULL;
		_tmp0__length1 = 0;
		if (result_length1) {
			*result_length1 = _tmp0__length1;
		}
		result = _tmp0_;
		return result;
	}
	_tmp1_ = valadoc_content_content_element_get_parent ((ValadocContentContentElement*) separator);
	_tmp2_ = _tmp1_;
	_tmp3_ = _g_object_ref0 (_tmp2_);
	parent = _tmp3_;
	parent_content = NULL;
	_tmp5_ = parent;
	if (VALADOC_CONTENT_IS_RUN (_tmp5_)) {
		ValadocContentContentElement* _tmp6_;
		ValadocContentRunStyle _tmp7_;
		ValadocContentRunStyle _tmp8_;
		_tmp6_ = parent;
		_tmp7_ = valadoc_content_run_get_style (G_TYPE_CHECK_INSTANCE_CAST (_tmp6_, VALADOC_CONTENT_TYPE_RUN, ValadocContentRun));
		_tmp8_ = _tmp7_;
		_tmp4_ = _tmp8_ == VALADOC_CONTENT_RUN_STYLE_NONE;
	} else {
		_tmp4_ = FALSE;
	}
	if (_tmp4_) {
		ValadocContentContentElement* _tmp9_;
		ValaList* _tmp10_;
		ValaList* _tmp11_;
		ValaList* _tmp12_;
		_tmp9_ = parent;
		_tmp10_ = valadoc_content_inline_content_get_content ((ValadocContentInlineContent*) G_TYPE_CHECK_INSTANCE_CAST (_tmp9_, VALADOC_CONTENT_TYPE_RUN, ValadocContentRun));
		_tmp11_ = _tmp10_;
		_tmp12_ = _vala_iterable_ref0 (_tmp11_);
		_vala_iterable_unref0 (parent_content);
		parent_content = _tmp12_;
	} else {
		ValadocContentContentElement* _tmp13_;
		_tmp13_ = parent;
		if (VALADOC_CONTENT_IS_PARAGRAPH (_tmp13_)) {
			ValadocContentContentElement* _tmp14_;
			ValaList* _tmp15_;
			ValaList* _tmp16_;
			ValaList* _tmp17_;
			_tmp14_ = parent;
			_tmp15_ = valadoc_content_inline_content_get_content ((ValadocContentInlineContent*) G_TYPE_CHECK_INSTANCE_CAST (_tmp14_, VALADOC_CONTENT_TYPE_PARAGRAPH, ValadocContentParagraph));
			_tmp16_ = _tmp15_;
			_tmp17_ = _vala_iterable_ref0 (_tmp16_);
			_vala_iterable_unref0 (parent_content);
			parent_content = _tmp17_;
		}
	}
	_tmp18_ = parent_content;
	if (_tmp18_ != NULL) {
		ValadocContentRun* right_run = NULL;
		ValadocContentRun* _tmp19_;
		ValadocContentRun* left_run = NULL;
		ValadocContentRun* _tmp20_;
		gboolean separated = FALSE;
		ValadocContentRun* _tmp42_;
		ValadocContentRun* _tmp43_;
		ValadocContentRun* _tmp44_;
		ValadocContentRun* _tmp45_;
		ValadocContentRun** _tmp46_;
		ValadocContentRun** _tmp47_;
		gint _tmp47__length1;
		_tmp19_ = valadoc_content_run_new (VALADOC_CONTENT_RUN_STYLE_NONE);
		right_run = _tmp19_;
		_tmp20_ = valadoc_content_run_new (VALADOC_CONTENT_RUN_STYLE_NONE);
		left_run = _tmp20_;
		separated = FALSE;
		{
			ValaList* _current_list = NULL;
			ValaList* _tmp21_;
			gint _current_size = 0;
			ValaList* _tmp22_;
			gint _tmp23_;
			gint _tmp24_;
			gint _current_index = 0;
			_tmp21_ = parent_content;
			_current_list = _tmp21_;
			_tmp22_ = _current_list;
			_tmp23_ = vala_collection_get_size ((ValaCollection*) _tmp22_);
			_tmp24_ = _tmp23_;
			_current_size = _tmp24_;
			_current_index = -1;
			while (TRUE) {
				gint _tmp25_;
				gint _tmp26_;
				ValadocContentInline* current = NULL;
				ValaList* _tmp27_;
				gpointer _tmp28_;
				ValadocContentInline* _tmp29_;
				_current_index = _current_index + 1;
				_tmp25_ = _current_index;
				_tmp26_ = _current_size;
				if (!(_tmp25_ < _tmp26_)) {
					break;
				}
				_tmp27_ = _current_list;
				_tmp28_ = vala_list_get (_tmp27_, _current_index);
				current = (ValadocContentInline*) _tmp28_;
				_tmp29_ = current;
				if (_tmp29_ == separator) {
					separated = TRUE;
				} else {
					if (separated) {
						ValadocContentRun* _tmp30_;
						ValaList* _tmp31_;
						ValaList* _tmp32_;
						ValadocContentInline* _tmp33_;
						ValadocContentInline* _tmp34_;
						ValadocContentRun* _tmp35_;
						_tmp30_ = right_run;
						_tmp31_ = valadoc_content_inline_content_get_content ((ValadocContentInlineContent*) _tmp30_);
						_tmp32_ = _tmp31_;
						_tmp33_ = current;
						vala_collection_add ((ValaCollection*) _tmp32_, _tmp33_);
						_tmp34_ = current;
						_tmp35_ = right_run;
						valadoc_content_content_element_set_parent ((ValadocContentContentElement*) _tmp34_, (ValadocContentContentElement*) _tmp35_);
					} else {
						ValadocContentRun* _tmp36_;
						ValaList* _tmp37_;
						ValaList* _tmp38_;
						ValadocContentInline* _tmp39_;
						ValadocContentInline* _tmp40_;
						ValadocContentRun* _tmp41_;
						_tmp36_ = left_run;
						_tmp37_ = valadoc_content_inline_content_get_content ((ValadocContentInlineContent*) _tmp36_);
						_tmp38_ = _tmp37_;
						_tmp39_ = current;
						vala_collection_add ((ValaCollection*) _tmp38_, _tmp39_);
						_tmp40_ = current;
						_tmp41_ = left_run;
						valadoc_content_content_element_set_parent ((ValadocContentContentElement*) _tmp40_, (ValadocContentContentElement*) _tmp41_);
					}
				}
				_g_object_unref0 (current);
			}
		}
		_tmp42_ = left_run;
		_tmp43_ = _g_object_ref0 (_tmp42_);
		_tmp44_ = right_run;
		_tmp45_ = _g_object_ref0 (_tmp44_);
		_tmp46_ = g_new0 (ValadocContentRun*, 2 + 1);
		_tmp46_[0] = _tmp43_;
		_tmp46_[1] = _tmp45_;
		_tmp47_ = _tmp46_;
		_tmp47__length1 = 2;
		if (result_length1) {
			*result_length1 = _tmp47__length1;
		}
		result = _tmp47_;
		_g_object_unref0 (left_run);
		_g_object_unref0 (right_run);
		_vala_iterable_unref0 (parent_content);
		_g_object_unref0 (parent);
		return result;
	}
	_tmp48_ = NULL;
	_tmp48__length1 = 0;
	if (result_length1) {
		*result_length1 = _tmp48__length1;
	}
	result = _tmp48_;
	_vala_iterable_unref0 (parent_content);
	_g_object_unref0 (parent);
	return result;
}

 G_GNUC_INTERNAL void
valadoc_taglets_inherit_doc_transform (ValadocTagletsInheritDoc* self,
                                       ValadocApiTree* api_root,
                                       ValadocApiNode* container,
                                       const gchar* file_path,
                                       ValadocErrorReporter* reporter,
                                       ValadocSettings* settings)
{
	ValadocContentContentElement* separator = NULL;
	ValadocContentContentElement* _tmp0_;
	ValadocContentRun* right_run = NULL;
	ValadocContentRun* left_run = NULL;
	ValadocContentRun** parts = NULL;
	gint parts_length1 = 0;
	gint _parts_size_ = 0;
	gboolean _tmp33_ = FALSE;
	ValadocContentContentElement* _tmp34_;
	ValadocContentComment* comment = NULL;
	ValadocContentContentElement* _tmp42_;
	ValadocContentContentElement* _tmp43_;
	ValadocContentContentElement* _tmp44_;
	ValadocContentComment* _tmp45_;
	ValadocContentComment* _tmp46_;
	gint insert_pos = 0;
	ValadocContentComment* _tmp47_;
	ValaList* _tmp48_;
	ValaList* _tmp49_;
	ValadocContentContentElement* _tmp50_;
	gint start_pos = 0;
	ValadocContentRun* _tmp71_;
	ValadocContentRun* _tmp105_;
	ValadocContentComment* _tmp139_;
	ValaList* _tmp140_;
	ValaList* _tmp141_;
	ValadocContentContentElement* _tmp142_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (api_root != NULL);
	g_return_if_fail (container != NULL);
	g_return_if_fail (file_path != NULL);
	g_return_if_fail (reporter != NULL);
	g_return_if_fail (settings != NULL);
	_tmp0_ = _g_object_ref0 ((ValadocContentContentElement*) self);
	separator = _tmp0_;
	right_run = NULL;
	left_run = NULL;
	while (TRUE) {
		ValadocContentContentElement* _tmp1_;
		gint _tmp2_ = 0;
		ValadocContentRun** _tmp3_;
		ValadocContentRun** _tmp4_;
		gint _tmp4__length1;
		ValadocContentRun* _tmp5_;
		ValadocContentRun* _tmp14_;
		ValadocContentContentElement* _tmp23_;
		ValadocContentContentElement* _tmp24_;
		ValadocContentContentElement* _tmp25_;
		ValadocContentContentElement* _tmp26_;
		ValadocContentRun** _tmp27_;
		gint _tmp27__length1;
		ValadocContentRun* _tmp28_;
		ValadocContentRun* _tmp29_;
		ValadocContentRun** _tmp30_;
		gint _tmp30__length1;
		ValadocContentRun* _tmp31_;
		ValadocContentRun* _tmp32_;
		_tmp1_ = separator;
		_tmp3_ = valadoc_taglets_inherit_doc_split_run (self, VALADOC_CONTENT_IS_INLINE (_tmp1_) ? ((ValadocContentInline*) _tmp1_) : NULL, &_tmp2_);
		parts = (_vala_array_free (parts, parts_length1, (GDestroyNotify) g_object_unref), NULL);
		parts = _tmp3_;
		parts_length1 = _tmp2_;
		_parts_size_ = parts_length1;
		_tmp4_ = parts;
		_tmp4__length1 = parts_length1;
		if (!(_tmp4_ != NULL)) {
			break;
		}
		_tmp5_ = left_run;
		if (_tmp5_ != NULL) {
			ValadocContentRun** _tmp6_;
			gint _tmp6__length1;
			ValadocContentRun* _tmp7_;
			ValaList* _tmp8_;
			ValaList* _tmp9_;
			ValadocContentRun* _tmp10_;
			ValadocContentRun* _tmp11_;
			ValadocContentRun** _tmp12_;
			gint _tmp12__length1;
			ValadocContentRun* _tmp13_;
			_tmp6_ = parts;
			_tmp6__length1 = parts_length1;
			_tmp7_ = _tmp6_[0];
			_tmp8_ = valadoc_content_inline_content_get_content ((ValadocContentInlineContent*) _tmp7_);
			_tmp9_ = _tmp8_;
			_tmp10_ = left_run;
			vala_collection_add ((ValaCollection*) _tmp9_, (ValadocContentInline*) _tmp10_);
			_tmp11_ = left_run;
			_tmp12_ = parts;
			_tmp12__length1 = parts_length1;
			_tmp13_ = _tmp12_[0];
			valadoc_content_content_element_set_parent ((ValadocContentContentElement*) _tmp11_, (ValadocContentContentElement*) _tmp13_);
		}
		_tmp14_ = right_run;
		if (_tmp14_ != NULL) {
			ValadocContentRun** _tmp15_;
			gint _tmp15__length1;
			ValadocContentRun* _tmp16_;
			ValaList* _tmp17_;
			ValaList* _tmp18_;
			ValadocContentRun* _tmp19_;
			ValadocContentRun* _tmp20_;
			ValadocContentRun** _tmp21_;
			gint _tmp21__length1;
			ValadocContentRun* _tmp22_;
			_tmp15_ = parts;
			_tmp15__length1 = parts_length1;
			_tmp16_ = _tmp15_[1];
			_tmp17_ = valadoc_content_inline_content_get_content ((ValadocContentInlineContent*) _tmp16_);
			_tmp18_ = _tmp17_;
			_tmp19_ = right_run;
			vala_list_insert (_tmp18_, 0, (ValadocContentInline*) _tmp19_);
			_tmp20_ = right_run;
			_tmp21_ = parts;
			_tmp21__length1 = parts_length1;
			_tmp22_ = _tmp21_[1];
			valadoc_content_content_element_set_parent ((ValadocContentContentElement*) _tmp20_, (ValadocContentContentElement*) _tmp22_);
		}
		_tmp23_ = separator;
		_tmp24_ = valadoc_content_content_element_get_parent (_tmp23_);
		_tmp25_ = _tmp24_;
		_tmp26_ = _g_object_ref0 (_tmp25_);
		_g_object_unref0 (separator);
		separator = _tmp26_;
		_tmp27_ = parts;
		_tmp27__length1 = parts_length1;
		_tmp28_ = _tmp27_[1];
		_tmp29_ = _g_object_ref0 (_tmp28_);
		_g_object_unref0 (right_run);
		right_run = _tmp29_;
		_tmp30_ = parts;
		_tmp30__length1 = parts_length1;
		_tmp31_ = _tmp30_[0];
		_tmp32_ = _g_object_ref0 (_tmp31_);
		_g_object_unref0 (left_run);
		left_run = _tmp32_;
	}
	_tmp34_ = separator;
	if (VALADOC_CONTENT_IS_PARAGRAPH (_tmp34_) == FALSE) {
		_tmp33_ = TRUE;
	} else {
		ValadocContentContentElement* _tmp35_;
		ValadocContentContentElement* _tmp36_;
		ValadocContentContentElement* _tmp37_;
		_tmp35_ = separator;
		_tmp36_ = valadoc_content_content_element_get_parent (_tmp35_);
		_tmp37_ = _tmp36_;
		_tmp33_ = VALADOC_CONTENT_IS_COMMENT (_tmp37_) == FALSE;
	}
	if (_tmp33_) {
		gchar* _tmp38_;
		gchar* _tmp39_;
		gchar* _tmp40_;
		gchar* _tmp41_;
		_tmp38_ = valadoc_api_node_get_full_name (container);
		_tmp39_ = _tmp38_;
		_tmp40_ = g_strdup_printf ("%s: %s: @inheritDoc", file_path, _tmp39_);
		_tmp41_ = _tmp40_;
		valadoc_error_reporter_simple_error (reporter, _tmp41_, "Parent documentation can't be copied to this location.");
		_g_free0 (_tmp41_);
		_g_free0 (_tmp39_);
		parts = (_vala_array_free (parts, parts_length1, (GDestroyNotify) g_object_unref), NULL);
		_g_object_unref0 (left_run);
		_g_object_unref0 (right_run);
		_g_object_unref0 (separator);
		return;
	}
	_tmp42_ = separator;
	_tmp43_ = valadoc_content_content_element_get_parent (_tmp42_);
	_tmp44_ = _tmp43_;
	_tmp45_ = _g_object_ref0 (VALADOC_CONTENT_IS_COMMENT (_tmp44_) ? ((ValadocContentComment*) _tmp44_) : NULL);
	comment = _tmp45_;
	_tmp46_ = comment;
	_vala_assert (_tmp46_ != NULL, "comment != null");
	_tmp47_ = comment;
	_tmp48_ = valadoc_content_block_content_get_content ((ValadocContentBlockContent*) _tmp47_);
	_tmp49_ = _tmp48_;
	_tmp50_ = separator;
	insert_pos = vala_list_index_of (_tmp49_, (ValadocContentBlock*) G_TYPE_CHECK_INSTANCE_CAST (_tmp50_, VALADOC_CONTENT_TYPE_PARAGRAPH, ValadocContentParagraph));
	start_pos = insert_pos;
	_vala_assert (insert_pos >= 0, "insert_pos >= 0");
	{
		ValaList* _block_list = NULL;
		ValadocApiNode* _tmp51_;
		ValadocContentComment* _tmp52_;
		ValadocContentComment* _tmp53_;
		ValaList* _tmp54_;
		ValaList* _tmp55_;
		gint _block_size = 0;
		ValaList* _tmp56_;
		gint _tmp57_;
		gint _tmp58_;
		gint _block_index = 0;
		_tmp51_ = self->priv->_inherited;
		_tmp52_ = valadoc_api_node_get_documentation (_tmp51_);
		_tmp53_ = _tmp52_;
		_tmp54_ = valadoc_content_block_content_get_content ((ValadocContentBlockContent*) _tmp53_);
		_tmp55_ = _tmp54_;
		_block_list = _tmp55_;
		_tmp56_ = _block_list;
		_tmp57_ = vala_collection_get_size ((ValaCollection*) _tmp56_);
		_tmp58_ = _tmp57_;
		_block_size = _tmp58_;
		_block_index = -1;
		while (TRUE) {
			gint _tmp59_;
			gint _tmp60_;
			ValadocContentBlock* block = NULL;
			ValaList* _tmp61_;
			gpointer _tmp62_;
			ValadocContentComment* _tmp63_;
			ValaList* _tmp64_;
			ValaList* _tmp65_;
			ValadocContentBlock* _tmp66_;
			ValadocContentComment* _tmp67_;
			ValadocContentContentElement* _tmp68_;
			ValadocContentBlock* _tmp69_;
			gint _tmp70_;
			_block_index = _block_index + 1;
			_tmp59_ = _block_index;
			_tmp60_ = _block_size;
			if (!(_tmp59_ < _tmp60_)) {
				break;
			}
			_tmp61_ = _block_list;
			_tmp62_ = vala_list_get (_tmp61_, _block_index);
			block = (ValadocContentBlock*) _tmp62_;
			_tmp63_ = comment;
			_tmp64_ = valadoc_content_block_content_get_content ((ValadocContentBlockContent*) _tmp63_);
			_tmp65_ = _tmp64_;
			_tmp66_ = block;
			_tmp67_ = comment;
			_tmp68_ = valadoc_content_content_element_copy ((ValadocContentContentElement*) _tmp66_, (ValadocContentContentElement*) _tmp67_);
			_tmp69_ = G_TYPE_CHECK_INSTANCE_CAST (_tmp68_, VALADOC_CONTENT_TYPE_BLOCK, ValadocContentBlock);
			vala_list_insert (_tmp65_, insert_pos, _tmp69_);
			_g_object_unref0 (_tmp69_);
			_tmp70_ = insert_pos;
			insert_pos = _tmp70_ + 1;
			_g_object_unref0 (block);
		}
	}
	_tmp71_ = right_run;
	if (_tmp71_ != NULL) {
		ValadocContentComment* _tmp72_;
		ValaList* _tmp73_;
		ValaList* _tmp74_;
		gpointer _tmp75_;
		ValadocContentBlock* _tmp76_;
		gboolean _tmp77_;
		_tmp72_ = comment;
		_tmp73_ = valadoc_content_block_content_get_content ((ValadocContentBlockContent*) _tmp72_);
		_tmp74_ = _tmp73_;
		_tmp75_ = vala_list_get (_tmp74_, insert_pos - 1);
		_tmp76_ = (ValadocContentBlock*) _tmp75_;
		_tmp77_ = VALADOC_CONTENT_IS_PARAGRAPH (_tmp76_);
		_g_object_unref0 (_tmp76_);
		if (_tmp77_) {
			ValadocContentComment* _tmp78_;
			ValaList* _tmp79_;
			ValaList* _tmp80_;
			gpointer _tmp81_;
			ValadocContentParagraph* _tmp82_;
			ValaList* _tmp83_;
			ValaList* _tmp84_;
			ValadocContentRun* _tmp85_;
			ValadocContentRun* _tmp86_;
			ValadocContentComment* _tmp87_;
			ValaList* _tmp88_;
			ValaList* _tmp89_;
			gpointer _tmp90_;
			ValadocContentBlock* _tmp91_;
			_tmp78_ = comment;
			_tmp79_ = valadoc_content_block_content_get_content ((ValadocContentBlockContent*) _tmp78_);
			_tmp80_ = _tmp79_;
			_tmp81_ = vala_list_get (_tmp80_, insert_pos - 1);
			_tmp82_ = G_TYPE_CHECK_INSTANCE_CAST ((ValadocContentBlock*) _tmp81_, VALADOC_CONTENT_TYPE_PARAGRAPH, ValadocContentParagraph);
			_tmp83_ = valadoc_content_inline_content_get_content ((ValadocContentInlineContent*) _tmp82_);
			_tmp84_ = _tmp83_;
			_tmp85_ = right_run;
			vala_collection_add ((ValaCollection*) _tmp84_, (ValadocContentInline*) _tmp85_);
			_g_object_unref0 (_tmp82_);
			_tmp86_ = right_run;
			_tmp87_ = comment;
			_tmp88_ = valadoc_content_block_content_get_content ((ValadocContentBlockContent*) _tmp87_);
			_tmp89_ = _tmp88_;
			_tmp90_ = vala_list_get (_tmp89_, insert_pos - 1);
			_tmp91_ = (ValadocContentBlock*) _tmp90_;
			valadoc_content_content_element_set_parent ((ValadocContentContentElement*) _tmp86_, (ValadocContentContentElement*) _tmp91_);
			_g_object_unref0 (_tmp91_);
		} else {
			ValadocContentParagraph* p = NULL;
			ValadocContentParagraph* _tmp92_;
			ValadocContentParagraph* _tmp93_;
			ValaList* _tmp94_;
			ValaList* _tmp95_;
			ValadocContentRun* _tmp96_;
			ValadocContentRun* _tmp97_;
			ValadocContentParagraph* _tmp98_;
			ValadocContentParagraph* _tmp99_;
			ValadocContentComment* _tmp100_;
			ValadocContentComment* _tmp101_;
			ValaList* _tmp102_;
			ValaList* _tmp103_;
			ValadocContentParagraph* _tmp104_;
			_tmp92_ = valadoc_content_paragraph_new ();
			p = _tmp92_;
			_tmp93_ = p;
			_tmp94_ = valadoc_content_inline_content_get_content ((ValadocContentInlineContent*) _tmp93_);
			_tmp95_ = _tmp94_;
			_tmp96_ = right_run;
			vala_collection_add ((ValaCollection*) _tmp95_, (ValadocContentInline*) _tmp96_);
			_tmp97_ = right_run;
			_tmp98_ = p;
			valadoc_content_content_element_set_parent ((ValadocContentContentElement*) _tmp97_, (ValadocContentContentElement*) _tmp98_);
			_tmp99_ = p;
			_tmp100_ = comment;
			valadoc_content_content_element_set_parent ((ValadocContentContentElement*) _tmp99_, (ValadocContentContentElement*) _tmp100_);
			_tmp101_ = comment;
			_tmp102_ = valadoc_content_block_content_get_content ((ValadocContentBlockContent*) _tmp101_);
			_tmp103_ = _tmp102_;
			_tmp104_ = p;
			vala_list_insert (_tmp103_, insert_pos, (ValadocContentBlock*) _tmp104_);
			_g_object_unref0 (p);
		}
	}
	_tmp105_ = left_run;
	if (_tmp105_ != NULL) {
		ValadocContentComment* _tmp106_;
		ValaList* _tmp107_;
		ValaList* _tmp108_;
		gpointer _tmp109_;
		ValadocContentBlock* _tmp110_;
		gboolean _tmp111_;
		_tmp106_ = comment;
		_tmp107_ = valadoc_content_block_content_get_content ((ValadocContentBlockContent*) _tmp106_);
		_tmp108_ = _tmp107_;
		_tmp109_ = vala_list_get (_tmp108_, start_pos);
		_tmp110_ = (ValadocContentBlock*) _tmp109_;
		_tmp111_ = VALADOC_CONTENT_IS_PARAGRAPH (_tmp110_);
		_g_object_unref0 (_tmp110_);
		if (_tmp111_) {
			ValadocContentComment* _tmp112_;
			ValaList* _tmp113_;
			ValaList* _tmp114_;
			gpointer _tmp115_;
			ValadocContentParagraph* _tmp116_;
			ValaList* _tmp117_;
			ValaList* _tmp118_;
			ValadocContentRun* _tmp119_;
			ValadocContentRun* _tmp120_;
			ValadocContentComment* _tmp121_;
			ValaList* _tmp122_;
			ValaList* _tmp123_;
			gpointer _tmp124_;
			ValadocContentBlock* _tmp125_;
			_tmp112_ = comment;
			_tmp113_ = valadoc_content_block_content_get_content ((ValadocContentBlockContent*) _tmp112_);
			_tmp114_ = _tmp113_;
			_tmp115_ = vala_list_get (_tmp114_, start_pos);
			_tmp116_ = G_TYPE_CHECK_INSTANCE_CAST ((ValadocContentBlock*) _tmp115_, VALADOC_CONTENT_TYPE_PARAGRAPH, ValadocContentParagraph);
			_tmp117_ = valadoc_content_inline_content_get_content ((ValadocContentInlineContent*) _tmp116_);
			_tmp118_ = _tmp117_;
			_tmp119_ = left_run;
			vala_list_insert (_tmp118_, 0, (ValadocContentInline*) _tmp119_);
			_g_object_unref0 (_tmp116_);
			_tmp120_ = left_run;
			_tmp121_ = comment;
			_tmp122_ = valadoc_content_block_content_get_content ((ValadocContentBlockContent*) _tmp121_);
			_tmp123_ = _tmp122_;
			_tmp124_ = vala_list_get (_tmp123_, start_pos);
			_tmp125_ = (ValadocContentBlock*) _tmp124_;
			valadoc_content_content_element_set_parent ((ValadocContentContentElement*) _tmp120_, (ValadocContentContentElement*) _tmp125_);
			_g_object_unref0 (_tmp125_);
		} else {
			ValadocContentParagraph* p = NULL;
			ValadocContentParagraph* _tmp126_;
			ValadocContentParagraph* _tmp127_;
			ValaList* _tmp128_;
			ValaList* _tmp129_;
			ValadocContentRun* _tmp130_;
			ValadocContentRun* _tmp131_;
			ValadocContentParagraph* _tmp132_;
			ValadocContentParagraph* _tmp133_;
			ValadocContentComment* _tmp134_;
			ValadocContentComment* _tmp135_;
			ValaList* _tmp136_;
			ValaList* _tmp137_;
			ValadocContentParagraph* _tmp138_;
			_tmp126_ = valadoc_content_paragraph_new ();
			p = _tmp126_;
			_tmp127_ = p;
			_tmp128_ = valadoc_content_inline_content_get_content ((ValadocContentInlineContent*) _tmp127_);
			_tmp129_ = _tmp128_;
			_tmp130_ = left_run;
			vala_collection_add ((ValaCollection*) _tmp129_, (ValadocContentInline*) _tmp130_);
			_tmp131_ = left_run;
			_tmp132_ = p;
			valadoc_content_content_element_set_parent ((ValadocContentContentElement*) _tmp131_, (ValadocContentContentElement*) _tmp132_);
			_tmp133_ = p;
			_tmp134_ = comment;
			valadoc_content_content_element_set_parent ((ValadocContentContentElement*) _tmp133_, (ValadocContentContentElement*) _tmp134_);
			_tmp135_ = comment;
			_tmp136_ = valadoc_content_block_content_get_content ((ValadocContentBlockContent*) _tmp135_);
			_tmp137_ = _tmp136_;
			_tmp138_ = p;
			vala_list_insert (_tmp137_, start_pos, (ValadocContentBlock*) _tmp138_);
			_g_object_unref0 (p);
		}
	}
	_tmp139_ = comment;
	_tmp140_ = valadoc_content_block_content_get_content ((ValadocContentBlockContent*) _tmp139_);
	_tmp141_ = _tmp140_;
	_tmp142_ = separator;
	vala_collection_remove ((ValaCollection*) _tmp141_, (ValadocContentBlock*) G_TYPE_CHECK_INSTANCE_CAST (_tmp142_, VALADOC_CONTENT_TYPE_PARAGRAPH, ValadocContentParagraph));
	_g_object_unref0 (comment);
	parts = (_vala_array_free (parts, parts_length1, (GDestroyNotify) g_object_unref), NULL);
	_g_object_unref0 (left_run);
	_g_object_unref0 (right_run);
	_g_object_unref0 (separator);
}

static ValadocContentRun*
valadoc_taglets_inherit_doc_content_copy (ValadocTagletsInheritDoc* self,
                                          ValaList* content)
{
	ValadocContentRun* run = NULL;
	ValadocContentRun* _tmp0_;
	ValadocContentRun* _tmp1_;
	ValadocContentRun* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = valadoc_content_run_new (VALADOC_CONTENT_RUN_STYLE_NONE);
	run = _tmp0_;
	_tmp1_ = run;
	valadoc_content_content_element_set_parent ((ValadocContentContentElement*) _tmp1_, (ValadocContentContentElement*) self);
	if (content != NULL) {
		{
			ValaList* _item_list = NULL;
			gint _item_size = 0;
			ValaList* _tmp2_;
			gint _tmp3_;
			gint _tmp4_;
			gint _item_index = 0;
			_item_list = content;
			_tmp2_ = _item_list;
			_tmp3_ = vala_collection_get_size ((ValaCollection*) _tmp2_);
			_tmp4_ = _tmp3_;
			_item_size = _tmp4_;
			_item_index = -1;
			while (TRUE) {
				gint _tmp5_;
				gint _tmp6_;
				ValadocContentContentElement* item = NULL;
				ValaList* _tmp7_;
				gpointer _tmp8_;
				ValadocContentRun* _tmp9_;
				ValaList* _tmp10_;
				ValaList* _tmp11_;
				ValadocContentContentElement* _tmp12_;
				ValadocContentContentElement* _tmp13_;
				ValadocContentInline* _tmp14_;
				ValadocContentInline* _tmp15_;
				_item_index = _item_index + 1;
				_tmp5_ = _item_index;
				_tmp6_ = _item_size;
				if (!(_tmp5_ < _tmp6_)) {
					break;
				}
				_tmp7_ = _item_list;
				_tmp8_ = vala_list_get (_tmp7_, _item_index);
				item = (ValadocContentContentElement*) _tmp8_;
				_tmp9_ = run;
				_tmp10_ = valadoc_content_inline_content_get_content ((ValadocContentInlineContent*) _tmp9_);
				_tmp11_ = _tmp10_;
				_tmp12_ = item;
				_tmp13_ = valadoc_content_content_element_copy (_tmp12_, (ValadocContentContentElement*) self);
				_tmp14_ = VALADOC_CONTENT_IS_INLINE (_tmp13_) ? ((ValadocContentInline*) _tmp13_) : NULL;
				if (_tmp14_ == NULL) {
					_g_object_unref0 (_tmp13_);
				}
				_tmp15_ = _tmp14_;
				vala_collection_add ((ValaCollection*) _tmp11_, _tmp15_);
				_g_object_unref0 (_tmp15_);
				_g_object_unref0 (item);
			}
		}
	}
	result = run;
	return result;
}

static ValadocContentContentElement*
valadoc_taglets_inherit_doc_real_produce_content (ValadocContentInlineTaglet* base)
{
	ValadocTagletsInheritDoc * self;
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	ValadocApiNode* _tmp2_;
	ValadocContentText* _tmp27_;
	ValadocContentContentElement* result;
	self = (ValadocTagletsInheritDoc*) base;
	_tmp2_ = self->priv->_inherited;
	if (_tmp2_ != NULL) {
		ValadocApiNode* _tmp3_;
		ValadocContentComment* _tmp4_;
		ValadocContentComment* _tmp5_;
		_tmp3_ = self->priv->_inherited;
		_tmp4_ = valadoc_api_node_get_documentation (_tmp3_);
		_tmp5_ = _tmp4_;
		_tmp1_ = _tmp5_ != NULL;
	} else {
		_tmp1_ = FALSE;
	}
	if (_tmp1_) {
		ValadocContentTaglet* _tmp6_;
		_tmp6_ = self->priv->parent_taglet;
		_tmp0_ = _tmp6_ != NULL;
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		ValaList* parent_taglets = NULL;
		ValadocApiNode* _tmp7_;
		ValadocContentComment* _tmp8_;
		ValadocContentComment* _tmp9_;
		ValadocContentTaglet* _tmp10_;
		ValaList* _tmp11_;
		_tmp7_ = self->priv->_inherited;
		_tmp8_ = valadoc_api_node_get_documentation (_tmp7_);
		_tmp9_ = _tmp8_;
		_tmp10_ = self->priv->parent_taglet;
		_tmp11_ = valadoc_content_comment_find_taglets (_tmp9_, NULL, G_TYPE_FROM_INSTANCE ((GObject*) _tmp10_));
		parent_taglets = _tmp11_;
		{
			ValaList* _parent_list = NULL;
			ValaList* _tmp12_;
			gint _parent_size = 0;
			ValaList* _tmp13_;
			gint _tmp14_;
			gint _tmp15_;
			gint _parent_index = 0;
			_tmp12_ = parent_taglets;
			_parent_list = _tmp12_;
			_tmp13_ = _parent_list;
			_tmp14_ = vala_collection_get_size ((ValaCollection*) _tmp13_);
			_tmp15_ = _tmp14_;
			_parent_size = _tmp15_;
			_parent_index = -1;
			while (TRUE) {
				gint _tmp16_;
				gint _tmp17_;
				ValadocContentTaglet* parent = NULL;
				ValaList* _tmp18_;
				gpointer _tmp19_;
				ValadocContentTaglet* _tmp20_;
				ValadocContentTaglet* _tmp21_;
				_parent_index = _parent_index + 1;
				_tmp16_ = _parent_index;
				_tmp17_ = _parent_size;
				if (!(_tmp16_ < _tmp17_)) {
					break;
				}
				_tmp18_ = _parent_list;
				_tmp19_ = vala_list_get (_tmp18_, _parent_index);
				parent = (ValadocContentTaglet*) _tmp19_;
				_tmp20_ = parent;
				_tmp21_ = self->priv->parent_taglet;
				if (valadoc_content_taglet_inheritable (_tmp20_, _tmp21_)) {
					ValadocContentTaglet* _tmp22_;
					ValaList* _tmp23_;
					ValaList* _tmp24_;
					ValadocContentRun* _tmp25_;
					ValadocContentContentElement* _tmp26_;
					_tmp22_ = parent;
					_tmp23_ = valadoc_content_taglet_get_inheritable_documentation (_tmp22_);
					_tmp24_ = _tmp23_;
					_tmp25_ = valadoc_taglets_inherit_doc_content_copy (self, _tmp24_);
					_tmp26_ = (ValadocContentContentElement*) _tmp25_;
					_vala_iterable_unref0 (_tmp24_);
					result = _tmp26_;
					_g_object_unref0 (parent);
					_vala_iterable_unref0 (parent_taglets);
					return result;
				}
				_g_object_unref0 (parent);
			}
		}
		_vala_iterable_unref0 (parent_taglets);
	}
	_tmp27_ = valadoc_content_text_new ("");
	result = (ValadocContentContentElement*) _tmp27_;
	return result;
}

static gboolean
valadoc_taglets_inherit_doc_real_is_empty (ValadocContentContentElement* base)
{
	ValadocTagletsInheritDoc * self;
	gboolean result;
	self = (ValadocTagletsInheritDoc*) base;
	result = FALSE;
	return result;
}

static ValadocContentContentElement*
valadoc_taglets_inherit_doc_real_copy (ValadocContentContentElement* base,
                                       ValadocContentContentElement* new_parent)
{
	ValadocTagletsInheritDoc * self;
	ValadocTagletsInheritDoc* doc = NULL;
	ValadocTagletsInheritDoc* _tmp0_;
	ValadocSettings* _tmp1_;
	ValadocSettings* _tmp2_;
	ValadocResourceLocator* _tmp3_;
	ValadocResourceLocator* _tmp4_;
	ValadocApiNode* _tmp5_;
	ValadocApiNode* _tmp6_;
	ValadocContentContentElement* result;
	self = (ValadocTagletsInheritDoc*) base;
	_tmp0_ = valadoc_taglets_inherit_doc_new ();
	doc = _tmp0_;
	valadoc_content_content_element_set_parent ((ValadocContentContentElement*) doc, new_parent);
	_tmp1_ = ((ValadocContentInlineTaglet*) self)->settings;
	_tmp2_ = _g_object_ref0 (_tmp1_);
	_g_object_unref0 (((ValadocContentInlineTaglet*) doc)->settings);
	((ValadocContentInlineTaglet*) doc)->settings = _tmp2_;
	_tmp3_ = ((ValadocContentInlineTaglet*) self)->locator;
	_tmp4_ = _g_object_ref0 (_tmp3_);
	_g_object_unref0 (((ValadocContentInlineTaglet*) doc)->locator);
	((ValadocContentInlineTaglet*) doc)->locator = _tmp4_;
	_tmp5_ = self->priv->_inherited;
	_tmp6_ = _g_object_ref0 (_tmp5_);
	_g_object_unref0 (doc->priv->_inherited);
	doc->priv->_inherited = _tmp6_;
	result = (ValadocContentContentElement*) doc;
	return result;
}

ValadocTagletsInheritDoc*
valadoc_taglets_inherit_doc_construct (GType object_type)
{
	ValadocTagletsInheritDoc * self = NULL;
	self = (ValadocTagletsInheritDoc*) valadoc_content_inline_taglet_construct (object_type);
	return self;
}

ValadocTagletsInheritDoc*
valadoc_taglets_inherit_doc_new (void)
{
	return valadoc_taglets_inherit_doc_construct (VALADOC_TAGLETS_TYPE_INHERIT_DOC);
}

static void
valadoc_taglets_inherit_doc_class_init (ValadocTagletsInheritDocClass * klass,
                                        gpointer klass_data)
{
	valadoc_taglets_inherit_doc_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &ValadocTagletsInheritDoc_private_offset);
	((ValadocContentInlineTagletClass *) klass)->get_parser_rule = (ValadocRule* (*) (ValadocContentInlineTaglet*, ValadocRule*)) valadoc_taglets_inherit_doc_real_get_parser_rule;
	((ValadocContentContentElementClass *) klass)->check = (void (*) (ValadocContentContentElement*, ValadocApiTree*, ValadocApiNode*, const gchar*, ValadocErrorReporter*, ValadocSettings*)) valadoc_taglets_inherit_doc_real_check;
	((ValadocContentInlineTagletClass *) klass)->produce_content = (ValadocContentContentElement* (*) (ValadocContentInlineTaglet*)) valadoc_taglets_inherit_doc_real_produce_content;
	((ValadocContentContentElementClass *) klass)->is_empty = (gboolean (*) (ValadocContentContentElement*)) valadoc_taglets_inherit_doc_real_is_empty;
	((ValadocContentContentElementClass *) klass)->copy = (ValadocContentContentElement* (*) (ValadocContentContentElement*, ValadocContentContentElement*)) valadoc_taglets_inherit_doc_real_copy;
	G_OBJECT_CLASS (klass)->get_property = _vala_valadoc_taglets_inherit_doc_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_valadoc_taglets_inherit_doc_set_property;
	G_OBJECT_CLASS (klass)->finalize = valadoc_taglets_inherit_doc_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), VALADOC_TAGLETS_INHERIT_DOC_INHERITED_PROPERTY, valadoc_taglets_inherit_doc_properties[VALADOC_TAGLETS_INHERIT_DOC_INHERITED_PROPERTY] = g_param_spec_object ("inherited", "inherited", "inherited", VALADOC_API_TYPE_NODE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
}

static void
valadoc_taglets_inherit_doc_instance_init (ValadocTagletsInheritDoc * self,
                                           gpointer klass)
{
	self->priv = valadoc_taglets_inherit_doc_get_instance_private (self);
	self->priv->parent_taglet = NULL;
}

static void
valadoc_taglets_inherit_doc_finalize (GObject * obj)
{
	ValadocTagletsInheritDoc * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, VALADOC_TAGLETS_TYPE_INHERIT_DOC, ValadocTagletsInheritDoc);
	_g_object_unref0 (self->priv->parent_taglet);
	_g_object_unref0 (self->priv->_inherited);
	G_OBJECT_CLASS (valadoc_taglets_inherit_doc_parent_class)->finalize (obj);
}

static GType
valadoc_taglets_inherit_doc_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ValadocTagletsInheritDocClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) valadoc_taglets_inherit_doc_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ValadocTagletsInheritDoc), 0, (GInstanceInitFunc) valadoc_taglets_inherit_doc_instance_init, NULL };
	GType valadoc_taglets_inherit_doc_type_id;
	valadoc_taglets_inherit_doc_type_id = g_type_register_static (VALADOC_CONTENT_TYPE_INLINE_TAGLET, "ValadocTagletsInheritDoc", &g_define_type_info, 0);
	ValadocTagletsInheritDoc_private_offset = g_type_add_instance_private (valadoc_taglets_inherit_doc_type_id, sizeof (ValadocTagletsInheritDocPrivate));
	return valadoc_taglets_inherit_doc_type_id;
}

GType
valadoc_taglets_inherit_doc_get_type (void)
{
	static volatile gsize valadoc_taglets_inherit_doc_type_id__once = 0;
	if (g_once_init_enter (&valadoc_taglets_inherit_doc_type_id__once)) {
		GType valadoc_taglets_inherit_doc_type_id;
		valadoc_taglets_inherit_doc_type_id = valadoc_taglets_inherit_doc_get_type_once ();
		g_once_init_leave (&valadoc_taglets_inherit_doc_type_id__once, valadoc_taglets_inherit_doc_type_id);
	}
	return valadoc_taglets_inherit_doc_type_id__once;
}

static void
_vala_valadoc_taglets_inherit_doc_get_property (GObject * object,
                                                guint property_id,
                                                GValue * value,
                                                GParamSpec * pspec)
{
	ValadocTagletsInheritDoc * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, VALADOC_TAGLETS_TYPE_INHERIT_DOC, ValadocTagletsInheritDoc);
	switch (property_id) {
		case VALADOC_TAGLETS_INHERIT_DOC_INHERITED_PROPERTY:
		g_value_set_object (value, valadoc_taglets_inherit_doc_get_inherited (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_valadoc_taglets_inherit_doc_set_property (GObject * object,
                                                guint property_id,
                                                const GValue * value,
                                                GParamSpec * pspec)
{
	ValadocTagletsInheritDoc * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, VALADOC_TAGLETS_TYPE_INHERIT_DOC, ValadocTagletsInheritDoc);
	switch (property_id) {
		case VALADOC_TAGLETS_INHERIT_DOC_INHERITED_PROPERTY:
		valadoc_taglets_inherit_doc_set_inherited (self, g_value_get_object (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_array_destroy (gpointer array,
                     gssize array_length,
                     GDestroyNotify destroy_func)
{
	if ((array != NULL) && (destroy_func != NULL)) {
		gssize i;
		for (i = 0; i < array_length; i = i + 1) {
			if (((gpointer*) array)[i] != NULL) {
				destroy_func (((gpointer*) array)[i]);
			}
		}
	}
}

static void
_vala_array_free (gpointer array,
                  gssize array_length,
                  GDestroyNotify destroy_func)
{
	_vala_array_destroy (array, array_length, destroy_func);
	g_free (array);
}

