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

vla5924-practice / compiler-project / 13547252619

26 Feb 2025 03:19PM UTC coverage: 83.626% (+0.5%) from 83.152%
13547252619

Pull #193

github

web-flow
Merge 5c9112e48 into 25b434a4f
Pull Request #193: Add scientific notation support

33 of 35 new or added lines in 2 files covered. (94.29%)

50 existing lines in 4 files now uncovered.

3284 of 3927 relevant lines covered (83.63%)

281.2 hits per line

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

94.44
/compiler/lib/optree/attribute.cpp
1
#include "attribute.hpp"
2

3
#include <cstdint>
4
#include <ostream>
5
#include <string>
6
#include <variant>
7

8
#include "definitions.hpp"
9
#include "types.hpp"
10

11
using namespace optree;
12

13
bool Attribute::operator==(const Attribute &other) const {
84✔
14
    if (is<Type::Ptr>() && other.is<Type::Ptr>()) {
84✔
15
        return *std::get<Type::Ptr>(storage) == *std::get<Type::Ptr>(other.storage);
13✔
16
    }
17
    return storage == other.storage;
71✔
18
}
19

20
void Attribute::dump(std::ostream &stream) const {
644✔
21
    if (is<std::monostate>()) {
644✔
UNCOV
22
        stream << "empty";
×
UNCOV
23
        return;
×
24
    }
25
    if (is<NativeInt>()) {
644✔
26
        stream << "int : " << as<NativeInt>();
92✔
27
        return;
92✔
28
    }
29
    if (is<NativeFloat>()) {
552✔
30
        stream << "float : " << as<NativeFloat>();
63✔
31
        return;
63✔
32
    }
33
    if (is<NativeBool>()) {
489✔
34
        stream << "bool : " << as<NativeBool>();
38✔
35
        return;
38✔
36
    }
37
    if (is<NativeStr>()) {
451✔
38
        stream << "str : " << as<NativeStr>();
186✔
39
        return;
186✔
40
    }
41
    if (is<Type::Ptr>()) {
265✔
42
        stream << "Type : ";
122✔
43
        as<Type::Ptr>()->dump(stream);
122✔
44
        return;
122✔
45
    }
46
    if (is<ArithBinOpKind>()) {
143✔
47
        stream << "ArithBinOpKind : " << static_cast<int>(as<ArithBinOpKind>());
70✔
48
        return;
70✔
49
    }
50
    if (is<ArithCastOpKind>()) {
73✔
51
        stream << "ArithCastOpKind : " << static_cast<int>(as<ArithCastOpKind>());
29✔
52
        return;
29✔
53
    }
54
    if (is<LogicBinOpKind>()) {
44✔
55
        stream << "LogicBinOpKind : " << static_cast<int>(as<LogicBinOpKind>());
39✔
56
        return;
39✔
57
    }
58
    if (is<LogicUnaryOpKind>()) {
5✔
59
        stream << "LogicUnaryOpKind : " << static_cast<int>(as<LogicUnaryOpKind>());
5✔
60
        return;
5✔
61
    }
62
}
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