code: def v_unique_name_defintions(ctx, stmt):
      
      defs = [('typedef', 'TYPE_ALREADY_DEFINED', stmt.i_typedefs),
              ('grouping', 'GROUPING_ALREADY_DEFINED', stmt.i_groupings)]
      def f(s):
          for (keyword, errcode, dict) in defs:
              if s.keyword == keyword and s.arg in dict:
                  err_add(ctx.errors, dict[s.arg].pos,
                          errcode, (s.arg, s.pos))
  
      for i in stmt.search('include'):
          submodulename = i.arg
          subm = ctx.get_module(submodulename)
          if subm is not None:
              for s in subm.substmts:
                  for ss in s.substmts:
                      iterate_stmt(ss, f)
docs: Make sure that all top-level definitions in a module are unique