enum = NAMEDCONSTANT and #define \ support.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@345 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
7cc2a8b85e
commit
a180cf5004
2 changed files with 41 additions and 6 deletions
|
@ -4794,7 +4794,7 @@ void QCC_PR_ParseStatement (void)
|
|||
}
|
||||
if (QCC_PR_Check(";"))
|
||||
{
|
||||
QCC_PR_ParseWarning(WARN_POINTLESSSTATEMENT, "Effectless statement");
|
||||
QCC_PR_ParseWarning(WARN_POINTLESSSTATEMENT, "Hanging ';'");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -6338,8 +6338,20 @@ void QCC_PR_ParseDefs (char *classname)
|
|||
if (QCC_PR_Check("="))
|
||||
{
|
||||
if (pr_token_type != tt_immediate && pr_immediate_type->type != ev_float)
|
||||
QCC_PR_ParseError(ERR_NOTANUMBER, "enum - not a number");
|
||||
v = pr_immediate._float;
|
||||
{
|
||||
def = QCC_PR_GetDef(NULL, name, NULL, false, 0);
|
||||
if (def)
|
||||
{
|
||||
if (!def->constant)
|
||||
QCC_PR_ParseError(ERR_NOTANUMBER, "enum - %s is not a constant", name);
|
||||
else
|
||||
v = G_FLOAT(def->ofs);
|
||||
}
|
||||
else
|
||||
QCC_PR_ParseError(ERR_NOTANUMBER, "enum - not a number");
|
||||
}
|
||||
else
|
||||
v = pr_immediate._float;
|
||||
QCC_PR_Lex();
|
||||
}
|
||||
def = QCC_PR_GetDef(type_float, name, pr_scope, true, 1);
|
||||
|
@ -6367,8 +6379,21 @@ void QCC_PR_ParseDefs (char *classname)
|
|||
if (QCC_PR_Check("="))
|
||||
{
|
||||
if (pr_token_type != tt_immediate && pr_immediate_type->type != ev_float)
|
||||
QCC_PR_ParseError(ERR_NOTANUMBER, "enumflags - not a number");
|
||||
v = pr_immediate._float;
|
||||
{
|
||||
def = QCC_PR_GetDef(NULL, name, NULL, false, 0);
|
||||
if (def)
|
||||
{
|
||||
if (!def->constant)
|
||||
QCC_PR_ParseError(ERR_NOTANUMBER, "enumflags - %s is not a constant", name);
|
||||
else
|
||||
v = G_FLOAT(def->ofs);
|
||||
}
|
||||
else
|
||||
QCC_PR_ParseError(ERR_NOTANUMBER, "enumflags - not a number");
|
||||
}
|
||||
else
|
||||
v = pr_immediate._float;
|
||||
|
||||
bits = 0;
|
||||
i = (int)v;
|
||||
if (i != v)
|
||||
|
|
|
@ -1640,7 +1640,17 @@ void QCC_PR_ConditionCompilation(void)
|
|||
while(1)
|
||||
{
|
||||
if (*s == '\r' || *s == '\n' || *s == '\0')
|
||||
break;
|
||||
{
|
||||
if (s[-1] == '\\')
|
||||
{
|
||||
}
|
||||
else if (s[-2] == '\\' && s[-1] == '\r' && s[-1] == '\n')
|
||||
{
|
||||
}
|
||||
else
|
||||
break;
|
||||
}
|
||||
|
||||
if (!quote && s[0]=='/'&&(s[1]=='/'||s[1]=='*'))
|
||||
break;
|
||||
if (*s == '\"')
|
||||
|
|
Loading…
Reference in a new issue