/* 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 <glib.h>
#include <glib-object.h>
#include "valadoc.h"
#include <stdlib.h>
#include <string.h>
#include <valagee.h>

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 gpointer valadoc_taglets_inherit_doc_parent_class = NULL;

#define VALADOC_TAGLETS_INHERIT_DOC_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), VALADOC_TAGLETS_TYPE_INHERIT_DOC, ValadocTagletsInheritDocPrivate))
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, int* 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_set_inherited (ValadocTagletsInheritDoc* self, ValadocApiNode* value);
static void valadoc_taglets_inherit_doc_finalize (GObject * obj);
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, gint array_length, GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func);


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


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


static ValadocContentTaglet* valadoc_taglets_inherit_doc_find_parent_taglet (ValadocTagletsInheritDoc* self) {
	ValadocContentTaglet* result = NULL;
	gboolean _tmp0_ = FALSE;
	ValadocApiNode* _tmp1_;
	ValadocContentContentElement* pos = NULL;
	ValadocContentContentElement* _tmp16_;
	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_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp15_, VALADOC_CONTENT_TYPE_TAGLET) == FALSE;
			} else {
				_tmp13_ = FALSE;
			}
			if (!_tmp13_) {
				break;
			}
		}
	}
	_tmp16_ = pos;
	if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp16_, VALADOC_CONTENT_TYPE_TAGLET)) {
		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;
	ValadocApiNode* _tmp0_;
	ValadocContentTaglet* _tmp32_;
	gboolean _tmp33_ = FALSE;
	ValadocContentTaglet* _tmp34_;
	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);
	_tmp0_ = container;
	if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, VALADOC_API_TYPE_METHOD)) {
		ValadocApiNode* _tmp1_;
		ValadocApiMethod* _tmp2_;
		ValadocApiMethod* _tmp3_;
		ValadocApiNode* _tmp4_;
		_tmp1_ = container;
		_tmp2_ = valadoc_api_method_get_base_method (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, VALADOC_API_TYPE_METHOD, ValadocApiMethod));
		_tmp3_ = _tmp2_;
		_tmp4_ = _g_object_ref0 ((ValadocApiNode*) _tmp3_);
		_g_object_unref0 (self->priv->_inherited);
		self->priv->_inherited = _tmp4_;
	} else {
		ValadocApiNode* _tmp5_;
		_tmp5_ = container;
		if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp5_, VALADOC_API_TYPE_PROPERTY)) {
			ValadocApiNode* _tmp6_;
			ValadocApiProperty* _tmp7_;
			ValadocApiProperty* _tmp8_;
			ValadocApiNode* _tmp9_;
			_tmp6_ = container;
			_tmp7_ = valadoc_api_property_get_base_property (G_TYPE_CHECK_INSTANCE_CAST (_tmp6_, VALADOC_API_TYPE_PROPERTY, ValadocApiProperty));
			_tmp8_ = _tmp7_;
			_tmp9_ = _g_object_ref0 ((ValadocApiNode*) _tmp8_);
			_g_object_unref0 (self->priv->_inherited);
			self->priv->_inherited = _tmp9_;
		} else {
			gboolean _tmp10_ = FALSE;
			ValadocApiNode* _tmp11_;
			_tmp11_ = container;
			if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp11_, VALADOC_API_TYPE_CLASS)) {
				ValadocApiNode* _tmp12_;
				ValadocApiTypeReference* _tmp13_;
				ValadocApiTypeReference* _tmp14_;
				_tmp12_ = container;
				_tmp13_ = valadoc_api_class_get_base_type (G_TYPE_CHECK_INSTANCE_CAST (_tmp12_, VALADOC_API_TYPE_CLASS, ValadocApiClass));
				_tmp14_ = _tmp13_;
				_tmp10_ = _tmp14_ != NULL;
			} else {
				_tmp10_ = FALSE;
			}
			if (_tmp10_) {
				ValadocApiNode* _tmp15_;
				ValadocApiTypeReference* _tmp16_;
				ValadocApiTypeReference* _tmp17_;
				ValadocApiItem* _tmp18_;
				ValadocApiItem* _tmp19_;
				ValadocApiNode* _tmp20_;
				_tmp15_ = container;
				_tmp16_ = valadoc_api_class_get_base_type (G_TYPE_CHECK_INSTANCE_CAST (_tmp15_, VALADOC_API_TYPE_CLASS, ValadocApiClass));
				_tmp17_ = _tmp16_;
				_tmp18_ = valadoc_api_typereference_get_data_type (_tmp17_);
				_tmp19_ = _tmp18_;
				_tmp20_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp19_, VALADOC_API_TYPE_NODE, ValadocApiNode));
				_g_object_unref0 (self->priv->_inherited);
				self->priv->_inherited = _tmp20_;
			} else {
				gboolean _tmp21_ = FALSE;
				ValadocApiNode* _tmp22_;
				_tmp22_ = container;
				if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp22_, VALADOC_API_TYPE_STRUCT)) {
					ValadocApiNode* _tmp23_;
					ValadocApiTypeReference* _tmp24_;
					ValadocApiTypeReference* _tmp25_;
					_tmp23_ = container;
					_tmp24_ = valadoc_api_struct_get_base_type (G_TYPE_CHECK_INSTANCE_CAST (_tmp23_, VALADOC_API_TYPE_STRUCT, ValadocApiStruct));
					_tmp25_ = _tmp24_;
					_tmp21_ = _tmp25_ != NULL;
				} else {
					_tmp21_ = FALSE;
				}
				if (_tmp21_) {
					ValadocApiNode* _tmp26_;
					ValadocApiTypeReference* _tmp27_;
					ValadocApiTypeReference* _tmp28_;
					ValadocApiItem* _tmp29_;
					ValadocApiItem* _tmp30_;
					ValadocApiNode* _tmp31_;
					_tmp26_ = container;
					_tmp27_ = valadoc_api_struct_get_base_type (G_TYPE_CHECK_INSTANCE_CAST (_tmp26_, VALADOC_API_TYPE_STRUCT, ValadocApiStruct));
					_tmp28_ = _tmp27_;
					_tmp29_ = valadoc_api_typereference_get_data_type (_tmp28_);
					_tmp30_ = _tmp29_;
					_tmp31_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp30_, VALADOC_API_TYPE_NODE, ValadocApiNode));
					_g_object_unref0 (self->priv->_inherited);
					self->priv->_inherited = _tmp31_;
				}
			}
		}
	}
	_tmp32_ = valadoc_taglets_inherit_doc_find_parent_taglet (self);
	_g_object_unref0 (self->priv->parent_taglet);
	self->priv->parent_taglet = _tmp32_;
	_tmp34_ = self->priv->parent_taglet;
	if (_tmp34_ == NULL) {
		ValadocApiNode* _tmp35_;
		_tmp35_ = self->priv->_inherited;
		_tmp33_ = _tmp35_ != NULL;
	} else {
		_tmp33_ = FALSE;
	}
	if (_tmp33_) {
		ValadocApiTree* _tmp36_;
		ValadocApiNode* _tmp37_;
		_tmp36_ = api_root;
		_tmp37_ = container;
		valadoc_api_tree_register_inheritdoc (_tmp36_, _tmp37_, 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, int* result_length1) {
	ValadocContentRun** result = NULL;
	ValadocContentInline* _tmp0_;
	ValadocContentContentElement* parent = NULL;
	ValadocContentInline* _tmp2_;
	ValadocContentContentElement* _tmp3_;
	ValadocContentContentElement* _tmp4_;
	ValadocContentContentElement* _tmp5_;
	ValaList* parent_content = NULL;
	gboolean _tmp6_ = FALSE;
	ValadocContentContentElement* _tmp7_;
	ValaList* _tmp20_;
	ValadocContentRun** _tmp55_;
	gint _tmp55__length1;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = separator;
	if (_tmp0_ == NULL) {
		ValadocContentRun** _tmp1_;
		gint _tmp1__length1;
		_tmp1_ = NULL;
		_tmp1__length1 = 0;
		if (result_length1) {
			*result_length1 = _tmp1__length1;
		}
		result = _tmp1_;
		return result;
	}
	_tmp2_ = separator;
	_tmp3_ = valadoc_content_content_element_get_parent ((ValadocContentContentElement*) _tmp2_);
	_tmp4_ = _tmp3_;
	_tmp5_ = _g_object_ref0 (_tmp4_);
	parent = _tmp5_;
	parent_content = NULL;
	_tmp7_ = parent;
	if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp7_, VALADOC_CONTENT_TYPE_RUN)) {
		ValadocContentContentElement* _tmp8_;
		ValadocContentRunStyle _tmp9_;
		ValadocContentRunStyle _tmp10_;
		_tmp8_ = parent;
		_tmp9_ = valadoc_content_run_get_style (G_TYPE_CHECK_INSTANCE_CAST (_tmp8_, VALADOC_CONTENT_TYPE_RUN, ValadocContentRun));
		_tmp10_ = _tmp9_;
		_tmp6_ = _tmp10_ == VALADOC_CONTENT_RUN_STYLE_NONE;
	} else {
		_tmp6_ = FALSE;
	}
	if (_tmp6_) {
		ValadocContentContentElement* _tmp11_;
		ValaList* _tmp12_;
		ValaList* _tmp13_;
		ValaList* _tmp14_;
		_tmp11_ = parent;
		_tmp12_ = valadoc_content_inline_content_get_content ((ValadocContentInlineContent*) G_TYPE_CHECK_INSTANCE_CAST (_tmp11_, VALADOC_CONTENT_TYPE_RUN, ValadocContentRun));
		_tmp13_ = _tmp12_;
		_tmp14_ = _vala_iterable_ref0 (_tmp13_);
		_vala_iterable_unref0 (parent_content);
		parent_content = _tmp14_;
	} else {
		ValadocContentContentElement* _tmp15_;
		_tmp15_ = parent;
		if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp15_, VALADOC_CONTENT_TYPE_PARAGRAPH)) {
			ValadocContentContentElement* _tmp16_;
			ValaList* _tmp17_;
			ValaList* _tmp18_;
			ValaList* _tmp19_;
			_tmp16_ = parent;
			_tmp17_ = valadoc_content_inline_content_get_content ((ValadocContentInlineContent*) G_TYPE_CHECK_INSTANCE_CAST (_tmp16_, VALADOC_CONTENT_TYPE_PARAGRAPH, ValadocContentParagraph));
			_tmp18_ = _tmp17_;
			_tmp19_ = _vala_iterable_ref0 (_tmp18_);
			_vala_iterable_unref0 (parent_content);
			parent_content = _tmp19_;
		}
	}
	_tmp20_ = parent_content;
	if (_tmp20_ != NULL) {
		ValadocContentRun* right_run = NULL;
		ValadocContentRun* _tmp21_;
		ValadocContentRun* left_run = NULL;
		ValadocContentRun* _tmp22_;
		gboolean separated = FALSE;
		ValadocContentRun* _tmp49_;
		ValadocContentRun* _tmp50_;
		ValadocContentRun* _tmp51_;
		ValadocContentRun* _tmp52_;
		ValadocContentRun** _tmp53_;
		ValadocContentRun** _tmp54_;
		gint _tmp54__length1;
		_tmp21_ = valadoc_content_run_new (VALADOC_CONTENT_RUN_STYLE_NONE);
		right_run = _tmp21_;
		_tmp22_ = valadoc_content_run_new (VALADOC_CONTENT_RUN_STYLE_NONE);
		left_run = _tmp22_;
		separated = FALSE;
		{
			ValaList* _current_list = NULL;
			ValaList* _tmp23_;
			ValaList* _tmp24_;
			gint _current_size = 0;
			ValaList* _tmp25_;
			gint _tmp26_;
			gint _tmp27_;
			gint _current_index = 0;
			_tmp23_ = parent_content;
			_tmp24_ = _vala_iterable_ref0 (_tmp23_);
			_current_list = _tmp24_;
			_tmp25_ = _current_list;
			_tmp26_ = vala_collection_get_size ((ValaCollection*) _tmp25_);
			_tmp27_ = _tmp26_;
			_current_size = _tmp27_;
			_current_index = -1;
			while (TRUE) {
				gint _tmp28_;
				gint _tmp29_;
				gint _tmp30_;
				ValadocContentInline* current = NULL;
				ValaList* _tmp31_;
				gint _tmp32_;
				gpointer _tmp33_;
				ValadocContentInline* _tmp34_;
				ValadocContentInline* _tmp35_;
				_tmp28_ = _current_index;
				_current_index = _tmp28_ + 1;
				_tmp29_ = _current_index;
				_tmp30_ = _current_size;
				if (!(_tmp29_ < _tmp30_)) {
					break;
				}
				_tmp31_ = _current_list;
				_tmp32_ = _current_index;
				_tmp33_ = vala_list_get (_tmp31_, _tmp32_);
				current = (ValadocContentInline*) _tmp33_;
				_tmp34_ = current;
				_tmp35_ = separator;
				if (_tmp34_ == _tmp35_) {
					separated = TRUE;
				} else {
					gboolean _tmp36_;
					_tmp36_ = separated;
					if (_tmp36_) {
						ValadocContentRun* _tmp37_;
						ValaList* _tmp38_;
						ValaList* _tmp39_;
						ValadocContentInline* _tmp40_;
						ValadocContentInline* _tmp41_;
						ValadocContentRun* _tmp42_;
						_tmp37_ = right_run;
						_tmp38_ = valadoc_content_inline_content_get_content ((ValadocContentInlineContent*) _tmp37_);
						_tmp39_ = _tmp38_;
						_tmp40_ = current;
						vala_collection_add ((ValaCollection*) _tmp39_, _tmp40_);
						_tmp41_ = current;
						_tmp42_ = right_run;
						valadoc_content_content_element_set_parent ((ValadocContentContentElement*) _tmp41_, (ValadocContentContentElement*) _tmp42_);
					} else {
						ValadocContentRun* _tmp43_;
						ValaList* _tmp44_;
						ValaList* _tmp45_;
						ValadocContentInline* _tmp46_;
						ValadocContentInline* _tmp47_;
						ValadocContentRun* _tmp48_;
						_tmp43_ = left_run;
						_tmp44_ = valadoc_content_inline_content_get_content ((ValadocContentInlineContent*) _tmp43_);
						_tmp45_ = _tmp44_;
						_tmp46_ = current;
						vala_collection_add ((ValaCollection*) _tmp45_, _tmp46_);
						_tmp47_ = current;
						_tmp48_ = left_run;
						valadoc_content_content_element_set_parent ((ValadocContentContentElement*) _tmp47_, (ValadocContentContentElement*) _tmp48_);
					}
				}
				_g_object_unref0 (current);
			}
			_vala_iterable_unref0 (_current_list);
		}
		_tmp49_ = left_run;
		_tmp50_ = _g_object_ref0 (_tmp49_);
		_tmp51_ = right_run;
		_tmp52_ = _g_object_ref0 (_tmp51_);
		_tmp53_ = g_new0 (ValadocContentRun*, 2 + 1);
		_tmp53_[0] = _tmp50_;
		_tmp53_[1] = _tmp52_;
		_tmp54_ = _tmp53_;
		_tmp54__length1 = 2;
		if (result_length1) {
			*result_length1 = _tmp54__length1;
		}
		result = _tmp54_;
		_g_object_unref0 (left_run);
		_g_object_unref0 (right_run);
		_vala_iterable_unref0 (parent_content);
		_g_object_unref0 (parent);
		return result;
	}
	_tmp55_ = NULL;
	_tmp55__length1 = 0;
	if (result_length1) {
		*result_length1 = _tmp55__length1;
	}
	result = _tmp55_;
	_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* _tmp45_;
	ValadocContentContentElement* _tmp46_;
	ValadocContentContentElement* _tmp47_;
	ValadocContentComment* _tmp48_;
	ValadocContentComment* _tmp49_;
	gint insert_pos = 0;
	ValadocContentComment* _tmp50_;
	ValaList* _tmp51_;
	ValaList* _tmp52_;
	ValadocContentContentElement* _tmp53_;
	gint _tmp54_;
	gint start_pos = 0;
	gint _tmp55_;
	gint _tmp56_;
	ValadocContentRun* _tmp81_;
	ValadocContentRun* _tmp119_;
	ValadocContentComment* _tmp157_;
	ValaList* _tmp158_;
	ValaList* _tmp159_;
	ValadocContentContentElement* _tmp160_;
	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_;
		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, G_TYPE_CHECK_INSTANCE_TYPE (_tmp1_, VALADOC_CONTENT_TYPE_INLINE) ? ((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 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp34_, VALADOC_CONTENT_TYPE_PARAGRAPH) == FALSE) {
		_tmp33_ = TRUE;
	} else {
		ValadocContentContentElement* _tmp35_;
		ValadocContentContentElement* _tmp36_;
		ValadocContentContentElement* _tmp37_;
		_tmp35_ = separator;
		_tmp36_ = valadoc_content_content_element_get_parent (_tmp35_);
		_tmp37_ = _tmp36_;
		_tmp33_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp37_, VALADOC_CONTENT_TYPE_COMMENT) == FALSE;
	}
	if (_tmp33_) {
		ValadocErrorReporter* _tmp38_;
		const gchar* _tmp39_;
		ValadocApiNode* _tmp40_;
		gchar* _tmp41_;
		gchar* _tmp42_;
		gchar* _tmp43_;
		gchar* _tmp44_;
		_tmp38_ = reporter;
		_tmp39_ = file_path;
		_tmp40_ = container;
		_tmp41_ = valadoc_api_node_get_full_name (_tmp40_);
		_tmp42_ = _tmp41_;
		_tmp43_ = g_strdup_printf ("%s: %s: @inheritDoc", _tmp39_, _tmp42_);
		_tmp44_ = _tmp43_;
		valadoc_error_reporter_simple_error (_tmp38_, _tmp44_, "Parent documentation can't be copied to this location.");
		_g_free0 (_tmp44_);
		_g_free0 (_tmp42_);
		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;
	}
	_tmp45_ = separator;
	_tmp46_ = valadoc_content_content_element_get_parent (_tmp45_);
	_tmp47_ = _tmp46_;
	_tmp48_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp47_, VALADOC_CONTENT_TYPE_COMMENT) ? ((ValadocContentComment*) _tmp47_) : NULL);
	comment = _tmp48_;
	_tmp49_ = comment;
	_vala_assert (_tmp49_ != NULL, "comment != null");
	_tmp50_ = comment;
	_tmp51_ = valadoc_content_block_content_get_content ((ValadocContentBlockContent*) _tmp50_);
	_tmp52_ = _tmp51_;
	_tmp53_ = separator;
	_tmp54_ = vala_list_index_of (_tmp52_, (ValadocContentBlock*) G_TYPE_CHECK_INSTANCE_CAST (_tmp53_, VALADOC_CONTENT_TYPE_PARAGRAPH, ValadocContentParagraph));
	insert_pos = _tmp54_;
	_tmp55_ = insert_pos;
	start_pos = _tmp55_;
	_tmp56_ = insert_pos;
	_vala_assert (_tmp56_ >= 0, "insert_pos >= 0");
	{
		ValaList* _block_list = NULL;
		ValadocApiNode* _tmp57_;
		ValadocContentComment* _tmp58_;
		ValadocContentComment* _tmp59_;
		ValaList* _tmp60_;
		ValaList* _tmp61_;
		ValaList* _tmp62_;
		gint _block_size = 0;
		ValaList* _tmp63_;
		gint _tmp64_;
		gint _tmp65_;
		gint _block_index = 0;
		_tmp57_ = self->priv->_inherited;
		_tmp58_ = valadoc_api_node_get_documentation (_tmp57_);
		_tmp59_ = _tmp58_;
		_tmp60_ = valadoc_content_block_content_get_content ((ValadocContentBlockContent*) _tmp59_);
		_tmp61_ = _tmp60_;
		_tmp62_ = _vala_iterable_ref0 (_tmp61_);
		_block_list = _tmp62_;
		_tmp63_ = _block_list;
		_tmp64_ = vala_collection_get_size ((ValaCollection*) _tmp63_);
		_tmp65_ = _tmp64_;
		_block_size = _tmp65_;
		_block_index = -1;
		while (TRUE) {
			gint _tmp66_;
			gint _tmp67_;
			gint _tmp68_;
			ValadocContentBlock* block = NULL;
			ValaList* _tmp69_;
			gint _tmp70_;
			gpointer _tmp71_;
			ValadocContentComment* _tmp72_;
			ValaList* _tmp73_;
			ValaList* _tmp74_;
			gint _tmp75_;
			ValadocContentBlock* _tmp76_;
			ValadocContentComment* _tmp77_;
			ValadocContentContentElement* _tmp78_;
			ValadocContentBlock* _tmp79_;
			gint _tmp80_;
			_tmp66_ = _block_index;
			_block_index = _tmp66_ + 1;
			_tmp67_ = _block_index;
			_tmp68_ = _block_size;
			if (!(_tmp67_ < _tmp68_)) {
				break;
			}
			_tmp69_ = _block_list;
			_tmp70_ = _block_index;
			_tmp71_ = vala_list_get (_tmp69_, _tmp70_);
			block = (ValadocContentBlock*) _tmp71_;
			_tmp72_ = comment;
			_tmp73_ = valadoc_content_block_content_get_content ((ValadocContentBlockContent*) _tmp72_);
			_tmp74_ = _tmp73_;
			_tmp75_ = insert_pos;
			_tmp76_ = block;
			_tmp77_ = comment;
			_tmp78_ = valadoc_content_content_element_copy ((ValadocContentContentElement*) _tmp76_, (ValadocContentContentElement*) _tmp77_);
			_tmp79_ = G_TYPE_CHECK_INSTANCE_CAST (_tmp78_, VALADOC_CONTENT_TYPE_BLOCK, ValadocContentBlock);
			vala_list_insert (_tmp74_, _tmp75_, _tmp79_);
			_g_object_unref0 (_tmp79_);
			_tmp80_ = insert_pos;
			insert_pos = _tmp80_ + 1;
			_g_object_unref0 (block);
		}
		_vala_iterable_unref0 (_block_list);
	}
	_tmp81_ = right_run;
	if (_tmp81_ != NULL) {
		ValadocContentComment* _tmp82_;
		ValaList* _tmp83_;
		ValaList* _tmp84_;
		gint _tmp85_;
		gpointer _tmp86_;
		ValadocContentBlock* _tmp87_;
		gboolean _tmp88_;
		_tmp82_ = comment;
		_tmp83_ = valadoc_content_block_content_get_content ((ValadocContentBlockContent*) _tmp82_);
		_tmp84_ = _tmp83_;
		_tmp85_ = insert_pos;
		_tmp86_ = vala_list_get (_tmp84_, _tmp85_ - 1);
		_tmp87_ = (ValadocContentBlock*) _tmp86_;
		_tmp88_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp87_, VALADOC_CONTENT_TYPE_PARAGRAPH);
		_g_object_unref0 (_tmp87_);
		if (_tmp88_) {
			ValadocContentComment* _tmp89_;
			ValaList* _tmp90_;
			ValaList* _tmp91_;
			gint _tmp92_;
			gpointer _tmp93_;
			ValadocContentParagraph* _tmp94_;
			ValaList* _tmp95_;
			ValaList* _tmp96_;
			ValadocContentRun* _tmp97_;
			ValadocContentRun* _tmp98_;
			ValadocContentComment* _tmp99_;
			ValaList* _tmp100_;
			ValaList* _tmp101_;
			gint _tmp102_;
			gpointer _tmp103_;
			ValadocContentBlock* _tmp104_;
			_tmp89_ = comment;
			_tmp90_ = valadoc_content_block_content_get_content ((ValadocContentBlockContent*) _tmp89_);
			_tmp91_ = _tmp90_;
			_tmp92_ = insert_pos;
			_tmp93_ = vala_list_get (_tmp91_, _tmp92_ - 1);
			_tmp94_ = G_TYPE_CHECK_INSTANCE_CAST ((ValadocContentBlock*) _tmp93_, VALADOC_CONTENT_TYPE_PARAGRAPH, ValadocContentParagraph);
			_tmp95_ = valadoc_content_inline_content_get_content ((ValadocContentInlineContent*) _tmp94_);
			_tmp96_ = _tmp95_;
			_tmp97_ = right_run;
			vala_collection_add ((ValaCollection*) _tmp96_, (ValadocContentInline*) _tmp97_);
			_g_object_unref0 (_tmp94_);
			_tmp98_ = right_run;
			_tmp99_ = comment;
			_tmp100_ = valadoc_content_block_content_get_content ((ValadocContentBlockContent*) _tmp99_);
			_tmp101_ = _tmp100_;
			_tmp102_ = insert_pos;
			_tmp103_ = vala_list_get (_tmp101_, _tmp102_ - 1);
			_tmp104_ = (ValadocContentBlock*) _tmp103_;
			valadoc_content_content_element_set_parent ((ValadocContentContentElement*) _tmp98_, (ValadocContentContentElement*) _tmp104_);
			_g_object_unref0 (_tmp104_);
		} else {
			ValadocContentParagraph* p = NULL;
			ValadocContentParagraph* _tmp105_;
			ValadocContentParagraph* _tmp106_;
			ValaList* _tmp107_;
			ValaList* _tmp108_;
			ValadocContentRun* _tmp109_;
			ValadocContentRun* _tmp110_;
			ValadocContentParagraph* _tmp111_;
			ValadocContentParagraph* _tmp112_;
			ValadocContentComment* _tmp113_;
			ValadocContentComment* _tmp114_;
			ValaList* _tmp115_;
			ValaList* _tmp116_;
			gint _tmp117_;
			ValadocContentParagraph* _tmp118_;
			_tmp105_ = valadoc_content_paragraph_new ();
			p = _tmp105_;
			_tmp106_ = p;
			_tmp107_ = valadoc_content_inline_content_get_content ((ValadocContentInlineContent*) _tmp106_);
			_tmp108_ = _tmp107_;
			_tmp109_ = right_run;
			vala_collection_add ((ValaCollection*) _tmp108_, (ValadocContentInline*) _tmp109_);
			_tmp110_ = right_run;
			_tmp111_ = p;
			valadoc_content_content_element_set_parent ((ValadocContentContentElement*) _tmp110_, (ValadocContentContentElement*) _tmp111_);
			_tmp112_ = p;
			_tmp113_ = comment;
			valadoc_content_content_element_set_parent ((ValadocContentContentElement*) _tmp112_, (ValadocContentContentElement*) _tmp113_);
			_tmp114_ = comment;
			_tmp115_ = valadoc_content_block_content_get_content ((ValadocContentBlockContent*) _tmp114_);
			_tmp116_ = _tmp115_;
			_tmp117_ = insert_pos;
			_tmp118_ = p;
			vala_list_insert (_tmp116_, _tmp117_, (ValadocContentBlock*) _tmp118_);
			_g_object_unref0 (p);
		}
	}
	_tmp119_ = left_run;
	if (_tmp119_ != NULL) {
		ValadocContentComment* _tmp120_;
		ValaList* _tmp121_;
		ValaList* _tmp122_;
		gint _tmp123_;
		gpointer _tmp124_;
		ValadocContentBlock* _tmp125_;
		gboolean _tmp126_;
		_tmp120_ = comment;
		_tmp121_ = valadoc_content_block_content_get_content ((ValadocContentBlockContent*) _tmp120_);
		_tmp122_ = _tmp121_;
		_tmp123_ = start_pos;
		_tmp124_ = vala_list_get (_tmp122_, _tmp123_);
		_tmp125_ = (ValadocContentBlock*) _tmp124_;
		_tmp126_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp125_, VALADOC_CONTENT_TYPE_PARAGRAPH);
		_g_object_unref0 (_tmp125_);
		if (_tmp126_) {
			ValadocContentComment* _tmp127_;
			ValaList* _tmp128_;
			ValaList* _tmp129_;
			gint _tmp130_;
			gpointer _tmp131_;
			ValadocContentParagraph* _tmp132_;
			ValaList* _tmp133_;
			ValaList* _tmp134_;
			ValadocContentRun* _tmp135_;
			ValadocContentRun* _tmp136_;
			ValadocContentComment* _tmp137_;
			ValaList* _tmp138_;
			ValaList* _tmp139_;
			gint _tmp140_;
			gpointer _tmp141_;
			ValadocContentBlock* _tmp142_;
			_tmp127_ = comment;
			_tmp128_ = valadoc_content_block_content_get_content ((ValadocContentBlockContent*) _tmp127_);
			_tmp129_ = _tmp128_;
			_tmp130_ = start_pos;
			_tmp131_ = vala_list_get (_tmp129_, _tmp130_);
			_tmp132_ = G_TYPE_CHECK_INSTANCE_CAST ((ValadocContentBlock*) _tmp131_, VALADOC_CONTENT_TYPE_PARAGRAPH, ValadocContentParagraph);
			_tmp133_ = valadoc_content_inline_content_get_content ((ValadocContentInlineContent*) _tmp132_);
			_tmp134_ = _tmp133_;
			_tmp135_ = left_run;
			vala_list_insert (_tmp134_, 0, (ValadocContentInline*) _tmp135_);
			_g_object_unref0 (_tmp132_);
			_tmp136_ = left_run;
			_tmp137_ = comment;
			_tmp138_ = valadoc_content_block_content_get_content ((ValadocContentBlockContent*) _tmp137_);
			_tmp139_ = _tmp138_;
			_tmp140_ = start_pos;
			_tmp141_ = vala_list_get (_tmp139_, _tmp140_);
			_tmp142_ = (ValadocContentBlock*) _tmp141_;
			valadoc_content_content_element_set_parent ((ValadocContentContentElement*) _tmp136_, (ValadocContentContentElement*) _tmp142_);
			_g_object_unref0 (_tmp142_);
		} else {
			ValadocContentParagraph* p = NULL;
			ValadocContentParagraph* _tmp143_;
			ValadocContentParagraph* _tmp144_;
			ValaList* _tmp145_;
			ValaList* _tmp146_;
			ValadocContentRun* _tmp147_;
			ValadocContentRun* _tmp148_;
			ValadocContentParagraph* _tmp149_;
			ValadocContentParagraph* _tmp150_;
			ValadocContentComment* _tmp151_;
			ValadocContentComment* _tmp152_;
			ValaList* _tmp153_;
			ValaList* _tmp154_;
			gint _tmp155_;
			ValadocContentParagraph* _tmp156_;
			_tmp143_ = valadoc_content_paragraph_new ();
			p = _tmp143_;
			_tmp144_ = p;
			_tmp145_ = valadoc_content_inline_content_get_content ((ValadocContentInlineContent*) _tmp144_);
			_tmp146_ = _tmp145_;
			_tmp147_ = left_run;
			vala_collection_add ((ValaCollection*) _tmp146_, (ValadocContentInline*) _tmp147_);
			_tmp148_ = left_run;
			_tmp149_ = p;
			valadoc_content_content_element_set_parent ((ValadocContentContentElement*) _tmp148_, (ValadocContentContentElement*) _tmp149_);
			_tmp150_ = p;
			_tmp151_ = comment;
			valadoc_content_content_element_set_parent ((ValadocContentContentElement*) _tmp150_, (ValadocContentContentElement*) _tmp151_);
			_tmp152_ = comment;
			_tmp153_ = valadoc_content_block_content_get_content ((ValadocContentBlockContent*) _tmp152_);
			_tmp154_ = _tmp153_;
			_tmp155_ = start_pos;
			_tmp156_ = p;
			vala_list_insert (_tmp154_, _tmp155_, (ValadocContentBlock*) _tmp156_);
			_g_object_unref0 (p);
		}
	}
	_tmp157_ = comment;
	_tmp158_ = valadoc_content_block_content_get_content ((ValadocContentBlockContent*) _tmp157_);
	_tmp159_ = _tmp158_;
	_tmp160_ = separator;
	vala_collection_remove ((ValaCollection*) _tmp159_, (ValadocContentBlock*) G_TYPE_CHECK_INSTANCE_CAST (_tmp160_, 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* result = NULL;
	ValadocContentRun* run = NULL;
	ValadocContentRun* _tmp0_;
	ValadocContentRun* _tmp1_;
	ValaList* _tmp2_;
	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);
	_tmp2_ = content;
	if (_tmp2_ != NULL) {
		{
			ValaList* _item_list = NULL;
			ValaList* _tmp3_;
			ValaList* _tmp4_;
			gint _item_size = 0;
			ValaList* _tmp5_;
			gint _tmp6_;
			gint _tmp7_;
			gint _item_index = 0;
			_tmp3_ = content;
			_tmp4_ = _vala_iterable_ref0 (_tmp3_);
			_item_list = _tmp4_;
			_tmp5_ = _item_list;
			_tmp6_ = vala_collection_get_size ((ValaCollection*) _tmp5_);
			_tmp7_ = _tmp6_;
			_item_size = _tmp7_;
			_item_index = -1;
			while (TRUE) {
				gint _tmp8_;
				gint _tmp9_;
				gint _tmp10_;
				ValadocContentContentElement* item = NULL;
				ValaList* _tmp11_;
				gint _tmp12_;
				gpointer _tmp13_;
				ValadocContentRun* _tmp14_;
				ValaList* _tmp15_;
				ValaList* _tmp16_;
				ValadocContentContentElement* _tmp17_;
				ValadocContentContentElement* _tmp18_;
				ValadocContentInline* _tmp19_;
				ValadocContentInline* _tmp20_;
				_tmp8_ = _item_index;
				_item_index = _tmp8_ + 1;
				_tmp9_ = _item_index;
				_tmp10_ = _item_size;
				if (!(_tmp9_ < _tmp10_)) {
					break;
				}
				_tmp11_ = _item_list;
				_tmp12_ = _item_index;
				_tmp13_ = vala_list_get (_tmp11_, _tmp12_);
				item = (ValadocContentContentElement*) _tmp13_;
				_tmp14_ = run;
				_tmp15_ = valadoc_content_inline_content_get_content ((ValadocContentInlineContent*) _tmp14_);
				_tmp16_ = _tmp15_;
				_tmp17_ = item;
				_tmp18_ = valadoc_content_content_element_copy (_tmp17_, (ValadocContentContentElement*) self);
				_tmp19_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp18_, VALADOC_CONTENT_TYPE_INLINE) ? ((ValadocContentInline*) _tmp18_) : NULL;
				if (_tmp19_ == NULL) {
					_g_object_unref0 (_tmp18_);
				}
				_tmp20_ = _tmp19_;
				vala_collection_add ((ValaCollection*) _tmp16_, _tmp20_);
				_g_object_unref0 (_tmp20_);
				_g_object_unref0 (item);
			}
			_vala_iterable_unref0 (_item_list);
		}
	}
	result = run;
	return result;
}


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


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


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


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 void valadoc_taglets_inherit_doc_set_inherited (ValadocTagletsInheritDoc* self, ValadocApiNode* value) {
	g_return_if_fail (self != NULL);
	if (valadoc_taglets_inherit_doc_get_inherited (self) != value) {
		ValadocApiNode* _tmp0_;
		ValadocApiNode* _tmp1_;
		_tmp0_ = value;
		_tmp1_ = _g_object_ref0 (_tmp0_);
		_g_object_unref0 (self->priv->_inherited);
		self->priv->_inherited = _tmp1_;
		g_object_notify_by_pspec ((GObject *) self, valadoc_taglets_inherit_doc_properties[VALADOC_TAGLETS_INHERIT_DOC_INHERITED_PROPERTY]);
	}
}


static void valadoc_taglets_inherit_doc_class_init (ValadocTagletsInheritDocClass * klass) {
	valadoc_taglets_inherit_doc_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (ValadocTagletsInheritDocPrivate));
	((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_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
}


static void valadoc_taglets_inherit_doc_instance_init (ValadocTagletsInheritDoc * self) {
	self->priv = VALADOC_TAGLETS_INHERIT_DOC_GET_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);
}


GType valadoc_taglets_inherit_doc_get_type (void) {
	static volatile gsize valadoc_taglets_inherit_doc_type_id__volatile = 0;
	if (g_once_init_enter (&valadoc_taglets_inherit_doc_type_id__volatile)) {
		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);
		g_once_init_leave (&valadoc_taglets_inherit_doc_type_id__volatile, valadoc_taglets_inherit_doc_type_id);
	}
	return valadoc_taglets_inherit_doc_type_id__volatile;
}


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, gint array_length, GDestroyNotify destroy_func) {
	if ((array != NULL) && (destroy_func != NULL)) {
		int 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, gint array_length, GDestroyNotify destroy_func) {
	_vala_array_destroy (array, array_length, destroy_func);
	g_free (array);
}



