Exemplo n.º 1
0
N_NIMCALL(NimStringDesc*, findmodule_137312)(NimStringDesc* modulename, NimStringDesc* currentmodule) {
	NimStringDesc* result;
	NimStringDesc* m;
	NimStringDesc* currentpath;
	TY108700 LOC1;
	nimfr("findModule", "options.nim")
	result = 0;
	nimln(338, "options.nim");
	m = nosaddFileExt(modulename, ((NimStringDesc*) &TMP434));
	nimln(339, "options.nim");
	nimln(339, "options.nim");
	memset((void*)&LOC1, 0, sizeof(LOC1));
	nossplitFile(currentmodule, &LOC1);
	currentpath = LOC1.Field0;
	nimln(340, "options.nim");
	result = HEX2F_108477(currentpath, m);
	nimln(341, "options.nim");
	{
		NIM_BOOL LOC4;
		nimln(341, "options.nim");
		nimln(341, "options.nim");
		LOC4 = 0;
		LOC4 = nosexistsFile(result);
		if (!!(LOC4)) goto LA5;
		nimln(342, "options.nim");
		result = findfile_137306(m);
	}
	LA5: ;
	popFrame();
	return result;
}
Exemplo n.º 2
0
N_NIMCALL(NimStringDesc*, findmodule_114591)(NimStringDesc* modulename, NimStringDesc* currentmodule) {
	NimStringDesc* result;
	NimStringDesc* m;
	NimStringDesc* currentpath;
	TY102259 LOC1;
	nimfr("findModule", "options.nim")
	result = 0;
	nimln(292, "options.nim");
	m = nosaddFileExt(modulename, ((NimStringDesc*) &TMP352));
	nimln(293, "options.nim");
	nimln(293, "options.nim");
	memset((void*)&LOC1, 0, sizeof(LOC1));
	nossplitFile(currentmodule, &LOC1);	currentpath = LOC1.Field0;
	nimln(294, "options.nim");
	result = HEX2F_102067(currentpath, m);
	nimln(295, "options.nim");
	{
		NIM_BOOL LOC4;
		nimln(295, "options.nim");
		nimln(295, "options.nim");
		LOC4 = 0;
		LOC4 = nosexistsFile(result);
		if (!!(LOC4)) goto LA5;
		nimln(296, "options.nim");
		result = findfile_114585(m);
	}	LA5: ;
	popFrame();
	return result;
}
Exemplo n.º 3
0
N_NIMCALL(void, Generatescript_70590)(NimStringDesc* Projectfile_70592, TY52008* Script_70593) {
TY38661 LOC1;
NimStringDesc* Dir_70594;
NimStringDesc* Name_70595;
NimStringDesc* Ext_70596;
NimStringDesc* LOC2;
NimStringDesc* LOC3;
NimStringDesc* LOC4;
memset((void*)&LOC1, 0, sizeof(LOC1));
nossplitFile(Projectfile_70592, &LOC1);
Dir_70594 = 0;
Dir_70594 = copyString(LOC1.Dir);
Name_70595 = 0;
Name_70595 = copyString(LOC1.Name);
Ext_70596 = 0;
Ext_70596 = copyString(LOC1.Ext);
LOC2 = 0;
LOC2 = rawNewString(Name_70595->Sup.len + 8);
appendString(LOC2, ((NimStringDesc*) &TMP196877));
appendString(LOC2, Name_70595);
LOC3 = 0;
LOC3 = nosaddFileExt(LOC2, Os_51053[(Targetos_51570)-1].Scriptext);
LOC4 = 0;
LOC4 = HEX2F_38480(Dir_70594, LOC3);
Writerope_52055(Script_70593, LOC4);
}
Exemplo n.º 4
0
N_NIMCALL(NimStringDesc*, withpackagename_136873)(NimStringDesc* path) {
	NimStringDesc* result;
	NimStringDesc* x;
	nimfr("withPackageName", "options.nim")
	result = 0;
	nimln(253, "options.nim");
	x = getpackagename_136811(path);
	nimln(254, "options.nim");
	{
		nimln(254, "options.nim");
		nimln(254, "options.nim");
		if (!(x->Sup.len == 0)) goto LA3;
		nimln(255, "options.nim");
		result = copyString(path);
	}
	goto LA1;
	LA3: ;
	{
		TY108700 LOC6;
		NimStringDesc* p;
		NimStringDesc* file;
		NimStringDesc* ext;
		NimStringDesc* LOC7;
		NimStringDesc* LOC8;
		NimStringDesc* LOC9;
		nimln(257, "options.nim");
		nimln(257, "options.nim");
		memset((void*)&LOC6, 0, sizeof(LOC6));
		nossplitFile(path, &LOC6);
		p = LOC6.Field0;
		file = LOC6.Field1;
		ext = LOC6.Field2;
		nimln(258, "options.nim");
		nimln(258, "options.nim");
		LOC7 = 0;
		nimln(258, "options.nim");
		nimln(258, "options.nim");
		LOC8 = 0;
		LOC8 = rawNewString(x->Sup.len + file->Sup.len + 1);
appendString(LOC8, x);
appendChar(LOC8, 95);
appendString(LOC8, file);
		LOC9 = 0;
		LOC9 = HEX2F_108477(p, LOC8);
		LOC7 = rawNewString(LOC9->Sup.len + ext->Sup.len + 0);
appendString(LOC7, LOC9);
appendString(LOC7, ext);
		result = LOC7;
	}
	LA1: ;
	popFrame();
	return result;
}
Exemplo n.º 5
0
N_NIMCALL(NimStringDesc*, nosgetAppDir)(void) {
	NimStringDesc* result;
	NimStringDesc* LOC1;
	TY118589 LOC2;
	result = 0;
	LOC1 = 0;
	LOC1 = nosgetAppFilename();
	memset((void*)(&LOC2), 0, sizeof(LOC2));
	nossplitFile(LOC1, (&LOC2));
	result = copyString(LOC2.Field0);
	return result;
}
Exemplo n.º 6
0
N_NIMCALL(NimStringDesc*, withpackagename_153944)(NimStringDesc* path) {
	NimStringDesc* result;
	NimStringDesc* x;
	result = 0;
	x = getpackagename_153825(path);
	{
		if (!((x ? x->Sup.len : 0) == ((NI) 0))) goto LA3;
		result = copyString(path);
	}
	goto LA1;
	LA3: ;
	{
		TY118589 LOC6;
		NimStringDesc* p;
		NimStringDesc* file;
		NimStringDesc* ext;
		NimStringDesc* LOC7;
		NimStringDesc* LOC8;
		NimStringDesc* LOC9;
		memset((void*)(&LOC6), 0, sizeof(LOC6));
		nossplitFile(path, (&LOC6));
		p = 0;
		p = LOC6.Field0;
		file = 0;
		file = LOC6.Field1;
		ext = 0;
		ext = LOC6.Field2;
		LOC7 = 0;
		LOC8 = 0;
		LOC8 = rawNewString(x->Sup.len + file->Sup.len + 1);
appendString(LOC8, x);
appendChar(LOC8, 95);
appendString(LOC8, file);
		LOC9 = 0;
		LOC9 = HEX2F_118292(p, LOC8);
		LOC7 = rawNewString(LOC9->Sup.len + ext->Sup.len + 0);
appendString(LOC7, LOC9);
appendString(LOC7, ext);
		result = LOC7;
	}
	LA1: ;
	return result;
}
Exemplo n.º 7
0
N_NIMCALL(NimStringDesc*, findmodule_154351)(NimStringDesc* modulename, NimStringDesc* currentmodule) {
	NimStringDesc* result;
	NimStringDesc* m;
	NimStringDesc* currentpath;
	TY118589 LOC1;
	result = 0;
	m = nosaddFileExt(modulename, ((NimStringDesc*) &TMP1485));
	memset((void*)(&LOC1), 0, sizeof(LOC1));
	nossplitFile(currentmodule, (&LOC1));
	currentpath = LOC1.Field0;
	result = HEX2F_118292(currentpath, m);
	{
		NIM_BOOL LOC4;
		LOC4 = 0;
		LOC4 = nosexistsFile(result);
		if (!!(LOC4)) goto LA5;
		result = findfile_154341(m);
	}
	LA5: ;
	return result;
}
Exemplo n.º 8
0
N_NIMCALL(TY55548*, Newmodule_191287)(NimStringDesc* Filename_191289) {
TY55548* Result_191290;
TY38661 LOC1;
NIM_BOOL LOC3;
Result_191290 = 0;
Result_191290 = (TY55548*) newObj(NTI55524, sizeof(TY55548));
objectInit(Result_191290, NTI55548);
(*Result_191290).Sup.Id = -1;
(*Result_191290).Kind = ((NU8) 6);
memset((void*)&LOC1, 0, sizeof(LOC1));
nossplitFile(Filename_191289, &LOC1);
asgnRefNoCycle((void**) &(*Result_191290).Name, Getident_54016(LOC1.Name));
LOC3 = Isnimrodidentifier_77357((*(*Result_191290).Name).S);
if (!!(LOC3)) goto LA4;
Rawmessage_48045(((NU8) 19), (*(*Result_191290).Name).S);
LA4: ;
asgnRef((void**) &(*Result_191290).Owner, Result_191290);
(*Result_191290).Info = Newlineinfo_47712(Filename_191289, 1, 1);
(*Result_191290).Flags |=(1<<((NI32)(((NU8) 0))%(sizeof(NI32)*8)));
Initstrtable_55747(&(*Result_191290).Tab);
Registermodule_191229(Filename_191289, Result_191290);
Strtableadd_60061(&(*Result_191290).Tab, Result_191290);
return Result_191290;
}
Exemplo n.º 9
0
N_NIMCALL(void, handlecmdline_535601)(void) {
{	{
		NI LOC3;
		LOC3 = 0;
		LOC3 = paramcount_131626();
		if (!(LOC3 == ((NI) 0))) goto LA4;
		writecommandlineusage_199005();
	}
	goto LA1;
	LA4: ;
	{
		NimStringDesc* scriptfile;
		processcmdline_529203(((NU8) 0), ((NimStringDesc*) &TMP2024));
		{
			NimStringDesc* LOC11;
			NimStringDesc* LOC12;
			if (!eqStrings(gprojectname_159199, ((NimStringDesc*) &TMP2025))) goto LA9;
			LOC11 = 0;
			LOC11 = gprojectname_159199; gprojectname_159199 = copyStringRC1(((NimStringDesc*) &TMP2026));
			if (LOC11) nimGCunrefNoCycle(LOC11);
			LOC12 = 0;
			LOC12 = gprojectfull_159201; gprojectfull_159201 = copyStringRC1(((NimStringDesc*) &TMP2026));
			if (LOC12) nimGCunrefNoCycle(LOC12);
			asgnRefNoCycle((void**) (&gprojectpath_159200), nosgetCurrentDir());
			gprojectisstdin_159202 = NIM_TRUE;
		}
		goto LA7;
		LA9: ;
		{
			TSafePoint TMP2027;
			TY118906 p;
			NimStringDesc* LOC20;
			NimStringDesc* LOC21;
			if (!!(((gprojectname_159199) && (gprojectname_159199)->Sup.len == 0))) goto LA14;
			pushSafePoint(&TMP2027);
			TMP2027.status = _setjmp(TMP2027.context);
			if (TMP2027.status == 0) {
				asgnRefNoCycle((void**) (&gprojectfull_159201), canonicalizepath_159405(gprojectname_159199));
				popSafePoint();
			}
			else {
				popSafePoint();
				if (isObj(getCurrentException()->Sup.m_type, (&NTI3630))) {
					NimStringDesc* LOC19;
					TMP2027.status = 0;
					LOC19 = 0;
					LOC19 = gprojectfull_159201; gprojectfull_159201 = copyStringRC1(gprojectname_159199);
					if (LOC19) nimGCunrefNoCycle(LOC19);
					popCurrentException();
				}
			}
			if (TMP2027.status != 0) reraiseException();
			memset((void*)(&p), 0, sizeof(p));
			chckNil((void*)(&p));
			memset((void*)(&p), 0, sizeof(p));
			nossplitFile(gprojectfull_159201, (&p));
			LOC20 = 0;
			LOC20 = gprojectpath_159200; gprojectpath_159200 = copyStringRC1(p.Field0);
			if (LOC20) nimGCunrefNoCycle(LOC20);
			LOC21 = 0;
			LOC21 = gprojectname_159199; gprojectname_159199 = copyStringRC1(p.Field1);
			if (LOC21) nimGCunrefNoCycle(LOC21);
		}
		goto LA7;
		LA14: ;
		{
			asgnRefNoCycle((void**) (&gprojectpath_159200), nosgetCurrentDir());
		}
		LA7: ;
		loadconfigs_209603(((NimStringDesc*) &TMP2056));
		scriptfile = noschangeFileExt(gprojectfull_159201, ((NimStringDesc*) &TMP2057));
		{
			NIM_BOOL LOC25;
			LOC25 = 0;
			LOC25 = fileexists_122004(scriptfile);
			if (!LOC25) goto LA26;
			runnimscript_534203(scriptfile);
			{
				if (!eqStrings(scriptfile, gprojectfull_159201)) goto LA30;
				goto BeforeRet;
			}
			LA30: ;
		}
		goto LA23;
		LA26: ;
		{
			NimStringDesc* LOC33;
			NIM_BOOL LOC34;
			NimStringDesc* LOC37;
			LOC33 = 0;
			LOC33 = HEX2F_118665(gprojectpath_159200, ((NimStringDesc*) &TMP3718));
			LOC34 = 0;
			LOC34 = fileexists_122004(LOC33);
			if (!LOC34) goto LA35;
			LOC37 = 0;
			LOC37 = HEX2F_118665(gprojectpath_159200, ((NimStringDesc*) &TMP3718));
			runnimscript_534203(LOC37);
		}
		goto LA23;
		LA35: ;
		LA23: ;
		initvars_193834();
		processcmdline_529203(((NU8) 1), ((NimStringDesc*) &TMP2024));
		{
			if (!((command_159205) && (command_159205)->Sup.len == 0)) goto LA40;
			rawmessage_184612(((NU16) 184), command_159205);
		}
		LA40: ;
		maincommand_531610();
		{
			NIM_BOOL LOC44;
			NimStringDesc* LOC48;
			LOC44 = 0;
			LOC44 = ((goptions_159119 &(1U<<((NU)(((NU8) 12))&31U)))!=0);
			if (!(LOC44)) goto LA45;
			LOC44 = ((gnotes_182077 &((NU64)1<<((NU)((((NU16) 289)- 237))&63U)))!=0);
			LA45: ;
			if (!LOC44) goto LA46;
			LOC48 = 0;
			LOC48 = Gcgetstatistics_9821();
			printf("%s\012", LOC48? (LOC48)->data:"nil");
			fflush(stdout);
		}
		LA46: ;
		{
			if (!(gerrorcounter_182078 == ((NI) 0))) goto LA51;
			{
				if (!((gglobaloptions_159121 &(1U<<((NU)(((NU8) 13))&31U)))!=0)) goto LA55;
				{
					NimStringDesc* ex;
					NimStringDesc* LOC70;
					NimStringDesc* LOC71;
					if (!(gcmd_159123 == ((NU8) 4))) goto LA59;
					ex = 0;
					{
						NimStringDesc* LOC65;
						if (!(((NI) 0) < (outfile_159127 ? outfile_159127->Sup.len : 0))) goto LA63;
						LOC65 = 0;
						LOC65 = prependcurdir_535401(outfile_159127);
						ex = nospquoteShell(LOC65);
					}
					goto LA61;
					LA63: ;
					{
						NimStringDesc* LOC67;
						NimStringDesc* LOC68;
						NimStringDesc* LOC69;
						LOC67 = 0;
						LOC67 = noschangeFileExt(gprojectfull_159201, ((NimStringDesc*) &TMP5307));
						LOC68 = 0;
						LOC68 = prependcurdir_535401(LOC67);
						LOC69 = 0;
						LOC69 = completecfilepath_193854(LOC68, NIM_TRUE);
						ex = nospquoteShell(LOC69);
					}
					LA61: ;
					LOC70 = 0;
					LOC71 = 0;
					LOC71 = findnodejs_533003();
					LOC70 = rawNewString(LOC71->Sup.len + ex->Sup.len + arguments_200699->Sup.len + 2);
appendString(LOC70, LOC71);
appendString(LOC70, ((NimStringDesc*) &TMP5311));
appendString(LOC70, ex);
appendChar(LOC70, 32);
appendString(LOC70, arguments_200699);
					execexternalprogram_193881(LOC70, ((NU16) 284));
				}
				goto LA57;
				LA59: ;
				{
					NimStringDesc* binpath;
					NimStringDesc* ex;
					NimStringDesc* LOC79;
					binpath = 0;
					{
						if (!(((NI) 0) < (outfile_159127 ? outfile_159127->Sup.len : 0))) goto LA75;
						binpath = prependcurdir_535401(outfile_159127);
					}
					goto LA73;
					LA75: ;
					{
						NimStringDesc* LOC78;
						LOC78 = 0;
						LOC78 = noschangeFileExt(gprojectfull_159201, ((NimStringDesc*) &TMP2024));
						binpath = prependcurdir_535401(LOC78);
					}
					LA73: ;
					ex = nospquoteShell(binpath);
					LOC79 = 0;
					LOC79 = rawNewString(ex->Sup.len + arguments_200699->Sup.len + 1);
appendString(LOC79, ex);
appendChar(LOC79, 32);
appendString(LOC79, arguments_200699);
					execexternalprogram_193881(LOC79, ((NU16) 284));
				}
				LA57: ;
			}
			LA55: ;
		}
		LA51: ;
	}
	LA1: ;
	}BeforeRet: ;
}
Exemplo n.º 10
0
N_NIMCALL(void, Handlecmdline_195245)(void) {
NI Start_195247;
NI LOC2;
NimStringDesc* Command_195250;
NimStringDesc* Filename_195251;
TY38661 LOC8;
NimStringDesc* LOC12;
TY115159 LOC19;
NI LOC20;
NI64 LOC21;
NimStringDesc* Prog_195432;
NimStringDesc* LOC25;
NimStringDesc* LOC26;
NimStringDesc* LOC27;
NimStringDesc* LOC28;
Start_195247 = 0;
Start_195247 = Gettime_28616();
LOC2 = Paramcount_41430();
if (!(LOC2 == 0)) goto LA3;
Writecommandlineusage_73001();
goto LA1;
LA3: ;
Command_195250 = 0;
Command_195250 = copyString(((NimStringDesc*) &TMP195203));
Filename_195251 = 0;
Filename_195251 = copyString(((NimStringDesc*) &TMP195203));
Processcmdline_195204(((NU8) 0), &Command_195250, &Filename_195251);
if (!!(((Filename_195251) && (Filename_195251)->Sup.len == 0))) goto LA6;
memset((void*)&LOC8, 0, sizeof(LOC8));
nossplitFile(Filename_195251, &LOC8);
asgnRefNoCycle((void**) &Projectpath_46113, copyString(LOC8.Dir));
LA6: ;
Loadconfig_80004(Filename_195251);
Initvars_70472();
Command_195250 = copyString(((NimStringDesc*) &TMP195203));
Filename_195251 = copyString(((NimStringDesc*) &TMP195203));
Processcmdline_195204(((NU8) 1), &Command_195250, &Filename_195251);
Maincommand_191201(Command_195250, Filename_195251);
if (!(2 <= Gverbosity_46085)) goto LA10;
LOC12 = 0;
LOC12 = Gcgetstatistics_3082();
rawEcho(LOC12);
rawEchoNL();
LA10: ;
if (!(Gerrorcounter_47565 == 0)) goto LA14;
if (!!(((262208 &(1<<((Gcmd_46084)&31)))!=0))) goto LA17;
memset((void*)&LOC19, 0, sizeof(LOC19));
LOC19[0] = nimIntToStr(Glinescompiled_77285);
LOC20 = Gettime_28616();
LOC21 = ntDiffTime(LOC20, Start_195247);
LOC19[1] = nimInt64ToStr(LOC21);
Rawmessage_47971(((NU8) 224), LOC19, 2);
LA17: ;
if (!((Gglobaloptions_46079 &(1<<((((NU8) 14))&31)))!=0)) goto LA23;
Prog_195432 = 0;
LOC25 = 0;
LOC26 = 0;
LOC26 = nosChangeFileExt(Filename_195251, ((NimStringDesc*) &TMP195203));
LOC27 = 0;
LOC27 = Quoteifcontainswhite_26268(LOC26);
LOC25 = rawNewString(LOC27->Sup.len + 2);
appendString(LOC25, ((NimStringDesc*) &TMP197511));
appendString(LOC25, LOC27);
Prog_195432 = LOC25;
LOC28 = 0;
LOC28 = rawNewString(Prog_195432->Sup.len + Arguments_195201->Sup.len + 1);
appendString(LOC28, Prog_195432);
appendChar(LOC28, 32);
appendString(LOC28, Arguments_195201);
Execexternalprogram_70570(LOC28);
LA23: ;
LA14: ;
LA1: ;
}
Exemplo n.º 11
0
N_NIMCALL(NimStringDesc*, Getcompilecfilecmd_70612)(NimStringDesc* Cfilename_70614, NIM_BOOL Isexternal_70615) {
NimStringDesc* Result_70616;
NimStringDesc* Cfile_70617;
NimStringDesc* Objfile_70618;
NimStringDesc* Options_70619;
NimStringDesc* Includecmd_70620;
NimStringDesc* Compilepattern_70621;
NimStringDesc* Key_70622;
NimStringDesc* Trunk_70623;
NimStringDesc* Exe_70624;
NU8 C_70625;
TY38661 LOC1;
NimStringDesc* LOC5;
NIM_BOOL LOC7;
NimStringDesc* LOC10;
NimStringDesc* LOC11;
NimStringDesc* LOC15;
NIM_BOOL LOC17;
NimStringDesc* LOC20;
NimStringDesc* LOC21;
NimStringDesc* LOC24;
NIM_BOOL LOC26;
NimStringDesc* LOC29;
NimStringDesc* LOC30;
NimStringDesc* LOC31;
NIM_BOOL LOC33;
NimStringDesc* LOC36;
NimStringDesc* LOC37;
NIM_BOOL LOC39;
NIM_BOOL LOC46;
NimStringDesc* LOC50;
NimStringDesc* LOC54;
NIM_BOOL LOC59;
NimStringDesc* LOC63;
NimStringDesc* LOC64;
TY70726 LOC65;
NimStringDesc* LOC66;
TY70726 LOC67;
NimStringDesc* LOC68;
Result_70616 = 0;
Cfile_70617 = 0;
Objfile_70618 = 0;
Options_70619 = 0;
Includecmd_70620 = 0;
Compilepattern_70621 = 0;
Key_70622 = 0;
Trunk_70623 = 0;
Exe_70624 = 0;
C_70625 = 0;
C_70625 = Ccompiler_70340;
Options_70619 = copyString(Compileoptions_70348);
memset((void*)&LOC1, 0, sizeof(LOC1));
nossplitFile(Cfilename_70614, &LOC1);
Trunk_70623 = copyString(LOC1.Name);
if (!((Gglobaloptions_46079 &(1<<((((NU8) 9))&31)))!=0)) goto LA3;
LOC5 = 0;
LOC5 = rawNewString(Trunk_70623->Sup.len + 6);
appendString(LOC5, Trunk_70623);
appendString(LOC5, ((NimStringDesc*) &TMP196784));
Key_70622 = LOC5;
LOC7 = Existsconfigvar_46132(Key_70622);
if (!LOC7) goto LA8;
LOC10 = 0;
LOC10 = Getconfigvar_46135(Key_70622);
Addopt_70443(&Options_70619, LOC10);
goto LA6;
LA8: ;
LOC11 = 0;
LOC11 = Getdebug_70601(C_70625);
Addopt_70443(&Options_70619, LOC11);
LA6: ;
LA3: ;
if (!((Goptions_46077 &(1<<((((NU8) 13))&31)))!=0)) goto LA13;
LOC15 = 0;
LOC15 = rawNewString(Trunk_70623->Sup.len + 6);
appendString(LOC15, Trunk_70623);
appendString(LOC15, ((NimStringDesc*) &TMP196786));
Key_70622 = LOC15;
LOC17 = Existsconfigvar_46132(Key_70622);
if (!LOC17) goto LA18;
LOC20 = 0;
LOC20 = Getconfigvar_46135(Key_70622);
Addopt_70443(&Options_70619, LOC20);
goto LA16;
LA18: ;
LOC21 = 0;
LOC21 = Getoptspeed_70597(C_70625);
Addopt_70443(&Options_70619, LOC21);
LA16: ;
goto LA12;
LA13: ;
if (!((Goptions_46077 &(1<<((((NU8) 14))&31)))!=0)) goto LA22;
LOC24 = 0;
LOC24 = rawNewString(Trunk_70623->Sup.len + 5);
appendString(LOC24, Trunk_70623);
appendString(LOC24, ((NimStringDesc*) &TMP196788));
Key_70622 = LOC24;
LOC26 = Existsconfigvar_46132(Key_70622);
if (!LOC26) goto LA27;
LOC29 = 0;
LOC29 = Getconfigvar_46135(Key_70622);
Addopt_70443(&Options_70619, LOC29);
goto LA25;
LA27: ;
LOC30 = 0;
LOC30 = Getoptsize_70605(C_70625);
Addopt_70443(&Options_70619, LOC30);
LA25: ;
goto LA12;
LA22: ;
LA12: ;
LOC31 = 0;
LOC31 = rawNewString(Trunk_70623->Sup.len + 7);
appendString(LOC31, Trunk_70623);
appendString(LOC31, ((NimStringDesc*) &TMP196790));
Key_70622 = LOC31;
LOC33 = Existsconfigvar_46132(Key_70622);
if (!LOC33) goto LA34;
LOC36 = 0;
LOC36 = Getconfigvar_46135(Key_70622);
Addopt_70443(&Options_70619, LOC36);
LA34: ;
Exe_70624 = copyString(Cc_70041[(C_70625)-1].Compilerexe);
LOC37 = 0;
LOC37 = rawNewString(Cc_70041[(C_70625)-1].Name->Sup.len + 4);
appendString(LOC37, Cc_70041[(C_70625)-1].Name);
appendString(LOC37, ((NimStringDesc*) &TMP196791));
Key_70622 = LOC37;
LOC39 = Existsconfigvar_46132(Key_70622);
if (!LOC39) goto LA40;
Exe_70624 = Getconfigvar_46135(Key_70622);
LA40: ;
if (!(Targetos_51570 == ((NU8) 2))) goto LA43;
Exe_70624 = nosaddFileExt(Exe_70624, ((NimStringDesc*) &TMP196792));
LA43: ;
LOC46 = ((Gglobaloptions_46079 &(1<<((((NU8) 10))&31)))!=0);
if (!(LOC46)) goto LA47;
LOC46 = ((Os_51053[(Targetos_51570)-1].Props &(1<<((((NU8) 0))&7)))!=0);
LA47: ;
if (!LOC46) goto LA48;
LOC50 = 0;
LOC50 = rawNewString(Cc_70041[(C_70625)-1].Pic->Sup.len + 1);
appendChar(LOC50, 32);
appendString(LOC50, Cc_70041[(C_70625)-1].Pic);
Options_70619 = resizeString(Options_70619, LOC50->Sup.len + 0);
appendString(Options_70619, LOC50);
LA48: ;
if (!(Targetos_51570 == Hostos_51571)) goto LA52;
Includecmd_70620 = copyString(Cc_70041[(C_70625)-1].Includecmd);
LOC54 = 0;
LOC54 = Quoteifcontainswhite_26268(Libpath_46112);
Includecmd_70620 = resizeString(Includecmd_70620, LOC54->Sup.len + 0);
appendString(Includecmd_70620, LOC54);
Compilepattern_70621 = nosJoinPath(Ccompilerpath_70349, Exe_70624);
goto LA51;
LA52: ;
Includecmd_70620 = copyString(((NimStringDesc*) &TMP70271));
Compilepattern_70621 = copyString(Cc_70041[(C_70625)-1].Compilerexe);
LA51: ;
if (!(Targetos_51570 == Hostos_51571)) goto LA56;
Cfile_70617 = copyString(Cfilename_70614);
goto LA55;
LA56: ;
Cfile_70617 = nosextractFilename(Cfilename_70614);
LA55: ;
LOC59 = !(Isexternal_70615);
if (LOC59) goto LA60;
LOC59 = !((Targetos_51570 == Hostos_51571));
LA60: ;
if (!LOC59) goto LA61;
Objfile_70618 = Toobjfile_70512(Cfile_70617);
goto LA58;
LA61: ;
LOC63 = 0;
LOC63 = Toobjfile_70512(Cfile_70617);
Objfile_70618 = Completecfilepath_70507(LOC63, NIM_TRUE);
LA58: ;
LOC64 = 0;
LOC64 = nosaddFileExt(Cfile_70617, Cext_70342);
Cfile_70617 = Quoteifcontainswhite_26268(LOC64);
Objfile_70618 = Quoteifcontainswhite_26268(Objfile_70618);
memset((void*)&LOC65, 0, sizeof(LOC65));
LOC65[0] = copyString(((NimStringDesc*) &TMP196793));
LOC65[1] = copyString(Cfile_70617);
LOC65[2] = copyString(((NimStringDesc*) &TMP196794));
LOC65[3] = copyString(Objfile_70618);
LOC65[4] = copyString(((NimStringDesc*) &TMP196795));
LOC65[5] = copyString(Options_70619);
LOC65[6] = copyString(((NimStringDesc*) &TMP196796));
LOC65[7] = copyString(Includecmd_70620);
LOC65[8] = copyString(((NimStringDesc*) &TMP196797));
LOC65[9] = Getprefixdir_46109();
LOC65[10] = copyString(((NimStringDesc*) &TMP196798));
LOC65[11] = copyString(Libpath_46112);
LOC66 = 0;
LOC66 = nsuFormatOpenArray(Compilepattern_70621, LOC65, 12);
Result_70616 = Quoteifcontainswhite_26268(LOC66);
Result_70616 = addChar(Result_70616, 32);
memset((void*)&LOC67, 0, sizeof(LOC67));
LOC67[0] = copyString(((NimStringDesc*) &TMP196793));
LOC67[1] = copyString(Cfile_70617);
LOC67[2] = copyString(((NimStringDesc*) &TMP196794));
LOC67[3] = copyString(Objfile_70618);
LOC67[4] = copyString(((NimStringDesc*) &TMP196795));
LOC67[5] = copyString(Options_70619);
LOC67[6] = copyString(((NimStringDesc*) &TMP196796));
LOC67[7] = copyString(Includecmd_70620);
LOC67[8] = copyString(((NimStringDesc*) &TMP196797));
LOC68 = 0;
LOC68 = Getprefixdir_46109();
LOC67[9] = Quoteifcontainswhite_26268(LOC68);
LOC67[10] = copyString(((NimStringDesc*) &TMP196798));
LOC67[11] = Quoteifcontainswhite_26268(Libpath_46112);
nsuAddf(&Result_70616, Cc_70041[(C_70625)-1].Compiletmpl, LOC67, 12);
return Result_70616;
}
Exemplo n.º 12
0
N_NIMCALL(void, loadfile_248043)(Tlineinfo163338 info) {
	NI32 i;
	i = info.fileindex;
	{
		if (!((gsourcefiles_248038 ? gsourcefiles_248038->Sup.len : 0) <= ((NI) (i)))) goto LA3;
		gsourcefiles_248038 = (TY248019*) setLengthSeq(&(gsourcefiles_248038)->Sup, sizeof(Tsourcefile248008), ((NI) ((NI32)(i + ((NI32) 1)))));
	}
	LA3: ;
	{
		NimStringDesc* path;
		NimStringDesc* LOC9;
		TY118589 LOC10;
		Baselexer246024 lex;
		Filestreamobj137692* LOC16;
		Streamobj137027* LOC17;
		NI pos;
		if (!gsourcefiles_248038->data[i].lines == 0) goto LA7;
		gsourcefiles_248038->data[i].fileidx = info.fileindex;
		if (gsourcefiles_248038->data[i].lines) nimGCunrefNoCycle(gsourcefiles_248038->data[i].lines);
		gsourcefiles_248038->data[i].lines = (TY121008*) newSeqRC1((&NTI121008), 0);
		path = tofullpath_164284(info.fileindex);
		LOC9 = 0;
		LOC9 = gsourcefiles_248038->data[i].fullpath; gsourcefiles_248038->data[i].fullpath = copyStringRC1(path);
		if (LOC9) nimGCunrefNoCycle(LOC9);
		memset((void*)(&LOC10), 0, sizeof(LOC10));
		nossplitFile(path, (&LOC10));
		gsourcefiles_248038->data[i].isnimfixfile = eqStrings(LOC10.Field2, ((NimStringDesc*) &TMP2680));
		{
			NimStringDesc* line_248092;
			FILE* f_248119;
			NimStringDesc* res_248121;
			line_248092 = 0;
			f_248119 = open_13217(path, ((NU8) 0), ((NI) 8000));
			res_248121 = rawNewString(((NI) 80));
			{
				while (1) {
					NIM_BOOL LOC14;
					NimStringDesc* LOC15;
					LOC14 = 0;
					LOC14 = readline_13481(f_248119, (&res_248121));
					if (!LOC14) goto LA13;
					line_248092 = res_248121;
					gsourcefiles_248038->data[i].lines = (TY121008*) incrSeq(&(gsourcefiles_248038->data[i].lines)->Sup, sizeof(NimStringDesc*));
					LOC15 = 0;
					LOC15 = gsourcefiles_248038->data[i].lines->data[gsourcefiles_248038->data[i].lines->Sup.len-1]; gsourcefiles_248038->data[i].lines->data[gsourcefiles_248038->data[i].lines->Sup.len-1] = copyStringRC1(line_248092);
					if (LOC15) nimGCunrefNoCycle(LOC15);
				} LA13: ;
			}
			fclose(f_248119);
		}
		memset((void*)(&lex), 0, sizeof(lex));
		lex.Sup.m_type = (&NTI246024);
		LOC16 = 0;
		LOC16 = newfilestream_137773(path, ((NU8) 0));
		LOC17 = 0;
		LOC17 = &LOC16->Sup;
		open_246040((&lex), LOC17, ((NI) 8192));
		pos = lex.bufpos;
		{
			while (1) {
				switch (((NU8)(lex.buf[pos]))) {
				case 13:
				{
					NimStringDesc* LOC21;
					LOC21 = 0;
					LOC21 = gsourcefiles_248038->data[i].newline; gsourcefiles_248038->data[i].newline = copyStringRC1(((NimStringDesc*) &TMP2688));
					if (LOC21) nimGCunrefNoCycle(LOC21);
					goto LA18;
				}
				break;
				case 10:
				case 0:
				{
					NimStringDesc* LOC23;
					LOC23 = 0;
					LOC23 = gsourcefiles_248038->data[i].newline; gsourcefiles_248038->data[i].newline = copyStringRC1(((NimStringDesc*) &TMP2689));
					if (LOC23) nimGCunrefNoCycle(LOC23);
					goto LA18;
				}
				break;
				default:
				{
				}
				break;
				}
				pos += ((NI) 1);
			}
		} LA18: ;
		close_246050((&lex));
	}
	LA7: ;
}
Exemplo n.º 13
0
N_NIMCALL(NimStringDesc*, getpackagename_153825)(NimStringDesc* path) {
	NimStringDesc* result;
	NI parents;
{	result = 0;
	parents = ((NI) 0);
	{
		{
			NimStringDesc* d_153831;
			NimStringDesc* current_153888;
			d_153831 = 0;
			current_153888 = copyString(path);
			{
				while (1) {
					current_153888 = nosparentDir(current_153888);
					{
						if (!((current_153888 ? current_153888->Sup.len : 0) == ((NI) 0))) goto LA7;
						goto LA3;
					}
					LA7: ;
					d_153831 = current_153888;
					{
						NIM_BOOL LOC11;
						LOC11 = 0;
						LOC11 = nsthasKey(packagecache_153601, d_153831);
						if (!LOC11) goto LA12;
						result = nstGet(packagecache_153601, d_153831);
						goto BeforeRet;
					}
					LA12: ;
					parents += ((NI) 1);
					{
						NimStringDesc* file_153841;
						NimStringDesc* HEX3Atmp_153855;
						glob_t f_153859;
						NI res_153861;
						int LOC15;
						file_153841 = 0;
						HEX3Atmp_153855 = 0;
						HEX3Atmp_153855 = HEX2F_118292(d_153831, ((NimStringDesc*) &TMP1433));
						memset((void*)(&f_153859), 0, sizeof(f_153859));
						res_153861 = 0;
						f_153859.gl_offs = ((NI) 0);
						f_153859.gl_pathc = ((NI) 0);
						f_153859.gl_pathv = NIM_NIL;
						LOC15 = 0;
						LOC15 = glob(HEX3Atmp_153855->data, ((int) 0), NIM_NIL, (&f_153859));
						res_153861 = ((NI) (LOC15));
						{
							if (!(res_153861 == ((NI) 0))) goto LA18;
							{
								NI i_153863;
								NI HEX3Atmp_153865;
								NI res_153867;
								i_153863 = 0;
								HEX3Atmp_153865 = 0;
								HEX3Atmp_153865 = (NI)(f_153859.gl_pathc - ((NI) 1));
								res_153867 = ((NI) 0);
								{
									while (1) {
										TY118589 LOC23;
										if (!(res_153867 <= HEX3Atmp_153865)) goto LA22;
										i_153863 = res_153867;
										file_153841 = cstrToNimstr(f_153859.gl_pathv[(i_153863)- 0]);
										memset((void*)(&LOC23), 0, sizeof(LOC23));
										nossplitFile(file_153841, (&LOC23));
										result = copyString(LOC23.Field1);
										goto LA1;
										res_153867 += ((NI) 1);
									} LA22: ;
								}
							}
						}
						LA18: ;
						globfree((&f_153859));
					}
					{
						NimStringDesc* file_153842;
						NimStringDesc* HEX3Atmp_153871;
						glob_t f_153875;
						NI res_153877;
						int LOC25;
						file_153842 = 0;
						HEX3Atmp_153871 = 0;
						HEX3Atmp_153871 = HEX2F_118292(d_153831, ((NimStringDesc*) &TMP1434));
						memset((void*)(&f_153875), 0, sizeof(f_153875));
						res_153877 = 0;
						f_153875.gl_offs = ((NI) 0);
						f_153875.gl_pathc = ((NI) 0);
						f_153875.gl_pathv = NIM_NIL;
						LOC25 = 0;
						LOC25 = glob(HEX3Atmp_153871->data, ((int) 0), NIM_NIL, (&f_153875));
						res_153877 = ((NI) (LOC25));
						{
							if (!(res_153877 == ((NI) 0))) goto LA28;
							{
								NI i_153879;
								NI HEX3Atmp_153881;
								NI res_153883;
								i_153879 = 0;
								HEX3Atmp_153881 = 0;
								HEX3Atmp_153881 = (NI)(f_153875.gl_pathc - ((NI) 1));
								res_153883 = ((NI) 0);
								{
									while (1) {
										TY118589 LOC33;
										if (!(res_153883 <= HEX3Atmp_153881)) goto LA32;
										i_153879 = res_153883;
										file_153842 = cstrToNimstr(f_153875.gl_pathv[(i_153879)- 0]);
										memset((void*)(&LOC33), 0, sizeof(LOC33));
										nossplitFile(file_153842, (&LOC33));
										result = copyString(LOC33.Field1);
										goto LA1;
										res_153883 += ((NI) 1);
									} LA32: ;
								}
							}
						}
						LA28: ;
						globfree((&f_153875));
					}
				}
			} LA3: ;
		}
	} LA1: ;
	{
		if (!result == 0) goto LA36;
		result = copyString(((NimStringDesc*) &TMP39));
	}
	LA36: ;
	{
		NimStringDesc* d_153843;
		NimStringDesc* current_153892;
		d_153843 = 0;
		current_153892 = copyString(path);
		{
			while (1) {
				current_153892 = nosparentDir(current_153892);
				{
					if (!((current_153892 ? current_153892->Sup.len : 0) == ((NI) 0))) goto LA43;
					goto LA39;
				}
				LA43: ;
				d_153843 = current_153892;
				nstPut(packagecache_153601, d_153843, result);
				parents -= ((NI) 1);
				{
					if (!(parents <= ((NI) 0))) goto LA47;
					goto LA38;
				}
				LA47: ;
			}
		} LA39: ;
	} LA38: ;
	}BeforeRet: ;
	return result;
}
Exemplo n.º 14
0
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, getModuleName_rlFejf61X39bVziQhhH7znQ)(tyObject_ConfigRefcolonObjectType__LaK09ayL9alwKUad7rts0rTw* conf, tyObject_TNode_bROa11lyF5vxEN9aYNbHmhw* n) {
	NimStringDesc* volatile result;
	result = (NimStringDesc*)0;
	switch ((*n).kind) {
	case ((tyEnum_TNodeKind_G4E4Gxe7oI2Cm03rkiOzQw) 20):
	case ((tyEnum_TNodeKind_G4E4Gxe7oI2Cm03rkiOzQw) 21):
	case ((tyEnum_TNodeKind_G4E4Gxe7oI2Cm03rkiOzQw) 22):
	{
		TSafePoint TM_GM5IT6miOywfWPAzqo7pmA_2;
		pushSafePoint(&TM_GM5IT6miOywfWPAzqo7pmA_2);
		TM_GM5IT6miOywfWPAzqo7pmA_2.status = _setjmp(TM_GM5IT6miOywfWPAzqo7pmA_2.context);
		if (TM_GM5IT6miOywfWPAzqo7pmA_2.status == 0) {
			NimStringDesc* T3_;
			tyTuple_7q7q3E6Oj24ZNVJb9aonhAg T4_;
			NimStringDesc* T5_;
			T3_ = (NimStringDesc*)0;
			T3_ = toFullPath_tdNdBP9cVqODPZCeXYb1GvA(conf, (*n).info.fileIndex);
			nimZeroMem((void*)(&T4_), sizeof(tyTuple_7q7q3E6Oj24ZNVJb9aonhAg));
			nossplitFile(T3_, (&T4_));
			T5_ = (NimStringDesc*)0;
			T5_ = pathSubs_44aLCEM3fkLK7eRwjgUydw(conf, (*n)._Ukind.S3.strVal, T4_.Field0);
			result = nsuReplaceStr(T5_, ((NimStringDesc*) &TM_GM5IT6miOywfWPAzqo7pmA_3), ((NimStringDesc*) NIM_NIL));
			popSafePoint();
		}
		else {
			popSafePoint();
			if (isObj(getCurrentException()->Sup.m_type, (&NTI_5aqBlilCK53e9cDu4kUyN5Q_))) {
				NimStringDesc* T8_;
				TM_GM5IT6miOywfWPAzqo7pmA_2.status = 0;
				T8_ = (NimStringDesc*)0;
				T8_ = rawNewString(((*n)._Ukind.S3.strVal ? (*n)._Ukind.S3.strVal->Sup.len : 0) + 14);
appendString(T8_, ((NimStringDesc*) &TM_GM5IT6miOywfWPAzqo7pmA_4));
appendString(T8_, (*n)._Ukind.S3.strVal);
				localError_NF6kBGchnhQYPbCedyefVA(conf, (*n).info, T8_);
				result = copyString((*n)._Ukind.S3.strVal);
				popCurrentException();
			}
		}
		if (TM_GM5IT6miOywfWPAzqo7pmA_2.status != 0) reraiseException();
	}
	break;
	case ((tyEnum_TNodeKind_G4E4Gxe7oI2Cm03rkiOzQw) 2):
	{
		result = copyString((*(*n)._Ukind.S5.ident).s);
	}
	break;
	case ((tyEnum_TNodeKind_G4E4Gxe7oI2Cm03rkiOzQw) 3):
	{
		result = copyString((*(*(*n)._Ukind.S4.sym).name).s);
	}
	break;
	case ((tyEnum_TNodeKind_G4E4Gxe7oI2Cm03rkiOzQw) 29):
	{
		tyObject_TNode_bROa11lyF5vxEN9aYNbHmhw* n0;
		tyObject_TNode_bROa11lyF5vxEN9aYNbHmhw* n1;
		NimStringDesc* modname;
		NimStringDesc* T12_;
		NimStringDesc* T13_;
		n0 = (*n)._Ukind.S6.sons->data[((NI) 0)];
		n1 = (*n)._Ukind.S6.sons->data[((NI) 1)];
		modname = getModuleName_rlFejf61X39bVziQhhH7znQ(conf, (*n)._Ukind.S6.sons->data[((NI) 2)]);
		result = getModuleName_rlFejf61X39bVziQhhH7znQ(conf, n1);
		T12_ = (NimStringDesc*)0;
		T12_ = renderTree_ppjdh9aQ5L0SGPF8yz1gZ9cA(n0, 4);
		T13_ = (NimStringDesc*)0;
		T13_ = nsuReplaceStr(T12_, ((NimStringDesc*) &TM_GM5IT6miOywfWPAzqo7pmA_3), ((NimStringDesc*) NIM_NIL));
		result = resizeString(result, (T13_ ? T13_->Sup.len : 0) + 0);
appendString(result, T13_);
		result = resizeString(result, (modname ? modname->Sup.len : 0) + 0);
appendString(result, modname);
	}
	break;
	case ((tyEnum_TNodeKind_G4E4Gxe7oI2Cm03rkiOzQw) 30):
	{
		NimStringDesc* T15_;
		T15_ = (NimStringDesc*)0;
		T15_ = renderTree_ppjdh9aQ5L0SGPF8yz1gZ9cA(n, 4);
		result = nsuReplaceStr(T15_, ((NimStringDesc*) &TM_GM5IT6miOywfWPAzqo7pmA_3), ((NimStringDesc*) NIM_NIL));
	}
	break;
	case ((tyEnum_TNodeKind_G4E4Gxe7oI2Cm03rkiOzQw) 45):
	{
		NimStringDesc* T17_;
		localError_mMj7lrOf3zBP9bl69amiKu5g_3(conf, (*n).info, ((tyEnum_TMsgKind_29cbg2fC1z5iM1PAI28kR5w) 15), ((NimStringDesc*) &TM_GM5IT6miOywfWPAzqo7pmA_5));
		T17_ = (NimStringDesc*)0;
		T17_ = renderTree_ppjdh9aQ5L0SGPF8yz1gZ9cA(n, 4);
		result = nsuReplaceStr(T17_, ((NimStringDesc*) &TM_GM5IT6miOywfWPAzqo7pmA_6), ((NimStringDesc*) &TM_GM5IT6miOywfWPAzqo7pmA_7));
	}
	break;
	case ((tyEnum_TNodeKind_G4E4Gxe7oI2Cm03rkiOzQw) 78):
	{
		result = getModuleName_rlFejf61X39bVziQhhH7znQ(conf, (*n)._Ukind.S6.sons->data[((NI) 0)]);
	}
	break;
	default:
	{
		NimStringDesc* T20_;
		NimStringDesc* T21_;
		T20_ = (NimStringDesc*)0;
		T20_ = renderTree_ppjdh9aQ5L0SGPF8yz1gZ9cA(n, 0);
		T21_ = (NimStringDesc*)0;
		T21_ = nsuFormatSingleElem(((NimStringDesc*) &TM_GM5IT6miOywfWPAzqo7pmA_8), T20_);
		localError_NF6kBGchnhQYPbCedyefVA(conf, (*n).info, T21_);
		result = ((NimStringDesc*) NIM_NIL);
	}
	break;
	}
	return result;
}
Exemplo n.º 15
0
N_NIMCALL(void, handlecmdline_598601_957294627)(void) {
{	{
		NI LOC3;
		LOC3 = (NI)0;
		LOC3 = paramcount_143026_2125978480();
		if (!(LOC3 == ((NI) 0))) goto LA4;
		writecommandlineusage_280005_2004575671();
	}
	goto LA1;
	LA4: ;
	{
		NimStringDesc* scriptfile0;
		processcmdline_592203_3526807654(((Tcmdlinepass280008) 0), ((NimStringDesc*) &T957294627_2));
		{
			NimStringDesc* LOC11;
			NimStringDesc* LOC12;
			if (!eqStrings(gprojectname_169209_2607990831, ((NimStringDesc*) &T957294627_3))) goto LA9;
			LOC11 = (NimStringDesc*)0;
			LOC11 = gprojectname_169209_2607990831; gprojectname_169209_2607990831 = copyStringRC1(((NimStringDesc*) &T957294627_4));
			if (LOC11) nimGCunrefNoCycle(LOC11);
			LOC12 = (NimStringDesc*)0;
			LOC12 = gprojectfull_169211_2607990831; gprojectfull_169211_2607990831 = copyStringRC1(((NimStringDesc*) &T957294627_4));
			if (LOC12) nimGCunrefNoCycle(LOC12);
			asgnRefNoCycle((void**) (&gprojectpath_169210_2607990831), nosgetCurrentDir());
			gprojectisstdin_169212_2607990831 = NIM_TRUE;
		}
		goto LA7;
		LA9: ;
		{
			TSafePoint T957294627_5;
			TY128506 p0;
			NimStringDesc* LOC20;
			NimStringDesc* LOC21;
			if (!!(((gprojectname_169209_2607990831) && (gprojectname_169209_2607990831)->Sup.len == 0))) goto LA14;
			pushSafePoint(&T957294627_5);
			T957294627_5.status = _setjmp(T957294627_5.context);
			if (T957294627_5.status == 0) {
				asgnRefNoCycle((void**) (&gprojectfull_169211_2607990831), canonicalizepath_169405_2607990831(gprojectname_169209_2607990831));
				popSafePoint();
			}
			else {
				popSafePoint();
				if (isObj(getCurrentException()->Sup.m_type, (&NTI3630))) {
					NimStringDesc* LOC19;
					T957294627_5.status = 0;
					LOC19 = (NimStringDesc*)0;
					LOC19 = gprojectfull_169211_2607990831; gprojectfull_169211_2607990831 = copyStringRC1(gprojectname_169209_2607990831);
					if (LOC19) nimGCunrefNoCycle(LOC19);
					popCurrentException();
				}
			}
			if (T957294627_5.status != 0) reraiseException();
			memset((void*)(&p0), 0, sizeof(p0));
			chckNil((void*)(&p0));
			memset((void*)(&p0), 0, sizeof(p0));
			nossplitFile(gprojectfull_169211_2607990831, (&p0));
			LOC20 = (NimStringDesc*)0;
			LOC20 = gprojectpath_169210_2607990831; gprojectpath_169210_2607990831 = copyStringRC1(p0.Field0);
			if (LOC20) nimGCunrefNoCycle(LOC20);
			LOC21 = (NimStringDesc*)0;
			LOC21 = gprojectname_169209_2607990831; gprojectname_169209_2607990831 = copyStringRC1(p0.Field1);
			if (LOC21) nimGCunrefNoCycle(LOC21);
		}
		goto LA7;
		LA14: ;
		{
			asgnRefNoCycle((void**) (&gprojectpath_169210_2607990831), nosgetCurrentDir());
		}
		LA7: ;
		loadconfigs_290603_930198375(((NimStringDesc*) &T957294627_6));
		scriptfile0 = noschangeFileExt(gprojectfull_169211_2607990831, ((NimStringDesc*) &T957294627_7));
		{
			NIM_BOOL LOC25;
			LOC25 = (NIM_BOOL)0;
			LOC25 = fileexists_131604_2125978480(scriptfile0);
			if (!LOC25) goto LA26;
			runnimscript_597218_3062286716(scriptfile0, NIM_FALSE);
			{
				if (!eqStrings(scriptfile0, gprojectfull_169211_2607990831)) goto LA30;
				goto BeforeRet;
			}
			LA30: ;
		}
		goto LA23;
		LA26: ;
		{
			NimStringDesc* LOC33;
			NIM_BOOL LOC34;
			NimStringDesc* LOC37;
			LOC33 = (NimStringDesc*)0;
			LOC33 = HEX2F_128265_2125978480(gprojectpath_169210_2607990831, ((NimStringDesc*) &T957294627_8));
			LOC34 = (NIM_BOOL)0;
			LOC34 = fileexists_131604_2125978480(LOC33);
			if (!LOC34) goto LA35;
			LOC37 = (NimStringDesc*)0;
			LOC37 = HEX2F_128265_2125978480(gprojectpath_169210_2607990831, ((NimStringDesc*) &T957294627_8));
			runnimscript_597218_3062286716(LOC37, NIM_FALSE);
		}
		goto LA23;
		LA35: ;
		LA23: ;
		initvars_273834_2528170400();
		processcmdline_592203_3526807654(((Tcmdlinepass280008) 1), ((NimStringDesc*) &T957294627_2));
		{
			if (!((command_169215_2607990831) && (command_169215_2607990831)->Sup.len == 0)) goto LA40;
			rawmessage_194612_155036129(((Tmsgkind191002) 184), command_169215_2607990831);
		}
		LA40: ;
		maincommand_594610_6460232();
		{
			NIM_BOOL LOC44;
			NimStringDesc* LOC48;
			LOC44 = (NIM_BOOL)0;
			LOC44 = ((goptions_169128_2607990831 &(1U<<((NU)(((Toption169009) 12))&31U)))!=0);
			if (!(LOC44)) goto LA45;
			LOC44 = ((gnotes_192068_155036129 &((NU64)1<<((NU)((((Tmsgkind191002) 289)- 237))&63U)))!=0);
			LA45: ;
			if (!LOC44) goto LA46;
			LOC48 = (NimStringDesc*)0;
			LOC48 = Gcgetstatistics_10421_1689653243();
			printf("%s\012", LOC48? (LOC48)->data:"nil");
			fflush(stdout);
		}
		LA46: ;
		{
			if (!(gerrorcounter_192069_155036129 == ((NI) 0))) goto LA51;
			{
				if (!((gglobaloptions_169130_2607990831 &((NU64)1<<((NU)(((Tglobaloption169013) 13))&63U)))!=0)) goto LA55;
				{
					NimStringDesc* ex0;
					NimStringDesc* LOC70;
					NimStringDesc* LOC71;
					if (!(gcmd_169132_2607990831 == ((Tcommands169076) 4))) goto LA59;
					ex0 = (NimStringDesc*)0;
					{
						NimStringDesc* LOC65;
						if (!(((NI) 0) < (outfile_169136_2607990831 ? outfile_169136_2607990831->Sup.len : 0))) goto LA63;
						LOC65 = (NimStringDesc*)0;
						LOC65 = prependcurdir_598401_957294627(outfile_169136_2607990831);
						ex0 = nospquoteShell(LOC65);
					}
					goto LA61;
					LA63: ;
					{
						NimStringDesc* LOC67;
						NimStringDesc* LOC68;
						NimStringDesc* LOC69;
						LOC67 = (NimStringDesc*)0;
						LOC67 = noschangeFileExt(gprojectfull_169211_2607990831, ((NimStringDesc*) &T957294627_10));
						LOC68 = (NimStringDesc*)0;
						LOC68 = prependcurdir_598401_957294627(LOC67);
						LOC69 = (NimStringDesc*)0;
						LOC69 = completecfilepath_273854_2528170400(LOC68, NIM_TRUE);
						ex0 = nospquoteShell(LOC69);
					}
					LA61: ;
					LOC70 = (NimStringDesc*)0;
					LOC71 = (NimStringDesc*)0;
					LOC71 = findnodejs_596002_1446018522();
					LOC70 = rawNewString(LOC71->Sup.len + ex0->Sup.len + arguments_281811_2004575671->Sup.len + 2);
appendString(LOC70, LOC71);
appendString(LOC70, ((NimStringDesc*) &T957294627_11));
appendString(LOC70, ex0);
appendChar(LOC70, 32);
appendString(LOC70, arguments_281811_2004575671);
					execexternalprogram_273881_2528170400(LOC70, ((Tmsgkind191002) 284));
				}
				goto LA57;
				LA59: ;
				{
					NimStringDesc* ex0;
					NimStringDesc* LOC84;
					if (!(gcmd_169132_2607990831 == ((Tcommands169076) 5))) goto LA73;
					ex0 = (NimStringDesc*)0;
					{
						NimStringDesc* LOC79;
						if (!(((NI) 0) < (outfile_169136_2607990831 ? outfile_169136_2607990831->Sup.len : 0))) goto LA77;
						LOC79 = (NimStringDesc*)0;
						LOC79 = prependcurdir_598401_957294627(outfile_169136_2607990831);
						ex0 = nospquoteShell(LOC79);
					}
					goto LA75;
					LA77: ;
					{
						NimStringDesc* LOC81;
						NimStringDesc* LOC82;
						NimStringDesc* LOC83;
						LOC81 = (NimStringDesc*)0;
						LOC81 = noschangeFileExt(gprojectfull_169211_2607990831, ((NimStringDesc*) &T957294627_12));
						LOC82 = (NimStringDesc*)0;
						LOC82 = prependcurdir_598401_957294627(LOC81);
						LOC83 = (NimStringDesc*)0;
						LOC83 = completecfilepath_273854_2528170400(LOC82, NIM_TRUE);
						ex0 = nospquoteShell(LOC83);
					}
					LA75: ;
					LOC84 = (NimStringDesc*)0;
					LOC84 = rawNewString(ex0->Sup.len + arguments_281811_2004575671->Sup.len + 5);
appendString(LOC84, ((NimStringDesc*) &T957294627_13));
appendString(LOC84, ex0);
appendChar(LOC84, 32);
appendString(LOC84, arguments_281811_2004575671);
					execexternalprogram_273881_2528170400(LOC84, ((Tmsgkind191002) 284));
				}
				goto LA57;
				LA73: ;
				{
					NimStringDesc* binpath0;
					NimStringDesc* ex0;
					NimStringDesc* LOC92;
					binpath0 = (NimStringDesc*)0;
					{
						if (!(((NI) 0) < (outfile_169136_2607990831 ? outfile_169136_2607990831->Sup.len : 0))) goto LA88;
						binpath0 = prependcurdir_598401_957294627(outfile_169136_2607990831);
					}
					goto LA86;
					LA88: ;
					{
						NimStringDesc* LOC91;
						LOC91 = (NimStringDesc*)0;
						LOC91 = noschangeFileExt(gprojectfull_169211_2607990831, ((NimStringDesc*) &T957294627_2));
						binpath0 = prependcurdir_598401_957294627(LOC91);
					}
					LA86: ;
					ex0 = nospquoteShell(binpath0);
					LOC92 = (NimStringDesc*)0;
					LOC92 = rawNewString(ex0->Sup.len + arguments_281811_2004575671->Sup.len + 1);
appendString(LOC92, ex0);
appendChar(LOC92, 32);
appendString(LOC92, arguments_281811_2004575671);
					execexternalprogram_273881_2528170400(LOC92, ((Tmsgkind191002) 284));
				}
				LA57: ;
			}
			LA55: ;
		}
		LA51: ;
	}
	LA1: ;
	}BeforeRet: ;
}
Exemplo n.º 16
0
N_NIMCALL(NimStringDesc*, getpackagename_136811)(NimStringDesc* path) {
	NimStringDesc* result;
	NI parents;
	NimStringDesc* d_136835;
	NimStringDesc* current_136866;
	nimfr("getPackageName", "options.nim")
	result = 0;
	nimln(234, "options.nim");
	parents = 0;
	{
		NimStringDesc* d_136817;
		NimStringDesc* current_136864;
		d_136817 = 0;
		nimln(227, "options.nim");
		current_136864 = copyString(path);
		nimln(228, "options.nim");
		while (1) {
			NimStringDesc* file_136834;
			NimStringDesc* HEX3Atmp_136852;
			glob_t f_136854;
			NI res_136856;
			int LOC12;
			nimln(229, "options.nim");
			current_136864 = nosparentDir(current_136864);
			nimln(230, "options.nim");
			{
				nimln(230, "options.nim");
				nimln(230, "options.nim");
				if (!(current_136864->Sup.len == 0)) goto LA5;
				nimln(230, "options.nim");
				goto LA2;
			}
			LA5: ;
			nimln(227, "options.nim");
			d_136817 = current_136864;
			nimln(237, "options.nim");
			{
				NIM_BOOL LOC9;
				nimln(237, "options.nim");
				LOC9 = 0;
				LOC9 = nsthasKey(packagecache_136601, d_136817);
				if (!LOC9) goto LA10;
				nimln(239, "options.nim");
				nimln(239, "options.nim");
				result = nstGet(packagecache_136601, d_136817);
				goto BeforeRet;
			}
			LA10: ;
			nimln(240, "options.nim");
			parents = addInt(parents, 1);
			file_136834 = 0;
			HEX3Atmp_136852 = 0;
			nimln(241, "options.nim");
			HEX3Atmp_136852 = HEX2F_108477(d_136817, ((NimStringDesc*) &TMP425));
			memset((void*)&f_136854, 0, sizeof(f_136854));
			res_136856 = 0;
			nimln(1208, "os.nim");
			f_136854.gl_offs = 0;
			nimln(1209, "os.nim");
			f_136854.gl_pathc = 0;
			nimln(1210, "os.nim");
			f_136854.gl_pathv = NIM_NIL;
			nimln(1211, "os.nim");
			nimln(1211, "os.nim");
			LOC12 = 0;
			LOC12 = glob(HEX3Atmp_136852->data, ((int) 0), NIM_NIL, &f_136854);
			res_136856 = ((NI) (LOC12));
			nimln(1212, "os.nim");
			{
				NI i_136858;
				NI HEX3Atmp_136860;
				NI TMP426;
				NI res_136862;
				nimln(1212, "os.nim");
				if (!(res_136856 == 0)) goto LA15;
				i_136858 = 0;
				HEX3Atmp_136860 = 0;
				nimln(1213, "os.nim");
				nimln(1213, "os.nim");
				TMP426 = subInt(f_136854.gl_pathc, 1);
				HEX3Atmp_136860 = (NI32)(TMP426);
				nimln(1457, "system.nim");
				res_136862 = 0;
				nimln(1458, "system.nim");
				while (1) {
					TY108700 LOC22;
					nimln(1458, "system.nim");
					if (!(res_136862 <= HEX3Atmp_136860)) goto LA17;
					nimln(1457, "system.nim");
					i_136858 = res_136862;
					nimln(1214, "os.nim");
					{
						nimln(1214, "os.nim");
						nimln(1214, "os.nim");
						nimln(1214, "os.nim");
						if ((NU)(i_136858) > (NU)(50000)) raiseIndexError();
						if (!!(!((f_136854.gl_pathv[(i_136858)- 0] == NIM_NIL)))) goto LA20;
						nimln(1214, "os.nim");
						failedassertimpl_79821(((NimStringDesc*) &TMP427));
					}
					LA20: ;
					nimln(1215, "os.nim");
					nimln(1215, "os.nim");
					if ((NU)(i_136858) > (NU)(50000)) raiseIndexError();
					file_136834 = cstrToNimstr(f_136854.gl_pathv[(i_136858)- 0]);
					nimln(242, "options.nim");
					nimln(242, "options.nim");
					memset((void*)&LOC22, 0, sizeof(LOC22));
					nossplitFile(file_136834, &LOC22);
					result = copyString(LOC22.Field1);
					nimln(243, "options.nim");
					goto LA1;
					nimln(1460, "system.nim");
					res_136862 = addInt(res_136862, 1);
				} LA17: ;
			}
			LA15: ;
			nimln(1216, "os.nim");
			globfree(&f_136854);
		} LA2: ;
	} LA1: ;
	nimln(245, "options.nim");
	{
		nimln(245, "options.nim");
		if (!result == 0) goto LA25;
		nimln(245, "options.nim");
		result = copyString(((NimStringDesc*) &TMP404));
	}
	LA25: ;
	d_136835 = 0;
	nimln(227, "options.nim");
	current_136866 = copyString(path);
	nimln(228, "options.nim");
	while (1) {
		nimln(229, "options.nim");
		current_136866 = nosparentDir(current_136866);
		nimln(230, "options.nim");
		{
			nimln(230, "options.nim");
			nimln(230, "options.nim");
			if (!(current_136866->Sup.len == 0)) goto LA30;
			nimln(230, "options.nim");
			goto LA27;
		}
		LA30: ;
		nimln(227, "options.nim");
		d_136835 = current_136866;
		nimln(248, "options.nim");
		nstPut(packagecache_136601, d_136835, result);
		nimln(249, "options.nim");
		parents = subInt(parents, 1);
		nimln(250, "options.nim");
		{
			nimln(250, "options.nim");
			if (!(parents <= 0)) goto LA34;
			nimln(250, "options.nim");
			goto LA27;
		}
		LA34: ;
	} LA27: ;
	BeforeRet: ;
	popFrame();
	return result;
}
N_NIMCALL(void, loadfile_343030_3901077974)(Tlineinfo189336 info0) {
	NI32 i0;
	i0 = info0.fileindex;
	{
		if (!((gsourcefiles_343028_3901077974 ? gsourcefiles_343028_3901077974->Sup.len : 0) <= ((NI) (i0)))) goto LA3;
		gsourcefiles_343028_3901077974 = (TY343011*) setLengthSeq(&(gsourcefiles_343028_3901077974)->Sup, sizeof(Tsourcefile343003), ((NI) ((NI32)(i0 + ((NI32) 1)))));
	}
	LA3: ;
	{
		NimStringDesc* path0;
		NimStringDesc* LOC9;
		TY124315 LOC10;
		Baselexer216007 lex0;
		Filestreamobj157877* LOC19;
		Streamobj156818* LOC20;
		NI pos0;
		if (!gsourcefiles_343028_3901077974->data[i0].lines == 0) goto LA7;
		gsourcefiles_343028_3901077974->data[i0].fileidx = info0.fileindex;
		if (gsourcefiles_343028_3901077974->data[i0].lines) nimGCunrefNoCycle(gsourcefiles_343028_3901077974->data[i0].lines);
		gsourcefiles_343028_3901077974->data[i0].lines = (TY134602*) newSeqRC1((&NTI134602), 0);
		path0 = tofullpath_190264_155036129(info0.fileindex);
		LOC9 = (NimStringDesc*)0;
		LOC9 = gsourcefiles_343028_3901077974->data[i0].fullpath; gsourcefiles_343028_3901077974->data[i0].fullpath = copyStringRC1(path0);
		if (LOC9) nimGCunrefNoCycle(LOC9);
		memset((void*)(&LOC10), 0, sizeof(LOC10));
		nossplitFile(path0, (&LOC10));
		gsourcefiles_343028_3901077974->data[i0].isnimfixfile = eqStrings(LOC10.Field2, ((NimStringDesc*) &T3901077974_5));
		{
			NimStringDesc* line_343077_3901077974;
			FILE* f_343104_3901077974;
			TSafePoint T3901077974_6;
			line_343077_3901077974 = (NimStringDesc*)0;
			f_343104_3901077974 = open_14817_1689653243(path0, ((Filemode13009) 0), ((NI) 8000));
			pushSafePoint(&T3901077974_6);
			T3901077974_6.status = setjmp(T3901077974_6.context);
			if (T3901077974_6.status == 0) {
				NimStringDesc* res_343106_3901077974;
				res_343106_3901077974 = rawNewString(((NI) 80));
				{
					while (1) {
						NIM_BOOL LOC15;
						NimStringDesc* LOC16;
						LOC15 = (NIM_BOOL)0;
						LOC15 = readline_14915_1689653243(f_343104_3901077974, (&res_343106_3901077974));
						if (!LOC15) goto LA14;
						line_343077_3901077974 = res_343106_3901077974;
						gsourcefiles_343028_3901077974->data[i0].lines = (TY134602*) incrSeqV2(&(gsourcefiles_343028_3901077974->data[i0].lines)->Sup, sizeof(NimStringDesc*));
						LOC16 = (NimStringDesc*)0;
						LOC16 = gsourcefiles_343028_3901077974->data[i0].lines->data[gsourcefiles_343028_3901077974->data[i0].lines->Sup.len]; gsourcefiles_343028_3901077974->data[i0].lines->data[gsourcefiles_343028_3901077974->data[i0].lines->Sup.len] = copyStringRC1(line_343077_3901077974);
						if (LOC16) nimGCunrefNoCycle(LOC16);
						++gsourcefiles_343028_3901077974->data[i0].lines->Sup.len;
					} LA14: ;
				}
				popSafePoint();
			}
			else {
				popSafePoint();
			}
			{
				close_14853_1689653243(f_343104_3901077974);
			}
			if (T3901077974_6.status != 0) reraiseException();
		}
		memset((void*)(&lex0), 0, sizeof(lex0));
		lex0.Sup.m_type = (&NTI216007);
		LOC19 = (Filestreamobj157877*)0;
		LOC19 = newfilestream_157942_1780494535(path0, ((Filemode13009) 0));
		LOC20 = (Streamobj156818*)0;
		LOC20 = &LOC19->Sup;
		open_218223_1314243012((&lex0), LOC20, ((NI) 8192), T3901077974_7);
		pos0 = lex0.bufpos;
		{
			while (1) {
				switch (((NU8)(lex0.buf[pos0]))) {
				case 13:
				{
					NimStringDesc* LOC24;
					LOC24 = (NimStringDesc*)0;
					LOC24 = gsourcefiles_343028_3901077974->data[i0].newline; gsourcefiles_343028_3901077974->data[i0].newline = copyStringRC1(((NimStringDesc*) &T3901077974_8));
					if (LOC24) nimGCunrefNoCycle(LOC24);
					goto LA21;
				}
				break;
				case 10:
				case 0:
				{
					NimStringDesc* LOC26;
					LOC26 = (NimStringDesc*)0;
					LOC26 = gsourcefiles_343028_3901077974->data[i0].newline; gsourcefiles_343028_3901077974->data[i0].newline = copyStringRC1(((NimStringDesc*) &T3901077974_9));
					if (LOC26) nimGCunrefNoCycle(LOC26);
					goto LA21;
				}
				break;
				default:
				{
				}
				break;
				}
				pos0 += ((NI) 1);
			}
		} LA21: ;
		close_216021_1314243012((&lex0));
	}
	LA7: ;
}
Exemplo n.º 18
0
N_NIMCALL(void, Callccompiler_70806)(NimStringDesc* Projectfile_70808) {
NimStringDesc* Linkcmd_70809;
NimStringDesc* Buildgui_70810;
NimStringDesc* Builddll_70811;
NU8 C_70833;
TY52008* Script_70834;
TY39221* Cmds_70851;
NI Res_70869;
NI I_70895;
NI HEX3Atmp_71050;
NI Res_71052;
NI LOC14;
NIM_BOOL LOC15;
TY46331 LOC22;
NimStringDesc* Linkerexe_70936;
NimStringDesc* LOC26;
NimStringDesc* LOC36;
NimStringDesc* Exefile_70970;
TY47805 LOC43;
TY38661 LOC44;
NimStringDesc* LOC45;
TY38661 LOC46;
TY38661 LOC50;
TY43015* It_70995;
NimStringDesc* Objfiles_70996;
NimStringDesc* LOC55;
NimStringDesc* LOC56;
NimStringDesc* LOC57;
NimStringDesc* LOC58;
TY71019 LOC59;
NimStringDesc* LOC60;
TY71019 LOC61;
NimStringDesc* LOC62;
Linkcmd_70809 = 0;
Buildgui_70810 = 0;
Builddll_70811 = 0;
if (!((Gglobaloptions_46079 & 4160) == 64)) goto LA2;
goto BeforeRet;
LA2: ;
Filecounter_70611 = 0;
C_70833 = 0;
C_70833 = Ccompiler_70340;
Script_70834 = 0;
Script_70834 = NIM_NIL;
Cmds_70851 = 0;
Cmds_70851 = (TY39221*) newSeq(NTI39221, 0);
Compilecfile_70733(&Tocompile_70345, &Script_70834, &Cmds_70851, NIM_FALSE);
Compilecfile_70733(&Externaltocompile_70346, &Script_70834, &Cmds_70851, NIM_TRUE);
if (!!(((Gglobaloptions_46079 &(1<<((((NU8) 6))&31)))!=0))) goto LA5;
if (!(Gnumberofprocessors_46086 == 0)) goto LA8;
Gnumberofprocessors_46086 = nospcountProcessors();
LA8: ;
Res_70869 = 0;
Res_70869 = 0;
if (!(Gnumberofprocessors_46086 <= 1)) goto LA11;
I_70895 = 0;
HEX3Atmp_71050 = 0;
HEX3Atmp_71050 = (Cmds_70851->Sup.len-1);
Res_71052 = 0;
Res_71052 = 0;
while (1) {
if (!(Res_71052 <= HEX3Atmp_71050)) goto LA13;
I_70895 = Res_71052;
LOC14 = nospexecCmd(Cmds_70851->data[I_70895]);
Res_70869 = ((LOC14 >= Res_70869) ? LOC14 : Res_70869);
Res_71052 += 1;
} LA13: ;
goto LA10;
LA11: ;
LOC15 = ((Gglobaloptions_46079 &(1<<((((NU8) 5))&31)))!=0);
if (LOC15) goto LA16;
LOC15 = (0 < Gverbosity_46085);
LA16: ;
if (!LOC15) goto LA17;
Res_70869 = nospexecProcesses(Cmds_70851->data, Cmds_70851->Sup.len, 11, Gnumberofprocessors_46086);
goto LA10;
LA17: ;
Res_70869 = nospexecProcesses(Cmds_70851->data, Cmds_70851->Sup.len, 10, Gnumberofprocessors_46086);
LA10: ;
if (!!((Res_70869 == 0))) goto LA20;
memset((void*)&LOC22, 0, sizeof(LOC22));
Rawmessage_47971(((NU8) 62), LOC22, 0);
LA20: ;
LA5: ;
if (!!(((Gglobaloptions_46079 &(1<<((((NU8) 7))&31)))!=0))) goto LA24;
Linkerexe_70936 = 0;
LOC26 = 0;
LOC26 = rawNewString(Cc_70041[(C_70833)-1].Name->Sup.len + 10);
appendString(LOC26, Cc_70041[(C_70833)-1].Name);
appendString(LOC26, ((NimStringDesc*) &TMP196872));
Linkerexe_70936 = Getconfigvar_46135(LOC26);
if (!(Linkerexe_70936->Sup.len == 0)) goto LA28;
Linkerexe_70936 = copyString(Cc_70041[(C_70833)-1].Linkerexe);
LA28: ;
if (!(Targetos_51570 == ((NU8) 2))) goto LA31;
Linkerexe_70936 = nosaddFileExt(Linkerexe_70936, ((NimStringDesc*) &TMP196792));
LA31: ;
if (!!((Hostos_51571 == Targetos_51570))) goto LA34;
Linkcmd_70809 = Quoteifcontainswhite_26268(Linkerexe_70936);
goto LA33;
LA34: ;
LOC36 = 0;
LOC36 = nosJoinPath(Ccompilerpath_70349, Linkerexe_70936);
Linkcmd_70809 = Quoteifcontainswhite_26268(LOC36);
LA33: ;
if (!((Gglobaloptions_46079 &(1<<((((NU8) 11))&31)))!=0)) goto LA38;
Buildgui_70810 = copyString(Cc_70041[(C_70833)-1].Buildgui);
goto LA37;
LA38: ;
Buildgui_70810 = copyString(((NimStringDesc*) &TMP70271));
LA37: ;
Exefile_70970 = 0;
if (!((Gglobaloptions_46079 &(1<<((((NU8) 10))&31)))!=0)) goto LA41;
memset((void*)&LOC43, 0, sizeof(LOC43));
memset((void*)&LOC44, 0, sizeof(LOC44));
nossplitFile(Projectfile_70808, &LOC44);
LOC43[0] = copyString(LOC44.Name);
Exefile_70970 = nsuFormatOpenArray(Os_51053[(Targetos_51570)-1].Dllfrmt, LOC43, 1);
Builddll_70811 = copyString(Cc_70041[(C_70833)-1].Builddll);
goto LA40;
LA41: ;
LOC45 = 0;
memset((void*)&LOC46, 0, sizeof(LOC46));
nossplitFile(Projectfile_70808, &LOC46);
LOC45 = rawNewString(LOC46.Name->Sup.len + Os_51053[(Targetos_51570)-1].Exeext->Sup.len + 0);
appendString(LOC45, LOC46.Name);
appendString(LOC45, Os_51053[(Targetos_51570)-1].Exeext);
Exefile_70970 = LOC45;
Builddll_70811 = copyString(((NimStringDesc*) &TMP70271));
LA40: ;
if (!(Targetos_51570 == Hostos_51571)) goto LA48;
memset((void*)&LOC50, 0, sizeof(LOC50));
nossplitFile(Projectfile_70808, &LOC50);
Exefile_70970 = nosJoinPath(LOC50.Dir, Exefile_70970);
LA48: ;
Exefile_70970 = Quoteifcontainswhite_26268(Exefile_70970);
It_70995 = 0;
It_70995 = ((TY43015*) (Tolink_70344.Head));
Objfiles_70996 = 0;
Objfiles_70996 = copyString(((NimStringDesc*) &TMP70271));
while (1) {
if (!!((It_70995 == NIM_NIL))) goto LA51;
Objfiles_70996 = addChar(Objfiles_70996, 32);
if (!(Targetos_51570 == Hostos_51571)) goto LA53;
LOC55 = 0;
LOC55 = nosaddFileExt((*It_70995).Data, Cc_70041[(Ccompiler_70340)-1].Objext);
LOC56 = 0;
LOC56 = Quoteifcontainswhite_26268(LOC55);
Objfiles_70996 = resizeString(Objfiles_70996, LOC56->Sup.len + 0);
appendString(Objfiles_70996, LOC56);
goto LA52;
LA53: ;
LOC57 = 0;
LOC57 = nosaddFileExt((*It_70995).Data, Cc_70041[(Ccompiler_70340)-1].Objext);
LOC58 = 0;
LOC58 = Quoteifcontainswhite_26268(LOC57);
Objfiles_70996 = resizeString(Objfiles_70996, LOC58->Sup.len + 0);
appendString(Objfiles_70996, LOC58);
LA52: ;
It_70995 = ((TY43015*) ((*It_70995).Sup.Next));
} LA51: ;
memset((void*)&LOC59, 0, sizeof(LOC59));
LOC59[0] = copyString(((NimStringDesc*) &TMP196873));
LOC59[1] = copyString(Builddll_70811);
LOC59[2] = copyString(((NimStringDesc*) &TMP196874));
LOC59[3] = copyString(Buildgui_70810);
LOC59[4] = copyString(((NimStringDesc*) &TMP196795));
LOC59[5] = copyString(Linkoptions_70347);
LOC59[6] = copyString(((NimStringDesc*) &TMP196875));
LOC59[7] = copyString(Objfiles_70996);
LOC59[8] = copyString(((NimStringDesc*) &TMP196876));
LOC59[9] = copyString(Exefile_70970);
LOC59[10] = copyString(((NimStringDesc*) &TMP196797));
LOC59[11] = Getprefixdir_46109();
LOC59[12] = copyString(((NimStringDesc*) &TMP196798));
LOC59[13] = copyString(Libpath_46112);
LOC60 = 0;
LOC60 = nsuFormatOpenArray(Linkcmd_70809, LOC59, 14);
Linkcmd_70809 = Quoteifcontainswhite_26268(LOC60);
Linkcmd_70809 = addChar(Linkcmd_70809, 32);
memset((void*)&LOC61, 0, sizeof(LOC61));
LOC61[0] = copyString(((NimStringDesc*) &TMP196873));
LOC61[1] = copyString(Builddll_70811);
LOC61[2] = copyString(((NimStringDesc*) &TMP196874));
LOC61[3] = copyString(Buildgui_70810);
LOC61[4] = copyString(((NimStringDesc*) &TMP196795));
LOC61[5] = copyString(Linkoptions_70347);
LOC61[6] = copyString(((NimStringDesc*) &TMP196875));
LOC61[7] = copyString(Objfiles_70996);
LOC61[8] = copyString(((NimStringDesc*) &TMP196876));
LOC61[9] = copyString(Exefile_70970);
LOC61[10] = copyString(((NimStringDesc*) &TMP196797));
LOC62 = 0;
LOC62 = Getprefixdir_46109();
LOC61[11] = Quoteifcontainswhite_26268(LOC62);
LOC61[12] = copyString(((NimStringDesc*) &TMP196798));
LOC61[13] = Quoteifcontainswhite_26268(Libpath_46112);
nsuAddf(&Linkcmd_70809, Cc_70041[(C_70833)-1].Linktmpl, LOC61, 14);
if (!!(((Gglobaloptions_46079 &(1<<((((NU8) 6))&31)))!=0))) goto LA64;
Execexternalprogram_70570(Linkcmd_70809);
LA64: ;
goto LA23;
LA24: ;
Linkcmd_70809 = copyString(((NimStringDesc*) &TMP70271));
LA23: ;
if (!((Gglobaloptions_46079 &(1<<((((NU8) 12))&31)))!=0)) goto LA67;
App_52036(&Script_70834, Linkcmd_70809);
App_52036(&Script_70834, Tnl_51581);
Generatescript_70590(Projectfile_70808, Script_70834);
LA67: ;
BeforeRet: ;
}
Exemplo n.º 19
0
N_NIMCALL(void, handlecmdline_527607)(void) {
	{
		NI LOC3;
		LOC3 = 0;
		LOC3 = paramcount_124830();
		if (!(LOC3 == ((NI) 0))) goto LA4;
		writecommandlineusage_175020();
	}
	goto LA1;
	LA4: ;
	{
		processcmdline_521209(((NU8) 0), ((NimStringDesc*) &TMP1869));
		{
			TSafePoint TMP1870;
			TY118589 p;
			NimStringDesc* LOC15;
			NimStringDesc* LOC16;
			if (!!(((gprojectname_153234) && (gprojectname_153234)->Sup.len == 0))) goto LA9;
			pushSafePoint(&TMP1870);
			TMP1870.status = setjmp(TMP1870.context);
			if (TMP1870.status == 0) {
				asgnRefNoCycle((void**) (&gprojectfull_153236), canonicalizepath_153380(gprojectname_153234));
				popSafePoint();
			}
			else {
				popSafePoint();
				if (isObj(getCurrentException()->Sup.m_type, (&NTI3433))) {
					NimStringDesc* LOC14;
					TMP1870.status = 0;
					LOC14 = 0;
					LOC14 = gprojectfull_153236; gprojectfull_153236 = copyStringRC1(gprojectname_153234);
					if (LOC14) nimGCunrefNoCycle(LOC14);
					popCurrentException();
				}
			}
			if (TMP1870.status != 0) reraiseException();
			memset((void*)(&p), 0, sizeof(p));
			chckNil((void*)(&p));
			memset((void*)(&p), 0, sizeof(p));
			nossplitFile(gprojectfull_153236, (&p));
			LOC15 = 0;
			LOC15 = gprojectpath_153235; gprojectpath_153235 = copyStringRC1(p.Field0);
			if (LOC15) nimGCunrefNoCycle(LOC15);
			LOC16 = 0;
			LOC16 = gprojectname_153234; gprojectname_153234 = copyStringRC1(p.Field1);
			if (LOC16) nimGCunrefNoCycle(LOC16);
		}
		goto LA7;
		LA9: ;
		{
			asgnRefNoCycle((void**) (&gprojectpath_153235), nosgetCurrentDir());
		}
		LA7: ;
		loadconfigs_185811(((NimStringDesc*) &TMP1898));
		initvars_169876();
		processcmdline_521209(((NU8) 1), ((NimStringDesc*) &TMP1869));
		maincommand_524628();
		{
			NimStringDesc* LOC22;
			if (!(((NI) 2) <= gverbosity_153137)) goto LA20;
			LOC22 = 0;
			LOC22 = Gcgetstatistics_8821();
			printf("%s\012", LOC22? (LOC22)->data:"nil");
		}
		LA20: ;
		{
			if (!(gerrorcounter_163016 == ((NI) 0))) goto LA25;
			{
				if (!((gglobaloptions_153128 &(1<<((((NU8) 13))&31)))!=0)) goto LA29;
				{
					NimStringDesc* LOC35;
					if (!eqStrings(gprojectname_153234, ((NimStringDesc*) &TMP5024))) goto LA33;
					LOC35 = 0;
					LOC35 = gprojectfull_153236; gprojectfull_153236 = copyStringRC1(((NimStringDesc*) &TMP5025));
					if (LOC35) nimGCunrefNoCycle(LOC35);
				}
				LA33: ;
				{
					NimStringDesc* ex;
					NimStringDesc* LOC49;
					NimStringDesc* LOC50;
					if (!(gcmd_153130 == ((NU8) 4))) goto LA38;
					ex = 0;
					{
						NimStringDesc* LOC44;
						if (!(((NI) 0) < (outfile_153134 ? outfile_153134->Sup.len : 0))) goto LA42;
						LOC44 = 0;
						LOC44 = prependcurdir_527401(outfile_153134);
						ex = nospquoteShell(LOC44);
					}
					goto LA40;
					LA42: ;
					{
						NimStringDesc* LOC46;
						NimStringDesc* LOC47;
						NimStringDesc* LOC48;
						LOC46 = 0;
						LOC46 = noschangeFileExt(gprojectfull_153236, ((NimStringDesc*) &TMP5027));
						LOC47 = 0;
						LOC47 = prependcurdir_527401(LOC46);
						LOC48 = 0;
						LOC48 = completecfilepath_169912(LOC47, NIM_TRUE);
						ex = nospquoteShell(LOC48);
					}
					LA40: ;
					LOC49 = 0;
					LOC50 = 0;
					LOC50 = findnodejs_526009();
					LOC49 = rawNewString(LOC50->Sup.len + ex->Sup.len + arguments_176723->Sup.len + 2);
appendString(LOC49, LOC50);
appendString(LOC49, ((NimStringDesc*) &TMP5030));
appendString(LOC49, ex);
appendChar(LOC49, 32);
appendString(LOC49, arguments_176723);
					execexternalprogram_169985(LOC49, ((NimStringDesc*) &TMP1869));
				}
				goto LA36;
				LA38: ;
				{
					NimStringDesc* binpath;
					NimStringDesc* ex;
					NimStringDesc* LOC58;
					binpath = 0;
					{
						if (!(((NI) 0) < (outfile_153134 ? outfile_153134->Sup.len : 0))) goto LA54;
						binpath = prependcurdir_527401(outfile_153134);
					}
					goto LA52;
					LA54: ;
					{
						NimStringDesc* LOC57;
						LOC57 = 0;
						LOC57 = noschangeFileExt(gprojectfull_153236, ((NimStringDesc*) &TMP1869));
						binpath = prependcurdir_527401(LOC57);
					}
					LA52: ;
					ex = nospquoteShell(binpath);
					LOC58 = 0;
					LOC58 = rawNewString(ex->Sup.len + arguments_176723->Sup.len + 1);
appendString(LOC58, ex);
appendChar(LOC58, 32);
appendString(LOC58, arguments_176723);
					execexternalprogram_169985(LOC58, ((NimStringDesc*) &TMP1869));
				}
				LA36: ;
			}
			LA29: ;
		}
		LA25: ;
	}
	LA1: ;
}
Exemplo n.º 20
0
N_NIMCALL(TY55526*, Adddotdependency_187025)(TY105002* C_187027, TY55526* N_187028) {
TY55526* Result_187029;
TY187010* G_187030;
NI I_187054;
NI HEX3Atmp_187102;
NI LOC1;
NI Res_187104;
NimStringDesc* Imported_187067;
NimStringDesc* LOC3;
TY38661 LOC4;
NimStringDesc* Imported_187080;
NimStringDesc* LOC5;
TY38661 LOC6;
NI I_187089;
NI HEX3Atmp_187105;
NI LOC7;
NI Res_187107;
TY55526* LOC9;
Result_187029 = 0;
Result_187029 = N_187028;
G_187030 = 0;
G_187030 = ((TY187010*) (C_187027));
switch ((*N_187028).Kind) {
case ((NU8) 102):
I_187054 = 0;
HEX3Atmp_187102 = 0;
LOC1 = Sonslen_55804(N_187028);
HEX3Atmp_187102 = (NI64)(LOC1 - 1);
Res_187104 = 0;
Res_187104 = 0;
while (1) {
if (!(Res_187104 <= HEX3Atmp_187102)) goto LA2;
I_187054 = Res_187104;
Imported_187067 = 0;
LOC3 = 0;
LOC3 = Getmodulefile_110013((*N_187028).KindU.S6.Sons->data[I_187054]);
memset((void*)&LOC4, 0, sizeof(LOC4));
nossplitFile(LOC3, &LOC4);
Imported_187067 = copyString(LOC4.Name);
Adddependencyaux_187016((*(*(*G_187030).Module).Name).S, Imported_187067);
Res_187104 += 1;
} LA2: ;
break;
case ((NU8) 103):
Imported_187080 = 0;
LOC5 = 0;
LOC5 = Getmodulefile_110013((*N_187028).KindU.S6.Sons->data[0]);
memset((void*)&LOC6, 0, sizeof(LOC6));
nossplitFile(LOC5, &LOC6);
Imported_187080 = copyString(LOC6.Name);
Adddependencyaux_187016((*(*(*G_187030).Module).Name).S, Imported_187080);
break;
case ((NU8) 101):
case ((NU8) 99):
case ((NU8) 106):
case ((NU8) 107):
I_187089 = 0;
HEX3Atmp_187105 = 0;
LOC7 = Sonslen_55804(N_187028);
HEX3Atmp_187105 = (NI64)(LOC7 - 1);
Res_187107 = 0;
Res_187107 = 0;
while (1) {
if (!(Res_187107 <= HEX3Atmp_187105)) goto LA8;
I_187089 = Res_187107;
LOC9 = 0;
LOC9 = Adddotdependency_187025(C_187027, (*N_187028).KindU.S6.Sons->data[I_187089]);
Res_187107 += 1;
} LA8: ;
break;
default:
break;
}
return Result_187029;
}
Exemplo n.º 21
0
N_NIMCALL(void, handlecmdline_424603)(void) {
	nimfr("HandleCmdLine", "nimrod.nim")
	nimln(35, "nimrod.nim");
	{
		NI LOC3;
		nimln(35, "nimrod.nim");
		nimln(35, "nimrod.nim");
		LOC3 = 0;
		LOC3 = paramcount_107029();
		if (!(LOC3 == 0)) goto LA4;
		nimln(36, "nimrod.nim");
		writecommandlineusage_152002();	}	goto LA1;
	LA4: ;
	{
		nimln(39, "nimrod.nim");
		processcmdline_419207(((NU8) 0), ((NimStringDesc*) &TMP7233));		nimln(40, "nimrod.nim");
		{
			TSafePoint TMP7234;
			TY102259 p;
			NimStringDesc* LOC15;
			NimStringDesc* LOC16;
			nimln(698, "system.nim");
			nimln(698, "system.nim");
			if (!!(((gprojectname_114197) && (gprojectname_114197)->Sup.len == 0))) goto LA9;
			nimln(41, "nimrod.nim");
			pushSafePoint(&TMP7234);
			TMP7234.status = setjmp(TMP7234.context);
			if (TMP7234.status == 0) {
				nimln(42, "nimrod.nim");
				asgnRefNoCycle((void**) &gprojectfull_114199, canonicalizepath_114316(gprojectname_114197));
				popSafePoint();
			}			else {
				popSafePoint();
				setFrame((TFrame*)&F);
				if (isObj(getCurrentException()->Sup.m_type, (&NTI1035))) {
					NimStringDesc* LOC14;
					TMP7234.status = 0;
					nimln(44, "nimrod.nim");
					LOC14 = 0;
					LOC14 = gprojectfull_114199; gprojectfull_114199 = copyStringRC1(gprojectname_114197);
					if (LOC14) nimGCunrefNoCycle(LOC14);
					popCurrentException();
				}			}			if (TMP7234.status != 0) reraiseException();
			nimln(45, "nimrod.nim");
			chckNil((void*)&p);
			memset((void*)&p, 0, sizeof(p));
			nossplitFile(gprojectfull_114199, &p);			nimln(46, "nimrod.nim");
			LOC15 = 0;
			LOC15 = gprojectpath_114198; gprojectpath_114198 = copyStringRC1(p.Field0);
			if (LOC15) nimGCunrefNoCycle(LOC15);
			nimln(47, "nimrod.nim");
			LOC16 = 0;
			LOC16 = gprojectname_114197; gprojectname_114197 = copyStringRC1(p.Field1);
			if (LOC16) nimGCunrefNoCycle(LOC16);
		}		goto LA7;
		LA9: ;
		{
			nimln(49, "nimrod.nim");
			asgnRefNoCycle((void**) &gprojectpath_114198, nosgetCurrentDir());
		}		LA7: ;
		nimln(50, "nimrod.nim");
		loadconfigs_168607(((NimStringDesc*) &TMP7235));		nimln(53, "nimrod.nim");
		initvars_148647();		nimln(54, "nimrod.nim");
		processcmdline_419207(((NU8) 1), ((NimStringDesc*) &TMP7233));		nimln(55, "nimrod.nim");
		maincommand_422811();		nimln(56, "nimrod.nim");
		{
			NimStringDesc* LOC22;
			nimln(702, "system.nim");
			if (!(2 <= gverbosity_114117)) goto LA20;
			nimln(56, "nimrod.nim");
			nimln(56, "nimrod.nim");
			LOC22 = 0;
			LOC22 = gcgetstatistics_6021();
			printf("%s\012", (LOC22)->data);
		}		LA20: ;
		nimln(58, "nimrod.nim");
		{
			nimln(58, "nimrod.nim");
			if (!(gerrorcounter_138074 == 0)) goto LA25;
			nimln(62, "nimrod.nim");
			{
				nimln(730, "system.nim");
				if (!((gglobaloptions_114109 &(1<<((((NU8) 13))&31)))!=0)) goto LA29;
				nimln(63, "nimrod.nim");
				{
					NimStringDesc* ex;
					NimStringDesc* LOC35;
					NimStringDesc* LOC36;
					NimStringDesc* LOC37;
					NimStringDesc* LOC38;
					nimln(63, "nimrod.nim");
					if (!(gcmd_114111 == ((NU8) 4))) goto LA33;
					nimln(64, "nimrod.nim");
					nimln(65, "nimrod.nim");
					nimln(65, "nimrod.nim");
					nimln(65, "nimrod.nim");
					LOC35 = 0;
					LOC35 = nosChangeFileExt(gprojectfull_114199, ((NimStringDesc*) &TMP7236));
					LOC36 = 0;
					LOC36 = prependcurdir_424401(LOC35);
					LOC37 = 0;
					LOC37 = completecfilepath_148681(LOC36, NIM_TRUE);
					ex = nospquoteShell(LOC37);
					nimln(66, "nimrod.nim");
					nimln(66, "nimrod.nim");
					LOC38 = 0;
					LOC38 = rawNewString(ex->Sup.len + arguments_419205->Sup.len + 6);
appendString(LOC38, ((NimStringDesc*) &TMP7237));
appendString(LOC38, ex);
appendChar(LOC38, 32);
appendString(LOC38, arguments_419205);
					execexternalprogram_148713(LOC38);				}				goto LA31;
				LA33: ;
				{
					NimStringDesc* binpath;
					NimStringDesc* ex;
					NimStringDesc* LOC46;
					binpath = 0;
					nimln(69, "nimrod.nim");
					{
						nimln(706, "system.nim");
						nimln(69, "nimrod.nim");
						if (!(0 < outfile_114115->Sup.len)) goto LA42;
						nimln(71, "nimrod.nim");
						binpath = prependcurdir_424401(outfile_114115);
					}					goto LA40;
					LA42: ;
					{
						NimStringDesc* LOC45;
						nimln(74, "nimrod.nim");
						nimln(74, "nimrod.nim");
						LOC45 = 0;
						LOC45 = nosChangeFileExt(gprojectfull_114199, ((NimStringDesc*) &TMP7233));
						binpath = prependcurdir_424401(LOC45);
					}					LA40: ;
					nimln(75, "nimrod.nim");
					ex = nospquoteShell(binpath);
					nimln(76, "nimrod.nim");
					nimln(76, "nimrod.nim");
					LOC46 = 0;
					LOC46 = rawNewString(ex->Sup.len + arguments_419205->Sup.len + 1);
appendString(LOC46, ex);
appendChar(LOC46, 32);
appendString(LOC46, arguments_419205);
					execexternalprogram_148713(LOC46);				}				LA31: ;
			}			LA29: ;
		}		LA25: ;
	}	LA1: ;
	popFrame();
}
Exemplo n.º 22
0
N_NIMCALL(void, handlecmdline_529603)(void) {
	nimfr("handleCmdLine", "nimrod.nim")
	nimln(35, "nimrod.nim");
	{
		NI LOC3;
		nimln(35, "nimrod.nim");
		nimln(35, "nimrod.nim");
		LOC3 = 0;
		LOC3 = paramcount_114233();
		if (!(LOC3 == 0)) goto LA4;
		nimln(36, "nimrod.nim");
		writecommandlineusage_171002();
	}
	goto LA1;
	LA4: ;
	{
		nimln(39, "nimrod.nim");
		processcmdline_523207(((NU8) 0), ((NimStringDesc*) &TMP7787));
		nimln(40, "nimrod.nim");
		{
			TSafePoint TMP7788;
			TY108700 p;
			NimStringDesc* LOC15;
			NimStringDesc* LOC16;
			nimln(40, "nimrod.nim");
			nimln(40, "nimrod.nim");
			if (!!(((gprojectname_135206) && (gprojectname_135206)->Sup.len == 0))) goto LA9;
			nimln(41, "nimrod.nim");
			pushSafePoint(&TMP7788);
			TMP7788.status = setjmp(TMP7788.context);
			if (TMP7788.status == 0) {
				nimln(42, "nimrod.nim");
				asgnRefNoCycle((void**) &gprojectfull_135208, canonicalizepath_135335(gprojectname_135206));
				popSafePoint();
			}
			else {
				popSafePoint();
				setFrame((TFrame*)&F);
				if (isObj(getCurrentException()->Sup.m_type, (&NTI2435))) {
					NimStringDesc* LOC14;
					TMP7788.status = 0;
					nimln(44, "nimrod.nim");
					LOC14 = 0;
					LOC14 = gprojectfull_135208; gprojectfull_135208 = copyStringRC1(gprojectname_135206);
					if (LOC14) nimGCunrefNoCycle(LOC14);
					popCurrentException();
				}
			}
			if (TMP7788.status != 0) reraiseException();
			nimln(45, "nimrod.nim");
			chckNil((void*)&p);
			memset((void*)&p, 0, sizeof(p));
			nossplitFile(gprojectfull_135208, &p);
			nimln(46, "nimrod.nim");
			LOC15 = 0;
			LOC15 = gprojectpath_135207; gprojectpath_135207 = copyStringRC1(p.Field0);
			if (LOC15) nimGCunrefNoCycle(LOC15);
			nimln(47, "nimrod.nim");
			LOC16 = 0;
			LOC16 = gprojectname_135206; gprojectname_135206 = copyStringRC1(p.Field1);
			if (LOC16) nimGCunrefNoCycle(LOC16);
		}
		goto LA7;
		LA9: ;
		{
			nimln(49, "nimrod.nim");
			asgnRefNoCycle((void**) &gprojectpath_135207, nosgetCurrentDir());
		}
		LA7: ;
		nimln(50, "nimrod.nim");
		loadconfigs_181607(((NimStringDesc*) &TMP7789));
		nimln(53, "nimrod.nim");
		initvars_167714();
		nimln(54, "nimrod.nim");
		processcmdline_523207(((NU8) 1), ((NimStringDesc*) &TMP7787));
		nimln(55, "nimrod.nim");
		maincommand_527011();
		nimln(56, "nimrod.nim");
		{
			NimStringDesc* LOC22;
			nimln(56, "nimrod.nim");
			if (!(2 <= gverbosity_135120)) goto LA20;
			nimln(56, "nimrod.nim");
			nimln(56, "nimrod.nim");
			LOC22 = 0;
			LOC22 = gcgetstatistics_6621();
			printf("%s\012", (LOC22)->data);
		}
		LA20: ;
		nimln(58, "nimrod.nim");
		{
			nimln(58, "nimrod.nim");
			if (!(gerrorcounter_162182 == 0)) goto LA25;
			nimln(62, "nimrod.nim");
			{
				nimln(62, "nimrod.nim");
				if (!((gglobaloptions_135111 &(1<<((((NU8) 13))&31)))!=0)) goto LA29;
				nimln(63, "nimrod.nim");
				{
					NimStringDesc* ex;
					NimStringDesc* LOC44;
					nimln(63, "nimrod.nim");
					if (!(gcmd_135113 == ((NU8) 4))) goto LA33;
					ex = 0;
					nimln(65, "nimrod.nim");
					{
						NimStringDesc* LOC39;
						nimln(65, "nimrod.nim");
						nimln(65, "nimrod.nim");
						if (!(0 < outfile_135117->Sup.len)) goto LA37;
						nimln(66, "nimrod.nim");
						nimln(66, "nimrod.nim");
						LOC39 = 0;
						LOC39 = prependcurdir_529401(outfile_135117);
						ex = nospquoteShell(LOC39);
					}
					goto LA35;
					LA37: ;
					{
						NimStringDesc* LOC41;
						NimStringDesc* LOC42;
						NimStringDesc* LOC43;
						nimln(68, "nimrod.nim");
						nimln(69, "nimrod.nim");
						nimln(69, "nimrod.nim");
						nimln(69, "nimrod.nim");
						LOC41 = 0;
						LOC41 = noschangeFileExt(gprojectfull_135208, ((NimStringDesc*) &TMP7790));
						LOC42 = 0;
						LOC42 = prependcurdir_529401(LOC41);
						LOC43 = 0;
						LOC43 = completecfilepath_167753(LOC42, NIM_TRUE);
						ex = nospquoteShell(LOC43);
					}
					LA35: ;
					nimln(70, "nimrod.nim");
					nimln(70, "nimrod.nim");
					LOC44 = 0;
					LOC44 = rawNewString(ex->Sup.len + arguments_523205->Sup.len + 6);
appendString(LOC44, ((NimStringDesc*) &TMP7791));
appendString(LOC44, ex);
appendChar(LOC44, 32);
appendString(LOC44, arguments_523205);
					execexternalprogram_167785(LOC44);
				}
				goto LA31;
				LA33: ;
				{
					NimStringDesc* binpath;
					NimStringDesc* ex;
					NimStringDesc* LOC52;
					binpath = 0;
					nimln(73, "nimrod.nim");
					{
						nimln(73, "nimrod.nim");
						nimln(73, "nimrod.nim");
						if (!(0 < outfile_135117->Sup.len)) goto LA48;
						nimln(75, "nimrod.nim");
						binpath = prependcurdir_529401(outfile_135117);
					}
					goto LA46;
					LA48: ;
					{
						NimStringDesc* LOC51;
						nimln(78, "nimrod.nim");
						nimln(78, "nimrod.nim");
						LOC51 = 0;
						LOC51 = noschangeFileExt(gprojectfull_135208, ((NimStringDesc*) &TMP7787));
						binpath = prependcurdir_529401(LOC51);
					}
					LA46: ;
					nimln(79, "nimrod.nim");
					ex = nospquoteShell(binpath);
					nimln(80, "nimrod.nim");
					nimln(80, "nimrod.nim");
					LOC52 = 0;
					LOC52 = rawNewString(ex->Sup.len + arguments_523205->Sup.len + 1);
appendString(LOC52, ex);
appendChar(LOC52, 32);
appendString(LOC52, arguments_523205);
					execexternalprogram_167785(LOC52);
				}
				LA31: ;
			}
			LA29: ;
		}
		LA25: ;
	}
	LA1: ;
	popFrame();
}
Exemplo n.º 23
0
N_NIMCALL(void, Maincommand_191201)(NimStringDesc* Cmd_191203, NimStringDesc* Filename_191204) {
TY38661 LOC4;
NU8 LOC5;
NimStringDesc* LOC6;
TY55526* LOC7;
Appendstr_43061(&Searchpaths_46081, Libpath_46112);
if (!!(((Filename_191204) && (Filename_191204)->Sup.len == 0))) goto LA2;
memset((void*)&LOC4, 0, sizeof(LOC4));
nossplitFile(Filename_191204, &LOC4);
Prependstr_43071(&Searchpaths_46081, LOC4.Dir);
LA2: ;
Setid_55696(100);
Gincludefile_105048 = Parsefile_92031;
Gimportmodule_105044 = Importmodule_191325;
LOC5 = Whichkeyword_72482(Cmd_191203);
switch (LOC5) {
case ((NU8) 107):
case ((NU8) 200):
case ((NU8) 176):
case ((NU8) 192):
Gcmd_46084 = ((NU8) 1);
Wantfile_191707(Filename_191204);
Commandcompiletoc_191416(Filename_191204);
break;
case ((NU8) 201):
asgnRefNoCycle((void**) &Cext_70342, copyString(((NimStringDesc*) &TMP196879)));
Gcmd_46084 = ((NU8) 2);
Wantfile_191707(Filename_191204);
Commandcompiletoc_191416(Filename_191204);
break;
case ((NU8) 204):
case ((NU8) 213):
asgnRefNoCycle((void**) &Cext_70342, copyString(((NimStringDesc*) &TMP196880)));
Gcmd_46084 = ((NU8) 3);
Wantfile_191707(Filename_191204);
Commandcompiletoc_191416(Filename_191204);
break;
case ((NU8) 179):
Gcmd_46084 = ((NU8) 18);
Wantfile_191707(Filename_191204);
Rawmessage_48045(((NU8) 176), Cmd_191203);
break;
case ((NU8) 202):
case ((NU8) 212):
Gcmd_46084 = ((NU8) 4);
Wantfile_191707(Filename_191204);
Commandcompiletoecmascript_191601(Filename_191204);
break;
case ((NU8) 203):
Gcmd_46084 = ((NU8) 5);
Wantfile_191707(Filename_191204);
Rawmessage_48045(((NU8) 176), Cmd_191203);
break;
case ((NU8) 205):
Gcmd_46084 = ((NU8) 7);
Wantfile_191707(Filename_191204);
Commandpretty_191643(Filename_191204);
break;
case ((NU8) 206):
Gcmd_46084 = ((NU8) 8);
Loadspecialconfig_80007(((NimStringDesc*) &TMP197084));
Wantfile_191707(Filename_191204);
Commanddoc_156001(Filename_191204);
break;
case ((NU8) 214):
Gcmd_46084 = ((NU8) 15);
Loadspecialconfig_80007(((NimStringDesc*) &TMP197084));
Wantfile_191707(Filename_191204);
Commandrst2html_156004(Filename_191204);
break;
case ((NU8) 215):
Gcmd_46084 = ((NU8) 16);
Loadspecialconfig_80007(((NimStringDesc*) &TMP197487));
Wantfile_191707(Filename_191204);
Commandrst2tex_156007(Filename_191204);
break;
case ((NU8) 207):
Gcmd_46084 = ((NU8) 9);
Wantfile_191707(Filename_191204);
Commandgendepend_191410(Filename_191204);
break;
case ((NU8) 208):
Gcmd_46084 = ((NU8) 10);
Listsymbols_64062();
break;
case ((NU8) 209):
Gcmd_46084 = ((NU8) 11);
Wantfile_191707(Filename_191204);
Commandcheck_191413(Filename_191204);
break;
case ((NU8) 210):
Gcmd_46084 = ((NU8) 12);
Wantfile_191707(Filename_191204);
LOC6 = 0;
LOC6 = nosaddFileExt(Filename_191204, ((NimStringDesc*) &TMP195865));
LOC7 = 0;
LOC7 = Parsefile_92031(LOC6);
break;
case ((NU8) 211):
Gcmd_46084 = ((NU8) 13);
Wantfile_191707(Filename_191204);
Commandscan_191658(Filename_191204);
Messageout_47775(((NimStringDesc*) &TMP197499));
break;
case ((NU8) 216):
Gcmd_46084 = ((NU8) 17);
Commandinteractive_191616();
break;
case ((NU8) 225):
Gcmd_46084 = ((NU8) 14);
Wantfile_191707(Filename_191204);
Commandsuggest_191704(Filename_191204);
break;
default:
Rawmessage_48045(((NU8) 176), Cmd_191203);
break;
}
}