From 55abb4f6f81fc370e349385b38dffb05fa9d5dcb Mon Sep 17 00:00:00 2001
From: Ferenc Szontágh <szf@fsociety.hu>
Date: Sat, 19 Apr 2025 20:36:38 +0000
Subject: [PATCH] add vscodium / vscode and vim syntax highlight

---
 src/Modules/BuiltIn/PrintModule.hpp |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/src/Modules/BuiltIn/PrintModule.hpp b/src/Modules/BuiltIn/PrintModule.hpp
index e27564a..a7c0b4e 100644
--- a/src/Modules/BuiltIn/PrintModule.hpp
+++ b/src/Modules/BuiltIn/PrintModule.hpp
@@ -37,6 +37,15 @@
             std::cerr << "\n";
             return Symbols::Value();
         });
+        // Built-in error thrower: throws a module exception with provided message
+        mgr.registerFunction("throw_error", [](const std::vector<Symbols::Value> & args) {
+            if (args.size() != 1 || args[0].getType() != Symbols::Variables::Type::STRING) {
+                throw Exception("throw_error requires exactly one string argument");
+            }
+            std::string msg = args[0].get<std::string>();
+            throw Exception(msg);
+            return Symbols::Value();  // never reached
+        });
     }
 };
 

--
Gitblit v1.9.3