diff options
Diffstat (limited to 'dev/LibCompiler/src')
| -rw-r--r-- | dev/LibCompiler/src/AssemblyFactory.cc | 4 | ||||
| -rw-r--r-- | dev/LibCompiler/src/CPlusPlusCompilerAMD64.cc | 14 |
2 files changed, 14 insertions, 4 deletions
diff --git a/dev/LibCompiler/src/AssemblyFactory.cc b/dev/LibCompiler/src/AssemblyFactory.cc index 3853446..46ebed3 100644 --- a/dev/LibCompiler/src/AssemblyFactory.cc +++ b/dev/LibCompiler/src/AssemblyFactory.cc @@ -9,12 +9,12 @@ /** * @file AssemblyFactory.cxx - * @author amlal (amlal@zka.com) + * @author amlal (amlal@nekernel.org) * @brief Assembler Kit * @version 0.1 * @date 2024-01-27 * - * @copyright Copyright (c) 2024 Amlal El Mahrouss + * @copyright Copyright (c) 2024-2025 Amlal El Mahrouss * */ diff --git a/dev/LibCompiler/src/CPlusPlusCompilerAMD64.cc b/dev/LibCompiler/src/CPlusPlusCompilerAMD64.cc index 62d1729..a184e45 100644 --- a/dev/LibCompiler/src/CPlusPlusCompilerAMD64.cc +++ b/dev/LibCompiler/src/CPlusPlusCompilerAMD64.cc @@ -230,7 +230,17 @@ Boolean CompilerFrontendCPlusPlus::Compile(std::string text, const std::string file) { if (text.empty()) - return false; + return true; + + // Clean whitespace and tabs + std::string cleanLine = text; + cleanLine.erase(std::remove(cleanLine.begin(), cleanLine.end(), '\t'), cleanLine.end()); + cleanLine.erase(0, cleanLine.find_first_not_of(" \r\n")); + cleanLine.erase(cleanLine.find_last_not_of(" \r\n") + 1); + + // Skip empty, doc, or block comment lines + if (cleanLine.empty() || cleanLine.starts_with("///") || cleanLine.starts_with("//") || cleanLine.starts_with("/*")) + return true; std::size_t index = 0UL; std::vector<std::pair<LibCompiler::CompilerKeyword, std::size_t>> keywords_list; @@ -983,7 +993,7 @@ static void cxx_print_help() { kSplashCxx(); kPrintF("%s", "No help available, see:\n"); - kPrintF("%s", "www.zws.zka.com/help/c++lang\n"); + kPrintF("%s", "nekernel.org/docs/cxxdrv\n"); } ///////////////////////////////////////////////////////////////////////////////////////// |
