1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 18:18:12 +00:00

LibJS: Add formatting helper for Bytecode::Register

This commit is contained in:
Andreas Kling 2021-06-03 18:29:30 +02:00
parent 37cb70836b
commit 23a4448862
2 changed files with 14 additions and 6 deletions

View file

@ -6,7 +6,7 @@
#pragma once
#include <AK/Types.h>
#include <AK/Format.h>
namespace JS::Bytecode {
@ -24,3 +24,11 @@ private:
};
}
template<>
struct AK::Formatter<JS::Bytecode::Register> : AK::Formatter<FormatString> {
void format(FormatBuilder& builder, JS::Bytecode::Register const& value)
{
return AK::Formatter<FormatString>::format(builder, "r{}", value.index());
}
};