Example #1
0
N_NIMCALL(NimStringDesc*, opslurp_379044)(NimStringDesc* file, Tlineinfo162338 info, Tsym190843* module) {
	NimStringDesc* volatile result;
	TSafePoint TMP2884;
	result = 0;
	pushSafePoint(&TMP2884);
	TMP2884.status = _setjmp(TMP2884.context);
	if (TMP2884.status == 0) {
		NimStringDesc* filename;
		Tnodeseq190807* LOC2;
		TY208694 LOC3;
		Tnode190813* LOC4;
		filename = findfile_154341(file);
		result = readfile_13434(filename);
		LOC2 = 0;
		LOC2 = (Tnodeseq190807*) newSeq((&NTI190807), 1);
		memset((void*)LOC3, 0, sizeof(LOC3));
		LOC3[0] = newstrnode_191644(((NU8) 20), filename);
		asgnRefNoCycle((void**) (&LOC2->data[0]), LOC3[0]);
		LOC4 = 0;
		LOC4 = newnode_192607(((NU8) 121), info, LOC2, NIM_NIL);
		appendtomodule_191911(module, LOC4);
		popSafePoint();
	}
	else {
		popSafePoint();
		if (isObj(getCurrentException()->Sup.m_type, (&NTI3431))) {
			TMP2884.status = 0;
			localerror_164171(info, ((NU16) 3), file);
			result = copyString(((NimStringDesc*) &TMP2885));
			popCurrentException();
		}
	}
	if (TMP2884.status != 0) reraiseException();
	return result;
}
Example #2
0
N_NIMCALL(NimStringDesc*, Completegeneratedfilepath_41101)(NimStringDesc* F_41103, NIM_BOOL Createsubdir_41104) {
    NimStringDesc* Result_41248;
    TY33337 LOC1;
    NimStringDesc* Head_41249;
    NimStringDesc* Tail_41250;
    NimStringDesc* LOC5;
    NimStringDesc* LOC6;
    NimStringDesc* Subdir_41261;
    TY69026 LOC7;
    TSafePoint TMP191662;
    NimStringDesc* LOC11;
    Result_41248 = 0;
    memset((void*)&LOC1, 0, sizeof(LOC1));
    nosSplitPath(F_41103, &LOC1);
    Head_41249 = 0;
    Head_41249 = copyString(LOC1.Head);
    Tail_41250 = 0;
    Tail_41250 = copyString(LOC1.Tail);
    if (!(0 < Head_41249->Sup.len)) goto LA3;
    LOC5 = 0;
    LOC5 = rawNewString(Head_41249->Sup.len + 1);
    appendString(LOC5, Head_41249);
    appendChar(LOC5, 92);
    LOC6 = 0;
    LOC6 = Shortendir_41200(LOC5);
    Head_41249 = Removetrailingdirsep_41211(LOC6);
LA3:
    ;
    Subdir_41261 = 0;
    memset((void*)&LOC7, 0, sizeof(LOC7));
    LOC7[0] = copyString(Projectpath_41113);
    LOC7[1] = copyString(((NimStringDesc*) &TMP191651));
    LOC7[2] = copyString(Head_41249);
    Subdir_41261 = nosJoinPathOpenArray(LOC7, 3);
    if (!Createsubdir_41104) goto LA9;
    pushSafePoint(&TMP191662);
    TMP191662.status = setjmp(TMP191662.context);
    if (TMP191662.status == 0) {
        noscreateDir(Subdir_41261);
        popSafePoint();
    } else {
        popSafePoint();
        if (getCurrentException()->Sup.m_type == NTI422) {
            LOC11 = 0;
            LOC11 = rawNewString(Subdir_41261->Sup.len + 25);
            appendString(LOC11, ((NimStringDesc*) &TMP191663));
            appendString(LOC11, Subdir_41261);
            Writeln_41265(stdout, LOC11);
            exit(1);
            TMP191662.status = 0;
            popCurrentException();
        }
    }
    if (TMP191662.status != 0) reraiseException();
LA9:
    ;
    Result_41248 = nosJoinPath(Subdir_41261, Tail_41250);
    return Result_41248;
}
Example #3
0
N_NIMCALL(NimStringDesc*, completegeneratedfilepath_137001)(NimStringDesc* f, NIM_BOOL createsubdir) {
	NimStringDesc* result;
	TY94105 LOC1;
	NimStringDesc* head;
	NimStringDesc* tail;
	NimStringDesc* subdir;
	nimfr("completeGeneratedFilePath", "options.nim")
	result = 0;
	nimln(290, "options.nim");
	nimln(290, "options.nim");
	memset((void*)&LOC1, 0, sizeof(LOC1));
	nossplitPath(f, &LOC1);
	head = copyString(LOC1.Field0);
	tail = copyString(LOC1.Field1);
	nimln(292, "options.nim");
	subdir = getgeneratedpath_136417();
	nimln(293, "options.nim");
	{
		TSafePoint TMP429;
		if (!createsubdir) goto LA4;
		nimln(294, "options.nim");
		pushSafePoint(&TMP429);
		TMP429.status = setjmp(TMP429.context);
		if (TMP429.status == 0) {
			nimln(295, "options.nim");
			noscreateDir(subdir);
			popSafePoint();
		}
		else {
			popSafePoint();
			setFrame((TFrame*)&F);
			if (isObj(getCurrentException()->Sup.m_type, (&NTI2435))) {
				TY128024 LOC9;
				NimStringDesc* LOC10;
				TMP429.status = 0;
				nimln(299, "options.nim");
				memset((void*)LOC9, 0, sizeof(LOC9));
				nimln(299, "options.nim");
				nimln(299, "options.nim");
				LOC10 = 0;
				LOC10 = rawNewString(subdir->Sup.len + 25);
appendString(LOC10, ((NimStringDesc*) &TMP432));
appendString(LOC10, subdir);
				LOC9[0] = LOC10;
				writeln_137205(stdout, LOC9, 1);
				nimln(300, "options.nim");
				exit(1);
				popCurrentException();
			}
		}
		if (TMP429.status != 0) reraiseException();
	}
	LA4: ;
	nimln(301, "options.nim");
	result = nosjoinPath(subdir, tail);
	popFrame();
	return result;
}
Example #4
0
N_NIMCALL(tnode192813*, close_527014)(tpasscontext251003* p, tnode192813* n) {
	tnode192813* result;
	tgen527008* g;
	NIM_BOOL usewarning;
	nimfr("close", "docgen2.nim")
	result = 0;
	nimln(23, "docgen2.nim");
	if (p) chckObj((*p).Sup.m_type, (&NTI527008));
	g = ((tgen527008*) (p));
	nimln(24, "docgen2.nim");
	nimln(24, "docgen2.nim");
	nimln(24, "docgen2.nim");
	usewarning = !((((*(*g).Module).Flags &(1<<((((NU8) 12))&31)))!=0));
	nimln(25, "docgen2.nim");
	{
		NIM_BOOL LOC3;
		NimStringDesc* LOC7;
		TSafePoint TMP7626;
		nimln(25, "docgen2.nim");
		LOC3 = 0;
		LOC3 = gwholeproject_139122;
		if (LOC3) goto LA4;
		nimln(25, "docgen2.nim");
		LOC3 = (((*(*g).Module).Flags &(1<<((((NU8) 12))&31)))!=0);
		LA4: ;
		if (!LOC3) goto LA5;
		nimln(26, "docgen2.nim");
		nimln(26, "docgen2.nim");
		LOC7 = 0;
		LOC7 = tofilename_168780(((NI32)chckRange((*(*g).Module).Position, ((NI32) (-2147483647 -1)), ((NI32) 2147483647))));
		writeoutput_349719((*g).Doc, LOC7, ((NimStringDesc*) &TMP7625), usewarning);
		nimln(27, "docgen2.nim");
		pushSafePoint(&TMP7626);
		TMP7626.status = setjmp(TMP7626.context);
		if (TMP7626.status == 0) {
			nimln(28, "docgen2.nim");
			generateindex_349700((*g).Doc);
			popSafePoint();
		}
		else {
			popSafePoint();
			setFrame((TFrame*)&F);
			if (isObj(getCurrentException()->Sup.m_type, (&NTI2433))) {
				TMP7626.status = 0;
				popCurrentException();
			}
		}
		if (TMP7626.status != 0) reraiseException();
	}
	LA5: ;
	popFrame();
	return result;
}
Example #5
0
N_NIMCALL(NimStringDesc*, completegeneratedfilepath_114490)(NimStringDesc* f, NIM_BOOL createsubdir) {
	NimStringDesc* result;
	TY87905 LOC1;
	NimStringDesc* head;
	NimStringDesc* tail;
	NimStringDesc* subdir;
	nimfr("completeGeneratedFilePath", "options.nim")
	result = 0;
	nimln(246, "options.nim");
	nimln(246, "options.nim");
	memset((void*)&LOC1, 0, sizeof(LOC1));
	nosSplitPath(f, &LOC1);	head = copyString(LOC1.Field0);
	tail = copyString(LOC1.Field1);
	nimln(248, "options.nim");
	subdir = getgeneratedpath_114417();
	nimln(249, "options.nim");
	{
		TSafePoint TMP347;
		if (!createsubdir) goto LA4;
		nimln(250, "options.nim");
		pushSafePoint(&TMP347);
		TMP347.status = setjmp(TMP347.context);
		if (TMP347.status == 0) {
			nimln(251, "options.nim");
			noscreateDir(subdir);			popSafePoint();
		}		else {
			popSafePoint();
			setFrame((TFrame*)&F);
			if (isObj(getCurrentException()->Sup.m_type, (&NTI1035))) {
				TY114525 LOC9;
				NimStringDesc* LOC10;
				TMP347.status = 0;
				nimln(253, "options.nim");
				memset((void*)LOC9, 0, sizeof(LOC9));
				nimln(253, "options.nim");
				nimln(253, "options.nim");
				LOC10 = 0;
				LOC10 = rawNewString(subdir->Sup.len + 25);
appendString(LOC10, ((NimStringDesc*) &TMP350));
appendString(LOC10, subdir);
				LOC9[0] = LOC10;
				writeln_114502(stdout, LOC9, 1);				nimln(254, "options.nim");
				exit(1);				popCurrentException();
			}		}		if (TMP347.status != 0) reraiseException();
	}	LA4: ;
	nimln(255, "options.nim");
	result = nosJoinPath(subdir, tail);
	popFrame();
	return result;
}
Example #6
0
N_NIMCALL(void, close_526411)(Socketimpl524404* socket) {
	TSafePoint TMP5292;
	pushSafePoint(&TMP5292);
	TMP5292.status = setjmp(TMP5292.context);
	if (TMP5292.status == 0) {
		popSafePoint();
	}
	else {
		popSafePoint();
	}
	{
		close_519013((*socket).fd);
	}
	if (TMP5292.status != 0) reraiseException();
}
Example #7
0
N_NIMCALL(void, close_515417)(Socketimpl513407* socket) {
	TSafePoint TMP5005;
	pushSafePoint(&TMP5005);
	TMP5005.status = _setjmp(TMP5005.context);
	if (TMP5005.status == 0) {
		popSafePoint();
	}
	else {
		popSafePoint();
	}
	{
		close_509028((*socket).fd);
	}
	if (TMP5005.status != 0) reraiseException();
}
Example #8
0
N_NIMCALL(void, close_585611)(Socketimpl583406* socket) {
	TSafePoint TMP5506;
	pushSafePoint(&TMP5506);
	TMP5506.status = setjmp(TMP5506.context);
	if (TMP5506.status == 0) {
		popSafePoint();
	}
	else {
		popSafePoint();
	}
	{
		close_578013((*socket).fd);
	}
	if (TMP5506.status != 0) reraiseException();
}
Example #9
0
N_NIMCALL(tnode171659*, close_415013)(tpasscontext222003* p, tnode171659* n) {
	tnode171659* result;
	tgen415007* g;
	NIM_BOOL usewarning;
	nimfr("close", "docgen2.nim")
	result = 0;
	nimln(23, "docgen2.nim");
	if (p) chckObj((*p).Sup.m_type, (&NTI415007));
	g = ((tgen415007*) (p));
	nimln(24, "docgen2.nim");
	nimln(731, "system.nim");
	nimln(731, "system.nim");
	usewarning = !((((*(*g).Module).Flags &(1<<((((NU8) 12))&31)))!=0));
	nimln(25, "docgen2.nim");
	{
		NIM_BOOL LOC3;
		NimStringDesc* LOC7;
		TSafePoint TMP7018;
		nimln(25, "docgen2.nim");
		LOC3 = 0;
		LOC3 = gwholeproject_114119;
		if (LOC3) goto LA4;
		nimln(730, "system.nim");
		LOC3 = (((*(*g).Module).Flags &(1<<((((NU8) 12))&31)))!=0);
		LA4: ;
		if (!LOC3) goto LA5;
		nimln(26, "docgen2.nim");
		nimln(913, "ast.nim");
		LOC7 = 0;
		LOC7 = tofilename_137700(((NI32)chckRange((*(*g).Module).Position, ((NI32) (-2147483647 -1)), ((NI32) 2147483647))));
		writeoutput_310043((*g).Doc, LOC7, ((NimStringDesc*) &TMP7017), usewarning);		nimln(27, "docgen2.nim");
		pushSafePoint(&TMP7018);
		TMP7018.status = setjmp(TMP7018.context);
		if (TMP7018.status == 0) {
			nimln(28, "docgen2.nim");
			generateindex_310027((*g).Doc);			popSafePoint();
		}		else {
			popSafePoint();
			setFrame((TFrame*)&F);
			if (isObj(getCurrentException()->Sup.m_type, (&NTI1033))) {
				TMP7018.status = 0;
				popCurrentException();
			}		}		if (TMP7018.status != 0) reraiseException();
	}	LA5: ;
	popFrame();
	return result;
}
Example #10
0
N_NIMCALL(NimStringDesc*, completegeneratedfilepath_154001)(NimStringDesc* f, NIM_BOOL createsubdir) {
	NimStringDesc* result;
	Keyvaluepair133008 LOC1;
	NimStringDesc* head;
	NimStringDesc* tail;
	NimStringDesc* subdir;
	result = 0;
	memset((void*)(&LOC1), 0, sizeof(LOC1));
	nossplitPath(f, (&LOC1));
	head = 0;
	head = copyString(LOC1.Field0);
	tail = 0;
	tail = copyString(LOC1.Field1);
	subdir = getgeneratedpath_153428();
	{
		TSafePoint TMP1436;
		if (!createsubdir) goto LA4;
		pushSafePoint(&TMP1436);
		TMP1436.status = _setjmp(TMP1436.context);
		if (TMP1436.status == 0) {
			noscreateDir(subdir);
			popSafePoint();
		}
		else {
			popSafePoint();
			if (isObj(getCurrentException()->Sup.m_type, (&NTI3433))) {
				TY163580 LOC9;
				NimStringDesc* LOC10;
				TMP1436.status = 0;
				memset((void*)LOC9, 0, sizeof(LOC9));
				LOC10 = 0;
				LOC10 = rawNewString(subdir->Sup.len + 25);
appendString(LOC10, ((NimStringDesc*) &TMP1438));
appendString(LOC10, subdir);
				LOC9[0] = LOC10;
				writeln_154205(stdout, LOC9, 1);
				exit(((NI) 1));
				popCurrentException();
			}
		}
		if (TMP1436.status != 0) reraiseException();
	}
	LA4: ;
	result = nosjoinPath(subdir, tail);
	return result;
}
Example #11
0
N_NIMCALL(NI, fspeekdata_7P4Enb2Vt3iOCL5K9cnGqYw_2)(Streamobj_RShkcoDOPnoCVhtpN1hDPQ* s0, void* buffer0, NI buflen0) {
	NI volatile result0;
	NI pos0;
	TSafePoint T_Ue7tnBcsL67VCiRfvt8q0A_3;
	result0 = (NI)0;
	pos0 = fsgetposition_ht6Fg1Bmvqnb8CP4WayC2A(s0);
	pushSafePoint(&T_Ue7tnBcsL67VCiRfvt8q0A_3);
	T_Ue7tnBcsL67VCiRfvt8q0A_3.status = setjmp(T_Ue7tnBcsL67VCiRfvt8q0A_3.context);
	if (T_Ue7tnBcsL67VCiRfvt8q0A_3.status == 0) {
		result0 = readbuffer_nZ0pNe9cd9cXtoayexCiaDtA_2((*((Filestreamobj_qoDM8xYRV40zbhS9acPNT9bw*) (s0))).f, buffer0, ((NI) (buflen0)));
		popSafePoint();
	}
	else {
		popSafePoint();
	}
	{
		fssetposition_C0SEQJWfadg6oK29b8FuMZg(s0, pos0);
	}
	if (T_Ue7tnBcsL67VCiRfvt8q0A_3.status != 0) reraiseException();
	return result0;
}
N_NIMCALL(NI, fspeekdata_158918_1780494535)(Streamobj157818* s0, void* buffer0, NI buflen0) {
	NI volatile result0;
	NI pos0;
	TSafePoint T1780494535_5;
	result0 = (NI)0;
	pos0 = fsgetposition_158908_1780494535(s0);
	pushSafePoint(&T1780494535_5);
	T1780494535_5.status = setjmp(T1780494535_5.context);
	if (T1780494535_5.status == 0) {
		result0 = readbuffer_14956_1689653243((*((Filestreamobj158877*) (s0))).f, buffer0, ((NI) (buflen0)));
		popSafePoint();
	}
	else {
		popSafePoint();
	}
	{
		fssetposition_158904_1780494535(s0, pos0);
	}
	if (T1780494535_5.status != 0) reraiseException();
	return result0;
}
Example #13
0
N_NIMCALL(Tnode191813*, close_508018)(Tpasscontext241005* p, Tnode191813* n) {
	Tnode191813* result;
	Tgen508010* g;
	NIM_BOOL usewarning;
	result = 0;
	g = ((Tgen508010*) (p));
	usewarning = !((((*(*g).module).flags &(1<<((((NU8) 12))&31)))!=0));
	{
		NIM_BOOL LOC3;
		NimStringDesc* LOC7;
		TSafePoint TMP4885;
		LOC3 = 0;
		LOC3 = gwholeproject_154139;
		if (LOC3) goto LA4;
		LOC3 = (((*(*g).module).flags &(1<<((((NU8) 12))&31)))!=0);
		LA4: ;
		if (!LOC3) goto LA5;
		LOC7 = 0;
		LOC7 = tofilename_164271(((NI32) ((*(*g).module).position)));
		writeoutput_343349((*g).doc, LOC7, ((NimStringDesc*) &TMP4884), usewarning);
		pushSafePoint(&TMP4885);
		TMP4885.status = _setjmp(TMP4885.context);
		if (TMP4885.status == 0) {
			generateindex_343330((*g).doc);
			popSafePoint();
		}
		else {
			popSafePoint();
			if (isObj(getCurrentException()->Sup.m_type, (&NTI3431))) {
				TMP4885.status = 0;
				popCurrentException();
			}
		}
		if (TMP4885.status != 0) reraiseException();
	}
	LA5: ;
	return result;
}
Example #14
0
N_NIMCALL(Tnode216790*, close_517009)(Tpasscontext263002* p, Tnode216790* n) {
	Tnode216790* result;
	Tgen517004* g;
	NIM_BOOL usewarning;
	result = 0;
	g = ((Tgen517004*) (p));
	usewarning = !((((*(*g).module).flags &(1U<<((NU)(((NU8) 12))&31U)))!=0));
	{
		NIM_BOOL LOC3;
		NimStringDesc* LOC7;
		TSafePoint TMP5167;
		LOC3 = 0;
		LOC3 = gwholeproject_163132;
		if (LOC3) goto LA4;
		LOC3 = (((*(*g).module).flags &(1U<<((NU)(((NU8) 12))&31U)))!=0);
		LA4: ;
		if (!LOC3) goto LA5;
		LOC7 = 0;
		LOC7 = tofilename_185265(((NI32) ((*(*g).module).position)));
		writeoutput_363697((*g).doc, LOC7, ((NimStringDesc*) &TMP5166), usewarning);
		pushSafePoint(&TMP5167);
		TMP5167.status = setjmp(TMP5167.context);
		if (TMP5167.status == 0) {
			generateindex_363684((*g).doc);
			popSafePoint();
		}
		else {
			popSafePoint();
			if (isObj(getCurrentException()->Sup.m_type, (&NTI3628))) {
				TMP5167.status = 0;
				popCurrentException();
			}
		}
		if (TMP5167.status != 0) reraiseException();
	}
	LA5: ;
	return result;
}
Example #15
0
N_NIMCALL(NimStringDesc*, opgorge_379027)(NimStringDesc* cmd, NimStringDesc* input) {
	NimStringDesc* volatile result;
	TSafePoint TMP2886;
	result = 0;
	pushSafePoint(&TMP2886);
	TMP2886.status = _setjmp(TMP2886.context);
	if (TMP2886.status == 0) {
		Processobj142402* p;
		TY218714 LOC2;
		memset((void*)LOC2, 0, sizeof(LOC2));
		p = nospstartProcess(cmd, ((NimStringDesc*) &TMP2885), LOC2, 0, NIM_NIL, 4);
		{
			Streamobj137027* LOC7;
			Streamobj137027* LOC8;
			if (!!(((input ? input->Sup.len : 0) == ((NI) 0)))) goto LA5;
			LOC7 = 0;
			LOC7 = nospinputStream(p);
			write_137233(LOC7, input);
			LOC8 = 0;
			LOC8 = nospinputStream(p);
			close_137085(LOC8);
		}
		LA5: ;
		result = readoutput_379009(p);
		popSafePoint();
	}
	else {
		popSafePoint();
		if (isObj(getCurrentException()->Sup.m_type, (&NTI3431))||isObj(getCurrentException()->Sup.m_type, (&NTI3433))) {
			TMP2886.status = 0;
			result = copyString(((NimStringDesc*) &TMP2885));
			popCurrentException();
		}
	}
	if (TMP2886.status != 0) reraiseException();
	return result;
}
Example #16
0
N_NIMCALL(Processobj143402*, nospstartProcess)(NimStringDesc* command, NimStringDesc* workingdir, NimStringDesc** args, NI argsLen0, Stringtableobj134012* env, NU8 options) {
	Processobj143402* result;
	TY145025 pstdin;
	TY145025 pstdout;
	TY145025 pstderr;
	NimStringDesc* syscommand;
	TY122208* sysargsraw;
	pid_t volatile pid;
	NCSTRING* sysargs;
	TSafePoint TMP2889;
	result = 0;
	memset((void*)pstdin, 0, sizeof(pstdin));
	memset((void*)pstdout, 0, sizeof(pstdout));
	memset((void*)pstderr, 0, sizeof(pstderr));
	result = (Processobj143402*) newObj((&NTI143404), sizeof(Processobj143402));
	(*result).Sup.m_type = (&NTI143402);
	(*result).exitcode = ((int) -3);
	{
		if (!!(((options &(1<<((((NU8) 4))&7)))!=0))) goto LA3;
		{
			NIM_BOOL LOC7;
			NIM_BOOL LOC8;
			int LOC9;
			int LOC11;
			int LOC13;
			NI32 LOC16;
			LOC7 = 0;
			LOC8 = 0;
			LOC9 = 0;
			LOC9 = pipe(pstdin);
			LOC8 = !((LOC9 == ((NI32) 0)));
			if (LOC8) goto LA10;
			LOC11 = 0;
			LOC11 = pipe(pstdout);
			LOC8 = !((LOC11 == ((NI32) 0)));
			LA10: ;
			LOC7 = LOC8;
			if (LOC7) goto LA12;
			LOC13 = 0;
			LOC13 = pipe(pstderr);
			LOC7 = !((LOC13 == ((NI32) 0)));
			LA12: ;
			if (!LOC7) goto LA14;
			LOC16 = 0;
			LOC16 = oslasterror_117033();
			raiseoserror_117009(LOC16);
		}
		LA14: ;
	}
	LA3: ;
	syscommand = 0;
	sysargsraw = 0;
	{
		TY176063 LOC21;
		NimStringDesc* LOC22;
		NimStringDesc* LOC23;
		NimStringDesc* LOC24;
		if (!((options &(1<<((((NU8) 2))&7)))!=0)) goto LA19;
		syscommand = copyString(((NimStringDesc*) &TMP2887));
		sysargsraw = (TY122208*) newSeq((&NTI122208), 3);
		memset((void*)LOC21, 0, sizeof(LOC21));
		LOC21[0] = copyString(syscommand);
		LOC21[1] = copyString(((NimStringDesc*) &TMP2888));
		LOC21[2] = copyString(command);
		LOC22 = 0;
		LOC22 = sysargsraw->data[0]; sysargsraw->data[0] = copyStringRC1(LOC21[0]);
		if (LOC22) nimGCunrefNoCycle(LOC22);
		LOC23 = 0;
		LOC23 = sysargsraw->data[1]; sysargsraw->data[1] = copyStringRC1(LOC21[1]);
		if (LOC23) nimGCunrefNoCycle(LOC23);
		LOC24 = 0;
		LOC24 = sysargsraw->data[2]; sysargsraw->data[2] = copyStringRC1(LOC21[2]);
		if (LOC24) nimGCunrefNoCycle(LOC24);
	}
	goto LA17;
	LA19: ;
	{
		TY164580 LOC26;
		NimStringDesc* LOC27;
		syscommand = copyString(command);
		sysargsraw = (TY122208*) newSeq((&NTI122208), 1);
		memset((void*)LOC26, 0, sizeof(LOC26));
		LOC26[0] = copyString(command);
		LOC27 = 0;
		LOC27 = sysargsraw->data[0]; sysargsraw->data[0] = copyStringRC1(LOC26[0]);
		if (LOC27) nimGCunrefNoCycle(LOC27);
		{
			NimStringDesc* arg_145224;
			NI i_145481;
			arg_145224 = 0;
			i_145481 = ((NI) 0);
			{
				while (1) {
					NimStringDesc* LOC31;
					if (!(i_145481 < argsLen0)) goto LA30;
					arg_145224 = args[i_145481];
					sysargsraw = (TY122208*) incrSeq(&(sysargsraw)->Sup, sizeof(NimStringDesc*));
					LOC31 = 0;
					LOC31 = sysargsraw->data[sysargsraw->Sup.len-1]; sysargsraw->data[sysargsraw->Sup.len-1] = copyStringRC1(arg_145224);
					if (LOC31) nimGCunrefNoCycle(LOC31);
					i_145481 += ((NI) 1);
				} LA30: ;
			}
		}
	}
	LA17: ;
	pid = 0;
	sysargs = alloccstringarray_14201(sysargsraw->data, sysargsraw->Sup.len);
	pushSafePoint(&TMP2889);
	TMP2889.status = _setjmp(TMP2889.context);
	if (TMP2889.status == 0) {
		NCSTRING* sysenv;
		TSafePoint TMP2891;
		{
			if (!(env == NIM_NIL)) goto LA35;
			sysenv = envtocstringarray_144854();
		}
		goto LA33;
		LA35: ;
		{
			sysenv = envtocstringarray_144806(env);
		}
		LA33: ;
		pushSafePoint(&TMP2891);
		TMP2891.status = _setjmp(TMP2891.context);
		if (TMP2891.status == 0) {
			Tstartprocessdata144948 data;
			memset((void*)(&data), 0, sizeof(data));
			data.syscommand = syscommand->data;
			data.sysargs = sysargs;
			data.sysenv = sysenv;
			memcpy((void*)data.pstdin, (NIM_CONST void*)pstdin, sizeof(data.pstdin));
			memcpy((void*)data.pstdout, (NIM_CONST void*)pstdout, sizeof(data.pstdout));
			memcpy((void*)data.pstderr, (NIM_CONST void*)pstderr, sizeof(data.pstderr));
			data.optionpoparentstreams = ((options &(1<<((((NU8) 4))&7)))!=0);
			data.optionpousepath = ((options &(1<<((((NU8) 1))&7)))!=0);
			data.optionpostderrtostdout = ((options &(1<<((((NU8) 3))&7)))!=0);
			data.workingdir = workingdir->data;
			pid = startprocessauxspawn_145001((&data));
			{
				NimStringDesc* LOC43;
				if (!((options &(1<<((((NU8) 0))&7)))!=0)) goto LA41;
				LOC43 = 0;
				LOC43 = nsuJoinSep(args, argsLen0, ((NimStringDesc*) &TMP2892));
				printf("%s%s%s\012", command? (command)->data:"nil", ((NimStringDesc*) &TMP2892)? (((NimStringDesc*) &TMP2892))->data:"nil", LOC43? (LOC43)->data:"nil");
			}
			LA41: ;
			(*result).id = pid;
			{
				if (!((options &(1<<((((NU8) 4))&7)))!=0)) goto LA46;
				(*result).inhandle = ((int) 0);
				(*result).outhandle = ((int) 1);
				{
					if (!((options &(1<<((((NU8) 3))&7)))!=0)) goto LA50;
					(*result).errhandle = (*result).outhandle;
				}
				goto LA48;
				LA50: ;
				{
					(*result).errhandle = ((int) 2);
				}
				LA48: ;
			}
			goto LA44;
			LA46: ;
			{
				int LOC60;
				int LOC61;
				int LOC62;
				(*result).inhandle = pstdin[(((NI) 1))- 0];
				(*result).outhandle = pstdout[(((NI) 0))- 0];
				{
					int LOC58;
					if (!((options &(1<<((((NU8) 3))&7)))!=0)) goto LA56;
					(*result).errhandle = (*result).outhandle;
					LOC58 = 0;
					LOC58 = close(pstderr[(((NI) 0))- 0]);
				}
				goto LA54;
				LA56: ;
				{
					(*result).errhandle = pstderr[(((NI) 0))- 0];
				}
				LA54: ;
				LOC60 = 0;
				LOC60 = close(pstderr[(((NI) 1))- 0]);
				LOC61 = 0;
				LOC61 = close(pstdin[(((NI) 0))- 0]);
				LOC62 = 0;
				LOC62 = close(pstdout[(((NI) 1))- 0]);
			}
			LA44: ;
			popSafePoint();
		}
		else {
			popSafePoint();
		}
		{
			dealloccstringarray_14450(sysenv);
		}
		if (TMP2891.status != 0) reraiseException();
		popSafePoint();
	}
	else {
		popSafePoint();
	}
	{
		dealloccstringarray_14450(sysargs);
	}
	if (TMP2889.status != 0) reraiseException();
	return result;
}
Example #17
0
N_NIMCALL(void, addpathrec_3JEODh79bt1SXwL9cUHI7lhw)(NimStringDesc* dir0, Tlineinfo_T9c3PM9bs7WZ4LIQfEici9cZw info0) {
	Stringtableobj_DKRIdH9c9cKI7YpQb9c0wKlEw* packages0;
	NI pos0;
	packages0 = nstnewStringTable(((Stringtablemode_G9c4wVDFIzf0xHmQvxso9a9cQ) 2));
	pos0 = (NI)((dir0 ? dir0->Sup.len : 0) - ((NI) 1));
	{
		if (!(((NU8)(dir0->data[pos0])) == ((NU8)(92)) || ((NU8)(dir0->data[pos0])) == ((NU8)(47)))) goto LA3;
		pos0 += ((NI) 1);
	}
	LA3: ;
	{
		Pathcomponent_9c1SIU9cO1wHcl09b703A9cDrg k_KeWeZHiyBnWbJ7NUxRxrzQ;
		NimStringDesc* p_dm2MlSSgl6QuA4g3oqnzug;
		Win32finddata_aYwmSz9bIz0JHAL9ciwIrnhA f_yneQFFyrNSt4aVInhReW9aA;
		NI h_0lk9afqbBF9cAQtskh16RYmQ;
		NimStringDesc* LOC6;
		k_KeWeZHiyBnWbJ7NUxRxrzQ = (Pathcomponent_9c1SIU9cO1wHcl09b703A9cDrg)0;
		p_dm2MlSSgl6QuA4g3oqnzug = (NimStringDesc*)0;
		memset((void*)(&f_yneQFFyrNSt4aVInhReW9aA), 0, sizeof(f_yneQFFyrNSt4aVInhReW9aA));
		LOC6 = (NimStringDesc*)0;
		LOC6 = HEX2F_BsTQv9c9anbxt9bKmR0aN1elQ(dir0, ((NimStringDesc*) &T_asNQM9aynXXg9ccUABbReyew_2));
		h_0lk9afqbBF9cAQtskh16RYmQ = findfirstfile_9cPKjuaUWDYlrzWunhDgNng(LOC6, (&f_yneQFFyrNSt4aVInhReW9aA));
		{
			TSafePoint T_asNQM9aynXXg9ccUABbReyew_3;
			if (!!((h_0lk9afqbBF9cAQtskh16RYmQ == ((NI) -1)))) goto LA9;
			pushSafePoint(&T_asNQM9aynXXg9ccUABbReyew_3);
			T_asNQM9aynXXg9ccUABbReyew_3.status = setjmp(T_asNQM9aynXXg9ccUABbReyew_3.context);
			if (T_asNQM9aynXXg9ccUABbReyew_3.status == 0) {
				{
					while (1) {
						Pathcomponent_9c1SIU9cO1wHcl09b703A9cDrg volatile k_KeWeZHiyBnWbJ7NUxRxrzQ_2;
						k_KeWeZHiyBnWbJ7NUxRxrzQ_2 = ((Pathcomponent_9c1SIU9cO1wHcl09b703A9cDrg) 0);
						{
							NIM_BOOL LOC16;
							NimStringDesc* xx_D6S9bE74YCnbt3gCAKHz9cNA;
							LOC16 = (NIM_BOOL)0;
							LOC16 = skipfinddata_Paqclu9aSY8chOSEIvA5ZoAoptions((&f_yneQFFyrNSt4aVInhReW9aA));
							if (!!(LOC16)) goto LA17;
							{
								if (!!(((NI32)(f_yneQFFyrNSt4aVInhReW9aA.dwfileattributes & ((NI32) 16)) == ((NI32) 0)))) goto LA21;
								k_KeWeZHiyBnWbJ7NUxRxrzQ_2 = ((Pathcomponent_9c1SIU9cO1wHcl09b703A9cDrg) 2);
							}
							LA21: ;
							{
								if (!!(((NI32)(f_yneQFFyrNSt4aVInhReW9aA.dwfileattributes & ((NI32) 1024)) == ((NI32) 0)))) goto LA25;
								k_KeWeZHiyBnWbJ7NUxRxrzQ_2 = (Pathcomponent_9c1SIU9cO1wHcl09b703A9cDrg)(k_KeWeZHiyBnWbJ7NUxRxrzQ_2 + ((NI) 1));
							}
							LA25: ;
							{
								NimStringDesc* LOC31;
								if (!NIM_FALSE) goto LA29;
								LOC31 = (NimStringDesc*)0;
								LOC31 = HEX24_QjWkJEdnPpNzR7KF7dYIoQ(((NI16*) ((&f_yneQFFyrNSt4aVInhReW9aA.cfilename[(((NI) 0))- 0]))));
								xx_D6S9bE74YCnbt3gCAKHz9cNA = nosextractFilename(LOC31);
							}
							goto LA27;
							LA29: ;
							{
								NimStringDesc* LOC33;
								NimStringDesc* LOC34;
								LOC33 = (NimStringDesc*)0;
								LOC33 = HEX24_QjWkJEdnPpNzR7KF7dYIoQ(((NI16*) ((&f_yneQFFyrNSt4aVInhReW9aA.cfilename[(((NI) 0))- 0]))));
								LOC34 = (NimStringDesc*)0;
								LOC34 = nosextractFilename(LOC33);
								xx_D6S9bE74YCnbt3gCAKHz9cNA = HEX2F_BsTQv9c9anbxt9bKmR0aN1elQ(dir0, LOC34);
							}
							LA27: ;
							k_KeWeZHiyBnWbJ7NUxRxrzQ = k_KeWeZHiyBnWbJ7NUxRxrzQ_2;
							p_dm2MlSSgl6QuA4g3oqnzug = xx_D6S9bE74YCnbt3gCAKHz9cNA;
							{
								NIM_BOOL LOC37;
								LOC37 = (NIM_BOOL)0;
								LOC37 = (k_KeWeZHiyBnWbJ7NUxRxrzQ == ((Pathcomponent_9c1SIU9cO1wHcl09b703A9cDrg) 2));
								if (!(LOC37)) goto LA38;
								LOC37 = !(((NU8)(p_dm2MlSSgl6QuA4g3oqnzug->data[pos0]) == (NU8)(46)));
								LA38: ;
								if (!LOC37) goto LA39;
								addpackage_mPfTsfux8gBVeyQ8xwDYTQ(packages0, p_dm2MlSSgl6QuA4g3oqnzug);
							}
							LA39: ;
						}
						LA17: ;
						{
							NI32 LOC43;
							LOC43 = (NI32)0;
							LOC43 = Dl_120437(h_0lk9afqbBF9cAQtskh16RYmQ, (&f_yneQFFyrNSt4aVInhReW9aA));
							if (!(LOC43 == ((NI32) 0))) goto LA44;
							goto LA12;
						}
						LA44: ;
					}
				} LA12: ;
				popSafePoint();
			}
			else {
				popSafePoint();
			}
			{
				Dl_120601(h_0lk9afqbBF9cAQtskh16RYmQ);
			}
			if (T_asNQM9aynXXg9ccUABbReyew_3.status != 0) reraiseException();
		}
		LA9: ;
	}
	{
		NimStringDesc* p_dm2MlSSgl6QuA4g3oqnzug_2;
		p_dm2MlSSgl6QuA4g3oqnzug_2 = (NimStringDesc*)0;
		{
			NimStringDesc* key_Ev9apnmbO2PJJuXUQfg55Zg;
			NimStringDesc* val_ybgqP7AeGJc5RfjZOOmLIA;
			key_Ev9apnmbO2PJJuXUQfg55Zg = (NimStringDesc*)0;
			val_ybgqP7AeGJc5RfjZOOmLIA = (NimStringDesc*)0;
			{
				NI h_0lk9afqbBF9cAQtskh16RYmQ_2;
				NI HEX3Atmp_xBs1KTOTJ0azvpgP9bD601g;
				NI res_yPiyJP1ZM9abouUrPkQkp8Q;
				h_0lk9afqbBF9cAQtskh16RYmQ_2 = (NI)0;
				HEX3Atmp_xBs1KTOTJ0azvpgP9bD601g = (NI)0;
				HEX3Atmp_xBs1KTOTJ0azvpgP9bD601g = ((*packages0).data ? ((*packages0).data->Sup.len-1) : -1);
				res_yPiyJP1ZM9abouUrPkQkp8Q = ((NI) 0);
				{
					while (1) {
						if (!(res_yPiyJP1ZM9abouUrPkQkp8Q <= HEX3Atmp_xBs1KTOTJ0azvpgP9bD601g)) goto LA52;
						h_0lk9afqbBF9cAQtskh16RYmQ_2 = res_yPiyJP1ZM9abouUrPkQkp8Q;
						{
							NimStringDesc* res_yPiyJP1ZM9abouUrPkQkp8Q_2;
							if (!!(((*packages0).data->data[h_0lk9afqbBF9cAQtskh16RYmQ_2].Field0 == 0))) goto LA55;
							key_Ev9apnmbO2PJJuXUQfg55Zg = (*packages0).data->data[h_0lk9afqbBF9cAQtskh16RYmQ_2].Field0;
							val_ybgqP7AeGJc5RfjZOOmLIA = (*packages0).data->data[h_0lk9afqbBF9cAQtskh16RYmQ_2].Field1;
							{
								if (!eqStrings(val_ybgqP7AeGJc5RfjZOOmLIA, ((NimStringDesc*) &T_asNQM9aynXXg9ccUABbReyew_4))) goto LA59;
								res_yPiyJP1ZM9abouUrPkQkp8Q_2 = key_Ev9apnmbO2PJJuXUQfg55Zg;
							}
							goto LA57;
							LA59: ;
							{
								NimStringDesc* LOC62;
								LOC62 = (NimStringDesc*)0;
								LOC62 = rawNewString(key_Ev9apnmbO2PJJuXUQfg55Zg->Sup.len + val_ybgqP7AeGJc5RfjZOOmLIA->Sup.len + 1);
appendString(LOC62, key_Ev9apnmbO2PJJuXUQfg55Zg);
appendChar(LOC62, 45);
appendString(LOC62, val_ybgqP7AeGJc5RfjZOOmLIA);
								res_yPiyJP1ZM9abouUrPkQkp8Q_2 = LOC62;
							}
							LA57: ;
							p_dm2MlSSgl6QuA4g3oqnzug_2 = res_yPiyJP1ZM9abouUrPkQkp8Q_2;
							addnimblepath_Io0tiMEKgDlbf67BdbC9cWw(p_dm2MlSSgl6QuA4g3oqnzug_2, info0);
						}
						LA55: ;
						res_yPiyJP1ZM9abouUrPkQkp8Q += ((NI) 1);
					} LA52: ;
				}
			}
		}
	}
}
N_NIMCALL(void, addpathrec_277113)(NimStringDesc* dir, Tlineinfo192336 info) {
	Stringtableobj152608* packages;
	NI pos;
	packages = nstnewStringTable(((NU8) 2));
	pos = (NI)((dir ? dir->Sup.len : 0) - ((NI) 1));
	{
		if (!(((NU8)(dir->data[pos])) == ((NU8)(47)) || ((NU8)(dir->data[pos])) == ((NU8)(47)))) goto LA3;
		pos += ((NI) 1);
	}
	LA3: ;
	{
		NU8 k_277139;
		NimStringDesc* p_277140;
		DIR* d_277167;
		k_277139 = 0;
		p_277140 = 0;
		d_277167 = opendir(dir->data);
		{
			TSafePoint TMP1827;
			if (!!((d_277167 == NIM_NIL))) goto LA8;
			pushSafePoint(&TMP1827);
			TMP1827.status = setjmp(TMP1827.context);
			if (TMP1827.status == 0) {
				{
					while (1) {
						{
							struct dirent* x_277169;
							NimStringDesc* volatile y_277171;
							x_277169 = readdir(d_277167);
							{
								if (!(x_277169 == NIM_NIL)) goto LA16;
								goto LA11;
							}
							LA16: ;
							y_277171 = cstrToNimstr(((NCSTRING) ((*x_277169).d_name)));
							{
								NIM_BOOL LOC20;
								struct stat s_277173;
								NU8 volatile k_277175;
								LOC20 = 0;
								LOC20 = !(eqStrings(y_277171, ((NimStringDesc*) &TMP1828)));
								if (!(LOC20)) goto LA21;
								LOC20 = !(eqStrings(y_277171, ((NimStringDesc*) &TMP1829)));
								LA21: ;
								if (!LOC20) goto LA22;
								memset((void*)(&s_277173), 0, sizeof(s_277173));
								{
									if (!NIM_TRUE) goto LA26;
									y_277171 = HEX2F_128265(dir, y_277171);
								}
								LA26: ;
								k_277175 = ((NU8) 0);
								{
									if (!!(((*x_277169).d_type == ((NI8) 0)))) goto LA30;
									{
										if (!((*x_277169).d_type == ((NI8) 4))) goto LA34;
										k_277175 = ((NU8) 2);
									}
									LA34: ;
									{
										if (!((*x_277169).d_type == ((NI8) 10))) goto LA38;
										{
											NIM_BOOL LOC42;
											LOC42 = 0;
											LOC42 = direxists_131608(y_277171);
											if (!LOC42) goto LA43;
											k_277175 = ((NU8) 3);
										}
										goto LA40;
										LA43: ;
										{
											k_277175 = ((NU8) 1);
										}
										LA40: ;
									}
									LA38: ;
									k_277139 = k_277175;
									p_277140 = y_277171;
									{
										NIM_BOOL LOC48;
										LOC48 = 0;
										LOC48 = (k_277139 == ((NU8) 2));
										if (!(LOC48)) goto LA49;
										LOC48 = !(((NU8)(p_277140->data[pos]) == (NU8)(46)));
										LA49: ;
										if (!LOC48) goto LA50;
										addpackage_277084(packages, p_277140);
									}
									LA50: ;
									goto LA13;
								}
								LA30: ;
								{
									int LOC54;
									LOC54 = 0;
									LOC54 = lstat(y_277171->data, (&s_277173));
									if (!(LOC54 < ((NI32) 0))) goto LA55;
									goto LA11;
								}
								LA55: ;
								{
									NIM_BOOL LOC59;
									LOC59 = 0;
									LOC59 = S_ISDIR(s_277173.st_mode);
									if (!LOC59) goto LA60;
									k_277175 = ((NU8) 2);
								}
								goto LA57;
								LA60: ;
								{
									NIM_BOOL LOC63;
									LOC63 = 0;
									LOC63 = S_ISLNK(s_277173.st_mode);
									if (!LOC63) goto LA64;
									k_277175 = getsymlinkfilekind_137218(y_277171);
								}
								goto LA57;
								LA64: ;
								LA57: ;
								k_277139 = k_277175;
								p_277140 = y_277171;
								{
									NIM_BOOL LOC68;
									LOC68 = 0;
									LOC68 = (k_277139 == ((NU8) 2));
									if (!(LOC68)) goto LA69;
									LOC68 = !(((NU8)(p_277140->data[pos]) == (NU8)(46)));
									LA69: ;
									if (!LOC68) goto LA70;
									addpackage_277084(packages, p_277140);
								}
								LA70: ;
							}
							LA22: ;
						} LA13: ;
					}
				} LA11: ;
				popSafePoint();
			}
			else {
				popSafePoint();
			}
			{
				int LOC74;
				LOC74 = 0;
				LOC74 = closedir(d_277167);
			}
			if (TMP1827.status != 0) reraiseException();
		}
		LA8: ;
	}
	{
		NimStringDesc* p_277150;
		p_277150 = 0;
		{
			NimStringDesc* key_277181;
			NimStringDesc* val_277183;
			key_277181 = 0;
			val_277183 = 0;
			{
				NI h_277185;
				NI HEX3Atmp_277187;
				NI res_277189;
				h_277185 = 0;
				HEX3Atmp_277187 = 0;
				HEX3Atmp_277187 = ((*packages).data ? ((*packages).data->Sup.len-1) : -1);
				res_277189 = ((NI) 0);
				{
					while (1) {
						if (!(res_277189 <= HEX3Atmp_277187)) goto LA79;
						h_277185 = res_277189;
						{
							NimStringDesc* res_277193;
							if (!!((*packages).data->data[h_277185].Field0 == 0)) goto LA82;
							key_277181 = (*packages).data->data[h_277185].Field0;
							val_277183 = (*packages).data->data[h_277185].Field1;
							{
								if (!eqStrings(val_277183, ((NimStringDesc*) &TMP1830))) goto LA86;
								res_277193 = key_277181;
							}
							goto LA84;
							LA86: ;
							{
								NimStringDesc* LOC89;
								LOC89 = 0;
								LOC89 = rawNewString(key_277181->Sup.len + val_277183->Sup.len + 1);
appendString(LOC89, key_277181);
appendChar(LOC89, 45);
appendString(LOC89, val_277183);
								res_277193 = LOC89;
							}
							LA84: ;
							p_277150 = res_277193;
							addnimblepath_277108(p_277150, info);
						}
						LA82: ;
						res_277189 += ((NI) 1);
					} LA79: ;
				}
			}
		}
	}
}
Example #19
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: ;
}
N_NIMCALL(void, addpathrec_277112_1623492514)(NimStringDesc* dir0, Tlineinfo192336 info0) {
	Stringtableobj152608* packages0;
	NI pos0;
	packages0 = nstnewStringTable(((Stringtablemode152602) 2));
	pos0 = (NI)((dir0 ? dir0->Sup.len : 0) - ((NI) 1));
	{
		if (!(((NU8)(dir0->data[pos0])) == ((NU8)(47)) || ((NU8)(dir0->data[pos0])) == ((NU8)(47)))) goto LA3;
		pos0 += ((NI) 1);
	}
	LA3: ;
	{
		Pathcomponent137212 k_277138_1623492514;
		NimStringDesc* p_277139_1623492514;
		DIR* d_277166_1623492514;
		k_277138_1623492514 = (Pathcomponent137212)0;
		p_277139_1623492514 = (NimStringDesc*)0;
		d_277166_1623492514 = opendir(dir0->data);
		{
			TSafePoint T1623492514_2;
			if (!!((d_277166_1623492514 == NIM_NIL))) goto LA8;
			pushSafePoint(&T1623492514_2);
			T1623492514_2.status = _setjmp(T1623492514_2.context);
			if (T1623492514_2.status == 0) {
				{
					while (1) {
						{
							struct dirent* x_277168_1623492514;
							NimStringDesc* volatile y_277170_1623492514;
							x_277168_1623492514 = readdir(d_277166_1623492514);
							{
								if (!(x_277168_1623492514 == NIM_NIL)) goto LA16;
								goto LA11;
							}
							LA16: ;
							y_277170_1623492514 = cstrToNimstr(((NCSTRING) ((*x_277168_1623492514).d_name)));
							{
								NIM_BOOL LOC20;
								struct stat s_277172_1623492514;
								Pathcomponent137212 volatile k_277174_1623492514;
								LOC20 = (NIM_BOOL)0;
								LOC20 = !(eqStrings(y_277170_1623492514, ((NimStringDesc*) &T1623492514_3)));
								if (!(LOC20)) goto LA21;
								LOC20 = !(eqStrings(y_277170_1623492514, ((NimStringDesc*) &T1623492514_4)));
								LA21: ;
								if (!LOC20) goto LA22;
								memset((void*)(&s_277172_1623492514), 0, sizeof(s_277172_1623492514));
								{
									if (!NIM_TRUE) goto LA26;
									y_277170_1623492514 = HEX2F_128265_2125978480(dir0, y_277170_1623492514);
								}
								LA26: ;
								k_277174_1623492514 = ((Pathcomponent137212) 0);
								{
									if (!!(((*x_277168_1623492514).d_type == ((NI8) 0)))) goto LA30;
									{
										if (!((*x_277168_1623492514).d_type == ((NI8) 4))) goto LA34;
										k_277174_1623492514 = ((Pathcomponent137212) 2);
									}
									LA34: ;
									{
										if (!((*x_277168_1623492514).d_type == ((NI8) 10))) goto LA38;
										{
											NIM_BOOL LOC42;
											LOC42 = (NIM_BOOL)0;
											LOC42 = direxists_131608_2125978480(y_277170_1623492514);
											if (!LOC42) goto LA43;
											k_277174_1623492514 = ((Pathcomponent137212) 3);
										}
										goto LA40;
										LA43: ;
										{
											k_277174_1623492514 = ((Pathcomponent137212) 1);
										}
										LA40: ;
									}
									LA38: ;
									k_277138_1623492514 = k_277174_1623492514;
									p_277139_1623492514 = y_277170_1623492514;
									{
										NIM_BOOL LOC48;
										LOC48 = (NIM_BOOL)0;
										LOC48 = (k_277138_1623492514 == ((Pathcomponent137212) 2));
										if (!(LOC48)) goto LA49;
										LOC48 = !(((NU8)(p_277139_1623492514->data[pos0]) == (NU8)(46)));
										LA49: ;
										if (!LOC48) goto LA50;
										addpackage_277083_1623492514(packages0, p_277139_1623492514);
									}
									LA50: ;
									goto LA13;
								}
								LA30: ;
								{
									int LOC54;
									LOC54 = (int)0;
									LOC54 = lstat(y_277170_1623492514->data, (&s_277172_1623492514));
									if (!(LOC54 < ((NI32) 0))) goto LA55;
									goto LA11;
								}
								LA55: ;
								{
									NIM_BOOL LOC59;
									LOC59 = (NIM_BOOL)0;
									LOC59 = S_ISDIR(s_277172_1623492514.st_mode);
									if (!LOC59) goto LA60;
									k_277174_1623492514 = ((Pathcomponent137212) 2);
								}
								goto LA57;
								LA60: ;
								{
									NIM_BOOL LOC63;
									LOC63 = (NIM_BOOL)0;
									LOC63 = S_ISLNK(s_277172_1623492514.st_mode);
									if (!LOC63) goto LA64;
									k_277174_1623492514 = getsymlinkfilekind_137219_2125978480(y_277170_1623492514);
								}
								goto LA57;
								LA64: ;
								LA57: ;
								k_277138_1623492514 = k_277174_1623492514;
								p_277139_1623492514 = y_277170_1623492514;
								{
									NIM_BOOL LOC68;
									LOC68 = (NIM_BOOL)0;
									LOC68 = (k_277138_1623492514 == ((Pathcomponent137212) 2));
									if (!(LOC68)) goto LA69;
									LOC68 = !(((NU8)(p_277139_1623492514->data[pos0]) == (NU8)(46)));
									LA69: ;
									if (!LOC68) goto LA70;
									addpackage_277083_1623492514(packages0, p_277139_1623492514);
								}
								LA70: ;
							}
							LA22: ;
						} LA13: ;
					}
				} LA11: ;
				popSafePoint();
			}
			else {
				popSafePoint();
			}
			{
				int LOC74;
				LOC74 = (int)0;
				LOC74 = closedir(d_277166_1623492514);
			}
			if (T1623492514_2.status != 0) reraiseException();
		}
		LA8: ;
	}
	{
		NimStringDesc* p_277149_1623492514;
		p_277149_1623492514 = (NimStringDesc*)0;
		{
			NimStringDesc* key_277180_1623492514;
			NimStringDesc* val_277182_1623492514;
			key_277180_1623492514 = (NimStringDesc*)0;
			val_277182_1623492514 = (NimStringDesc*)0;
			{
				NI h_277184_1623492514;
				NI HEX3Atmp_277186_1623492514;
				NI res_277188_1623492514;
				h_277184_1623492514 = (NI)0;
				HEX3Atmp_277186_1623492514 = (NI)0;
				HEX3Atmp_277186_1623492514 = ((*packages0).data ? ((*packages0).data->Sup.len-1) : -1);
				res_277188_1623492514 = ((NI) 0);
				{
					while (1) {
						if (!(res_277188_1623492514 <= HEX3Atmp_277186_1623492514)) goto LA79;
						h_277184_1623492514 = res_277188_1623492514;
						{
							NimStringDesc* res_277192_1623492514;
							if (!!((*packages0).data->data[h_277184_1623492514].Field0 == 0)) goto LA82;
							key_277180_1623492514 = (*packages0).data->data[h_277184_1623492514].Field0;
							val_277182_1623492514 = (*packages0).data->data[h_277184_1623492514].Field1;
							{
								if (!eqStrings(val_277182_1623492514, ((NimStringDesc*) &T1623492514_5))) goto LA86;
								res_277192_1623492514 = key_277180_1623492514;
							}
							goto LA84;
							LA86: ;
							{
								NimStringDesc* LOC89;
								LOC89 = (NimStringDesc*)0;
								LOC89 = rawNewString(key_277180_1623492514->Sup.len + val_277182_1623492514->Sup.len + 1);
appendString(LOC89, key_277180_1623492514);
appendChar(LOC89, 45);
appendString(LOC89, val_277182_1623492514);
								res_277192_1623492514 = LOC89;
							}
							LA84: ;
							p_277149_1623492514 = res_277192_1623492514;
							addnimblepath_277107_1623492514(p_277149_1623492514, info0);
						}
						LA82: ;
						res_277188_1623492514 += ((NI) 1);
					} LA79: ;
				}
			}
		}
	}
}
Example #21
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: ;
}
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: ;
}
Example #23
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: ;
}
Example #24
0
N_NIMCALL(void, addpathrec_3JEODh79bt1SXwL9cUHI7lhw)(NimStringDesc* dir0, Tlineinfo_T9c3PM9bs7WZ4LIQfEici9cZw info0) {
	Stringtableobj_DKRIdH9c9cKI7YpQb9c0wKlEw* packages0;
	NI pos0;
	packages0 = nstnewStringTable(((Stringtablemode_G9c4wVDFIzf0xHmQvxso9a9cQ) 2));
	pos0 = (NI)((dir0 ? dir0->Sup.len : 0) - ((NI) 1));
	{
		if (!(((NU8)(dir0->data[pos0])) == ((NU8)(47)) || ((NU8)(dir0->data[pos0])) == ((NU8)(47)))) goto LA3;
		pos0 += ((NI) 1);
	}
	LA3: ;
	{
		Pathcomponent_9c1SIU9cO1wHcl09b703A9cDrg k_KeWeZHiyBnWbJ7NUxRxrzQ;
		NimStringDesc* p_dm2MlSSgl6QuA4g3oqnzug;
		DIR* d_ZfFno5oDVOm9aHJ009cmNoGQ;
		k_KeWeZHiyBnWbJ7NUxRxrzQ = (Pathcomponent_9c1SIU9cO1wHcl09b703A9cDrg)0;
		p_dm2MlSSgl6QuA4g3oqnzug = (NimStringDesc*)0;
		d_ZfFno5oDVOm9aHJ009cmNoGQ = opendir(dir0->data);
		{
			TSafePoint T_asNQM9aynXXg9ccUABbReyew_2;
			if (!!((d_ZfFno5oDVOm9aHJ009cmNoGQ == NIM_NIL))) goto LA8;
			pushSafePoint(&T_asNQM9aynXXg9ccUABbReyew_2);
			T_asNQM9aynXXg9ccUABbReyew_2.status = setjmp(T_asNQM9aynXXg9ccUABbReyew_2.context);
			if (T_asNQM9aynXXg9ccUABbReyew_2.status == 0) {
				{
					while (1) {
						{
							struct dirent* x_rBzPa0W2aCO6C2N57Y0ovQ;
							NimStringDesc* volatile y_KzqyWmE69cwQ0l9c9bXwsjU9cw;
							x_rBzPa0W2aCO6C2N57Y0ovQ = readdir(d_ZfFno5oDVOm9aHJ009cmNoGQ);
							{
								if (!(x_rBzPa0W2aCO6C2N57Y0ovQ == NIM_NIL)) goto LA16;
								goto LA11;
							}
							LA16: ;
							y_KzqyWmE69cwQ0l9c9bXwsjU9cw = cstrToNimstr(((NCSTRING) ((*x_rBzPa0W2aCO6C2N57Y0ovQ).d_name)));
							{
								NIM_BOOL LOC20;
								struct stat s_k2PyMBHM0O7gW5niqUdMGA;
								Pathcomponent_9c1SIU9cO1wHcl09b703A9cDrg volatile k_KeWeZHiyBnWbJ7NUxRxrzQ_2;
								LOC20 = (NIM_BOOL)0;
								LOC20 = !(eqStrings(y_KzqyWmE69cwQ0l9c9bXwsjU9cw, ((NimStringDesc*) &T_asNQM9aynXXg9ccUABbReyew_3)));
								if (!(LOC20)) goto LA21;
								LOC20 = !(eqStrings(y_KzqyWmE69cwQ0l9c9bXwsjU9cw, ((NimStringDesc*) &T_asNQM9aynXXg9ccUABbReyew_4)));
								LA21: ;
								if (!LOC20) goto LA22;
								memset((void*)(&s_k2PyMBHM0O7gW5niqUdMGA), 0, sizeof(s_k2PyMBHM0O7gW5niqUdMGA));
								{
									if (!NIM_TRUE) goto LA26;
									y_KzqyWmE69cwQ0l9c9bXwsjU9cw = HEX2F_BsTQv9c9anbxt9bKmR0aN1elQ(dir0, y_KzqyWmE69cwQ0l9c9bXwsjU9cw);
								}
								LA26: ;
								k_KeWeZHiyBnWbJ7NUxRxrzQ_2 = ((Pathcomponent_9c1SIU9cO1wHcl09b703A9cDrg) 0);
								{
									if (!!(((*x_rBzPa0W2aCO6C2N57Y0ovQ).d_type == ((NI8) 0)))) goto LA30;
									{
										if (!((*x_rBzPa0W2aCO6C2N57Y0ovQ).d_type == ((NI8) 4))) goto LA34;
										k_KeWeZHiyBnWbJ7NUxRxrzQ_2 = ((Pathcomponent_9c1SIU9cO1wHcl09b703A9cDrg) 2);
									}
									LA34: ;
									{
										if (!((*x_rBzPa0W2aCO6C2N57Y0ovQ).d_type == ((NI8) 10))) goto LA38;
										{
											NIM_BOOL LOC42;
											LOC42 = (NIM_BOOL)0;
											LOC42 = direxists_wf0Ae3eLXw0lSNEFJMV3ognimblecmd(y_KzqyWmE69cwQ0l9c9bXwsjU9cw);
											if (!LOC42) goto LA43;
											k_KeWeZHiyBnWbJ7NUxRxrzQ_2 = ((Pathcomponent_9c1SIU9cO1wHcl09b703A9cDrg) 3);
										}
										goto LA40;
										LA43: ;
										{
											k_KeWeZHiyBnWbJ7NUxRxrzQ_2 = ((Pathcomponent_9c1SIU9cO1wHcl09b703A9cDrg) 1);
										}
										LA40: ;
									}
									LA38: ;
									k_KeWeZHiyBnWbJ7NUxRxrzQ = k_KeWeZHiyBnWbJ7NUxRxrzQ_2;
									p_dm2MlSSgl6QuA4g3oqnzug = y_KzqyWmE69cwQ0l9c9bXwsjU9cw;
									{
										NIM_BOOL LOC48;
										LOC48 = (NIM_BOOL)0;
										LOC48 = (k_KeWeZHiyBnWbJ7NUxRxrzQ == ((Pathcomponent_9c1SIU9cO1wHcl09b703A9cDrg) 2));
										if (!(LOC48)) goto LA49;
										LOC48 = !(((NU8)(p_dm2MlSSgl6QuA4g3oqnzug->data[pos0]) == (NU8)(46)));
										LA49: ;
										if (!LOC48) goto LA50;
										addpackage_mPfTsfux8gBVeyQ8xwDYTQ(packages0, p_dm2MlSSgl6QuA4g3oqnzug);
									}
									LA50: ;
									goto LA13;
								}
								LA30: ;
								{
									int LOC54;
									LOC54 = (int)0;
									LOC54 = lstat(y_KzqyWmE69cwQ0l9c9bXwsjU9cw->data, (&s_k2PyMBHM0O7gW5niqUdMGA));
									if (!(LOC54 < ((NI32) 0))) goto LA55;
									goto LA11;
								}
								LA55: ;
								{
									NIM_BOOL LOC59;
									LOC59 = (NIM_BOOL)0;
									LOC59 = S_ISDIR(s_k2PyMBHM0O7gW5niqUdMGA.st_mode);
									if (!LOC59) goto LA60;
									k_KeWeZHiyBnWbJ7NUxRxrzQ_2 = ((Pathcomponent_9c1SIU9cO1wHcl09b703A9cDrg) 2);
								}
								goto LA57;
								LA60: ;
								{
									NIM_BOOL LOC63;
									LOC63 = (NIM_BOOL)0;
									LOC63 = S_ISLNK(s_k2PyMBHM0O7gW5niqUdMGA.st_mode);
									if (!LOC63) goto LA64;
									k_KeWeZHiyBnWbJ7NUxRxrzQ_2 = getsymlinkfilekind_WoXOp8qmMec1P4MyA3LBKg(y_KzqyWmE69cwQ0l9c9bXwsjU9cw);
								}
								goto LA57;
								LA64: ;
								LA57: ;
								k_KeWeZHiyBnWbJ7NUxRxrzQ = k_KeWeZHiyBnWbJ7NUxRxrzQ_2;
								p_dm2MlSSgl6QuA4g3oqnzug = y_KzqyWmE69cwQ0l9c9bXwsjU9cw;
								{
									NIM_BOOL LOC68;
									LOC68 = (NIM_BOOL)0;
									LOC68 = (k_KeWeZHiyBnWbJ7NUxRxrzQ == ((Pathcomponent_9c1SIU9cO1wHcl09b703A9cDrg) 2));
									if (!(LOC68)) goto LA69;
									LOC68 = !(((NU8)(p_dm2MlSSgl6QuA4g3oqnzug->data[pos0]) == (NU8)(46)));
									LA69: ;
									if (!LOC68) goto LA70;
									addpackage_mPfTsfux8gBVeyQ8xwDYTQ(packages0, p_dm2MlSSgl6QuA4g3oqnzug);
								}
								LA70: ;
							}
							LA22: ;
						} LA13: ;
					}
				} LA11: ;
				popSafePoint();
			}
			else {
				popSafePoint();
			}
			{
				int LOC74;
				LOC74 = (int)0;
				LOC74 = closedir(d_ZfFno5oDVOm9aHJ009cmNoGQ);
			}
			if (T_asNQM9aynXXg9ccUABbReyew_2.status != 0) reraiseException();
		}
		LA8: ;
	}
	{
		NimStringDesc* p_dm2MlSSgl6QuA4g3oqnzug_2;
		p_dm2MlSSgl6QuA4g3oqnzug_2 = (NimStringDesc*)0;
		{
			NimStringDesc* key_Ev9apnmbO2PJJuXUQfg55Zg;
			NimStringDesc* val_ybgqP7AeGJc5RfjZOOmLIA;
			key_Ev9apnmbO2PJJuXUQfg55Zg = (NimStringDesc*)0;
			val_ybgqP7AeGJc5RfjZOOmLIA = (NimStringDesc*)0;
			{
				NI h_0lk9afqbBF9cAQtskh16RYmQ;
				NI HEX3Atmp_xBs1KTOTJ0azvpgP9bD601g;
				NI res_yPiyJP1ZM9abouUrPkQkp8Q;
				h_0lk9afqbBF9cAQtskh16RYmQ = (NI)0;
				HEX3Atmp_xBs1KTOTJ0azvpgP9bD601g = (NI)0;
				HEX3Atmp_xBs1KTOTJ0azvpgP9bD601g = ((*packages0).data ? ((*packages0).data->Sup.len-1) : -1);
				res_yPiyJP1ZM9abouUrPkQkp8Q = ((NI) 0);
				{
					while (1) {
						if (!(res_yPiyJP1ZM9abouUrPkQkp8Q <= HEX3Atmp_xBs1KTOTJ0azvpgP9bD601g)) goto LA79;
						h_0lk9afqbBF9cAQtskh16RYmQ = res_yPiyJP1ZM9abouUrPkQkp8Q;
						{
							NimStringDesc* res_yPiyJP1ZM9abouUrPkQkp8Q_2;
							if (!!(((*packages0).data->data[h_0lk9afqbBF9cAQtskh16RYmQ].Field0 == 0))) goto LA82;
							key_Ev9apnmbO2PJJuXUQfg55Zg = (*packages0).data->data[h_0lk9afqbBF9cAQtskh16RYmQ].Field0;
							val_ybgqP7AeGJc5RfjZOOmLIA = (*packages0).data->data[h_0lk9afqbBF9cAQtskh16RYmQ].Field1;
							{
								if (!eqStrings(val_ybgqP7AeGJc5RfjZOOmLIA, ((NimStringDesc*) &T_asNQM9aynXXg9ccUABbReyew_5))) goto LA86;
								res_yPiyJP1ZM9abouUrPkQkp8Q_2 = key_Ev9apnmbO2PJJuXUQfg55Zg;
							}
							goto LA84;
							LA86: ;
							{
								NimStringDesc* LOC89;
								LOC89 = (NimStringDesc*)0;
								LOC89 = rawNewString(key_Ev9apnmbO2PJJuXUQfg55Zg->Sup.len + val_ybgqP7AeGJc5RfjZOOmLIA->Sup.len + 1);
appendString(LOC89, key_Ev9apnmbO2PJJuXUQfg55Zg);
appendChar(LOC89, 45);
appendString(LOC89, val_ybgqP7AeGJc5RfjZOOmLIA);
								res_yPiyJP1ZM9abouUrPkQkp8Q_2 = LOC89;
							}
							LA84: ;
							p_dm2MlSSgl6QuA4g3oqnzug_2 = res_yPiyJP1ZM9abouUrPkQkp8Q_2;
							addnimblepath_Io0tiMEKgDlbf67BdbC9cWw(p_dm2MlSSgl6QuA4g3oqnzug_2, info0);
						}
						LA82: ;
						res_yPiyJP1ZM9abouUrPkQkp8Q += ((NI) 1);
					} LA79: ;
				}
			}
		}
	}
}
Example #25
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();
}
Example #26
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();
}
Example #27
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;
}