GCC Code Coverage Report
Directory: src/ Exec Total Coverage
File: src/import/internals.c Lines: 14 14 100.0 %
Date: 2020-08-07 19:15:19 Branches: 4 4 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 "traverse.h"
6
#include "instr.h"
7
#include "object.h"
8
#include "gwion.h"
9
#include "operator.h"
10
#include "import.h"
11
#include "gwi.h"
12
13
737
void gwi_body(const Gwi gwi, const Ast body) {
14
737
  const Class_Def cdef = gwi->gwion->env->class_def->e->def;
15
737
  if(!cdef->body)
16
733
    cdef->body = body;
17
  else
18
4
    gwi->body->next = body;
19
737
  gwi->body = body;
20
737
}
21
22
35
ANN void gwi_reset(const Gwi gwi) {
23
35
  if(gwi->ck) {
24
23
    ck_clean(gwi);
25
23
    mp_free2(gwi->gwion->mp, sizeof(ImportCK), gwi->ck);
26
23
    gwi->ck = NULL;
27
  }
28
35
  env_reset(gwi->gwion->env);
29
35
}