Example #1
0
/* this method is mainly for testing in the Ruby specs*/
char* gtk_mate_matcher_test_rank (const char* selector_a, const char* selector_b, const char* scope_string) {
	OnigMatch* m1;
	OnigMatch* m2;
	OnigMatch* _tmp2;
	gboolean _tmp1;
	OnigMatch* _tmp0;
	OnigMatch* _tmp5;
	gboolean _tmp4;
	OnigMatch* _tmp3;
	gint r;
	g_return_val_if_fail (selector_a != NULL, NULL);
	g_return_val_if_fail (selector_b != NULL, NULL);
	g_return_val_if_fail (scope_string != NULL, NULL);
	m1 = NULL;
	m2 = NULL;
	_tmp2 = NULL;
	_tmp0 = NULL;
	_tmp1 = gtk_mate_matcher_match (selector_a, scope_string, &_tmp0);
	m1 = (_tmp2 = _tmp0, (m1 == NULL) ? NULL : (m1 = (g_object_unref (m1), NULL)), _tmp2);
	_tmp1;
	_tmp5 = NULL;
	_tmp3 = NULL;
	_tmp4 = gtk_mate_matcher_match (selector_b, scope_string, &_tmp3);
	m2 = (_tmp5 = _tmp3, (m2 == NULL) ? NULL : (m2 = (g_object_unref (m2), NULL)), _tmp5);
	_tmp4;
	r = gtk_mate_matcher_compare_match (scope_string, m1, m2);
	if (r > 0) {
		const char* _tmp6;
		char* _tmp7;
		_tmp6 = NULL;
		_tmp7 = NULL;
		return (_tmp7 = (_tmp6 = selector_a, (_tmp6 == NULL) ? NULL : g_strdup (_tmp6)), (m1 == NULL) ? NULL : (m1 = (g_object_unref (m1), NULL)), (m2 == NULL) ? NULL : (m2 = (g_object_unref (m2), NULL)), _tmp7);
	} else {
		if (r == 0) {
			char* _tmp8;
			char* _tmp9;
			char* _tmp10;
			_tmp8 = NULL;
			_tmp9 = NULL;
			_tmp10 = NULL;
			return (_tmp10 = (_tmp9 = g_strconcat (_tmp8 = g_strconcat (selector_a, " == ", NULL), selector_b, NULL), _tmp8 = (g_free (_tmp8), NULL), _tmp9), (m1 == NULL) ? NULL : (m1 = (g_object_unref (m1), NULL)), (m2 == NULL) ? NULL : (m2 = (g_object_unref (m2), NULL)), _tmp10);
		} else {
			const char* _tmp11;
			char* _tmp12;
			_tmp11 = NULL;
			_tmp12 = NULL;
			return (_tmp12 = (_tmp11 = selector_b, (_tmp11 == NULL) ? NULL : g_strdup (_tmp11)), (m1 == NULL) ? NULL : (m1 = (g_object_unref (m1), NULL)), (m2 == NULL) ? NULL : (m2 = (g_object_unref (m2), NULL)), _tmp12);
		}
	}
	(m1 == NULL) ? NULL : (m1 = (g_object_unref (m1), NULL));
	(m2 == NULL) ? NULL : (m2 = (g_object_unref (m2), NULL));
}
Example #2
0
/* this method is mainly for testing in the Ruby specs*/
char* gtk_mate_matcher_test_rank (const char* selector_a, const char* selector_b, const char* scope_string) {
	OnigMatch* m1;
	OnigMatch* m2;
	OnigMatch* _tmp2_;
	gboolean _tmp1_;
	OnigMatch* _tmp0_;
	OnigMatch* _tmp5_;
	gboolean _tmp4_;
	OnigMatch* _tmp3_;
	gint r;
	g_return_val_if_fail (selector_a != NULL, NULL);
	g_return_val_if_fail (selector_b != NULL, NULL);
	g_return_val_if_fail (scope_string != NULL, NULL);
	m1 = NULL;
	m2 = NULL;
	_tmp2_ = NULL;
	_tmp0_ = NULL;
	_tmp1_ = gtk_mate_matcher_match (selector_a, scope_string, &_tmp0_);
	m1 = (_tmp2_ = _tmp0_, (m1 == NULL) ? NULL : (m1 = (g_object_unref (m1), NULL)), _tmp2_);
	_tmp1_;
	_tmp5_ = NULL;
	_tmp3_ = NULL;
	_tmp4_ = gtk_mate_matcher_match (selector_b, scope_string, &_tmp3_);
	m2 = (_tmp5_ = _tmp3_, (m2 == NULL) ? NULL : (m2 = (g_object_unref (m2), NULL)), _tmp5_);
	_tmp4_;
	r = gtk_mate_matcher_compare_match (scope_string, m1, m2);
	if (r > 0) {
		const char* _tmp6_;
		char* _tmp7_;
		_tmp6_ = NULL;
		_tmp7_ = NULL;
		return (_tmp7_ = (_tmp6_ = selector_a, (_tmp6_ == NULL) ? NULL : g_strdup (_tmp6_)), (m1 == NULL) ? NULL : (m1 = (g_object_unref (m1), NULL)), (m2 == NULL) ? NULL : (m2 = (g_object_unref (m2), NULL)), _tmp7_);
	} else {
		if (r == 0) {
			char* _tmp8_;
			char* _tmp9_;
			char* _tmp10_;
			_tmp8_ = NULL;
			_tmp9_ = NULL;
			_tmp10_ = NULL;
			return (_tmp10_ = (_tmp9_ = g_strconcat (_tmp8_ = g_strconcat (selector_a, " == ", NULL), selector_b, NULL), _tmp8_ = (g_free (_tmp8_), NULL), _tmp9_), (m1 == NULL) ? NULL : (m1 = (g_object_unref (m1), NULL)), (m2 == NULL) ? NULL : (m2 = (g_object_unref (m2), NULL)), _tmp10_);
		} else {
			const char* _tmp11_;
			char* _tmp12_;
			_tmp11_ = NULL;
			_tmp12_ = NULL;
			return (_tmp12_ = (_tmp11_ = selector_b, (_tmp11_ == NULL) ? NULL : g_strdup (_tmp11_)), (m1 == NULL) ? NULL : (m1 = (g_object_unref (m1), NULL)), (m2 == NULL) ? NULL : (m2 = (g_object_unref (m2), NULL)), _tmp12_);
		}
	}
	(m1 == NULL) ? NULL : (m1 = (g_object_unref (m1), NULL));
	(m2 == NULL) ? NULL : (m2 = (g_object_unref (m2), NULL));
}
Example #3
0
OnigMatch* gtk_mate_matcher_get_match (const char* selector_string, const char* scope_string) {
	OnigMatch* m;
	OnigMatch* _tmp2;
	gboolean _tmp1;
	OnigMatch* _tmp0;
	g_return_val_if_fail (selector_string != NULL, NULL);
	g_return_val_if_fail (scope_string != NULL, NULL);
	m = NULL;
	_tmp2 = NULL;
	_tmp0 = NULL;
	_tmp1 = gtk_mate_matcher_match (selector_string, scope_string, &_tmp0);
	m = (_tmp2 = _tmp0, (m == NULL) ? NULL : (m = (g_object_unref (m), NULL)), _tmp2);
	_tmp1;
	/* stdout.printf("test_match('%s', '%s') == %d\n", selector_string, scope_string, result ? 1 : 0);*/
	return m;
}