Exemplo n.º 1
0
N_NIMCALL(void, processimplicits_240621)(TY121008* implicits, NU8 nodekind, Tpasscontext240005** a) {
	{
		NimStringDesc* module_240637;
		NI i_240644;
		NI L_240646;
		module_240637 = 0;
		i_240644 = ((NI) 0);
		L_240646 = (implicits ? implicits->Sup.len : 0);
		{
			while (1) {
				Tnode190813* importstmt;
				Tnode190813* str;
				if (!(i_240644 < L_240646)) goto LA3;
				module_240637 = implicits->data[i_240644];
				importstmt = newnodei_192351(nodekind, gcmdlineinfo_162926);
				str = newstrnode_191644(((NU8) 20), module_240637);
				(*str).info = gcmdlineinfo_162926;
				addson_192819(importstmt, str);
				{
					NIM_BOOL LOC6;
					LOC6 = 0;
					LOC6 = processtoplevelstmt_240454(importstmt, a);
					if (!!(LOC6)) goto LA7;
					goto LA1;
				}
				LA7: ;
				i_240644 += ((NI) 1);
			} LA3: ;
		}
	} LA1: ;
}
Exemplo n.º 2
0
N_NIMCALL(Tnode190813*, evaltemplateargs_383184)(Tnode190813* n, Tsym190843* s) {
	Tnode190813* result;
	NI a;
	NI f;
	nimfr("evalTemplateArgs", "evaltempl.nim")
	result = 0;
	a = 0;
	nimln(60, "evaltempl.nim");
	switch ((*n).kind) {
	case ((NU8) 27):
	case ((NU8) 29):
	case ((NU8) 30):
	case ((NU8) 31):
	case ((NU8) 26):
	case ((NU8) 28):
	{
		nimln(62, "evaltempl.nim");
		a = sonslen_193403(n);
	}
	break;
	default:
	{
		nimln(63, "evaltempl.nim");
		a = ((NI) 0);
	}
	break;
	}
	nimln(64, "evaltempl.nim");
	f = sonslen_193351((*s).typ);
	nimln(65, "evaltempl.nim");
	{
		if (!(f < a)) goto LA5;
		globalerror_164134((*n).info, ((NU16) 133), ((NimStringDesc*) &TMP7631));
	}
	LA5: ;
	nimln(67, "evaltempl.nim");
	result = newnodei_192351(((NU8) 152), (*n).info);
	{
		NI i_383204;
		NI HEX3Atmp_383234;
		NI TMP7632;
		NI res_383237;
		i_383204 = 0;
		HEX3Atmp_383234 = 0;
		nimln(68, "evaltempl.nim");
		TMP7632 = subInt(f, ((NI) 1));
		HEX3Atmp_383234 = (NI)(TMP7632);
		nimln(1598, "system.nim");
		res_383237 = ((NI) 1);
		{
			nimln(1599, "system.nim");
			while (1) {
				Tnode190813* arg;
				NI TMP7633;
				if (!(res_383237 <= HEX3Atmp_383234)) goto LA9;
				nimln(1600, "system.nim");
				i_383204 = res_383237;
				nimln(69, "evaltempl.nim");
				{
					if (!(i_383204 < a)) goto LA12;
					if (((TMP7624[(*n).kind/8] &(1<<((*n).kind%8)))!=0)) raiseFieldError(((NimStringDesc*) &TMP7625));
					if ((NU)(i_383204) >= (NU)((*n).kindU.S6.sons->Sup.len)) raiseIndexError();
					arg = (*n).kindU.S6.sons->data[i_383204];
				}
				goto LA10;
				LA12: ;
				{
					if (((TMP7624[(*(*(*s).typ).n).kind/8] &(1<<((*(*(*s).typ).n).kind%8)))!=0)) raiseFieldError(((NimStringDesc*) &TMP7625));
					if ((NU)(i_383204) >= (NU)((*(*(*s).typ).n).kindU.S6.sons->Sup.len)) raiseIndexError();
					if (!(((TMP7622[(*(*(*(*s).typ).n).kindU.S6.sons->data[i_383204]).kind/8] &(1<<((*(*(*(*s).typ).n).kindU.S6.sons->data[i_383204]).kind%8)))!=0))) raiseFieldError(((NimStringDesc*) &TMP7623));
					arg = copytree_195028((*(*(*(*(*s).typ).n).kindU.S6.sons->data[i_383204]).kindU.S4.sym).ast);
				}
				LA10: ;
				nimln(70, "evaltempl.nim");
				{
					NIM_BOOL LOC17;
					LOC17 = 0;
					LOC17 = (arg == NIM_NIL);
					if (LOC17) goto LA18;
					LOC17 = ((*arg).kind == ((NU8) 1));
					LA18: ;
					if (!LOC17) goto LA19;
					nimln(71, "evaltempl.nim");
					localerror_164155((*n).info, ((NU16) 133), ((NimStringDesc*) &TMP7631));
				}
				LA19: ;
				nimln(72, "evaltempl.nim");
				addson_192819(result, arg);
				nimln(1614, "system.nim");
				TMP7633 = addInt(res_383237, ((NI) 1));
				res_383237 = (NI)(TMP7633);
			} LA9: ;
		}
	}
	popFrame();
	return result;
}
Exemplo n.º 3
0
N_NIMCALL(Tnode190813*, evaltemplateargs_382184)(Tnode190813* n, Tsym190843* s) {
	Tnode190813* result;
	NI a;
	NI f;
	result = 0;
	a = 0;
	switch ((*n).kind) {
	case ((NU8) 27):
	case ((NU8) 29):
	case ((NU8) 30):
	case ((NU8) 31):
	case ((NU8) 26):
	case ((NU8) 28):
	{
		a = sonslen_193403(n);
	}
	break;
	default:
	{
		a = ((NI) 0);
	}
	break;
	}
	f = sonslen_193351((*s).typ);
	{
		if (!(f < a)) goto LA5;
		globalerror_164150((*n).info, ((NU16) 133), ((NimStringDesc*) &TMP2819));
	}
	LA5: ;
	result = newnodei_192351(((NU8) 152), (*n).info);
	{
		NI i_382204;
		NI HEX3Atmp_382234;
		NI res_382237;
		i_382204 = 0;
		HEX3Atmp_382234 = 0;
		HEX3Atmp_382234 = (NI)(f - ((NI) 1));
		res_382237 = ((NI) 1);
		{
			while (1) {
				Tnode190813* arg;
				if (!(res_382237 <= HEX3Atmp_382234)) goto LA9;
				i_382204 = res_382237;
				{
					if (!(i_382204 < a)) goto LA12;
					arg = (*n).kindU.S6.sons->data[i_382204];
				}
				goto LA10;
				LA12: ;
				{
					arg = copytree_195028((*(*(*(*(*s).typ).n).kindU.S6.sons->data[i_382204]).kindU.S4.sym).ast);
				}
				LA10: ;
				{
					NIM_BOOL LOC17;
					LOC17 = 0;
					LOC17 = (arg == NIM_NIL);
					if (LOC17) goto LA18;
					LOC17 = ((*arg).kind == ((NU8) 1));
					LA18: ;
					if (!LOC17) goto LA19;
					localerror_164171((*n).info, ((NU16) 133), ((NimStringDesc*) &TMP2819));
				}
				LA19: ;
				addson_192819(result, arg);
				res_382237 += ((NI) 1);
			} LA9: ;
		}
	}
	return result;
}