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:
parent
37cb70836b
commit
23a4448862
2 changed files with 14 additions and 6 deletions
|
@ -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());
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue