anchor.diff:             Name ->
                Ctx;
              NS ->
  -             %% TODO build previous namespace
  -             kapok_error:form_error(Meta, ?m(Ctx, file), ?MODULE,
  -                                        {multiple_namespace, {NS, Name}})
  +             %% build the previous namespace before entering the new namespace
  +             build_namespace(NS, Ctx),
  +             Ctx#{namespace => Name}
            end,
     kapok_symbol_table:add_namespace(Name),
     {_, TCtx1} = lists:mapfoldl(fun handle_ns_clause/2, Ctx1, Clauses),
  
positive.code: 
  handle_ns(Meta, Ast, Clauses, Ctx) ->
    handle_ns(Meta, Ast, empty_doc(), Clauses,  Ctx).
  handle_ns(Meta, Ast, _Doc, Clauses, Ctx) ->
    Name = dot_id_name(Ast),
    Ctx1 = case ?m(Ctx, namespace) of
             nil ->
  
negative.code:                 [Alias, Fun]);
  format_error({invalid_defalias_expression, {Alias, Ast}}) ->
    io_lib:format("invalid expression ~p to define alias ~s", [Ast, Alias]);
  format_error({dangling_parameter_keyword, {Token}}) ->
    io_lib:format("dangling ~s without argument", [token_text(Token)]);
  format_error({invalid_def_expression, {Kind, Name, Expr}}) ->
  