AsmGrader
0.0.0
Loading...
Searching...
No Matches
debug.hpp
Go to the documentation of this file.
1
#pragma once
2
3
#include <fmt/base.h>
4
#include <fmt/format.h>
5
6
namespace
asmgrader
{
7
8
struct
DebugFormatter
9
{
10
bool
is_debug_format
=
false
;
11
12
constexpr
auto
parse
(fmt::format_parse_context& ctx) {
13
const
auto
* it = ctx.begin();
14
const
auto
* end = ctx.end();
15
16
if
(it != end && *it ==
'?'
) {
17
is_debug_format
=
true
;
18
++it;
19
}
else
if
(it != end && *it !=
'}'
) {
20
throw
fmt::format_error(
"invalid format"
);
21
}
22
23
return
it;
24
}
25
};
26
27
}
// namespace asmgrader
asmgrader
Definition
asm_buffer.hpp:19
asmgrader::DebugFormatter
Definition
debug.hpp:9
asmgrader::DebugFormatter::parse
constexpr auto parse(fmt::format_parse_context &ctx)
Definition
debug.hpp:12
asmgrader::DebugFormatter::is_debug_format
bool is_debug_format
Definition
debug.hpp:10
include
asmgrader
common
formatters
debug.hpp
Generated by
1.12.0