summaryrefslogtreecommitdiffhomepage
path: root/dev/LibCompiler/src/Frontend.cc
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal@nekernel.org>2025-07-30 08:50:15 +0100
committerAmlal El Mahrouss <amlal@nekernel.org>2025-07-30 08:50:15 +0100
commit1c8c5cff67b20d86c442b0917d6c1fc6407140df (patch)
tree53ebea660bef14cdc2ff5b7ebefb4049f705f997 /dev/LibCompiler/src/Frontend.cc
parent073811d89c98d6e1c078a032ca2eedefebf80384 (diff)
feat! Breaking API changes of NeCTI's LibCompiler and LibDebugger.
what: - They've now become CompilerKit and DebuggerKit. - Expanding XCoff for NeBoot PowerPC backend. Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
Diffstat (limited to 'dev/LibCompiler/src/Frontend.cc')
-rw-r--r--dev/LibCompiler/src/Frontend.cc51
1 files changed, 0 insertions, 51 deletions
diff --git a/dev/LibCompiler/src/Frontend.cc b/dev/LibCompiler/src/Frontend.cc
deleted file mode 100644
index 2ed5309..0000000
--- a/dev/LibCompiler/src/Frontend.cc
+++ /dev/null
@@ -1,51 +0,0 @@
-/* -------------------------------------------
-
- Copyright (C) 2025 Amlal EL Mahrouss, all rights reserved
-
-------------------------------------------- */
-
-#include <LibCompiler/Frontend.h>
-
-namespace LibCompiler {
-/// find the perfect matching word in a haystack.
-/// \param haystack base string
-/// \param needle the string we search for.
-/// \return if we found it or not.
-BOOL find_word(STLString haystack, STLString needle) noexcept {
- auto index = haystack.find(needle);
-
- // check for needle validity.
- if (index == STLString::npos) return false;
-
- // declare lambda
- auto not_part_of_word = [&](int index) {
- if (std::isspace(haystack[index]) || std::ispunct(haystack[index])) return true;
-
- if (index <= 0 || index >= haystack.size()) return true;
-
- return false;
- };
-
- return not_part_of_word(index - 1) && not_part_of_word(index + needle.size());
-}
-
-/// find a word within strict conditions and returns a range of it.
-/// \param haystack
-/// \param needle
-/// \return position of needle.
-SizeType find_word_range(STLString haystack, STLString needle) noexcept {
- auto index = haystack.find(needle);
-
- // check for needle validity.
- if (index == STLString::npos) return false;
-
- if (!isalnum((haystack[index + needle.size() + 1])) &&
- !isdigit(haystack[index + needle.size() + 1]) &&
- !isalnum((haystack[index - needle.size() - 1])) &&
- !isdigit(haystack[index - needle.size() - 1])) {
- return index;
- }
-
- return STLString::npos;
-}
-} // namespace LibCompiler \ No newline at end of file