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
34{
35 return node.identifier;
36}
37
39
UniqueNode rhs
Definition Node.h:72
UniqueNode lhs
Definition Node.h:72
std::string operator()(std::monostate &node)
std::string identifier
Definition Node.h:55