From acb1c33ab258dc14dcc51b405b44cc5923b34324 Mon Sep 17 00:00:00 2001
From: Ferenc Szontágh <szf@fsociety.hu>
Date: Fri, 18 Apr 2025 08:52:16 +0000
Subject: [PATCH] add function call

---
 src/Lexer/Operators.hpp |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/src/Lexer/Operators.hpp b/src/Lexer/Operators.hpp
index 690efe5..6725b99 100644
--- a/src/Lexer/Operators.hpp
+++ b/src/Lexer/Operators.hpp
@@ -59,8 +59,16 @@
                                       std::vector<Parser::ParsedExpressionPtr> & output_queue) {
     if (token.type == Tokens::Type::NUMBER || token.type == Tokens::Type::STRING_LITERAL ||
         token.type == Tokens::Type::KEYWORD) {
-        output_queue.push_back(
-            Parser::ParsedExpression::makeLiteral(Symbols::Value::fromString(token.value, expected_var_type)));
+        // Parse literal: use expected type if provided, otherwise auto-detect
+        if (expected_var_type == Symbols::Variables::Type::NULL_TYPE) {
+            output_queue.push_back(
+                Parser::ParsedExpression::makeLiteral(
+                    Symbols::Value::fromString(token.value, /*autoDetectType*/ true)));
+        } else {
+            output_queue.push_back(
+                Parser::ParsedExpression::makeLiteral(
+                    Symbols::Value::fromString(token.value, expected_var_type)));
+        }
         return true;
     }
     if (token.type == Tokens::Type::VARIABLE_IDENTIFIER) {

--
Gitblit v1.9.3