GCC Code Coverage Report
Directory: src/ Exec Total Coverage
File: src/parse/stage.c Lines: 14 14 100.0 %
Date: 2020-09-14 09:03:05 Branches: 18 18 100.0 %

Line Branch Exec Source
1
#include "gwion_util.h"
2
#include "gwion_ast.h"
3
#include "gwion_env.h"
4
5
59
ANN m_uint union_push(const Env env, const Union_Def udef) {
6
96
  const Type type = udef->xid ? udef->value->type : udef->type_xid ?
7
37
    udef->type : NULL;
8

77
  return type ? env_push_type(env, type) : GET_FLAG(udef, global) ?
9
18
    env_push_global(env) : env->scope->depth;
10
}
11
12
59
ANN void union_pop(const Env env, const Union_Def udef, const m_uint scope) {
13

59
  if(udef->xid || udef->type_xid || GET_FLAG(udef, global))
14
41
    env_pop(env, scope);
15
59
}
16
17
121
ANN void union_flag(const Union_Def udef, const ae_flag flag) {
18
319
  const Type type = udef->xid || !udef->type_xid ?
19
206
    udef->value->type : udef->type;
20
121
  type->flag |= flag;
21
121
}