@@ -127,18 +127,12 @@ MC_PICKLE_BEGIN_RECORD(MCScriptVariableDefinition)
127127 MC_PICKLE_UINDEX(type)
128128MC_PICKLE_END_RECORD()
129129
130- MC_PICKLE_BEGIN_RECORD(MCScriptContextVariableDefinition)
131- MC_PICKLE_UINDEX(type)
132- MC_PICKLE_UINDEX(default_value)
133- MC_PICKLE_END_RECORD()
134-
135130MC_PICKLE_BEGIN_RECORD(MCScriptHandlerDefinition)
136131 MC_PICKLE_UINDEX(type)
137132 MC_PICKLE_ARRAY_OF_UINDEX(local_types, local_type_count)
138133 MC_PICKLE_ARRAY_OF_NAMEREF(local_names, local_name_count)
139134 MC_PICKLE_UINDEX(start_address)
140135 MC_PICKLE_UINDEX(finish_address)
141- MC_PICKLE_INTENUM(MCScriptHandlerScope, scope)
142136MC_PICKLE_END_RECORD()
143137
144138MC_PICKLE_BEGIN_RECORD(MCScriptForeignHandlerDefinition)
@@ -175,7 +169,6 @@ MC_PICKLE_BEGIN_VARIANT(MCScriptDefinition, kind)
175169 MC_PICKLE_VARIANT_CASE(kMCScriptDefinitionKindEvent , MCScriptEventDefinition)
176170 MC_PICKLE_VARIANT_CASE(kMCScriptDefinitionKindSyntax , MCScriptSyntaxDefinition)
177171 MC_PICKLE_VARIANT_CASE(kMCScriptDefinitionKindDefinitionGroup , MCScriptDefinitionGroupDefinition)
178- MC_PICKLE_VARIANT_CASE(kMCScriptDefinitionKindContextVariable , MCScriptContextVariableDefinition)
179172MC_PICKLE_END_VARIANT()
180173
181174MC_PICKLE_BEGIN_RECORD(MCScriptModule)
@@ -220,7 +213,6 @@ static MCStringRef __MCScriptDefinitionKindToString(MCScriptDefinitionKind p_kin
220213 case kMCScriptDefinitionKindEvent : return MCSTR (" event" );
221214 case kMCScriptDefinitionKindSyntax : return MCSTR (" syntax" );
222215 case kMCScriptDefinitionKindDefinitionGroup : return MCSTR (" group" );
223- case kMCScriptDefinitionKindContextVariable : return MCSTR (" context variable" );
224216 default :
225217 return MCSTR (" unknown" );
226218 }
@@ -276,30 +268,6 @@ bool MCScriptValidateModule(MCScriptModuleRef self)
276268 t_variable = static_cast <MCScriptVariableDefinition *>(self -> definitions[i]);
277269 t_variable -> slot_index = self -> slot_count++;
278270 }
279- else if (self -> definitions[i] -> kind == kMCScriptDefinitionKindContextVariable )
280- {
281- MCScriptContextVariableDefinition *t_variable;
282- t_variable = static_cast <MCScriptContextVariableDefinition *>(self -> definitions[i]);
283-
284- uindex_t t_index;
285- t_index = UINDEX_MAX;
286- for (uindex_t i = 0 ; i < s_context_slot_count; i++)
287- if (s_context_slot_owners[i] == nil)
288- {
289- t_index = i;
290- break ;
291- }
292-
293- if (t_index == UINDEX_MAX)
294- {
295- if (!MCMemoryResizeArray (s_context_slot_count + 1 , s_context_slot_owners, s_context_slot_count))
296- return false ; // oom
297-
298- t_index = s_context_slot_count - 1 ;
299- }
300-
301- s_context_slot_owners[t_index] = self;
302- }
303271 else if (self -> definitions[i] -> kind == kMCScriptDefinitionKindHandler )
304272 {
305273 MCScriptHandlerDefinition *t_handler;
@@ -373,16 +341,16 @@ bool MCScriptValidateModule(MCScriptModuleRef self)
373341 // check index operand is within definition range
374342 // check definition[index] is handler or definition group
375343 // check signature of defintion[index] conforms with invoke arity
376- for (uindex_t i = 1 ; i < t_arity; i ++)
377- t_temporary_count = MCMax (t_temporary_count, t_operands[i ] + 1 );
344+ for (uindex_t j = 1 ; j < t_arity; j ++)
345+ t_temporary_count = MCMax (t_temporary_count, t_operands[j ] + 1 );
378346 break ;
379347 case kMCScriptBytecodeOpInvokeIndirect :
380348 // invoke *<src>, <result>, [ <arg_1>, ..., <arg_n> ]
381349 if (t_arity < 2 )
382350 goto invalid_bytecode_error;
383351
384- for (uindex_t i = 0 ; i < t_arity; i ++)
385- t_temporary_count = MCMax (t_temporary_count, t_operands[i ] + 1 );
352+ for (uindex_t j = 0 ; j < t_arity; j ++)
353+ t_temporary_count = MCMax (t_temporary_count, t_operands[j ] + 1 );
386354 break ;
387355 case kMCScriptBytecodeOpFetch :
388356 case kMCScriptBytecodeOpStore :
@@ -400,8 +368,8 @@ bool MCScriptValidateModule(MCScriptModuleRef self)
400368 if (t_arity < 1 )
401369 goto invalid_bytecode_error;
402370
403- for (uindex_t i = 0 ; i < t_arity; i ++)
404- t_temporary_count = MCMax (t_temporary_count, t_operands[i ] + 1 );
371+ for (uindex_t j = 0 ; j < t_arity; j ++)
372+ t_temporary_count = MCMax (t_temporary_count, t_operands[j ] + 1 );
405373 break ;
406374 case kMCScriptBytecodeOpAssignArray :
407375 // assignarray <dst>, [ <key_1>, <value_1>, ..., <key_n>, <value_n> ]
@@ -410,9 +378,9 @@ bool MCScriptValidateModule(MCScriptModuleRef self)
410378 if (t_arity % 2 != 1 ) // parameters must come in pairs
411379 goto invalid_bytecode_error;
412380
413- for (uindex_t i = 0 ; i < t_arity; ++i )
381+ for (uindex_t j = 0 ; j < t_arity; ++j )
414382 {
415- t_temporary_count = MCMax (t_temporary_count, t_operands[i ] + 1 );
383+ t_temporary_count = MCMax (t_temporary_count, t_operands[j ] + 1 );
416384 }
417385 break ;
418386 }
@@ -790,11 +758,11 @@ bool MCScriptEnsureModuleIsUsable(MCScriptModuleRef self)
790758 t_type = static_cast <MCScriptRecordType *>(self -> types[i]);
791759
792760 MCAutoArray<MCRecordTypeFieldInfo> t_fields;
793- for (uindex_t i = 0 ; i < t_type -> field_count; i ++)
761+ for (uindex_t j = 0 ; j < t_type -> field_count; j ++)
794762 {
795763 MCRecordTypeFieldInfo t_field;
796- t_field . name = t_type -> fields[i ] . name;
797- t_field . type = self -> types[t_type -> fields[i ] . type] -> typeinfo;
764+ t_field . name = t_type -> fields[j ] . name;
765+ t_field . type = self -> types[t_type -> fields[j ] . type] -> typeinfo;
798766 if (!t_fields . Push (t_field))
799767 goto error_cleanup; // oom
800768 }
@@ -1133,20 +1101,6 @@ MCNameRef MCScriptGetNameOfLocalVariableInModule(MCScriptModuleRef self, MCScrip
11331101 return t_handler -> local_names[p_index - t_type -> parameter_name_count];
11341102}
11351103
1136- MCNameRef MCScriptGetNameOfGlobalVariableInModule (MCScriptModuleRef self, uindex_t p_index)
1137- {
1138- if (self -> definition_name_count > 0 )
1139- return self -> definition_names[p_index];
1140- return kMCEmptyName ;
1141- }
1142-
1143- MCNameRef MCScriptGetNameOfContextVariableInModule (MCScriptModuleRef self, uindex_t p_index)
1144- {
1145- if (self -> definition_name_count > 0 )
1146- return self -> definition_names[p_index];
1147- return kMCEmptyName ;
1148- }
1149-
11501104// //////////////////////////////////////////////////////////////////////////////
11511105
11521106static int s_current_indent = 0 ;
0 commit comments