unlogic
Loading...
Searching...
No Matches
DebugPrinter.cpp
Go to the documentation of this file.
1//
2// Created by Nathan on 12/1/2024.
3//
4
5#include "DebugPrinter.h"
6#include <format>
7
8std::string unlogic::DebugPrinter::operator()(std::monostate &node)
9{
10 throw std::runtime_error("unexpected empty node");
11}
12
14{
15 return std::format("{}", node.value);
16}
17
19{
20 return std::format("\"{}\"", node.value);
21}
22
24{
25 auto lhs = std::visit(*this, *node.lhs);
26 auto rhs = std::visit(*this, *node.rhs);
27
28 return std::format("({} / {})", lhs, rhs);
29}
30
32{
33 return "";
34}
35
37{
38 return node.identifier;
39}
40
42{
43 return "";
44}
45
47{
48 return "";
49}
50
52{
53 return "";
54}
55
57{
58 return "";
59}
60
62{
63 return "";
64}
65
67{
68 return "";
69}
70
72{
73 return "";
74}
75
77{
78 return "";
79}
UniqueNode rhs
Definition Node.h:73
UniqueNode lhs
Definition Node.h:73
std::string operator()(std::monostate &node)
std::string identifier
Definition Node.h:56