GCC Code Coverage Report
Directory: src/ Exec Total Coverage
File: src/parse/func_operator.c Lines: 13 13 100.0 %
Date: 2020-08-07 19:15:19 Branches: 16 16 100.0 %

Line Branch Exec Source
1
#include "gwion_util.h"
2
#include "gwion_ast.h"
3
#include "gwion_env.h"
4
#include "vm.h"
5
#include "instr.h"
6
#include "object.h"
7
#include "gwion.h"
8
#include "operator.h"
9
10
38
ANN void func_operator(const Func_Def fdef, struct Op_Import *opi) {
11
38
  opi->op =fdef->base->xid;
12
38
  const m_str str = s_name(fdef->base->xid);
13
76
  const uint is_unary = GET_FLAG(fdef, unary) +
14

38
    (!strcmp(str, "@conditionnal") || !strcmp(str, "@unconditionnal"));
15
38
  const Arg_List args = fdef->base->args;
16
70
  opi->lhs = is_unary ? NULL :
17
32
    args ? args->var_decl->value->type : NULL;
18
38
  if(strcmp(str, "@implicit"))
19
64
    opi->rhs = args ? is_unary ? args->var_decl->value->type :
20

64
      (args->next ? args->next->var_decl->value->type : NULL) : NULL;
21
  else
22
4
    opi->rhs = fdef->base->ret_type;
23
38
}