Actually, these are the new function changes

This commit is contained in:
sam-astro 2022-01-05 08:50:33 -05:00 committed by GitHub
parent ddf09173e4
commit 4fb5500cc3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -573,11 +573,9 @@ int parseSlang(string script)
// First go through entire script and iterate through all types to see if line is a variable
// or function declaration, then store it with it's value
for (int lineNum = 0; lineNum < (int)words.size(); lineNum++)
for (int t = 0; t < (int)types.size(); t++)
if (words[lineNum][0] == types[t])
{
//Checks if it is function
if (words[lineNum][(int)words[lineNum].size() - 1][(int)words[lineNum][(int)words[lineNum].size() - 1].size() - 1] == ')')
if (words[lineNum][0] == "func")
{
vector<vector<string>> functionContents;
@ -609,6 +607,11 @@ int parseSlang(string script)
functionValues[functName] = functionContents;
//cout << functName << " is \n" << Vec2Str(functionContents) << endl << endl;
}
else
for (int t = 0; t < (int)types.size(); t++)
if (words[lineNum][0] == types[t])
{
//Checks if it is variable
else
{
@ -623,6 +626,7 @@ int parseSlang(string script)
//cout << words[lineNum][1] << " is " << words[lineNum][3] << endl;
}
}
}
// Executes main, which is the starting function
ExecuteFunction("Main", vector<any> {"hi", 0});