示例#1
0
文件: reach.c 项目: Sendence/ponyc
static reach_type_t* add_type(reach_t* r, ast_t* type, pass_opt_t* opt)
{
  switch(ast_id(type))
  {
    case TK_UNIONTYPE:
    case TK_ISECTTYPE:
      return add_isect_or_union(r, type, opt);

    case TK_TUPLETYPE:
      return add_tuple(r, type, opt);

    case TK_NOMINAL:
      return add_nominal(r, type, opt);

    default:
      assert(0);
  }

  return NULL;
}
示例#2
0
文件: reach.c 项目: DevL/ponyc
static reachable_type_t* add_type(reachable_method_stack_t** s,
  reachable_types_t* r, uint32_t* next_type_id, ast_t* type)
{
  switch(ast_id(type))
  {
    case TK_UNIONTYPE:
    case TK_ISECTTYPE:
      return add_isect_or_union(s, r, next_type_id, type);

    case TK_TUPLETYPE:
      return add_tuple(s, r, next_type_id, type);

    case TK_NOMINAL:
      return add_nominal(s, r, next_type_id, type);

    default:
      assert(0);
  }

  return NULL;
}