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

ArkScript-lang / Ark / 19113248525

05 Nov 2025 11:10AM UTC coverage: 90.556% (-0.08%) from 90.631%
19113248525

push

github

SuperFola
feat(builtins): adding disassemble builtin

9 of 26 new or added lines in 4 files covered. (34.62%)

7978 of 8810 relevant lines covered (90.56%)

157678.34 hits per line

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

66.67
/src/arkreactor/Builtins/Bytecode.cpp
1
#include <Ark/Builtins/Builtins.hpp>
2

3
#include <Ark/Compiler/BytecodeReader.hpp>
4

5
#include <Ark/VM/DefaultValues.hpp>
6
#include <Ark/TypeChecker.hpp>
7

8
namespace Ark::internal::Builtins::Bytecode
9
{
10
    /**
11
     * @name disassemble
12
     * @brief Prints the bytecode of a given function
13
     * @param f function to disassemble
14
     * =begin
15
     * (let foo (fun () { (let a 1) (print a) })
16
     * (disassemble foo)
17
     * =end
18
     * @author https://github.com/SuperFola
19
     */
20
    // cppcheck-suppress constParameterReference
21
    Value disassemble(std::vector<Value>& n, VM* vm)
1✔
22
    {
1✔
23
        if (!types::check(n, ValueType::PageAddr))
1✔
24
            throw types::TypeCheckingError(
2✔
25
                "disassemble",
1✔
26
                { { types::Contract { { types::Typedef("f", ValueType::PageAddr) } } } },
1✔
27
                n);
1✔
28

NEW
29
        BytecodeReader bcr;
×
NEW
30
        bcr.feed(vm->bytecode());
×
NEW
31
        bcr.display(BytecodeSegment::Code, std::nullopt, std::nullopt, n[0].pageAddr());
×
32

NEW
33
        return Nil;
×
34
    }
1✔
35
}
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