mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-11-10 23:02:03 +00:00
- hack for buggy scripts in production code.
This commit is contained in:
parent
248e0503d8
commit
11255cbf6a
1 changed files with 30 additions and 26 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue