Move DebugChar into its own file

Change-Id: Ia40549e5d0b78ece8dd0722c3a5a032b9915f24b
This commit is contained in:
Rebecca Turner
2024-03-28 15:54:12 -07:00
parent 62332c1250
commit 5ec2efb686
7 changed files with 54 additions and 32 deletions
@@ -1,5 +1,5 @@
#include "terminal-code-eater.hh"
#include "debug-char.hh"
#include "escape-char.hh"
#include <assert.h>
#include <cstdint>
#include <iostream>
@@ -14,7 +14,7 @@ void TerminalCodeEater::feed(char c, std::function<void(char)> on_char)
auto isIntermediateChar = [](char v) -> bool { return v >= 0x20 && v <= 0x2f; };
auto isFinalChar = [](char v) -> bool { return v >= 0x40 && v <= 0x7e; };
if constexpr (DEBUG_EATER) {
std::cerr << "eater" << DebugChar{c} << "\n";
std::cerr << "eater" << MaybeHexEscapedChar{c} << "\n";
}
switch (state) {
@@ -28,7 +28,7 @@ void TerminalCodeEater::feed(char c, std::function<void(char)> on_char)
return;
}
if constexpr (DEBUG_EATER) {
std::cerr << "eater uneat" << DebugChar{c} << "\n";
std::cerr << "eater uneat" << MaybeHexEscapedChar{c} << "\n";
}
on_char(c);
break;