Skip to content

Commit 3ef6919

Browse files
Merge branch 'refactor-syntax_unicode_shims_cmds' into refactor-syntax_unicode_shims
Conflicts: engine/src/cmds.cpp
2 parents 595f0a2 + 18f11f6 commit 3ef6919

2 files changed

Lines changed: 19 additions & 25 deletions

File tree

engine/src/cmds.cpp

Lines changed: 18 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1045,7 +1045,7 @@ if (sp.next(type) != PS_NORMAL)
10451045
return PS_NORMAL;
10461046
}
10471047

1048-
Exec_stat MCMarking::exec(MCExecPoint &ep)
1048+
void MCMarking::exec_ctxt(MCExecContext &ctxt)
10491049
{
10501050
#ifdef /* MCMarking */ LEGACY_EXEC
10511051
if (card != NULL)
@@ -1075,27 +1075,25 @@ Exec_stat MCMarking::exec(MCExecPoint &ep)
10751075

10761076
MCdefaultstackptr->markfind(ep, mode, ep.getsvalue(), field, mark);
10771077
}
1078-
return ES_NORMAL;
1078+
return ES_NORMAL;
10791079
#endif /* MCMarking */
1080-
1081-
MCExecContext ctxt(ep);
1082-
if (card != nil)
1080+
1081+
if (card != NULL)
10831082
{
1084-
MCObjectPtr t_object;
1085-
if (card->getobj(ep, t_object, True) != ES_NORMAL || t_object . object->gettype() != CT_CARD)
1083+
MCObjectPtr t_object;
1084+
if (!card->getobj(ctxt, t_object, True)
1085+
|| t_object . object -> gettype() != CT_CARD)
10861086
{
1087-
MCeerror->add(EE_MARK_BADCARD, line, pos);
1088-
return ES_ERROR;
1089-
}
1090-
1087+
ctxt . LegacyThrow(EE_MARK_BADCARD);
1088+
return;
1089+
}
1090+
10911091
if (mark)
10921092
MCInterfaceExecMarkCard(ctxt, t_object);
10931093
else
10941094
MCInterfaceExecUnmarkCard(ctxt, t_object);
1095-
10961095
}
1097-
if (tofind == nil)
1098-
{
1096+
if (tofind == nil)
10991097
if (mark)
11001098
{
11011099
if (where != nil)
@@ -1110,22 +1108,18 @@ Exec_stat MCMarking::exec(MCExecPoint &ep)
11101108
else
11111109
MCInterfaceExecUnmarkAllCards(ctxt);
11121110
}
1113-
}
11141111
else
1115-
{
1112+
{
11161113
MCAutoStringRef t_needle;
1117-
if (tofind->eval(ep) != ES_NORMAL)
1118-
{
1119-
MCeerror->add(EE_MARK_BADSTRING, line, pos);
1120-
return ES_ERROR;
1121-
}
1122-
ep . copyasstringref(&t_needle);
1114+
1115+
if (!ctxt . EvalExprAsStringRef(tofind, EE_MARK_BADSTRING, &t_needle))
1116+
return;
1117+
11231118
if (mark)
11241119
MCInterfaceExecMarkFind(ctxt, mode, *t_needle, field);
11251120
else
11261121
MCInterfaceExecUnmarkFind(ctxt, mode, *t_needle, field);
1127-
}
1128-
return ES_NORMAL;
1122+
}
11291123
}
11301124

11311125
MCPut::~MCPut()

engine/src/cmds.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ class MCMarking : public MCStatement
192192
}
193193
virtual ~MCMarking();
194194
virtual Parse_stat parse(MCScriptPoint &);
195-
virtual Exec_stat exec(MCExecPoint &);
195+
virtual void exec_ctxt(MCExecContext &ctxt);
196196
};
197197

198198
class MCMarkCommand : public MCMarking

0 commit comments

Comments
 (0)