diff options
| author | Amlal El Mahrouss <amlal@nekernel.org> | 2025-05-14 17:49:19 +0200 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal@nekernel.org> | 2025-05-14 17:50:15 +0200 |
| commit | 9f031e69aace747feb5bac78eccb9a1d5df81f74 (patch) | |
| tree | 3cc53814499a1b2c2d44fdffc7f694732cd44a1f /dev | |
| parent | 94ceccd5acda2fd035eb55235126b944b0915576 (diff) | |
feat(cc): Rename Parser.h to CompilerFrontend.h, refactor codebase
accordingly.
why:
- To make its intent clearer, and avoid future confusions.
also:
- Ran ./format.sh to the codebase.
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
Diffstat (limited to 'dev')
| -rw-r--r-- | dev/LibCompiler/CompilerFrontend.h (renamed from dev/LibCompiler/Parser.h) | 2 | ||||
| -rw-r--r-- | dev/LibCompiler/Detail/AsmUtils.h | 2 | ||||
| -rw-r--r-- | dev/LibCompiler/Detail/ClUtils.h | 2 | ||||
| -rw-r--r-- | dev/LibCompiler/src/Assembler32x0.cc | 2 | ||||
| -rw-r--r-- | dev/LibCompiler/src/Assembler64x0.cc | 2 | ||||
| -rw-r--r-- | dev/LibCompiler/src/AssemblerAMD64.cc | 2 | ||||
| -rw-r--r-- | dev/LibCompiler/src/AssemblerARM64.cc | 2 | ||||
| -rw-r--r-- | dev/LibCompiler/src/AssemblerPowerPC.cc | 2 | ||||
| -rw-r--r-- | dev/LibCompiler/src/CCompiler64x0.cc | 2 | ||||
| -rw-r--r-- | dev/LibCompiler/src/CCompilerARM64.cc | 2 | ||||
| -rw-r--r-- | dev/LibCompiler/src/CCompilerPower64.cc | 2 | ||||
| -rw-r--r-- | dev/LibCompiler/src/CPlusPlusCompilerAMD64.cc | 2 | ||||
| -rw-r--r-- | dev/LibCompiler/src/CPlusPlusCompilerPreProcessor.cc | 2 | ||||
| -rw-r--r-- | dev/LibDebugger/CommonCLI.inl | 8 | ||||
| -rw-r--r-- | dev/LibDebugger/NeKernelContract.h | 2 | ||||
| -rw-r--r-- | dev/LibDebugger/src/NeKernelContract.cc | 22 | ||||
| -rw-r--r-- | dev/LibDebugger/src/NeKernelContractCLI.cc | 21 |
17 files changed, 44 insertions, 35 deletions
diff --git a/dev/LibCompiler/Parser.h b/dev/LibCompiler/CompilerFrontend.h index 6baff7e..858473b 100644 --- a/dev/LibCompiler/Parser.h +++ b/dev/LibCompiler/CompilerFrontend.h @@ -144,6 +144,6 @@ inline std::size_t find_word_range(std::string haystack, std::string needle) noe return index; } - return false; + return std::string::npos; } } // namespace LibCompiler diff --git a/dev/LibCompiler/Detail/AsmUtils.h b/dev/LibCompiler/Detail/AsmUtils.h index 559df5f..77805c1 100644 --- a/dev/LibCompiler/Detail/AsmUtils.h +++ b/dev/LibCompiler/Detail/AsmUtils.h @@ -7,7 +7,7 @@ #pragma once #include <LibCompiler/AssemblyInterface.h> -#include <LibCompiler/Parser.h> +#include <LibCompiler/CompilerFrontend.h> #include <LibCompiler/Detail/ClUtils.h> diff --git a/dev/LibCompiler/Detail/ClUtils.h b/dev/LibCompiler/Detail/ClUtils.h index f47101a..a809cdf 100644 --- a/dev/LibCompiler/Detail/ClUtils.h +++ b/dev/LibCompiler/Detail/ClUtils.h @@ -7,8 +7,8 @@ #pragma once #include <LibCompiler/AssemblyInterface.h> +#include <LibCompiler/CompilerFrontend.h> #include <LibCompiler/ErrorID.h> -#include <LibCompiler/Parser.h> #include <Vendor/Dialogs.h> #define kZero64Section ".zero64" diff --git a/dev/LibCompiler/src/Assembler32x0.cc b/dev/LibCompiler/src/Assembler32x0.cc index ac24946..44850f6 100644 --- a/dev/LibCompiler/src/Assembler32x0.cc +++ b/dev/LibCompiler/src/Assembler32x0.cc @@ -21,8 +21,8 @@ #include <LibCompiler/AE.h> #include <LibCompiler/Backend/32x0.h> +#include <LibCompiler/CompilerFrontend.h> #include <LibCompiler/PEF.h> -#include <LibCompiler/Parser.h> ///////////////////// diff --git a/dev/LibCompiler/src/Assembler64x0.cc b/dev/LibCompiler/src/Assembler64x0.cc index 8483e9e..a7c3efc 100644 --- a/dev/LibCompiler/src/Assembler64x0.cc +++ b/dev/LibCompiler/src/Assembler64x0.cc @@ -21,9 +21,9 @@ #include <LibCompiler/AE.h> #include <LibCompiler/Backend/64x0.h> +#include <LibCompiler/CompilerFrontend.h> #include <LibCompiler/Detail/ClUtils.h> #include <LibCompiler/PEF.h> -#include <LibCompiler/Parser.h> #include <algorithm> #include <filesystem> #include <fstream> diff --git a/dev/LibCompiler/src/AssemblerAMD64.cc b/dev/LibCompiler/src/AssemblerAMD64.cc index 5e9a7cd..3fdb197 100644 --- a/dev/LibCompiler/src/AssemblerAMD64.cc +++ b/dev/LibCompiler/src/AssemblerAMD64.cc @@ -28,8 +28,8 @@ #include <LibCompiler/AE.h> #include <LibCompiler/Backend/Amd64.h> +#include <LibCompiler/CompilerFrontend.h> #include <LibCompiler/PEF.h> -#include <LibCompiler/Parser.h> #include <algorithm> #include <cstdlib> #include <filesystem> diff --git a/dev/LibCompiler/src/AssemblerARM64.cc b/dev/LibCompiler/src/AssemblerARM64.cc index 8686edb..c8b66f7 100644 --- a/dev/LibCompiler/src/AssemblerARM64.cc +++ b/dev/LibCompiler/src/AssemblerARM64.cc @@ -19,10 +19,10 @@ #include <LibCompiler/AE.h> #include <LibCompiler/Backend/Aarch64.h> +#include <LibCompiler/CompilerFrontend.h> #include <LibCompiler/Detail/AsmUtils.h> #include <LibCompiler/ErrorID.h> #include <LibCompiler/PEF.h> -#include <LibCompiler/Parser.h> #include <LibCompiler/Version.h> #include <algorithm> #include <filesystem> diff --git a/dev/LibCompiler/src/AssemblerPowerPC.cc b/dev/LibCompiler/src/AssemblerPowerPC.cc index f2c3be3..a438aed 100644 --- a/dev/LibCompiler/src/AssemblerPowerPC.cc +++ b/dev/LibCompiler/src/AssemblerPowerPC.cc @@ -19,10 +19,10 @@ #include <LibCompiler/AE.h> #include <LibCompiler/Backend/PowerPC.h> +#include <LibCompiler/CompilerFrontend.h> #include <LibCompiler/Detail/AsmUtils.h> #include <LibCompiler/ErrorID.h> #include <LibCompiler/PEF.h> -#include <LibCompiler/Parser.h> #include <LibCompiler/Version.h> #include <algorithm> #include <filesystem> diff --git a/dev/LibCompiler/src/CCompiler64x0.cc b/dev/LibCompiler/src/CCompiler64x0.cc index 79d32ce..e43e16b 100644 --- a/dev/LibCompiler/src/CCompiler64x0.cc +++ b/dev/LibCompiler/src/CCompiler64x0.cc @@ -11,8 +11,8 @@ /// TODO: none #include <LibCompiler/Backend/64x0.h> +#include <LibCompiler/CompilerFrontend.h> #include <LibCompiler/Detail/ClUtils.h> -#include <LibCompiler/Parser.h> #include <LibCompiler/UUID.h> #include <cstdio> #include <fstream> diff --git a/dev/LibCompiler/src/CCompilerARM64.cc b/dev/LibCompiler/src/CCompilerARM64.cc index a5ddf43..b60ef4f 100644 --- a/dev/LibCompiler/src/CCompilerARM64.cc +++ b/dev/LibCompiler/src/CCompilerARM64.cc @@ -11,8 +11,8 @@ /// TODO: none #include <LibCompiler/Backend/Aarch64.h> +#include <LibCompiler/CompilerFrontend.h> #include <LibCompiler/Detail/ClUtils.h> -#include <LibCompiler/Parser.h> #include <LibCompiler/UUID.h> #include <cstdio> #include <fstream> diff --git a/dev/LibCompiler/src/CCompilerPower64.cc b/dev/LibCompiler/src/CCompilerPower64.cc index f2eba43..30a1ab3 100644 --- a/dev/LibCompiler/src/CCompilerPower64.cc +++ b/dev/LibCompiler/src/CCompilerPower64.cc @@ -8,8 +8,8 @@ */ #include <LibCompiler/Backend/PowerPC.h> +#include <LibCompiler/CompilerFrontend.h> #include <LibCompiler/Detail/ClUtils.h> -#include <LibCompiler/Parser.h> #include <LibCompiler/UUID.h> #include <cstdio> #include <fstream> diff --git a/dev/LibCompiler/src/CPlusPlusCompilerAMD64.cc b/dev/LibCompiler/src/CPlusPlusCompilerAMD64.cc index 051529d..92bf9ad 100644 --- a/dev/LibCompiler/src/CPlusPlusCompilerAMD64.cc +++ b/dev/LibCompiler/src/CPlusPlusCompilerAMD64.cc @@ -17,8 +17,8 @@ // extern_segment, @autodelete { ... }, fn foo() -> auto { ... } #include <LibCompiler/Backend/Amd64.h> +#include <LibCompiler/CompilerFrontend.h> #include <LibCompiler/Detail/ClUtils.h> -#include <LibCompiler/Parser.h> #include <LibCompiler/UUID.h> #include <cstdio> diff --git a/dev/LibCompiler/src/CPlusPlusCompilerPreProcessor.cc b/dev/LibCompiler/src/CPlusPlusCompilerPreProcessor.cc index 5d035da..9981f37 100644 --- a/dev/LibCompiler/src/CPlusPlusCompilerPreProcessor.cc +++ b/dev/LibCompiler/src/CPlusPlusCompilerPreProcessor.cc @@ -9,8 +9,8 @@ /// BUGS: 0 +#include <LibCompiler/CompilerFrontend.h> #include <LibCompiler/ErrorID.h> -#include <LibCompiler/Parser.h> #include <algorithm> #include <filesystem> #include <fstream> diff --git a/dev/LibDebugger/CommonCLI.inl b/dev/LibDebugger/CommonCLI.inl index 0660bb3..c917295 100644 --- a/dev/LibDebugger/CommonCLI.inl +++ b/dev/LibDebugger/CommonCLI.inl @@ -1,5 +1,5 @@ -static BOOL kKeepRunning = false; +static BOOL kKeepRunning = false; #ifdef LD_NEKERNEL_DEBUGGER static LibDebugger::NeKernel::NeKernelContract kKernelDebugger; @@ -7,9 +7,9 @@ static LibDebugger::NeKernel::NeKernelContract kKernelDebugger; static LibDebugger::POSIX::POSIXMachContract kDebugger; #endif -static LibDebugger::ProcessID kPID = 0L; -static LibDebugger::CAddress kActiveAddress = nullptr; -static std::string kPath = ""; +static LibDebugger::ProcessID kPID = 0L; +static LibDebugger::CAddress kActiveAddress = nullptr; +static std::string kPath = ""; #define kBlank "\e[0;30m" #define kRed "\e[0;31m" diff --git a/dev/LibDebugger/NeKernelContract.h b/dev/LibDebugger/NeKernelContract.h index b63dcb9..78140e7 100644 --- a/dev/LibDebugger/NeKernelContract.h +++ b/dev/LibDebugger/NeKernelContract.h @@ -68,6 +68,6 @@ class NeKernelContract : public DebuggerContract { }; } // namespace LibDebugger::NeKernel -#endif // ifdef LD_NEKERNEL_DEBUGGER +#endif // ifdef LD_NEKERNEL_DEBUGGER #endif // LD_NEKERNEL_CONTRACT_H
\ No newline at end of file diff --git a/dev/LibDebugger/src/NeKernelContract.cc b/dev/LibDebugger/src/NeKernelContract.cc index e653d12..33c0c48 100644 --- a/dev/LibDebugger/src/NeKernelContract.cc +++ b/dev/LibDebugger/src/NeKernelContract.cc @@ -21,14 +21,24 @@ NeKernelContract::NeKernelContract() = default; NeKernelContract::~NeKernelContract() = default; -bool NeKernelContract::Attach(std::string path, std::string argv, ProcessID& pid) noexcept { return false; } +bool NeKernelContract::Attach(std::string path, std::string argv, ProcessID& pid) noexcept { + return false; +} -bool NeKernelContract::Breakpoint(std::string symbol) noexcept { return false; } +bool NeKernelContract::Breakpoint(std::string symbol) noexcept { + return false; +} -bool NeKernelContract::Break() noexcept { return false; } +bool NeKernelContract::Break() noexcept { + return false; +} -bool NeKernelContract::Continue() noexcept { return false; } +bool NeKernelContract::Continue() noexcept { + return false; +} -bool NeKernelContract::Detach() noexcept { return false; } +bool NeKernelContract::Detach() noexcept { + return false; +} -#endif // LD_NEKERNEL_DEBUGGER
\ No newline at end of file +#endif // LD_NEKERNEL_DEBUGGER
\ No newline at end of file diff --git a/dev/LibDebugger/src/NeKernelContractCLI.cc b/dev/LibDebugger/src/NeKernelContractCLI.cc index 1f05ff2..dddefda 100644 --- a/dev/LibDebugger/src/NeKernelContractCLI.cc +++ b/dev/LibDebugger/src/NeKernelContractCLI.cc @@ -20,16 +20,15 @@ using namespace LibDebugger::NeKernel; LIBCOMPILER_MODULE(DebuggerNeKernel) { - pfd::notify("Debugger Event", - "Kernel Debugger\n(C) 2025 Amlal El Mahrouss, all rights reserved."); - - if (argc >= 3 && std::string(argv[1]) == "-p" && argv[2] != nullptr) { - kPath = argv[2]; - kStdOut << "[+] Kernel image set to: " << kPath << "\n"; - } - - - return EXIT_SUCCESS; + pfd::notify("Debugger Event", + "Kernel Debugger\n(C) 2025 Amlal El Mahrouss, all rights reserved."); + + if (argc >= 3 && std::string(argv[1]) == "-p" && argv[2] != nullptr) { + kPath = argv[2]; + kStdOut << "[+] Kernel image set to: " << kPath << "\n"; + } + + return EXIT_SUCCESS; } -#endif // LD_NEKERNEL_DEBUGGER
\ No newline at end of file +#endif // LD_NEKERNEL_DEBUGGER
\ No newline at end of file |
