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
6namespace asmgrader {
7
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
Definition asm_buffer.hpp:19
Definition debug.hpp:9
constexpr auto parse(fmt::format_parse_context &ctx)
Definition debug.hpp:12
bool is_debug_format
Definition debug.hpp:10