- hack for buggy scripts in production code.

This commit is contained in:
Christoph Oelckers 2020-05-12 23:19:01 +02:00
parent 248e0503d8
commit 11255cbf6a

View file

@ -230,6 +230,33 @@ int findlabel(const char* text)
//
//---------------------------------------------------------------------------
bool ispecial(char c)
{
if (c == 0x0a)
{
line_number++;
return true;
}
// oh joy - we need to skip some more characters here to allow running broken scripts.
if (c == ' ' || c == 0x0d || c == '(' || c == ')' || c == ',' || c == ';')
return true;
return false;
}
bool isaltok(char c)
{
// isalnum pukes on negative input.
return c > 0 && (isalnum(c) || c == '{' || c == '}' || c == '/' || c == '*' || c == '-' || c == '_' || c == '.');
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
void skiptoendofline()
{
while (*textptr != 0x0a && *textptr != 0x0d && *textptr != 0)
@ -272,6 +299,9 @@ bool skipcomments()
continue;
}
// stop if we got something else
// this line got added to skip over a stray semicolon in RR's COOT.CON.
if (ispecial(*textptr)) textptr++;
break;
}
return *textptr != 0;
@ -283,32 +313,6 @@ bool skipcomments()
//
//---------------------------------------------------------------------------
bool ispecial(char c)
{
if (c == 0x0a)
{
line_number++;
return true;
}
if (c == ' ' || c == 0x0d)
return true;
return false;
}
bool isaltok(char c)
{
// isalnum pukes on negative input.
return c > 0 && (isalnum(c) || c == '{' || c == '}' || c == '/' || c == '*' || c == '-' || c == '_' || c == '.');
}
//---------------------------------------------------------------------------
//
//
//
//---------------------------------------------------------------------------
int keyword(void)
{
int i;