mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-08-10 01:59:02 +00:00
Parser and Assembler implementations
This commit is contained in:
parent
88cd618b4d
commit
38c15df464
36 changed files with 7522 additions and 11 deletions
26
Source/Core/Common/Assembler/AssemblerShared.cpp
Normal file
26
Source/Core/Common/Assembler/AssemblerShared.cpp
Normal file
|
@ -0,0 +1,26 @@
|
|||
// Copyright 2023 Dolphin Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include "Common/Assembler/AssemblerShared.h"
|
||||
|
||||
#include <fmt/format.h>
|
||||
|
||||
namespace Common::GekkoAssembler
|
||||
{
|
||||
std::string AssemblerError::FormatError() const
|
||||
{
|
||||
const char* space_char = col == 0 ? "" : " ";
|
||||
|
||||
std::string_view line_str = error_line;
|
||||
if (line_str.back() == '\n')
|
||||
{
|
||||
line_str = line_str.substr(0, line_str.length() - 1);
|
||||
}
|
||||
|
||||
return fmt::format("Error on line {0} col {1}:\n"
|
||||
" {2}\n"
|
||||
" {3:{4}}{5:^^{6}}\n"
|
||||
"{7}",
|
||||
line + 1, col + 1, line_str, space_char, col, '^', len, message);
|
||||
}
|
||||
} // namespace Common::GekkoAssembler
|
Loading…
Add table
Add a link
Reference in a new issue