@@ -1338,6 +1338,7 @@ class MCExecContext
13381338 bool ConvertToLegacyColor (MCValueRef value, MCColor& r_color);
13391339
13401340 bool ConvertToMutableString (MCValueRef p_value, MCStringRef &r_string);
1341+ bool ConvertToNumberOrArray (MCExecValue &x_value);
13411342
13421343 // These attempt to convert the given value as specified. If conversion
13431344 // was successful then 'r_converted' is set to true, else 'false'. If
@@ -1505,6 +1506,7 @@ class MCExecContext
15051506 bool EvalOptionalExprAsInt (MCExpression *expr, integer_t default_value, Exec_errors error, integer_t & r_int);
15061507
15071508 bool EvalExprAsBool (MCExpression *expr, Exec_errors error, bool & r_bool);
1509+ bool EvalExprAsNonStrictBool (MCExpression *expr, Exec_errors error, bool & r_bool);
15081510 bool EvalOptionalExprAsBool (MCExpression *expr, bool default_value, Exec_errors error, bool & r_bool);
15091511
15101512 bool EvalExprAsDouble (MCExpression *expr, Exec_errors error, double & r_double);
@@ -5007,15 +5009,15 @@ template<> struct MCExecValueTraits<MCValueRef>
50075009 inline static void set (MCExecValue& self, MCValueRef p_value)
50085010 {
50095011 self . type = kMCExecValueTypeValueRef ;
5010- self . valueref_value = p_value;
5012+ self . valueref_value = MCValueRetain ( p_value) ;
50115013 }
50125014
5013- inline static void free (out_type self)
5015+ inline static void free (MCValueRef& self)
50145016 {
50155017 MCValueRelease (self);
50165018 }
50175019
5018- inline static bool eval (MCExecContext &ctxt, MCExpression* p_expr, Exec_errors p_error, out_type r_value)
5020+ inline static bool eval (MCExecContext &ctxt, MCExpression* p_expr, Exec_errors p_error, MCValueRef& r_value)
50195021 {
50205022 return ctxt . EvalExprAsValueRef (p_expr, p_error, r_value);
50215023 }
@@ -5029,15 +5031,15 @@ template<> struct MCExecValueTraits<MCBooleanRef>
50295031 inline static void set (MCExecValue& self, MCBooleanRef p_value)
50305032 {
50315033 self . type = kMCExecValueTypeBooleanRef ;
5032- self . booleanref_value = p_value;
5034+ self . booleanref_value = MCValueRetain ( p_value) ;
50335035 }
50345036
5035- inline static void free (out_type self)
5037+ inline static void free (MCBooleanRef& self)
50365038 {
50375039 MCValueRelease (self);
50385040 }
50395041
5040- inline static bool eval (MCExecContext &ctxt, MCExpression* p_expr, Exec_errors p_error, out_type r_value)
5042+ inline static bool eval (MCExecContext &ctxt, MCExpression* p_expr, Exec_errors p_error, MCBooleanRef& r_value)
50415043 {
50425044 return ctxt . EvalExprAsBooleanRef (p_expr, p_error, r_value);
50435045 }
@@ -5051,15 +5053,15 @@ template<> struct MCExecValueTraits<MCNameRef>
50515053 inline static void set (MCExecValue& self, MCNameRef p_value)
50525054 {
50535055 self . type = kMCExecValueTypeNameRef ;
5054- self . nameref_value = p_value;
5056+ self . nameref_value = MCValueRetain ( p_value) ;
50555057 }
50565058
5057- inline static void free (out_type self)
5059+ inline static void free (MCNameRef& self)
50585060 {
50595061 MCNameDelete (self);
50605062 }
50615063
5062- inline static bool eval (MCExecContext &ctxt, MCExpression* p_expr, Exec_errors p_error, out_type r_value)
5064+ inline static bool eval (MCExecContext &ctxt, MCExpression* p_expr, Exec_errors p_error, MCNameRef& r_value)
50635065 {
50645066 return ctxt . EvalExprAsNameRef (p_expr, p_error, r_value);
50655067 }
@@ -5073,15 +5075,15 @@ template<> struct MCExecValueTraits<MCDataRef>
50735075 inline static void set (MCExecValue& self, MCDataRef p_value)
50745076 {
50755077 self . type = kMCExecValueTypeDataRef ;
5076- self . dataref_value = p_value;
5078+ self . dataref_value = MCValueRetain ( p_value) ;
50775079 }
50785080
5079- inline static void free (out_type self)
5081+ inline static void free (MCDataRef& self)
50805082 {
50815083 MCValueRelease (self);
50825084 }
50835085
5084- inline static bool eval (MCExecContext &ctxt, MCExpression* p_expr, Exec_errors p_error, out_type r_value)
5086+ inline static bool eval (MCExecContext &ctxt, MCExpression* p_expr, Exec_errors p_error, MCDataRef& r_value)
50855087 {
50865088 return ctxt . EvalExprAsDataRef (p_expr, p_error, r_value);
50875089 }
@@ -5095,15 +5097,15 @@ template<> struct MCExecValueTraits<MCArrayRef>
50955097 inline static void set (MCExecValue& self, MCArrayRef p_value)
50965098 {
50975099 self . type = kMCExecValueTypeArrayRef ;
5098- self . arrayref_value = p_value;
5100+ self . arrayref_value = MCValueRetain ( p_value) ;
50995101 }
51005102
5101- inline static void free (out_type self)
5103+ inline static void free (MCArrayRef& self)
51025104 {
51035105 MCValueRelease (self);
51045106 }
51055107
5106- inline static bool eval (MCExecContext &ctxt, MCExpression* p_expr, Exec_errors p_error, out_type r_value)
5108+ inline static bool eval (MCExecContext &ctxt, MCExpression* p_expr, Exec_errors p_error, MCArrayRef& r_value)
51075109 {
51085110 return ctxt . EvalExprAsArrayRef (p_expr, p_error, r_value);
51095111 }
@@ -5117,15 +5119,15 @@ template<> struct MCExecValueTraits<MCNumberRef>
51175119 inline static void set (MCExecValue& self, MCNumberRef p_value)
51185120 {
51195121 self . type = kMCExecValueTypeNumberRef ;
5120- self . numberref_value = p_value;
5122+ self . numberref_value = MCValueRetain ( p_value) ;
51215123 }
51225124
5123- inline static void free (out_type self)
5125+ inline static void free (MCNumberRef& self)
51245126 {
51255127 MCValueRelease (self);
51265128 }
51275129
5128- inline static bool eval (MCExecContext &ctxt, MCExpression* p_expr, Exec_errors p_error, out_type r_value)
5130+ inline static bool eval (MCExecContext &ctxt, MCExpression* p_expr, Exec_errors p_error, MCNumberRef& r_value)
51295131 {
51305132 return ctxt . EvalExprAsNumberRef (p_expr, p_error, r_value);
51315133 }
@@ -5139,15 +5141,15 @@ template<> struct MCExecValueTraits<MCStringRef>
51395141 inline static void set (MCExecValue& self, MCStringRef p_value)
51405142 {
51415143 self . type = kMCExecValueTypeStringRef ;
5142- self . stringref_value = p_value;
5144+ self . stringref_value = MCValueRetain ( p_value) ;
51435145 }
51445146
5145- inline static void free (out_type self)
5147+ inline static void free (MCStringRef& self)
51465148 {
51475149 MCValueRelease (self);
51485150 }
51495151
5150- inline static bool eval (MCExecContext &ctxt, MCExpression* p_expr, Exec_errors p_error, out_type r_value)
5152+ inline static bool eval (MCExecContext &ctxt, MCExpression* p_expr, Exec_errors p_error, MCStringRef& r_value)
51515153 {
51525154 return ctxt . EvalExprAsStringRef (p_expr, p_error, r_value);
51535155 }
@@ -5164,9 +5166,9 @@ template<> struct MCExecValueTraits<integer_t>
51645166 self . int_value = p_value;
51655167 }
51665168
5167- inline static void free (out_type ){}
5169+ inline static void free (integer_t & self ){}
51685170
5169- inline static bool eval (MCExecContext &ctxt, MCExpression* p_expr, Exec_errors p_error, out_type r_value)
5171+ inline static bool eval (MCExecContext &ctxt, MCExpression* p_expr, Exec_errors p_error, integer_t & r_value)
51705172 {
51715173 return ctxt . EvalExprAsInt (p_expr, p_error, r_value);
51725174 }
@@ -5183,9 +5185,9 @@ template<> struct MCExecValueTraits<uinteger_t>
51835185 self . uint_value = p_value;
51845186 }
51855187
5186- inline static void free (out_type ){}
5188+ inline static void free (uinteger_t & self ){}
51875189
5188- inline static bool eval (MCExecContext &ctxt, MCExpression* p_expr, Exec_errors p_error, out_type r_value)
5190+ inline static bool eval (MCExecContext &ctxt, MCExpression* p_expr, Exec_errors p_error, uinteger_t & r_value)
51895191 {
51905192 return ctxt . EvalExprAsUInt (p_expr, p_error, r_value);
51915193 }
@@ -5202,9 +5204,9 @@ template<> struct MCExecValueTraits<bool>
52025204 self . bool_value = p_value;
52035205 }
52045206
5205- inline static void free (out_type ){}
5207+ inline static void free (bool & self ){}
52065208
5207- inline static bool eval (MCExecContext &ctxt, MCExpression* p_expr, Exec_errors p_error, out_type r_value)
5209+ inline static bool eval (MCExecContext &ctxt, MCExpression* p_expr, Exec_errors p_error, bool & r_value)
52085210 {
52095211 return ctxt . EvalExprAsBool (p_expr, p_error, r_value);
52105212 }
@@ -5221,9 +5223,9 @@ template<> struct MCExecValueTraits<double>
52215223 self . double_value = p_value;
52225224 }
52235225
5224- inline static void free (out_type ){}
5226+ inline static void free (double & self ){}
52255227
5226- inline static bool eval (MCExecContext &ctxt, MCExpression* p_expr, Exec_errors p_error, out_type r_value)
5228+ inline static bool eval (MCExecContext &ctxt, MCExpression* p_expr, Exec_errors p_error, double & r_value)
52275229 {
52285230 return ctxt . EvalExprAsDouble (p_expr, p_error, r_value);
52295231 }
@@ -5240,9 +5242,9 @@ template<> struct MCExecValueTraits<char_t>
52405242 self . char_value = p_value;
52415243 }
52425244
5243- inline static void free (out_type ){}
5245+ inline static void free (char_t & self ){}
52445246
5245- inline static bool eval (MCExecContext &ctxt, MCExpression* p_expr, Exec_errors p_error, out_type r_value)
5247+ inline static bool eval (MCExecContext &ctxt, MCExpression* p_expr, Exec_errors p_error, char_t & r_value)
52465248 {
52475249 return ctxt . EvalExprAsChar (p_expr, p_error, r_value);
52485250 }
@@ -5259,9 +5261,9 @@ template<> struct MCExecValueTraits<MCPoint>
52595261 self . point_value = p_value;
52605262 }
52615263
5262- inline static void free (out_type ){}
5264+ inline static void free (MCPoint& self ){}
52635265
5264- inline static bool eval (MCExecContext &ctxt, MCExpression* p_expr, Exec_errors p_error, out_type r_value)
5266+ inline static bool eval (MCExecContext &ctxt, MCExpression* p_expr, Exec_errors p_error, MCPoint& r_value)
52655267 {
52665268 return ctxt . EvalExprAsPoint (p_expr, p_error, r_value);
52675269 }
@@ -5278,9 +5280,9 @@ template<> struct MCExecValueTraits<MCColor>
52785280 self . color_value = p_value;
52795281 }
52805282
5281- inline static void free (out_type ){}
5283+ inline static void free (MCColor& self ){}
52825284
5283- inline static bool eval (MCExecContext &ctxt, MCExpression* p_expr, Exec_errors p_error, out_type r_value)
5285+ inline static bool eval (MCExecContext &ctxt, MCExpression* p_expr, Exec_errors p_error, MCColor& r_value)
52845286 {
52855287 return ctxt . EvalExprAsColor (p_expr, p_error, r_value);
52865288 }
@@ -5297,9 +5299,9 @@ template<> struct MCExecValueTraits<MCRectangle>
52975299 self . rectangle_value = p_value;
52985300 }
52995301
5300- inline static void free (out_type ){}
5302+ inline static void free (MCRectangle& self ){}
53015303
5302- inline static bool eval (MCExecContext &ctxt, MCExpression* p_expr, Exec_errors p_error, out_type r_value)
5304+ inline static bool eval (MCExecContext &ctxt, MCExpression* p_expr, Exec_errors p_error, MCRectangle& r_value)
53035305 {
53045306 return ctxt . EvalExprAsRectangle (p_expr, p_error, r_value);
53055307 }
@@ -5316,9 +5318,9 @@ template<> struct MCExecValueTraits<float>
53165318 self . float_value = p_value;
53175319 }
53185320
5319- inline static void free (out_type ){}
5321+ inline static void free (float & self ){}
53205322
5321- inline static bool eval (MCExecContext &ctxt, MCExpression* p_expr, Exec_errors p_error, out_type r_value)
5323+ inline static bool eval (MCExecContext &ctxt, MCExpression* p_expr, Exec_errors p_error, float & r_value)
53225324 {
53235325 double t_double;
53245326 if (!ctxt . EvalExprAsDouble (p_expr, p_error, t_double))
0 commit comments