示例#1
0
static gboolean vala_ccode_compiler_package_exists (const gchar* package_name) {
	gboolean result = FALSE;
	const gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* pc;
	gint exit_status = 0;
	GError * _inner_error_ = NULL;
	g_return_val_if_fail (package_name != NULL, FALSE);
	_tmp0_ = package_name;
	_tmp1_ = g_strconcat ("pkg-config --exists ", _tmp0_, NULL);
	pc = _tmp1_;
	{
		gint _tmp2_ = 0;
		g_spawn_command_line_sync (pc, NULL, NULL, &_tmp2_, &_inner_error_);
		exit_status = _tmp2_;
		if (_inner_error_ != NULL) {
			if (_inner_error_->domain == G_SPAWN_ERROR) {
				goto __catch1_g_spawn_error;
			}
			_g_free0 (pc);
			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
			g_clear_error (&_inner_error_);
			return FALSE;
		}
		result = 0 == exit_status;
		_g_free0 (pc);
		return result;
	}
	goto __finally1;
	__catch1_g_spawn_error:
	{
		GError* e = NULL;
		GError* _tmp3_;
		const gchar* _tmp4_;
		e = _inner_error_;
		_inner_error_ = NULL;
		_tmp3_ = e;
		_tmp4_ = _tmp3_->message;
		vala_report_error (NULL, _tmp4_);
		result = FALSE;
		_g_error_free0 (e);
		_g_free0 (pc);
		return result;
	}
	__finally1:
	_g_free0 (pc);
	g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
	g_clear_error (&_inner_error_);
	return FALSE;
}
static gboolean vala_addressof_expression_real_check (ValaCodeNode* base, ValaCodeContext* context) {
	ValaAddressofExpression * self;
	gboolean result = FALSE;
	gboolean _tmp0_;
	gboolean _tmp1_;
	ValaExpression* _tmp4_;
	ValaExpression* _tmp5_;
	ValaExpression* _tmp6_;
	ValaExpression* _tmp7_;
	ValaCodeContext* _tmp8_;
	gboolean _tmp9_ = FALSE;
	ValaExpression* _tmp10_;
	ValaExpression* _tmp11_;
	ValaElementAccess* _tmp12_;
	ValaElementAccess* ea;
	gboolean _tmp13_ = FALSE;
	ValaExpression* _tmp14_;
	ValaExpression* _tmp15_;
	gboolean _tmp20_;
	ValaExpression* _tmp38_;
	ValaExpression* _tmp39_;
	ValaDataType* _tmp40_;
	ValaDataType* _tmp41_;
	gboolean _tmp42_ = FALSE;
	gboolean _tmp57_;
	gboolean _tmp58_;
	self = (ValaAddressofExpression*) base;
	g_return_val_if_fail (context != NULL, FALSE);
	_tmp0_ = vala_code_node_get_checked ((ValaCodeNode*) self);
	_tmp1_ = _tmp0_;
	if (_tmp1_) {
		gboolean _tmp2_;
		gboolean _tmp3_;
		_tmp2_ = vala_code_node_get_error ((ValaCodeNode*) self);
		_tmp3_ = _tmp2_;
		result = !_tmp3_;
		return result;
	}
	vala_code_node_set_checked ((ValaCodeNode*) self, TRUE);
	_tmp4_ = vala_addressof_expression_get_inner (self);
	_tmp5_ = _tmp4_;
	vala_expression_set_lvalue (_tmp5_, TRUE);
	_tmp6_ = vala_addressof_expression_get_inner (self);
	_tmp7_ = _tmp6_;
	_tmp8_ = context;
	_tmp9_ = vala_code_node_check ((ValaCodeNode*) _tmp7_, _tmp8_);
	if (!_tmp9_) {
		vala_code_node_set_error ((ValaCodeNode*) self, TRUE);
		result = FALSE;
		return result;
	}
	_tmp10_ = vala_addressof_expression_get_inner (self);
	_tmp11_ = _tmp10_;
	_tmp12_ = _vala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp11_, VALA_TYPE_ELEMENT_ACCESS) ? ((ValaElementAccess*) _tmp11_) : NULL);
	ea = _tmp12_;
	_tmp14_ = vala_addressof_expression_get_inner (self);
	_tmp15_ = _tmp14_;
	if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp15_, VALA_TYPE_MEMBER_ACCESS)) {
		ValaExpression* _tmp16_;
		ValaExpression* _tmp17_;
		ValaSymbol* _tmp18_;
		ValaSymbol* _tmp19_;
		_tmp16_ = vala_addressof_expression_get_inner (self);
		_tmp17_ = _tmp16_;
		_tmp18_ = vala_expression_get_symbol_reference (_tmp17_);
		_tmp19_ = _tmp18_;
		_tmp13_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp19_, VALA_TYPE_VARIABLE);
	} else {
		_tmp13_ = FALSE;
	}
	_tmp20_ = _tmp13_;
	if (_tmp20_) {
	} else {
		gboolean _tmp21_ = FALSE;
		ValaElementAccess* _tmp22_;
		gboolean _tmp35_;
		_tmp22_ = ea;
		if (_tmp22_ != NULL) {
			gboolean _tmp23_ = FALSE;
			ValaElementAccess* _tmp24_;
			ValaExpression* _tmp25_;
			ValaExpression* _tmp26_;
			ValaDataType* _tmp27_;
			ValaDataType* _tmp28_;
			gboolean _tmp34_;
			_tmp24_ = ea;
			_tmp25_ = vala_element_access_get_container (_tmp24_);
			_tmp26_ = _tmp25_;
			_tmp27_ = vala_expression_get_value_type (_tmp26_);
			_tmp28_ = _tmp27_;
			if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp28_, VALA_TYPE_ARRAY_TYPE)) {
				_tmp23_ = TRUE;
			} else {
				ValaElementAccess* _tmp29_;
				ValaExpression* _tmp30_;
				ValaExpression* _tmp31_;
				ValaDataType* _tmp32_;
				ValaDataType* _tmp33_;
				_tmp29_ = ea;
				_tmp30_ = vala_element_access_get_container (_tmp29_);
				_tmp31_ = _tmp30_;
				_tmp32_ = vala_expression_get_value_type (_tmp31_);
				_tmp33_ = _tmp32_;
				_tmp23_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp33_, VALA_TYPE_POINTER_TYPE);
			}
			_tmp34_ = _tmp23_;
			_tmp21_ = _tmp34_;
		} else {
			_tmp21_ = FALSE;
		}
		_tmp35_ = _tmp21_;
		if (_tmp35_) {
		} else {
			ValaSourceReference* _tmp36_;
			ValaSourceReference* _tmp37_;
			vala_code_node_set_error ((ValaCodeNode*) self, TRUE);
			_tmp36_ = vala_code_node_get_source_reference ((ValaCodeNode*) self);
			_tmp37_ = _tmp36_;
			vala_report_error (_tmp37_, "Address-of operator not supported for this expression");
			result = FALSE;
			_vala_code_node_unref0 (ea);
			return result;
		}
	}
	_tmp38_ = vala_addressof_expression_get_inner (self);
	_tmp39_ = _tmp38_;
	_tmp40_ = vala_expression_get_value_type (_tmp39_);
	_tmp41_ = _tmp40_;
	_tmp42_ = vala_data_type_is_reference_type_or_type_parameter (_tmp41_);
	if (_tmp42_) {
		ValaExpression* _tmp43_;
		ValaExpression* _tmp44_;
		ValaDataType* _tmp45_;
		ValaDataType* _tmp46_;
		ValaPointerType* _tmp47_;
		ValaPointerType* _tmp48_;
		ValaPointerType* _tmp49_;
		ValaPointerType* _tmp50_;
		_tmp43_ = vala_addressof_expression_get_inner (self);
		_tmp44_ = _tmp43_;
		_tmp45_ = vala_expression_get_value_type (_tmp44_);
		_tmp46_ = _tmp45_;
		_tmp47_ = vala_pointer_type_new (_tmp46_, NULL);
		_tmp48_ = _tmp47_;
		_tmp49_ = vala_pointer_type_new ((ValaDataType*) _tmp48_, NULL);
		_tmp50_ = _tmp49_;
		vala_expression_set_value_type ((ValaExpression*) self, (ValaDataType*) _tmp50_);
		_vala_code_node_unref0 (_tmp50_);
		_vala_code_node_unref0 (_tmp48_);
	} else {
		ValaExpression* _tmp51_;
		ValaExpression* _tmp52_;
		ValaDataType* _tmp53_;
		ValaDataType* _tmp54_;
		ValaPointerType* _tmp55_;
		ValaPointerType* _tmp56_;
		_tmp51_ = vala_addressof_expression_get_inner (self);
		_tmp52_ = _tmp51_;
		_tmp53_ = vala_expression_get_value_type (_tmp52_);
		_tmp54_ = _tmp53_;
		_tmp55_ = vala_pointer_type_new (_tmp54_, NULL);
		_tmp56_ = _tmp55_;
		vala_expression_set_value_type ((ValaExpression*) self, (ValaDataType*) _tmp56_);
		_vala_code_node_unref0 (_tmp56_);
	}
	_tmp57_ = vala_code_node_get_error ((ValaCodeNode*) self);
	_tmp58_ = _tmp57_;
	result = !_tmp58_;
	_vala_code_node_unref0 (ea);
	return result;
}
示例#3
0
static gboolean vala_slice_expression_real_check (ValaCodeNode* base, ValaCodeContext* context) {
	ValaSliceExpression * self;
	gboolean result = FALSE;
	gboolean _tmp0_;
	gboolean _tmp1_;
	ValaExpression* _tmp4_;
	ValaExpression* _tmp5_;
	ValaCodeContext* _tmp6_;
	gboolean _tmp7_ = FALSE;
	ValaExpression* _tmp8_;
	ValaExpression* _tmp9_;
	ValaCodeContext* _tmp10_;
	gboolean _tmp11_ = FALSE;
	ValaExpression* _tmp12_;
	ValaExpression* _tmp13_;
	ValaCodeContext* _tmp14_;
	gboolean _tmp15_ = FALSE;
	ValaExpression* _tmp16_;
	ValaExpression* _tmp17_;
	ValaDataType* _tmp18_;
	ValaDataType* _tmp19_;
	gboolean _tmp24_;
	gboolean _tmp25_;
	ValaExpression* _tmp30_;
	ValaExpression* _tmp31_;
	ValaDataType* _tmp32_;
	ValaDataType* _tmp33_;
	gboolean _tmp107_;
	gboolean _tmp108_;
	self = (ValaSliceExpression*) base;
	g_return_val_if_fail (context != NULL, FALSE);
	_tmp0_ = vala_code_node_get_checked ((ValaCodeNode*) self);
	_tmp1_ = _tmp0_;
	if (_tmp1_) {
		gboolean _tmp2_;
		gboolean _tmp3_;
		_tmp2_ = vala_code_node_get_error ((ValaCodeNode*) self);
		_tmp3_ = _tmp2_;
		result = !_tmp3_;
		return result;
	}
	vala_code_node_set_checked ((ValaCodeNode*) self, TRUE);
	_tmp4_ = vala_slice_expression_get_container (self);
	_tmp5_ = _tmp4_;
	_tmp6_ = context;
	_tmp7_ = vala_code_node_check ((ValaCodeNode*) _tmp5_, _tmp6_);
	if (!_tmp7_) {
		vala_code_node_set_error ((ValaCodeNode*) self, TRUE);
		result = FALSE;
		return result;
	}
	_tmp8_ = vala_slice_expression_get_start (self);
	_tmp9_ = _tmp8_;
	_tmp10_ = context;
	_tmp11_ = vala_code_node_check ((ValaCodeNode*) _tmp9_, _tmp10_);
	if (!_tmp11_) {
		vala_code_node_set_error ((ValaCodeNode*) self, TRUE);
		result = FALSE;
		return result;
	}
	_tmp12_ = vala_slice_expression_get_stop (self);
	_tmp13_ = _tmp12_;
	_tmp14_ = context;
	_tmp15_ = vala_code_node_check ((ValaCodeNode*) _tmp13_, _tmp14_);
	if (!_tmp15_) {
		vala_code_node_set_error ((ValaCodeNode*) self, TRUE);
		result = FALSE;
		return result;
	}
	_tmp16_ = vala_slice_expression_get_container (self);
	_tmp17_ = _tmp16_;
	_tmp18_ = vala_expression_get_value_type (_tmp17_);
	_tmp19_ = _tmp18_;
	if (_tmp19_ == NULL) {
		ValaExpression* _tmp20_;
		ValaExpression* _tmp21_;
		ValaSourceReference* _tmp22_;
		ValaSourceReference* _tmp23_;
		vala_code_node_set_error ((ValaCodeNode*) self, TRUE);
		_tmp20_ = vala_slice_expression_get_container (self);
		_tmp21_ = _tmp20_;
		_tmp22_ = vala_code_node_get_source_reference ((ValaCodeNode*) _tmp21_);
		_tmp23_ = _tmp22_;
		vala_report_error (_tmp23_, "Invalid container expression");
		result = FALSE;
		return result;
	}
	_tmp24_ = vala_expression_get_lvalue ((ValaExpression*) self);
	_tmp25_ = _tmp24_;
	if (_tmp25_) {
		ValaExpression* _tmp26_;
		ValaExpression* _tmp27_;
		ValaSourceReference* _tmp28_;
		ValaSourceReference* _tmp29_;
		vala_code_node_set_error ((ValaCodeNode*) self, TRUE);
		_tmp26_ = vala_slice_expression_get_container (self);
		_tmp27_ = _tmp26_;
		_tmp28_ = vala_code_node_get_source_reference ((ValaCodeNode*) _tmp27_);
		_tmp29_ = _tmp28_;
		vala_report_error (_tmp29_, "Slice expressions cannot be used as lvalue");
		result = FALSE;
		return result;
	}
	_tmp30_ = vala_slice_expression_get_container (self);
	_tmp31_ = _tmp30_;
	_tmp32_ = vala_expression_get_value_type (_tmp31_);
	_tmp33_ = _tmp32_;
	if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp33_, VALA_TYPE_ARRAY_TYPE)) {
		ValaExpression* _tmp34_;
		ValaExpression* _tmp35_;
		ValaDataType* _tmp36_;
		ValaDataType* _tmp37_;
		ValaDataType* _tmp38_ = NULL;
		ValaDataType* _tmp39_;
		ValaDataType* _tmp40_;
		ValaDataType* _tmp41_;
		gboolean _tmp42_ = FALSE;
		ValaExpression* _tmp43_;
		ValaExpression* _tmp44_;
		ValaDataType* _tmp45_;
		ValaDataType* _tmp46_;
		gboolean _tmp51_;
		gboolean _tmp56_ = FALSE;
		ValaExpression* _tmp57_;
		ValaExpression* _tmp58_;
		ValaDataType* _tmp59_;
		ValaDataType* _tmp60_;
		gboolean _tmp65_;
		_tmp34_ = vala_slice_expression_get_container (self);
		_tmp35_ = _tmp34_;
		_tmp36_ = vala_expression_get_value_type (_tmp35_);
		_tmp37_ = _tmp36_;
		_tmp38_ = vala_data_type_copy (_tmp37_);
		_tmp39_ = _tmp38_;
		vala_expression_set_value_type ((ValaExpression*) self, _tmp39_);
		_vala_code_node_unref0 (_tmp39_);
		_tmp40_ = vala_expression_get_value_type ((ValaExpression*) self);
		_tmp41_ = _tmp40_;
		vala_data_type_set_value_owned (_tmp41_, FALSE);
		_tmp43_ = vala_slice_expression_get_start (self);
		_tmp44_ = _tmp43_;
		_tmp45_ = vala_expression_get_value_type (_tmp44_);
		_tmp46_ = _tmp45_;
		if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp46_, VALA_TYPE_INTEGER_TYPE)) {
			_tmp42_ = TRUE;
		} else {
			ValaExpression* _tmp47_;
			ValaExpression* _tmp48_;
			ValaDataType* _tmp49_;
			ValaDataType* _tmp50_;
			_tmp47_ = vala_slice_expression_get_start (self);
			_tmp48_ = _tmp47_;
			_tmp49_ = vala_expression_get_value_type (_tmp48_);
			_tmp50_ = _tmp49_;
			_tmp42_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp50_, VALA_TYPE_ENUM_VALUE_TYPE);
		}
		_tmp51_ = _tmp42_;
		if (!_tmp51_) {
			ValaExpression* _tmp52_;
			ValaExpression* _tmp53_;
			ValaSourceReference* _tmp54_;
			ValaSourceReference* _tmp55_;
			vala_code_node_set_error ((ValaCodeNode*) self, TRUE);
			_tmp52_ = vala_slice_expression_get_start (self);
			_tmp53_ = _tmp52_;
			_tmp54_ = vala_code_node_get_source_reference ((ValaCodeNode*) _tmp53_);
			_tmp55_ = _tmp54_;
			vala_report_error (_tmp55_, "Expression of integer type expected");
		}
		_tmp57_ = vala_slice_expression_get_stop (self);
		_tmp58_ = _tmp57_;
		_tmp59_ = vala_expression_get_value_type (_tmp58_);
		_tmp60_ = _tmp59_;
		if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp60_, VALA_TYPE_INTEGER_TYPE)) {
			_tmp56_ = TRUE;
		} else {
			ValaExpression* _tmp61_;
			ValaExpression* _tmp62_;
			ValaDataType* _tmp63_;
			ValaDataType* _tmp64_;
			_tmp61_ = vala_slice_expression_get_stop (self);
			_tmp62_ = _tmp61_;
			_tmp63_ = vala_expression_get_value_type (_tmp62_);
			_tmp64_ = _tmp63_;
			_tmp56_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp64_, VALA_TYPE_ENUM_VALUE_TYPE);
		}
		_tmp65_ = _tmp56_;
		if (!_tmp65_) {
			ValaExpression* _tmp66_;
			ValaExpression* _tmp67_;
			ValaSourceReference* _tmp68_;
			ValaSourceReference* _tmp69_;
			vala_code_node_set_error ((ValaCodeNode*) self, TRUE);
			_tmp66_ = vala_slice_expression_get_stop (self);
			_tmp67_ = _tmp66_;
			_tmp68_ = vala_code_node_get_source_reference ((ValaCodeNode*) _tmp67_);
			_tmp69_ = _tmp68_;
			vala_report_error (_tmp69_, "Expression of integer type expected");
		}
	} else {
		ValaExpression* _tmp70_;
		ValaExpression* _tmp71_;
		ValaDataType* _tmp72_;
		ValaDataType* _tmp73_;
		ValaSymbol* _tmp74_ = NULL;
		ValaMethod* slice_method;
		ValaMethod* _tmp75_;
		ValaSourceReference* _tmp97_;
		ValaSourceReference* _tmp98_;
		ValaExpression* _tmp99_;
		ValaExpression* _tmp100_;
		ValaDataType* _tmp101_;
		ValaDataType* _tmp102_;
		gchar* _tmp103_ = NULL;
		gchar* _tmp104_;
		gchar* _tmp105_ = NULL;
		gchar* _tmp106_;
		_tmp70_ = vala_slice_expression_get_container (self);
		_tmp71_ = _tmp70_;
		_tmp72_ = vala_expression_get_value_type (_tmp71_);
		_tmp73_ = _tmp72_;
		_tmp74_ = vala_data_type_get_member (_tmp73_, "slice");
		slice_method = G_TYPE_CHECK_INSTANCE_TYPE (_tmp74_, VALA_TYPE_METHOD) ? ((ValaMethod*) _tmp74_) : NULL;
		_tmp75_ = slice_method;
		if (_tmp75_ != NULL) {
			ValaExpression* _tmp76_;
			ValaExpression* _tmp77_;
			ValaMemberAccess* _tmp78_;
			ValaMemberAccess* _tmp79_;
			ValaMethodCall* _tmp80_;
			ValaMethodCall* _tmp81_;
			ValaMethodCall* slice_call;
			ValaMethodCall* _tmp82_;
			ValaExpression* _tmp83_;
			ValaExpression* _tmp84_;
			ValaMethodCall* _tmp85_;
			ValaExpression* _tmp86_;
			ValaExpression* _tmp87_;
			ValaMethodCall* _tmp88_;
			ValaDataType* _tmp89_;
			ValaDataType* _tmp90_;
			ValaCodeNode* _tmp91_;
			ValaCodeNode* _tmp92_;
			ValaMethodCall* _tmp93_;
			ValaMethodCall* _tmp94_;
			ValaCodeContext* _tmp95_;
			gboolean _tmp96_ = FALSE;
			_tmp76_ = vala_slice_expression_get_container (self);
			_tmp77_ = _tmp76_;
			_tmp78_ = vala_member_access_new (_tmp77_, "slice", NULL);
			_tmp79_ = _tmp78_;
			_tmp80_ = vala_method_call_new ((ValaExpression*) _tmp79_, NULL);
			_tmp81_ = _tmp80_;
			_vala_code_node_unref0 (_tmp79_);
			slice_call = _tmp81_;
			_tmp82_ = slice_call;
			_tmp83_ = vala_slice_expression_get_start (self);
			_tmp84_ = _tmp83_;
			vala_method_call_add_argument (_tmp82_, _tmp84_);
			_tmp85_ = slice_call;
			_tmp86_ = vala_slice_expression_get_stop (self);
			_tmp87_ = _tmp86_;
			vala_method_call_add_argument (_tmp85_, _tmp87_);
			_tmp88_ = slice_call;
			_tmp89_ = vala_expression_get_target_type ((ValaExpression*) self);
			_tmp90_ = _tmp89_;
			vala_expression_set_target_type ((ValaExpression*) _tmp88_, _tmp90_);
			_tmp91_ = vala_code_node_get_parent_node ((ValaCodeNode*) self);
			_tmp92_ = _tmp91_;
			_tmp93_ = slice_call;
			vala_code_node_replace_expression (_tmp92_, (ValaExpression*) self, (ValaExpression*) _tmp93_);
			_tmp94_ = slice_call;
			_tmp95_ = context;
			_tmp96_ = vala_code_node_check ((ValaCodeNode*) _tmp94_, _tmp95_);
			result = _tmp96_;
			_vala_code_node_unref0 (slice_call);
			_vala_code_node_unref0 (slice_method);
			return result;
		}
		vala_code_node_set_error ((ValaCodeNode*) self, TRUE);
		_tmp97_ = vala_code_node_get_source_reference ((ValaCodeNode*) self);
		_tmp98_ = _tmp97_;
		_tmp99_ = vala_slice_expression_get_container (self);
		_tmp100_ = _tmp99_;
		_tmp101_ = vala_expression_get_value_type (_tmp100_);
		_tmp102_ = _tmp101_;
		_tmp103_ = vala_code_node_to_string ((ValaCodeNode*) _tmp102_);
		_tmp104_ = _tmp103_;
		_tmp105_ = g_strdup_printf ("The expression `%s' does not denote an array", _tmp104_);
		_tmp106_ = _tmp105_;
		vala_report_error (_tmp98_, _tmp106_);
		_g_free0 (_tmp106_);
		_g_free0 (_tmp104_);
		_vala_code_node_unref0 (slice_method);
	}
	_tmp107_ = vala_code_node_get_error ((ValaCodeNode*) self);
	_tmp108_ = _tmp107_;
	result = !_tmp108_;
	return result;
}
示例#4
0
static gchar* vala_markup_reader_text (ValaMarkupReader* self, gchar end_char, gboolean rm_trailing_whitespace) {
	gchar* result = NULL;
	GString* _tmp0_;
	GString* content;
	gchar* _tmp1_;
	gchar* text_begin;
	gchar* _tmp2_;
	gchar* last_linebreak;
	gchar* _tmp84_;
	gchar* _tmp85_;
	gint _tmp92_;
	gchar* _tmp93_;
	gchar* _tmp94_;
	gboolean _tmp95_;
	GString* _tmp116_;
	const gchar* _tmp117_;
	gchar* _tmp118_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = g_string_new ("");
	content = _tmp0_;
	_tmp1_ = self->priv->current;
	text_begin = _tmp1_;
	_tmp2_ = self->priv->current;
	last_linebreak = _tmp2_;
	while (TRUE) {
		gboolean _tmp3_ = FALSE;
		gchar* _tmp4_;
		gchar* _tmp5_;
		gboolean _tmp9_;
		gchar* _tmp10_;
		gchar* _tmp11_;
		gchar* _tmp12_;
		gunichar _tmp13_ = 0U;
		gunichar u;
		gunichar _tmp14_;
		_tmp4_ = self->priv->current;
		_tmp5_ = self->priv->end;
		if (_tmp4_ < _tmp5_) {
			gchar* _tmp6_;
			gchar _tmp7_;
			gchar _tmp8_;
			_tmp6_ = self->priv->current;
			_tmp7_ = _tmp6_[0];
			_tmp8_ = end_char;
			_tmp3_ = _tmp7_ != _tmp8_;
		} else {
			_tmp3_ = FALSE;
		}
		_tmp9_ = _tmp3_;
		if (!_tmp9_) {
			break;
		}
		_tmp10_ = self->priv->current;
		_tmp11_ = self->priv->end;
		_tmp12_ = self->priv->current;
		_tmp13_ = g_utf8_get_char_validated ((const gchar*) _tmp10_, (gssize) ((glong) (_tmp11_ - _tmp12_)));
		u = _tmp13_;
		_tmp14_ = u;
		if (_tmp14_ == ((gunichar) (-1))) {
			vala_report_error (NULL, "invalid UTF-8 character");
		} else {
			gunichar _tmp15_;
			_tmp15_ = u;
			if (_tmp15_ == ((gunichar) '&')) {
				gchar* _tmp16_;
				gunichar _tmp17_;
				gint _tmp18_ = 0;
				gchar* next_pos;
				gchar* _tmp19_;
				gboolean _tmp20_ = FALSE;
				_tmp16_ = self->priv->current;
				_tmp17_ = u;
				_tmp18_ = g_unichar_to_utf8 (_tmp17_, NULL);
				next_pos = _tmp16_ + _tmp18_;
				_tmp19_ = next_pos;
				_tmp20_ = g_str_has_prefix ((const gchar*) _tmp19_, "amp;");
				if (_tmp20_) {
					GString* _tmp21_;
					gchar* _tmp22_;
					gchar* _tmp23_;
					gchar* _tmp24_;
					gchar* _tmp25_ = NULL;
					gchar* _tmp26_;
					GString* _tmp27_;
					gchar* _tmp28_;
					gchar* _tmp29_;
					_tmp21_ = content;
					_tmp22_ = text_begin;
					_tmp23_ = self->priv->current;
					_tmp24_ = text_begin;
					_tmp25_ = string_substring ((const gchar*) _tmp22_, (glong) 0, (glong) ((gint) (_tmp23_ - _tmp24_)));
					_tmp26_ = _tmp25_;
					g_string_append (_tmp21_, _tmp26_);
					_g_free0 (_tmp26_);
					_tmp27_ = content;
					g_string_append_c (_tmp27_, '&');
					_tmp28_ = self->priv->current;
					self->priv->current = _tmp28_ + 5;
					_tmp29_ = self->priv->current;
					text_begin = _tmp29_;
				} else {
					gchar* _tmp30_;
					gboolean _tmp31_ = FALSE;
					_tmp30_ = next_pos;
					_tmp31_ = g_str_has_prefix ((const gchar*) _tmp30_, "quot;");
					if (_tmp31_) {
						GString* _tmp32_;
						gchar* _tmp33_;
						gchar* _tmp34_;
						gchar* _tmp35_;
						gchar* _tmp36_ = NULL;
						gchar* _tmp37_;
						GString* _tmp38_;
						gchar* _tmp39_;
						gchar* _tmp40_;
						_tmp32_ = content;
						_tmp33_ = text_begin;
						_tmp34_ = self->priv->current;
						_tmp35_ = text_begin;
						_tmp36_ = string_substring ((const gchar*) _tmp33_, (glong) 0, (glong) ((gint) (_tmp34_ - _tmp35_)));
						_tmp37_ = _tmp36_;
						g_string_append (_tmp32_, _tmp37_);
						_g_free0 (_tmp37_);
						_tmp38_ = content;
						g_string_append_c (_tmp38_, '"');
						_tmp39_ = self->priv->current;
						self->priv->current = _tmp39_ + 6;
						_tmp40_ = self->priv->current;
						text_begin = _tmp40_;
					} else {
						gchar* _tmp41_;
						gboolean _tmp42_ = FALSE;
						_tmp41_ = next_pos;
						_tmp42_ = g_str_has_prefix ((const gchar*) _tmp41_, "apos;");
						if (_tmp42_) {
							GString* _tmp43_;
							gchar* _tmp44_;
							gchar* _tmp45_;
							gchar* _tmp46_;
							gchar* _tmp47_ = NULL;
							gchar* _tmp48_;
							GString* _tmp49_;
							gchar* _tmp50_;
							gchar* _tmp51_;
							_tmp43_ = content;
							_tmp44_ = text_begin;
							_tmp45_ = self->priv->current;
							_tmp46_ = text_begin;
							_tmp47_ = string_substring ((const gchar*) _tmp44_, (glong) 0, (glong) ((gint) (_tmp45_ - _tmp46_)));
							_tmp48_ = _tmp47_;
							g_string_append (_tmp43_, _tmp48_);
							_g_free0 (_tmp48_);
							_tmp49_ = content;
							g_string_append_c (_tmp49_, '\'');
							_tmp50_ = self->priv->current;
							self->priv->current = _tmp50_ + 6;
							_tmp51_ = self->priv->current;
							text_begin = _tmp51_;
						} else {
							gchar* _tmp52_;
							gboolean _tmp53_ = FALSE;
							_tmp52_ = next_pos;
							_tmp53_ = g_str_has_prefix ((const gchar*) _tmp52_, "lt;");
							if (_tmp53_) {
								GString* _tmp54_;
								gchar* _tmp55_;
								gchar* _tmp56_;
								gchar* _tmp57_;
								gchar* _tmp58_ = NULL;
								gchar* _tmp59_;
								GString* _tmp60_;
								gchar* _tmp61_;
								gchar* _tmp62_;
								_tmp54_ = content;
								_tmp55_ = text_begin;
								_tmp56_ = self->priv->current;
								_tmp57_ = text_begin;
								_tmp58_ = string_substring ((const gchar*) _tmp55_, (glong) 0, (glong) ((gint) (_tmp56_ - _tmp57_)));
								_tmp59_ = _tmp58_;
								g_string_append (_tmp54_, _tmp59_);
								_g_free0 (_tmp59_);
								_tmp60_ = content;
								g_string_append_c (_tmp60_, '<');
								_tmp61_ = self->priv->current;
								self->priv->current = _tmp61_ + 4;
								_tmp62_ = self->priv->current;
								text_begin = _tmp62_;
							} else {
								gchar* _tmp63_;
								gboolean _tmp64_ = FALSE;
								_tmp63_ = next_pos;
								_tmp64_ = g_str_has_prefix ((const gchar*) _tmp63_, "gt;");
								if (_tmp64_) {
									GString* _tmp65_;
									gchar* _tmp66_;
									gchar* _tmp67_;
									gchar* _tmp68_;
									gchar* _tmp69_ = NULL;
									gchar* _tmp70_;
									GString* _tmp71_;
									gchar* _tmp72_;
									gchar* _tmp73_;
									_tmp65_ = content;
									_tmp66_ = text_begin;
									_tmp67_ = self->priv->current;
									_tmp68_ = text_begin;
									_tmp69_ = string_substring ((const gchar*) _tmp66_, (glong) 0, (glong) ((gint) (_tmp67_ - _tmp68_)));
									_tmp70_ = _tmp69_;
									g_string_append (_tmp65_, _tmp70_);
									_g_free0 (_tmp70_);
									_tmp71_ = content;
									g_string_append_c (_tmp71_, '>');
									_tmp72_ = self->priv->current;
									self->priv->current = _tmp72_ + 4;
									_tmp73_ = self->priv->current;
									text_begin = _tmp73_;
								} else {
									gchar* _tmp74_;
									gunichar _tmp75_;
									gint _tmp76_ = 0;
									_tmp74_ = self->priv->current;
									_tmp75_ = u;
									_tmp76_ = g_unichar_to_utf8 (_tmp75_, NULL);
									self->priv->current = _tmp74_ + _tmp76_;
								}
							}
						}
					}
				}
			} else {
				gunichar _tmp77_;
				gchar* _tmp80_;
				gunichar _tmp81_;
				gint _tmp82_ = 0;
				gint _tmp83_;
				_tmp77_ = u;
				if (_tmp77_ == ((gunichar) '\n')) {
					gint _tmp78_;
					gchar* _tmp79_;
					_tmp78_ = self->priv->line;
					self->priv->line = _tmp78_ + 1;
					self->priv->column = 0;
					_tmp79_ = self->priv->current;
					last_linebreak = _tmp79_;
				}
				_tmp80_ = self->priv->current;
				_tmp81_ = u;
				_tmp82_ = g_unichar_to_utf8 (_tmp81_, NULL);
				self->priv->current = _tmp80_ + _tmp82_;
				_tmp83_ = self->priv->column;
				self->priv->column = _tmp83_ + 1;
			}
		}
	}
	_tmp84_ = text_begin;
	_tmp85_ = self->priv->current;
	if (_tmp84_ != _tmp85_) {
		GString* _tmp86_;
		gchar* _tmp87_;
		gchar* _tmp88_;
		gchar* _tmp89_;
		gchar* _tmp90_ = NULL;
		gchar* _tmp91_;
		_tmp86_ = content;
		_tmp87_ = text_begin;
		_tmp88_ = self->priv->current;
		_tmp89_ = text_begin;
		_tmp90_ = string_substring ((const gchar*) _tmp87_, (glong) 0, (glong) ((gint) (_tmp88_ - _tmp89_)));
		_tmp91_ = _tmp90_;
		g_string_append (_tmp86_, _tmp91_);
		_g_free0 (_tmp91_);
	}
	_tmp92_ = self->priv->column;
	_tmp93_ = self->priv->current;
	_tmp94_ = last_linebreak;
	self->priv->column = _tmp92_ + ((gint) (_tmp93_ - _tmp94_));
	_tmp95_ = rm_trailing_whitespace;
	if (_tmp95_) {
		GString* _tmp96_;
		const gchar* _tmp97_;
		GString* _tmp98_;
		gssize _tmp99_;
		gchar* str_pos;
		GString* _tmp112_;
		gchar* _tmp113_;
		GString* _tmp114_;
		const gchar* _tmp115_;
		_tmp96_ = content;
		_tmp97_ = _tmp96_->str;
		_tmp98_ = content;
		_tmp99_ = _tmp98_->len;
		str_pos = ((gchar*) _tmp97_) + _tmp99_;
		{
			gchar* _tmp100_;
			gboolean _tmp101_;
			_tmp100_ = str_pos;
			str_pos = _tmp100_ - 1;
			_tmp101_ = TRUE;
			while (TRUE) {
				gboolean _tmp102_;
				gboolean _tmp104_ = FALSE;
				gchar* _tmp105_;
				GString* _tmp106_;
				const gchar* _tmp107_;
				gboolean _tmp111_;
				_tmp102_ = _tmp101_;
				if (!_tmp102_) {
					gchar* _tmp103_;
					_tmp103_ = str_pos;
					str_pos = _tmp103_ - 1;
				}
				_tmp101_ = FALSE;
				_tmp105_ = str_pos;
				_tmp106_ = content;
				_tmp107_ = _tmp106_->str;
				if (_tmp105_ > ((gchar*) _tmp107_)) {
					gchar* _tmp108_;
					gchar _tmp109_;
					gboolean _tmp110_ = FALSE;
					_tmp108_ = str_pos;
					_tmp109_ = _tmp108_[0];
					_tmp110_ = g_ascii_isspace (_tmp109_);
					_tmp104_ = _tmp110_;
				} else {
					_tmp104_ = FALSE;
				}
				_tmp111_ = _tmp104_;
				if (!_tmp111_) {
					break;
				}
			}
		}
		_tmp112_ = content;
		_tmp113_ = str_pos;
		_tmp114_ = content;
		_tmp115_ = _tmp114_->str;
		g_string_erase (_tmp112_, (gssize) ((_tmp113_ - ((gchar*) _tmp115_)) + 1), (gssize) (-1));
	}
	_tmp116_ = content;
	_tmp117_ = _tmp116_->str;
	_tmp118_ = g_strdup (_tmp117_);
	result = _tmp118_;
	_g_string_free0 (content);
	return result;
}
示例#5
0
static gchar* vala_markup_reader_read_name (ValaMarkupReader* self) {
	gchar* result = NULL;
	gchar* _tmp0_;
	gchar* begin;
	gchar* _tmp33_;
	gchar* _tmp34_;
	gchar* _tmp35_;
	gchar* _tmp36_;
	gchar* _tmp37_;
	gchar* _tmp38_ = NULL;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->current;
	begin = _tmp0_;
	while (TRUE) {
		gchar* _tmp1_;
		gchar* _tmp2_;
		gboolean _tmp3_ = FALSE;
		gboolean _tmp4_ = FALSE;
		gboolean _tmp5_ = FALSE;
		gboolean _tmp6_ = FALSE;
		gboolean _tmp7_ = FALSE;
		gchar* _tmp8_;
		gchar _tmp9_;
		gboolean _tmp12_;
		gboolean _tmp15_;
		gboolean _tmp18_;
		gboolean _tmp21_;
		gboolean _tmp24_;
		gchar* _tmp25_;
		gchar* _tmp26_;
		gchar* _tmp27_;
		gunichar _tmp28_ = 0U;
		gunichar u;
		gunichar _tmp29_;
		_tmp1_ = self->priv->current;
		_tmp2_ = self->priv->end;
		if (!(_tmp1_ < _tmp2_)) {
			break;
		}
		_tmp8_ = self->priv->current;
		_tmp9_ = _tmp8_[0];
		if (_tmp9_ == ' ') {
			_tmp7_ = TRUE;
		} else {
			gchar* _tmp10_;
			gchar _tmp11_;
			_tmp10_ = self->priv->current;
			_tmp11_ = _tmp10_[0];
			_tmp7_ = _tmp11_ == '\t';
		}
		_tmp12_ = _tmp7_;
		if (_tmp12_) {
			_tmp6_ = TRUE;
		} else {
			gchar* _tmp13_;
			gchar _tmp14_;
			_tmp13_ = self->priv->current;
			_tmp14_ = _tmp13_[0];
			_tmp6_ = _tmp14_ == '>';
		}
		_tmp15_ = _tmp6_;
		if (_tmp15_) {
			_tmp5_ = TRUE;
		} else {
			gchar* _tmp16_;
			gchar _tmp17_;
			_tmp16_ = self->priv->current;
			_tmp17_ = _tmp16_[0];
			_tmp5_ = _tmp17_ == '/';
		}
		_tmp18_ = _tmp5_;
		if (_tmp18_) {
			_tmp4_ = TRUE;
		} else {
			gchar* _tmp19_;
			gchar _tmp20_;
			_tmp19_ = self->priv->current;
			_tmp20_ = _tmp19_[0];
			_tmp4_ = _tmp20_ == '=';
		}
		_tmp21_ = _tmp4_;
		if (_tmp21_) {
			_tmp3_ = TRUE;
		} else {
			gchar* _tmp22_;
			gchar _tmp23_;
			_tmp22_ = self->priv->current;
			_tmp23_ = _tmp22_[0];
			_tmp3_ = _tmp23_ == '\n';
		}
		_tmp24_ = _tmp3_;
		if (_tmp24_) {
			break;
		}
		_tmp25_ = self->priv->current;
		_tmp26_ = self->priv->end;
		_tmp27_ = self->priv->current;
		_tmp28_ = g_utf8_get_char_validated ((const gchar*) _tmp25_, (gssize) ((glong) (_tmp26_ - _tmp27_)));
		u = _tmp28_;
		_tmp29_ = u;
		if (_tmp29_ != ((gunichar) (-1))) {
			gchar* _tmp30_;
			gunichar _tmp31_;
			gint _tmp32_ = 0;
			_tmp30_ = self->priv->current;
			_tmp31_ = u;
			_tmp32_ = g_unichar_to_utf8 (_tmp31_, NULL);
			self->priv->current = _tmp30_ + _tmp32_;
		} else {
			vala_report_error (NULL, "invalid UTF-8 character");
		}
	}
	_tmp33_ = self->priv->current;
	_tmp34_ = begin;
	if (_tmp33_ == _tmp34_) {
	}
	_tmp35_ = begin;
	_tmp36_ = self->priv->current;
	_tmp37_ = begin;
	_tmp38_ = string_substring ((const gchar*) _tmp35_, (glong) 0, (glong) ((gint) (_tmp36_ - _tmp37_)));
	result = _tmp38_;
	return result;
}
示例#6
0
ValaMarkupReader* vala_markup_reader_construct (GType object_type, const gchar* filename) {
	ValaMarkupReader * self = NULL;
	const gchar* _tmp0_;
	GError * _inner_error_ = NULL;
	g_return_val_if_fail (filename != NULL, NULL);
	self = (ValaMarkupReader*) g_object_new (object_type, NULL);
	_tmp0_ = filename;
	vala_markup_reader_set_filename (self, _tmp0_);
	{
		const gchar* _tmp1_;
		GMappedFile* _tmp2_;
		GMappedFile* _tmp3_;
		GMappedFile* _tmp4_;
		gchar* _tmp5_ = NULL;
		gchar* _tmp6_;
		GMappedFile* _tmp7_;
		gsize _tmp8_ = 0UL;
		gchar* _tmp9_;
		_tmp1_ = filename;
		_tmp2_ = g_mapped_file_new (_tmp1_, FALSE, &_inner_error_);
		_tmp3_ = _tmp2_;
		if (_inner_error_ != NULL) {
			if (_inner_error_->domain == G_FILE_ERROR) {
				goto __catch9_g_file_error;
			}
			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
			g_clear_error (&_inner_error_);
			return NULL;
		}
		_g_mapped_file_free0 (self->priv->mapped_file);
		self->priv->mapped_file = _tmp3_;
		_tmp4_ = self->priv->mapped_file;
		_tmp5_ = g_mapped_file_get_contents (_tmp4_);
		self->priv->begin = _tmp5_;
		_tmp6_ = self->priv->begin;
		_tmp7_ = self->priv->mapped_file;
		_tmp8_ = g_mapped_file_get_length (_tmp7_);
		self->priv->end = _tmp6_ + _tmp8_;
		_tmp9_ = self->priv->begin;
		self->priv->current = _tmp9_;
		self->priv->line = 1;
		self->priv->column = 1;
	}
	goto __finally9;
	__catch9_g_file_error:
	{
		GError* e = NULL;
		const gchar* _tmp10_;
		GError* _tmp11_;
		const gchar* _tmp12_;
		gchar* _tmp13_ = NULL;
		gchar* _tmp14_;
		e = _inner_error_;
		_inner_error_ = NULL;
		_tmp10_ = filename;
		_tmp11_ = e;
		_tmp12_ = _tmp11_->message;
		_tmp13_ = g_strdup_printf ("Unable to map file `%s': %s", _tmp10_, _tmp12_);
		_tmp14_ = _tmp13_;
		vala_report_error (NULL, _tmp14_);
		_g_free0 (_tmp14_);
		_g_error_free0 (e);
	}
	__finally9:
	if (_inner_error_ != NULL) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
		g_clear_error (&_inner_error_);
		return NULL;
	}
	return self;
}
示例#7
0
static gboolean vala_tuple_real_check (ValaCodeNode* base, ValaCodeContext* context) {
	ValaTuple * self;
	gboolean result = FALSE;
	gboolean _tmp0_;
	gboolean _tmp1_;
	ValaCodeContext* _tmp4_;
	ValaProfile _tmp5_;
	ValaProfile _tmp6_;
	ValaCodeContext* _tmp9_;
	ValaNamespace* _tmp10_;
	ValaNamespace* _tmp11_;
	ValaScope* _tmp12_;
	ValaScope* _tmp13_;
	ValaSymbol* _tmp14_ = NULL;
	ValaSymbol* _tmp15_;
	ValaScope* _tmp16_;
	ValaScope* _tmp17_;
	ValaSymbol* _tmp18_ = NULL;
	ValaClass* _tmp19_;
	ValaObjectType* _tmp20_;
	ValaObjectType* _tmp21_;
	ValaDataType* _tmp22_;
	ValaDataType* _tmp23_;
	gboolean _tmp45_;
	gboolean _tmp46_;
	self = (ValaTuple*) base;
	g_return_val_if_fail (context != NULL, FALSE);
	_tmp0_ = vala_code_node_get_checked ((ValaCodeNode*) self);
	_tmp1_ = _tmp0_;
	if (_tmp1_) {
		gboolean _tmp2_;
		gboolean _tmp3_;
		_tmp2_ = vala_code_node_get_error ((ValaCodeNode*) self);
		_tmp3_ = _tmp2_;
		result = !_tmp3_;
		return result;
	}
	vala_code_node_set_checked ((ValaCodeNode*) self, TRUE);
	_tmp4_ = context;
	_tmp5_ = vala_code_context_get_profile (_tmp4_);
	_tmp6_ = _tmp5_;
	if (_tmp6_ != VALA_PROFILE_DOVA) {
		ValaSourceReference* _tmp7_;
		ValaSourceReference* _tmp8_;
		_tmp7_ = vala_code_node_get_source_reference ((ValaCodeNode*) self);
		_tmp8_ = _tmp7_;
		vala_report_error (_tmp8_, "tuples are not supported");
		vala_code_node_set_error ((ValaCodeNode*) self, TRUE);
		result = FALSE;
		return result;
	}
	_tmp9_ = context;
	_tmp10_ = vala_code_context_get_root (_tmp9_);
	_tmp11_ = _tmp10_;
	_tmp12_ = vala_symbol_get_scope ((ValaSymbol*) _tmp11_);
	_tmp13_ = _tmp12_;
	_tmp14_ = vala_scope_lookup (_tmp13_, "Dova");
	_tmp15_ = _tmp14_;
	_tmp16_ = vala_symbol_get_scope (_tmp15_);
	_tmp17_ = _tmp16_;
	_tmp18_ = vala_scope_lookup (_tmp17_, "Tuple");
	_tmp19_ = VALA_CLASS (_tmp18_);
	_tmp20_ = vala_object_type_new ((ValaObjectTypeSymbol*) _tmp19_);
	_tmp21_ = _tmp20_;
	vala_expression_set_value_type ((ValaExpression*) self, (ValaDataType*) _tmp21_);
	_vala_code_node_unref0 (_tmp21_);
	_vala_code_node_unref0 (_tmp19_);
	_vala_code_node_unref0 (_tmp15_);
	_tmp22_ = vala_expression_get_value_type ((ValaExpression*) self);
	_tmp23_ = _tmp22_;
	vala_data_type_set_value_owned (_tmp23_, TRUE);
	{
		ValaList* _tmp24_;
		ValaList* _tmp25_;
		ValaList* _expr_list;
		ValaList* _tmp26_;
		gint _tmp27_;
		gint _tmp28_;
		gint _expr_size;
		gint _expr_index;
		_tmp24_ = self->priv->expression_list;
		_tmp25_ = _vala_iterable_ref0 (_tmp24_);
		_expr_list = _tmp25_;
		_tmp26_ = _expr_list;
		_tmp27_ = vala_collection_get_size ((ValaCollection*) _tmp26_);
		_tmp28_ = _tmp27_;
		_expr_size = _tmp28_;
		_expr_index = -1;
		while (TRUE) {
			gint _tmp29_;
			gint _tmp30_;
			gint _tmp31_;
			ValaList* _tmp32_;
			gint _tmp33_;
			gpointer _tmp34_ = NULL;
			ValaExpression* expr;
			ValaExpression* _tmp35_;
			ValaCodeContext* _tmp36_;
			gboolean _tmp37_ = FALSE;
			ValaDataType* _tmp38_;
			ValaDataType* _tmp39_;
			ValaExpression* _tmp40_;
			ValaDataType* _tmp41_;
			ValaDataType* _tmp42_;
			ValaDataType* _tmp43_ = NULL;
			ValaDataType* _tmp44_;
			_tmp29_ = _expr_index;
			_expr_index = _tmp29_ + 1;
			_tmp30_ = _expr_index;
			_tmp31_ = _expr_size;
			if (!(_tmp30_ < _tmp31_)) {
				break;
			}
			_tmp32_ = _expr_list;
			_tmp33_ = _expr_index;
			_tmp34_ = vala_list_get (_tmp32_, _tmp33_);
			expr = (ValaExpression*) _tmp34_;
			_tmp35_ = expr;
			_tmp36_ = context;
			_tmp37_ = vala_code_node_check ((ValaCodeNode*) _tmp35_, _tmp36_);
			if (!_tmp37_) {
				result = FALSE;
				_vala_code_node_unref0 (expr);
				_vala_iterable_unref0 (_expr_list);
				return result;
			}
			_tmp38_ = vala_expression_get_value_type ((ValaExpression*) self);
			_tmp39_ = _tmp38_;
			_tmp40_ = expr;
			_tmp41_ = vala_expression_get_value_type (_tmp40_);
			_tmp42_ = _tmp41_;
			_tmp43_ = vala_data_type_copy (_tmp42_);
			_tmp44_ = _tmp43_;
			vala_data_type_add_type_argument (_tmp39_, _tmp44_);
			_vala_code_node_unref0 (_tmp44_);
			_vala_code_node_unref0 (expr);
		}
		_vala_iterable_unref0 (_expr_list);
	}
	_tmp45_ = vala_code_node_get_error ((ValaCodeNode*) self);
	_tmp46_ = _tmp45_;
	result = !_tmp46_;
	return result;
}
示例#8
0
void vala_ccode_compiler_compile (ValaCCodeCompiler* self, ValaCodeContext* context, const gchar* cc_command, gchar** cc_options, int cc_options_length1) {
	gboolean use_pkgconfig;
	gchar* _tmp0_;
	gchar* pc;
	ValaCodeContext* _tmp1_;
	gboolean _tmp2_;
	gboolean _tmp3_;
	ValaCodeContext* _tmp6_;
	ValaProfile _tmp7_;
	ValaProfile _tmp8_;
	gchar* _tmp34_;
	gchar* pkgflags;
	gboolean _tmp35_;
	const gchar* _tmp45_;
	const gchar* _tmp46_;
	gchar* _tmp47_;
	gchar* cmdline;
	ValaCodeContext* _tmp48_;
	gboolean _tmp49_;
	gboolean _tmp50_;
	ValaCodeContext* _tmp53_;
	gboolean _tmp54_;
	gboolean _tmp55_;
	ValaCodeContext* _tmp93_;
	ValaList* _tmp94_ = NULL;
	ValaList* source_files;
	ValaCodeContext* _tmp118_;
	ValaList* _tmp119_ = NULL;
	ValaList* c_source_files;
	const gchar* _tmp138_;
	const gchar* _tmp139_;
	gchar* _tmp140_ = NULL;
	gchar* _tmp141_;
	gchar* _tmp142_;
	gchar* _tmp143_;
	gchar* _tmp144_;
	gchar** _tmp145_;
	gint _tmp145__length1;
	ValaCodeContext* _tmp154_;
	gboolean _tmp155_;
	gboolean _tmp156_;
	GError * _inner_error_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (context != NULL);
	use_pkgconfig = FALSE;
	_tmp0_ = g_strdup ("pkg-config --cflags");
	pc = _tmp0_;
	_tmp1_ = context;
	_tmp2_ = vala_code_context_get_compile_only (_tmp1_);
	_tmp3_ = _tmp2_;
	if (!_tmp3_) {
		const gchar* _tmp4_;
		gchar* _tmp5_;
		_tmp4_ = pc;
		_tmp5_ = g_strconcat (_tmp4_, " --libs", NULL);
		_g_free0 (pc);
		pc = _tmp5_;
	}
	_tmp6_ = context;
	_tmp7_ = vala_code_context_get_profile (_tmp6_);
	_tmp8_ = _tmp7_;
	if (_tmp8_ == VALA_PROFILE_GOBJECT) {
		const gchar* _tmp9_;
		gchar* _tmp10_;
		ValaCodeContext* _tmp11_;
		gboolean _tmp12_;
		gboolean _tmp13_;
		use_pkgconfig = TRUE;
		_tmp9_ = pc;
		_tmp10_ = g_strconcat (_tmp9_, " gobject-2.0", NULL);
		_g_free0 (pc);
		pc = _tmp10_;
		_tmp11_ = context;
		_tmp12_ = vala_code_context_get_thread (_tmp11_);
		_tmp13_ = _tmp12_;
		if (_tmp13_) {
			const gchar* _tmp14_;
			gchar* _tmp15_;
			_tmp14_ = pc;
			_tmp15_ = g_strconcat (_tmp14_, " gthread-2.0", NULL);
			_g_free0 (pc);
			pc = _tmp15_;
		}
	}
	{
		ValaCodeContext* _tmp16_;
		ValaList* _tmp17_ = NULL;
		ValaList* _pkg_list;
		ValaList* _tmp18_;
		gint _tmp19_;
		gint _tmp20_;
		gint _pkg_size;
		gint _pkg_index;
		_tmp16_ = context;
		_tmp17_ = vala_code_context_get_packages (_tmp16_);
		_pkg_list = _tmp17_;
		_tmp18_ = _pkg_list;
		_tmp19_ = vala_collection_get_size ((ValaCollection*) _tmp18_);
		_tmp20_ = _tmp19_;
		_pkg_size = _tmp20_;
		_pkg_index = -1;
		while (TRUE) {
			gint _tmp21_;
			gint _tmp22_;
			gint _tmp23_;
			ValaList* _tmp24_;
			gint _tmp25_;
			gpointer _tmp26_ = NULL;
			gchar* pkg;
			const gchar* _tmp27_;
			gboolean _tmp28_ = FALSE;
			_tmp21_ = _pkg_index;
			_pkg_index = _tmp21_ + 1;
			_tmp22_ = _pkg_index;
			_tmp23_ = _pkg_size;
			if (!(_tmp22_ < _tmp23_)) {
				break;
			}
			_tmp24_ = _pkg_list;
			_tmp25_ = _pkg_index;
			_tmp26_ = vala_list_get (_tmp24_, _tmp25_);
			pkg = (gchar*) _tmp26_;
			_tmp27_ = pkg;
			_tmp28_ = vala_ccode_compiler_package_exists (_tmp27_);
			if (_tmp28_) {
				const gchar* _tmp29_;
				const gchar* _tmp30_;
				gchar* _tmp31_;
				gchar* _tmp32_;
				gchar* _tmp33_;
				use_pkgconfig = TRUE;
				_tmp29_ = pc;
				_tmp30_ = pkg;
				_tmp31_ = g_strconcat (" ", _tmp30_, NULL);
				_tmp32_ = _tmp31_;
				_tmp33_ = g_strconcat (_tmp29_, _tmp32_, NULL);
				_g_free0 (pc);
				pc = _tmp33_;
				_g_free0 (_tmp32_);
			}
			_g_free0 (pkg);
		}
		_vala_iterable_unref0 (_pkg_list);
	}
	_tmp34_ = g_strdup ("");
	pkgflags = _tmp34_;
	_tmp35_ = use_pkgconfig;
	if (_tmp35_) {
		{
			gint exit_status = 0;
			const gchar* _tmp36_;
			gchar* _tmp37_ = NULL;
			gint _tmp38_ = 0;
			gint _tmp39_;
			_tmp36_ = pc;
			g_spawn_command_line_sync (_tmp36_, &_tmp37_, NULL, &_tmp38_, &_inner_error_);
			_g_free0 (pkgflags);
			pkgflags = _tmp37_;
			exit_status = _tmp38_;
			if (_inner_error_ != NULL) {
				if (_inner_error_->domain == G_SPAWN_ERROR) {
					goto __catch2_g_spawn_error;
				}
				_g_free0 (pkgflags);
				_g_free0 (pc);
				g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
				g_clear_error (&_inner_error_);
				return;
			}
			_tmp39_ = exit_status;
			if (_tmp39_ != 0) {
				gint _tmp40_;
				gchar* _tmp41_ = NULL;
				gchar* _tmp42_;
				_tmp40_ = exit_status;
				_tmp41_ = g_strdup_printf ("pkg-config exited with status %d", _tmp40_);
				_tmp42_ = _tmp41_;
				vala_report_error (NULL, _tmp42_);
				_g_free0 (_tmp42_);
				_g_free0 (pkgflags);
				_g_free0 (pc);
				return;
			}
		}
		goto __finally2;
		__catch2_g_spawn_error:
		{
			GError* e = NULL;
			GError* _tmp43_;
			const gchar* _tmp44_;
			e = _inner_error_;
			_inner_error_ = NULL;
			_tmp43_ = e;
			_tmp44_ = _tmp43_->message;
			vala_report_error (NULL, _tmp44_);
			_g_error_free0 (e);
			_g_free0 (pkgflags);
			_g_free0 (pc);
			return;
		}
		__finally2:
		if (_inner_error_ != NULL) {
			_g_free0 (pkgflags);
			_g_free0 (pc);
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
			g_clear_error (&_inner_error_);
			return;
		}
	}
	_tmp45_ = cc_command;
	if (_tmp45_ == NULL) {
		cc_command = "cc";
	}
	_tmp46_ = cc_command;
	_tmp47_ = g_strdup (_tmp46_);
	cmdline = _tmp47_;
	_tmp48_ = context;
	_tmp49_ = vala_code_context_get_debug (_tmp48_);
	_tmp50_ = _tmp49_;
	if (_tmp50_) {
		const gchar* _tmp51_;
		gchar* _tmp52_;
		_tmp51_ = cmdline;
		_tmp52_ = g_strconcat (_tmp51_, " -g", NULL);
		_g_free0 (cmdline);
		cmdline = _tmp52_;
	}
	_tmp53_ = context;
	_tmp54_ = vala_code_context_get_compile_only (_tmp53_);
	_tmp55_ = _tmp54_;
	if (_tmp55_) {
		const gchar* _tmp56_;
		gchar* _tmp57_;
		_tmp56_ = cmdline;
		_tmp57_ = g_strconcat (_tmp56_, " -c", NULL);
		_g_free0 (cmdline);
		cmdline = _tmp57_;
	} else {
		ValaCodeContext* _tmp58_;
		const gchar* _tmp59_;
		const gchar* _tmp60_;
		_tmp58_ = context;
		_tmp59_ = vala_code_context_get_output (_tmp58_);
		_tmp60_ = _tmp59_;
		if (_tmp60_ != NULL) {
			ValaCodeContext* _tmp61_;
			const gchar* _tmp62_;
			const gchar* _tmp63_;
			gchar* _tmp64_;
			gchar* output;
			gboolean _tmp65_ = FALSE;
			gboolean _tmp66_ = FALSE;
			ValaCodeContext* _tmp67_;
			const gchar* _tmp68_;
			const gchar* _tmp69_;
			gboolean _tmp73_;
			gboolean _tmp78_;
			const gchar* _tmp86_;
			const gchar* _tmp87_;
			gchar* _tmp88_ = NULL;
			gchar* _tmp89_;
			gchar* _tmp90_;
			gchar* _tmp91_;
			gchar* _tmp92_;
			_tmp61_ = context;
			_tmp62_ = vala_code_context_get_output (_tmp61_);
			_tmp63_ = _tmp62_;
			_tmp64_ = g_strdup (_tmp63_);
			output = _tmp64_;
			_tmp67_ = context;
			_tmp68_ = vala_code_context_get_directory (_tmp67_);
			_tmp69_ = _tmp68_;
			if (_tmp69_ != NULL) {
				ValaCodeContext* _tmp70_;
				const gchar* _tmp71_;
				const gchar* _tmp72_;
				_tmp70_ = context;
				_tmp71_ = vala_code_context_get_directory (_tmp70_);
				_tmp72_ = _tmp71_;
				_tmp66_ = g_strcmp0 (_tmp72_, "") != 0;
			} else {
				_tmp66_ = FALSE;
			}
			_tmp73_ = _tmp66_;
			if (_tmp73_) {
				ValaCodeContext* _tmp74_;
				const gchar* _tmp75_;
				const gchar* _tmp76_;
				gboolean _tmp77_ = FALSE;
				_tmp74_ = context;
				_tmp75_ = vala_code_context_get_output (_tmp74_);
				_tmp76_ = _tmp75_;
				_tmp77_ = g_path_is_absolute (_tmp76_);
				_tmp65_ = !_tmp77_;
			} else {
				_tmp65_ = FALSE;
			}
			_tmp78_ = _tmp65_;
			if (_tmp78_) {
				ValaCodeContext* _tmp79_;
				const gchar* _tmp80_;
				const gchar* _tmp81_;
				ValaCodeContext* _tmp82_;
				const gchar* _tmp83_;
				const gchar* _tmp84_;
				gchar* _tmp85_ = NULL;
				_tmp79_ = context;
				_tmp80_ = vala_code_context_get_directory (_tmp79_);
				_tmp81_ = _tmp80_;
				_tmp82_ = context;
				_tmp83_ = vala_code_context_get_output (_tmp82_);
				_tmp84_ = _tmp83_;
				_tmp85_ = g_strdup_printf ("%s%c%s", _tmp81_, (gint) G_DIR_SEPARATOR, _tmp84_);
				_g_free0 (output);
				output = _tmp85_;
			}
			_tmp86_ = cmdline;
			_tmp87_ = output;
			_tmp88_ = g_shell_quote (_tmp87_);
			_tmp89_ = _tmp88_;
			_tmp90_ = g_strconcat (" -o ", _tmp89_, NULL);
			_tmp91_ = _tmp90_;
			_tmp92_ = g_strconcat (_tmp86_, _tmp91_, NULL);
			_g_free0 (cmdline);
			cmdline = _tmp92_;
			_g_free0 (_tmp91_);
			_g_free0 (_tmp89_);
			_g_free0 (output);
		}
	}
	_tmp93_ = context;
	_tmp94_ = vala_code_context_get_source_files (_tmp93_);
	source_files = _tmp94_;
	{
		ValaList* _tmp95_;
		ValaList* _tmp96_;
		ValaList* _file_list;
		ValaList* _tmp97_;
		gint _tmp98_;
		gint _tmp99_;
		gint _file_size;
		gint _file_index;
		_tmp95_ = source_files;
		_tmp96_ = _vala_iterable_ref0 (_tmp95_);
		_file_list = _tmp96_;
		_tmp97_ = _file_list;
		_tmp98_ = vala_collection_get_size ((ValaCollection*) _tmp97_);
		_tmp99_ = _tmp98_;
		_file_size = _tmp99_;
		_file_index = -1;
		while (TRUE) {
			gint _tmp100_;
			gint _tmp101_;
			gint _tmp102_;
			ValaList* _tmp103_;
			gint _tmp104_;
			gpointer _tmp105_ = NULL;
			ValaSourceFile* file;
			ValaSourceFile* _tmp106_;
			ValaSourceFileType _tmp107_;
			ValaSourceFileType _tmp108_;
			_tmp100_ = _file_index;
			_file_index = _tmp100_ + 1;
			_tmp101_ = _file_index;
			_tmp102_ = _file_size;
			if (!(_tmp101_ < _tmp102_)) {
				break;
			}
			_tmp103_ = _file_list;
			_tmp104_ = _file_index;
			_tmp105_ = vala_list_get (_tmp103_, _tmp104_);
			file = (ValaSourceFile*) _tmp105_;
			_tmp106_ = file;
			_tmp107_ = vala_source_file_get_file_type (_tmp106_);
			_tmp108_ = _tmp107_;
			if (_tmp108_ == VALA_SOURCE_FILE_TYPE_SOURCE) {
				const gchar* _tmp109_;
				ValaSourceFile* _tmp110_;
				gchar* _tmp111_ = NULL;
				gchar* _tmp112_;
				gchar* _tmp113_ = NULL;
				gchar* _tmp114_;
				gchar* _tmp115_;
				gchar* _tmp116_;
				gchar* _tmp117_;
				_tmp109_ = cmdline;
				_tmp110_ = file;
				_tmp111_ = vala_source_file_get_csource_filename (_tmp110_);
				_tmp112_ = _tmp111_;
				_tmp113_ = g_shell_quote (_tmp112_);
				_tmp114_ = _tmp113_;
				_tmp115_ = g_strconcat (" ", _tmp114_, NULL);
				_tmp116_ = _tmp115_;
				_tmp117_ = g_strconcat (_tmp109_, _tmp116_, NULL);
				_g_free0 (cmdline);
				cmdline = _tmp117_;
				_g_free0 (_tmp116_);
				_g_free0 (_tmp114_);
				_g_free0 (_tmp112_);
			}
			_vala_source_file_unref0 (file);
		}
		_vala_iterable_unref0 (_file_list);
	}
	_tmp118_ = context;
	_tmp119_ = vala_code_context_get_c_source_files (_tmp118_);
	c_source_files = _tmp119_;
	{
		ValaList* _tmp120_;
		ValaList* _tmp121_;
		ValaList* _file_list;
		ValaList* _tmp122_;
		gint _tmp123_;
		gint _tmp124_;
		gint _file_size;
		gint _file_index;
		_tmp120_ = c_source_files;
		_tmp121_ = _vala_iterable_ref0 (_tmp120_);
		_file_list = _tmp121_;
		_tmp122_ = _file_list;
		_tmp123_ = vala_collection_get_size ((ValaCollection*) _tmp122_);
		_tmp124_ = _tmp123_;
		_file_size = _tmp124_;
		_file_index = -1;
		while (TRUE) {
			gint _tmp125_;
			gint _tmp126_;
			gint _tmp127_;
			ValaList* _tmp128_;
			gint _tmp129_;
			gpointer _tmp130_ = NULL;
			gchar* file;
			const gchar* _tmp131_;
			const gchar* _tmp132_;
			gchar* _tmp133_ = NULL;
			gchar* _tmp134_;
			gchar* _tmp135_;
			gchar* _tmp136_;
			gchar* _tmp137_;
			_tmp125_ = _file_index;
			_file_index = _tmp125_ + 1;
			_tmp126_ = _file_index;
			_tmp127_ = _file_size;
			if (!(_tmp126_ < _tmp127_)) {
				break;
			}
			_tmp128_ = _file_list;
			_tmp129_ = _file_index;
			_tmp130_ = vala_list_get (_tmp128_, _tmp129_);
			file = (gchar*) _tmp130_;
			_tmp131_ = cmdline;
			_tmp132_ = file;
			_tmp133_ = g_shell_quote (_tmp132_);
			_tmp134_ = _tmp133_;
			_tmp135_ = g_strconcat (" ", _tmp134_, NULL);
			_tmp136_ = _tmp135_;
			_tmp137_ = g_strconcat (_tmp131_, _tmp136_, NULL);
			_g_free0 (cmdline);
			cmdline = _tmp137_;
			_g_free0 (_tmp136_);
			_g_free0 (_tmp134_);
			_g_free0 (file);
		}
		_vala_iterable_unref0 (_file_list);
	}
	_tmp138_ = cmdline;
	_tmp139_ = pkgflags;
	_tmp140_ = string_strip (_tmp139_);
	_tmp141_ = _tmp140_;
	_tmp142_ = g_strconcat (" ", _tmp141_, NULL);
	_tmp143_ = _tmp142_;
	_tmp144_ = g_strconcat (_tmp138_, _tmp143_, NULL);
	_g_free0 (cmdline);
	cmdline = _tmp144_;
	_g_free0 (_tmp143_);
	_g_free0 (_tmp141_);
	_tmp145_ = cc_options;
	_tmp145__length1 = cc_options_length1;
	{
		gchar** cc_option_collection = NULL;
		gint cc_option_collection_length1 = 0;
		gint _cc_option_collection_size_ = 0;
		gint cc_option_it = 0;
		cc_option_collection = _tmp145_;
		cc_option_collection_length1 = _tmp145__length1;
		for (cc_option_it = 0; cc_option_it < _tmp145__length1; cc_option_it = cc_option_it + 1) {
			gchar* _tmp146_;
			gchar* cc_option = NULL;
			_tmp146_ = g_strdup (cc_option_collection[cc_option_it]);
			cc_option = _tmp146_;
			{
				const gchar* _tmp147_;
				const gchar* _tmp148_;
				gchar* _tmp149_ = NULL;
				gchar* _tmp150_;
				gchar* _tmp151_;
				gchar* _tmp152_;
				gchar* _tmp153_;
				_tmp147_ = cmdline;
				_tmp148_ = cc_option;
				_tmp149_ = g_shell_quote (_tmp148_);
				_tmp150_ = _tmp149_;
				_tmp151_ = g_strconcat (" ", _tmp150_, NULL);
				_tmp152_ = _tmp151_;
				_tmp153_ = g_strconcat (_tmp147_, _tmp152_, NULL);
				_g_free0 (cmdline);
				cmdline = _tmp153_;
				_g_free0 (_tmp152_);
				_g_free0 (_tmp150_);
				_g_free0 (cc_option);
			}
		}
	}
	_tmp154_ = context;
	_tmp155_ = vala_code_context_get_verbose_mode (_tmp154_);
	_tmp156_ = _tmp155_;
	if (_tmp156_) {
		FILE* _tmp157_;
		const gchar* _tmp158_;
		_tmp157_ = stdout;
		_tmp158_ = cmdline;
		fprintf (_tmp157_, "%s\n", _tmp158_);
	}
	{
		gint exit_status = 0;
		const gchar* _tmp159_;
		gint _tmp160_ = 0;
		gint _tmp161_;
		_tmp159_ = cmdline;
		g_spawn_command_line_sync (_tmp159_, NULL, NULL, &_tmp160_, &_inner_error_);
		exit_status = _tmp160_;
		if (_inner_error_ != NULL) {
			if (_inner_error_->domain == G_SPAWN_ERROR) {
				goto __catch3_g_spawn_error;
			}
			_vala_iterable_unref0 (c_source_files);
			_vala_iterable_unref0 (source_files);
			_g_free0 (cmdline);
			_g_free0 (pkgflags);
			_g_free0 (pc);
			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
			g_clear_error (&_inner_error_);
			return;
		}
		_tmp161_ = exit_status;
		if (_tmp161_ != 0) {
			gint _tmp162_;
			gchar* _tmp163_ = NULL;
			gchar* _tmp164_;
			_tmp162_ = exit_status;
			_tmp163_ = g_strdup_printf ("cc exited with status %d", _tmp162_);
			_tmp164_ = _tmp163_;
			vala_report_error (NULL, _tmp164_);
			_g_free0 (_tmp164_);
		}
	}
	goto __finally3;
	__catch3_g_spawn_error:
	{
		GError* e = NULL;
		GError* _tmp165_;
		const gchar* _tmp166_;
		e = _inner_error_;
		_inner_error_ = NULL;
		_tmp165_ = e;
		_tmp166_ = _tmp165_->message;
		vala_report_error (NULL, _tmp166_);
		_g_error_free0 (e);
	}
	__finally3:
	if (_inner_error_ != NULL) {
		_vala_iterable_unref0 (c_source_files);
		_vala_iterable_unref0 (source_files);
		_g_free0 (cmdline);
		_g_free0 (pkgflags);
		_g_free0 (pc);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
		g_clear_error (&_inner_error_);
		return;
	}
	{
		ValaList* _tmp167_;
		ValaList* _tmp168_;
		ValaList* _file_list;
		ValaList* _tmp169_;
		gint _tmp170_;
		gint _tmp171_;
		gint _file_size;
		gint _file_index;
		_tmp167_ = source_files;
		_tmp168_ = _vala_iterable_ref0 (_tmp167_);
		_file_list = _tmp168_;
		_tmp169_ = _file_list;
		_tmp170_ = vala_collection_get_size ((ValaCollection*) _tmp169_);
		_tmp171_ = _tmp170_;
		_file_size = _tmp171_;
		_file_index = -1;
		while (TRUE) {
			gint _tmp172_;
			gint _tmp173_;
			gint _tmp174_;
			ValaList* _tmp175_;
			gint _tmp176_;
			gpointer _tmp177_ = NULL;
			ValaSourceFile* file;
			ValaSourceFile* _tmp178_;
			ValaSourceFileType _tmp179_;
			ValaSourceFileType _tmp180_;
			_tmp172_ = _file_index;
			_file_index = _tmp172_ + 1;
			_tmp173_ = _file_index;
			_tmp174_ = _file_size;
			if (!(_tmp173_ < _tmp174_)) {
				break;
			}
			_tmp175_ = _file_list;
			_tmp176_ = _file_index;
			_tmp177_ = vala_list_get (_tmp175_, _tmp176_);
			file = (ValaSourceFile*) _tmp177_;
			_tmp178_ = file;
			_tmp179_ = vala_source_file_get_file_type (_tmp178_);
			_tmp180_ = _tmp179_;
			if (_tmp180_ == VALA_SOURCE_FILE_TYPE_SOURCE) {
				ValaCodeContext* _tmp181_;
				gboolean _tmp182_;
				gboolean _tmp183_;
				_tmp181_ = context;
				_tmp182_ = vala_code_context_get_save_csources (_tmp181_);
				_tmp183_ = _tmp182_;
				if (!_tmp183_) {
					ValaSourceFile* _tmp184_;
					gchar* _tmp185_ = NULL;
					gchar* _tmp186_;
					_tmp184_ = file;
					_tmp185_ = vala_source_file_get_csource_filename (_tmp184_);
					_tmp186_ = _tmp185_;
					g_unlink (_tmp186_);
					_g_free0 (_tmp186_);
				}
			}
			_vala_source_file_unref0 (file);
		}
		_vala_iterable_unref0 (_file_list);
	}
	_vala_iterable_unref0 (c_source_files);
	_vala_iterable_unref0 (source_files);
	_g_free0 (cmdline);
	_g_free0 (pkgflags);
	_g_free0 (pc);
}
示例#9
0
static gboolean vala_unlock_statement_real_check (ValaCodeNode* base, ValaCodeContext* context) {
	ValaUnlockStatement * self;
	gboolean result = FALSE;
	gboolean _tmp0_;
	gboolean _tmp1_;
	ValaExpression* _tmp4_;
	ValaCodeContext* _tmp5_;
	gboolean _tmp6_ = FALSE;
	ValaExpression* _tmp7_;
	gboolean _tmp11_;
	ValaExpression* _tmp16_;
	ValaSymbol* _tmp17_;
	ValaSymbol* _tmp18_;
	ValaSymbol* _tmp19_;
	ValaSymbol* _tmp20_;
	ValaCodeContext* _tmp21_;
	ValaSemanticAnalyzer* _tmp22_;
	ValaSemanticAnalyzer* _tmp23_;
	ValaClass* _tmp24_;
	ValaClass* _tmp25_;
	ValaExpression* _tmp30_;
	ValaSymbol* _tmp31_;
	ValaSymbol* _tmp32_;
	gboolean _tmp33_;
	gboolean _tmp34_;
	self = (ValaUnlockStatement*) base;
	g_return_val_if_fail (context != NULL, FALSE);
	_tmp0_ = vala_code_node_get_checked ((ValaCodeNode*) self);
	_tmp1_ = _tmp0_;
	if (_tmp1_) {
		gboolean _tmp2_;
		gboolean _tmp3_;
		_tmp2_ = vala_code_node_get_error ((ValaCodeNode*) self);
		_tmp3_ = _tmp2_;
		result = !_tmp3_;
		return result;
	}
	vala_code_node_set_checked ((ValaCodeNode*) self, TRUE);
	_tmp4_ = self->priv->_resource;
	_tmp5_ = context;
	vala_code_node_check ((ValaCodeNode*) _tmp4_, _tmp5_);
	_tmp7_ = self->priv->_resource;
	if (VALA_IS_MEMBER_ACCESS (_tmp7_)) {
		ValaExpression* _tmp8_;
		ValaSymbol* _tmp9_;
		ValaSymbol* _tmp10_;
		_tmp8_ = self->priv->_resource;
		_tmp9_ = vala_expression_get_symbol_reference (_tmp8_);
		_tmp10_ = _tmp9_;
		_tmp6_ = VALA_IS_LOCKABLE (_tmp10_);
	} else {
		_tmp6_ = FALSE;
	}
	_tmp11_ = _tmp6_;
	if (!_tmp11_) {
		ValaExpression* _tmp12_;
		ValaExpression* _tmp13_;
		ValaSourceReference* _tmp14_;
		ValaSourceReference* _tmp15_;
		vala_code_node_set_error ((ValaCodeNode*) self, TRUE);
		_tmp12_ = self->priv->_resource;
		vala_code_node_set_error ((ValaCodeNode*) _tmp12_, TRUE);
		_tmp13_ = self->priv->_resource;
		_tmp14_ = vala_code_node_get_source_reference ((ValaCodeNode*) _tmp13_);
		_tmp15_ = _tmp14_;
		vala_report_error (_tmp15_, "Expression is either not a member access or does not denote a lockable" \
" member");
		result = FALSE;
		return result;
	}
	_tmp16_ = self->priv->_resource;
	_tmp17_ = vala_expression_get_symbol_reference (_tmp16_);
	_tmp18_ = _tmp17_;
	_tmp19_ = vala_symbol_get_parent_symbol (_tmp18_);
	_tmp20_ = _tmp19_;
	_tmp21_ = context;
	_tmp22_ = vala_code_context_get_analyzer (_tmp21_);
	_tmp23_ = _tmp22_;
	_tmp24_ = vala_semantic_analyzer_get_current_class (_tmp23_);
	_tmp25_ = _tmp24_;
	if (_tmp20_ != VALA_SYMBOL (_tmp25_)) {
		ValaExpression* _tmp26_;
		ValaExpression* _tmp27_;
		ValaSourceReference* _tmp28_;
		ValaSourceReference* _tmp29_;
		vala_code_node_set_error ((ValaCodeNode*) self, TRUE);
		_tmp26_ = self->priv->_resource;
		vala_code_node_set_error ((ValaCodeNode*) _tmp26_, TRUE);
		_tmp27_ = self->priv->_resource;
		_tmp28_ = vala_code_node_get_source_reference ((ValaCodeNode*) _tmp27_);
		_tmp29_ = _tmp28_;
		vala_report_error (_tmp29_, "Only members of the current class are lockable");
	}
	_tmp30_ = self->priv->_resource;
	_tmp31_ = vala_expression_get_symbol_reference (_tmp30_);
	_tmp32_ = _tmp31_;
	vala_lockable_set_lock_used (VALA_LOCKABLE (_tmp32_), TRUE);
	_tmp33_ = vala_code_node_get_error ((ValaCodeNode*) self);
	_tmp34_ = _tmp33_;
	result = !_tmp34_;
	return result;
}