1
0
Fork 0
forked from fte/fteqw

. .vector fieldtest; works now! woot!

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@540 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2004-11-29 19:33:49 +00:00
parent 2d90a24fbc
commit 1fbf42489a

View file

@ -3586,35 +3586,59 @@ reloop:
if (QCC_PR_Check(".") || QCC_PR_Check("->")) if (QCC_PR_Check(".") || QCC_PR_Check("->"))
{ {
QCC_def_t *field; QCC_def_t *field;
field = QCC_PR_ParseValue(d->type); if (QCC_PR_Check("("))
{
field = QCC_PR_Expression(TOP_PRIORITY);
QCC_PR_Expect(")");
}
else
field = QCC_PR_ParseValue(d->type);
if (field->type->type == ev_field) if (field->type->type == ev_field)
{ {
switch(field->type->aux_type->type) if (!field->type->aux_type)
{ {
default: QCC_PR_ParseWarning(ERR_INTERNAL, "Field with null aux_type");
QCC_PR_ParseError(ERR_INTERNAL, "Bad field type"); return QCC_PR_Statement(&pr_opcodes[OP_LOAD_FLD], d, field, NULL);
return d; }
case ev_float: else
return QCC_PR_Statement(&pr_opcodes[OP_LOAD_F], d, field, NULL); {
case ev_string: switch(field->type->aux_type->type)
return QCC_PR_Statement(&pr_opcodes[OP_LOAD_S], d, field, NULL); {
case ev_vector: default:
return QCC_PR_Statement(&pr_opcodes[OP_LOAD_V], d, field, NULL); QCC_PR_ParseError(ERR_INTERNAL, "Bad field type");
case ev_function: return d;
{ //complicated for a typecast case ev_field:
d = QCC_PR_Statement(&pr_opcodes[OP_LOAD_FNC], d, field, NULL); d = QCC_PR_Statement(&pr_opcodes[OP_LOAD_FLD], d, field, NULL);
nd = (void *)qccHunkAlloc (sizeof(QCC_def_t)); nd = (void *)qccHunkAlloc (sizeof(QCC_def_t));
memset (nd, 0, sizeof(QCC_def_t)); memset (nd, 0, sizeof(QCC_def_t));
nd->type = field->type->aux_type; nd->type = field->type->aux_type;
nd->ofs = d->ofs; nd->ofs = d->ofs;
nd->temp = d->temp; nd->temp = d->temp;
nd->constant = false; nd->constant = false;
nd->name = d->name; nd->name = d->name;
return nd; return nd;
case ev_float:
return QCC_PR_Statement(&pr_opcodes[OP_LOAD_F], d, field, NULL);
case ev_string:
return QCC_PR_Statement(&pr_opcodes[OP_LOAD_S], d, field, NULL);
case ev_vector:
return QCC_PR_Statement(&pr_opcodes[OP_LOAD_V], d, field, NULL);
case ev_function:
{ //complicated for a typecast
d = QCC_PR_Statement(&pr_opcodes[OP_LOAD_FNC], d, field, NULL);
nd = (void *)qccHunkAlloc (sizeof(QCC_def_t));
memset (nd, 0, sizeof(QCC_def_t));
nd->type = field->type->aux_type;
nd->ofs = d->ofs;
nd->temp = d->temp;
nd->constant = false;
nd->name = d->name;
return nd;
}
case ev_entity:
return QCC_PR_Statement(&pr_opcodes[OP_LOAD_ENT], d, field, NULL);
} }
case ev_entity:
return QCC_PR_Statement(&pr_opcodes[OP_LOAD_ENT], d, field, NULL);
} }
} }
else else