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

ArkScript-lang / Ark / 15167894191

21 May 2025 04:46PM UTC coverage: 86.739%. First build
15167894191

Pull #539

github

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

205 of 240 new or added lines in 10 files covered. (85.42%)

7025 of 8099 relevant lines covered (86.74%)

79582.66 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,333✔
6
        m_kind(kind),
6,333✔
7
        m_inst(NOP)
6,333✔
8
    {}
12,666✔
9

10
    Entity::Entity(const Instruction inst, const uint16_t arg) :
41,620✔
11
        m_kind(Kind::Opcode),
41,620✔
12
        m_inst(inst), m_primary_arg(arg)
41,620✔
13
    {}
83,240✔
14

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

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

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

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

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

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

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

44
    Word Entity::bytecode() const
36,446✔
45
    {
36,446✔
46
        if (m_kind == Kind::Opcode)
36,446✔
47
            return Word(m_inst, m_primary_arg);
32,007✔
48
        if (m_kind == Kind::Opcode2Args)
4,439✔
49
            return Word(m_inst, m_primary_arg, m_secondary_arg);
4,439✔
NEW
50
        return Word(0, 0);
×
51
    }
36,446✔
52

53
    void Entity::setSourceLocation(const std::string& filename, std::size_t line)
20,922✔
54
    {
20,922✔
55
        m_source_file = filename;
20,922✔
56
        m_source_line = line;
20,922✔
57
    }
20,922✔
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