added more functions

This commit is contained in:
mmichlol
2026-02-07 11:33:50 +01:00
parent 5fbd0f98a2
commit aa6d16bc52
8 changed files with 264 additions and 17 deletions

View File

@@ -2,14 +2,16 @@
#include <fstream>
#include <string>
#include <vector>
#include <cstdlib> // do std::system
#include <cstdlib>
#include <filesystem>
#include "compiler_types.h"
#include "parser.h"
#include "codegen.h"
#include "preprocessor.h"
int main(int argc, char* argv[]) {
std::string inputFile, outputName;
std::string Version = "v1.5.0-modular"; // Zaktualizowałem wersję :)
std::string Version = "v0.0.3-beta"; // Zaktualizowałem wersję :)
bool showHelp = false, showVersion = false, showCredits = false;
// --- PARSOWANIE ARGUMENTÓW ---
@@ -68,10 +70,24 @@ int main(int argc, char* argv[]) {
return 1;
}
// ... wczytywanie pliku (to co miałeś) ...
std::string src((std::istreambuf_iterator<char>(in)), std::istreambuf_iterator<char>());
in.close();
// --- LOGIKA KOMPILATORA ---
// --- PREPROCESSOR START ---
std::cout << "[INFO] Preprocessing...\n";
std::filesystem::path p(inputFile);
std::string basePath = p.parent_path().string();
// Uruchamiamy preprocesor - podmieni #include na kod
src = preprocessSource(src, basePath);
// Opcjonalnie: pokaż kod po złączeniu (do debugowania)
// std::cout << "--- FINAL CODE ---\n" << src << "\n------------------\n";
// --- PREPROCESSOR END ---
// --- LOGIKA KOMPILATORA (DALEJ BEZ ZMIAN) ---
CompilerState state;
std::cout << "[INFO] Parsing code...\n";