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

ArkScript-lang / Ark / 15214772429

23 May 2025 04:19PM UTC coverage: 86.895% (+0.2%) from 86.726%
15214772429

push

github

SuperFola
feat(compiler, vm): adding new AT_SYM_SYM and AT_SYM_INDEX_SYM_INDEX super instructions to get elements from list in a single instruction

40 of 44 new or added lines in 2 files covered. (90.91%)

178 existing lines in 8 files now uncovered.

7095 of 8165 relevant lines covered (86.9%)

86688.13 hits per line

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

97.96
/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) :
7,220✔
6
        m_kind(kind),
7,220✔
7
        m_inst(NOP)
7,220✔
8
    {}
14,440✔
9

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

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

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

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

28
    Entity Entity::Goto(const Entity& label, const Instruction inst)
3,407✔
29
    {
3,407✔
30
        auto jump = Entity(Kind::Goto);
3,407✔
31
        jump.m_label = label.m_label;
3,407✔
32
        jump.m_inst = inst;
3,407✔
33

34
        return jump;
3,407✔
35
    }
3,407✔
36

37
    Entity Entity::GotoWithArg(const Entity& label, const Instruction inst, const uint16_t primary_arg)
415✔
38
    {
415✔
39
        auto jump = Entity(Kind::GotoWithArg);
415✔
40
        jump.m_label = label.m_label;
415✔
41
        jump.m_inst = inst;
415✔
42
        jump.m_primary_arg = primary_arg;
415✔
43

44
        return jump;
415✔
45
    }
415✔
46

47
    Entity Entity::GotoIf(const Entity& label, const bool cond)
1,772✔
48
    {
1,772✔
49
        return Goto(label, cond ? POP_JUMP_IF_TRUE : POP_JUMP_IF_FALSE);
1,772✔
50
    }
51

52
    Word Entity::bytecode() const
33,330✔
53
    {
33,330✔
54
        if (m_kind == Kind::Opcode)
33,330✔
55
            return Word(m_inst, m_primary_arg);
25,213✔
56
        if (m_kind == Kind::Opcode2Args)
8,117✔
57
            return Word(m_inst, m_primary_arg, m_secondary_arg);
8,117✔
UNCOV
58
        return Word(0, 0);
×
59
    }
33,330✔
60

61
    void Entity::setSourceLocation(const std::string& filename, std::size_t line)
26,070✔
62
    {
26,070✔
63
        m_source_file = filename;
26,070✔
64
        m_source_line = line;
26,070✔
65
    }
26,070✔
66
}
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