anchor.diff:        _ -> {Tree, false}
       end.
   
  -%% ===========================================================================
  -%% The following functions are temporally for testing purpose only, and will be removed.
  -%%=============================================================================
  -
  --spec(pre_cond_check/4::(syntaxTree(), integer(), integer(), atom())->
  -	     boolean()).
  -pre_cond_check(AST, Line, Col, NewName) ->
  -    {ok, {VarName, DefinePos, _C}} = refac_util:pos_to_var_name(AST, {Line, Col}),
  -    case VarName == NewName of 
  -	true -> true;
  -	_ ->  R = cond_check(AST, DefinePos, NewName),
  -	      case R of
  -		  {false, false} -> true;
  -		  _ -> false
  -	      end
  -    end.
   
   %% =====================================================================
   %% @spec envs_bounds_frees(Node::syntaxTree())-> {value, [{Key, [atom()}]}
  
positive.code: 					macro_name ->
  					    {error, "Sorry, renaming of macro names is not supported yet."};
  					_ ->
  					    case cond_check(AnnAST1, DefinePos, NewName1) of
  						{true, _} ->
  						    {error, "New name already declared in the same scope."};
  						{_, true} -> {error, "New name could cause name shadowing."};
  						_ ->
  						    {AnnAST2, _Changed} = rename(AnnAST1, DefinePos, NewName1),
  						    case Editor of 
  
negative.code: 			Env_Bd_Fr_Vars),
      %% The new name will be shadowed by an existing bound variable.
      Shadow2 = lists:any(fun ({{env, _}, {bound, Bds}, {free, Fs}}) ->
  				Poss = lists:map(F_Pos, Fs),
  				Names = lists:map(F_Name, Bds),
  				F_Member = fun (P) -> lists:member(P, Poss) end,
  				lists:any(F_Member, Pos) and lists:member(NewName, Names)
  			end,
  			Env_Bd_Fr_Vars),
      BindingChange1 = lists:any(fun({{env, Envs}, {bound, Bds},{free, _Fs}})->
  				       Poss = lists:map (F_Pos, Bds),
  				       Names = lists:map(F_Name, Envs),
  				       F_Member = fun (P) -> lists:member(P,Poss) end,
  				       lists:any(F_Member, Pos) and lists:member(NewName, Names)
  			       end, Env_Bd_Fr_Vars),
      BindingChange2 = lists:any(fun({{env, Envs}, {bound, Bds}, {free, _Fs}})->
  				       Poss = lists:map(F_Pos, Envs),
  				       Names = lists:map(F_Name, Bds),
  				       F_Member = fun (P) -> lists:member(P,Poss) end,
  				       lists:any(F_Member, Pos) and lists:member(NewName, Names)
  			       end, Env_Bd_Fr_Vars),
      {Clash, Shadow1 or Shadow2, BindingChange1 or BindingChange2}.
  
  
  defpos_to_var_env(Node, DefPos) ->
      case refac_util:once_tdTU(fun defpos_to_var/2, Node, DefPos) of
  	{_, false} ->
  	    throw({error, "Refactoring failed because of a Wrangerl error."});
  	{R, true} -> 
  	    As = refac_syntax:get_ann(R),
  	    case lists:keysearch(env, 1, As) of
  		{value, {env, Env}} ->
  		    Env;
  		_ -> []
  	    end
      end.
  defpos_to_var(Node, DefPos) ->
      case refac_syntax:type(Node) of
  	variable ->
  	    Pos = refac_syntax:get_pos(Node),
  	    case lists:member(Pos, DefPos) of
  		true ->
  		    {Node, true};
  		_ -> {[],false}
  	    end;
  	_ -> {[], false}
      end.
      
      
  pos_to_form(Node, Pos) ->
      case refac_util:once_tdTU(fun pos_to_form_1/2, Node, Pos) of
  	{_, false} -> throw({error, "Refactoring failed because of a Wrangler error."});
  	{R, true} -> R
      end.
  
  pos_to_form_1(Node, Pos) ->
      case (refac_syntax:type(Node)==function) 
  	orelse (refac_syntax:type(Node)==attribute) of
  	true ->
  	    {S, E} = refac_util:get_range(Node),
  	    if (S =< Pos) and (Pos =< E) ->
  		    {Node, true};
  	       true -> {[], false}
  	    end;
  	_ -> {[], false}
      end.
  
  
  
  %% =====================================================================
  