Skip to content

Commit de02953

Browse files
committed
Merge branch 'refactor-it' into refactor-syntax_unicode
Conflicts: engine/src/ask.cpp engine/src/cmds.cpp engine/src/cmdsc.cpp engine/src/cmdsf.cpp engine/src/execpt.cpp engine/src/internal_development.cpp engine/src/mode_installer.cpp engine/src/srvscript.cpp engine/src/srvscript.h engine/src/statemnt.cpp
2 parents 342e85d + 95e6e97 commit de02953

26 files changed

Lines changed: 164 additions & 221 deletions

engine/src/answer.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ along with LiveCode. If not see <http://www.gnu.org/licenses/>. */
4747

4848
MCAnswer::~MCAnswer()
4949
{
50-
delete it;
5150
delete title;
5251

5352
switch(mode)
@@ -89,7 +88,6 @@ Parse_stat MCAnswer::parse(MCScriptPoint &sp)
8988
const LT *t_literal;
9089

9190
initpoint(sp);
92-
getit(sp, it);
9391

9492
if (sp . skip_token(SP_ASK, TT_UNDEFINED, AT_PAGE) == PS_NORMAL)
9593
{
@@ -309,7 +307,7 @@ Exec_stat MCAnswer::exec(MCExecPoint& ep)
309307
{
310308
Exec_errors t_error = EE_UNDEFINED;
311309

312-
MCExecContext ctxt(ep, it);
310+
MCExecContext ctxt(ep);
313311
MCAutoStringRef t_title;
314312

315313
if (!evaluate_stringref(ep, title, EE_ANSWER_BADTITLE, line, pos, &t_title))
@@ -468,7 +466,7 @@ Exec_stat MCAnswer::exec(MCExecPoint& ep)
468466
}
469467

470468
if (!t_error)
471-
it -> set(ep);
469+
ep . getit() -> set(ep);
472470
else
473471
MCeerror -> add(t_error, line, pos);
474472

engine/src/answer.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ along with LiveCode. If not see <http://www.gnu.org/licenses/>. */
3636
class MCAnswer : public MCStatement
3737
{
3838
Ask_type mode;
39-
MCVarref *it;
4039
MCExpression *title;
4140
Boolean sheet;
4241

@@ -71,7 +70,6 @@ class MCAnswer : public MCStatement
7170
MCAnswer()
7271
{
7372
mode = AT_UNDEFINED;
74-
it = NULL;
7573
sheet = False;
7674
title = NULL;
7775
notify . prompt = NULL;

engine/src/ask.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ const char *MCdialogtypes[] =
6666

6767
MCAsk::~MCAsk(void)
6868
{
69-
delete it;
7069
delete title;
7170

7271
switch(mode)
@@ -101,7 +100,6 @@ Parse_stat MCAsk::parse(MCScriptPoint &sp)
101100
const LT *t_literal;
102101

103102
initpoint(sp);
104-
getit(sp, it);
105103

106104
if (sp . next(t_type) == PS_NORMAL)
107105
if (sp . lookup(SP_ASK, t_literal) == PS_NORMAL)
@@ -260,7 +258,7 @@ Exec_stat MCAsk::exec(class MCExecPoint& ep)
260258
{
261259
Exec_errors t_error = EE_UNDEFINED;
262260

263-
MCExecContext ctxt(ep, it);
261+
MCExecContext ctxt(ep);
264262

265263
MCAutoStringRef t_title;
266264
if (!evaluate_stringref(ep, title, EE_ANSWER_BADTITLE, line, pos, &t_title))

engine/src/ask.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ along with LiveCode. If not see <http://www.gnu.org/licenses/>. */
3636
class MCAsk : public MCStatement
3737
{
3838
Ask_type mode;
39-
MCVarref *it;
4039
MCExpression *title;
4140
Boolean sheet;
4241

@@ -72,7 +71,6 @@ class MCAsk : public MCStatement
7271
file . types = NULL;
7372
file . type_count = 0;
7473
mode = AT_UNDEFINED;
75-
it = NULL;
7674
sheet = False;
7775
}
7876
virtual ~MCAsk(void);

engine/src/cmds.cpp

Lines changed: 12 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,6 @@ MCConvert::~MCConvert()
156156
{
157157
delete container;
158158
delete source;
159-
delete it;
160159
}
161160

162161
Parse_stat MCConvert::parse(MCScriptPoint &sp)
@@ -177,7 +176,6 @@ Parse_stat MCConvert::parse(MCScriptPoint &sp)
177176
(PE_CONVERT_NOCONTAINER, sp);
178177
return PS_ERROR;
179178
}
180-
getit(sp, it);
181179
}
182180
else
183181
MCerrorlock--;
@@ -318,12 +316,11 @@ Exec_stat MCConvert::exec(MCExecPoint &ep)
318316
return ES_NORMAL;
319317
}
320318
Exec_stat stat;
321-
if (it != NULL)
322-
stat = it->set
323-
(ep);
319+
if (container == NULL)
320+
stat = ep . getit() -> set(ep);
324321
else
325-
stat = container->set
326-
(ep, PT_INTO);
322+
stat = container->set(ep, PT_INTO);
323+
327324
if (stat != ES_NORMAL)
328325
{
329326
MCeerror->add
@@ -334,7 +331,7 @@ Exec_stat MCConvert::exec(MCExecPoint &ep)
334331
#endif /* MCConvert */
335332

336333

337-
MCExecContext ctxt(ep, it);
334+
MCExecContext ctxt(ep);
338335
MCAutoStringRef t_input;
339336
MCAutoStringRef t_output;
340337
if (container != NULL)
@@ -355,8 +352,8 @@ Exec_stat MCConvert::exec(MCExecPoint &ep)
355352
}
356353
/* UNCHECKED */ ep . copyasstringref(&t_input);
357354

358-
if (it != NULL)
359-
MCDateTimeExecConvertIntoIt(ctxt, *t_input, fform, fsform, pform, sform, &t_output);
355+
if (container == NULL)
356+
MCDateTimeExecConvertIntoIt(ctxt, *t_input, fform, fsform, pform, sform);
360357
else
361358
{
362359
MCDateTimeExecConvert(ctxt, *t_input, fform, fsform, pform, sform, &t_output);
@@ -377,7 +374,7 @@ void MCConvert::compile(MCSyntaxFactoryRef ctxt)
377374
{
378375
MCSyntaxFactoryBeginStatement(ctxt, line, pos);
379376

380-
if (it != nil)
377+
if (container == nil)
381378
source -> compile(ctxt);
382379
else
383380
container -> compile_inout(ctxt);
@@ -387,7 +384,7 @@ void MCConvert::compile(MCSyntaxFactoryRef ctxt)
387384
MCSyntaxFactoryEvalConstantInt(ctxt, pform);
388385
MCSyntaxFactoryEvalConstantInt(ctxt, sform);
389386

390-
if (it != nil)
387+
if (container == nil)
391388
MCSyntaxFactoryExecMethod(ctxt, kMCDateTimeExecConvertIntoItMethodInfo);
392389
else
393390
MCSyntaxFactoryExecMethodWithArgs(ctxt, kMCDateTimeExecConvertMethodInfo, 0, 1, 2, 3, 4, 0);
@@ -996,7 +993,6 @@ void MCFind::compile(MCSyntaxFactoryRef ctxt)
996993
MCGet::~MCGet()
997994
{
998995
delete value;
999-
delete it;
1000996
}
1001997

1002998
Parse_stat MCGet::parse(MCScriptPoint &sp)
@@ -1008,7 +1004,6 @@ Parse_stat MCGet::parse(MCScriptPoint &sp)
10081004
(PE_GET_BADEXP, sp);
10091005
return PS_ERROR;
10101006
}
1011-
getit(sp, it);
10121007
return PS_NORMAL;
10131008
}
10141009

@@ -1020,7 +1015,7 @@ Exec_stat MCGet::exec(MCExecPoint &ep)
10201015
MCeerror->add(EE_GET_BADEXP, line, pos);
10211016
return ES_ERROR;
10221017
}
1023-
if (it->set(ep) != ES_NORMAL)
1018+
if (ep.getit()->set(ep) != ES_NORMAL)
10241019
{
10251020
MCeerror->add(EE_GET_CANTSET, line, pos, ep.getsvalue());
10261021
return ES_ERROR;
@@ -1036,7 +1031,7 @@ Exec_stat MCGet::exec(MCExecPoint &ep)
10361031
}
10371032
/* UNCHECKED */ ep . copyasvalueref(&t_value);
10381033

1039-
MCExecContext ctxt(ep, it);
1034+
MCExecContext ctxt(ep);
10401035
MCEngineExecGet(ctxt, *t_value);
10411036
if (!ctxt . HasError())
10421037
return ES_NORMAL;
@@ -2992,17 +2987,13 @@ MCResolveImage::~MCResolveImage(void)
29922987
{
29932988
delete m_relative_object;
29942989
delete m_id_or_name;
2995-
delete m_it;
29962990
}
29972991

29982992
Parse_stat MCResolveImage::parse(MCScriptPoint &p_sp)
29992993
{
30002994
Parse_stat t_stat;
30012995
t_stat = PS_NORMAL;
30022996

3003-
// Fetch a reference to 'it'
3004-
getit(p_sp, m_it);
3005-
30062997
if (t_stat == PS_NORMAL)
30072998
t_stat = p_sp.skip_token(SP_FACTOR, TT_CHUNK, CT_IMAGE);
30082999

@@ -3083,7 +3074,7 @@ Exec_stat MCResolveImage::exec(MCExecPoint &p_ep)
30833074
}
30843075

30853076
if (t_stat == ES_NORMAL)
3086-
t_stat = m_it -> set(p_ep);
3077+
t_stat = p_ep.getit() -> set(p_ep);
30873078

30883079
return t_stat;
30893080

0 commit comments

Comments
 (0)