Beispiel #1
0
IoMessage *IoMessage_rawNextIgnoreEOLs(IoMessage *self)
{
	IoMessage *next = IoMessage_rawNext(self);

	while (next && IoMessage_rawIsEOL(next))
	{
		next = IoMessage_rawNext(next);
	}

	return next;
}
Beispiel #2
0
IoMessage *IoMessage_rawLast(IoMessage *self)
{
	IoMessage *last = self;
	IoMessage *next;

	while ((next = IoMessage_rawNext(last)))
	{
		last = next;
	}

	return last;
}
Beispiel #3
0
IoMessage *IoMessage_rawLastBeforeEOL(IoMessage *self)
{
	IoMessage *last = self;
	IoMessage *next;

	while ((next = IoMessage_rawNext(last)))
	{
		if (IoMessage_rawIsEOL(next))
		{
			break;
		}
		last = next;
	}

	return last;
}
Beispiel #4
0
void Level_finish(Level *self)
{
	if (self->message)
	{
		IoMessage_rawSetNext_(self->message, NULL);

		// Remove extra () we added in for operators, but do not need any more
		if ( IoMessage_argCount(self->message) == 1 )
		{
			IoMessage *arg = IoMessage_rawArgAt_(self->message, 0);

			if ( IoSeq_rawSize(IoMessage_name(arg)) == 0 && IoMessage_argCount(arg) == 1 && IoMessage_rawNext(arg) == NULL )
			{
				List_copy_(IoMessage_rawArgList(self->message), IoMessage_rawArgList(arg));
				List_removeAll(IoMessage_rawArgList(arg));
			}
		}
	}

	self->type = UNUSED;
}