コード例 #1
0
ファイル: stdlib_tables.c プロジェクト: jlp765/csources
N_NIMCALL(void, HEX5BHEX5DHEX3D_316072)(Table313411* t, Tindexentry313398* key, TY315708* val) {
    NI hc;
    NI index;
    hc = 0;
    index = rawget_315294((*t), key, (&hc));
    {
        if (!(((NI) 0) <= index)) goto LA3;
        genericSeqAssign((&(*t).data->data[index].Field2), val, (&NTI315708));
    }
    goto LA1;
LA3:
    ;
    {
        {
            NIM_BOOL LOC8;
            LOC8 = 0;
            LOC8 = mustrehash_157313(((*t).data ? (*t).data->Sup.len : 0), (*t).counter);
            if (!LOC8) goto LA9;
            enlarge_316109(t);
            index = rawgetknownhc_316163((*t), key, hc);
        }
LA9:
        ;
        index = (NI)(((NI) -1) - index);
        rawinsert_316198(t, (&(*t).data), key, val, hc, index);
        (*t).counter += ((NI) 1);
    }
LA1:
    ;
}
コード例 #2
0
N_NIMCALL(void, rawinsert_222250)(ttable221059* t, tkeyvaluepairseq221062** data, tcall221009 key, NU8 val) {
	NI h;
	NI LOC1;
	nimfr("RawInsert", "tables.nim")
	nimln(81, "tables.nim");
	nimln(81, "tables.nim");
	nimln(81, "tables.nim");
	LOC1 = 0;
	LOC1 = hash_221214(key);
	nimln(81, "tables.nim");
	h = (NI)(LOC1 & ((*data)->Sup.len-1));
	nimln(82, "tables.nim");
	while (1) {
		nimln(82, "tables.nim");
		if ((NU)(h) >= (NU)((*data)->Sup.len)) raiseIndexError();
		if (!((*data)->data[h].Field0 == ((NU8) 1))) goto LA2;
		nimln(83, "tables.nim");
		nimln(83, "tables.nim");
		h = nexttry_118405(h, ((*data)->Sup.len-1));
	} LA2: ;
	nimln(84, "tables.nim");
	if ((NU)(h) >= (NU)((*data)->Sup.len)) raiseIndexError();
	asgnRefNoCycle((void**) &(*data)->data[h].Field1.Callee, key.Callee);
	genericSeqAssign(&(*data)->data[h].Field1.Args, key.Args, (&NTI221020));
	nimln(85, "tables.nim");
	if ((NU)(h) >= (NU)((*data)->Sup.len)) raiseIndexError();
	(*data)->data[h].Field2 = val;
	nimln(86, "tables.nim");
	if ((NU)(h) >= (NU)((*data)->Sup.len)) raiseIndexError();
	(*data)->data[h].Field0 = ((NU8) 1);
	popFrame();
}
コード例 #3
0
ファイル: compiler_cgmeth.c プロジェクト: apense/csources
N_NIMCALL(void, methoddef_355636)(Tsym191843* s, NIM_BOOL fromcache) {
	NI L;
	TY355243 LOC10;
	TY244447 LOC11;
{	L = (gmethods_355264 ? gmethods_355264->Sup.len : 0);
	{
		NI i_355661;
		NI HEX3Atmp_355831;
		NI res_355834;
		i_355661 = 0;
		HEX3Atmp_355831 = 0;
		HEX3Atmp_355831 = (NI)(L - ((NI) 1));
		res_355834 = ((NI) 0);
		{
			while (1) {
				Tsym191843* disp;
				if (!(res_355834 <= HEX3Atmp_355831)) goto LA3;
				i_355661 = res_355834;
				disp = gmethods_355264->data[i_355661].Field1;
				{
					NIM_BOOL LOC6;
					Tnode191813* LOC9;
					LOC6 = 0;
					LOC6 = samemethodbucket_355269(disp, s);
					if (!LOC6) goto LA7;
					gmethods_355264->data[i_355661].Field0 = (Tsymseq191815*) incrSeq(&(gmethods_355264->data[i_355661].Field0)->Sup, sizeof(Tsym191843*));
					asgnRefNoCycle((void**) (&gmethods_355264->data[i_355661].Field0->data[gmethods_355264->data[i_355661].Field0->Sup.len-1]), s);
					LOC9 = 0;
					LOC9 = lastson_194431((*disp).ast);
					attachdispatcher_355368(s, LOC9);
					fixupdispatcher_355484(s, disp);
					checkmethodeffects_329189(disp, s);
					goto BeforeRet;
				}
				LA7: ;
				res_355834 += ((NI) 1);
			} LA3: ;
		}
	}
	memset((void*)(&LOC10), 0, sizeof(LOC10));
	LOC10.Field0 = (Tsymseq191815*) newSeq((&NTI191815), 1);
	memset((void*)LOC11, 0, sizeof(LOC11));
	LOC11[0] = s;
	asgnRefNoCycle((void**) (&LOC10.Field0->data[0]), LOC11[0]);
	LOC10.Field1 = createdispatcher_355409(s);
	gmethods_355264 = (TY355242*) incrSeq(&(gmethods_355264)->Sup, sizeof(TY355243));
	genericSeqAssign((&gmethods_355264->data[gmethods_355264->Sup.len-1].Field0), LOC10.Field0, (&NTI191815));
	asgnRefNoCycle((void**) (&gmethods_355264->data[gmethods_355264->Sup.len-1].Field1), LOC10.Field1);
	{
		if (!fromcache) goto LA14;
		internalerror_165215((*s).info, ((NimStringDesc*) &TMP3276));
	}
	LA14: ;
	}BeforeRet: ;
}
コード例 #4
0
ファイル: stdlib_tables.c プロジェクト: jlp765/csources
N_NIMCALL(TY315708*, HEX5BHEX5D_315282)(Table313411 t, Tindexentry313398* key) {
    TY315708* result;
    NI hc;
    NI index;
    result = 0;
    hc = 0;
    index = rawget_315294(t, key, (&hc));
    {
        if (!(((NI) 0) <= index)) goto LA3;
        genericSeqAssign((&result), t.data->data[index].Field2, (&NTI315708));
    }
LA3:
    ;
    return result;
}
コード例 #5
0
ファイル: compiler_patterns.c プロジェクト: jlp765/csources
N_NIMCALL(NIM_BOOL, matchrange_401043)(Tpatterncontext400013* c, Tnode191813* p, Tnode191813* n, NI i) {
	NIM_BOOL result;
{	result = 0;
	{
		NI j_401069;
		NI HEX3Atmp_401081;
		NI LOC2;
		NI res_401084;
		j_401069 = 0;
		HEX3Atmp_401081 = 0;
		LOC2 = 0;
		LOC2 = len_192097(p);
		HEX3Atmp_401081 = (LOC2 - 1);
		res_401084 = ((NI) 0);
		{
			while (1) {
				if (!(res_401084 <= HEX3Atmp_401081)) goto LA4;
				j_401069 = res_401084;
				{
					NIM_BOOL LOC7;
					LOC7 = 0;
					LOC7 = matches_400075(c, (*p).kindU.S6.sons->data[j_401069], (*n).kindU.S6.sons->data[(NI)(i + j_401069)]);
					if (!!(LOC7)) goto LA8;
					{
						if (!!((*c).mapping == 0)) goto LA12;
						genericSeqAssign((&(*c).mapping), NIM_NIL, (&NTI191807));
					}
					LA12: ;
					result = NIM_FALSE;
					goto BeforeRet;
				}
				LA8: ;
				res_401084 += ((NI) 1);
			} LA4: ;
		}
	}
	result = NIM_TRUE;
	}BeforeRet: ;
	return result;
}
コード例 #6
0
ファイル: stdlib_tables.c プロジェクト: jlp765/csources
N_NIMCALL(void, rawinsert_316198)(Table313411* t, Keyvaluepairseq313414** data, Tindexentry313398* key, TY315708* val, NI hc, NI h) {
    NimStringDesc* LOC1;
    NimStringDesc* LOC2;
    NimStringDesc* LOC3;
    NimStringDesc* LOC4;
    LOC1 = 0;
    LOC1 = (*data)->data[h].Field1.keyword;
    (*data)->data[h].Field1.keyword = copyStringRC1((*key).keyword);
    if (LOC1) nimGCunrefNoCycle(LOC1);
    LOC2 = 0;
    LOC2 = (*data)->data[h].Field1.link;
    (*data)->data[h].Field1.link = copyStringRC1((*key).link);
    if (LOC2) nimGCunrefNoCycle(LOC2);
    LOC3 = 0;
    LOC3 = (*data)->data[h].Field1.linktitle;
    (*data)->data[h].Field1.linktitle = copyStringRC1((*key).linktitle);
    if (LOC3) nimGCunrefNoCycle(LOC3);
    LOC4 = 0;
    LOC4 = (*data)->data[h].Field1.linkdesc;
    (*data)->data[h].Field1.linkdesc = copyStringRC1((*key).linkdesc);
    if (LOC4) nimGCunrefNoCycle(LOC4);
    genericSeqAssign((&(*data)->data[h].Field2), val, (&NTI315708));
    (*data)->data[h].Field0 = hc;
}
コード例 #7
0
N_NIMCALL(void, methoddef_433628_3853300031)(Tsym294834* s0, NIM_BOOL fromcache0) {
	NI L0;
	Tsym294834* witness0;
	TY433227 LOC19;
	TY346318 LOC20;
{	L0 = (gmethods_433246_3853300031 ? gmethods_433246_3853300031->Sup.len : 0);
	witness0 = (Tsym294834*)0;
	{
		NI i_433653_3853300031;
		NI HEX3Atmp_433889_3853300031;
		NI res_433892_3853300031;
		i_433653_3853300031 = (NI)0;
		HEX3Atmp_433889_3853300031 = (NI)0;
		HEX3Atmp_433889_3853300031 = (NI)(L0 - ((NI) 1));
		res_433892_3853300031 = ((NI) 0);
		{
			while (1) {
				Tsym294834* disp0;
				Methodresult433249 LOC4;
				if (!(res_433892_3853300031 <= HEX3Atmp_433889_3853300031)) goto LA3;
				i_433653_3853300031 = res_433892_3853300031;
				disp0 = gmethods_433246_3853300031->data[i_433653_3853300031].Field1;
				LOC4 = (Methodresult433249)0;
				LOC4 = samemethodbucket_433253_3853300031(disp0, s0);
				switch (LOC4) {
				case ((Methodresult433249) 2):
				{
					Tnode294802* LOC6;
					gmethods_433246_3853300031->data[i_433653_3853300031].Field0 = (Tsymseq294804*) incrSeqV2(&(gmethods_433246_3853300031->data[i_433653_3853300031].Field0)->Sup, sizeof(Tsym294834*));
					asgnRefNoCycle((void**) (&gmethods_433246_3853300031->data[i_433653_3853300031].Field0->data[gmethods_433246_3853300031->data[i_433653_3853300031].Field0->Sup.len]), s0);
					++gmethods_433246_3853300031->data[i_433653_3853300031].Field0->Sup.len;
					LOC6 = (Tnode294802*)0;
					LOC6 = lastson_297364_850551059((*disp0).ast);
					attachdispatcher_433362_3853300031(s0, LOC6);
					fixupdispatcher_433466_3853300031(s0, disp0);
					checkmethodeffects_405033_422813333(disp0, s0);
					{
						NIM_BOOL LOC9;
						LOC9 = (NIM_BOOL)0;
						LOC9 = (((*s0).flags &(1U<<((NU)(((Tsymflag294184) 18))&31U)))!=0);
						if (!(LOC9)) goto LA10;
						LOC9 = !((gmethods_433246_3853300031->data[i_433653_3853300031].Field0->data[((NI) 0)] == s0));
						LA10: ;
						if (!LOC9) goto LA11;
						localerror_198085_155036129((*s0).info, ((NimStringDesc*) &T3853300031_6));
					}
					LA11: ;
					goto BeforeRet;
				}
				break;
				case ((Methodresult433249) 0):
				{
				}
				break;
				case ((Methodresult433249) 1):
				{
					{
						if (!witness0 == 0) goto LA17;
						witness0 = gmethods_433246_3853300031->data[i_433653_3853300031].Field0->data[((NI) 0)];
					}
					LA17: ;
				}
				break;
				}
				res_433892_3853300031 += ((NI) 1);
			} LA3: ;
		}
	}
	memset((void*)(&LOC19), 0, sizeof(LOC19));
	LOC19.Field0 = (Tsymseq294804*) newSeq((&NTI294804), 1);
	memset((void*)LOC20, 0, sizeof(LOC20));
	LOC20[0] = s0;
	asgnRefNoCycle((void**) (&LOC19.Field0->data[0]), LOC20[0]);
	LOC19.Field1 = createdispatcher_433397_3853300031(s0);
	gmethods_433246_3853300031 = (TY433226*) incrSeqV2(&(gmethods_433246_3853300031)->Sup, sizeof(TY433227));
	genericSeqAssign((&gmethods_433246_3853300031->data[gmethods_433246_3853300031->Sup.len].Field0), LOC19.Field0, (&NTI294804));
	asgnRefNoCycle((void**) (&gmethods_433246_3853300031->data[gmethods_433246_3853300031->Sup.len].Field1), LOC19.Field1);
	++gmethods_433246_3853300031->Sup.len;
	{
		if (!fromcache0) goto LA23;
		internalerror_198100_155036129((*s0).info, ((NimStringDesc*) &T3853300031_7));
	}
	LA23: ;
	{
		NimStringDesc* LOC29;
		NimStringDesc* LOC30;
		if (!!((witness0 == NIM_NIL))) goto LA27;
		LOC29 = (NimStringDesc*)0;
		LOC30 = (NimStringDesc*)0;
		LOC30 = HEX24_194431_155036129((*witness0).info);
		LOC29 = rawNewString((*(*s0).name).s->Sup.len + LOC30->Sup.len + 68);
appendString(LOC29, ((NimStringDesc*) &T3853300031_8));
appendString(LOC29, (*(*s0).name).s);
appendString(LOC29, ((NimStringDesc*) &T3853300031_9));
appendString(LOC29, LOC30);
		localerror_198085_155036129((*s0).info, LOC29);
	}
	goto LA25;
	LA27: ;
	{
		if (!!((((*s0).flags &(1U<<((NU)(((Tsymflag294184) 18))&31U)))!=0))) goto LA32;
		message_198095_155036129((*s0).info, ((Tmsgkind193002) 252), ((NimStringDesc*) &T3853300031_10));
	}
	goto LA25;
	LA32: ;
	LA25: ;
	}BeforeRet: ;
}
コード例 #8
0
ファイル: brainfuck.c プロジェクト: Kozzi11/Trash
N_NIMCALL(void, newtape_136015)(tape136008* Result) {
	(*Result).Pos = 0;
	genericSeqAssign((&(*Result).Tape), TMP23, (&NTI136010));
}