get and out statements can now be placed anywhere and function arguments are now always in correct order

This commit is contained in:
Stone_Red
2024-08-07 21:20:00 +02:00
parent c3bc324519
commit 7e357884f5
2 changed files with 23 additions and 29 deletions
@@ -1,6 +1,5 @@
using System;
using System.Collections.Generic;
using System.Linq;
using YesNt.Interpreter.Attributes;
using YesNt.Interpreter.Enums;
@@ -89,7 +88,7 @@ internal class CodeFlowStatements : StatementRuntimeInformation
{
string key = args.Trim();
RuntimeInfo.FunctionCallStack.Push(new FunctionScope(RuntimeInfo.LineNumber, new Stack<string>(RuntimeInfo.InParametersStack.Reverse())));
RuntimeInfo.FunctionCallStack.Push(new FunctionScope(RuntimeInfo.LineNumber, new Stack<string>(RuntimeInfo.InParametersStack)));
RuntimeInfo.InParametersStack.Clear();
if (RuntimeInfo.Functions.TryGetValue(key, out int value))