DIRECTOR: LINGO: Remove legacy me code

This commit is contained in:
djsrv 2020-06-05 18:05:15 -04:00 committed by Eugene Sandulenko
parent 759c53c868
commit be4c440128
9 changed files with 368 additions and 404 deletions

View File

@ -244,7 +244,6 @@ static struct BuiltinProto {
// References
{ "cast", LB::b_cast, 1, 1, false, 4, RBLTIN }, // D4 f
{ "field", LB::b_field, 1, 1, false, 3, RBLTIN }, // D3 f
// { "me", LB::b_me, -1,0, false, 3, FBLTIN }, // D3 // works as normal ID, see c_varpush
{ "script", LB::b_script, 1, 1, false, 4, RBLTIN }, // D4 f
{ "window", LB::b_window, 1, 1, false, 4, RBLTIN }, // D4 f
// Chunk operations

View File

@ -381,31 +381,6 @@ int Lingo::codeFunc(Common::String *s, int numpar) {
return ret;
}
// int Lingo::codeMe(Common::String *method, int numpar) {
// // Check if need to encode reference to the factory
// if (method == nullptr) {
// int ret = g_lingo->code1(LC::c_factory);
// g_lingo->codeString(g_lingo->_currentFactory->name->c_str());
// return ret;
// }
// int ret = g_lingo->code1(LC::c_call);
// Common::String m(g_lingo->_currentFactory->name);
// m += '-';
// m += *method;
// g_lingo->codeString(m.c_str());
// inst num = 0;
// WRITE_UINT32(&num, numpar);
// g_lingo->code1(num);
// return ret;
// }
void Lingo::codeLabel(int label) {
_labelstack.push_back(label);
debugC(4, kDebugLingoCompile, "codeLabel: Added label %d", label);

File diff suppressed because it is too large Load Diff

View File

@ -147,7 +147,7 @@ extern int yydebug;
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
union YYSTYPE
{
#line 138 "engines/director/lingo/lingo-gr.y"
#line 137 "engines/director/lingo/lingo-gr.y"
Common::String *s;
int i;

View File

@ -103,7 +103,6 @@ static void startDef() {
static void endDef() {
g_lingo->clearArgStack();
inNone();
g_lingo->_ignoreMe = false;
delete g_lingo->_methodVars;
g_lingo->_methodVars = g_lingo->_methodVarsStash;
@ -727,7 +726,7 @@ defn: tMACRO { startDef(); } ID { g_lingo->_currentFactory = NULL; }
delete $on; }
on: tON { startDef(); } ID {
$$ = $ID; g_lingo->_currentFactory = NULL; g_lingo->_ignoreMe = true; }
$$ = $ID; g_lingo->_currentFactory = NULL; }
argdef: /* nothing */ { $$ = 0; }
| ID { g_lingo->codeArg($ID); mVar($ID, kVarArgument); $$ = 1; delete $ID; }

View File

@ -427,7 +427,7 @@ static const YY_CHAR yy_ec[256] =
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 2, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1
@ -1602,9 +1602,6 @@ YY_RULE_SETUP
count();
yylval.s = new Common::String(yytext);
if (g_lingo->_ignoreMe && yylval.s->equalsIgnoreCase("me"))
return ID;
// When we are defining arguments, allow any string
if (g_lingo->_indef == kStateInArgs)
return ID;
@ -1640,41 +1637,41 @@ YY_RULE_SETUP
YY_BREAK
case 64:
YY_RULE_SETUP
#line 428 "engines/director/lingo/lingo-lex.l"
#line 425 "engines/director/lingo/lingo-lex.l"
{ count(); yylval.f = atof(yytext); return FLOAT; }
YY_BREAK
case 65:
YY_RULE_SETUP
#line 429 "engines/director/lingo/lingo-lex.l"
#line 426 "engines/director/lingo/lingo-lex.l"
{ count(); yylval.i = strtol(yytext, NULL, 10); return INT; }
YY_BREAK
case 66:
YY_RULE_SETUP
#line 430 "engines/director/lingo/lingo-lex.l"
#line 427 "engines/director/lingo/lingo-lex.l"
{ count(); return *yytext; }
YY_BREAK
case 67:
/* rule 67 can match eol */
YY_RULE_SETUP
#line 431 "engines/director/lingo/lingo-lex.l"
#line 428 "engines/director/lingo/lingo-lex.l"
{ count(); return '\n'; }
YY_BREAK
case 68:
YY_RULE_SETUP
#line 432 "engines/director/lingo/lingo-lex.l"
#line 429 "engines/director/lingo/lingo-lex.l"
{ count(); yylval.s = cleanupString(&yytext[1]); yylval.s->deleteLastChar(); return STRING; }
YY_BREAK
case 69:
YY_RULE_SETUP
#line 433 "engines/director/lingo/lingo-lex.l"
#line 430 "engines/director/lingo/lingo-lex.l"
{ count(); }
YY_BREAK
case 70:
YY_RULE_SETUP
#line 435 "engines/director/lingo/lingo-lex.l"
#line 432 "engines/director/lingo/lingo-lex.l"
ECHO;
YY_BREAK
#line 1677 "engines/director/lingo/lingo-lex.cpp"
#line 1674 "engines/director/lingo/lingo-lex.cpp"
case YY_STATE_EOF(INITIAL):
yyterminate();
@ -2683,7 +2680,7 @@ void yyfree (void * ptr )
#define YYTABLES_NAME "yytables"
#line 435 "engines/director/lingo/lingo-lex.l"
#line 432 "engines/director/lingo/lingo-lex.l"
extern int yydebug;

View File

@ -390,9 +390,6 @@ word { count(); return varCheck(tWORD, "word"); }
count();
yylval.s = new Common::String(yytext);
if (g_lingo->_ignoreMe && yylval.s->equalsIgnoreCase("me"))
return ID;
// When we are defining arguments, allow any string
if (g_lingo->_indef == kStateInArgs)
return ID;

View File

@ -157,7 +157,6 @@ Lingo::Lingo(DirectorEngine *vm) : _vm(vm) {
_abort = false;
_nextRepeat = false;
_indef = kStateNone;
_ignoreMe = false;
_immediateMode = false;
_linenumber = _colnumber = _bytenumber = _lastbytenumber = _errorbytenumber = 0;

View File

@ -471,7 +471,6 @@ public:
bool _abort;
bool _nextRepeat;
LexerDefineState _indef;
bool _ignoreMe;
bool _immediateMode;
Common::HashMap<Common::String, VarType, Common::IgnoreCase_Hash, Common::IgnoreCase_EqualTo> *_methodVars;
Common::HashMap<Common::String, VarType, Common::IgnoreCase_Hash, Common::IgnoreCase_EqualTo> *_methodVarsStash;