N_NIMCALL(NimStringDesc*, mangle_528847_2036603609)(NimStringDesc* name0) {
	NimStringDesc* result0;
	result0 = (NimStringDesc*)0;
	result0 = rawNewString(((NI) ((name0 ? name0->Sup.len : 0))));
	switch (((NU8)(name0->data[((NI) 0)]))) {
	case 65 ... 90:
	case 97 ... 122:
	{
		result0 = addChar(result0, name0->data[((NI) 0)]);
	}
	break;
	case 48 ... 57:
	{
		NimStringDesc* LOC3;
		LOC3 = (NimStringDesc*)0;
		LOC3 = rawNewString(2);
appendString(LOC3, ((NimStringDesc*) &T2036603609_4));
appendChar(LOC3, name0->data[((NI) 0)]);
		result0 = resizeString(result0, LOC3->Sup.len + 0);
appendString(result0, LOC3);
	}
	break;
	default:
	{
		NimStringDesc* LOC5;
		NimStringDesc* LOC6;
		LOC5 = (NimStringDesc*)0;
		LOC6 = (NimStringDesc*)0;
		LOC6 = nsuToHex(((NI64) (((NU8)(name0->data[((NI) 0)])))), ((NI) 2));
		LOC5 = rawNewString(LOC6->Sup.len + 3);
appendString(LOC5, ((NimStringDesc*) &T2036603609_5));
appendString(LOC5, LOC6);
		result0 = LOC5;
	}
	break;
	}
	{
		NI i_528868_2036603609;
		NI HEX3Atmp_528879_2036603609;
		NI res_528882_2036603609;
		i_528868_2036603609 = (NI)0;
		HEX3Atmp_528879_2036603609 = (NI)0;
		HEX3Atmp_528879_2036603609 = (NI)((name0 ? name0->Sup.len : 0) - ((NI) 1));
		res_528882_2036603609 = ((NI) 1);
		{
			while (1) {
				NIM_CHAR c0;
				if (!(res_528882_2036603609 <= HEX3Atmp_528879_2036603609)) goto LA9;
				i_528868_2036603609 = res_528882_2036603609;
				c0 = name0->data[i_528868_2036603609];
				switch (((NU8)(c0))) {
				case 65 ... 90:
				{
					NIM_CHAR LOC11;
					LOC11 = (NIM_CHAR)0;
					LOC11 = nsuToLowerAsciiChar(c0);
					result0 = addChar(result0, LOC11);
				}
				break;
				case 95:
				{
				}
				break;
				case 97 ... 122:
				case 48 ... 57:
				{
					result0 = addChar(result0, c0);
				}
				break;
				default:
				{
					NimStringDesc* LOC15;
					NimStringDesc* LOC16;
					LOC15 = (NimStringDesc*)0;
					LOC16 = (NimStringDesc*)0;
					LOC16 = nsuToHex(((NI64) (((NU8)(c0)))), ((NI) 2));
					LOC15 = rawNewString(LOC16->Sup.len + 3);
appendString(LOC15, ((NimStringDesc*) &T2036603609_5));
appendString(LOC15, LOC16);
					result0 = resizeString(result0, LOC15->Sup.len + 0);
appendString(result0, LOC15);
				}
				break;
				}
				res_528882_2036603609 += ((NI) 1);
			} LA9: ;
		}
	}
	return result0;
}
Beispiel #2
0
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, beautifyName_fOdwioWHjTwKHWAVS9bR9cng)(NimStringDesc* s, tyEnum_TSymKind_cNCW9acsSznmEccl1fgQwkw k) {
	NimStringDesc* result;
	NIM_BOOL allUpper;
	NI i;
{	result = (NimStringDesc*)0;
	allUpper = allCharsInSet_wVfr4F6j4mVzI8ggLoMVdw(s, TM_NvI37FoCN5uTD3k9bAqbGMA_2);
	{
		NIM_BOOL T3_;
		T3_ = (NIM_BOOL)0;
		T3_ = allUpper;
		if (!(T3_)) goto LA4_;
		T3_ = ((1049728 &(1U<<((NU)(k)&31U)))!=0);
		LA4_: ;
		if (!T3_) goto LA5_;
		result = copyString(s);
		goto BeforeRet_;
	}
	LA5_: ;
	result = rawNewString(((NI) ((s ? s->Sup.len : 0))));
	i = ((NI) 0);
	switch (k) {
	case ((tyEnum_TSymKind_cNCW9acsSznmEccl1fgQwkw) 7):
	case ((tyEnum_TSymKind_cNCW9acsSznmEccl1fgQwkw) 4):
	{
		{
			NIM_BOOL T10_;
			T10_ = (NIM_BOOL)0;
			T10_ = eqtilde__5yoNqXoYehBJvvfaWrX6Rg(s, TM_NvI37FoCN5uTD3k9bAqbGMA_3, 33);
			if (!T10_) goto LA11_;
			result = addChar(result, s->data[i]);
		}
		goto LA8_;
		LA11_: ;
		{
			NIM_CHAR T14_;
			T14_ = (NIM_CHAR)0;
			T14_ = nsuToUpperAsciiChar(s->data[i]);
			result = addChar(result, T14_);
		}
		LA8_: ;
	}
	break;
	case ((tyEnum_TSymKind_cNCW9acsSznmEccl1fgQwkw) 10):
	case ((tyEnum_TSymKind_cNCW9acsSznmEccl1fgQwkw) 20):
	{
		result = addChar(result, s->data[((NI) 0)]);
	}
	break;
	default:
	{
		{
			NIM_BOOL T19_;
			T19_ = (NIM_BOOL)0;
			T19_ = ((s ? s->Sup.len : 0) == ((NI) 1));
			if (!(T19_)) goto LA20_;
			T19_ = ((NU8)(s->data[((NI) 0)]) == (NU8)(76));
			LA20_: ;
			if (!T19_) goto LA21_;
			result = addChar(result, 76);
		}
		goto LA17_;
		LA21_: ;
		{
			NIM_BOOL T24_;
			T24_ = (NIM_BOOL)0;
			T24_ = contains_6e5MGL10HDAJ205lBYpWxw(s, 95);
			if (!T24_) goto LA25_;
			result = addChar(result, s->data[i]);
		}
		goto LA17_;
		LA25_: ;
		{
			NIM_CHAR T28_;
			T28_ = (NIM_CHAR)0;
			T28_ = nsuToLowerAsciiChar(s->data[((NI) 0)]);
			result = addChar(result, T28_);
		}
		LA17_: ;
	}
	break;
	}
	i += ((NI) 1);
	{
		while (1) {
			if (!(i < (s ? s->Sup.len : 0))) goto LA30;
			{
				if (!((NU8)(s->data[i]) == (NU8)(95))) goto LA33_;
				{
					NIM_BOOL T37_;
					T37_ = (NIM_BOOL)0;
					T37_ = (((NI) 0) < i);
					if (!(T37_)) goto LA38_;
					T37_ = (((NU8)(s->data[(NI)(i - ((NI) 1))])) >= ((NU8)(65)) && ((NU8)(s->data[(NI)(i - ((NI) 1))])) <= ((NU8)(90)));
					LA38_: ;
					if (!T37_) goto LA39_;
					result = addChar(result, 95);
					i += ((NI) 1);
					result = addChar(result, s->data[i]);
				}
				goto LA35_;
				LA39_: ;
				{
					NIM_CHAR T42_;
					i += ((NI) 1);
					T42_ = (NIM_CHAR)0;
					T42_ = nsuToUpperAsciiChar(s->data[i]);
					result = addChar(result, T42_);
				}
				LA35_: ;
			}
			goto LA31_;
			LA33_: ;
			{
				NIM_CHAR T46_;
				if (!allUpper) goto LA44_;
				T46_ = (NIM_CHAR)0;
				T46_ = nsuToLowerAsciiChar(s->data[i]);
				result = addChar(result, T46_);
			}
			goto LA31_;
			LA44_: ;
			{
				result = addChar(result, s->data[i]);
			}
			LA31_: ;
			i += ((NI) 1);
		} LA30: ;
	}
	}BeforeRet_: ;
	return result;
}