anchor.diff:  	{nil,_} -> true;
   	{atom,_,_} -> true;
   	{cons,_,H,T} ->
  -	    is_valid_map_key_value(H,Ctx) andalso
  -	    is_valid_map_key_value(T,Ctx);
  +	    is_valid_map_key_value(H) andalso
  +	    is_valid_map_key_value(T);
   	{tuple,_,Es} ->
   	    foldl(fun(E,B) ->
  -			B andalso is_valid_map_key_value(E,Ctx)
  +			B andalso is_valid_map_key_value(E)
   		end,true,Es);
   	{map,_,Arg,Ps} ->
   	    % only check for value expressions to be valid
   	    % invalid map expressions are later checked in
   	    % core and kernel
  -	    is_valid_map_key_value(Arg,Ctx) andalso foldl(fun
  +	    is_valid_map_key_value(Arg) andalso foldl(fun
   		    ({Tag,_,Ke,Ve},B) when Tag =:= map_field_assoc;
  -					   Tag =:= map_field_exact, Ctx =:= expr ->
  -		    B andalso is_valid_map_key_value(Ke,Ctx)
  -		      andalso is_valid_map_key_value(Ve,Ctx);
  +					   Tag =:= map_field_exact ->
  +		    B andalso is_valid_map_key_value(Ke)
  +		      andalso is_valid_map_key_value(Ve);
   		    (_,_) -> false
   	    end,true,Ps);
   	{map,_,Ps} ->
   	    foldl(fun
   		    ({Tag,_,Ke,Ve},B) when Tag =:= map_field_assoc;
  -					   Tag =:= map_field_exact, Ctx =:= expr ->
  -		    B andalso is_valid_map_key_value(Ke,Ctx)
  -		      andalso is_valid_map_key_value(Ve,Ctx);
  +					   Tag =:= map_field_exact ->
  +		    B andalso is_valid_map_key_value(Ke)
  +		      andalso is_valid_map_key_value(Ve);
   		    (_,_) -> false
   	    end, true, Ps);
   	{record,_,_,Fs} ->
   	    foldl(fun
   		    ({record_field,_,Ke,Ve},B) ->
  -		    B andalso is_valid_map_key_value(Ke,Ctx)
  -		      andalso is_valid_map_key_value(Ve,Ctx)
  +		    B andalso is_valid_map_key_value(Ke)
  +		      andalso is_valid_map_key_value(Ve)
   	      end,true,Fs);
   	{bin,_,Es} ->
   	    % only check for value expressions to be valid
  
positive.code:         _ -> true
      end.
  
  %% is_valid_map_key(K,St) -> true | false | {false, Var::atom()}
  %%   check for value expression without variables
  
  is_valid_map_key(K,St) ->
      is_valid_map_key(K,expr,St).
  is_valid_map_key(K,Ctx,St) ->
      case expr(K,[],St) of
  	{[],_} ->
  	    is_valid_map_key_value(K,Ctx);
  	{[Var|_],_} ->
  	    {false,variable,element(1,Var)}
      end.
  
  is_valid_map_key_value(K,Ctx) ->
      case K of
  	{char,_,_} -> true;
  	{integer,_,_} -> true;
  	{float,_,_} -> true;
  
negative.code: is_pattern_expr_1({op,_Line,Op,A1,A2}) ->
      erl_internal:arith_op(Op, 2) andalso all(fun is_pattern_expr/1, [A1,A2]);
  is_pattern_expr_1(_Other) -> false.
  
  pattern_map(Ps, Vt, Old, Bvt, St) ->
      foldl(fun
  	    ({map_field_assoc,L,_,_}, {Psvt,Bvt0,St0}) ->
  		{Psvt,Bvt0,add_error(L, illegal_pattern, St0)};
  	    ({map_field_exact,L,K,V}, {Psvt,Bvt0,St0}) ->
  		case is_valid_map_key(K) of
  		    true ->
  			{Kvt,St1} = expr(K, Vt, St0),
  			{Vvt,Bvt2,St2} = pattern(V, Vt, Old, Bvt, St1),
  			{vtmerge_pat(vtmerge_pat(Kvt, Vvt), Psvt), vtmerge_pat(Bvt0, Bvt2), St2};
  		    false ->
  			{Psvt,Bvt0,add_error(L, illegal_map_key, St0)}
  		end
  	end, {[],[],St}, Ps).
  
  %% pattern_bin([Element], VarTable, Old, BinVarTable, State) ->
  %%           {UpdVarTable,UpdBinVarTable,State}.
  