コード例 #1
0
N_NIMCALL(Tnode290802*, parsefile_315029_4241778752)(NI32 fileidx0) {
	Tnode290802* result0;
	Tparsers315026 p0;
	FILE* f0;
	NimStringDesc* filename0;
	Tllstream280204* LOC6;
{	result0 = (Tnode290802*)0;
	memset((void*)(&p0), 0, sizeof(p0));
	objectInit((&p0), (&NTI315026));
	f0 = (FILE*)0;
	filename0 = tofullpathconsiderdirty_190401_155036129(fileidx0);
	{
		NIM_BOOL LOC3;
		LOC3 = (NIM_BOOL)0;
		LOC3 = open_14803_1689653243(&f0, filename0, ((Filemode13009) 0), ((NI) -1));
		if (!!(LOC3)) goto LA4;
		rawmessage_192612_155036129(((Tmsgkind189002) 3), filename0);
		goto BeforeRet;
	}
	LA4: ;
	LOC6 = (Tllstream280204*)0;
	LOC6 = llstreamopen_280230_597494479(f0);
	openparsers_315032_4241778752((&p0), fileidx0, LOC6);
	result0 = parseall_315042_4241778752((&p0));
	closeparsers_315038_4241778752((&p0));
	}BeforeRet: ;
	return result0;
}
コード例 #2
0
ファイル: compiler_syntaxes.c プロジェクト: StetHD/csources
N_NIMCALL(Tnode216790*, parsefile_240029)(NI32 fileidx) {
	Tnode216790* result;
	Tparsers240026 p;
	FILE* f;
	NimStringDesc* filename;
	Tllstream204204* LOC6;
{	result = 0;
	memset((void*)(&p), 0, sizeof(p));
	objectInit((&p), (&NTI240026));
	f = 0;
	filename = tofullpathconsiderdirty_185401(fileidx);
	{
		NIM_BOOL LOC3;
		LOC3 = 0;
		LOC3 = open_15403(&f, filename, ((NU8) 0), ((NI) -1));
		if (!!(LOC3)) goto LA4;
		rawmessage_187612(((NU16) 3), filename);
		goto BeforeRet;
	}
	LA4: ;
	LOC6 = 0;
	LOC6 = llstreamopen_204229(f);
	openparsers_240032((&p), fileidx, LOC6);
	result = parseall_240042((&p));
	closeparsers_240038((&p));
	}BeforeRet: ;
	return result;
}
コード例 #3
0
ファイル: compiler_syntaxes.c プロジェクト: nim-lang/csources
N_NIMCALL(Tnode_bROa11lyF5vxEN9aYNbHmhw*, parsefile_9cEZ7X5V9c6ooHZhVrYd0X7Q)(NI32 fileidx0, IdentcacheHEX3Aobjecttype_TzLHS09bRH9a0TYLs39cqcNaw* cache0) {
	Tnode_bROa11lyF5vxEN9aYNbHmhw* result0;
	Tparsers_WENTuyElSRFloaVOQEDvMg p0;
	FILE* f0;
	NimStringDesc* filename0;
	Tllstream_IHsOGFu33dIY69a9bLlFHlHw* LOC6;
{	result0 = (Tnode_bROa11lyF5vxEN9aYNbHmhw*)0;
	memset((void*)(&p0), 0, sizeof(p0));
	objectInit((&p0), (&NTI_WENTuyElSRFloaVOQEDvMg));
	f0 = (FILE*)0;
	filename0 = tofullpathconsiderdirty_7s19cb7WBgztz9aqEBzwwuqA_2(fileidx0);
	{
		NIM_BOOL LOC3;
		LOC3 = (NIM_BOOL)0;
		LOC3 = open_sEp0GH2306oGo9bqBpj5oTQ(&f0, filename0, ((Filemode_fVUBHvW79bXUw1j55Oo9avSQ) 0), ((NI) -1));
		if (!!(LOC3)) goto LA4;
		rawmessage_tBJ8mvo7MzzirsGkrHVc9cw(((Tmsgkind_IGAWgv9aR2KqPKJfPZPEWaw) 3), filename0);
		goto BeforeRet;
	}
	LA4: ;
	LOC6 = (Tllstream_IHsOGFu33dIY69a9bLlFHlHw*)0;
	LOC6 = llstreamopen_8hTxoBHhwtwZR9cM9bBLMsCQ(f0);
	openparsers_zDBDS8Km3Tchi1ohPVieKQ((&p0), fileidx0, LOC6, cache0);
	result0 = parseall_N9cl8bNz6TaGrhhLXmkyhrw((&p0));
	closeparsers_aZMERNSTUyTfW9aaFR9bAn9aQ((&p0));
	}BeforeRet: ;
	return result0;
}
コード例 #4
0
ファイル: compiler_syntaxes.c プロジェクト: apense/csources
N_NIMCALL(Tnode192813*, parsepipe_220170)(NimStringDesc* filename, Tllstream179204* inputstream) {
	Tnode192813* result;
	Tllstream179204* s;
	result = 0;
	result = emptynode_193807;
	s = llstreamopen_179256(filename, ((NU8) 0));
	{
		NimStringDesc* line;
		NIM_BOOL LOC5;
		NI i;
		if (!!((s == NIM_NIL))) goto LA3;
		line = rawNewString(((NI) 80));
		LOC5 = 0;
		LOC5 = llstreamreadline_179610(s, (&line));
		i = utf8bom_220122(line);
		{
			NIM_BOOL LOC8;
			NIM_BOOL LOC11;
			LOC8 = 0;
			LOC8 = containsshebang_220132(line, i);
			if (!LOC8) goto LA9;
			LOC11 = 0;
			LOC11 = llstreamreadline_179610(s, (&line));
			i = ((NI) 0);
		}
		LA9: ;
		{
			NIM_BOOL LOC14;
			Tparser208205 q;
			NimStringDesc* LOC20;
			Tllstream179204* LOC21;
			LOC14 = 0;
			LOC14 = ((NU8)(line->data[i]) == (NU8)(35));
			if (!(LOC14)) goto LA15;
			LOC14 = ((NU8)(line->data[(NI)(i + ((NI) 1))]) == (NU8)(33));
			LA15: ;
			if (!LOC14) goto LA16;
			i += ((NI) 2);
			{
				while (1) {
					if (!(((NU8)(line->data[i])) == ((NU8)(32)) || ((NU8)(line->data[i])) == ((NU8)(9)) || ((NU8)(line->data[i])) == ((NU8)(11)) || ((NU8)(line->data[i])) == ((NU8)(13)) || ((NU8)(line->data[i])) == ((NU8)(10)) || ((NU8)(line->data[i])) == ((NU8)(12)))) goto LA19;
					i += ((NI) 1);
				} LA19: ;
			}
			memset((void*)(&q), 0, sizeof(q));
			objectInit((&q), (&NTI208205));
			LOC20 = 0;
			LOC20 = copyStr(line, i);
			LOC21 = 0;
			LOC21 = llstreamopen_179220(LOC20);
			openparser_208417((&q), filename, LOC21, NIM_FALSE);
			result = parseall_208216((&q));
			closeparser_208223((&q));
		}
		LA16: ;
		llstreamclose_179310(s);
	}
	LA3: ;
	return result;
}
コード例 #5
0
ファイル: parser.c プロジェクト: neosam/lisp3d
Object *createObject(char *name, char **list)
{
	Object *obj;
	int i;
	
	DMSG("Create object - create base object\n");
	
	obj = objectInit(list);
	
	DMSG("Create real object\n");
	
	
	for (i = 0; taglist[i].name != NULL; i++) {
		if (strcmp(name, taglist[i].name) == 0 &&
		    taglist[i].initfunc != NULL) 
			return taglist[i].initfunc(obj, list);
	}
	
#ifndef NDEBUG
	printf("DEBUG: Created Object %s with type %i\n", name, obj->type);
#endif
	DMSG("Object created\n");
	
	return obj;
}
コード例 #6
0
ファイル: compiler_syntaxes.c プロジェクト: apense/csources
N_NIMCALL(Tnode192813*, parsefile_220041)(NI32 fileidx) {
	Tnode192813* result;
	Tparsers220035 p;
	FILE* f;
	NimStringDesc* filename;
	Tllstream179204* LOC6;
{	result = 0;
	memset((void*)(&p), 0, sizeof(p));
	objectInit((&p), (&NTI220035));
	f = 0;
	filename = tofullpathconsiderdirty_165407(fileidx);
	{
		NIM_BOOL LOC3;
		LOC3 = 0;
		LOC3 = open_13203(&f, filename, ((NU8) 0), ((NI) -1));
		if (!!(LOC3)) goto LA4;
		rawmessage_165970(((NU16) 3), filename);
		goto BeforeRet;
	}
	LA4: ;
	LOC6 = 0;
	LOC6 = llstreamopen_179238(f);
	openparsers_220047((&p), fileidx, LOC6);
	result = parseall_220063((&p));
	closeparsers_220056((&p));
	}BeforeRet: ;
	return result;
}
コード例 #7
0
N_NIMCALL(tnode173659*, parsefile_199030)(NI32 fileidx) {
	tnode173659* result;
	tparsers199026 p;
	FILE* f;
	NimStringDesc* filename;
	tllstream163204* LOC6;
	nimfr("parseFile", "syntaxes.nim")
	result = 0;
	memset((void*)&p, 0, sizeof(p));
	objectInit(&p, (&NTI199026));
	f = 0;
	nimln(47, "syntaxes.nim");
	filename = tofullpath_138708(fileidx);
	nimln(48, "syntaxes.nim");
	{
		NIM_BOOL LOC3;
		nimln(48, "syntaxes.nim");
		nimln(48, "syntaxes.nim");
		LOC3 = 0;
		LOC3 = open_9203(&f, filename, ((NU8) 0), -1);
		if (!!(LOC3)) goto LA4;
		nimln(49, "syntaxes.nim");
		rawmessage_139191(((NU16) 3), filename);		nimln(50, "syntaxes.nim");
		goto BeforeRet;
	}	LA4: ;
	nimln(51, "syntaxes.nim");
	nimln(51, "syntaxes.nim");
	LOC6 = 0;
	LOC6 = llstreamopen_163222(&f);
	openparsers_199034(&p, fileidx, LOC6);	nimln(52, "syntaxes.nim");
	result = parseall_199046(&p);
	nimln(53, "syntaxes.nim");
	closeparsers_199041(&p);	BeforeRet: ;	popFrame();
	return result;
}
コード例 #8
0
ファイル: condsyms.c プロジェクト: ddlsmurf/Nimrod
N_NIMCALL(void, Definesymbol_64053)(NimStringDesc* Symbol_64055) {
TY54011* I_64069;
TY55548* Sym_64070;
I_64069 = 0;
I_64069 = Getident_54016(Symbol_64055);
Sym_64070 = 0;
Sym_64070 = Strtableget_60066(&Gsymbols_64001, I_64069);
if (!(Sym_64070 == NIM_NIL)) goto LA2;
Sym_64070 = (TY55548*) newObj(NTI55524, sizeof(TY55548));
objectInit(Sym_64070, NTI55548);
(*Sym_64070).Kind = ((NU8) 1);
asgnRefNoCycle((void**) &(*Sym_64070).Name, I_64069);
Strtableadd_60061(&Gsymbols_64001, Sym_64070);
LA2: ;
(*Sym_64070).Position = 1;
}
コード例 #9
0
ファイル: semdata.c プロジェクト: ddlsmurf/Nimrod
N_NIMCALL(TY107012*, Newcontext_107046)(TY55548* Module_107048, NimStringDesc* Nimfile_107049) {
TY107012* Result_107224;
TY107002* LOC1;
Result_107224 = 0;
Result_107224 = (TY107012*) newObj(NTI107010, sizeof(TY107012));
objectInit(Result_107224, NTI107012);
Initsymtab_60103(&(*Result_107224).Tab);
Intsetinit_55919(&(*Result_107224).Ambiguoussymbols);
Initlinkedlist_43031(&(*Result_107224).Optionstack);
Initlinkedlist_43031(&(*Result_107224).Libs);
LOC1 = 0;
LOC1 = Newoptionentry_107056();
Append_43035(&(*Result_107224).Optionstack, &LOC1->Sup);
asgnRef((void**) &(*Result_107224).Module, Module_107048);
asgnRefNoCycle((void**) &(*Result_107224).Generics, Newnode_55711(((NU8) 101)));
asgnRef((void**) &(*Result_107224).Converters, (TY55528*) newSeq(NTI55528, 0));
asgnRefNoCycle((void**) &(*Result_107224).Filename, copyString(Nimfile_107049));
Intsetinit_55919(&(*Result_107224).Includedfiles);
Initstrtable_55747(&(*Result_107224).Userpragmas);
return Result_107224;
}
コード例 #10
0
ファイル: syntaxes.c プロジェクト: reactormonk/csources
N_NIMCALL(tnode185813*, parsefile_218033)(NI32 fileidx) {
	tnode185813* result;
	tparsers218029 p;
	FILE* f;
	NimStringDesc* filename;
	tllstream173204* LOC6;
	nimfr("parseFile", "syntaxes.nim")
	result = 0;
	memset((void*)&p, 0, sizeof(p));
	objectInit(&p, (&NTI218029));
	f = 0;
	nimln(48, "syntaxes.nim");
	filename = tofullpath_162788(fileidx);
	nimln(49, "syntaxes.nim");
	{
		NIM_BOOL LOC3;
		nimln(49, "syntaxes.nim");
		nimln(49, "syntaxes.nim");
		LOC3 = 0;
		LOC3 = open_10203(&f, filename, ((NU8) 0), -1);
		if (!!(LOC3)) goto LA4;
		nimln(50, "syntaxes.nim");
		rawmessage_163386(((NU16) 3), filename);
		nimln(51, "syntaxes.nim");
		goto BeforeRet;
	}
	LA4: ;
	nimln(52, "syntaxes.nim");
	nimln(52, "syntaxes.nim");
	LOC6 = 0;
	LOC6 = llstreamopen_173222(&f);
	openparsers_218037(&p, fileidx, LOC6);
	nimln(53, "syntaxes.nim");
	result = parseall_218049(&p);
	nimln(54, "syntaxes.nim");
	closeparsers_218044(&p);
	BeforeRet: ;
	popFrame();
	return result;
}
コード例 #11
0
ファイル: main.c プロジェクト: ddlsmurf/Nimrod
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;
}
コード例 #12
0
ファイル: compiler_syntaxes.c プロジェクト: nim-lang/csources
N_NIMCALL(Tnode_bROa11lyF5vxEN9aYNbHmhw*, parsepipe_bJSds72kKu77CwGx8lNYmA)(NimStringDesc* filename0, Tllstream_IHsOGFu33dIY69a9bLlFHlHw* inputstream0, IdentcacheHEX3Aobjecttype_TzLHS09bRH9a0TYLs39cqcNaw* cache0) {
	Tnode_bROa11lyF5vxEN9aYNbHmhw* result0;
	Tllstream_IHsOGFu33dIY69a9bLlFHlHw* s0;
	result0 = (Tnode_bROa11lyF5vxEN9aYNbHmhw*)0;
	result0 = emptynode_69ccLGuQ2mITw7zylZYtWcA;
	s0 = llstreamopen_TMcHzC3C639c0ccC0wtKA2w(filename0, ((Filemode_fVUBHvW79bXUw1j55Oo9avSQ) 0));
	{
		NimStringDesc* line0;
		NIM_BOOL LOC5;
		NI i0;
		NI linenumber0;
		if (!!((s0 == NIM_NIL))) goto LA3;
		line0 = rawNewString(((NI) 80));
		LOC5 = (NIM_BOOL)0;
		LOC5 = llstreamreadline_Qwm1ilRhcaI3znjOGn4xBg(s0, (&line0));
		i0 = utf8bom_h8LrhHxyp3nGeHzqCSFf9bg(line0);
		linenumber0 = ((NI) 1);
		{
			NIM_BOOL LOC8;
			NIM_BOOL LOC11;
			LOC8 = (NIM_BOOL)0;
			LOC8 = containsshebang_KmLpTlp0iQ7qLu2YAgAZhw(line0, i0);
			if (!LOC8) goto LA9;
			LOC11 = (NIM_BOOL)0;
			LOC11 = llstreamreadline_Qwm1ilRhcaI3znjOGn4xBg(s0, (&line0));
			i0 = ((NI) 0);
			linenumber0 += ((NI) 1);
		}
		LA9: ;
		{
			NIM_BOOL LOC14;
			Tparser_c38t9cDVS8o9b29cOovKwkANw q0;
			NimStringDesc* LOC20;
			Tllstream_IHsOGFu33dIY69a9bLlFHlHw* LOC21;
			LOC14 = (NIM_BOOL)0;
			LOC14 = ((NU8)(line0->data[i0]) == (NU8)(35));
			if (!(LOC14)) goto LA15;
			LOC14 = ((NU8)(line0->data[(NI)(i0 + ((NI) 1))]) == (NU8)(63));
			LA15: ;
			if (!LOC14) goto LA16;
			i0 += ((NI) 2);
			{
				while (1) {
					if (!(((NU8)(line0->data[i0])) == ((NU8)(32)) || ((NU8)(line0->data[i0])) == ((NU8)(9)) || ((NU8)(line0->data[i0])) == ((NU8)(11)) || ((NU8)(line0->data[i0])) == ((NU8)(13)) || ((NU8)(line0->data[i0])) == ((NU8)(10)) || ((NU8)(line0->data[i0])) == ((NU8)(12)))) goto LA19;
					i0 += ((NI) 1);
				} LA19: ;
			}
			memset((void*)(&q0), 0, sizeof(q0));
			objectInit((&q0), (&NTI_c38t9cDVS8o9b29cOovKwkANw));
			LOC20 = (NimStringDesc*)0;
			LOC20 = copyStr(line0, i0);
			LOC21 = (Tllstream_IHsOGFu33dIY69a9bLlFHlHw*)0;
			LOC21 = llstreamopen_HQSZA6kzdilYF0Pf022dhA(LOC20);
			openparser_xOo5exBZF46oOyrExM9a3yQ((&q0), filename0, LOC21, cache0, NIM_FALSE);
			result0 = parseall_x3UAdSvBfIIO33m4gWdOPg((&q0));
			closeparser_Bv6bIlAg2H4GfVH07sPwUw((&q0));
		}
		LA16: ;
		llstreamclose_TQe1mwqs39ccgay5ywsr9azw(s0);
	}
	LA3: ;
	return result0;
}
コード例 #13
0
N_NIMCALL(void, processmodule_221049)(tsym170689* module, tllstream160204* stream, trodreader210023* rd) {
	tparsers196026 p;
	tpasscontextarray221155 a;
	tllstream160204* s;
	NI32 fileidx;
	nimfr("processModule", "passes.nim")
	memset((void*)&p, 0, sizeof(p));
	objectInit(&p, (&NTI196026));
	memset((void*)a, 0, sizeof(a));
	s = 0;
	nimln(167, "passes.nim");
	fileidx = ((NI32)chckRange((*module).Position, ((NI32) (-2147483647 -1)), ((NI32) 2147483647)));
	nimln(168, "passes.nim");
	{
		nimln(168, "passes.nim");
		if (!(rd == NIM_NIL)) goto LA3;
		nimln(169, "passes.nim");
		openpasses_221243(a, module);		nimln(170, "passes.nim");
		{
			NimStringDesc* filename;
			nimln(170, "passes.nim");
			if (!(stream == NIM_NIL)) goto LA7;
			nimln(171, "passes.nim");
			filename = tofullpath_136708(fileidx);
			nimln(172, "passes.nim");
			s = llstreamopen_160227(filename, ((NU8) 0));
			nimln(173, "passes.nim");
			{
				nimln(173, "passes.nim");
				if (!(s == NIM_NIL)) goto LA11;
				nimln(174, "passes.nim");
				rawmessage_137191(((NU16) 3), filename);				nimln(175, "passes.nim");
				goto BeforeRet;
			}			LA11: ;
		}		goto LA5;
		LA7: ;
		{
			nimln(177, "passes.nim");
			s = stream;
		}		LA5: ;
		nimln(178, "passes.nim");
		while (1) {
			nimln(179, "passes.nim");
			openparsers_196034(&p, fileidx, s);			nimln(181, "passes.nim");
			{
				nimln(731, "system.nim");
				nimln(731, "system.nim");
				if (!!((((*module).Flags &(1<<((((NU8) 13))&31)))!=0))) goto LA17;
				nimln(186, "passes.nim");
				processimplicits_221443(implicitimports_113242, ((NU8) 115), a);				nimln(187, "passes.nim");
				processimplicits_221443(implicitincludes_113261, ((NU8) 120), a);			}			LA17: ;
			nimln(189, "passes.nim");
			while (1) {
				tnode170659* n;
				nimln(190, "passes.nim");
				n = parsetoplevelstmt_196051(&p);
				nimln(191, "passes.nim");
				{
					nimln(191, "passes.nim");
					if (!((*n).Kind == ((NU8) 1))) goto LA22;
					nimln(191, "passes.nim");
					goto LA19;
				}				LA22: ;
				nimln(192, "passes.nim");
				{
					NIM_BOOL LOC26;
					nimln(192, "passes.nim");
					nimln(192, "passes.nim");
					LOC26 = 0;
					LOC26 = processtoplevelstmt_221341(n, a);
					if (!!(LOC26)) goto LA27;
					nimln(192, "passes.nim");
					goto LA19;
				}				LA27: ;
			} LA19: ;
			nimln(194, "passes.nim");
			closeparsers_196041(&p);			nimln(195, "passes.nim");
			{
				nimln(698, "system.nim");
				nimln(698, "system.nim");
				if (!!(((*s).Kind == ((NU8) 3)))) goto LA31;
				nimln(195, "passes.nim");
				goto LA14;
			}			LA31: ;
		} LA14: ;
		nimln(196, "passes.nim");
		closepasses_221312(a);		nimln(198, "passes.nim");
		idsynchronizationpoint_169440(1000);	}	goto LA1;
	LA3: ;
	{
		tnode170659* n;
		NI i_221560;
		NI HEX3Atmp_221577;
		NI LOC34;
		NI TMP3139;
		NI res_221579;
		nimln(200, "passes.nim");
		openpassescached_221271(a, module, rd);		nimln(201, "passes.nim");
		n = loadinitsection_210065(rd);
		i_221560 = 0;
		HEX3Atmp_221577 = 0;
		nimln(202, "passes.nim");
		nimln(202, "passes.nim");
		nimln(202, "passes.nim");
		LOC34 = 0;
		LOC34 = sonslen_171022(n);
		TMP3139 = subInt(LOC34, 1);
		HEX3Atmp_221577 = (NI64)(TMP3139);
		nimln(1301, "system.nim");
		res_221579 = 0;
		nimln(1302, "system.nim");
		while (1) {
			nimln(1302, "system.nim");
			if (!(res_221579 <= HEX3Atmp_221577)) goto LA35;
			nimln(1301, "system.nim");
			i_221560 = res_221579;
			nimln(202, "passes.nim");
			if (((TMP3131[(*n).Kind/8] &(1<<((*n).Kind%8)))!=0)) raiseFieldError(((NimStringDesc*) &TMP3132));
			if ((NU)(i_221560) >= (NU)((*n).kindU.S6.Sons->Sup.len)) raiseIndexError();
			processtoplevelstmtcached_221379((*n).kindU.S6.Sons->data[i_221560], a);			nimln(1304, "system.nim");
			res_221579 = addInt(res_221579, 1);
		} LA35: ;
		nimln(203, "passes.nim");
		closepassescached_221408(a);	}	LA1: ;
	BeforeRet: ;	popFrame();
}N_NOINLINE(void, compilerpassesInit)(void) {
コード例 #14
0
N_NIMCALL(Tnode290802*, parsepipe_315107_4241778752)(NimStringDesc* filename0, Tllstream280204* inputstream0) {
	Tnode290802* result0;
	Tllstream280204* s0;
	result0 = (Tnode290802*)0;
	result0 = emptynode_291801_850551059;
	s0 = llstreamopen_280242_597494479(filename0, ((Filemode13009) 0));
	{
		NimStringDesc* line0;
		NIM_BOOL LOC5;
		NI i0;
		NI linenumber0;
		if (!!((s0 == NIM_NIL))) goto LA3;
		line0 = rawNewString(((NI) 80));
		LOC5 = (NIM_BOOL)0;
		LOC5 = llstreamreadline_280550_597494479(s0, (&line0));
		i0 = utf8bom_315077_4241778752(line0);
		linenumber0 = ((NI) 1);
		{
			NIM_BOOL LOC8;
			NIM_BOOL LOC11;
			LOC8 = (NIM_BOOL)0;
			LOC8 = containsshebang_315081_4241778752(line0, i0);
			if (!LOC8) goto LA9;
			LOC11 = (NIM_BOOL)0;
			LOC11 = llstreamreadline_280550_597494479(s0, (&line0));
			i0 = ((NI) 0);
			linenumber0 += ((NI) 1);
		}
		LA9: ;
		{
			NIM_BOOL LOC14;
			Tparser304202 q0;
			NimStringDesc* LOC20;
			Tllstream280204* LOC21;
			LOC14 = (NIM_BOOL)0;
			LOC14 = ((NU8)(line0->data[i0]) == (NU8)(35));
			if (!(LOC14)) goto LA15;
			LOC14 = ((NU8)(line0->data[(NI)(i0 + ((NI) 1))]) == (NU8)(63));
			LA15: ;
			if (!LOC14) goto LA16;
			i0 += ((NI) 2);
			{
				while (1) {
					if (!(((NU8)(line0->data[i0])) == ((NU8)(32)) || ((NU8)(line0->data[i0])) == ((NU8)(9)) || ((NU8)(line0->data[i0])) == ((NU8)(11)) || ((NU8)(line0->data[i0])) == ((NU8)(13)) || ((NU8)(line0->data[i0])) == ((NU8)(10)) || ((NU8)(line0->data[i0])) == ((NU8)(12)))) goto LA19;
					i0 += ((NI) 1);
				} LA19: ;
			}
			memset((void*)(&q0), 0, sizeof(q0));
			objectInit((&q0), (&NTI304202));
			LOC20 = (NimStringDesc*)0;
			LOC20 = copyStr(line0, i0);
			LOC21 = (Tllstream280204*)0;
			LOC21 = llstreamopen_280218_597494479(LOC20);
			openparser_304331_1574654094((&q0), filename0, LOC21, NIM_FALSE);
			result0 = parseall_304210_1574654094((&q0));
			closeparser_304214_1574654094((&q0));
		}
		LA16: ;
		llstreamclose_280278_597494479(s0);
	}
	LA3: ;
	return result0;
}
コード例 #15
0
ファイル: compiler_syntaxes.c プロジェクト: StetHD/csources
N_NIMCALL(Tnode216790*, parsepipe_240107)(NimStringDesc* filename, Tllstream204204* inputstream) {
	Tnode216790* result;
	Tllstream204204* s;
	result = 0;
	result = emptynode_217801;
	s = llstreamopen_204241(filename, ((NU8) 0));
	{
		NimStringDesc* line;
		NIM_BOOL LOC5;
		NI i;
		NI linenumber;
		if (!!((s == NIM_NIL))) goto LA3;
		line = rawNewString(((NI) 80));
		LOC5 = 0;
		LOC5 = llstreamreadline_204550(s, (&line));
		i = utf8bom_240077(line);
		linenumber = ((NI) 1);
		{
			NIM_BOOL LOC8;
			NIM_BOOL LOC11;
			LOC8 = 0;
			LOC8 = containsshebang_240081(line, i);
			if (!LOC8) goto LA9;
			LOC11 = 0;
			LOC11 = llstreamreadline_204550(s, (&line));
			i = ((NI) 0);
			linenumber += ((NI) 1);
		}
		LA9: ;
		{
			NIM_BOOL LOC14;
			Tparser230202 q;
			NimStringDesc* LOC25;
			Tllstream204204* LOC26;
			LOC14 = 0;
			LOC14 = ((NU8)(line->data[i]) == (NU8)(35));
			if (!(LOC14)) goto LA15;
			LOC14 = (((NU8)(line->data[(NI)(i + ((NI) 1))])) == ((NU8)(63)) || ((NU8)(line->data[(NI)(i + ((NI) 1))])) == ((NU8)(33)));
			LA15: ;
			if (!LOC14) goto LA16;
			{
				Tlineinfo184337 LOC22;
				if (!((NU8)(line->data[(NI)(i + ((NI) 1))]) == (NU8)(33))) goto LA20;
				LOC22 = newlineinfo_185029(filename, linenumber, ((NI) 1));
				message_189095(LOC22, ((NU16) 241), ((NimStringDesc*) &TMP1245));
			}
			LA20: ;
			i += ((NI) 2);
			{
				while (1) {
					if (!(((NU8)(line->data[i])) == ((NU8)(32)) || ((NU8)(line->data[i])) == ((NU8)(9)) || ((NU8)(line->data[i])) == ((NU8)(11)) || ((NU8)(line->data[i])) == ((NU8)(13)) || ((NU8)(line->data[i])) == ((NU8)(10)) || ((NU8)(line->data[i])) == ((NU8)(12)))) goto LA24;
					i += ((NI) 1);
				} LA24: ;
			}
			memset((void*)(&q), 0, sizeof(q));
			objectInit((&q), (&NTI230202));
			LOC25 = 0;
			LOC25 = copyStr(line, i);
			LOC26 = 0;
			LOC26 = llstreamopen_204217(LOC25);
			openparser_230331((&q), filename, LOC26, NIM_FALSE);
			result = parseall_230210((&q));
			closeparser_230214((&q));
		}
		LA16: ;
		llstreamclose_204277(s);
	}
	LA3: ;
	return result;
}
コード例 #16
0
ファイル: compiler_passes.c プロジェクト: StetHD/csources
N_NIMCALL(void, processmodule_262044)(Tsym215822* module, Tllstream203204* stream, Trodreader253021* rd) {
	Tparsers239026 p;
	Tpasscontextarray262135 a;
	Tllstream203204* s;
	NI32 fileidx;
{	memset((void*)(&p), 0, sizeof(p));
	objectInit((&p), (&NTI239026));
	memset((void*)a, 0, sizeof(a));
	s = 0;
	fileidx = ((NI32) ((*module).position));
	{
		if (!(rd == NIM_NIL)) goto LA3;
		openpasses_262211(a, module);
		{
			NimStringDesc* filename;
			if (!(stream == NIM_NIL)) goto LA7;
			filename = tofullpathconsiderdirty_184401(fileidx);
			s = llstreamopen_203241(filename, ((NU8) 0));
			{
				if (!(s == NIM_NIL)) goto LA11;
				rawmessage_186612(((NU16) 3), filename);
				goto BeforeRet;
			}
			LA11: ;
		}
		goto LA5;
		LA7: ;
		{
			s = stream;
		}
		LA5: ;
		{
			while (1) {
				openparsers_239032((&p), fileidx, s);
				{
					if (!!((((*module).flags &(1U<<((NU)(((NU8) 13))&31U)))!=0))) goto LA18;
					processimplicits_262443(implicitimports_161242, ((NU8) 116), a);
					processimplicits_262443(implicitincludes_161260, ((NU8) 121), a);
				}
				LA18: ;
				{
					while (1) {
						Tnode215790* n_262533;
						n_262533 = parsetoplevelstmt_239046((&p));
						{
							if (!((*n_262533).kind == ((NU8) 1))) goto LA24;
							goto LA20;
						}
						LA24: ;
						{
							Tnode215790* sl;
							NIM_BOOL LOC36;
							if (!(((*module).flags &(1U<<((NU)(((NU8) 8))&31U)))!=0)) goto LA28;
							sl = newnodei_217248(((NU8) 115), (*n_262533).info);
							add_216114(sl, n_262533);
							{
								while (1) {
									Tnode215790* n;
									n = parsetoplevelstmt_239046((&p));
									{
										if (!((*n).kind == ((NU8) 1))) goto LA34;
										goto LA30;
									}
									LA34: ;
									add_216114(sl, n);
								}
							} LA30: ;
							LOC36 = 0;
							LOC36 = processtoplevelstmt_262324(sl, a);
							goto LA20;
						}
						goto LA26;
						LA28: ;
						{
							NIM_BOOL LOC38;
							LOC38 = 0;
							LOC38 = processtoplevelstmt_262324(n_262533, a);
							if (!!(LOC38)) goto LA39;
							goto LA20;
						}
						goto LA26;
						LA39: ;
						LA26: ;
					}
				} LA20: ;
				closeparsers_239038((&p));
				{
					if (!!(((*s).kind == ((NU8) 3)))) goto LA43;
					goto LA14;
				}
				LA43: ;
			}
		} LA14: ;
		closepasses_262290(a);
		idsynchronizationpoint_214432(((NI) 1000));
	}
	goto LA1;
	LA3: ;
	{
		Tnode215790* n;
		openpassescached_262244(a, module, rd);
		n = loadinitsection_253082(rd);
		{
			NI i_262595;
			NI HEX3Atmp_262606;
			NI LOC47;
			NI res_262609;
			i_262595 = 0;
			HEX3Atmp_262606 = 0;
			LOC47 = 0;
			LOC47 = sonslen_218351(n);
			HEX3Atmp_262606 = (NI)(LOC47 - ((NI) 1));
			res_262609 = ((NI) 0);
			{
				while (1) {
					if (!(res_262609 <= HEX3Atmp_262606)) goto LA49;
					i_262595 = res_262609;
					processtoplevelstmtcached_262367((*n).kindU.S6.sons->data[i_262595], a);
					res_262609 += ((NI) 1);
				} LA49: ;
			}
		}
		closepassescached_262401(a);
	}
	LA1: ;
	}BeforeRet: ;
}
コード例 #17
0
N_NIMCALL(NIM_BOOL, processmodule_339490_2355241294)(Tsym290834* module0, Tllstream280204* stream0, Trodreader330021* rd0) {
	NIM_BOOL result0;
	Tparsers315026 p0;
	Tpasscontextarray339155 a0;
	Tllstream280204* s0;
	NI32 fileidx0;
{	result0 = (NIM_BOOL)0;
	memset((void*)(&p0), 0, sizeof(p0));
	objectInit((&p0), (&NTI315026));
	memset((void*)a0, 0, sizeof(a0));
	s0 = (Tllstream280204*)0;
	fileidx0 = ((NI32) ((*module0).position));
	{
		if (!(rd0 == NIM_NIL)) goto LA3;
		openpasses_339233_2355241294(a0, module0);
		{
			NimStringDesc* filename0;
			if (!(stream0 == NIM_NIL)) goto LA7;
			filename0 = tofullpathconsiderdirty_190401_155036129(fileidx0);
			s0 = llstreamopen_280242_597494479(filename0, ((Filemode13009) 0));
			{
				if (!(s0 == NIM_NIL)) goto LA11;
				rawmessage_192612_155036129(((Tmsgkind189002) 3), filename0);
				result0 = NIM_FALSE;
				goto BeforeRet;
			}
			LA11: ;
		}
		goto LA5;
		LA7: ;
		{
			s0 = stream0;
		}
		LA5: ;
		{
			while (1) {
				openparsers_315032_4241778752((&p0), fileidx0, s0);
				{
					if (!!((((*module0).flags &(1U<<((NU)(((Tsymflag290184) 13))&31U)))!=0))) goto LA18;
					processimplicits_339465_2355241294(implicitimports_168252_2607990831, ((Tnodekind290020) 116), a0);
					processimplicits_339465_2355241294(implicitincludes_168270_2607990831, ((Tnodekind290020) 121), a0);
				}
				LA18: ;
				{
					while (1) {
						Tnode290802* n_339556_2355241294;
						n_339556_2355241294 = parsetoplevelstmt_315046_4241778752((&p0));
						{
							if (!((*n_339556_2355241294).kind == ((Tnodekind290020) 1))) goto LA24;
							goto LA20;
						}
						LA24: ;
						{
							Tnode290802* sl0;
							NIM_BOOL LOC36;
							if (!(((*module0).flags &(1U<<((NU)(((Tsymflag290184) 8))&31U)))!=0)) goto LA28;
							sl0 = newnodei_292197_850551059(((Tnodekind290020) 115), (*n_339556_2355241294).info);
							add_291136_850551059(sl0, n_339556_2355241294);
							{
								while (1) {
									Tnode290802* n0;
									n0 = parsetoplevelstmt_315046_4241778752((&p0));
									{
										if (!((*n0).kind == ((Tnodekind290020) 1))) goto LA34;
										goto LA30;
									}
									LA34: ;
									add_291136_850551059(sl0, n0);
								}
							} LA30: ;
							LOC36 = (NIM_BOOL)0;
							LOC36 = processtoplevelstmt_339346_2355241294(sl0, a0);
							goto LA20;
						}
						goto LA26;
						LA28: ;
						{
							NIM_BOOL LOC38;
							LOC38 = (NIM_BOOL)0;
							LOC38 = processtoplevelstmt_339346_2355241294(n_339556_2355241294, a0);
							if (!!(LOC38)) goto LA39;
							goto LA20;
						}
						goto LA26;
						LA39: ;
						LA26: ;
					}
				} LA20: ;
				closeparsers_315038_4241778752((&p0));
				{
					if (!!(((*s0).kind == ((Tllstreamkind280202) 3)))) goto LA43;
					goto LA14;
				}
				LA43: ;
			}
		} LA14: ;
		closepasses_339312_2355241294(a0);
		idsynchronizationpoint_289420_644355110(((NI) 1000));
	}
	goto LA1;
	LA3: ;
	{
		Tnode290802* n0;
		openpassescached_339266_2355241294(a0, module0, rd0);
		n0 = loadinitsection_332822_1724185294(rd0);
		{
			NI i_339618_2355241294;
			NI HEX3Atmp_339629_2355241294;
			NI LOC47;
			NI res_339632_2355241294;
			i_339618_2355241294 = (NI)0;
			HEX3Atmp_339629_2355241294 = (NI)0;
			LOC47 = (NI)0;
			LOC47 = sonslen_293351_850551059(n0);
			HEX3Atmp_339629_2355241294 = (NI)(LOC47 - ((NI) 1));
			res_339632_2355241294 = ((NI) 0);
			{
				while (1) {
					if (!(res_339632_2355241294 <= HEX3Atmp_339629_2355241294)) goto LA49;
					i_339618_2355241294 = res_339632_2355241294;
					processtoplevelstmtcached_339389_2355241294((*n0).kindU.S6.sons->data[i_339618_2355241294], a0);
					res_339632_2355241294 += ((NI) 1);
				} LA49: ;
			}
		}
		closepassescached_339423_2355241294(a0);
	}
	LA1: ;
	result0 = NIM_TRUE;
	}BeforeRet: ;
	return result0;
}
コード例 #18
0
ファイル: passes.c プロジェクト: rbehrends/csources
N_NIMCALL(void, processmodule_251049)(tsym192843* module, tllstream180204* stream, trodreader241024* rd) {
    tparsers225029 p;
    tpasscontextarray251173 a;
    tllstream180204* s;
    NI32 fileidx;
    nimfr("processModule", "passes.nim")
    memset((void*)&p, 0, sizeof(p));
    objectInit(&p, (&NTI225029));
    memset((void*)a, 0, sizeof(a));
    s = 0;
    nimln(168, "passes.nim");
    fileidx = ((NI32) ((*module).Position));
    nimln(169, "passes.nim");
    {
        nimln(169, "passes.nim");
        if (!(rd == NIM_NIL)) goto LA3;
        nimln(170, "passes.nim");
        openpasses_251277(a, module);
        nimln(171, "passes.nim");
        {
            NimStringDesc* filename;
            nimln(171, "passes.nim");
            if (!(stream == NIM_NIL)) goto LA7;
            nimln(172, "passes.nim");
            filename = tofullpath_168788(fileidx);
            nimln(173, "passes.nim");
            s = llstreamopen_180227(filename, ((NU8) 0));
            nimln(174, "passes.nim");
            {
                nimln(174, "passes.nim");
                if (!(s == NIM_NIL)) goto LA11;
                nimln(175, "passes.nim");
                rawmessage_169386(((NU16) 3), filename);
                nimln(176, "passes.nim");
                goto BeforeRet;
            }
LA11:
            ;
        }
        goto LA5;
LA7:
        ;
        {
            nimln(178, "passes.nim");
            s = stream;
        }
LA5:
        ;
        nimln(179, "passes.nim");
        while (1) {
            nimln(180, "passes.nim");
            openparsers_225037(&p, fileidx, s);
            nimln(182, "passes.nim");
            {
                nimln(182, "passes.nim");
                nimln(182, "passes.nim");
                if (!!((((*module).Flags &(1<<((((NU8) 13))&31)))!=0))) goto LA17;
                nimln(187, "passes.nim");
                processimplicits_251510(implicitimports_139257, ((NU8) 115), a);
                nimln(188, "passes.nim");
                processimplicits_251510(implicitincludes_139279, ((NU8) 120), a);
            }
LA17:
            ;
            nimln(190, "passes.nim");
            while (1) {
                tnode192813* n;
                nimln(191, "passes.nim");
                n = parsetoplevelstmt_225054(&p);
                nimln(192, "passes.nim");
                {
                    nimln(192, "passes.nim");
                    if (!((*n).Kind == ((NU8) 1))) goto LA22;
                    nimln(192, "passes.nim");
                    goto LA19;
                }
LA22:
                ;
                nimln(193, "passes.nim");
                {
                    NIM_BOOL LOC26;
                    nimln(193, "passes.nim");
                    nimln(193, "passes.nim");
                    LOC26 = 0;
                    LOC26 = processtoplevelstmt_251392(n, a);
                    if (!!(LOC26)) goto LA27;
                    nimln(193, "passes.nim");
                    goto LA19;
                }
LA27:
                ;
            }
LA19:
            ;
            nimln(195, "passes.nim");
            closeparsers_225044(&p);
            nimln(196, "passes.nim");
            {
                nimln(196, "passes.nim");
                nimln(196, "passes.nim");
                if (!!(((*s).Kind == ((NU8) 3)))) goto LA31;
                nimln(196, "passes.nim");
                goto LA14;
            }
LA31:
            ;
        }
LA14:
        ;
        nimln(197, "passes.nim");
        closepasses_251359(a);
        nimln(199, "passes.nim");
        idsynchronizationpoint_191452(1000);
    }
    goto LA1;
LA3:
    ;
    {
        tnode192813* n;
        NI i_251655;
        NI HEX3Atmp_251676;
        NI LOC34;
        NI TMP3191;
        NI res_251678;
        nimln(201, "passes.nim");
        openpassescached_251309(a, module, rd);
        nimln(202, "passes.nim");
        n = loadinitsection_241066(rd);
        i_251655 = 0;
        HEX3Atmp_251676 = 0;
        nimln(203, "passes.nim");
        nimln(203, "passes.nim");
        nimln(203, "passes.nim");
        LOC34 = 0;
        LOC34 = sonslen_193191(n);
        TMP3191 = subInt(LOC34, 1);
        HEX3Atmp_251676 = (NI32)(TMP3191);
        nimln(1451, "system.nim");
        res_251678 = 0;
        nimln(1452, "system.nim");
        while (1) {
            nimln(1452, "system.nim");
            if (!(res_251678 <= HEX3Atmp_251676)) goto LA35;
            nimln(1451, "system.nim");
            i_251655 = res_251678;
            nimln(203, "passes.nim");
            if (((TMP3182[(*n).Kind/8] &(1<<((*n).Kind%8)))!=0)) raiseFieldError(((NimStringDesc*) &TMP3183));
            if ((NU)(i_251655) >= (NU)((*n).kindU.S6.Sons->Sup.len)) raiseIndexError();
            processtoplevelstmtcached_251437((*n).kindU.S6.Sons->data[i_251655], a);
            nimln(1454, "system.nim");
            res_251678 = addInt(res_251678, 1);
        }
LA35:
        ;
        nimln(204, "passes.nim");
        closepassescached_251470(a);
    }
LA1:
    ;
BeforeRet:
    ;
    popFrame();
}
コード例 #19
0
ファイル: compiler_passes.c プロジェクト: jlp765/csources
N_NIMCALL(void, processmodule_240056)(Tsym190843* module, Tllstream177204* stream, Trodreader232030* rd) {
	Tparsers218035 p;
	Tpasscontextarray240168 a;
	Tllstream177204* s;
	NI32 fileidx;
{	memset((void*)(&p), 0, sizeof(p));
	objectInit((&p), (&NTI218035));
	memset((void*)a, 0, sizeof(a));
	s = 0;
	fileidx = ((NI32) ((*module).position));
	{
		if (!(rd == NIM_NIL)) goto LA3;
		openpasses_240293(a, module);
		{
			NimStringDesc* filename;
			if (!(stream == NIM_NIL)) goto LA7;
			filename = tofullpathconsiderdirty_163407(fileidx);
			{
				NimStringDesc* LOC13;
				if (!eqStrings((*(*module).name).s, ((NimStringDesc*) &TMP1506))) goto LA11;
				LOC13 = 0;
				LOC13 = (*(*module).name).s; (*(*module).name).s = copyStringRC1(((NimStringDesc*) &TMP1507));
				if (LOC13) nimGCunrefNoCycle(LOC13);
				s = llstreamopen_177238(stdin);
			}
			goto LA9;
			LA11: ;
			{
				s = llstreamopen_177256(filename, ((NU8) 0));
			}
			LA9: ;
			{
				if (!(s == NIM_NIL)) goto LA17;
				rawmessage_163970(((NU16) 3), filename);
				goto BeforeRet;
			}
			LA17: ;
		}
		goto LA5;
		LA7: ;
		{
			s = stream;
		}
		LA5: ;
		{
			while (1) {
				openparsers_218047((&p), fileidx, s);
				{
					if (!!((((*module).flags &(1<<((((NU8) 13))&31)))!=0))) goto LA24;
					processimplicits_240621(implicitimports_153280, ((NU8) 116), a);
					processimplicits_240621(implicitincludes_153300, ((NU8) 121), a);
				}
				LA24: ;
				{
					while (1) {
						Tnode190813* n;
						n = parsetoplevelstmt_218070((&p));
						{
							if (!((*n).kind == ((NU8) 1))) goto LA30;
							goto LA26;
						}
						LA30: ;
						{
							NIM_BOOL LOC34;
							LOC34 = 0;
							LOC34 = processtoplevelstmt_240454(n, a);
							if (!!(LOC34)) goto LA35;
							goto LA26;
						}
						LA35: ;
					}
				} LA26: ;
				closeparsers_218056((&p));
				{
					if (!!(((*s).kind == ((NU8) 3)))) goto LA39;
					goto LA20;
				}
				LA39: ;
			}
		} LA20: ;
		closepasses_240404(a);
		idsynchronizationpoint_189453(((NI) 1000));
	}
	goto LA1;
	LA3: ;
	{
		Tnode190813* n;
		openpassescached_240342(a, module, rd);
		n = loadinitsection_232077(rd);
		{
			NI i_240766;
			NI HEX3Atmp_240777;
			NI LOC43;
			NI res_240780;
			i_240766 = 0;
			HEX3Atmp_240777 = 0;
			LOC43 = 0;
			LOC43 = sonslen_193403(n);
			HEX3Atmp_240777 = (NI)(LOC43 - ((NI) 1));
			res_240780 = ((NI) 0);
			{
				while (1) {
					if (!(res_240780 <= HEX3Atmp_240777)) goto LA45;
					i_240766 = res_240780;
					processtoplevelstmtcached_240513((*n).kindU.S6.sons->data[i_240766], a);
					res_240780 += ((NI) 1);
				} LA45: ;
			}
		}
		closepassescached_240563(a);
	}
	LA1: ;
	}BeforeRet: ;
}
コード例 #20
0
N_NIMCALL(tnode173659*, parsepipe_199126)(NimStringDesc* filename, tllstream163204* inputstream) {
	tnode173659* result;
	tllstream163204* s;
	nimfr("parsePipe", "syntaxes.nim")
	result = 0;
	nimln(90, "syntaxes.nim");
	result = emptynode_174505;
	nimln(91, "syntaxes.nim");
	s = llstreamopen_163227(filename, ((NU8) 0));
	nimln(92, "syntaxes.nim");
	{
		NimStringDesc* line;
		NIM_BOOL LOC5;
		NI i;
		nimln(698, "system.nim");
		nimln(698, "system.nim");
		if (!!((s == NIM_NIL))) goto LA3;
		nimln(93, "syntaxes.nim");
		nimln(93, "syntaxes.nim");
		line = rawNewString(80);
		nimln(94, "syntaxes.nim");
		nimln(94, "syntaxes.nim");
		LOC5 = 0;
		LOC5 = llstreamreadline_163248(s, &line);
		nimln(95, "syntaxes.nim");
		i = utf8bom_199091(line);
		nimln(96, "syntaxes.nim");
		{
			NIM_BOOL LOC8;
			NIM_BOOL LOC11;
			nimln(96, "syntaxes.nim");
			LOC8 = 0;
			LOC8 = containsshebang_199097(line, i);
			if (!LOC8) goto LA9;
			nimln(97, "syntaxes.nim");
			nimln(97, "syntaxes.nim");
			LOC11 = 0;
			LOC11 = llstreamreadline_163248(s, &line);
			nimln(98, "syntaxes.nim");
			i = 0;
		}		LA9: ;
		nimln(99, "syntaxes.nim");
		{
			NIM_BOOL LOC14;
			NI TMP2625;
			tparser187203 q;
			NimStringDesc* LOC19;
			tllstream163204* LOC20;
			nimln(99, "syntaxes.nim");
			LOC14 = 0;
			nimln(99, "syntaxes.nim");
			if ((NU)(i) > (NU)(line->Sup.len)) raiseIndexError();
			LOC14 = ((NU8)(line->data[i]) == (NU8)(35));
			if (!(LOC14)) goto LA15;
			nimln(99, "syntaxes.nim");
			nimln(99, "syntaxes.nim");
			TMP2625 = addInt(i, 1);
			if ((NU)((NI64)(TMP2625)) > (NU)(line->Sup.len)) raiseIndexError();
			LOC14 = ((NU8)(line->data[(NI64)(TMP2625)]) == (NU8)(33));
			LA15: ;
			if (!LOC14) goto LA16;
			nimln(100, "syntaxes.nim");
			i = addInt(i, 2);
			nimln(101, "syntaxes.nim");
			while (1) {
				nimln(730, "system.nim");
				if ((NU)(i) > (NU)(line->Sup.len)) raiseIndexError();
				if (!(((NU8)(line->data[i])) == ((NU8)(32)) || ((NU8)(line->data[i])) == ((NU8)(9)) || ((NU8)(line->data[i])) == ((NU8)(11)) || ((NU8)(line->data[i])) == ((NU8)(13)) || ((NU8)(line->data[i])) == ((NU8)(10)) || ((NU8)(line->data[i])) == ((NU8)(12)))) goto LA18;
				nimln(101, "syntaxes.nim");
				i = addInt(i, 1);
			} LA18: ;
			memset((void*)&q, 0, sizeof(q));
			objectInit(&q, (&NTI187203));
			nimln(103, "syntaxes.nim");
			nimln(103, "syntaxes.nim");
			nimln(103, "syntaxes.nim");
			LOC19 = 0;
			LOC19 = copyStr(line, i);
			LOC20 = 0;
			LOC20 = llstreamopen_163218(LOC19);
			openparser_187214(&q, filename, LOC20);			nimln(104, "syntaxes.nim");
			result = parseall_187209(&q);
			nimln(105, "syntaxes.nim");
			closeparser_187221(&q);		}		LA16: ;
		nimln(106, "syntaxes.nim");
		llstreamclose_163238(s);	}	LA3: ;
	popFrame();
	return result;
}
コード例 #21
0
ファイル: syntaxes.c プロジェクト: reactormonk/csources
N_NIMCALL(tnode185813*, parsepipe_218138)(NimStringDesc* filename, tllstream173204* inputstream) {
	tnode185813* result;
	tllstream173204* s;
	nimfr("parsePipe", "syntaxes.nim")
	result = 0;
	nimln(89, "syntaxes.nim");
	result = emptynode_186744;
	nimln(90, "syntaxes.nim");
	s = llstreamopen_173227(filename, ((NU8) 0));
	nimln(91, "syntaxes.nim");
	{
		NimStringDesc* line;
		NIM_BOOL LOC5;
		NI i;
		nimln(91, "syntaxes.nim");
		nimln(91, "syntaxes.nim");
		if (!!((s == NIM_NIL))) goto LA3;
		nimln(92, "syntaxes.nim");
		nimln(92, "syntaxes.nim");
		line = rawNewString(80);
		nimln(93, "syntaxes.nim");
		nimln(93, "syntaxes.nim");
		LOC5 = 0;
		LOC5 = llstreamreadline_173248(s, &line);
		nimln(94, "syntaxes.nim");
		i = utf8bom_218094(line);
		nimln(95, "syntaxes.nim");
		{
			NIM_BOOL LOC8;
			NIM_BOOL LOC11;
			nimln(95, "syntaxes.nim");
			LOC8 = 0;
			LOC8 = containsshebang_218100(line, i);
			if (!LOC8) goto LA9;
			nimln(96, "syntaxes.nim");
			nimln(96, "syntaxes.nim");
			LOC11 = 0;
			LOC11 = llstreamreadline_173248(s, &line);
			nimln(97, "syntaxes.nim");
			i = 0;
		}
		LA9: ;
		nimln(98, "syntaxes.nim");
		{
			NIM_BOOL LOC14;
			NI TMP2706;
			tparser203203 q;
			NimStringDesc* LOC19;
			tllstream173204* LOC20;
			nimln(98, "syntaxes.nim");
			LOC14 = 0;
			nimln(98, "syntaxes.nim");
			if ((NU)(i) > (NU)(line->Sup.len)) raiseIndexError();
			LOC14 = ((NU8)(line->data[i]) == (NU8)(35));
			if (!(LOC14)) goto LA15;
			nimln(98, "syntaxes.nim");
			nimln(98, "syntaxes.nim");
			TMP2706 = addInt(i, 1);
			if ((NU)((NI32)(TMP2706)) > (NU)(line->Sup.len)) raiseIndexError();
			LOC14 = ((NU8)(line->data[(NI32)(TMP2706)]) == (NU8)(33));
			LA15: ;
			if (!LOC14) goto LA16;
			nimln(99, "syntaxes.nim");
			i = addInt(i, 2);
			nimln(100, "syntaxes.nim");
			while (1) {
				nimln(100, "syntaxes.nim");
				if ((NU)(i) > (NU)(line->Sup.len)) raiseIndexError();
				if (!(((NU8)(line->data[i])) == ((NU8)(32)) || ((NU8)(line->data[i])) == ((NU8)(9)) || ((NU8)(line->data[i])) == ((NU8)(11)) || ((NU8)(line->data[i])) == ((NU8)(13)) || ((NU8)(line->data[i])) == ((NU8)(10)) || ((NU8)(line->data[i])) == ((NU8)(12)))) goto LA18;
				nimln(100, "syntaxes.nim");
				i = addInt(i, 1);
			} LA18: ;
			memset((void*)&q, 0, sizeof(q));
			objectInit(&q, (&NTI203203));
			nimln(102, "syntaxes.nim");
			nimln(102, "syntaxes.nim");
			nimln(102, "syntaxes.nim");
			LOC19 = 0;
			LOC19 = copyStr(line, i);
			LOC20 = 0;
			LOC20 = llstreamopen_173218(LOC19);
			openparser_203364(&q, filename, LOC20, NIM_FALSE);
			nimln(103, "syntaxes.nim");
			result = parseall_203212(&q);
			nimln(104, "syntaxes.nim");
			closeparser_203217(&q);
		}
		LA16: ;
		nimln(105, "syntaxes.nim");
		llstreamclose_173238(s);
	}
	LA3: ;
	popFrame();
	return result;
}