Example #1
0
N_NIMCALL(Ropeobj161009*, HEX26_161436)(Ropeobj161009* a, Ropeobj161009* b) {
	Ropeobj161009* result;
	result = 0;
	{
		if (!(a == NIM_NIL)) goto LA3;
		result = b;
	}
	goto LA1;
	LA3: ;
	{
		if (!(b == NIM_NIL)) goto LA6;
		result = a;
	}
	goto LA1;
	LA6: ;
	{
		result = newrope_161056(NIM_NIL);
		(*result).length = (NI)((*a).length + (*b).length);
		asgnRefNoCycle((void**) (&(*result).left), a);
		asgnRefNoCycle((void**) (&(*result).right), b);
	}
	LA1: ;
	return result;
}
Example #2
0
N_NIMCALL(void, Setcc_70398)(NimStringDesc* Ccname_70400) {
NimStringDesc* LOC4;
NimStringDesc* LOC5;
NimStringDesc* LOC6;
NU8 I_70440;
NU8 Res_70442;
Ccompiler_70340 = Nametocc_70350(Ccname_70400);
if (!(Ccompiler_70340 == ((NU8) 0))) goto LA2;
Rawmessage_48045(((NU8) 46), Ccname_70400);
LA2: ;
LOC4 = 0;
LOC4 = rawNewString(Cc_70041[(Ccompiler_70340)-1].Name->Sup.len + 15);
appendString(LOC4, Cc_70041[(Ccompiler_70340)-1].Name);
appendString(LOC4, ((NimStringDesc*) &TMP195674));
asgnRefNoCycle((void**) &Compileoptions_70348, Getconfigvar_46135(LOC4));
LOC5 = 0;
LOC5 = rawNewString(Cc_70041[(Ccompiler_70340)-1].Name->Sup.len + 15);
appendString(LOC5, Cc_70041[(Ccompiler_70340)-1].Name);
appendString(LOC5, ((NimStringDesc*) &TMP195675));
asgnRefNoCycle((void**) &Linkoptions_70347, Getconfigvar_46135(LOC5));
LOC6 = 0;
LOC6 = rawNewString(Cc_70041[(Ccompiler_70340)-1].Name->Sup.len + 5);
appendString(LOC6, Cc_70041[(Ccompiler_70340)-1].Name);
appendString(LOC6, ((NimStringDesc*) &TMP195676));
asgnRefNoCycle((void**) &Ccompilerpath_70349, Getconfigvar_46135(LOC6));
I_70440 = 0;
Res_70442 = 0;
Res_70442 = ((NU8) 1);
while (1) {
if (!(Res_70442 <= ((NU8) 12))) goto LA7;
I_70440 = Res_70442;
Undefsymbol_64056(Cc_70041[(I_70440)-1].Name);
Res_70442 += 1;
} LA7: ;
Definesymbol_64053(Cc_70041[(Ccompiler_70340)-1].Name);
}
Example #3
0
N_NIMCALL(void, resetropecache_161111)(void) {
	{
		NI i_161223;
		NI res_161228;
		i_161223 = 0;
		res_161228 = ((NI) 0);
		{
			while (1) {
				if (!(res_161228 <= ((NI) 4095))) goto LA3;
				i_161223 = ((NI) (res_161228));
				asgnRefNoCycle((void**) (&cache_161106[(i_161223)- 0]), NIM_NIL);
				res_161228 += ((NI) 1);
			} LA3: ;
		}
	}
}
Example #4
0
N_NIMCALL(tpasscontext223003*, myopen_415114)(tsym172689* module) {
	tpasscontext223003* result;
	tgen415011* g;
	nimfr("myOpen", "depends.nim")
	result = 0;
	g = 0;
	nimln(51, "depends.nim");
	g = (tgen415011*) newObj((&NTI415013), sizeof(tgen415011));
	(*g).Sup.Sup.m_type = (&NTI415011);
	nimln(52, "depends.nim");
	asgnRefNoCycle((void**) &(*g).Module, module);
	nimln(53, "depends.nim");
	result = &g->Sup;
	popFrame();
	return result;
}N_NOINLINE(void, compilerdependsInit)(void) {
Example #5
0
N_NIMCALL(void, Definesymbol_64053)(NimStringDesc* Symbol_64055) {
TY54011* I_64069;
TY55548* Sym_64070;
I_64069 = 0;
I_64069 = Getident_54016(Symbol_64055);
Sym_64070 = 0;
Sym_64070 = Strtableget_60066(&Gsymbols_64001, I_64069);
if (!(Sym_64070 == NIM_NIL)) goto LA2;
Sym_64070 = (TY55548*) newObj(NTI55524, sizeof(TY55548));
objectInit(Sym_64070, NTI55548);
(*Sym_64070).Kind = ((NU8) 1);
asgnRefNoCycle((void**) &(*Sym_64070).Name, I_64069);
Strtableadd_60061(&Gsymbols_64001, Sym_64070);
LA2: ;
(*Sym_64070).Position = 1;
}
Example #6
0
N_NIMCALL(tpasscontext244003*, myopen_519128)(tsym185843* module) {
	tpasscontext244003* result;
	tgen519012* g;
	nimfr("myOpen", "depends.nim")
	result = 0;
	g = 0;
	nimln(51, "depends.nim");
	g = (tgen519012*) newObj((&NTI519014), sizeof(tgen519012));
	(*g).Sup.Sup.m_type = (&NTI519012);
	nimln(52, "depends.nim");
	asgnRefNoCycle((void**) &(*g).Module, module);
	nimln(53, "depends.nim");
	result = &g->Sup;
	popFrame();
	return result;
}
Example #7
0
N_NIMCALL(TY47008*, Torope_47046)(NimStringDesc* S_47048) {
TY47008* Result_47280;
Result_47280 = 0;
if (!((S_47048) && (S_47048)->Sup.len == 0)) goto LA2;
Result_47280 = NIM_NIL;
goto LA1;
LA2: ;
if (!NIM_TRUE) goto LA4;
Result_47280 = Insertincache_47201(S_47048, Cache_47123);
asgnRefNoCycle((void**) &Cache_47123, Result_47280);
goto LA1;
LA4: ;
Result_47280 = Newrope_47102(S_47048);
LA1: ;
return Result_47280;
}
Example #8
0
N_NIMCALL(void, resetropecache_172075)(void) {
	{
		NI i_172214;
		NI res_172219;
		i_172214 = 0;
		res_172219 = ((NI) 0);
		{
			while (1) {
				if (!(res_172219 <= ((NI) 4095))) goto LA3;
				i_172214 = ((NI) (res_172219));
				asgnRefNoCycle((void**) (&cache_172073[(i_172214)- 0]), NIM_NIL);
				res_172219 += ((NI) 1);
			} LA3: ;
		}
	}
}
Example #9
0
N_NIMCALL(Tpasscontext241005*, myopen_506131)(Tsym190843* module) {
	Tpasscontext241005* result;
	Tgen506016* g;
	nimfr("myOpen", "depends.nim")
	result = 0;
	g = 0;
	nimln(51, "depends.nim");
	g = (Tgen506016*) newObj((&NTI506018), sizeof(Tgen506016));
	(*g).Sup.Sup.m_type = (&NTI506016);
	nimln(52, "depends.nim");
	asgnRefNoCycle((void**) (&(*g).module), module);
	nimln(53, "depends.nim");
	result = &g->Sup;
	popFrame();
	return result;
}
Example #10
0
N_NIMCALL(tsym187843*, getsysmagic_242128)(NimStringDesc* name, NU16 m) {
	tsym187843* result;
	tidentiter196106 ti;
	tident167019* id;
	nimfr("getSysMagic", "magicsys.nim")
	result = 0;
	memset((void*)&ti, 0, sizeof(ti));
	nimln(48, "magicsys.nim");
	id = getident_167456(name);
	nimln(49, "magicsys.nim");
	if (!(((64 &(1<<(((*systemmodule_242017).Kind)&31)))!=0))) raiseFieldError(((NimStringDesc*) &TMP3108));
	result = initidentiter_196110(&ti, (*systemmodule_242017).kindU.S3.Tab, id);
	nimln(50, "magicsys.nim");
	while (1) {
		nimln(50, "magicsys.nim");
		nimln(50, "magicsys.nim");
		if (!!((result == NIM_NIL))) goto LA1;
		nimln(51, "magicsys.nim");
		{
			nimln(51, "magicsys.nim");
			if (!((*result).Kind == ((NU8) 23))) goto LA4;
			nimln(51, "magicsys.nim");
			loadstub_239239(result);
		}
		LA4: ;
		nimln(52, "magicsys.nim");
		{
			nimln(52, "magicsys.nim");
			if (!((*result).Magic == m)) goto LA8;
			nimln(52, "magicsys.nim");
			goto BeforeRet;
		}
		LA8: ;
		nimln(53, "magicsys.nim");
		if (!(((64 &(1<<(((*systemmodule_242017).Kind)&31)))!=0))) raiseFieldError(((NimStringDesc*) &TMP3108));
		result = nextidentiter_196117(&ti, (*systemmodule_242017).kindU.S3.Tab);
	} LA1: ;
	nimln(54, "magicsys.nim");
	rawmessage_165386(((NU16) 64), name);
	nimln(55, "magicsys.nim");
	result = newsym_188063(((NU8) 0), id, systemmodule_242017, (*systemmodule_242017).Info);
	nimln(56, "magicsys.nim");
	asgnRefNoCycle((void**) &(*result).Typ, newtype_188070(((NU8) 50), systemmodule_242017));
	BeforeRet: ;
	popFrame();
	return result;
}
Example #11
0
N_LIB_PRIVATE N_NIMCALL(void, liftLocals_DlEpkVXkhugkUzS9c9aUc8dg)(tyObject_TNode_bROa11lyF5vxEN9aYNbHmhw* n, NI i, tyObject_Ctx_A9b2QU9aJFjQJmSPHiXNYt7g* c) {
	tyObject_TNode_bROa11lyF5vxEN9aYNbHmhw* it;
	it = (*n)._Ukind.S6.sons->data[i];
	switch ((*it).kind) {
	case ((tyEnum_TNodeKind_G4E4Gxe7oI2Cm03rkiOzQw) 3):
	{
		{
			NIM_BOOL T4_;
			T4_ = (NIM_BOOL)0;
			T4_ = interestingVar_NYtvGlXG4WF2jKlY2I639awliftlocals((*it)._Ukind.S4.sym);
			if (!T4_) goto LA5_;
			asgnRefNoCycle((void**) (&(*n)._Ukind.S6.sons->data[i]), lookupOrAdd_6aiVjS5FtaP6i63MT9buQJw(c, (*it)._Ukind.S4.sym, (*it).info));
		}
		LA5_: ;
	}
	break;
	case ((tyEnum_TNodeKind_G4E4Gxe7oI2Cm03rkiOzQw) 51) ... ((tyEnum_TNodeKind_G4E4Gxe7oI2Cm03rkiOzQw) 52):
	case ((tyEnum_TNodeKind_G4E4Gxe7oI2Cm03rkiOzQw) 98):
	case ((tyEnum_TNodeKind_G4E4Gxe7oI2Cm03rkiOzQw) 79) ... ((tyEnum_TNodeKind_G4E4Gxe7oI2Cm03rkiOzQw) 81):
	case ((tyEnum_TNodeKind_G4E4Gxe7oI2Cm03rkiOzQw) 84):
	case ((tyEnum_TNodeKind_G4E4Gxe7oI2Cm03rkiOzQw) 159):
	{
	}
	break;
	default:
	{
		{
			NI i_2;
			NI colontmp_;
			NI i_3;
			i_2 = (NI)0;
			colontmp_ = (NI)0;
			colontmp_ = safeLen_CdME9baJhvveuPEDZE9bXoxArenderer(it);
			i_3 = ((NI) 0);
			{
				while (1) {
					if (!(i_3 < colontmp_)) goto LA11;
					i_2 = i_3;
					liftLocals_DlEpkVXkhugkUzS9c9aUc8dg(it, i_2, c);
					i_3 += ((NI) 1);
				} LA11: ;
			}
		}
	}
	break;
	}
}
Example #12
0
N_NIMCALL(void, enlarge_112876)(tstringtable112610* t) {
	tkeyvaluepairseq112608* n;
	NI TMP287;
	NI i_112907;
	NI HEX3Atmp_112921;
	NI res_112923;
	tkeyvaluepairseq112608* LOC6;
	nimfr("Enlarge", "strtabs.nim")
	n = 0;
	nimln(128, "strtabs.nim");
	nimln(128, "strtabs.nim");
	nimln(128, "strtabs.nim");
	TMP287 = mulInt((*t).Data->Sup.len, 2);
	n = (tkeyvaluepairseq112608*) newSeq((&NTI112608), (NI32)(TMP287));
	i_112907 = 0;
	HEX3Atmp_112921 = 0;
	nimln(129, "strtabs.nim");
	nimln(129, "strtabs.nim");
	HEX3Atmp_112921 = ((*t).Data->Sup.len-1);
	nimln(1301, "system.nim");
	res_112923 = 0;
	nimln(1302, "system.nim");
	while (1) {
		nimln(1302, "system.nim");
		if (!(res_112923 <= HEX3Atmp_112921)) goto LA1;
		nimln(1301, "system.nim");
		i_112907 = res_112923;
		nimln(130, "strtabs.nim");
		{
			nimln(130, "strtabs.nim");
			nimln(130, "strtabs.nim");
			if ((NU)(i_112907) >= (NU)((*t).Data->Sup.len)) raiseIndexError();
			if (!!((*t).Data->data[i_112907].Field0 == 0)) goto LA4;
			nimln(130, "strtabs.nim");
			if ((NU)(i_112907) >= (NU)((*t).Data->Sup.len)) raiseIndexError();
			if ((NU)(i_112907) >= (NU)((*t).Data->Sup.len)) raiseIndexError();
			rawinsert_112864(t, &n, (*t).Data->data[i_112907].Field0, (*t).Data->data[i_112907].Field1);		}		LA4: ;
		nimln(1304, "system.nim");
		res_112923 = addInt(res_112923, 1);
	} LA1: ;
	nimln(131, "strtabs.nim");
	LOC6 = 0;
	LOC6 = (*t).Data;
	asgnRefNoCycle((void**) &(*t).Data, n);
	n = LOC6;
	popFrame();
}
N_NIMCALL(void, resetcaches_528424_2036603609)(void) {
	inittypetables_528210_2036603609();
	{
		Ttypekind292244 i_528435_2036603609;
		NI res_528439_2036603609;
		i_528435_2036603609 = (Ttypekind292244)0;
		res_528439_2036603609 = ((NI) 0);
		{
			while (1) {
				if (!(res_528439_2036603609 <= ((NI) 62))) goto LA3;
				i_528435_2036603609 = ((Ttypekind292244) (res_528439_2036603609));
				asgnRefNoCycle((void**) (&gcanonicaltypes_528207_2036603609[(i_528435_2036603609)- 0]), NIM_NIL);
				res_528439_2036603609 += ((NI) 1);
			} LA3: ;
		}
	}
}
Example #14
0
N_NIMCALL(void, resetcaches_468424)(void) {
	inittypetables_468212();
	{
		NU8 i_468435;
		NI res_468439;
		i_468435 = 0;
		res_468439 = ((NI) 0);
		{
			while (1) {
				if (!(res_468439 <= ((NI) 61))) goto LA3;
				i_468435 = ((NU8) (res_468439));
				asgnRefNoCycle((void**) (&gcanonicaltypes_468209[(i_468435)- 0]), NIM_NIL);
				res_468439 += ((NI) 1);
			} LA3: ;
		}
	}
}
Example #15
0
N_NIMCALL(void, symtabreplaceraw_225414)(Tsymseq215792** data, Tsym215822* prevsym, Tsym215822* newsym) {
	NI h;
{	h = (NI)((*(*prevsym).name).h & ((*data) ? ((*data)->Sup.len-1) : -1));
	{
		while (1) {
			if (!!(((*data)->data[h] == NIM_NIL))) goto LA2;
			{
				if (!((*data)->data[h] == prevsym)) goto LA5;
				asgnRefNoCycle((void**) (&(*data)->data[h]), newsym);
				goto BeforeRet;
			}
			LA5: ;
			h = nexttry_222151(h, ((*data) ? ((*data)->Sup.len-1) : -1));
		} LA2: ;
	}
	}BeforeRet: ;
}
Example #16
0
N_NIMCALL(NI, Llreadfromstdin_71464)(TY71204* S_71466, void* Buf_71467, NI Buflen_71468) {
NI Result_71469;
NimStringDesc* Line_71470;
NI L_71471;
NIM_BOOL Intriplestring_71472;
NimStringDesc* LOC2;
NIM_BOOL LOC6;
NIM_BOOL LOC10;
Result_71469 = 0;
Line_71470 = 0;
L_71471 = 0;
Intriplestring_71472 = 0;
Intriplestring_71472 = NIM_FALSE;
asgnRefNoCycle((void**) &(*S_71466).S, copyString(((NimStringDesc*) &TMP191701)));
(*S_71466).Rd = 0;
while (1) {
LOC2 = 0;
if (!((*S_71466).S->Sup.len == 0)) goto LA4;
LOC2 = copyString(((NimStringDesc*) &TMP191702));
goto LA3;
LA4: ;
LOC2 = copyString(((NimStringDesc*) &TMP191703));
LA3: ;
Line_71470 = Readlinefromstdin_71365(LOC2);
L_71471 = Line_71470->Sup.len;
(*S_71466).S = resizeString((*S_71466).S, Line_71470->Sup.len + 0);
appendString((*S_71466).S, Line_71470);
(*S_71466).S = resizeString((*S_71466).S, 2);
appendString((*S_71466).S, ((NimStringDesc*) &TMP191704));
LOC6 = Contains_25284(Line_71470, ((NimStringDesc*) &TMP191705));
if (!LOC6) goto LA7;
Intriplestring_71472 = !(Intriplestring_71472);
LA7: ;
LOC10 = Continueline_71447(Line_71470, Intriplestring_71472);
if (!!(LOC10)) goto LA11;
goto LA1;
LA11: ;
} LA1: ;
(*S_71466).Lineoffset += 1;
Result_71469 = ((Buflen_71468 <= (NI64)((*S_71466).S->Sup.len - (*S_71466).Rd)) ? Buflen_71468 : (NI64)((*S_71466).S->Sup.len - (*S_71466).Rd));
if (!(0 < Result_71469)) goto LA14;
memcpy(Buf_71467, ((void*) (&(*S_71466).S->data[(*S_71466).Rd])), Result_71469);
(*S_71466).Rd += Result_71469;
LA14: ;
return Result_71469;
}
Example #17
0
N_NIMCALL(Tnode191813*, semnodekindconstraints_268679)(Tnode191813* p) {
	Tnode191813* result;
	result = 0;
	result = newnodei_193351(((NU8) 20), (*p).info);
	asgnRefNoCycle((void**) (&(*result).kindU.S3.strval), rawNewString(((NI) 10)));
	(*result).kindU.S3.strval = addChar((*result).kindU.S3.strval, 1);
	{
		NI LOC3;
		LOC3 = 0;
		LOC3 = len_192097(p);
		if (!(((NI) 2) <= LOC3)) goto LA4;
		{
			NI i_268831;
			NI HEX3Atmp_268839;
			NI LOC7;
			NI res_268842;
			i_268831 = 0;
			HEX3Atmp_268839 = 0;
			LOC7 = 0;
			LOC7 = len_192097(p);
			HEX3Atmp_268839 = (LOC7 - 1);
			res_268842 = ((NI) 1);
			{
				while (1) {
					if (!(res_268842 <= HEX3Atmp_268839)) goto LA9;
					i_268831 = res_268842;
					compileconstraints_268113((*p).kindU.S6.sons->data[i_268831], (&(*result).kindU.S3.strval));
					res_268842 += ((NI) 1);
				} LA9: ;
			}
		}
		{
			if (!(((NI) 63) < ((*result).kindU.S3.strval ? (*result).kindU.S3.strval->Sup.len : 0))) goto LA12;
			internalerror_165215((*p).info, ((NimStringDesc*) &TMP3128));
		}
		LA12: ;
	}
	goto LA1;
	LA4: ;
	{
		patternerror_268051(p);
	}
	LA1: ;
	add_268061((&(*result).kindU.S3.strval), ((NU8) 1));
	return result;
}
Example #18
0
N_NIMCALL(void, raiseoserror_115809)(NI32 errorcode) {
	Oserror3433* e;
	e = 0;
	e = (Oserror3433*) newObj((&NTI115812), sizeof(Oserror3433));
	(*e).Sup.Sup.Sup.m_type = (&NTI3433);
	(*e).errorcode = errorcode;
	asgnRefNoCycle((void**) (&(*e).Sup.Sup.message), oserrormsg_115620(errorcode));
	{
		NimStringDesc* LOC5;
		if (!(((*e).Sup.Sup.message) && ((*e).Sup.Sup.message)->Sup.len == 0)) goto LA3;
		LOC5 = 0;
		LOC5 = (*e).Sup.Sup.message; (*e).Sup.Sup.message = copyStringRC1(((NimStringDesc*) &TMP1143));
		if (LOC5) nimGCunrefNoCycle(LOC5);
	}
	LA3: ;
	raiseException((Exception*)e, "OSError");
}
Example #19
0
N_NIMCALL(Tnode_bROa11lyF5vxEN9aYNbHmhw*, semnodekindconstraints_oHADKQ703A40xFUb2Or4EQ)(Tnode_bROa11lyF5vxEN9aYNbHmhw* p0) {
	Tnode_bROa11lyF5vxEN9aYNbHmhw* result0;
	result0 = (Tnode_bROa11lyF5vxEN9aYNbHmhw*)0;
	result0 = newnodei_PIqgSH9b0m7nFpOyXf9cpz5w(((Tnodekind_G4E4Gxe7oI2Cm03rkiOzQw) 20), (*p0).info);
	asgnRefNoCycle((void**) (&(*result0).kindU.S3.strval), rawNewString(((NI) 10)));
	(*result0).kindU.S3.strval = addChar((*result0).kindU.S3.strval, 1);
	{
		NI LOC3;
		LOC3 = (NI)0;
		LOC3 = len_CdME9baJhvveuPEDZE9bXoxAlambdalifting(p0);
		if (!(((NI) 2) <= LOC3)) goto LA4;
		{
			NI i_dXblwP9c0fT57IJBT9cidd0w;
			NI HEX3Atmp_iqP0XjvVfdwlykC4jWWcWQ;
			NI LOC7;
			NI res_tvTr9cfrvhfw6gavuvsPeCg;
			i_dXblwP9c0fT57IJBT9cidd0w = (NI)0;
			HEX3Atmp_iqP0XjvVfdwlykC4jWWcWQ = (NI)0;
			LOC7 = (NI)0;
			LOC7 = len_CdME9baJhvveuPEDZE9bXoxAlambdalifting(p0);
			HEX3Atmp_iqP0XjvVfdwlykC4jWWcWQ = (LOC7 - 1);
			res_tvTr9cfrvhfw6gavuvsPeCg = ((NI) 1);
			{
				while (1) {
					if (!(res_tvTr9cfrvhfw6gavuvsPeCg <= HEX3Atmp_iqP0XjvVfdwlykC4jWWcWQ)) goto LA9;
					i_dXblwP9c0fT57IJBT9cidd0w = res_tvTr9cfrvhfw6gavuvsPeCg;
					compileconstraints_9bwUcgT2L3sSIVcH2QkZg2A((*p0).kindU.S6.sons->data[i_dXblwP9c0fT57IJBT9cidd0w], (&(*result0).kindU.S3.strval));
					res_tvTr9cfrvhfw6gavuvsPeCg += ((NI) 1);
				} LA9: ;
			}
		}
		{
			if (!(((NI) 63) < ((*result0).kindU.S3.strval ? (*result0).kindU.S3.strval->Sup.len : 0))) goto LA12;
			internalerror_MXmtqrCmYwtOPkDCFgUWKQ((*p0).info, ((NimStringDesc*) &T_kdeXVhLeMhTeIyOxnAjnxA_19));
		}
		LA12: ;
	}
	goto LA1;
	LA4: ;
	{
		patternerror_WCa9bfuEYPAnEySVcJ29aYHw(p0);
	}
	LA1: ;
	add_9b9cetGbqmZ2rntk8RrPpv0gparampatterns((&(*result0).kindU.S3.strval), ((Topcode_cKhgukabZvDBOVLlPOrptA) 1));
	return result0;
}
N_NIMCALL(void, symtabreplaceraw_301814_2984716966)(Tsymseq292804** data0, Tsym292834* prevsym0, Tsym292834* newsym0) {
	NI h0;
{	h0 = (NI)((*(*prevsym0).name).h & ((*data0) ? ((*data0)->Sup.len-1) : -1));
	{
		while (1) {
			if (!!(((*data0)->data[h0] == NIM_NIL))) goto LA2;
			{
				if (!((*data0)->data[h0] == prevsym0)) goto LA5;
				asgnRefNoCycle((void**) (&(*data0)->data[h0]), newsym0);
				goto BeforeRet;
			}
			LA5: ;
			h0 = nexttry_299130_2984716966(h0, ((*data0) ? ((*data0)->Sup.len-1) : -1));
		} LA2: ;
	}
	}BeforeRet: ;
}
Example #21
0
N_NIMCALL(void, symtabreplaceraw_203032)(Tsymseq191815** data, Tsym191843* prevsym, Tsym191843* newsym) {
	NI h;
{	h = (NI)((*(*prevsym).name).h & ((*data) ? ((*data)->Sup.len-1) : -1));
	{
		while (1) {
			if (!!(((*data)->data[h] == NIM_NIL))) goto LA2;
			{
				if (!((*data)->data[h] == prevsym)) goto LA5;
				asgnRefNoCycle((void**) (&(*data)->data[h]), newsym);
				goto BeforeRet;
			}
			LA5: ;
			h = nexttry_199256(h, ((*data) ? ((*data)->Sup.len-1) : -1));
		} LA2: ;
	}
	}BeforeRet: ;
}
Example #22
0
N_NIMCALL(Tnode215790*, semnodekindconstraints_287446)(Tnode215790* p) {
	Tnode215790* result;
	result = 0;
	result = newnodei_217248(((NU8) 20), (*p).info);
	asgnRefNoCycle((void**) (&(*result).kindU.S3.strval), rawNewString(((NI) 10)));
	(*result).kindU.S3.strval = addChar((*result).kindU.S3.strval, 1);
	{
		NI LOC3;
		LOC3 = 0;
		LOC3 = len_216059(p);
		if (!(((NI) 2) <= LOC3)) goto LA4;
		{
			NI i_287630;
			NI HEX3Atmp_287638;
			NI LOC7;
			NI res_287641;
			i_287630 = 0;
			HEX3Atmp_287638 = 0;
			LOC7 = 0;
			LOC7 = len_216059(p);
			HEX3Atmp_287638 = (LOC7 - 1);
			res_287641 = ((NI) 1);
			{
				while (1) {
					if (!(res_287641 <= HEX3Atmp_287638)) goto LA9;
					i_287630 = res_287641;
					compileconstraints_287074((*p).kindU.S6.sons->data[i_287630], (&(*result).kindU.S3.strval));
					res_287641 += ((NI) 1);
				} LA9: ;
			}
		}
		{
			if (!(((NI) 63) < ((*result).kindU.S3.strval ? (*result).kindU.S3.strval->Sup.len : 0))) goto LA12;
			internalerror_188100((*p).info, ((NimStringDesc*) &TMP3309));
		}
		LA12: ;
	}
	goto LA1;
	LA4: ;
	{
		patternerror_287030(p);
	}
	LA1: ;
	add_287034((&(*result).kindU.S3.strval), ((NU8) 1));
	return result;
}
Example #23
0
N_NIMCALL(tnode186813*, extractrange_221271)(NU8 k, tnode186813* n, NI a, NI b) {
	tnode186813* result;
	NI TMP2728;
	NI TMP2729;
	NI i_221288;
	NI HEX3Atmp_221317;
	NI TMP2730;
	NI res_221319;
	nimfr("extractRange", "trees.nim")
	result = 0;
	nimln(167, "trees.nim");
	nimln(167, "trees.nim");
	nimln(167, "trees.nim");
	TMP2728 = subInt(b, a);
	TMP2729 = addInt((NI32)(TMP2728), 1);
	result = newnodei_188803(k, (*n).Info, (NI32)(TMP2729));
	i_221288 = 0;
	HEX3Atmp_221317 = 0;
	nimln(168, "trees.nim");
	nimln(168, "trees.nim");
	TMP2730 = subInt(b, a);
	HEX3Atmp_221317 = (NI32)(TMP2730);
	nimln(1457, "system.nim");
	res_221319 = 0;
	nimln(1458, "system.nim");
	while (1) {
		NI TMP2731;
		nimln(1458, "system.nim");
		if (!(res_221319 <= HEX3Atmp_221317)) goto LA1;
		nimln(1457, "system.nim");
		i_221288 = res_221319;
		nimln(168, "trees.nim");
		if (((TMP2710[(*result).Kind/8] &(1<<((*result).Kind%8)))!=0)) raiseFieldError(((NimStringDesc*) &TMP2711));
		if ((NU)(i_221288) >= (NU)((*result).kindU.S6.Sons->Sup.len)) raiseIndexError();
		if (((TMP2710[(*n).Kind/8] &(1<<((*n).Kind%8)))!=0)) raiseFieldError(((NimStringDesc*) &TMP2711));
		nimln(168, "trees.nim");
		TMP2731 = addInt(i_221288, a);
		if ((NU)((NI32)(TMP2731)) >= (NU)((*n).kindU.S6.Sons->Sup.len)) raiseIndexError();
		asgnRefNoCycle((void**) &(*result).kindU.S6.Sons->data[i_221288], (*n).kindU.S6.Sons->data[(NI32)(TMP2731)]);
		nimln(1460, "system.nim");
		res_221319 = addInt(res_221319, 1);
	} LA1: ;
	popFrame();
	return result;
}
Example #24
0
N_NIMCALL(Tnode190813*, maptypetobracket_379094)(NimStringDesc* name, Ttype190849* t, Tlineinfo162338 info) {
	Tnode190813* result;
	Tnode190813* LOC1;
	result = 0;
	result = newnodeit_192807(((NU8) 42), info, t);
	LOC1 = 0;
	LOC1 = atomictypex_379072(name, t, info);
	add_191164(result, LOC1);
	{
		NI i_379119;
		NI HEX3Atmp_379136;
		NI LOC3;
		NI res_379139;
		i_379119 = 0;
		HEX3Atmp_379136 = 0;
		LOC3 = 0;
		LOC3 = len_193377(t);
		HEX3Atmp_379136 = (LOC3 - 1);
		res_379139 = ((NI) 0);
		{
			while (1) {
				if (!(res_379139 <= HEX3Atmp_379136)) goto LA5;
				i_379119 = res_379139;
				{
					Tnode190813* void_379132;
					if (!((*t).sons->data[i_379119] == NIM_NIL)) goto LA8;
					void_379132 = atomictypex_379072(((NimStringDesc*) &TMP2840), t, info);
					asgnRefNoCycle((void**) (&(*void_379132).typ), newtype_193144(((NU8) 3), (*t).owner));
					add_191164(result, void_379132);
				}
				goto LA6;
				LA8: ;
				{
					Tnode190813* LOC11;
					LOC11 = 0;
					LOC11 = maptypetoast_379086((*t).sons->data[i_379119], info, NIM_FALSE);
					add_191164(result, LOC11);
				}
				LA6: ;
				res_379139 += ((NI) 1);
			} LA5: ;
		}
	}
	return result;
}
Example #25
0
N_NIMCALL(Tpasscontext241005*, myopen_508068)(Tsym191843* module) {
	Tpasscontext241005* result;
	Tgen508010* g;
	Tdocumentor340007* d;
	NimStringDesc* LOC1;
	result = 0;
	g = 0;
	g = (Tgen508010*) newObj((&NTI508012), sizeof(Tgen508010));
	(*g).Sup.Sup.m_type = (&NTI508010);
	asgnRefNoCycle((void**) (&(*g).module), module);
	LOC1 = 0;
	LOC1 = tofilename_164271(((NI32) ((*module).position)));
	d = newdocumentor_340065(LOC1, gconfigvars_154231);
	(*d).Sup.hastoc = NIM_TRUE;
	asgnRef((void**) (&(*g).doc), d);
	result = &g->Sup;
	return result;
}
Example #26
0
N_NIMCALL(Tpasscontext263002*, myopen_517048)(Tsym216822* module) {
	Tpasscontext263002* result;
	Tgen517004* g;
	Tdocumentor361004* d;
	NimStringDesc* LOC1;
	result = 0;
	g = 0;
	g = (Tgen517004*) newObj((&NTI517006), sizeof(Tgen517004));
	(*g).Sup.Sup.m_type = (&NTI517004);
	asgnRefNoCycle((void**) (&(*g).module), module);
	LOC1 = 0;
	LOC1 = tofilename_185265(((NI32) ((*module).position)));
	d = newdocumentor_361041(LOC1, gconfigvars_163195);
	(*d).Sup.hastoc = NIM_TRUE;
	asgnRef((void**) (&(*g).doc), d);
	result = &g->Sup;
	return result;
}
Example #27
0
N_NIMCALL(void, raiseformatexception_113955)(NimStringDesc* s) {
    einvalidvalue1053* e;
    NimStringDesc* LOC1;
    nimfr("RaiseFormatException", "strtabs.nim")
    e = 0;
    nimln(145, "strtabs.nim");
    e = (einvalidvalue1053*) newObj((&NTI16601), sizeof(einvalidvalue1053));
    (*e).Sup.Sup.Sup.m_type = (&NTI1053);
    nimln(146, "strtabs.nim");
    nimln(146, "strtabs.nim");
    LOC1 = 0;
    LOC1 = rawNewString(s->Sup.len + 30);
    appendString(LOC1, ((NimStringDesc*) &TMP303));
    appendString(LOC1, s);
    asgnRefNoCycle((void**) &(*e).Sup.Sup.message, LOC1);
    nimln(147, "strtabs.nim");
    raiseException((E_Base*)e, "EInvalidValue");
    popFrame();
}
Example #28
0
N_NIMCALL(Tnode190813*, evalimportexcept_250857)(Tcontext243023* c, Tnode190813* n) {
	Tnode190813* result;
	Tsym190843* m;
	result = 0;
	result = n;
	checkminsonslen_244275(n, ((NI) 2));
	m = myimportmodule_250708(c, (*n).kindU.S6.sons->data[((NI) 0)]);
	{
		Intset187056 exceptset;
		if (!!((m == NIM_NIL))) goto LA3;
		asgnRefNoCycle((void**) (&(*n).kindU.S6.sons->data[((NI) 0)]), newsymnode_192325(m));
		adddecl_248611(c, m);
		memset((void*)(&exceptset), 0, sizeof(exceptset));
		chckNil((void*)(&exceptset));
		memset((void*)(&exceptset), 0, sizeof(exceptset));
		initintset_187927((&exceptset));
		{
			NI i_250890;
			NI HEX3Atmp_250895;
			NI LOC6;
			NI res_250898;
			i_250890 = 0;
			HEX3Atmp_250895 = 0;
			LOC6 = 0;
			LOC6 = sonslen_193403(n);
			HEX3Atmp_250895 = (NI)(LOC6 - ((NI) 1));
			res_250898 = ((NI) 1);
			{
				while (1) {
					Tident166021* ident;
					if (!(res_250898 <= HEX3Atmp_250895)) goto LA8;
					i_250890 = res_250898;
					ident = considerquotedident_248010((*n).kindU.S6.sons->data[i_250890]);
					incl_187856((&exceptset), (*ident).Sup.id);
					res_250898 += ((NI) 1);
				} LA8: ;
			}
		}
		importallsymbolsexcept_250315(c, m, exceptset);
	}
	LA3: ;
	return result;
}
Example #29
0
N_NIMCALL(void, putenv_121669)(NimStringDesc* key, NimStringDesc* val) {
	NI indx;
	indx = findenvvar_121605(key);
	{
		NimStringDesc* LOC5;
		if (!(((NI) 0) <= indx)) goto LA3;
		LOC5 = 0;
		LOC5 = rawNewString(key->Sup.len + val->Sup.len + 1);
appendString(LOC5, key);
appendChar(LOC5, 61);
appendString(LOC5, val);
		asgnRefNoCycle((void**) (&environment_121009->data[indx]), LOC5);
	}
	goto LA1;
	LA3: ;
	{
		NimStringDesc* LOC7;
		NimStringDesc* LOC8;
		LOC7 = 0;
		LOC7 = rawNewString(key->Sup.len + val->Sup.len + 1);
appendString(LOC7, key);
appendChar(LOC7, 61);
appendString(LOC7, val);
		environment_121009 = (TY121008*) incrSeq(&(environment_121009)->Sup, sizeof(NimStringDesc*));
		LOC8 = 0;
		LOC8 = environment_121009->data[environment_121009->Sup.len-1]; environment_121009->data[environment_121009->Sup.len-1] = copyStringRC1(LOC7);
		if (LOC8) nimGCunrefNoCycle(LOC8);
		indx = (environment_121009 ? (environment_121009->Sup.len-1) : -1);
	}
	LA1: ;
	{
		int LOC11;
		NI32 LOC14;
		LOC11 = 0;
		LOC11 = putenv(environment_121009->data[indx]->data);
		if (!!((LOC11 == ((NI32) 0)))) goto LA12;
		LOC14 = 0;
		LOC14 = oslasterror_115833();
		raiseoserror_115809(LOC14);
	}
	LA12: ;
}
Example #30
0
N_NIMCALL(trope144007*, insertincache_144262)(NimStringDesc* s) {
    trope144007* result;
    NI h;
    NI LOC1;
    nimfr("insertInCache", "ropes.nim")
    result = 0;
    nimln(147, "ropes.nim");
    gcachetries_144256 = addInt(gcachetries_144256, 1);
    nimln(148, "ropes.nim");
    nimln(148, "ropes.nim");
    nimln(148, "ropes.nim");
    LOC1 = 0;
    LOC1 = hash_118827(s);
    h = (NI)(LOC1 & 4095);
    nimln(149, "ropes.nim");
    result = cache_144189[(h)- 0];
    nimln(150, "ropes.nim");
    {
        NIM_BOOL LOC4;
        nimln(150, "ropes.nim");
        LOC4 = 0;
        nimln(150, "ropes.nim");
        LOC4 = result == 0;
        if (LOC4) goto LA5;
        nimln(150, "ropes.nim");
        nimln(150, "ropes.nim");
        LOC4 = !(eqStrings((*result).Data, s));
LA5:
        ;
        if (!LOC4) goto LA6;
        nimln(151, "ropes.nim");
        gcachemisses_144258 = addInt(gcachemisses_144258, 1);
        nimln(152, "ropes.nim");
        result = newrope_144135(s);
        nimln(153, "ropes.nim");
        asgnRefNoCycle((void**) &cache_144189[(h)- 0], result);
    }
LA6:
    ;
    popFrame();
    return result;
}