mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-09 03:10:22 +00:00
DIRECTOR: LINGO: Implement grammar for setting object fields
This commit is contained in:
parent
c5b8aaa949
commit
fa1ee74e02
@ -462,6 +462,15 @@ void Lingo::c_theentityassign() {
|
||||
g_lingo->setTheEntity(entity, id, field, d);
|
||||
}
|
||||
|
||||
void Lingo::c_objectfieldassign() {
|
||||
Common::String object(g_lingo->readString());
|
||||
int field = g_lingo->readInt();
|
||||
|
||||
Datum d = g_lingo->pop();
|
||||
|
||||
g_lingo->setObjectField(object, field, d);
|
||||
}
|
||||
|
||||
void Lingo::c_swap() {
|
||||
Datum d2 = g_lingo->pop();
|
||||
Datum d1 = g_lingo->pop();
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -70,10 +70,10 @@
|
||||
STRING = 286,
|
||||
HANDLER = 287,
|
||||
SYMBOL = 288,
|
||||
THEOBJECTFIELD = 289,
|
||||
ENDCLAUSE = 290,
|
||||
tPLAYACCEL = 291,
|
||||
tMETHOD = 292,
|
||||
ENDCLAUSE = 289,
|
||||
tPLAYACCEL = 290,
|
||||
tMETHOD = 291,
|
||||
THEOBJECTFIELD = 292,
|
||||
tDOWN = 293,
|
||||
tELSE = 294,
|
||||
tELSIF = 295,
|
||||
@ -163,10 +163,10 @@
|
||||
#define STRING 286
|
||||
#define HANDLER 287
|
||||
#define SYMBOL 288
|
||||
#define THEOBJECTFIELD 289
|
||||
#define ENDCLAUSE 290
|
||||
#define tPLAYACCEL 291
|
||||
#define tMETHOD 292
|
||||
#define ENDCLAUSE 289
|
||||
#define tPLAYACCEL 290
|
||||
#define tMETHOD 291
|
||||
#define THEOBJECTFIELD 292
|
||||
#define tDOWN 293
|
||||
#define tELSE 294
|
||||
#define tELSIF 295
|
||||
|
@ -103,8 +103,9 @@ void checkEnd(Common::String *token, const char *expect, bool required) {
|
||||
%token<f> FLOAT
|
||||
%token<s> BLTIN BLTINNOARGS BLTINNOARGSORONE BLTINONEARG BLTINARGLIST TWOWORDBUILTIN
|
||||
%token<s> FBLTIN FBLTINNOARGS FBLTINONEARG FBLTINARGLIST RBLTIN RBLTINONEARG
|
||||
%token<s> ID STRING HANDLER SYMBOL THEOBJECTFIELD
|
||||
%token<s> ID STRING HANDLER SYMBOL
|
||||
%token<s> ENDCLAUSE tPLAYACCEL tMETHOD
|
||||
%token<objectfield> THEOBJECTFIELD
|
||||
%token tDOWN tELSE tELSIF tEXIT tGLOBAL tGO tIF tINTO tLOOP tMACRO
|
||||
%token tMOVIE tNEXT tOF tPREVIOUS tPUT tREPEAT tSET tTHEN tTO tWHEN
|
||||
%token tWITH tWHILE tNLELSE tFACTORY tOPEN tPLAY tDONE tINSTANCE
|
||||
@ -186,6 +187,11 @@ asgn: tPUT expr tINTO ID {
|
||||
g_lingo->codeInt($2[0]);
|
||||
g_lingo->codeInt($2[1]);
|
||||
$$ = $5; }
|
||||
| tSET THEOBJECTFIELD tTO expr {
|
||||
g_lingo->code1(g_lingo->c_objectfieldassign);
|
||||
g_lingo->codeString($2.s->c_str());
|
||||
g_lingo->codeInt($2.e);
|
||||
$$ = $4; }
|
||||
;
|
||||
|
||||
stmtoneliner: macro
|
||||
|
@ -842,4 +842,8 @@ void Lingo::setTheCast(Datum &id1, int field, Datum &d) {
|
||||
}
|
||||
}
|
||||
|
||||
void Lingo::setObjectField(Common::String &obj, int field, Datum &d) {
|
||||
warning("STUB: setObjectField(\"%s\", %d, ...)", obj.c_str(), field);
|
||||
}
|
||||
|
||||
} // End of namespace Director
|
||||
|
@ -322,6 +322,7 @@ public:
|
||||
|
||||
static void c_theentitypush();
|
||||
static void c_theentityassign();
|
||||
static void c_objectfieldassign();
|
||||
|
||||
static void c_repeatwhilecode();
|
||||
static void c_repeatwithcode();
|
||||
@ -571,6 +572,7 @@ public:
|
||||
Datum getTheEntity(int entity, Datum &id, int field);
|
||||
Datum getTheSprite(Datum &id, int field);
|
||||
Datum getTheCast(Datum &id, int field);
|
||||
void setObjectField(Common::String &obj, int field, Datum &d);
|
||||
|
||||
public:
|
||||
bool isInArgStack(Common::String *s);
|
||||
|
Loading…
Reference in New Issue
Block a user