From e2e9e07a9f50dc1f7a967280a3d1d8ef7fcaa153 Mon Sep 17 00:00:00 2001
From: Ferenc Szontágh <szf@fsociety.hu>
Date: Fri, 18 Apr 2025 09:12:33 +0000
Subject: [PATCH] add built-in modules
---
src/VoidScript.hpp | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/src/VoidScript.hpp b/src/VoidScript.hpp
index 879afeb..5fa3ef0 100644
--- a/src/VoidScript.hpp
+++ b/src/VoidScript.hpp
@@ -7,6 +7,8 @@
#include "Interpreter/Interpreter.hpp"
#include "Lexer/Lexer.hpp"
#include "Parser/Parser.hpp"
+#include "Modules/ModuleManager.hpp"
+#include "Modules/PrintModule.hpp"
class VoidScript {
private:
@@ -33,6 +35,8 @@
lexer(std::make_shared<Lexer::Lexer>()),
parser(std::make_shared<Parser::Parser>()) {
+ // Register built-in modules (print, etc.)
+ Modules::ModuleManager::instance().addModule(std::make_unique<Modules::PrintModule>());
this->files.emplace(this->files.begin(), file);
lexer->setKeyWords(Parser::Parser::keywords);
@@ -40,6 +44,8 @@
int run() {
try {
+ // Register all built-in modules before execution
+ Modules::ModuleManager::instance().registerAll();
while (!files.empty()) {
std::string file = files.back();
const std::string file_content = readFile(file);
--
Gitblit v1.9.3