Exemplo n.º 1
0
N_NIMCALL(NimStringDesc*, Getmodulefile_106013)(TY50526* N_106015) {
NimStringDesc* Result_106024;
NimStringDesc* LOC1;
Result_106024 = 0;
switch ((*N_106015).Kind) {
case ((NU8) 14):
case ((NU8) 15):
case ((NU8) 16):
LOC1 = 0;
LOC1 = nosUnixToNativePath((*N_106015).KindU.S3.Strval);
Result_106024 = Findmodule_106016((*N_106015).Info, LOC1);
break;
case ((NU8) 2):
Result_106024 = Findmodule_106016((*N_106015).Info, (*(*N_106015).KindU.S5.Ident).S);
break;
case ((NU8) 3):
Result_106024 = Findmodule_106016((*N_106015).Info, (*(*(*N_106015).KindU.S4.Sym).Name).S);
break;
default:
Internalerror_43159((*N_106015).Info, ((NimStringDesc*) &TMP192194));
Result_106024 = copyString(((NimStringDesc*) &TMP192195));
break;
}
return Result_106024;
}
Exemplo n.º 2
0
N_NIMCALL(void, Processcmdline_195204)(NU8 Pass_195206, NimStringDesc** Command_195208, NimStringDesc** Filename_195209) {
TY193404 P_195210;
NI Bracketle_195212;
NimStringDesc* Key_195215;
NimStringDesc* Val_195216;
NimStringDesc* LOC5;
NimStringDesc* LOC6;
NIM_BOOL LOC16;
TY46331 LOC20;
memset((void*)&P_195210, 0, sizeof(P_195210));
Initoptparser_193415(((NimStringDesc*) &TMP195203), &P_195210);
P_195210.Sup.m_type = NTI193404;
while (1) {
nponext(&P_195210);
switch (P_195210.Kind) {
case ((NU8) 0):
goto LA1;
break;
case ((NU8) 2):
case ((NU8) 3):
Bracketle_195212 = 0;
Bracketle_195212 = nsuFindChar(P_195210.Key, 91, 0);
if (!(0 <= Bracketle_195212)) goto LA3;
Key_195215 = 0;
Key_195215 = copyStrLast(P_195210.Key, 0, (NI32)(Bracketle_195212 - 1));
Val_195216 = 0;
LOC5 = 0;
LOC6 = 0;
LOC6 = copyStr(P_195210.Key, (NI32)(Bracketle_195212 + 1));
LOC5 = rawNewString(LOC6->Sup.len + P_195210.Val->Sup.len + 1);
appendString(LOC5, LOC6);
appendChar(LOC5, 58);
appendString(LOC5, P_195210.Val);
Val_195216 = LOC5;
Processswitch_73012(Key_195215, Val_195216, Pass_195206, Cmdlineinfo_195202);
goto LA2;
LA3: ;
Processswitch_73012(P_195210.Key, P_195210.Val, Pass_195206, Cmdlineinfo_195202);
LA2: ;
break;
case ((NU8) 1):
if (!(((*Command_195208)) && ((*Command_195208))->Sup.len == 0)) goto LA8;
unsureAsgnRef((void**) &(*Command_195208), copyString(P_195210.Key));
goto LA7;
LA8: ;
if (!(((*Filename_195209)) && ((*Filename_195209))->Sup.len == 0)) goto LA10;
unsureAsgnRef((void**) &(*Filename_195209), nosUnixToNativePath(P_195210.Key));
goto LA1;
goto LA7;
LA10: ;
LA7: ;
break;
}
} LA1: ;
if (!(Pass_195206 == ((NU8) 1))) goto LA13;
asgnRefNoCycle((void**) &Arguments_195201, npocmdLineRest(&P_195210));
LOC16 = !(((Gglobaloptions_46079 &(1<<((((NU8) 14))&31)))!=0));
if (!(LOC16)) goto LA17;
LOC16 = !(((Arguments_195201) && (Arguments_195201)->Sup.len == 0));
LA17: ;
if (!LOC16) goto LA18;
memset((void*)&LOC20, 0, sizeof(LOC20));
Rawmessage_47971(((NU8) 54), LOC20, 0);
LA18: ;
LA13: ;
}
Exemplo n.º 3
0
N_NIMCALL(void, processcmdline_418207)(NU8 pass, NimStringDesc* cmd) {
	toptparser416607 p;
	NI argscount;
	nimfr("ProcessCmdLine", "service.nim")
	nimln(33, "service.nim");
	chckNil((void*)&p);
	memset((void*)&p, 0, sizeof(p));
	p.Sup.m_type = (&NTI416607);
	initoptparser_416619(cmd, &p);	nimln(34, "service.nim");
	argscount = 0;
	nimln(35, "service.nim");
	while (1) {
		nimln(36, "service.nim");
		nponext(&p);		nimln(37, "service.nim");
		switch (p.Kind) {
		case ((NU8) 0):
		{
			nimln(38, "service.nim");
			goto LA1;
		}		break;
		case ((NU8) 2):
		case ((NU8) 3):
		{
			NI bracketle;
			nimln(42, "service.nim");
			bracketle = nsuFindChar(p.Key, 91, 0);
			nimln(43, "service.nim");
			{
				NimStringDesc* key;
				NI TMP7042;
				NimStringDesc* val;
				NimStringDesc* LOC8;
				NI TMP7043;
				NimStringDesc* LOC9;
				nimln(702, "system.nim");
				if (!(0 <= bracketle)) goto LA6;
				nimln(44, "service.nim");
				nimln(44, "service.nim");
				nimln(44, "service.nim");
				TMP7042 = subInt(bracketle, 1);
				key = copyStrLast(p.Key, 0, (NI64)(TMP7042));
				nimln(45, "service.nim");
				nimln(45, "service.nim");
				LOC8 = 0;
				nimln(45, "service.nim");
				nimln(45, "service.nim");
				TMP7043 = addInt(bracketle, 1);
				LOC9 = 0;
				LOC9 = copyStr(p.Key, (NI64)(TMP7043));
				LOC8 = rawNewString(LOC9->Sup.len + p.Val->Sup.len + 1);
appendString(LOC8, LOC9);
appendChar(LOC8, 58);
appendString(LOC8, p.Val);
				val = LOC8;
				nimln(46, "service.nim");
				processswitch_151016(key, val, pass, gcmdlineinfo_137008);			}			goto LA4;
			LA6: ;
			{
				nimln(48, "service.nim");
				processswitch_151016(p.Key, p.Val, pass, gcmdlineinfo_137008);			}			LA4: ;
		}		break;
		case ((NU8) 1):
		{
			nimln(50, "service.nim");
			{
				NimStringDesc* LOC16;
				nimln(50, "service.nim");
				if (!(argscount == 0)) goto LA14;
				nimln(51, "service.nim");
				LOC16 = 0;
				LOC16 = command_114203; command_114203 = copyStringRC1(p.Key);
				if (LOC16) nimGCunrefNoCycle(LOC16);
			}			goto LA12;
			LA14: ;
			{
				nimln(53, "service.nim");
				{
					NimStringDesc* LOC22;
					nimln(53, "service.nim");
					if (!(pass == ((NU8) 0))) goto LA20;
					nimln(53, "service.nim");
					commandargs_114222 = (TY9552*) incrSeq(&(commandargs_114222)->Sup, sizeof(NimStringDesc*));
					LOC22 = 0;
					LOC22 = commandargs_114222->data[commandargs_114222->Sup.len-1]; commandargs_114222->data[commandargs_114222->Sup.len-1] = copyStringRC1(p.Key);
					if (LOC22) nimGCunrefNoCycle(LOC22);
				}				LA20: ;
				nimln(54, "service.nim");
				{
					nimln(54, "service.nim");
					if (!(argscount == 1)) goto LA25;
					nimln(56, "service.nim");
					asgnRefNoCycle((void**) &gprojectname_114197, nosUnixToNativePath(p.Key));
					nimln(57, "service.nim");
					asgnRefNoCycle((void**) &arguments_418205, npocmdLineRest(&p));
					nimln(58, "service.nim");
					goto LA1;
				}				LA25: ;
			}			LA12: ;
			nimln(59, "service.nim");
			argscount = addInt(argscount, 1);
		}		break;
		}
	} LA1: ;
	nimln(61, "service.nim");
	{
		nimln(61, "service.nim");
		if (!(pass == ((NU8) 1))) goto LA29;
		nimln(62, "service.nim");
		{
			NIM_BOOL LOC33;
			TY148228 LOC37;
			nimln(62, "service.nim");
			LOC33 = 0;
			nimln(731, "system.nim");
			nimln(731, "system.nim");
			LOC33 = !(((gglobaloptions_114109 &(1<<((((NU8) 13))&31)))!=0));
			if (!(LOC33)) goto LA34;
			nimln(698, "system.nim");
			nimln(698, "system.nim");
			LOC33 = !(((arguments_418205) && (arguments_418205)->Sup.len == 0));
			LA34: ;
			if (!LOC33) goto LA35;
			nimln(63, "service.nim");
			memset((void*)LOC37, 0, sizeof(LOC37));
			rawmessage_138121(((NU16) 57), LOC37, 0);		}		LA35: ;
	}	LA29: ;
	popFrame();
}