From 62b7af496f2c694ff5361cf21042bbe14f969c64 Mon Sep 17 00:00:00 2001 From: A404M Date: Mon, 7 Apr 2025 14:44:16 +0330 Subject: add more type stuff --- src/runner/runner.c | 7 ++++++- src/runner/runner.h | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'src/runner') diff --git a/src/runner/runner.c b/src/runner/runner.c index c6a8bf0..984af3f 100644 --- a/src/runner/runner.c +++ b/src/runner/runner.c @@ -30,6 +30,11 @@ void runnerVariableSetValue(AstTreeVariable *variable, AstTree *value) { if (variable->isConst) { UNREACHABLE; } + runnerVariableSetValueWihtoutConstCheck(variable, value); +} + +void runnerVariableSetValueWihtoutConstCheck(AstTreeVariable *variable, + AstTree *value) { if (variable->value != NULL) { astTreeDelete(variable->value); } @@ -71,7 +76,7 @@ AstTree *runAstTreeFunction(AstTree *tree, AstTreeFunctionCallParam *arguments, AstTreeFunctionCallParam param = arguments[i]; AstTreeVariable *arg = function->arguments.data[i]; AstTree *value = runExpression(param.value, &shouldRet, false); - runnerVariableSetValue(arg, value); + runnerVariableSetValueWihtoutConstCheck(arg, value); } shouldRet = false; diff --git a/src/runner/runner.h b/src/runner/runner.h index 10fd8dc..2ff2ec2 100644 --- a/src/runner/runner.h +++ b/src/runner/runner.h @@ -4,6 +4,7 @@ #include void runnerVariableSetValue(AstTreeVariable *variable,AstTree *value); +void runnerVariableSetValueWihtoutConstCheck(AstTreeVariable *variable,AstTree *value); bool runAstTree(AstTreeRoot *root); -- cgit v1.2.3