Esempio n. 1
0
N_NIMCALL(void, fillbuffer_180072)(tbaselexer180018* l) {
	NI charsread;
	NI tocopy;
	NI s;
	NI oldbuflen;
	NI TMP1653;
	NI TMP1654;
	NI TMP1658;
	NI TMP1659;
	NI LOC13;
	NI TMP1660;
	NI TMP1661;
	nimfr("fillBuffer", "nimlexbase.nim")
	charsread = 0;
	tocopy = 0;
	s = 0;
	oldbuflen = 0;
	nimln(82, "nimlexbase.nim");
	{
		nimln(82, "nimlexbase.nim");
		nimln(82, "nimlexbase.nim");
		if (!!(((*l).Sentinel < (*l).Buflen))) goto LA3;
		nimln(82, "nimlexbase.nim");
		failedassertimpl_80421(((NimStringDesc*) &TMP1652));
	}
	LA3: ;
	nimln(83, "nimlexbase.nim");
	nimln(83, "nimlexbase.nim");
	nimln(83, "nimlexbase.nim");
	TMP1653 = subInt((*l).Buflen, (*l).Sentinel);
	TMP1654 = subInt((NI64)(TMP1653), 1);
	tocopy = (NI64)(TMP1654);
	nimln(84, "nimlexbase.nim");
	{
		nimln(84, "nimlexbase.nim");
		nimln(84, "nimlexbase.nim");
		if (!!((0 <= tocopy))) goto LA7;
		nimln(84, "nimlexbase.nim");
		failedassertimpl_80421(((NimStringDesc*) &TMP1655));
	}
	LA7: ;
	nimln(85, "nimlexbase.nim");
	{
		NI TMP1656;
		NI TMP1657;
		nimln(85, "nimlexbase.nim");
		if (!(0 < tocopy)) goto LA11;
		nimln(86, "nimlexbase.nim");
		nimln(86, "nimlexbase.nim");
		TMP1656 = addInt((*l).Sentinel, 1);
		nimln(86, "nimlexbase.nim");
		TMP1657 = mulInt(tocopy, 1);
		memmove(((void*) ((*l).Buf)), ((void*) (&(*l).Buf[(NI64)(TMP1656)])), (NI64)(TMP1657));
	}
	LA11: ;
	nimln(88, "nimlexbase.nim");
	nimln(89, "nimlexbase.nim");
	nimln(88, "nimlexbase.nim");
	nimln(89, "nimlexbase.nim");
	nimln(89, "nimlexbase.nim");
	TMP1658 = addInt((*l).Sentinel, 1);
	TMP1659 = mulInt((NI64)(TMP1658), 1);
	LOC13 = 0;
	LOC13 = llstreamread_178242((*l).Stream, ((void*) (&(*l).Buf[tocopy])), (NI64)(TMP1659));
	TMP1660 = divInt(LOC13, 1);
	charsread = (NI64)(TMP1660);
	nimln(90, "nimlexbase.nim");
	nimln(90, "nimlexbase.nim");
	TMP1661 = addInt(tocopy, charsread);
	s = (NI64)(TMP1661);
	nimln(91, "nimlexbase.nim");
	{
		NI TMP1662;
		nimln(91, "nimlexbase.nim");
		nimln(91, "nimlexbase.nim");
		TMP1662 = addInt((*l).Sentinel, 1);
		if (!(charsread < (NI64)(TMP1662))) goto LA16;
		nimln(92, "nimlexbase.nim");
		(*l).Buf[s] = 0;
		nimln(93, "nimlexbase.nim");
		(*l).Sentinel = s;
	}
	goto LA14;
	LA16: ;
	{
		nimln(96, "nimlexbase.nim");
		s = subInt(s, 1);
		nimln(97, "nimlexbase.nim");
		while (1) {
			nimln(98, "nimlexbase.nim");
			{
				nimln(98, "nimlexbase.nim");
				nimln(98, "nimlexbase.nim");
				if (!!((s < (*l).Buflen))) goto LA22;
				nimln(98, "nimlexbase.nim");
				failedassertimpl_80421(((NimStringDesc*) &TMP1663));
			}
			LA22: ;
			nimln(99, "nimlexbase.nim");
			while (1) {
				NIM_BOOL LOC25;
				nimln(99, "nimlexbase.nim");
				LOC25 = 0;
				nimln(99, "nimlexbase.nim");
				LOC25 = (0 <= s);
				if (!(LOC25)) goto LA26;
				nimln(99, "nimlexbase.nim");
				nimln(99, "nimlexbase.nim");
				LOC25 = !((((NU8)((*l).Buf[s])) == ((NU8)(13)) || ((NU8)((*l).Buf[s])) == ((NU8)(10))));
				LA26: ;
				if (!LOC25) goto LA24;
				nimln(99, "nimlexbase.nim");
				s = subInt(s, 1);
			} LA24: ;
			nimln(100, "nimlexbase.nim");
			{
				nimln(100, "nimlexbase.nim");
				if (!(0 <= s)) goto LA29;
				nimln(102, "nimlexbase.nim");
				(*l).Sentinel = s;
				nimln(103, "nimlexbase.nim");
				goto LA19;
			}
			goto LA27;
			LA29: ;
			{
				NI TMP1664;
				NI TMP1665;
				void* LOC32;
				NI TMP1668;
				NI LOC37;
				NI TMP1669;
				NI TMP1672;
				nimln(107, "nimlexbase.nim");
				oldbuflen = (*l).Buflen;
				nimln(108, "nimlexbase.nim");
				nimln(108, "nimlexbase.nim");
				TMP1664 = mulInt((*l).Buflen, 2);
				(*l).Buflen = (NI64)(TMP1664);
				nimln(109, "nimlexbase.nim");
				nimln(109, "nimlexbase.nim");
				nimln(109, "nimlexbase.nim");
				TMP1665 = mulInt((*l).Buflen, 1);
				LOC32 = 0;
				LOC32 = realloc_4631(((void*) ((*l).Buf)), (NI64)(TMP1665));
				(*l).Buf = ((NCSTRING) (LOC32));
				nimln(110, "nimlexbase.nim");
				{
					NI TMP1666;
					nimln(110, "nimlexbase.nim");
					nimln(110, "nimlexbase.nim");
					nimln(110, "nimlexbase.nim");
					TMP1666 = subInt((*l).Buflen, oldbuflen);
					if (!!(((NI64)(TMP1666) == oldbuflen))) goto LA35;
					nimln(110, "nimlexbase.nim");
					failedassertimpl_80421(((NimStringDesc*) &TMP1667));
				}
				LA35: ;
				nimln(111, "nimlexbase.nim");
				nimln(112, "nimlexbase.nim");
				nimln(111, "nimlexbase.nim");
				nimln(112, "nimlexbase.nim");
				TMP1668 = mulInt(oldbuflen, 1);
				LOC37 = 0;
				LOC37 = llstreamread_178242((*l).Stream, ((void*) (&(*l).Buf[oldbuflen])), (NI64)(TMP1668));
				TMP1669 = divInt(LOC37, 1);
				charsread = (NI64)(TMP1669);
				nimln(113, "nimlexbase.nim");
				{
					NI TMP1670;
					NI TMP1671;
					nimln(113, "nimlexbase.nim");
					if (!(charsread < oldbuflen)) goto LA40;
					nimln(114, "nimlexbase.nim");
					nimln(114, "nimlexbase.nim");
					TMP1670 = addInt(oldbuflen, charsread);
					(*l).Buf[(NI64)(TMP1670)] = 0;
					nimln(115, "nimlexbase.nim");
					nimln(115, "nimlexbase.nim");
					TMP1671 = addInt(oldbuflen, charsread);
					(*l).Sentinel = (NI64)(TMP1671);
					nimln(116, "nimlexbase.nim");
					goto LA19;
				}
				LA40: ;
				nimln(117, "nimlexbase.nim");
				nimln(117, "nimlexbase.nim");
				TMP1672 = subInt((*l).Buflen, 1);
				s = (NI64)(TMP1672);
			}
			LA27: ;
		} LA19: ;
	}
	LA14: ;
	popFrame();
}
Esempio n. 2
0
N_NIMCALL(void, fillbuffer_276084)(tbaselexer276029* l) {
	NI charsread;
	NI tocopy;
	NI s;
	NI oldbuflen;
	NI TMP3618;
	NI TMP3619;
	NI TMP3623;
	NI TMP3624;
	NI LOC13;
	NI TMP3625;
	NI TMP3626;
	nimfr("fillBuffer", "lexbase.nim")
	charsread = 0;
	tocopy = 0;
	s = 0;
	oldbuflen = 0;
	nimln(77, "lexbase.nim");
	{
		nimln(77, "lexbase.nim");
		nimln(77, "lexbase.nim");
		if (!!(((*l).Sentinel < (*l).Buflen))) goto LA3;
		nimln(77, "lexbase.nim");
		failedassertimpl_79821(((NimStringDesc*) &TMP3617));
	}
	LA3: ;
	nimln(78, "lexbase.nim");
	nimln(78, "lexbase.nim");
	nimln(78, "lexbase.nim");
	TMP3618 = subInt((*l).Buflen, (*l).Sentinel);
	TMP3619 = subInt((NI32)(TMP3618), 1);
	tocopy = (NI32)(TMP3619);
	nimln(79, "lexbase.nim");
	{
		nimln(79, "lexbase.nim");
		nimln(79, "lexbase.nim");
		if (!!((0 <= tocopy))) goto LA7;
		nimln(79, "lexbase.nim");
		failedassertimpl_79821(((NimStringDesc*) &TMP3620));
	}
	LA7: ;
	nimln(80, "lexbase.nim");
	{
		NI TMP3621;
		NI TMP3622;
		nimln(80, "lexbase.nim");
		if (!(0 < tocopy)) goto LA11;
		nimln(81, "lexbase.nim");
		nimln(81, "lexbase.nim");
		TMP3621 = addInt((*l).Sentinel, 1);
		nimln(81, "lexbase.nim");
		TMP3622 = mulInt(tocopy, 1);
		memmove(((void*) ((*l).Buf)), ((void*) (&(*l).Buf[(NI32)(TMP3621)])), (NI32)(TMP3622));
	}
	LA11: ;
	nimln(83, "lexbase.nim");
	nimln(84, "lexbase.nim");
	nimln(83, "lexbase.nim");
	nimln(84, "lexbase.nim");
	nimln(84, "lexbase.nim");
	TMP3623 = addInt((*l).Sentinel, 1);
	TMP3624 = mulInt((NI32)(TMP3623), 1);
	LOC13 = 0;
	LOC13 = readdata_123733((*l).Input, ((void*) (&(*l).Buf[tocopy])), (NI32)(TMP3624));
	TMP3625 = divInt(LOC13, 1);
	charsread = (NI32)(TMP3625);
	nimln(85, "lexbase.nim");
	nimln(85, "lexbase.nim");
	TMP3626 = addInt(tocopy, charsread);
	s = (NI32)(TMP3626);
	nimln(86, "lexbase.nim");
	{
		NI TMP3627;
		nimln(86, "lexbase.nim");
		nimln(86, "lexbase.nim");
		TMP3627 = addInt((*l).Sentinel, 1);
		if (!(charsread < (NI32)(TMP3627))) goto LA16;
		nimln(87, "lexbase.nim");
		(*l).Buf[s] = 0;
		nimln(88, "lexbase.nim");
		(*l).Sentinel = s;
	}
	goto LA14;
	LA16: ;
	{
		nimln(91, "lexbase.nim");
		s = subInt(s, 1);
		nimln(92, "lexbase.nim");
		while (1) {
			nimln(93, "lexbase.nim");
			{
				nimln(93, "lexbase.nim");
				nimln(93, "lexbase.nim");
				if (!!((s < (*l).Buflen))) goto LA22;
				nimln(93, "lexbase.nim");
				failedassertimpl_79821(((NimStringDesc*) &TMP3628));
			}
			LA22: ;
			nimln(94, "lexbase.nim");
			while (1) {
				NIM_BOOL LOC25;
				nimln(94, "lexbase.nim");
				LOC25 = 0;
				nimln(94, "lexbase.nim");
				LOC25 = (0 <= s);
				if (!(LOC25)) goto LA26;
				nimln(94, "lexbase.nim");
				nimln(94, "lexbase.nim");
				LOC25 = !((((NU8)((*l).Buf[s])) == ((NU8)(13)) || ((NU8)((*l).Buf[s])) == ((NU8)(10))));
				LA26: ;
				if (!LOC25) goto LA24;
				nimln(94, "lexbase.nim");
				s = subInt(s, 1);
			} LA24: ;
			nimln(95, "lexbase.nim");
			{
				nimln(95, "lexbase.nim");
				if (!(0 <= s)) goto LA29;
				nimln(97, "lexbase.nim");
				(*l).Sentinel = s;
				nimln(98, "lexbase.nim");
				goto LA19;
			}
			goto LA27;
			LA29: ;
			{
				NI TMP3629;
				NI TMP3630;
				void* LOC32;
				NI TMP3633;
				NI LOC37;
				NI TMP3634;
				NI TMP3637;
				nimln(102, "lexbase.nim");
				oldbuflen = (*l).Buflen;
				nimln(103, "lexbase.nim");
				nimln(103, "lexbase.nim");
				TMP3629 = mulInt((*l).Buflen, 2);
				(*l).Buflen = (NI32)(TMP3629);
				nimln(104, "lexbase.nim");
				nimln(104, "lexbase.nim");
				nimln(104, "lexbase.nim");
				TMP3630 = mulInt((*l).Buflen, 1);
				LOC32 = 0;
				LOC32 = realloc_4631(((void*) ((*l).Buf)), (NI32)(TMP3630));
				(*l).Buf = ((NCSTRING) (LOC32));
				nimln(105, "lexbase.nim");
				{
					NI TMP3631;
					nimln(105, "lexbase.nim");
					nimln(105, "lexbase.nim");
					nimln(105, "lexbase.nim");
					TMP3631 = subInt((*l).Buflen, oldbuflen);
					if (!!(((NI32)(TMP3631) == oldbuflen))) goto LA35;
					nimln(105, "lexbase.nim");
					failedassertimpl_79821(((NimStringDesc*) &TMP3632));
				}
				LA35: ;
				nimln(106, "lexbase.nim");
				nimln(107, "lexbase.nim");
				nimln(106, "lexbase.nim");
				nimln(107, "lexbase.nim");
				TMP3633 = mulInt(oldbuflen, 1);
				LOC37 = 0;
				LOC37 = readdata_123733((*l).Input, ((void*) (&(*l).Buf[oldbuflen])), (NI32)(TMP3633));
				TMP3634 = divInt(LOC37, 1);
				charsread = (NI32)(TMP3634);
				nimln(108, "lexbase.nim");
				{
					NI TMP3635;
					NI TMP3636;
					nimln(108, "lexbase.nim");
					if (!(charsread < oldbuflen)) goto LA40;
					nimln(109, "lexbase.nim");
					nimln(109, "lexbase.nim");
					TMP3635 = addInt(oldbuflen, charsread);
					(*l).Buf[(NI32)(TMP3635)] = 0;
					nimln(110, "lexbase.nim");
					nimln(110, "lexbase.nim");
					TMP3636 = addInt(oldbuflen, charsread);
					(*l).Sentinel = (NI32)(TMP3636);
					nimln(111, "lexbase.nim");
					goto LA19;
				}
				LA40: ;
				nimln(112, "lexbase.nim");
				nimln(112, "lexbase.nim");
				TMP3637 = subInt((*l).Buflen, 1);
				s = (NI32)(TMP3637);
			}
			LA27: ;
		} LA19: ;
	}
	LA14: ;
	popFrame();
}