anchor.diff:  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    
   do_state_to_record_in_callback_fun(PatIndex, Fun, RecordName, RecordFields, IsTuple, ReturnState, SM,
  -				  TupleToRecordFunName, RecordToTupleFunName) ->
  +				   TupleToRecordFunName, RecordToTupleFunName) ->
       FunName = refac_syntax:function_name(Fun),
       Cs = refac_syntax:function_clauses(Fun),
  -    Cs1 = [do_state_to_record_in_callback_clause(PatIndex, C, RecordName, RecordFields, 
  -						 IsTuple, ReturnState, SM, TupleToRecordFunName, 
  -						 RecordToTupleFunName) 
  +    Cs1 = [do_state_to_record_in_callback_clause(PatIndex, C, RecordName, RecordFields,
  +						 IsTuple, ReturnState, SM, TupleToRecordFunName,
  +						 RecordToTupleFunName)
   	   || C <- Cs],
  -    refac_util:rewrite(Fun, refac_syntax:function(FunName, Cs1)).
  -
  -
  -do_state_to_record_in_callback_clause(PatIndex, C, RecordName, RecordFields, IsTuple, ReturnState, SM, 
  -				     TupleToRecordFunName, RecordToTupleFunName) ->
  +    refac_misc:rewrite(Fun, refac_syntax:function(FunName, Cs1)).
  +
  +
  +do_state_to_record_in_callback_clause(PatIndex, C, RecordName, RecordFields, IsTuple, ReturnState, SM,
  +				      TupleToRecordFunName, RecordToTupleFunName) ->
       Ps = refac_syntax:clause_patterns(C),
       G = refac_syntax:clause_guard(C),
       B = refac_syntax:clause_body(C),
  -    {Ps1, DefPs}  = do_state_to_record_in_pats(Ps, PatIndex, RecordName, RecordFields, IsTuple), 
  +    {Ps1, DefPs} = do_state_to_record_in_pats(Ps, PatIndex, RecordName, RecordFields, IsTuple),
       B1 = do_state_to_record_in_callback_fun_clause_body(
  -	   B, RecordName, RecordFields, DefPs, IsTuple, ReturnState, SM,TupleToRecordFunName, RecordToTupleFunName),
  -    B2= remove_record_tuple_conversions(refac_syntax:block_expr(B1), TupleToRecordFunName, RecordToTupleFunName),
  -    B3= refac_syntax:block_expr_body(B2),
  -    refac_util:rewrite(C, refac_syntax:clause(Ps1, G, B3)).
  +	   B, RecordName, RecordFields, DefPs, IsTuple, ReturnState, SM, TupleToRecordFunName, RecordToTupleFunName),
  +    B2 = remove_record_tuple_conversions(refac_syntax:block_expr(B1), TupleToRecordFunName, RecordToTupleFunName),
  +    B3 = refac_syntax:block_expr_body(B2),
  +    refac_misc:rewrite(C, refac_syntax:clause(Ps1, G, B3)).
   
   
   do_state_to_record_in_pats(Ps, PatIndex, RecordName, RecordFields, IsTuple) ->
  
positive.code: 		  true ->
  		      case SM of
  			eqc_statem ->
  			      Node1 = refac_syntax:remove_comments(refac_util:reset_attrs(Node)),
  			      Es2 =  transform_run_command_statem(Node1, RecordName, RecordFields, IsTuple),
  			      {refac_syntax:copy_comments(Node, set_pos(refac_syntax:get_pos(Node), Es2)), true};
  			eqc_fsm ->
  			      Node1 = refac_syntax:remove_comments(refac_util:reset_attrs(Node)),
  			      Node2 = transform_run_command_fsm(Node1, RecordName, RecordFields, IsTuple),
  			      {refac_syntax:copy_comments(Node, set_pos(refac_syntax:get_pos(Node), Node2)), true}
  		      end;
  		  false ->
  		      {Node, false}
  
negative.code:     FieldName = lists:nth(refac_syntax:integer_value(Nth), RecordFields),
      RecordName1 = refac_syntax:atom(RecordName),
      FieldName1 = refac_syntax:atom(FieldName),
      refac_misc:rewrite(Tuple, refac_syntax:record_access(Tuple, RecordName1, FieldName1)).
  
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%    
  %%                 Transformation: setelement to record expression             %%
  