• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

ArkScript-lang / Ark / 15170219841

21 May 2025 06:50PM UTC coverage: 86.742%. First build
15170219841

Pull #539

github

web-flow
Merge 17f527cb8 into 4ade02b21
Pull Request #539: Feat/various improvements

204 of 239 new or added lines in 10 files covered. (85.36%)

7027 of 8101 relevant lines covered (86.74%)

88229.97 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

97.67
/src/arkreactor/Compiler/IntermediateRepresentation/Entity.cpp
1
#include <Ark/Compiler/IntermediateRepresentation/Entity.hpp>
2

3
namespace Ark::internal::IR
4
{
5
    Entity::Entity(const Kind kind) :
6,789✔
6
        m_kind(kind),
6,789✔
7
        m_inst(NOP)
6,789✔
8
    {}
13,578✔
9

10
    Entity::Entity(const Instruction inst, const uint16_t arg) :
43,963✔
11
        m_kind(Kind::Opcode),
43,963✔
12
        m_inst(inst), m_primary_arg(arg)
43,963✔
13
    {}
87,926✔
14

15
    Entity::Entity(const Instruction inst, const uint16_t primary_arg, const uint16_t secondary_arg) :
4,610✔
16
        m_kind(Kind::Opcode2Args),
4,610✔
17
        m_inst(inst), m_primary_arg(primary_arg), m_secondary_arg(secondary_arg)
4,610✔
18
    {}
9,220✔
19

20
    Entity Entity::Label(const label_t value)
3,390✔
21
    {
3,390✔
22
        auto entity = Entity(Kind::Label);
3,390✔
23
        entity.m_label = value;
3,390✔
24

25
        return entity;
3,390✔
26
    }
3,390✔
27

28
    Entity Entity::Goto(const Entity& label)
1,631✔
29
    {
1,631✔
30
        auto jump = Entity(Kind::Goto);
1,631✔
31
        jump.m_label = label.m_label;
1,631✔
32

33
        return jump;
1,631✔
34
    }
1,631✔
35

36
    Entity Entity::GotoIf(const Entity& label, const bool cond)
1,768✔
37
    {
1,768✔
38
        auto jump = Entity(cond ? Kind::GotoIfTrue : Kind::GotoIfFalse);
1,768✔
39
        jump.m_label = label.m_label;
1,768✔
40

41
        return jump;
1,768✔
42
    }
1,768✔
43

44
    Word Entity::bytecode() const
38,600✔
45
    {
38,600✔
46
        if (m_kind == Kind::Opcode)
38,600✔
47
            return Word(m_inst, m_primary_arg);
33,990✔
48
        if (m_kind == Kind::Opcode2Args)
4,610✔
49
            return Word(m_inst, m_primary_arg, m_secondary_arg);
4,610✔
NEW
50
        return Word(0, 0);
×
51
    }
38,600✔
52

53
    void Entity::setSourceLocation(const std::string& filename, std::size_t line)
22,128✔
54
    {
22,128✔
55
        m_source_file = filename;
22,128✔
56
        m_source_line = line;
22,128✔
57
    }
22,128✔
58
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc