mirror of
https://github.com/DrBeef/Raze.git
synced 2025-02-21 11:11:16 +00:00
- fixed the CON parser to treat tabs as whitespace.
Fixes #287. World Tour starts now but still has issues.
This commit is contained in:
parent
36b9ac54b7
commit
d5b7935ca1
1 changed files with 11 additions and 13 deletions
|
@ -226,7 +226,7 @@ void ConCompiler::ReportError(int error)
|
||||||
{
|
{
|
||||||
case ERROR_ISAKEYWORD:
|
case ERROR_ISAKEYWORD:
|
||||||
Printf(TEXTCOLOR_RED " * ERROR!(%s, line %d) Symbol '%s' is a key word.\n",
|
Printf(TEXTCOLOR_RED " * ERROR!(%s, line %d) Symbol '%s' is a key word.\n",
|
||||||
fn, line_number, parselabel.GetChars());
|
fn, line_number, parsebuf);
|
||||||
break;
|
break;
|
||||||
case ERROR_PARMUNDEFINED:
|
case ERROR_PARMUNDEFINED:
|
||||||
Printf(TEXTCOLOR_RED " * ERROR!(%s, line %d) Parameter '%s' is undefined.\n",
|
Printf(TEXTCOLOR_RED " * ERROR!(%s, line %d) Parameter '%s' is undefined.\n",
|
||||||
|
@ -363,7 +363,7 @@ bool ConCompiler::ispecial(char c)
|
||||||
}
|
}
|
||||||
|
|
||||||
// oh joy - we need to skip some more characters here to allow running broken scripts.
|
// oh joy - we need to skip some more characters here to allow running broken scripts.
|
||||||
if (c == ' ' || c == 0x0d || c == '(' || c == ')' || c == ',' || c == ';')
|
if (c == ' ' || c == '\t' || c == 0x0d || c == '(' || c == ')' || c == ',' || c == ';')
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
@ -1556,7 +1556,7 @@ int ConCompiler::parsecommand()
|
||||||
popscriptvalue();
|
popscriptvalue();
|
||||||
transnum(LABEL_DEFINE);
|
transnum(LABEL_DEFINE);
|
||||||
j = popscriptvalue();
|
j = popscriptvalue();
|
||||||
while (*textptr == ' ') textptr++;
|
while (*textptr == ' ' || *textptr == '\t') textptr++;
|
||||||
|
|
||||||
i = 0;
|
i = 0;
|
||||||
|
|
||||||
|
@ -1577,11 +1577,11 @@ int ConCompiler::parsecommand()
|
||||||
j = popscriptvalue();
|
j = popscriptvalue();
|
||||||
transnum(LABEL_DEFINE);
|
transnum(LABEL_DEFINE);
|
||||||
k = popscriptvalue();
|
k = popscriptvalue();
|
||||||
while (*textptr == ' ') textptr++;
|
while (*textptr == ' ' || *textptr == '\t') textptr++;
|
||||||
|
|
||||||
i = 0;
|
i = 0;
|
||||||
parsebuffer.Clear();
|
parsebuffer.Clear();
|
||||||
while (*textptr != ' ' && *textptr != 0x0a && *textptr != 0x0d && *textptr != 0) // JBF 20040127: end of file checked
|
while (*textptr != ' ' && *textptr != '\t' && *textptr != 0x0a && *textptr != 0x0d && *textptr != 0) // JBF 20040127: end of file checked
|
||||||
{
|
{
|
||||||
parsebuffer.Push(*textptr);
|
parsebuffer.Push(*textptr);
|
||||||
textptr++, i++;
|
textptr++, i++;
|
||||||
|
@ -1592,14 +1592,14 @@ int ConCompiler::parsecommand()
|
||||||
if (!map) map = AllocateMap();
|
if (!map) map = AllocateMap();
|
||||||
map->SetFileName(parsebuffer.Data());
|
map->SetFileName(parsebuffer.Data());
|
||||||
|
|
||||||
while (*textptr == ' ') textptr++;
|
while (*textptr == ' ' || *textptr == '\t') textptr++;
|
||||||
|
|
||||||
map->parTime =
|
map->parTime =
|
||||||
(((*(textptr + 0) - '0') * 10 + (*(textptr + 1) - '0')) * 26 * 60) +
|
(((*(textptr + 0) - '0') * 10 + (*(textptr + 1) - '0')) * 26 * 60) +
|
||||||
(((*(textptr + 3) - '0') * 10 + (*(textptr + 4) - '0')) * 26);
|
(((*(textptr + 3) - '0') * 10 + (*(textptr + 4) - '0')) * 26);
|
||||||
|
|
||||||
textptr += 5;
|
textptr += 5;
|
||||||
while (*textptr == ' ') textptr++;
|
while (*textptr == ' ' || *textptr == '\t') textptr++;
|
||||||
|
|
||||||
map->designerTime =
|
map->designerTime =
|
||||||
(((*(textptr + 0) - '0') * 10 + (*(textptr + 1) - '0')) * 26 * 60) +
|
(((*(textptr + 0) - '0') * 10 + (*(textptr + 1) - '0')) * 26 * 60) +
|
||||||
|
@ -1608,7 +1608,7 @@ int ConCompiler::parsecommand()
|
||||||
map->levelNumber = levnum;
|
map->levelNumber = levnum;
|
||||||
|
|
||||||
textptr += 5;
|
textptr += 5;
|
||||||
while (*textptr == ' ') textptr++;
|
while (*textptr == ' ' || *textptr == '\t') textptr++;
|
||||||
|
|
||||||
i = 0;
|
i = 0;
|
||||||
|
|
||||||
|
@ -1633,8 +1633,7 @@ int ConCompiler::parsecommand()
|
||||||
}
|
}
|
||||||
|
|
||||||
i = 0;
|
i = 0;
|
||||||
while (*textptr == ' ')
|
while (*textptr == ' ' || *textptr == '\t') textptr++;
|
||||||
textptr++;
|
|
||||||
|
|
||||||
parsebuffer.Clear();
|
parsebuffer.Clear();
|
||||||
while (*textptr != 0x0a && *textptr != 0x0d && *textptr != 0) // JBF 20040127: end of file checked
|
while (*textptr != 0x0a && *textptr != 0x0d && *textptr != 0) // JBF 20040127: end of file checked
|
||||||
|
@ -1651,11 +1650,10 @@ int ConCompiler::parsecommand()
|
||||||
transnum(LABEL_DEFINE);
|
transnum(LABEL_DEFINE);
|
||||||
k = popscriptvalue();
|
k = popscriptvalue();
|
||||||
i = 0;
|
i = 0;
|
||||||
while (*textptr == ' ')
|
while (*textptr == ' ' || *textptr == '\t') textptr++;
|
||||||
textptr++;
|
|
||||||
|
|
||||||
parsebuffer.Clear();
|
parsebuffer.Clear();
|
||||||
while (*textptr != ' ' && *textptr != 0) // JBF 20040127: end of file checked
|
while (*textptr != ' ' && *textptr != '\t' && *textptr != 0) // JBF 20040127: end of file checked
|
||||||
{
|
{
|
||||||
parsebuffer.Push(*textptr);
|
parsebuffer.Push(*textptr);
|
||||||
textptr++, i++;
|
textptr++, i++;
|
||||||
|
|
Loading…
Reference in a new issue