Script: Remove unimplemented Par(n)=foo

Günther Brammer 2011-04-10 02:05:11 +02:00
parent a3fab0234e
commit 435ed78cd9
3 changed files with 3 additions and 15 deletions

View File

@ -112,7 +112,6 @@ enum C4AulBCCType
AB_GLOBALN, // a named global
AB_GLOBALN_SET,
AB_PAR, // Par statement
AB_PAR_SET,
AB_FUNC, // function
AB_PARN_CONTEXT,

View File

@ -191,11 +191,11 @@ C4Value C4AulExec::Exec(C4AulBCC *pCPos, bool fPassErrors)
PushValue(pCurVal[-pCPos->Par.i+1]);
break;
case AB_EOFN:
case AB_EOF: case AB_EOFN:
throw new C4AulExecError(pCurCtx->Obj, "internal error: function didn't return");
case AB_ERR:
throw new C4AulExecError(pCurCtx->Obj, "syntax error: see previous parser error for details");
throw new C4AulExecError(pCurCtx->Obj, "syntax error: see above for details");
case AB_PARN:
PushValue(pCurCtx->Pars[pCPos->Par.i]);
@ -770,9 +770,6 @@ C4Value C4AulExec::Exec(C4AulBCC *pCPos, bool fPassErrors)
if (pDebug) pDebug->DebugStep(pCPos);
#endif
break;
default:
assert(false);
}
// Continue

View File

@ -784,7 +784,6 @@ static const char * GetTTName(C4AulBCCType e)
case AB_GLOBALN: return "GLOBALN"; // a named global
case AB_GLOBALN_SET: return "GLOBALN_SET";
case AB_PAR: return "PAR"; // Par statement
case AB_PAR_SET: return "PAR_SET";
case AB_FUNC: return "FUNC"; // function
case AB_PARN_CONTEXT: return "AB_PARN_CONTEXT";
@ -1006,7 +1005,6 @@ int C4AulParseState::GetStackValue(C4AulBCCType eType, intptr_t X)
case AB_LOCALN_SET:
case AB_PROP:
case AB_GLOBALN_SET:
case AB_PAR_SET:
case AB_Inc:
case AB_Dec:
case AB_BitNot:
@ -1139,7 +1137,6 @@ C4AulBCC C4AulParseState::MakeSetter(bool fLeaveValue)
{
case AB_ARRAYA: Setter.bccType = AB_ARRAYA_SET; break;
case AB_ARRAY_SLICE: Setter.bccType = AB_ARRAY_SLICE_SET; break;
case AB_PAR: Setter.bccType = AB_PAR_SET; break;
case AB_PARN: Setter.bccType = AB_PARN_SET; break;
case AB_VARN: Setter.bccType = AB_VARN_SET; break;
case AB_LOCALN:
@ -1151,13 +1148,8 @@ C4AulBCC C4AulParseState::MakeSetter(bool fLeaveValue)
Setter.Par.s->IncRef(); // so string isn't dropped by RemoveLastBCC, see also C4AulScript::AddBCC
break;
case AB_GLOBALN: Setter.bccType = AB_GLOBALN_SET; break;
case AB_CALL:
case AB_FUNC:
// Huge hacks would required to make this work. EffectVar should get the Var treatment
// and become a BCC of its own anyway.
throw new C4AulParseError(this, "Setting a call result does not work, sorry!");
default:
throw new C4AulParseError(this, "assignment not possible for this value!");
throw new C4AulParseError(this, "assignment to a constant");
}
// Remove value BCC
RemoveLastBCC();